Posts

Showing posts from February, 2013

local storage - What causes a jQuery cookie function to work ok when tested 'locally' but then has an error when tested live at hosting site -

local storage - What causes a jQuery cookie function to work ok when tested 'locally' but then has an error when tested live at hosting site - i have searched through several previous questions, , have not seen similar bug & resolution. here goes. i using several jquery plugins, 2 of jquery cookie plugin , localstorage plugin chrome browsers. building , testing locally, appears fine, cookie , storage wise. then .js library crashes when few errors detected browser when loaded on live server. code: $(function (){ if( $.cookie('cookie_1') == 'visit_1' ){ $('#id1').dosomething(); $('#id2').dosomething(); } else if( $.sessionstorage('chromecookie_1') == 'chromevisit_1' ){ $('#id1').dosomething(); $('#id2').dosomething(); } else{return false;} }); i have several of these dual cookie type functions navigation etc. in inspectors in ff , chro...

cuda - GPU Compute on Android? -

cuda - GPU Compute on Android? - how programme existing gpu architectures on android. , there possibility in near future android supported cuda perhaps maybe through android-based dev kit jetson tk1. i've read renderscript think tailored more image processing. i'm planning on doing simulations instead. there way can these simulations on android platform. i don't see much opportunities develop cuda apps android except developing devices employ cuda enabled gpu such tegra k1, illustration of such device nvidia shield. can grab tegra android development pack , start development right away. android cuda gpu

ruby on rails - Render form partial from view ROR -

ruby on rails - Render form partial from view ROR - im trying render form controller in view. this posts_index, , render post.comments works fine, form new comment doesnt. <% @posts.each |post| %> <%= link_to post.title, post %> <%= simple_format post.text %> <%= render post.comments.order('created_at desc').all %> <%= render :partial => '/comments/form', locals: {post: post} %> i error: undefined method `comments' nil:nilclass the comments form: <%= form_for([@post, @post.comments.build]) |f| %> <%= f.label :comment %><br /> <%= f.text_area :body, :class => "comment_text_box" %> <%= f.submit %> <% end %> i understand need pass post.comments form, can't figure out how. post_show works <%= render "comments/form" %> post , comments has_many relationship, posts has_many comments. thanks looking. you need pas...

c - I'm at a loss at finding the segfault in my program -

c - I'm at a loss at finding the segfault in my program - so i've been spending hours trying find source of segmentation fault 11 error, , hoping if guys can help me out. so purpose of programme find redirection in input string, , homecoming redircode struct gives direction of redirection, filename, , argswithoutfile. example input: "ls -a > test.txt" returns redir code with: argswithoutfile = "ls -a" filename = "test.txt" code = 2 //stdout i'm pretty sure seg fault coming trying substrings. loop seems fine, because when comment out substring stuff @ end doesn't give segfault. seems fine me except substring. substring want this: char *input = "ls -a > test.txt' char *desiredsubstring = "ls -a " here code in entirety: #include <stdio.h> #include <string.h> #define buffer 1024 struct redircode findredirects(char *input); struct redircode { /* c...

c - Accordance of linkage between declaration and definition -

c - Accordance of linkage between declaration and definition - i wondering if c snippet below, in definition of f fails repeat f of static linkage, correct: static int f(int); int f(int x) { homecoming x; } clang not emit warning it. read clause 6.7.1 of c11 standard without finding reply question. it possible imagine more questions along same vein, instance t1.c , t2.c below, , nice if reply general plenty apply of these, concerned first illustration above. ~ $ cat t1.c static int f(int); int f(int); int f(int x) { homecoming x; } ~ $ clang -c -std=c99 -pedantic t1.c ~ $ nm t1.o warning: /applications/xcode.app/…/bin/nm: no name list ~ $ cat t2.c int f(int); static int f(int); int f(int x) { homecoming x; } ~ $ clang -c -std=c99 -pedantic t2.c t2.c:3:12: error: static declaration of 'f' follows non-static declaration static int f(int); ^ t2.c:1:5: note: previous declaration here int f(int); ^ 1 error generated. the rules l...

java - Tree from tree paths -

java - Tree from tree paths - in project have lot of data, can structured in way. simplify, let's pretend that info bunch of file paths: /user/homefolder/folder1/file1.jpg /user/homefolder/folder1/file2.jpg /user/homefolder/folder2/file3.jpg /user/homefolder/folder2/file4.jpg /user/homefolder/folder3/file5.jpg so, have tree-paths , can grouping these paths first 3 folders or more if there are. i have values in array of arrays. , don't want create duplicate tree-model. i utilize jface treeviewer in swt.virtual style , ilazytreecontentprovider doesn't seem made work kind of data. how should able create proper tree? have at https://github.com/johandb/jtree you can implement own node example tree<string> root = new tree<string>(); tree<string> folder1 = root.add("folder1"); folder1.add("file1.jpg"); folder1.add("file2.jpg"); tree<string> folder2 = root.add("folder2"); folder2.a...

python - Google plus api "Resource object has no attribute 'insert' " -

python - Google plus api "Resource object has no attribute 'insert' " - following directions found on google developers here when seek add together activity (a post) python error "resource object has no attribute 'insert' " but when here (at api docs) there's insert method under activities() this problem code result = service.activities().insert( userid=user_id, body={ 'object': { #'orginalcontent': content }, 'access': { 'items': [{ 'type': 'domain' }], 'domainrestricted': true } }).execute() i handled authentication stuff before of course, code above taken google's illustration , have proper scope(s) included, can...

What is the runtime complexity if T(n)= n*T(n-1)? -

What is the runtime complexity if T(n)= n*T(n-1)? - should utilize tree solve ? or there easiest way solve it? think n! right? thank you. using recurrence relations, may this: runtime asymptotic-complexity

javascript - Bing Maps API request returning Uncaught SyntaxError: Unexpected token : -

javascript - Bing Maps API request returning Uncaught SyntaxError: Unexpected token : - i'm getting error uncaught syntaxerror: unexpected token : (dev.virtualearth.net/:1) here javascript. function getlocation() { if (navigator.geolocation) { navigator.geolocation.getcurrentposition(showposition); } else { alert("geolocation not supported browswer or not enabled."); } } function showposition(position) { $.ajax({ url: 'http://dev.virtualearth.net/rest/v1/locations/', datatype: 'jsonp', data: { q: position.coords.latitude + ',' + position.coords.longitude, key: '***' } }).then(function(data) { //alert("latitude: " + position.coords.latitude + "<br /> longitude: " + position.coords.longitude + //"<br /> province: " + data.resourcesets.resources[0].address.locality); console.lo...

Replacing double quotes with html quote tags for a given string in C# -

Replacing double quotes with html quote tags for a given string in C# - given c# string like: var str = "this string \"contains\" double quotes."; i'd transform to: var str = "this string <q>contains</q> double quotes."; i've got solution loops through , string.replaces double quotes <q> loop through , create every other <q> closing </q> tag. have feeling there's improve way or more understandable way though. i utilize regex var str = "this string \"contains\" double \"aaaaa\"quotes."; var str2 = regex.replace(str,@"""(.+?)""", m => "<b>" + m.groups[1].value + "</b>"); c# html string

c# - LINQ On DbContext.Set() -

c# - LINQ On DbContext.Set() - so, trying dbset returned entity name (string). how far have gotten: var customers = db.set(type.gettype("app.model.customer, app.model, version=1.0.0.0, culture=neutral, publickeytoken=null")); but cannot perform other linq any() or single() . why , how can alter so? the non-generic overload of dbcontext.set returns as non-generic dbset . 1 of interfaces class implements iqueryable , again, non generic. that's reason why can't serve input of these linq extension method defined on generic type iqueryable<t> . so in fact, if still want utilize linq, postpone moment when have convert generic iqueryable . could do... var customers = db.set(type.gettype(...)).cast<customer>().where(c => ...) ...but of course of study lose whole point of definin...

Input::get() inside update query in laravel -

Input::get() inside update query in laravel - how can utilize input info in database update query? ok utilize ,the next statement? db::update('update doc set availability= 0 doctorid= input::get('doctorid'); capture input in variable first, concatenate sql statement. laravel

jquery - The property 'unobtrusive' does not exist on value of type 'Validator' -

jquery - The property 'unobtrusive' does not exist on value of type 'Validator' - i ugly error using typescript jquery validation. property 'unobtrusive' not exist on value of type 'validator' have jquery typescript d.ts file , jquery validation d.ts file. there d.ts file need? thanks the jquery validation library doesn't have property named unobtrusive . couldn't find 1 in documentation , there isn't 1 in definition file: https://github.com/borisyankov/definitelytyped/blob/master/jquery.validation/jquery.validation.d.ts therefore think using other plugin or library... either need find type definition or write one. for example, if utilize this: $.unobtrusive('...').text('hello world); you extend jquery interface so: interface jquerystatic { unobtrusive(ar: string): jquery; } jquery validation typescript

javascript - addEventListener working in firefox but not in chrome -

javascript - addEventListener working in firefox but not in chrome - the given code works in mozilla firefox 31.0 not in google chrome 38.0.2125.104 how can issue solved? please note : using change() function or jquery not alternative here! <body> <select id="category"> <option value="movies">movies</option> <option value="artist">artists</option> <option value="authors">authors</option> <option value="chemistry">chemistry</option> </select> </body> <script> window.onload = initialise; function initialise() { var options = document.getelementsbytagname('option'); (var = 0; < options.length; i++) { options[i].addeventlistener("click", getquestion, false); //console.log(i); } } function getquestion() { console.log("getting question.."); } </scr...

javascript - undefined value; include var value into table cell -

javascript - undefined value; include var value into table cell - function statechanged() { if (xmlhttp.readystate == 4 || xmlhttp.readystate == "complete") { var showdata = xmlhttp.responsetext; // var showdata = "test\ntest2" var res = showdata.split(","); var html = ' <table border="1" width="80%" class ="bordered"> <tr><th></th><th>taught by</th></tr>'; (var = 0; < res.length - 1; i++) { // window.alert("value gotten " + res[i]); var test = res[i]; // document.cookie= "teacher"= test; // html += '<tr><td><input type="radio" name="vlist" value="'+ "122222" + '"><br></td><td>' + test + '</td></tr>'; html += '<tr><td><input ty...

mySQL and PHP login page problems -

mySQL and PHP login page problems - i have been trying create login form. mysql right , connecting database, log in details there , right when inputting error php , message log in details wrong. i'm new php/mysql don't know doing wrong! code page connects database. error php: warning: mysql_num_rows() expects parameter 1 resource, null given in /home/bluecode/public_html/intranet/checklogin.php on line 22 the variables form myusername , mypassword. thanks :) <?php // username , password sent form $username=stripslashes($_post['myusername']); $password=sha1(stripslashes($_post['mypassword'])); $host="localhost"; // host name $username="bluecode_power"; // mysql username $password="bluecode123"; // mysql password $db_name="bluecode_login"; // database name $tbl_name="members"; // table name // connect server , select databse. mysql_connect("$id", "$username", ...

FileMaker Pro: -

FileMaker Pro: <no values defined> - so im working on hardware inventory , have problem relationships. in "item_view" layout select type , brand corresponds unique type ( i.e. if select type "smartphone" should show me brands smartphones ). attribute "type" defined in own table ( seen in image below ), such brand ( model , designation there too, i've tried type-brand thing first - "testing db" ). my problem if seek access "type" table in "item_view" layout, can select type not related brand ( ). made "pop-up menu" in "item_brand" field , gave him values "brand::brand" "include related values starting from: type" ( "typ", thats high german type - ignore ). i think should work, i't doesn't. need help. thx. if connect item_view table occurrence typ table occurrence via relationship: item_view::item_typ = typ::typ_id which this: ...

ios - Adding dictionaries to Plist programmatically -

ios - Adding dictionaries to Plist programmatically - i trying add together dictionary plist programmatically in next format: root(dict) | stringofviewid(dict) | buttontitle(dict) | string string i can want maintain adding viewid(dict) more buttontitle(dict) under same viewid(dict). so far can replace existing. something this: root(dict) | stringofviewid(dict) - buttontitle(dict)(2)-string string | buttontitle(dict)(1) | string string here code i'm using: //initialize , load plist file here: [...] nsmutabledictionary *data; nsmutabledictionary *viewid; nsmutabledictionary *buttonname; nsarray *keys; nsarray *locations; // insert info plist nsnumber *xnumber = [[nsnumber alloc] initwithdouble:locationx]; nsnumber *ynumber = [[nsnumber alloc] initwithdouble:locationy]; keys = [nsarray arraywithobjects:@"locationx", @"locationy", nil]; l...

c# - How to combine and retrieve multiple columns from two tables in a Dataset -

c# - How to combine and retrieve multiple columns from two tables in a Dataset - i have dataset 2 tables connected reference (loop_id) table1 column1 column2 loop_id 1 itemcode_aaa 6 2 itemcode_bbb 8 table2 column1 loop_id 2014-sep-09 6 2014-nov-09 8 how retrieve columns, except loop_id both tables single table. resulting table should appear like t1_column1 t1_column2 t2_column1 1 itemcode_aaa 2014-sep-09 2 itemcode_bbb 2014-nov-09 i using net framework 4.5 use linq datasets: to enumerate table, phone call asenumerable . datatable table1 = ds.tables["table1"]; datatable table2 = ds.tables["table2"]; var records = (from t1 in table1.asenumerable() bring together t2 in table2.asenumerable() on t1.field<int>("loop_id") equals t2.field<int>("loop_id") select new {t1_column1 = t1...

c# - How can I take a parameter or call a function which is declared in other braces? -

c# - How can I take a parameter or call a function which is declared in other braces? - i'm beginner in c# , having great difficulty figure our issues. hope terminology not matter. here question. let's have next code: namespace windowsformsapplication8 { public partial class form1 : form { public form1() { initializecomponent(); //code starts //... //if(...) { //... //string parameter = abc.tostring(); //} //code ends }//form1 ends private void button1_click(object sender, eventargs e) { //code here } private void button2_click(object sender, eventargs e) { textbox1.text = parameter; button1.perform(); } } } i have difficulties here. how can utilize string declared in form1 called parameter within button2_click ? textbox1.text = parameter; do...

osx - Enabling https ssl wordpress plugin, some css stylesheets don't load on the first try. Issue happens only on a Mac -

osx - Enabling https ssl wordpress plugin, some css stylesheets don't load on the first try. Issue happens only on a Mac - i have issue has been bothering me month. wordpress site, installed popular https plugin. converted url's in database , in php files utilize https. now when load page in chrome on mac, styleesheets don't load on first try. says net::err connection refused. this issue never appears in ie8-11 in windows. links connection refused show link using https, file permissions stylesheets in question set permission 644. directories containing them 755. i can wordpress admin fine using https , site uses wordpress functions is_user_logged_in. when disable/deactivate https wordpress plugin, issue disappears , loads fine. on mac, when issue happens, loads on first try, on second, takes 3 reloads page load images/css. i've disabled firewall on mac. thanks help. ok, fixed it, seems host (hostgator) problem load balancer/reverse proxy...

Handling a specific route with ASP.NET MVC -

Handling a specific route with ASP.NET MVC - i have asp.net mvc 4 app users beingness directed links in email. users visiting 1 of next links: http://my-site.com/view-name http://my-site.com/#/view-name the difference between 2 add-on of '#'. need both of these urls homecoming same view. how do in asp.net mvc 4. one-off situation. reason, i'm trying figure out quickest solution. thank much help! you can have multiple routes patterns in route config file. routes.maproute( name: "defaultroute1", url: "{controller}/{action}/{id}", defaults: new { controller = "home", action = "index", id = urlparameter.optional } ); routes.maproute( name: "defaultroute2", url: "{controller}/#/{action}/{id}", defaults: new { controller = "home", action = "index", id = urlparameter.optional } );...

How to call an Objective C method in Swift that requires a runtime class as a parameter -

How to call an Objective C method in Swift that requires a runtime class as a parameter - i started programming in swift 2 weeks , still have objective c classes utilize in app. 1 illustration calling method swift: + (void)transitionfromthisvcclass:(class<someprotocol>)afromvcclass tothisclassvcclass:(class<someprotocol>)atovcclass withnavigationcontroller:(uinavigationcontroller *)anav withduration:(nstimeinterval)aduration my problem can't find way pass in class type have done in objective c [someclass class]. help much appreciated. thanks update if i'm trying utilize myclass.self so: asfsharedviewtransition.addtransitionwithfromviewcontrollerclass( recommendationlistviewcontroller.self, toviewcontrollerclass: recommendationviewcontroller.self, withnavigationcontroller: self.window?.rootviewcontroller, withduration: 0.3) asfsharedviewtransi...

Merge 2 regex patterns -

Merge 2 regex patterns - i have text file contains (this on excerpt): third doc season 7 051 spearhead space 4 3—24 jan 1970 052 doc , silurians 7 31 january—14 march 1970 053 ambassadors of death 7 21 march—2 may 1970 054 inferno 7 9 may—20 june 1970 season 8 055 terror of autons 4 2—23 jan 1971 056 mind of evil 6 30 january—6 march 1971 057 claws of axos 4 13 march—3 apr 1971 058 colony in space 6 10 april—15 may 1971 059 dæmons 5 22 may—19 june 1971 note basic line pattern ^###\t.*\t?\t.*$ (i.e every line has 3 tabs \t ). i remove after the episode title, this: third doc season 7 051 spearhead space 052 doc , silurians 053 ambassadors of death 054 inferno season 8 055 terror of autons 056 mind of evil 057 claws of axos 058 colony in space 059 dæmons currently tested next patterns in gedit: ([^\t]*)$ # replaces not after lastly `\t', # incl `\t', lines *does not* contain `\t' then tried...

For loop in logstash -

For loop in logstash - i have event in logstash looks like: { "terms" : { "a" : 1, "b" : 0.5, "c" : 1.6 } } i alter to: { "terms" : [ "a", "b", "c" ] } i didn't find documentation for loop or keys of dictionary. i like: filter { key in [terms]{ mutate { merge => ["tmp_terms", key] } mutate { remove_field => ["terms"] rename => ["tmp_terms", "terms"] } } any suggestions ? logstash doesn't have loop build can utilize ruby plugin: filter { ruby { code => "event['terms'] = event['terms'].keys" } } for-loop logstash

c# - Nested ViewModels / Partial View problems in MVC -

c# - Nested ViewModels / Partial View problems in MVC - i have 2 views: partial view, , view encapsulates partial view using @html.renderpartial("_partialview") . each has own viewmodel: public class partialviewmodel { // properties, etc. } public class mainviewmodel { public partialviewmodel p { get; set; } // properties, etc. } i'm getting dictionary errors when load sec view (the 1 uses mainviewmodel), because view , partial view encapsulates using 2 different viewmodels. can't have them utilize same viewmodel, because partial view rendered within many other different views. to clear, both of these views contain forms, partial view representing of shared fields between forms. given this, have options, or attempting not fit within mvc design constraints? you going want design little differently . main view have model - lets phone call mainmodel , , partial view can have model - we'll phone call partialmodel public c...

Do Scala Sparc RDDs allow objects with reference members -

Do Scala Sparc RDDs allow objects with reference members - i in stages of designing application using sparc rdds (which don't understand yet). rdd contain big number of objects in turn contain references little number (100) of big (0.5mb) objects immutable. the operations mapped on rdd phone call fellow member functions on objects in turn phone call fellow member functions on references. is possible in principle? spark (not sparc) info passed around using java serialization (unless configure utilize kyro). think right thing big objects. if you're willing customize info bit might best utilize broadcast variables big immutable objects. scala sparc rdd

android - Autocomplete textview not showing any data -

android - Autocomplete textview not showing any data - i getting place's name places api. problem autocomplete textview not showing me info testing. adding ok1 , it's not showing when add together without sync task shows info when come in sec character in text field crashes application. destiantion=(autocompletetextview)findviewbyid(r.id.auto_complete_text); destiantion.setthreshold(1); resultlist1=new arraylist<string>(); destiantion.addtextchangedlistener(new textwatcher() { @override public void ontextchanged(charsequence s, int start, int before, int count) { string place=s.tostring(); final string url="http://maps.google.com/maps/api/geocode/json?"+"address="+place+"&sensor=true"; seek { //destiantion.setadapter(new placesautocompleteadapter(startjourney.this, r.layout.auto_complete_items)); //destiantion=(autocompletetextview)findviewbyid(r.id.auto_complete_text); } catch(ex...

javascript - Magento 1.7 - OnePageCheckout Broken -

javascript - Magento 1.7 - OnePageCheckout Broken - i've been trying prepare website on 2 days , don't seem getting anywhere - updated magento 1.7 1.6, , i'm having problem onepagecheckout extension. when shipping details page , click place order button, javascript console returns error: uncaught typeerror: cannot read property 'save' of undefined the buttons action currently: checkout.save(); homecoming false; the html+javascript is: <div id="checkout-review-submit"> <div class="buttons-set" id="review-buttons-container"> <button type="submit" title="place order now" class="button btn-checkout" onclick="checkout.save(); homecoming false;">place order now</button> <span id="review-please-wait" style="display:none;float:right;"> <img src="http://odilynch.com/skin/frontend/...

php - Fill file input after form submit / on form submit error -

php - Fill file input after form submit / on form submit error - i´ve multipart form mixture of default inputs (text, select etc.) , file upload ( <input type="file"> ). i´m using combination of form validation class , upload library of codeigniter form submission. works great. i´ve 1 problem haven´t found solution yet: if user selects image misses fill required field (like "name"), form validation class blocks request , shows error message customer. but i´ve problem, image submitted , don´t want allow user add together file again. want pre-fill file input data. i´ve tried different things like: <input type="file" name="image" value="<?php echo set_value('image','');?>" /> and spent time on finding solution on web without success. on server side, not info where file located on client's computer, in scenario of user uploading image user hasn't filled out rest of field...

How to disable onTouch of parent retaining onTouch of child in android -

How to disable onTouch of parent retaining onTouch of child in android - what having: i having imageview on linear layout. want observe ontouch of imageview . i not want utilize onclick because implementation requires ontouch imageview kid of linearlayout what happening: two touch events firing when click on image 1 image , linear layout(parent) question: how can disable ontouch of linearlayout (parent)retaining ontouch of imageview code: @override public void onactivitycreated(bundle savedinstancestate) { super.onactivitycreated(savedinstancestate); imgusrclrid.setontouchlistener(imgsourceontouchlistener); } ontouchlistener imgsourceontouchlistener= new ontouchlistener(){ @override public boolean ontouch(view view, motionevent event) { log.d("", ""); homecoming true; }}; touch event fired 1 view @ time, , here in code touch event fired imageview know touchlistener called ever...

php - Validation of not allowed username string in input form -

php - Validation of not allowed username string in input form - i have collection of string stored in database table separated comma. table "not_allowed" content : admin,administrator,register,email,password,username,database,computer,... etc. (as admin defind) in user registration, want collection of string "not allowed" username input. how create validation in php in relation database table content? manual scipt have : $notallowed = array('admin','administrator','register','email','password','username','database','computer',... etc); if (in_array($username, $notallowed, true)) { $errors[] = 'the selected username not allowed! '; } create table in db called not_allowed . utilize store not allowed strings. when user signs in, query table not allowed strings. store result in variable , utilize in same way utilize now. depending on programme construction can ...

eclipse - maven dependency not resolved, not authorized error -

eclipse - maven dependency not resolved, not authorized error - i trying utilize maven project in eclipse. first time using maven repository. using maven 3.2.3 when mvn clean install -u it shows these errors [info] scanning projects... [info] [info] ------------------------------------------------------------------------ [info] building treetaggerv2 0.0.1-snapshot [info] ------------------------------------------------------------------------ downloading: http://hlt-services4.fbk.eu:8080/artifactory/repo/de/tudarmstadt/ukp/dkpro/core/de.tudarmstadt.ukp.dkpro.core.treetagger-bin/20131118.0/de.tudarmstadt.ukp.dkpro.core.treetagger-bin-20131118.0.pom downloading: https://repo.maven.apache.org/maven2/de/tudarmstadt/ukp/dkpro/core/de.tudarmstadt.ukp.dkpro.core.treetagger-bin/20131118.0/de.tudarmstadt.ukp.dkpro.core.treetagger-bin-20131118.0.pom [info] ----------------------------------------------------...

iphone - Does XCode iOS Simulator require internet access? -

iphone - Does XCode iOS Simulator require internet access? - i trying build iphone application in xcode 6.1, code delivered external company. for security reasons, test server application (supposed be) talking on separate network not have net access. when build , run app on simulator network, there error thrown (on app) , app doesn't run. when build app using network net access, app starts - can't reach destination server. the company insisting net access required validate ios provisioning profile...whereas pretty sure in app. is net access required build , run application on simulator xcode? i think error...but i'm c#/windows guy knows v. little xcode! pretty sure error thrown application , not emulator. *********************************** server response end fai blo****************************** 2014-11-12 14:33:04.019 fcios12p2[11017:60b] **** error :error domain=kfcrmserrordomaininresourceupdate code=3126 "the operation couldn’t completed....

How to customize JSONBuilder results in Groovy? -

How to customize JSONBuilder results in Groovy? - the below groovy code produces result shown under current result. how customize json output shown in expected output? def resultset = sql.newinstance(...).rows('select * client') println new jsonbuilder(clients:resultset).toprettystring() current result { "clients": [ { "id": 1, "name": "abc", "addr1": "123 main st", "addr2": "new york", "zip": "12345" }, { "id": 2, "name": "xyz", "addr1": "321 main st", "addr2": "new jersey", "zip": "98761" } ] } do need loop through each row , customize? expected { "clients": [ { "id":...

xcode6 - storyboard is shown as a xml document. How to switch the view back to default graphical mode? -

xcode6 - storyboard is shown as a xml document. How to switch the view back to default graphical mode? - i trying link widget on view controller in story board iboutlet variable in view controller swift file. however when switched on assistant, storyboard switched xml code mode, shown in screen shot how can revert default graphical mode? open project navigator on left, select main.storyboard, right click, select open "interface builder" storyboard xcode6

Typescript find sum from user input numbers -

Typescript find sum from user input numbers - my task: have 1 input numbers separated commas & button outputs sum onto dom. i wasn't confident start this. think have @ to the lowest degree of start... after searching web , stackoverflow, haven't come other ideas. i suppose utilize array. also, professor noted initial start first adding class ("class calculate{...}) method use, i've since strayed it. not sure @ point if need go that. html <input id="numbers"> <input type="button" onclick="calculate()" value="click"> <div id="output"></div> typescript function calculate(){ var numbersinput:htmlinputelement = <htmlinputelement>document.getelementbyid('numbersinput'); var numbers:number[] = [parsefloat(numbersinput.value)]; var sum = 0; for(var i:number = 0; i, numbers.length; i++){ console.log(numbers[i]); sum += numbers[i]; } var outputelement...

javascript - Using shift key and click to go to the next slide -

javascript - Using shift key and click to go to the next slide - hei guys, added these lines of code javascript on succes of click box in captivate : document.onkeydown = function (e) { if (e.keycode == 16) { document.captivate.cpeisetvalue('m_varhandle.cpcmndgotoslide', 5); } }; it after first atempt if im on slide , press shift key goes slide 5 :( question is, how set mousedown , onkeyup event on same button. seek accomplish jump next slide if press shift key , click on click box. edit: new code: document.onmousedown = function (e) { var currentslide = document.captivate.cpeigetvalue('m_varhandle.cpinfocurrentslide'); if(currentslide == 5 && e.keycode == 16){ document.captivate.cpeisetvalue('m_varhandle.cpcmndgotoslide' , 5); } }; as think it, should fire function when click on it, buuut , unfortunately doesnt work... seems captivate doesnt recognize onmousedown event :| re-edit : figurate out how ...

php - Yii Bootstrap Select 2 : Select a choice once -

php - Yii Bootstrap Select 2 : Select a choice once - i'm using select2, , i've been reading documentation , have select2 $this->widget('bootstrap.widgets.tbselect2', array( 'name' => 'select', 'options' => array( 'tags' => $tags, ), 'htmloptions'=>array( 'style'=>'width:10px' ), 'asdropdownlist' => false, )); let's $tags contain values red,blue,green , set multiple true. select them all, problem select reddish twice, or bluish twice. there way set status if selection selected, may no longer appear in list of choices? first create sure every tag in list once, can filter out duplicates : 'data' => array_filter($data), i have nev...

java - how to assign variable from inside an actionlistener to one outside -

java - how to assign variable from inside an actionlistener to one outside - i'm c programmer handed lastly min java gui task. given not gui or java person, have created 2 objects: 1 text box, i'm hoping assigned results of 2nd object. 2 combo box. when user selects combo box, wish value populated first object (textfield). here actionlistener(): class foo { // declared instance variable private string thevalue; // created textfield, , jcombobox thingies listbox.addactionlistener(new actionlistener() { public void actionperformed(actionevent e) { // line produces reported error //textfield.settext( (string)(((jcombobox)e.getsource()).getselecteditem()) ); // line works, below error when seek assign thevalue outside method thevalue = ((jcombobox)e.getsource()).getselecteditem(); } }); ... textfield.setvalue(thevalue); // errors out and next (appa...

core plot - iOS: How to make a CPTTradingRangePlot .stickLength be dynamic? -

core plot - iOS: How to make a CPTTradingRangePlot .stickLength be dynamic? - how set cpttradingrangeplot sticklength dynamically in core plot ios? cpttradingrangeplot *tradeplot = [(cpttradingrangeplot *)[cpttradingrangeplot alloc] initwithframe :....]; tradeplot.barwidth = 5.0; tradeplot.sticklength = 10.0f; //can vary dynamically graph screenshot link the length of symbol or (cpttradingrangeplot) sticklength varies not uniform. you can set sticklength or other core plot property @ time, long phone call setter main thread. sticklength , many other properties animatable using core animation or cptanimation . core-plot

c++ - Where is _SECURE_SCL normally found? -

c++ - Where is _SECURE_SCL normally found? - i'm convinced have std::vector bounds problems in project built using visual studio 2005. according microsoft documentation, can command bounds checking using _secure_scl . assures me enabled default - courtesy of #define _secure_scl 1 somewhere. can't find it, , if slip definition stdafx.h , doesn't conflict anything. missing something? "normal" way utilize _secure_scl ? by default it's defined in header file yvals.h . if both _iterator_debug_level , has_iterator_debugging undefined, has_iterator_debugging defaults 1 in debug build. if _secure_scl undefined, , has_iterator_debugging defined 1 , _secure_scl defaults 1 different rules come play if _iterator_debug_level defined. see header file more information. c++ visual-c++ visual-studio-2005

php - How to check if a point is inside specified area? -

php - How to check if a point is inside specified area? - my server receive 4 points on map(a,b,c,d),that represent rectangle on map. in database have business table: bussid | longitude | latitude ============================= .. .. .. how businesses placed within rectangle ? let point p. p within rectangle vertices (a,b,c,d) [in order] if , if dot product of vectors ab.ap , bc.bp, cd.cp, , da.dp having same sign (i.e. either they're positive or negative). approximate if you're talking longitude , latitude because surface of earth curved surface, not flat rectangle. php mysql algorithm map

What is the equivalent of ToString("00") in C++? -

What is the equivalent of ToString("00") in C++? - what equivalent of .tostring("00") in c++? i'm getting error stating that left of '.tostring' must have class/struct/union 1> type 'double' update: replies, i'm having similar issue //inorder //.tostring("00.00000") did following memset(buf, 0, sizeof(buf)); sprintf_s(buf, "%02.7f",latm); //.7 match heremisphere std::string latm_str = buf; i realised %02 doesnt have effects, illustration when 7.0, result 7.0000000 rather desired 07.0000000, wrong here? double number = 3.14; char buf[100]; sprintf_s(buf, "%02d", (int)number); string s = buf; cout << s; // prints 03 based on custom string formatting: tostring("00") c++

parallel processing - Parallelism in php -

parallel processing - Parallelism in php - i want optimize part of code improve performance.since application create utilize of commandline tool , think improve performance execute lines of code in parallel rather executing code sequentially <?php $value = exec("command goes here"); //this takes time /* instructions here don't depend on $value */ /* instructions here don't depend on $value */ $result = $value*2 ; //this dumb illustration ?> i want execute codes don't depend on value @ same time $value whole script execute faster rather waiting exec() complete unfortunately php despond in parallelism, concurrent,... programming. , never know why php dosen't back upwards these of import things , when php want back upwards these !!. but may want utilize fork in php (if know problems , troubles in fork ) http://php.net/manual/en/function.pcntl-fork.php http://codereview.stackexchange.com/questions/22919/how-to-fork-with...

java - How to compare nextLine() to a String -

java - How to compare nextLine() to a String - i have assignment in apcs class asks create combination lock , think have basic construction down. however, maintain running problem won't allow me compare raw nextline() string . i wondering if nextline() s default int s? or tell me what's wrong code? if((in.nextline()).compareto(combo)) { system.out.println("the lock unlocked."); system.out.println("please come in combo unlock: "); if((in.nextline()).compareto(combo)) { system.out.println("the lock locked."); } else { system.exit(0); } } p.s. ide returns error: "error: incompatible types: int cannot converted boolean" , referring if qualifications. nextline() homecoming string, isn't problem. compareto(str) returns negative number if str lexicographically less value beingness compared to, 0 if strings lex...

javascript - Jquery parseJSON failing - "unexpected token o" -

javascript - Jquery parseJSON failing - "unexpected token o" - this question has reply here: i maintain getting “uncaught syntaxerror: unexpected token o” 8 answers i'd simple ajax request json info , parse it. code using follows: $.get('/ajax/search/dsb.json', function (data) { searchdata=$.parsejson(data); }); i getting error: "unexpected token o." have verified file in question valid json. have googled reply - problem passing javascript object json parser, redundant. however, i'm not sure problem in case. thoughts? here's json, can check yourselves if it's valid (it is). { "numcols": 2, "colnames": [ "disability level", "region" ], "colwidths": [ 200, null ], "colfilters": [ [ "", "all di...

How to fire an event when user change a dropdownlist inside an asp.net listview? -

How to fire an event when user change a dropdownlist inside an asp.net listview? - i have listview utilize gridview. within itemtemplate have 'modifyble' field, dropdownlist. i fire 'save' event when user alter dropdownlist. know have set autopostback = true of dropdownlist don't know how fire event because visual studio don't allow me create 'on alter event' of dropdownlist when within listview. this code example <asp:listview id="lvdmr" runat="server" datasourceid="dsdmr" datakeynames="id"> <itemtemplate> <table style="width: 100%;" cellspacing="0" cellpadding="8"> <tr style="width: 100%;"> <td class="colonna-griglia" style="width: 5%;"> <%# convert.todatetime(eval("data_rilevazione")).tostring("d") %> ...

javascript - convert GMT to PST in Angular JS -

javascript - convert GMT to PST in Angular JS - how can convert string: mon, 28 jul 2014 09:33:44 gmt to pst? using angular js (preferable) or rather javascript. i went through other thread didn't find point/complete/crisp solution. people should not handle date/time zone myself, mandatory utilize existing lib? if suggest lib , implementation. javascript angularjs date timezone

C++ Struct in C# -

C++ Struct in C# - i'm using dll written in c++ in c# project using dllimport , 1 of functions i'm using looks this: [dllimport("dds.dll", charset = charset.auto)] private static extern int par( ddtableresults2 tableresult, ref parresults parresult, int vul ); the parresults struct defined in c++ this: struct parresults { /* index = 0 ns view , index = 1 ew view. 'view' here meant side starts bidding. */ char parscore[2][16]; char parcontractsstring[2][128]; }; the start of c++ function int stdcall par(struct ddtableresults * tablep, struct parresults *presp, int vulnerable) how should define above struct in c# able send struct en reference dll function? this have tried don't work @ , access violation error [structlayout(layoutkind.sequential)] public struct parresults { [marshalas(unmanagedtype.byvalarray, sizeconst = 32)] ...

How to rollback nHibernate transaction when an exception occurs during request having Ninject for managing sessions? -

How to rollback nHibernate transaction when an exception occurs during request having Ninject for managing sessions? - i utilize nhibernate orm , ninject ioc. create nhibernate sessions per custom scope (which can assume per request). begin transaction onactivation. commit transaction ondeactivation. the problem if exception happens during request want rollback transaction rather committing it. thought how observe (in clean way, using ninject context) exception has happened? note: not concerned exceptions can happen on commit can grab in next code , role easily. protected void bindwithsessionwrapper<t>(func<icontext, t> creationfunc) t : isessionwrapper { bind<t>().tomethod(creationfunc) .inscope(x => new ninjectcustomscope()) // work in progress !!! .onactivation(t => t.session.begintransaction(isolationlevel.readcommitted)) .ondeactivation((c, t) => { t.session.transaction.commit();...