Posts

Showing posts from May, 2013

android - Dynamic graphic interactions on mobile: HTML5 and Javascript or native application -

i have develop mobile application displays dynamic generated images , allows user perform different actions pressing region of image. example displaying router , allowing user select 2 ports on router. ports color should dynamically change when selected. i'm not experience mobile development wondering differences between html5 + javascript solution , native app. native app give me more flexibility in dealing graphics? limitation of graphic representation of html5 + javascript compared native apps? i think use both technologies 1 recommended keeping in mind functionality beginning. sure product extend more , there more complex graphical interactions implement in future. thanks, irina using html5 , javascript easier compared native android or ios code. you can develop once , use for multiple devices (android, ios etc) native faster, though javascript rendering in mobile devices getting faster. with html5 , javascript limited device's browser limitation th...

html - SmartGWT / GWT accessing div created in constructor via javascript -

i trying integrate custom javascript library smartgwt project. i have areas of page loaded dynamically via button clicks , in java code have following pseudo code: button . onclick { contextarea = new contextareatypea() } so contextareatypea created , within constructor want create series of div elements, assign them ids , call function in custom library loads content divs. smartgwt gets rid of way of getting hold of ids or setting ids on element in page, create ids on elements either have create own widget , override getinnerhtml or create htmlflow , add content myflow.setcontent('<div id="myid" ></div>'); way doing it. my problem doing in constructor means when come call custom javascript function takes id, div created not seem attached dom yet null pointer. since module , document loaded , content being dynamically added in can't call document ready or onmoduleload, how , when should detecting load of div , when safe access di...

php - wordpress site uploaded on Plesk server gives warning and permalink issue -

i have uploaded wordpress site shared plesk parallel panel dedicated plesk parallel panel. getting 1 warning in testimonial rotator plugin follow : warning: file_exists() [function.file-exists]: open_basedir restriction in effect. file(path1\httpdocs/wp-content/plugins/site_url/wp-admin/edit.php) not within allowed path(s): (path_2_site;path_2_temp) and having problem in permalink settings. set custom structure : /%category%/%postname%/ it gives 404 : page not found. don't know problem actually, on server or in site. because working fine on shared plesk. please me out of these issue thanks in advance, mona it looks loading files second site located on same server, correct? you need adjust open_basedir settings allow php functions access files in other site ordinarily outside of allowed access. i think indicating site on dedicated server (that assume have full access to), if should able create vhost.conf file wordpress site adjust open_basedir set...

javascript - Move items between two ListBoxes in ASP.Net using JQuery -

i want move items between 2 listboxes in asp.net using jquery/javascript , below code working perfectly. function additems() { var totalitemsselected = 0; var currentitems = 0; var messagelabel = document.getelementbyid('<%=lblitprogrammingmessage.clientid%>'); var selectedoptions = jquery('#<%=listitprogramming.clientid %> option:selected'); if (selectedoptions.length == 0) { messagelabel.innerhtml = "please select skill(s) add."; jquery('#<%= lblitprogrammingmessage.clientid %>').fadeout(2000, function () { messagelabel.innerhtml = ""; }); jquery('#<%= lblitprogrammingmessage.clientid %>').fadein(500, function () { }); return false; } jquery('select[name$=listmyitprogramming] > option').each(function () { currentitems++; }); if (currentitems == 30) { messagelabel.innerhtml = "maximum limit (30) reached. cannot add...

android - Is there any way to get upload progress correctly with HttpUrlConncetion -

android developers blog recommend use httpurlconnection other apache's httpclient ( http://android-developers.blogspot.com/2011/09/androids-http-clients.html ). take advice , problem in reporting file upload progress. my code grab progress this: try { out = conncetion.getoutputstream(); in = new bufferedinputstream(fin); byte[] buffer = new byte[max_buffer_size]; int r; while ((r = in.read(buffer)) != -1) { out.write(buffer, 0, r); bytes += r; if (null != mlistener) { long = system.currenttimemillis(); if (now - lasttime >= mlistener.getprogressinterval()) { lasttime = now; if (!mlistener.onprogress(bytes, msize)) { break; } } } } out.flush(); } { closesilently(in); closesilently(out); } this code excutes fast whatever file size, file still uploading server util response server. seems httpurlconnec...

angularjs - angular how to define multiple controllers -

i have code angular.module('mywidget', ['$scope']).controller('testcontroller', testcontroller); i want add controller ..say ...controller("test2controller",test2controller) just wanted know how can achieve ? you can var myapp = angular.module('mywidget', ['$scope']); myapp.controller('testcontroller', testcontroller); myapp.controller('test2controller', test2controller);

laravel - Import of 50K+ Records in MySQL Gives General error: 1390 Prepared statement contains too many placeholders -

has ever come across error: general error: 1390 prepared statement contains many placeholders i did import via sequelpro of on 50,000 records , when go view these records in view (laravel 4) general error: 1390 prepared statement contains many placeholders. the below index() method in adminnotescontroller.php file generating query , rendering view. public function index() { $created_at_value = input::get('created_at_value'); $note_types_value = input::get('note_types_value'); $contact_names_value = input::get('contact_names_value'); $user_names_value = input::get('user_names_value'); $account_managers_value = input::get('account_managers_value'); if (is_null($created_at_value)) $created_at_value = db::table('notes')->lists('created_at'); if (is_null($note_types_value)) $note_types_value = db::table('note_types')->lists('type'); if (is_null($contact_names_value)) $con...

javascript - Breeze + OData + MS Dynamics CRM -

i'm trying use breeze 1.4.0 odata managing data operations against ms dynamics crm 2011 odata service. retrieving data works fine, trying push data doesn't work. tried simple update, breeze fails when reaches second line: function updatedeletemergerequest(request, aspect, prefix) { var extrametadata = aspect.extrametadata; var uri = extrametadata.uri; if (__stringstartswith(uri, prefix)) { uri = uri.substring(prefix.length); } request.requesturi = uri; if (extrametadata.etag) { request.headers["if-match"] = extrametadata.etag; } } i have debugged through it, , fails because aspect.extrametadata undefined. aspect breeze entity.entityaspect object, doesn't have property. i have found dataserviceversion used breeze odata 2.0, while 1 odata service @ ms dynamics crm 2011 1.0. i'm not sure if has it. have tried change dataserviceversion breeze 1.0. any ideas? thank...

How to pass argument to Context in android -

i new android , times application works fine if pass if use, this context // gets error if use, classname.this context // gets error android.view.windowmanager$badtokenexception: unable add window -- token android.app.localactivitymanager$localactivityrecord@40537450 not valid; activity running? if use, getapplicationcontext() android.view.windowmanager$badtokenexception: unable add window -- token null not application if use, classname.this.getparent() i confused when use what. please explain

Clear previous cached options in jQuery chosen for new AJAX submit -

auto-populating values in jquery chosen on key press event values typed in chosen field. in first request, fine. furthur keypress event, values getting appended previous appended options. below callback code. success: function(data) { each(data, function(index) { $(".chzn-select").append( $('<option></option>') .val(data[index]) .html(data[index])); }); $(".chzn-select").trigger("liszt:updated"); } is possible clear chosen optioned values before ajax call. you configure jquery ajax requests without caching. $(document).ready(function() { $.ajaxsetup({ cache: false }); }); with this, jquery add parameter named _ on url random number , make diferent request , url server avoiding browser caching. can configure cache in $.ajax command, sample: $.ajax({ // configs... cache: false, // configs... });

What does the command A(~A) really do in matlab -

i looking find efficient way find non 0 minimum of matrix , found on forum : let data matrix a . a(~a) = nan; minnonzero = min(a); this short , efficient (at least in number of code lines) don't understand happens when this. can't find documentation since it's not operation on matrices + , - , \ ,... be. could explain me or give me link or me understand done ? thank ! it uses logical indexing ~ in matlab not operator. when used on double array, finds elements equal zero. e.g.: ~[0 3 4 0] results in logical matrix [1 0 0 1] i.e. it's quick way find 0 elements so if a = [0 3 4 0] ~a = [1 0 0 1] a(~a) = a([1 0 0 1]) . a([1 0 0 1]) uses logical indexing affect elements true in case element 1 , element 4. finally a(~a) = nan replace elements in equal 0 nan min ignores , find smallest non-zero element.

performance - MySQL Update query too slow -

i have update query takes more 2 hours execute. query updates 3 tables simultaneously based on cases . update query little complex based on business requirement. how optimize query: query below : update atmissuerdata a1 inner join cbsissuerdata c1 on row( a1.transactionnumber,a1.cardnumber) =row( c1.approvalnumber,c1.cardnumber) inner join switchissuerdata s1 on row( a1.transactionnumber,a1.cardnumber) =row( s1.approvalnumber,s1.cardnumber) inner join atmlevel1 al1 on al1.id=a1.id inner join cbslevel1 cl1 on cl1.id=c1.id inner join switchlevel1 sl1 on sl1.id=s1.id set a1.reconstatus = case when ( row( a1.transactionnumber,a1.cardnumber) = row( c1.approvalnumber,c1.cardnumber) , row( a1.transactionnumber,a1.cardnumber) = row( s1.approvalnumber,s1.cardnumber) ) , ( a1.transactionamount = c1.transactionamountdr , a1.transactionamount...

php - Retriev variable values in javascript function -

i using facebook api project , getting data in following manner in var mydata if (response.status === "connected") { lodinganimate(); //animate login fb.api('/me?fields=movies,email', function(mydata) { //-- console.log(mydata); if(data.email == null) { alert("you must allow access email id!"); resetanimate(); } } i dont have issue code. want send data using ajax call process , insert database. my ajax call: function ajaxresponse() { var send=document.ge(mydata) **//here want fetch mydata previous code** var datas = document.elements['id'].value; var s = 'connect=1'; $.ajax({ type: "post", url: "process_facebook.php", data: s,send **//is correct way send s , send togather? have tried 's' works fine dont know both togather** }...

three.js - Dynamically change .mtl of .obj OBJMTLLoader -

how can dynamically change material on .obj model? each of model contains .obj, .mtl , .jpg files textures. should change .mtl file somehow? in code below center geometries of each child mesh of .obj , try give texture, neither commented code nor loader.load not giving texture. var loader = new three.objmtlloader(); loader.addeventlistener( 'load', function ( event ) { object = event.content; (var = 0; < object.children.length; i++) { three.geometryutils.merge(geometry, object.children[i].geometry); } three.geometryutils.center( geometry ); //var materials = new three.imageutils.loadtexture("/obj/stol.mtl"); //mesh = new three.mesh( geometry, new three.meshfacematerial( material ) ); var material = new three.meshbasicmaterial( { color: 0xff0000 } ); mesh = new three.mesh( geometry, material ); ...

gruntjs - yeoman/grunt task : copy a folder to dist -

i new yeoman , grunt, , don't how copy folder created in app directory dist directory. the folder /data/locales/ lng /_ ns _.json , there several lng folders , multiple ns files. i copy whole structure dist directory. i tried copy task , added : { cwd: '<%= yeoman.app %>', dest: '<%= yeoman.dist %>', src: [ 'data/**/*.{json}' ] } but doesn't work... "i copy whole structure dist directory." this should it: { cwd: 'data', dest: 'path/to/dest', src: ['**'] } this copy files , directories within 'data' directory destination directory. more examples here: https://github.com/gruntjs/grunt-contrib-copy#usage-examples

android - Destroy an activity when back button is pressed? -

Image
i have app allows user select txt file list , goes off internet contents of file. works except when user accidentally or deliberately presses hardware button go , see list again. now, when user clicks new item list (a new file is), instead of loading new file, app continues off suspended.i not want happen. know related life cycle of activity. how make sure loads new file rather continuing left off ? i suppose you're loading file in oncreate() . should in onresume() instead. do not force activities close (e.g. use finish() ). first, this not guarantee activity closed , , second, better left android decide.

r - user data as variable in shiny -

i building app analyze wind data using packages “shiny” , “openair”. i trying read input data given user , use variables, keep getting : error in updateselectinput(session, "pollutant", choices = names(df)) : object 'session' not found error: [on_request_read] connection reset peer in ui.r have: selectinput("pollutant","please choose pollutant",names(userdata)), , in server.r: observe({ df <- userdata() str(names(df)) if (!is.null(df)) { updateselectinput(session, "pollutant", choices = names(df)) } }) it sounds you're not including session variable in server definition? i.e. use (input, output, session) rather (input, output) .

c# - How to connect Hive to asp.net project -

hi i'm new hadoop. i have installed microsoft hdinsight local system. want connect hive , hbase hive connection have specify connection string, port, username, password. but i'm not able figure out how value. have tried localhost , 8085 port doesn't work. done giving localhost ip , system ip too. please , let me know how should proceed hbase connectivity your best bet use microsoft's hive sdk (also available on nuget microsoft.hadoop.hive) there great sample on how connect , run linq-to-hive query @ http://hadoopsdk.codeplex.com/wikipage?title=simple%20linq%20to%20hive%20query&referringtitle=linq%20to%20hive this used webhcat api submit query hive, , work against hdinsights cluster in azure cloud (hence need provide storage key results again). if you're interested in using local copy can adapt example exclude storage account credentials. var db = new hiveconnection( webhcaturi: new uri("http://localhost:50111")...

grails - Integrating OpenAM, tomcat J2EE policy agent with Spring Security-enabled web application -

we trying fine-grained authorizations using spring security while having user authentication , coarse-grained authorization using openam policies feature application realm. mean coarse-grained simple uri rules subjects. mean fine-grained authorization @ web application level such using acls using spring-security-acls . to accomplish this, approach have thought use ** spring security preauthenticationfilters** outlined in spring-security reference manual. got thought after reading question pre-authentication to rapid prototyping, have chosen grails 2.2.3 web application platform plugins spring-security-core , acls behind openam , openam j2ee policy agent interfaces. openam policy setup authenticate user , return uid (ldap user id) in policy response header. mapped user_id in response provider , sent http header policy agent. the grails application resources.groovy looks this: beans = { preauthenticatedgrantedauthoritiesuserdetailsservice(preauthenticatedgrantedauthoriti...

java - Tapestry updating DAO from editable grid with AJAX -

i'm trying make following work in tapestry. i have dictionary<string, dictionary<string, object>> contains data. i'm trying accomplish have 1 drop-down menu (select component) contains keys outer dictionary. when selection changes, grid should updated keys , values selected sub-dictionary. for example: dictionary<string, dictionary<string, object>> dictionaries = new hashtable<string, dictionary<string, object>>(); dictionary<string, object> dict1 = new hashtable<string, object>(); dictionary<string, object> dict2 = new hashtable<string, object>(); dict1.put("k1", "d1v1"); dict1.put("k2", "d1v2"); dict2.put("k1", "d2v1"); dict2.put("k2", "d2v2"); dictionaries.put("d1", dict1); dictionaries.put("d2", dict2); would kind give me example or push me in right direction? edit: i managed first part worki...

linux - How can I show passwords that are being typed in? -

i know it's huge security risk , i'd never use it, i'm showing product password management, want password shown on command line i'm typing in. there way in redhat linux? short answer: no long answer: yes, have change source code of shadow-utils program , recompile demo.

ios - CoreData-Project with two entities -

this question has answer here: new core data, getting error in persistentstorecoordinator 1 answer i've 2 tableviews in app , user should able add objects both of them. 1 tableview works fine (there's 1 coredata entity ). when add entity , same things 1 tableview, xcode shows me error. the output is: unresolved error error domain=nscocoaerrordomain code=134100 "the operation couldn’t completed. (cocoa error 134100.)" userinfo=0x10333d80 {metadata={ nspersistenceframeworkversion = 419; nsstoremodelversionhashes = { buy = <883135e4 2884b0ed 4bb8fc1c 7d56c229 fbae3090 91be719d 73ac5d66 65e70b18>; }; nsstoremodelversionhashesversion = 3; nsstoremodelversionidentifiers = ( "" ); nsstoretype = sqlite; nsstoreuuid = "..."; "_nsautovacuumlevel" = 2; }, reaso...

android - Toggle button for Mobile data -

in app having 2 toggle buttons, 1 wifi , other 1 mobile data. when applications start, if wifi on, toggle button on. but, if mobile data on, toggle button doesn't show that, it's still grey(no matter what's happening wifi). when press it, becomes green , mobile data still on... idea why? gprs.setoncheckedchangelistener(new compoundbutton.oncheckedchangelistener() { @override public void oncheckedchanged(compoundbutton buttonview, boolean ischecked) { try { turndata(ischecked); //klasa za ukljucivanje gprsa } catch (exception e) { // todo auto-generated catch block e.printstacktrace(); } } }); and class mobile data void turndata(boolean on) throws exception { log.i("version:", "found gingerbread+"); final connectivitymanager conman = (connectivitymanager) getapplicationcontext().getsyst...

ruby on rails - Link_to with colorbox jquery -

please tell me wrong. view: <div id='profile_galery'> <ul> <li class='big'><%=link_to image_tag(@profile.user.get_avatar(:large) ), @profile.user.get_avatar(:very_large), :class => 'colorbox'%></li> and js: $(document).on("ready page:change", function() { $(".colorbox").colorbox(); }); but when click on image doesnt show - after page reload works.

html - Create buttons dynamically in a div from a javascript function -

i have function returns data sql... i need create buttons in div called divresult here function function retrievedata(transaction, results) { for(var = 0; < results.rows.length; i++) { var data = results.rows.item(i)['nome']; alert(data); } } there answer on how create html elements using javascript here: creating dynamic button click event in javascript . ...i add simple comment don't have enough street cred yet.

Can a .NET Semaphore be shared between users on the same computer? -

i need restrict access shared resource between 2 users logged terminal server sessions (windows 2008 r2 x64). tests, appears 1 user cannot see named system semaphore created user. if try sharing semaphore within same user account, works. should able share across accounts? you need create global semaphore that's visible across sessions. prefix name global\ .

How to get value from page using WebDriver >> find elements -

how value hierarchy selenium webdriver , webelement? web page application telerik model. part of java code : public void changeelementsaveandverify() throws interruptedexception { driver.findelement(by.xpath(myprintertab.printertabiconleftpane)).click(); thread.sleep(5000); driver.findelement(by.xpath(myprintertab.showhidedriverdetailed)).click(); thread.sleep(5000); webelement select = driver.findelement(by.id("ctl00_contentplaceholder2_radgrid_driver_ctl00_ctl05_editformcontrol_preton_ucsettings_driver_treelist_ctl04_enabled_dropdown")); webelement innerelemt = select.findelement(by.tagname("div")); webelement innerelemt2 = innerelemt.findelement(by.tagname("ul")); list<webelement> alloptions = innerelemt2.findelements(by.tagname("li")); (webelement option : alloptions) { system.out.println(...

android - Is it possible to move ImageButtons with an onClick in a relative view? -

Image
my intension have button on screen when clicked move bunch of imagebuttons 1 "football formation" one. something along lines of this. to with each position representing different imagebutton, when try player2.setleft(200); it crashes program. if view isn't possible best way go it, or best off using different layout entirely?

wpf - Require reusable DataCell ControlTemplate for different binding sources -

(visual studio 2010) web examples, have overridden controltemplate of datagridtextcolumn include additional image binded viewmodel. <datagridtextcolumn.cellstyle> <style targettype="datagridcell"> <setter property="template"> <setter.value> <controltemplate targettype="datagridcell"> <grid name="root" background="{templatebinding background}"> <visualstatemanager.visualstategroups> <visualstategroup x:name="currentstates"> <visualstate x:name="regular" /> <visualstate x:name="current"> <storyboard> <doubleanimation storyboard.targetname="focusvisual" storyboard.targe...

Windows Phone 8: Auto-Launch *.pptx fail -

i have code launching file on windows phone 8: string ppfile = @"assets\documents\test.txt"; var file = await windows.applicationmodel.package.current.installedlocation.getfileasync(ppfile); var success = await windows.system.launcher.launchfileasync(file); when have *.txt file windows phone 8 launching it. want launch "example.pptx" file, code doesn't work. there perhaps permission problems powerpoint file? the code specified correct launching file, either txt or pptx. both cases should work fine. could please verify in solution explorer build action pptx file set "content"? when adding txt file defaults content, pptx defaults none. adjusting content solve issue.

XCode import public key file generated with Java Security -

i have java generator public key this: final keypairgenerator keygen = keypairgenerator.getinstance("rsa"); keygen.initialize(1024); final keypair key = keygen.generatekeypair(); publickey pubkey = key.getpublic(); byte[] key = pubkey .getencoded(); fileoutputstream keyfos = new fileoutputstream("publickey.der"); keyfos.write(key); keyfos.close(); and on hand, have xcode,that use publickey.der encrypt data: nsstring *publickeypath = [[nsbundle mainbundle] pathforresource:@"public_key" oftype:@"der"]; if (publickeypath == nil) { nslog(@"can not find public_key.der"); return nil; } nsdate *publickeyfilecontent = [nsdata datawithcontentsoffile:publickeypath]; if (publickeyfilecontent == nil) { nslog(@"can not read public_key.der"); return nil; } certificate = seccertificatecreatewithdata(kcfallocatordefault, ( __bridge cfdataref)publickeyfilecontent); if (certificate == nil) { nslog(@"can not read certificate ...

java - FileSystemView get war file icon null pointer -

i using javax.swing.chooser.filesystemview system file icons , display them uploaded files in web application. it working various file types, when trying upload .war file, java returning null pointer exception . how can know if particular file type supported or not method? anyone had similar issue? this code using // gets 16x16 size image icon list view icon smallicon = filesystemview.getfilesystemview().getsystemicon(file); image smallimage = ((imageicon) smallicon).getimage(); i running code on windows 7 machine if makes difference. thanks :) edit : turns out problem wasn't icon. have line of code string contenttype = getservletcontext().getmimetype(file.getname()); which accepts file uploaded parameter , checks type of file. doing check if file image or not. case of war file returning null reason

r - Legend linetypes not displaying properly ggplot -

Image
i have following plot: ggplot(proba[108:140,], aes(c,four, color="a1")) + geom_line(linetype=1, size=0.3) + scale_x_continuous(breaks=seq(110,140,5)) + theme_bw() + theme(axis.line = element_line(colour = "black", size=0.25), panel.grid.major = element_blank(), panel.grid.minor = element_blank(), panel.border = element_blank(), panel.background = element_blank()) + theme(axis.text.x = element_text(angle = 0, hjust = +0.5, size=6,color="black")) + theme(axis.text.y = element_text(angle = 0, hjust = -100, size=6, color="black")) + theme(axis.ticks=element_line(colour="black",size=0.25)) + xlab("\ntime-steps")+ylab("proportion correct\n") + theme(axis.text=element_text(size=8), axis.title=element_text(size=8)) + geom_line(aes(c,three, color="a2"), size=0.2, linetype=2) + geom_line(aes(c,one, color="a3"),lin...

Good c++ coding style for global functions? -

i have global functions has same name member methods. both used in same scope. way distinguish them? adding prefix 'g' conventional? know conventional global variable not sure global functions. you don't need change function name use them. comments say, can qualify function e.g. void foo() { } class bar { void foo() { } void wibble() { ::foo(); } }; :: means in global scope

objective c - Importing XLS/CSV to Parse.com BaaS with Array and Dictionary data -

i using parse.com baas , using 'import' function create data tables existing xls/csv files. this works ok when cells in excel spreadsheet basic object types (numbers, strings, booleans) wanting import array , dictionary objects. i know parse import not support this, wondering if has developed workaround? i saw 1 posted converted csv file json file, did not share how did this. know rest api option have never used api , prefer not go down path right if can avoided. cheers

asp.net mvc - Autopopulate search results using jquery in MVC 3 -

i have textbox called "name" , when user types letter ,suppose "a" names beginning letter should listed , user can select name. is kind of listing possible using jquery in mvc 3 application? try jquery autocomplete can able use in asp.net mvc3 application. var availabletags = ["al", "ak", "az", "ar", "ca", "co", "ct", "de", "dc", "fl", "ga"]; $("#card_state").autocomplete({ source: availabletags }); @html.textboxfor(model => model.state, new { id = "card_state" })

sqlite - Load spatialite extension in RSQLite crashes R (OS X & Ubuntu) -

i running queries against spatialite database, , data directly r. this page suggests can this: library(rsqlite) sqldrv <- dbdriver("sqlite") con <- dbconnect(sqldrv, dbname = "/path/to/db.sqlite",loadable.extensions = true) spatialitestatus <- dbgetquery(con, "select load_extension('libspatialite.dylib')") but when do, r segfaults following: *** caught segfault *** address 0x0, cause 'memory not mapped' traceback: 1: .call("rs_sqlite_fetch", rsid, nrec = n, package = .sqlitepkgname) 2: sqlitefetch(rs, n = -1, ...) 3: sqlitequicksql(conn, statement, ...) 4: dbgetquery(con, "select load_extension('/usr/local/lib/libspatialite.dylib')") 5: dbgetquery(con, "select load_extension('/usr/local/lib/libspatialite.dylib')") in case, spatialite built source using homebrew, version of sqlite use. in libspatialite homebrew definition, says depends on sqlite > 3.7.3. homebre...

error javascript code calculation -

pls consider calculation in javascript code below. example values: investmentfix = 200.00 investmentvar = 123.12 nrofparts = 5.00 ...the console shows strange result value 0200.00615.6. don't understand. noticed values 200.00 , 615.6, - latter result of investmentvar * nrofparts - in result value. i'd expect (and target get) result 815.6 (200+(123.12*5.00). what goes wrong? relate kind of format issue? javascript code: var result =0; result += (investmentfix + (investmentvar * nrofparts)); console.log(result); try following: result = parsefloat(0,10); result+=parsefloat(investmendfix,10)+parsefloat(investmentvar*nrofparts,10); console.log(result); this ensures javascript engine parses variables @ numbers instead of strings. parsefloat() syntax: parsefloat(mynumber,base);

jquery - String search with jsonpath -

i have huge json file more 20000 objects in it. query string in json file. however, using jsonpath , find exact matches? let's file like: { "store": { "book": [ { "category": "reference", "author": "nigel rees", "title": "sayings of century", "price": 8.95 }, { "category": "fiction", "author": "evelyn waugh", "title": "sword of honour", "price": 12.99 }, { "category": "fiction", "author": "herman melville", "title": "moby dick", "isbn": "0-553-21311-3", "price": 8.99 }, { "category": "fiction", "author": "j. r. r. tolkien", "title": "...

actionscript 3 - Form thumbnail in PHP and send it to AS3 -

i'm making image gallery using as3. read given directory php, returning paths images in array. form thumbnails, serialize them, send as3 array, , create bitmaps data. please me through these steps: -resizing image in php , serializing it -forming bitmap in as3 serialized data as first requirement, thumbnail image code this: $source_image = imagecreatefrompng( www_root . 'img/' . $yourpath . '.png'); $source_imagex = imagesx($source_image); $source_imagey = imagesy($source_image); $dest_imagex = 200; $dest_imagey = 200; $dest_image = imagecreate($dest_imagex, $dest_imagey); imagecopyresampled($dest_image, $source_image, 0, 0, 0, 0, $dest_imagex, $dest_imagey, $source_imagex, $source_imagey); header("content-type: image/png"); imagepng($dest_image, www_root . 'img/' . "small" . $yourpath . '.png' ,9); ...

ocr - ABBYY Flexicapture connect to database -

i have run database queries in abbyy flexicapture connecting dll methods contained database calls. have ability connect directly in abbyy rules, if possible. relatively recent update added ability write rules in c#, i'm assuming it's possible this. i have added system.data .net reference in document definition properties, "the type or namespace name 'sqlconnection' not found (are missing using directive or assembly reference?" when run line of code: sqlconn = new sqlconnection("[my connection string]"); i have tried adding using system.data.sqlconnection above line , says sqlconnection not exist in system.data. has had success in doing this? try this: using system.data.sqlclient

php - How to add multiple add to cart buttons on one form -

i have 16 products, of have separate add cart buttons assigned them. when customer enters desired quantity , clicks add cart, product added shopping cart , customer directed corresponding paypal shopping cart. wondering if there way carry out same action without having make individual buttons each product? this code 1 of buttons: <form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post"> <input type="hidden" name="cmd" value="_s-xclick"> <input type="hidden" name="hosted_button_id" value="93xbl9hz8d5mg"> <table> <tr><td><input type="hidden" name="add" value="1"></td></tr><tr><td> <input type="hidden" name="item_name" value="a...

How to create and mount a volume in Qt -

my application client desktop app connects database server. app document management system allows user store files such .pdf .xlsx etc in database , keeps track of versions of documents. user can "check in" , "check out" documents. when user checks out file, downloaded database , copied user's hard drive. user accesses file, edits, , checks database. inside database, file stored in compressed, encrypted , base64 encoded form in text field. my objective ensure when file copied user's hard drive, encrypted, still allow user easy access it. best way visualize want consider how truecrypt works - allows user create encrypted binary file can mounted drive. example on windows, drive letter assigned volume , user can access files via computer example. my app uses botan library encryption. is possible achieve similar qt? if so, how? if not, recommend? many thanks. well, think talking reasonable requires 'core design' thoughts before going...

java - Reflections bad or good practice for commands -

well, saw there questions , answers this, didn't satisfy me. let's example, have programmed console. it's nice jframe output , input txtfield/area. console should not used output, run commands. because need console , don't want change code of console programmed way: the console has 1 method register commands. console.registercommand(string command, string methodtoinvoke, object invokeobject); with method i'm able use console everywhere without need of changing or inharitance. whenever string command written console knows it's registered keyword , executes method via reflection. would or bad practice? on code styling , in performance! , better? i found quite neat use reflections way add actionlisteners menuitems in trayicon. edit to answer below: ok commands accept way do. in tray example wrote trayhelper class creates trayicon. there want add menuitems , actionlisteners without creating every object myself , add them tray. wrote method...

graphics - Inkscape : How to ' crop ' something before 'saving' it? -

if open new inkscape document , type test and try save ( .svg ) the whole page saved. what want tiny icon reads ' test '. with no empty places around it. sort of "cropped" edition. you can file -> document properties or shift+ctrl+d then resize page content , click resize page drawing or selection now when save it, should have desired dimensions. cheers