Posts

Showing posts from September, 2010

javascript - HTML changing images with JS interval -

i have code , need simple action: have 28 images in div , need change every 41ms. i have html: <div class="full_slider"> <img id="bgs_49" style="visibility: visible; display: block; opacity: 1;" src="images/background/10_00049.jpg" class="full_slider_child" alt="bg" /> <img id="bgs_50" src="images/background/10_00050.jpg" class="full_slider_child" alt="bg" /> <img id="bgs_51" src="images/background/10_00051.jpg" class="full_slider_child" alt="bg" /> <img id="bgs_52" src="images/background/10_00052.jpg" class="full_slider_child" alt="bg" /> <img id="bgs_53" src="images/background/10_00053.jpg" class="full_slider_child" alt="bg" /> <img id="bgs_54" src="images/background/10_00054.jpg" class="full_slid

Google Analytics - Why do some of my visits report 0 Pages / Visit? -

i've looking @ google analytics statistics berlin , can see have 1 visit 0 pages / visit. blip in ga software - or problem in code? can't see think how have visited site without visiting 1 of pages. (this uncommon problem, should say. i've noticed , , wondering cause of be.) you have other kind of hits. the types of hits in ga are: pageviews ( _trackpageview ) events ( _trackevent ) social interactions ( _tracksocial ) custom timming ( _tracktimming ) set var ( _setvar ) deprecated ecommerce items ( _additem + _tracktrans ) ecommerce trans ( _addtrans + _tracktrans ) the common _trackevent , check events table , try find out why visits events no pageviews. it can due bad filtering rules. kind of rule filter out pageviews profile not other hit types, causing visits other hit types. if still use old _setvar can see data inside "user defined" report, if that's case, it's time remove these calls , move on.

javascript circle moves around a point -

my element circling around point. jsfiddle html <div class="center-dot"> <div class="dot"></div> <div class="one"></div> <div class="two"></div> </div> css: .center-dot {position:relative;top:200px;left:200px;} .dot {width:3px;height:3px;background:blue;} .one {width:40px;height:40px;border-radius:40px;background:red;position:absolute;} .two {width:40px;height:40px;border-radius:40px;background:green;position:absolute;} js: var 1 = $('.one'), 2 = $('.two'); var one_start = 0, two_start = 0; setinterval(function(){ ++one_start; var one_css = { 'left': math.sin(one_start * 0.0010) * 100 , 'top': math.cos(one_start * 0.0010) * 100 } one.css(one_css); ++two_start; var two_css = { 'left': math.sin(two_start * 0.0025) * 200 , 'top': math.cos(two_start * 0.0025) *

java - Different JRE for Runtime and Compiling in Grails STS environment -

i working on migrating grails app java 6 java 7. in order this, plan continue compile in java 6 , change runtime environment java 7. migrated through environments. after complete build server have upgraded java 7 things start compiling in java 7. the issue having replicating environment on local machine work on issues such incompatible class change error . have set build path point java 6 jdk changed preferences -> java -> compiler 1.6 compliance changed preferences -> java -> installed jres use java 6 jdk. when call system.getproperty("java.class.version") expect receive 50.0 indicating class files compiled java 6. however, receive 51.0 indicating compiling in java 7. what else there need change? right click on project -> properties -> java compiler , uncheck enable project specific settings. if doesn't works go [your grails workspace path]/.metadata.plugins\org.eclipse.debug.core.launches , edit files contain java path spo

mysql - group SQL 2 tables -

i don't know if proper title question, not advanced sql user, know basics :) create table movie (id int(4), title varchar(255)); create table genre (id int(4), mid int(4), genre varchar(200)); insert movie values (1, 'iron man'), (2, 'titanic'); insert genre values (1,1,'sci-fi'), (2,1,'action'), (3,2,'drama'); here have 2 tables, 1 movies , 1 genres. i want create sql this. id | title | genre 1 | iron man | action, sci-fi in table genres mid id of movie movie table .. for movies genre details : select m.id id, m.title title, group_concat(g.genre) genre movie m left outer join genre g on (g.mid = m.id) group m.id see on sqlfiddle

c# - How does waiting on Task.Result affect nested async/await methods? -

this bit long winded, here goes.... given have interface so: public interface iwebclienthelper { tpayload get<tpayload>(string url); } where implementation of get makes call supplied url, return response containing json object of type tpayload ), , json deserialized tpayload , returned. i make implementation of get method asynchronous (or more make http call contained within get method asynchronous), understand it, require signature of get method changed to: task<tpayload> get<tpayload>(string url); i aiming keep interface is, created second interface: public interface iasyncwebclienthelper { task<tpayload> get<tpayload>(string url); } and injected implementation of iwebclienthelper . implementation of iwebclienthelper looks this: public tpayload get<tpayload>(string url) { return _asyncwebclienthelper.get<tpayload>(url).result; } and get method of _asyncwebclienthelper contains line message = await

matplotlib - Change text style midway through a string -

Image
i'm trying figure out how change font style mid way through string. far best way i've come mess horizontalalignment parameter: self.ax.text(0.7, 0.1, 'bold', style='italic', weight='bold', horizontalalignment='right', transform=self.ax.transaxes, size=24) self.ax.text(0.7, 0.1, ' italic', style='italic', horizontalalignment='left', transform=self.ax.transaxes, size=24) but seems ugly, , more importantly it's not robust: suppose want 3 styles, what? isn't there way change style mid way? one option use latex this: fig, ax = subplots() x = linspace(0, 2 * pi, 1000) y = sin(x) ax.plot(x, y) rc('text', usetex=true) ax.annotate(r'$\sin$ wavez \textbf{n}\textit{e}ato', (3, 0.1), size=15)

PHP send a REST message within body and not as multipart -

we have issue php client sending rest / post message. receive message payload attachment, while expect in message content itself. <http:accept>*/*</http:accept> <http:connection>close</http:connection> <http:content-length>385</http:content-length> <http:content-type>multipart/form-data; boundary=----------------------------41eae3cb899c</http:content-type> <http:host>jit</http:host> </tran:headers> while if send request using curl like curl -h "username:xxx" -x post -d '<message />' http://myurl.com it works properly, should ask check? issue content wrong content type, it'd application / xml

python - X-PAYPAL-APPLICATION-ID error -

i'm writing application utilizes paypal's permissions api. i'm working on sandbox. verification code correctly when try getaccesstoken, error: {"responseenvelope":{"timestamp":"2013-09-03t08:32:16.580-07:00","ack":"failure","correlationid":"3527b7033f20f","build":"2210301"},"error":[{"errorid":"560022","domain":"platform","subdomain":"application","severity":"error","category":"application","message":"the x-paypal-application-id header contains invalid value","parameter":["x-paypal-application-id"]}]} i'm using sandbox app_id , verification code gotten dynamically. here code fragment. token = "aaaaaaayaratsvjvkubt" verification = "mgnnwdvffmgaes0q371hug" headers2 = { "x-paypal-security-userid":

c# - Cannot set row to be selected -

i have 1 strange problem , don't have clue how solve it. here is: have 2 forms. first form take row (with index), , data row display in form possibility edit data. time have index of row datagridview in first form. when edit data in second form , press update button, want data applied in same row in first form. here code further info: if (datagridview.selectedrows.count == 0) { messagebox.show("index of row must selected " + rowindex); datagridview.rows[rowindex].selected = true; } now, when form2 closed want check if still have same row selected in first form, , if not, select it. on line .selected = true; error: index out of range. must non-negative , less size of collection. messagebox above line gives me right index of row... example, datgridview have 100 rows , work row index 5. why don't understand why error "index out of range"... why can't select row again?

when using a specific database such as sql server,do we have to install and configure odbc? -

when using specific database such sql server,do have install , configure odbc? and other question why cant thrift/avro/rest/protobuf used rdbms,they services,why used nosql dbs? reading professional nosql book,and there list of different nosql db access methods,and listed nosql db access methods,but when googled them saw services serializing datas , on(each of them sth). thanks in advance. these multiple questions here. (1) no, sql server accessed best via sql native client, ado/mdac/ole-db. performance-wise odbc not recommended @ all, although still may viable option in cases. (2) thrift rpc-mechanism, has nothing db in general. different aspect. however, thrift can of course used, , in fact used nosql database apache cassandra i'd recommend first find out kind of db suitable use case: may typical sql database, or may classical isam or cassandra, couchdb or mongodb. once know that, you'll surely find out how conect db of choice - or ask question :-).

ios - UIBarButton Title Only Shows Periodically -

i'm adding uitoolbar uiviewcontroller programmatically. the problem have when view created buttons in toolbar "do" show not show title text. if wait 10 - 20 seconds or longer titles show. i tried calling setneedsdisplay , setneedslayout force ui yo update straight doesnt work. am doing ridiculous? can't life of me figure out why title don't show immediately. -(id)initwithframe:(cgrect)frame { self= [super init]; if (self) { uiview *view=[[uiview alloc]initwithframe:frame]; self.view=view; cellloader = [uinib nibwithnibname:cellclassname bundle:[nsbundle mainbundle]] ; self.tableview=[[uitableview alloc]initwithframe:cgrectmake(self.view.frame.origin.x, self.view.frame.origin.y+44, self.view.frame.size.width,

.htaccess - Symfony2 assetic cssrewrite with mod_rewrite on app.php giving incorrect basepath -

when using cssrewrite getting incorrect paths. works fine when using app_dev.php or app.php in url , example, mysite.com/site/app.php/login correctly function. however, using mysite.com/site/login not work. when viewing css files see following while accessing mysite.com/site/app.php/login : src: url('../../bundles/acmetest/font/fontawesome-webfont.eot?#iefix&v=3.2.1') the correct path when viewing mysite.com/site/login should be: src: url('../bundles/acmetest/font/fontawesome-webfont.eot?#iefix&v=3.2.1') here htaccess file: directoryindex app.php <ifmodule mod_rewrite.c> rewriteengine on rewritecond %{request_uri}::$1 ^(/.+)/(.*)::\2$ rewriterule ^(.*) - [e=base:%1] rewritecond %{env:redirect_status} ^$ rewriterule ^app\.php(/(.*)|$) %{env:base}/$2 [r=301,l] rewritecond %{request_filename} -f rewriterule .? - [l] rewriterule .? %{env:base}/app.php [l] </ifmodule> <ifmodule !mod_rewrite.c>

javascript - Why use $http in Angular instead of jquery's ajax? -

i don't understand when use angular on jquery ajax requests. for example, why should use: function itemlistctrl ($scope, $http) { $http.get(‘example.com/items').success(function (data) { $scope.items = data; } } instead of function itemlistctrl ($scope) { $.ajax({type: "get", url: 'example.com/items', success: function (result) { $scope.items = data; } }); } ?? my understanding there couple reasons first preferred: $http testable. it's possible stub out backend uses , test $http requests without actually sending requests. $http common "stuff" you, such setting content type 'application/json' on post requests. $http returns "promise" similar other areas in angular, means .success, .done consistent angular. jquery allows similar, syntax different. $http success , error callbacks execute inside of

confused using Jquery in Asp.net (User control) -

currently working in page has 3 usercontrols. need put loading image when search in 1 user control used code below: the div in html: <div class="loading"> <img src="../images/loading/466.gif" title="cargando" alt="cargando" class="load" /> </div> the jquery (i found in google, before saw lot of examples, don't know if use settimeout this) function showprogress() { var table = $("#table"); table.css("opacity", ".2"); settimeout(function () { var modal = $('<div />'); modal.addclass("modal"); $('table').append(modal); var loading = $(".loading"); loading.show(); var top = math.max($(window).height() / 2 - loading[0].offsetheight / 2, 0); var left = math.max($(window).width() / 2 - loading[0].offsetwidth / 2, 0); loading.css({ top: top, left: left } );

javascript - AngularJS Custom Directive shows {{obj}} but not {{obj.prop}}? -

i'm trying build simple angular directive: app.directive("mydirective", function () { return { template: "{{result}} {{result.starttime}}", scope: { result: '@result' } }; }); and use way in view: <div my-directive result="{{result}}"></div> the problem {{result}} displayed correctly (as json) abject, while {{result.starttime}} not displayed, despite fact displayed {{result}} contains starttime property. 2 problems: 1 need pass model in, not interpolated string. <div my-directive result="result"></div> 2 need assign value directive, use '=' instead of '@' gives 1-way binding directive dom only. app.directive("mydirective", function () { return { template: "{{result}}, {{result.starttime}}", scope: { result: '=' } }; }); working demo

Excel 2010 Import Issues With Time from an embedded query via Access 2010 -

i have question concerning excel 2010. upgraded win7 , microsoft 2010 office platform. have active embedded query within excel pull time interval access, assist in creating particular chart. data gathered odbc connections working in access, because when go access db time data in correct format. when brought excel 2010 time format showing 12:00 (0) intervals. various searches in google , such have turned nothing. when re-ran on previous versions of excel working correctly. any assistance appreciated. thanks...

javascript - jqXHR object removes itself and container from an array -

i storing jquery ajax objects inside array can manually cancel call,if has not returned, based on user triggered events. these ajax calls expect run long. javascript var ajaxcalls = []; ajaxcalls[0] = $.ajax({...}); $("#cancelbutton").on("click", function() { ajaxcalls[0].abort(); }); the problem exists jqxhr object disappears array after abort() method called. now looks great when comes managing memory of objects magically removing , cleaning nicely. however, leaves anti-pattern in code looks not cleaning after myself. defeats purpose of me creating remove companion method add method. is there reason this? if array contains more 1 object re-sizes appropriately. this array if letters jqxhr objects ['a', 'b', 'c', 'd'] becomes array when jqxhr object 'b' completes ['a', 'c', 'd'] reading code, 1 expect occur ['a', null/undefined, 'c', 'd'] why? edit:

Access sharepoint list from web site hosted externally from sharepoint -

i'm developing web application externally sharepoint online 2010. part of application allow users access documents document library. ideally users click on option, query library documents, , return json object each object satisfying query display links in webpage. i've been looking way in website hosted externally sharepoint 2010, have been unable find resources describing how load ecma script api , connect sharepoint site. know can find information? thank help! you have several ways achieve this. out of box option using queries (from server code or ajax) list svc. in case don't know, lists have associated service pull information. http://msdn.microsoft.com/en-us/library/hh134614(v=office.14).aspx http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2010/01/21/introduction-to-querying-lists-with-rest-and-listdata-svc-in-sharepoint-2010.aspx there wonderful js library @ codeplex, spservices, helps query sharepoint. list (sample code taken code

c++ - Writing video with openCV - no key frame set for track 0 -

i'm trying modify , write video using opencv 2.4.6.1 using following code: cv::videocapture capture( video_filename ); // check if capture object initialized if ( !capture.isopened() ) { printf( "failed load video, exiting.\n" ); return -1; } cv::mat frame, cropped_img; cv::rect roi( offset_x, offset_y, width, height ); int fourcc = static_cast<int>(capture.get(cv_cap_prop_fourcc)); double fps = 30; cv::size frame_size( radius, (int) 2*pi*radius ); video_filename = "test.avi"; cv::videowriter writer( video_filename, fourcc, fps, frame_size ); if ( !writer.isopened() && save ) { printf("failed initialize video writer, unable save video!\n"); } while(true) { if ( !capture.read(frame) ) { printf("failed read next frame, exiting.\n"); break; } // select region of interest i

xml - Returning nodeset based on two other nodes being equal -

i trying return specific nodeset based on value of 1 node = node. the expression //*[local-name()='jms-listener']/@busidref=//*[local-name()='jms-bus']/@busid returns boolean from <providers> <jms-provider name="jbossmq" connection-factory="connectionfactory"> <jms-bus busid="quickstartgwchannel"> <jms-message-filter dest-type="queue" dest-name="queue/quickstart_helloworld_request_gw" /> </jms-bus> <jms-bus busid="quickstartesbchannel"> <jms-message-filter dest-type="queue" dest-name="queue/quickstart_helloworld_request_esb" /> </jms-bus> </jms-provider> </providers> <services> <service category="firstserviceesb&q

python 2.7 - How to use a for loop in Scrapy? -

i using scrapy project, in project extracting information xml. in xml document format implement loop: <relatedpersonslist> <relatedpersoninfo>...</relatedpersoninfo> <relatedpersoninfo> <relatedpersonname> <firstname>mark</firstname> <middlename>e.</middlename> <lastname>lucas</lastname> </relatedpersonname> <relatedpersonaddress> <street1>1 imation way</street1> <city>oakdale</city> <stateorcountry>mn</stateorcountry> <stateorcountrydescription>minnesota</stateorcountrydescription> <zipcode>55128</zipcode> </relatedpersonaddress> <relatedpersonrelationshiplist> <relationship>executive officer</relationship> <relationship>director</relationship&

jquery - Remove certain elements from map in Javascript -

how can remove key/value pairs following map, key starts x . var map = new object(); map[xkey1] = "value1"; map[xkey2] = "value2"; map[ykey3] = "value3"; map[ykey4] = "value4"; edit is there way through regular expression, using ^ . map[^xke], key starts 'xke' instead of 'x' you can iterate on map keys using object.key . the simple solution : demo here object.keys(map).foreach(function (key) { if(key.match('^'+letter)) delete obj[key]; }); so here other version of removekeystartswith regular expression said: function removekeystartswith(obj, letter) { object.keys(obj).foreach(function (key) { //if(key[0]==letter) delete obj[key];////without regex if(key.match('^'+letter)) delete obj[key];//with regex }); } var map = new object(); map['xkey1'] = "value1"; map['xkey2'] = "value2"; map['ykey3'] = "value3"; map

slim - Empty variable output using Twig -

i have slim/paris/twig application , have strange problem output. this code: the title: {{ share.title }} the output nothing. but if use: the title {{ share.title | lower }} the output is: the title first title {{ share.title | raw }} works too, don't want use because shows accented characteres weird characters. any idea how solve ? thanks

java - Separate JSON string into variable in android -

i'm trying divide json string individual strings of each contact item such emailaddress & phone number. i'm using system.out.print see if information being stored in strings should. nothing showing in system.out , happens see below in logcat. json string: {"items":[{"description":"payment confirmed","emailaddress":"abc@aqw.com","id":"fri aug 30 17:20:35 edt 2013","namefirst":"bill","namelast":"sanders","phone":"5555555555","state":"ks","streetaddress":"123 rick dr","zipcode":"44444","kind":"contactinfoendpoint#resourcesitem"},{"description":"payment confirmed","emailaddress":"qwe@msn.com","id":"fri aug 30 17:21:37 edt 2013","namefirst":"frank","namelast":"lloyd"

ruby on rails - Errno::ECONNREFUSED in UsersController#create -

my application proceeded register. after input information receive error page saying: errno::econnrefused in userscontroller#create connection refused - {:data=>"<?xml version=\"1.0\" encoding=\"utf-8\"?><add><doc><field name=\"id\">user 1</field><field name=\"type\">user</field><field name=\"type\">activerecord::base</field><field name=\"class_name\">user</field><field name=\"username_text\">mikeadeleke</field><field name=\"bio_text\">founder of edopter</field></doc></add>", :headers=>{"content-type"=>"text/xml"}, :method=>:post, :params=>{:wt=>:ruby}, :query=>"wt=ruby", :path=>"update", :uri=>#<uri::http:0x007fb6c3c911d0 url:http://localhost:8982/solr/update?wt=ruby>, :open_timeout=>nil, :read_timeout=>nil, :r

android - How to show an alert dialog without activity background -

i creating notification using below code. notificationmanager nm = (notificationmanager)getsystemservice(context.notification_service); notification notification = new notification(r.drawable.ic_launcher, "don't forget", system.currenttimemillis()); notification.defaults|=notification.default_sound; notification.defaults|=notification.default_lights; notification.defaults|=notification.default_vibrate; intent intent2 = new intent(create_notification.this,after_alarm.class); intent2.putextra("arr", arr); pendingintent pintent = pendingintent.getactivity(create_notification.this, 0,intent2 ,0 ); nm.notify(i, notification); i want show string on alert dialog after clicking on notifiction.for doing created alert dialog in oncreate() of activity(i.e after_alarm activity) showing background of after_alarm activity , alert dialog on it.i want show alert dialog.is way make activity visible alert dia

In Ruby is it possible to create a local variable explicitly -

e.g. x = 123 p = proc.new { x = 'i not want change value of outer x, want create local x' } in ruby there same "my" keyword in perl ? as per perl documentation of my ,i think looking below in ruby:- x = 123 p = proc.new {|;x| x = 'i not want change value of outer x, want create local x' } p.call # => "i not want change value of outer x, want create local x" x # => 123

arrays - PHP - Multiple instances of script accessing same resources -

i have analyze lot of information. speed things i'll running multiple instances of same script @ same moment. however there big chance scripts analyze same piece of information(duplicate) not slow down process. if running 1 instance solve problem array(i save has been analyzed). so have question how somehow sync array other "threads" ? mysql option guess overkill? read memory sharing not sure if solution looking for. so if has suggestions let me know. regards this trivial task using real multi-threading: <?php /* want logs readable creating mutex output */ define ("log", mutex::create()); /* thread safe printf */ function slog($message, $format = null) { $format = func_get_args(); if ($format) { $message = array_shift($format); if ($message) { mutex::lock(log); echo vsprintf( $message, $format); mutex::unlock(log); } } } /* pthreads descendant

c# - Why XmlSerializer adding garbage value to end tag of the root element? -

i trying write value xml values using xmlserializer , below code. code called on selection change of dropdown list. first time works fine second selection change event inserts garbage value xml shown below. protected void updatedefaultreasonconfig(object sender, eventargs e) { string configfile = configurationsettings.appsettings["defaultoutagereasonconfig"]; defaultoutagereason defaultoutagereason = new defaultoutagereason(); defaultoutagereason.outagereason = this._defaultoutagereason.text; xmlserializer writer = new xmlserializer(typeof(defaultoutagereason)); using (filestream write = file.openwrite(configfile)) { writer.serialize(write, defaultoutagereason); } } and resulting xml is: <?xml version="1.0"?> <defaultoutagereason xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:xsd="http://www.w3.org/2001/xmlschema"> <outagereason>

Select the largest number from MYSQL Table with added Prefix -

i have table unfortunately, can't alter in way , have work have. the mysql table has field labeled, "customer_id". has 2 prefixed letters 4-value numerical number. ex: bi8392 he8492 wo1293 how can select largest numerical value prefix? example, assume wanted select largest number prefix of he. how can select value? any absolutely appreciated. i've been stuck while now. since values left padded can do select right(max(customer_id), 4) max_val table1 customer_id 'he%' make sure have index on customer_id based on name of column. like use it. here sqlfiddle demo

java - Using ZeroClipboard with GWT -

i'm trying use zeroclipboard project, seems samples provided " copy to " clipboard, need other way around "copy from" method. anyone can share code ideas on how implement this? code: public static native string getpastedtext()/*-{ var clip = new $wnd.zeroclipboard.client(); }-*/; you can't using default browser installation. , security requirement. if possible, can imagine how data stoled using javascript?

How to get the job name on a groovy dynamic parameter in Jenkins -

i need name job in example, have code previous value of build parameter code jenkins.model.jenkins.instance.getitem("nameofjob").lastbuild.getbuildvariables().get("nameofparameter"); the name of job hard coded, need name name of current job, how can't do? thank you groovy dynamic parameters not have access usual environment variables rest of jenkins job privy to. here working hack job name: def build = thread.currentthread().tostring() def regexp= ".+?/job/([^/]+)/.*" def match = build =~ regexp def jobname = match[0][1]

machine learning - Concerns related to matlab neural network toolbox -

i have concerns related use of nntool in matlab toolbox. following links these simple linear neural network weights training , not compatable training results, cant understand why , have found nntool default normalizes inputs range [-1 1]. bit concerned, created neural network tansig activation in first layer , logsig activation in output layer. manually normalized outputs range of [0 1] in data , fed nntool. question nntool further normalizes range [-1 1]. if not correct, output of logsig cannot in range of [-1 1]. any suggestions? i not matlab user, if don't want use normalization , forced on both input , output - denormalize output. assume, simple linear normalization (squashing [-1,1] interval), if want output in [0,1] interval can apply f(x) = (x+1)/2 linearly maps [-1,1] [0,1] . neural networks scale sensitive (as correlated non-tunable parameters activation functions slopes), internal normalization has advantages. should work, if normalization applied afte

yii - Saving Many-to-Many Relationships with TokenInput -

help me, oh mighty hive mind. you're hope. i have been working on small app work i'm building around database (go figure). while have managed save relationship data more manually iterating through data, creating new model each, , saving information, know there must cleaner way this: foreach($keys $k) { //build model associate keyword $k $facts_keyword=new factskeyword; $facts_keyword['fact_id']=$model->id; $facts_keyword['keyword_id']=$k; if(!$facts_keyword->save()) //check errors on saving echo "failure save facts_keywords"; } to make work, have made model reference table between tables facts , keywords . reference table has 2 columns facts_id , keywords_id . using tokeninput plugin yii input keywords associated given fact. relevant view code here: <div id="keywords" class="row"> <?php echo $form->labelex($keyword,'keywords'); ?> <?php $this->widget('ext.tokeninput.

c# - How To Copy .NET User Settings During EXE Upgrade -

i working on application uses .net user settings manage application preferences. have noticed if add new user setting , update customer's executable, preferences (i.e. user settings) lost. there way ensure these settings copied without running upgrade or conversion program perform update? right now, our code base volatile , updating executables , dll files.

android - Search Contact By Name -

i trying create custom contact app displays contacts have contact number . first of all, there automated way it? suppose not, trying search contact name e.g. rohan . here code :- cursor photocursor = getcontentresolver().query( android.provider.contactscontract.contacts.content_uri, new string[] { contactscontract.contacts.photo_id, contactscontract.contacts.display_name }, contactscontract.contacts.display_name + " = ?", new string[]{"rohan"}, null); photocursor.movetofirst(); while (photocursor.movetonext()) { log.d("photo thumbnail", "" + photocursor.getstring(1)); } although contact exists, not getting log, if remove selection & selection args see rohan in log. doing wrong? try this: cursor contactlookupcursor = getcontentresolver().query( uri.withappendedpath(phonelookup.content_filter_uri,

Unable to run calabash-ios + rspec tests with the updated Gem versions -

i created few calabash-ios tests using rspec in rubymine ide on mac mini worked great; however moved imac , had configure , install ruby , necessary gems. however, time not execute tests due following error , i'm stuck. (copied error message below) best guess related difference in version of gems on both machines. did version comparison in detail, observed quite few differences.. listing here ones think relevant error: (and unfortunately, not able install older version of gems (on imac) not exists anymore, instead updated versions) listed tge versions in form of gem name = version on oldmachine && version on newmachine cfpropertylist = 2.2.0 && 2.2.1 httpclient = 2.3.3 && 2.3.4.1 rspec = 2.14.1, 2.9.0.rc2 && 2.14.1 rspec-core = 2.14.4, 2.14.3, 2.9.0.rc2 && 2.14.5 rspec-expectations = 2.14.1, 2.14.0, 2.9.0.rc2 && 2.14.2 rspec-mocks = 2.14.3, 2.14.2, 2.14.1,2.9.0.rc2 && 2.14.3 rubygems-update =

c++ - Fusion vector projection -

i have fusion vector elements have several member data of different types , create new fusion vector(s) project specific data member(s). i've been looking time no progress. #include <iostream> #include <string> #include <boost/fusion/adapted/boost_tuple.hpp> #include <boost/fusion/include/fold.hpp> #include <boost/fusion/include/sequence.hpp> #include <boost/fusion/algorithm.hpp> #include <boost/spirit/include/phoenix.hpp> #include <boost/fusion/include/make_vector.hpp> #include <boost/bind.hpp> namespace phx = boost::phoenix; namespace fusion = boost::fusion; using namespace phx::arg_names; struct mprint { template<typename t> void operator()(t& t) const { std::cout << t << std::endl; } }; struct tstruct { std::string val1_; double val2_; int val3_; bool val4_; tstruct( const std::string &val1, double val2, int val3, bool val4

delphi - How to avoid getting an error 10053 (WSAECONNABORTED) if a HttpGet operation in Android is lasting too long? -

i have android application communicating delphi 2006 web service application using indy 10 tidhttpserver (coming delphi 2006). delphi application generates big xml file , serves this. xml generation may last more 5 minutes. if duration of generatexml() more 5 minutes (*), detect error 10053 in tidhttpresponseinfo.writecontent if running in delphi ide: socket error # 10053 software caused connection abort. however, on android side nothing detected , httpget -call lasts forever. my questions are: 1.) why error 10053 , how can avoid it? seems android times out connection, http.socket.timeout set infinite. and 2.) can detect such error on client side (other setting timeout, have big useful)? can in tidhttpserver.onexception? here code. android - download function, run inside asynctask: protected static httpentity downloadentity(string url) throws ioexception { httpclient client = new defaulthttpclient(); //check because of error 10053: timeout null ->