Posts

Showing posts from August, 2011

Cannot call methods on dialog prior to initialization -

i trying open div in jquery dialog. after opening div dialog, when click on overlay area, error. cannot call methods on dialog prior initialization. attempt call method 'close'. here tried far: <div class="mydiv"></div> var options = { modal: true, draggable: true, resizable: false, position: "center", buttons: { ok: function () { $(this).dialog("close"); } }, close: function () { $(".ui-dialog").remove(); } }; var dg = $(".mydiv").dialog(options); $(dg).dialog("open"); //document.ready $(".ui-widget-overlay").live("click", function () { $(".mydiv").dialog("close"); }); there may many div same class name ".mydiv". the buttons property takes array of objects define text property , click property containing event handler. var options = { modal: true, draggable: true, resizable: false,

Convert 3D drawing to 2D drawing In Autocad Using C# -

i have convert 3d drawing 2d drawing. have create tool automate this. i don't know how start , can materials. please give idea create tool. i using autocad2007 , have create tool in c#. autocad express tools has method called "flatten" supposed handle this. has used knows doesn't job done. this feasible, , can use in-process autocad libraries natively in c# walk through entities. (acmdg.dll, acdbmdg.dll) i approach entity type. each entity handles z-axis differently in autocad, i'd group them buckets beforehand , deal them in batches. lines easy, can change z-axis on start , end points 0, , polylines have elevation if remember correctly. 3d polylines need each vertex walked through , set individually. circles can have center point set directly z = 0... see i'm getting at. go through autocad documentation , strategy every entity type you'll encounter. this tricky things blocks, because you'll have block definition deal to

converter - JSF Save value of input before conversion -

i have input field user enter social security number(userid). number has in format use custom converter format correctly. later number checked against db. when check fails, want number displayed way user entered ux reasons. conversion before check , userid in backing bean set converted value, original number lost. best way save original value? <h:inputtext id="userid" value="#{bean.userid}"> <f:converter converterid="idconverter" /> </h:inputtext> if understand problem correctly not need save original value. take advantage of jsf lifecycle. in addition custom converter, need custom validator. in validator, if check between converted input , data on db successful getasstring of custom converter return converted input. however, if conversion succeeds validation fails (meaning check against db record unsuccessful) throw validatorexception . getasstring not called , raw input displayed. there 2 ways can think of on

c# - Xamarin.Mobile Create, Update & Delete Contacts -

on platforms xamarin.mobile allow creation, updating , deleting of contacts? specifically, allow on android? doesn't seem case, according research of apis. i'm going 'no' based on both api , getting started page xamarin... android xamarin.contacts requires read_contacts permission (surprise) strictly reading contacts. source: xamarin.mobile getting started for potential solutions outside of using xamarin.mobile component, check out this answer on similar thread.

java - Multi Threaded Port Scanner, scanning multiple IP's. How can I ensure that the ip's are scanned one at a time -

i building port scanner can scan ip range. have got point parameters correct , multithread port scanner works single ip, problem have when trying scan range of ip's starts of x number of multithreaded scanners (x being number of ip's) @ same time , of course causing memory problems. wondering how threadpools run sequentially. scanning single ip @ time in order. this code have defining list of ip addresses , putting them multithread scanner. else if (chkiprange.isselected()==true){ system.out.println("multi ip scan started"); if(multiscanner==null && errorcheck()==0 || isscanning==false){ isscanning=true; lstmessagesmodel.clear(); listlisteningmodel.clear(); btnscan.settext("stop"); lstmessagesmodel.addelement("scan started..."); int p1 = integer.parseint(txtstartport.gettext()); int p2 = integer.parseint(txtfinalport.gettext()

access violation - Exception with std::string and How to find Platform Toolset of compiled c++ application -

we have dll (developed our company, have source) hosted , loaded application (we don't have source code), lately have lot of access violation exception because of std string: 76fae228:000196 [76fae3be] rtlinitializegenerictable (ntdll.dll) 76fadfa5:00007e [76fae023] rtlgetcompressionworkspacesize (ntdll.dll) 749714c9:000014 [749714dd] heaplock (kernel32.dll) 730b3b4e:0000cd [730b3c1b] free (msvcr90.dll) 736a5dfb:000035 [736a5e30] ?_tidy@?$basic_string@du?$char_traits@d@std@@v?$allocator@d@2@@std@@iaex_ni@z (msvcp90.dll) 736a5ebb:000009 [736a5ec4] ??1?$basic_string@du?$char_traits@d@std@@v?$allocator@d@2@@std@@qae@xz (msvcp90.dll) as can see using multi threaded dll (/md) runtime library , using platform toolset v90... we suspect hosting application changed platform toolset newer version , causing issue, problem cannot find out platform toolset of hosting application (they using multi-threaded (/mt) runtime library) process walker didn't well... how can find platfor

knockout.js - inserting a div between divs using knockout -

im using knockout , want insert / show div between 2 divs. im creating employee details page. employees listed , when user clicks on employee want / details show under employee <div>user 1</div> <div>user 2</div> <div>user 3</div> clicked <div>user 1</div> <div>user details etc</div> <div>user 2</div> <div>user 3</div> im storing selected user in editable property populated when employee clicked , using binding can user come after users, details come under relevant employee. ideas? heres link quick fiddle ive done knockoutjs doesn't manipulate dom way. use jquery or native js document.createelement('user details etc') , append between users divs. closest behavior in knockout if binding. explained @ end. still needs there defined @ first, , knockout can control it. for knockout way can start visibility: <div>user 1</div> <div data-bind="visi

android - how to compress my mp3 files to reduce apk file size? -

i'm developing android application has on 111mb of mp3 files. i need compress these files , put them in package (like raw folder) , after app installed on device, decompresses files use them. how this? possible? you can reduce mp3 file size reducing bit rate. reducing bit rate result in smaller file size lower quality, have check works best you. can improve quality using variable bit rate (vbr) instead of constant bit rate (cbr). you can using software such audacity .

excel vba - Copying cell with VBA using If statement -

i'm beginner vba , i'm wondering how add if else statement code: want enable copy cells if filled , if not filled msgbox must pop-up code: private sub commandbutton3_click() application.screenupdating = false dim nextrow range sheet1.range("f7,f10,f13,f16,f19,f22,f25,f28").copy sheets("overzicht").select set nextrow = activesheet.cells(cells.rows.count, 1).end(xlup).offset(1, 0) nextrow.select selection.pastespecial (xlvalues), transpose:=true msgbox "invoer opgeslagen" application.cutcopymode = false application.screenupdating = true end sub welcome stackoverflow.com you have wrap copy code block for loop , if-else statement , boolean type variable. firstly, want iterate on specified range of cells , make sure filled dim allfilled boolean dim long = 7 28 step 3 if not isempty(sheet1.range("f" & i)) allfilled = true else

php - Sonata Admin: How to represent a Many to Many in the edit form when the associated entity has thousands of records? -

in entities, have many many relationship between roles , users /** * @orm\manytomany(targetentity="user", mappedby="roles") */ protected $users; in edit form role entity i'd able see users role, , add , remove users too, added users field in configureformfields protected function configureformfields(formmapper $formmapper) { $formmapper ->add('name') ->add('description') ->add('users'); } the problem sonata's approach naive: render form, executes 1 query retrieve fields of role, 1 retrieve fields of users role, , 1 retrieve fields of all users in database !!! as have more 20,000 users in database, uses more 250mb of memory . is there way instruct sonata show paginated list search or that? could pcdummy/ajaxcompletebundle of interest? have stumbled upon today. and suggest creating separate intermediate users_roles entity (and admin it). then, using sonata_type_collect

How to create and use a database in java -

i have developed java gui application uses ms access database. but, after research came know can store 2 gb data. planning replace other database. which free , easy use sql database? java connectivity mysql db: http://www.vogella.com/articles/mysqljava/article.html step step explanation: http://www.roseindia.net/jdbc/jdbc-mysql/mysqlconnect.shtml apache derby: it relational database similar mysql developed apache. tomcat server as name says, server, listens request on particular port, process dynamic request , respond client.

performance - JQuery animate slower every call -

i have modal box open jquery. when close buttons called, modal box closed. works fine, more open , close modal box, longer takes modal box close: window.closemodal = function () { modal = $("div.modal-overlay"); windowheight = $(window).height(); // until here performance modal.animate({top: windowheight, }, 800, function () { // problem modal.hide(); $("body").css("overflow-y", "scroll"); }); } i have put console logs on every line, , executed instantly until hit modal.animate function. every time open modal, , press close button, takes more time until modal.animate starts executing. can shed light please. @edit: have created jsfiddle shows problem. just press open modal, close modal. 4-5 times see delay become bigger http://jsfiddle.net/cz54c/ @@edit: strange happens. although openmodal executed once, iframe.load executed # times modal opened , closed ... window.openmodal = fun

c++ - Calling a functor in a std::map with boost::bind -

i having trouble this, , couldn't find solution on so. took me while figure out thought i'd post it, in case useful else problem: have set of functors of different types, want store in std::map , call later sort of switch statement/factory. class foo { public: void operator() (int x) { std::cout << "in foo" << x << std::endl; } }; class bar { public: void operator() (int x) { std::cout << "in bar" << x << std::endl; } }; the map looks like std::map<int,boost::function<void(int)>> maps; and inserts like maps.insert(std::make_pair(1,boost::bind(&foo::operator(),foo(),_1))); and can call like auto iter = maps.find(1); iter->second(123); looking @ solution it's quite simple 1 liner, compared mental gymnastics trying figure out - oh :) what trying store boost::signals2::signal objects chain set of factories,in map, never did figure out. question, how

email - Sent mail from php goes into spam folder -

this question has answer here: prevent sent emails treated junk mails using php mail function 14 answers i used tutorial sending mail : http://www.velvetblues.com/web-development-blog/avoid-spam-filters-with-php-mail-emails/ my code looks : $headers .= "reply-to: sender <sender@sender.com>\r\n"; $headers .= "return-path: sender <sender@sender.com>\r\n"; $headers .= "from: sender <senter@sender.com>\r\n"; $headers .= "organization: sender organization\r\n"; $headers .= "mime-version: 1.0\r\n"; $headers .= "content-type: text/plain; charset=iso-8859-1\r\n"; $headers .= "x-priority: 3\r\n"; $headers .= "x-mailer: php". phpversion() ."\r\n" mail("recipient@recipient.com", "message", "a simple message.", $headers); i using

c++ - Two phase construction at real time system -

Image
i developing real time system, , debating design of classes. specific, can't decide whether build "heavy" classes using 2 phase construction. on 1 hand, calling constructor of "heavy" class can major bottle-neck @ running time, , saves me creating classes , allocating memory of features user might won't use. on other hand, 2 phase construction can makes surprises during execution, considering situation when try access ability, can't since didn't initialize, , need build before using. my tendency go 2 phase construction method. hear pros\cons 2 phase construction @ real time system. , if there better approach toward this. here code example of heavy class (my classes sure won't that, demonstrate idea): class veryheavy { private: heavyclass1* p1; heavyclass2* p2; heavyclass3* p3; heavyclass4* p4; heavyclass5* p5; int* hugearray [100000]; //...// }; this agc, apollo guidance computer

javascript - Can an id of an html be related even between different html documents that are referenced to each other? -

this hard question explain. for example, if have function "randomfunction" in javascript file "somefile.js," , in html have button activates function "randomfunction," has "somefile.js it's script, 2 "randomfunction"s cooperate each other? hope makes sense... yes. there single execution environment per page javascript. anything placed global scope 1 script can access other script script on page.

c++ - error LNK2001: unresolved external symbol despite inclusion of header file -

i have problem can't seem resolve. have file jobdispatcher.cpp includes file #include "calculatenormalsjob.h" containing declaration of class same name. class calculatenormalsjob : public job { public: calculatenormalsjob(some params); ... }; the file calculatenormalsjob.cpp contains following definition calculatenormalsjob::calculatenormalsjob(some params) : job(params) { } both calculatenormalsjob.h , calculatenormalsjob.cpp in same project , folder jobdispatcher.cpp creates job object as add(new calculatenormalsjob(some params)); during linking, receive following error error 9 error lnk2001: unresolved external symbol "public: __thiscall calculatenormalsjob::calculatenormalsjob(class resourcemap *,class jobscheduler *,class job *,int)" (??0calculatenormalsjob@@qae@pavresourcemap@@pavjobscheduler@@pavjob@@h@z) c:\fredrik\vs12\proflexa\scanner\jobdispatcherjob.obj i clueless have forgotten. i'm using visual studio 2012

java - AsyncTask/Handler lagging UI -

so have asynctask gets data website, , on it's post execute calls main function settext main's textview. here code. @override protected void doinbackground(string... arg0) { result = connect(start);//connect webpage, start url // todo auto-generated method stub return null; } @override protected void onpostexecute(void result) { super.onpostexecute(result); document doc = jsoup.parse(this.result); elements stuff = doc.select("td"); mainactivity.getdata(doc);//set textview } i call handler every 5 seconds, here handler code. hand = new handler(); r = new runnable() { @override public void run() { dh = new downloadhelper("http://app2.nea.gov.sg/anti-pollution-radiation-protection/air-pollution/psi/psi-readings-over-the-last-24-hours"); dh.execute("");// todo auto-generated method stub hand.postdelayed(this, 10000); } }; hand.post(r); wh

javascript - jquery: display one element on top of another and disable mouse hover event on it -

here fiddle: http://jsfiddle.net/5lfqr/ the fiddle contains html pair of images (thumb , big): <div class="wrapper"> <a href="http://cssglobe.com/lab/tooltip/02/1.jpg" class="preview" title=""> <img src="http://cssglobe.com/lab/tooltip/02/1s.jpg" alt="gallery thumbnail"> </a> </div> the idea display big image when user hovers mouse on thumbnail. this solution simple , works except 1 thing: originally, offset of big image right , down of mouse position. big image over thumb , should cover it. when implement it, changing offset this: xoffset = -100; yoffset = -100; the big image flickers. it's because mouse cursor on thumb , @ same time on big, can't decide do. big image should become transparent hover. is there solution it? you way: place preview behind thumbnail , turn thumbnail transparent on mouse-enter: http://jsfiddle.net/nthdb/ $(this).css("o

r - Testing multiple columns in a time series simultaneously -

library("xts") data1<- cbind(a = c(1,2,3,4,5,6,5,4,3,4,5,6,5,4,3,5), b = c(1,2,3,4,5,6,5,4,3,4,5,6,5,4,3,5), c = c(1,2,3,4,5,6,5,4,5,4,5,4,5,4,5,2), d = c(1,2,3,4,5,6,5,4,1,1,1,1,1,2,3,2)) data<- xts(data1, sys.date() - (16:1)) data b c d 2013-07-09 1 1 1 1 2013-07-10 2 2 2 2 2013-07-11 3 3 3 3 2013-07-12 4 4 4 4 2013-07-13 5 5 5 5 2013-07-14 6 6 6 6 2013-07-15 5 5 5 5 2013-07-16 4 4 4 4 2013-07-17 5 3 5 1 2013-07-18 4 4 4 1 2013-07-19 5 5 5 1 2013-07-20 4 6 4 1 2013-07-21 5 5 5 1 2013-07-22 4 4 4 2 2013-07-23 3 3 5 3 2013-07-24 5 5 2 2 i have data set contains 100 such columns. need method or define function can tell me how many such columns are, above 5 days sma (moving average) on given day. if give specific date , 5 days sma, should number of columns above sma and, if possible, column names too. you can use which and tabulate, order, etc. all <- which(data>5, arr.ind=true) table(all[,"

asp.net - Get file path without the file -

on web page, need allow users input path file - stored in database can subsequently display 'a list of documents apply project'. if put input type="file" on page, makes easy user browse document ... but, when form submitted, document uploaded server. don't want document, want path. how provide functionality allow user browse file record path file without uploading file itself? i want end showing, on web page, list of files like: \myserver\folder20\somefolder\somefile.doc \myserver2\folder50\somefolder\somefile.doc i need give users easy way locate files in first place - without having laboriously open windows explorer, find file, , copy , paste path. file upload control gives access path - need - don't want file uploaded. i not sure if want. assuming selecting file using input type="file" html control, able complete file path in jquery , pass asp.net code behind using pagemethods (or ajax method of jquery). need create webm

smt - How to interpret statistics Z3 -

i following statistics in z3. (:added-eqs 24529 :binary-propagations 43837 :bv-bit2core 7115 :bv-conflicts 156 :bv-diseqs 10395 :bv-dynamic-diseqs 10028 :bv->core-eq 10401 :conflicts 409 :decisions 4840 :del-clause 84926 :final-checks 2 :max-generation 4 :memory 5.69 :minimized-lits 467 :mk-clause 88358 :propagations 90195 :quant-instantiations 3388 :restarts 3 :time 0.83) i'd know metrics used each result row. can me? disclaimer: have feeling interpreting statistics right way quite art, , z3 developers ones know how that. anyway, here know ... or believe: quant-instantiations indicates number of instantiated quantifiers. fewer instantiations better, of course don't want make patterns/triggers strict because z3 won't able prove anything. conflicts indicate assignment

c# - Regular expression to match a string that contains only numbers, not letters -

my code using following regex expression matches on numbers: regex numberexpression = new regex(@"(?<number>\d+)"); this current works fine input strings "1", "100", "1a", "a1", etc.... but want change not match when input string contains letter, "1", "100" match, "1a", "a1", not. can help, know simple regular expression question can't head around forward , backward looking. have tried: regex numberexpression = new regex(@"(?<number>^![a-za-z]\d+![a-za-z])"); but didn't work, , fails match of above input. you trying hard way, looking numeric substring of input, , looking see there isn't before or after substring. the easy way force regular expression either match entire input string or nothing: regex numberexpression = new regex(@"^\d+$"); where "^" means "beginning of line" , "$" means "e

How can i specify CSS Pixels -

i developing mobile web application our client , web designer send detailed specification screen design in specification mentioned height , width in "css pixels" logo positioned 116 css pixels top so css pixels , how can specify in css please help regards denny <div class="logo"> <img src="http://olea.org/ilustraciones/fedora-logo-icon.png"> </div> .logo { margin-top:116px; } http://jsfiddle.net/k6nmt/1/

C++ AMP suitable matrix library for inversion, QR decomposition -

i require matrix library c++ amp able perform basic operations matrix inversion arbitrarily sized matrices , qr decomposition. i found there blas amp implementation , not find anywhere stated whether or not blas can perform matrix inversion, can enlighten me capabilities and/or suggest more suitable parallel matrix library amp? thanks! edit : found lapack amp library capable of matrix inversion (i think), it's still in development :( as far know, best bet lapack library linked to. c++ amp still new , doesn't seem have large uptake in scientific computing far. there other c++ amp libraries in development may of interest you. algorithms blas fft random number generation generic kernels

java - How to deploy 2 war files to one instance of Tomcat7 on different ports? -

in netbeans, possible deploy 2 different war files 2 different ports in 1 tomcat instance ? i know can manually copying , pasting individual war files respective appbase folders or using copy-maven-plugin. possible in netbeans ? here server.xml file configuration <service name="app1"> <connector port="8080" protocol="http/1.1" connectiontimeout="20000" redirectport="8443" /> <engine name="catalina" defaulthost="localhost"> <realm classname="org.apache.catalina.realm.lockoutrealm"> <realm classname="org.apache.catalina.realm.userdatabaserealm" resourcename="userdatabase"/> </realm> <host name="localhost" appbase="webapps8080" unpackwars="true" autodeploy="true"/> </engine> </service> <service name="app2"> <connector

c# - File upload using ajax request -

i trying upload image, using ajax. sending request this: @using (ajax.beginform("savereferral", "referralim", new ajaxoptions { httpmethod = "post", onsuccess = "onsuccessreferralsent" }, new { id = "frmreferral", onsubmit = "oncontrolmapping(this);" })) { } if send request this: @using (html.beginform("savereferral", "referralim", formmethod.post, new { id = "frmreferral", enctype = "multipart/form-data" })) { file uploaded successfully, want use ajax ,please me how should file uploading ajax. thanks i not using mvc if want use $.ajax here is... $('.file-uploadid').on('click', function (e) { e.preventdefault(); var fileinput = $('.file-uploadid'); var filedata = fileinput.prop("files")[0]; // getting properties of file file field formdata.append("

runtime.exec - how to invoke sh file in linux terminal using Runtime.getRuntime().exec in java -

how invoke sh file in linux terminal using runtime.getruntime().exec in java ? i want invoke sh file in new terminal java code. if run in terminal runs separate process, not closed if programs exits. , thats why i'm not using processbuilder , stops process invoked if program using exits. if script marked executable ( chmod +x script.sh ), can invoke exec("./script.sh") . otherwise can directly call using exec("sh script.sh") .

jprofiler - JProfile jpexport csv output missing headings -

i'm evaluating jprofiler see if can used in automated fashion. i'd run tool in offline mode, save snapshot, export data, , parse see if there performance degradation since last run. i able use jpexport command export telemetryheap view snapshot file csv file (sample below). when @ csv file see 10 13 columns of data 4 headings. there documentation explains output more fully? sample output: "time [s]","committed size","free size","used size" 0.0,450,880,000,371,600,000,79,280,000 1.0,450,880,000,371,600,000,79,280,000 2.0,450,880,000,371,600,000,79,280,000 3.0,450,880,000,371,600,000,79,280,000 4.0,450,880,000,371,600,000,79,280,000 5.0,450,880,000,371,600,000,79,280,000 6.0,450,880,000,371,600,000,79,280,000 7.0,450,880,000,355,932,992,94,947,000 8.0,450,880,000,355,932,992,94,947,000 9.58,969,216,000,634,564,992,334,651,008 11.05,1,419,456,000,743,606,016,675,849,984 12.05,1,609,792,000,377,251,008,1,232,541,056 17.33,2,524

Remove image drawn on Highchart -

i have drawn 1 image on high-chart using chart.render.img method of high-chart. after clicking on button want update coordinates of img. but, there no update function image, trying remove , again add new coordinates. have stored img in 1 array , using array element trying remove image. not working. var symbol = new array(); symbol[0]= chart.renderer.image('assets/shared/images/green-line.png', xpoint, offset, width,height); symbol[0].add(); now after want update xpoint, offset, width & height. removing img. $(symbol[0].element).remove(); want again add using add method new coordinates. remove not working. just call "destroy" method: symbol[0].destroy();

java - Spring batch 2.2.0 and Hibernate 3 compatibility -

i using version 2.2.0 of spring batch , version 3.6.4 of hibernate. in java-based spring configuration want configure bean of class hibernateitemwriter this: @bean public <e> itemwriter<e> hibernateitemwriter(hibernateoperations hibernatetemplate) { hibernateitemwriter<e> writer = new hibernateitemwriter<e>(); writer.sethibernatetemplate(hibernatetemplate); return writer; } but in version of spring batch, method sethibernatetemplate of class hibernateitemwriter deprecated. /** * public setter {@link hibernateoperations} property. * * @param hibernatetemplate * hibernatetemplate set * @deprecated of 2.2 in favor of using hibernate's session management apis directly */ public void sethibernatetemplate(hibernateoperations hibernatetemplate) { this.hibernatetemplate = hibernatetemplate; } i tried configure hibernateitemwriter followed: @bean public <e> itemwriter<e> hibernateitemwriter(sessionfactor

objective c - Drop e-mail from mail.app into NSWindow object -

i have cocoa app accept e-mails mail.app dragged main window of app. have in applicationdidfinishlaunching: [_window registerfordraggedtypes: [nsarray arraywithobjects: nsfilenamespboardtype, (nsstring *)kpasteboardtypefileurlpromise, nil]]; //kuttypedata [_window setdelegate:(id) self]; this works fine, can receive document, in performdragoperation: using nsarray * files = [sender namesofpromisedfilesdroppedatdestination:url]; however, lets me drag emails one-by-one. if mark several emails, seems ok until drop, nothing happens. performdragoperation not called. i have tried add kuttypedata registerfordraggedtypes..., , performdragoperation... called, cannot use namesofpromisedfilesdroppedatdestination:url returns nil pointer. when had kuttypedata included in register... included in performdragoperation see types in drag: pboard = [sender draggingpasteboard]; nslog(@"perform drag entered, %@", [pboard types]); with following result: 2013

ticker - jQuery vTicker - Pause:true Resumes on Mouseover -

i have implemented jquery vticker plugin , along 'previous,' 'next,' , 'pause' link functionality. when click pause, ticker pause. the problem when ticker paused, if mouse-over ticker, resumes. can see happen on demo page of site posted above (click pause button in demo, mouse-over ticker below it). any ideas on how fix this? @matt - issue has been fixed , latest version 1.13 includes fix. have test covers issue now.

java - how to make a web services in android and connect it to a website to fetch the data -

i going create android application website of own academy.so have created application in android not know how create web services fetch data website?? i totally new in webservice , java programming. question should start learn , tried search example create webservice in java not able tutorial. it appreciated, if body me understand flow. thanks.. you need use cors fetch datasets website, android device not run web application, run activity runs webview ping website. can use java end fetch data well, using similar cors or socketing approach. that way, can stuff via javascript , via java. also, using cordova link both js , java together. keep in mind, application not people have unlimited data, try minimize fetched datasets as can. user, might not know mighht fetch 1 meg, might end doing 50 times, chews information.

powershell v3.0 - Error redirection not working -

i trying pipe output of script text file. this works: myscript > c:\output.txt the problem errors not included in output in text file (on screen are). when this: myscript 2>&1 c:\output.txt no file created (but still see on screen). i'm using powershell 3.0. doing wrong? i believe you're looking is: myscript > c:\output.txt 2>&1 the "> c:\output.txt" redirects stdout file the 2>&1 redirects stderr stdout when you've done stdout redirection, result redirection of both stdout , stderr c:\output.txt with "2>&1 c:\output.txt" you're redirecting stderr stdout, letting stdout still output console, , merely supplying c:\output.txt unused parameter script.

shader - OpenGL ES 2.0, texture image not filling screen -

Image
i want upload simple texture overlay square have drawn on screen. code without texture shows red square in centre of screen. im editing code overlay texture on top, every time try apply texture square distorts image , moves across screen. edit: whole code available here: http://codetidy.com/6291/ before texture applied: after texture applied: some sample code: void init() // create opengl 2d texture box resource. glenable(gl_texture_2d); glenable(gl_blend); glblendfunc(gl_one, gl_src_color); glgentextures(1, &texturehandle); glbindtexture(gl_texture_2d, texturehandle); // set texture parameters. gltexparameteri(gl_texture_2d, gl_texture_min_filter, gl_linear); gltexparameteri(gl_texture_2d, gl_texture_mag_filter, gl_linear); gltexparameteri(gl_texture_2d, gl_texture_wrap_s, gl_repeat); gltexparameteri(gl_texture_2d, gl_texture_wrap_t, gl_repeat); maopenglteximage2d(texture); edit: whole draw() function void draw()

html - HTML5 - Canvas, draw rectangle through div -

i've made example show problem is: http://jsfiddle.net/gsrgf/ html <canvas id="canvas" width="500" height="500"></canvas> <div id="div"></div> js $(function() { var ctx=$('#canvas')[0].getcontext('2d'); rect = {}; drag = false; $(document).on('mousedown','#canvas',function(e){ rect.startx = e.pagex - $(this).offset().left; rect.starty = e.pagey - $(this).offset().top; rect.w=0; rect.h=0; drag = true; }); $(document).on('mouseup','#canvas',function(){ drag = false; }); $(document).on('mousemove','#canvas',function(e){ if (drag) { rect.w = (e.pagex - $(this).offset().left)- rect.startx; rect.h = (e.pagey - $(this).offset().top)- rect.starty; ctx.clearrect(0, 0, 500, 500); ctx.fillstyle = 'rgba(0,0,0,0.5)'; ctx.fillrect(rect.startx, rect.starty, rect.w, rect.h); }

How to configure my application php sdk (facebook) -

i'm trying create first login php sdk, apparently have bad configuration of application, have made simple code learn sdk not run well, please make right. here sample code: require_once("src/facebook.php"); $config = array(); $config['appid'] = '{app id}'; $config['secret'] = '{app secret}'; $config['fileupload'] = true; $facebook = new facebook($config); echo $facebook->api('/me'); echo $facebook->getuser(); so far comment, think facebook app configuration issue. logged in facebook ie. https://developers.facebook.com . -> apps ->open app in edit mode. find "website facebook login". here put domain name, running app. http://yourdomain for development purpose, can set http://localhost/ in textbox. also set "app domains" same above. try again. hope problem solved.

vb.net - Should I keep using visual basic? -

microsoft's visual basic 1 of first languages started learning, , helped build interest in programming. recently, have been reading around language impractical or considered joke. i've been branching out other languages, java. in long run, worth me keep using visual basic write applications? or should move on , try , learn language. main interest developing gui applications, why liked visual basic because creating gui extremely easy. "visual basic joke" , old cliche no longer actual. visual basic.net first-class citizen .net platform , @ end produces same managed code c# , other clr languages. so if have used vb before - continue using vb.net, keep in mind has full support oop (inheritance, encapsulation etc.) while can simple migrate old code vb.net - learn new capabilities , use them.

android - Set opacity in framelayout or relativeLayout -

Image
edit: can me please ? i'm trying display button on supportmapfragment. <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <linearlayout android:id="@+id/menu_model" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" > </linearlayout> <framelayout android:id="@+id/content_parent" android:layout_width="match_parent" android:layout_height="match_parent" > <imageview android:layout_width="match_parent" android:layout_height="match_parent" android:contentdesc

backbone.js - Backbone with slider -

this scenario apply whole bunch of ui widgets, simple example i'll use slider (e.g. jquery ui slider). i have jquery slider notifies backbone.model when 'slides' when stops. views update in both cases. want add undo/redo functionality listen changes in model, , create undo objects each change, using previous() values. however, want create undo objects when slider stops, not on every change during sliding. so, need slider notify model of changes slider value in 2 different ways can distinguished undo code. at moment, i'm doing model.trigger('slidevalue', [newvalue]) while sliding , views listen , update on trigger. when slider stops, model.set('slidevalue', newvalue) , undo functionality listens these change events create new undo object , add queue. the reason i'm doing model.trigger('slidevalue', [newvalue]) allows me notify views model changing (so can render change), when come model.set('slidevalue', newvalue) when slid

sql - SELECT specific columns from EXEC stored procedure -

i having issue trying select specific columns exec statement on stored procedure. trying find count(*) stored procedure returns doing : insert #temp exec dbo.my_sp set @count = (select count(*) #temp) delete #temp however, works if columns returned match table columns , since trying find count of many different stored procedures (each of return different columns), cannot use method without creating new table each stored procedure. is there way can select specific columns exec dbo.my_sp ? would @@rowcount work you? if object_id('someproc') null exec ('create procedure dbo.someproc select 1 somevalue union select 2 somevalue;') exec dbo.someproc select @@rowcount rowsaffected http://technet.microsoft.com/en-us/library/ms187316(v=sql.105).aspx

x86 - SSE multiplication of 2 64-bit integers -

how multiply 2 64-bit integers 2 64-bit integers? didn't find instruction can it. you need implement own 64 bit multiplication routine using 32 bit multiply operations. it's not going more efficient doing scalar code though, particularly there lot of shuffling of vectors required operations.

java - How to read the complete result of ftp transfer in storeFile() in FTPClient? -

my question regarding ftpclient . need detailed reply statistics. when use getreplystring() part of information. example: code is ftpclient ftp = new ftpclient(); //some code here ftp.storefile(hostdir + filename, input); system.out.println(ftp.getreplystring());// prints "226 transfer ok" when sucessful but need statistics when ftp manually using command prompt in 226 transfer ok ftp: 50 bytes sent in 0.09seconds 0.55kbytes/sec. how these stats using ftpclient? idea or link refer to? you can make manually, recording start , end of process. after, calculations, like: filelength / timeend - timestart. should work little more in these calculations.

orchardcms - Orchard - how to remove a field from a form (content type) -

Image
i have created 'content type' incorporates 'content part', allows user upload image. iv created 'form' uses image loader 'content type' display on screen, front end menu. however when user tries upload image front end text box displaying owner appears @ bottom. want set invisible. know how this? thanks go contenttypes dashboard,select contenttype - click edit , expand commonpart - uncheck show editor owner check box shown in picture :

Accept number of inputs based on a number given at runtime in ruby -

accept integer n based on n, accept n inputs ex: @ runtime n = 2 2 inputs of type string should accepted ex: @ runtime n = 3 3 inputs of type string should accepted array = [] n.times {array << gets.chomp}

android - ndk assertion failure Ubuntu 13.04 -

when try run ndk-build error: /home/adam/programs/adt-bundle-linux-x86_64-20130522/android-ndk-r8e/build/core/setup-toolchain.mk:20: * android ndk: assertion failure: target_platform not defined . stop. i in root project directory (i have tried jni folder same thing) i giving qualified path of ndk-build not happening new project, error occurs sample app comes ndk (hello-jni). i had no problems using ndk windows cmd prompt , cygwin. ubuntu 13.04 linux environment have tried. i using ndk-r8e linuxx86_64 (as can tell error message) so 1 reason or deleting old ndk , unpacking new 1 solved problem. same version , everything. files must have been corrupt.

How do I dynamically assign enum values using java spring bean -

i've got following code: package vb4.email; import org.springframework.beans.factory.annotation.value; public enum validaddresses { // todo: there cleaner way switch debugs? // how make bean-able? @value("${email.addresses.defaults.support}") default_support_address("support@example.com"), @value("${email.addresses.defaults.performance}") default_performance_support_address("speed@example.com"); private final string email; private validaddresses(final string email){ this.email = email; } @override public string tostring() { return this.email; } } as can see @value annotations, i'm looking "beanify" process. want benefits of enumerable construct, i'd make configurable in our .properties file. please keep in mind .properties file has key=value pairs used extensively throughout site. please keep answers on mark; i'm not looking debate vali

php - str_replace exact match only -

good day, i trying create morse code text , text morse code converter. my code: $letter = str_split(strtolower($_post['text'])); $morse = $_post['morse']; $morsecmp = explode(" ",$morse); $letter = implode(" ",$letter); $mode = $_post['sub']; $morsecode = array(".-","-...","-.-.","-..","..-.","--.","....","..",".---","-.-",".-..","--","-.","---", ".--.","--.-",".-.","...","-.","..-","...-",".--","-..-","-.--","--..","."); $letters = array("a","b","c","d","f","g","h","i","j","k","l","m","n","o","p","q","

javascript - Collect variables using a loop -

i have commented on answer found; however, have created account , not have required reputation. answer on link: calculate average of 5 numbers using 2 functions , onchange event handlers if scroll down, answer given robg. in script mentions can collect variables in loop instead of manually calling them, not how this. if give me insight on how this, appreciated. thanks in advance, have spent close 7 hours trying figure out. here's code other page: function calcavg(one, two, three, four, five) { // note these collected using loop var 1 = document.totalf.one.value; var 2 = document.totalf.two.value; var 3 = document.totalf.three.value; var 4 = document.totalf.four.value; var 5 = document.totalf.five.value; // @ point you'd validate values retrieved // form , deal junk (remove it, stop processing, // ask value, etc.) // pass values performcalc , store result var average = performcalc([one, two, three, four, five]);