Posts

Showing posts from February, 2011

What should I store in Git? -

i have several projects want control using git. each project consists of source code created in visual studio, pad file (xml file), multiple .txt files, several .psd files (photoshop files), .jpg/.png/.bmp files, compiled setup file, etc. files should store in git repository , not? i know text files pad file or .txt files ok store in there, .psd files, image files , compiled setup? there article describing why not idea put binary data in git? one great advantage of putting inside git when tag specific software version (which released public), once checkout tag, associated particular release - setup file, source code, images , promotional material, , i'm in time without having finding additional files somewhere else. downsides? how have solved in company? i put binaries in git too. why not? psds aren't changing throughout development stage designs have been fleshed out example, if check them in...

c read() causing bad file descriptor error -

context program reading through filestream, 4k chunks @ time, looking pattern. starts reading in 4k, , if doesn't find pattern there, starts loop reads in next 4k chunk (rinse , repeat until eof or pattern found). on many files code working properly, files getting errors. the code below highly redacted, know might annoying, includes lines reference file descriptor or file itself. know don't want take word it, since i'm 1 problem... having done little homework before crying help, i've found: the file descriptor happens = 6 (it's 6 files working), , number isn't getting changed through life of execution. don't know if that's useful info or not. by inserting print statements after every operation accesses file descriptor, i've found successful files go through following cycle "open-read-close-close" (i.e. pattern found in first 4k) unsuccessful files go "open-read-read error (bad file descriptor)-close." no premature clos...

php - cakephp: '/Array' in pagination results? -

i'm using custom route present specific search results on page. first page of results loads fine, pagination includes '/array' before parameters , links not pull results. manually removing '/array' url lets page load properly. failing url generated cake: http://www.advancelegaljobs.com/app/webroot/index.php/jobs/search/array/page:2/experience:0/industry:0/radius:north+carolina good url: http://www.advancelegaljobs.com/app/webroot/index.php/jobs/search/page:2/experience:0/industry:0/radius:north+carolina why '/array' being inserted? or how rid of it? update: i ended out using jquery strip '/array' out of pagination links. works, i'd implement proper fix.

Deploy GWT to Tomcat (servlet not running) -

what correct way deploy gwt app tomcat? have made gwt app server side code (servlets). works in hosted mode when copy war folder (after compiling) tomcat webapp directory , rename war folder correctly. my gwt app servlet in uri /mygwtapp, renamed folder mygwtapp. app loads correctly problem servlet not run i.e. /mygwtapp/servlet not run. all libraries needed server side code in web-inf/lib folder. reason this? thanks. by default, tomcat serves app named 'mygwtapp' context path '/mygwtapp'. (whereas gwt built-in jetty serves context path '/'.) your servlet paths '/mygwtapp/*'. means, in conjunction context path, servlets accessible '/mygwtapp/mygwtapp/*'. (try it: enter full url in browser - servlet complain missing, or doesn't support get, you'll know sure now, lives.) so have 2 options: tell client side call servlets @ '/mygwtapp/mygwtapp/*' (i think, taken care of automatically when using @remoteservice...

coding style - Opera extension -

to put simple: what's fastest way head element in injected opera extension script ? (faster waiting domcontentloaded) i insert bunch of styles loaded pages, , i'm not waiting domcontentloaded (because user wants see rendered css when page loads, usercss). so head element (document.getelementsbytagname("head")[0] or document.head) , insert style elements it; works on websites found out doesn't work on wikipedia because can't head element without waiting domcontentloaded. ps: know opera extensions inserted before other script mean head element isn't loaded when script inserted ? why work on sites ?? afaik, can document.documentelement.appendchild() right away in extension's script. browser should sort things out fine.

document - which version of PDF for general use/distribution? -

i lot of quick-and-dirty pdf creation of long documents (100+ pages), distribution clients; clients individuals, corporate managers @ banks , insurance companies. acrobat pro allows save in many versions of pdf, acrobat 4 - acrobat 10. should use, general rule? i don't use advanced features in documents: pictures , text. since send via email, want best compression possible... documents have lots of images. however, since clients banks , such, not cutting-edge technologists, don't think have recent acrobat/pdf reader installed. what best pdf version, compromise between document compression , widespread adoption? i recommend pdf 1.4 - acrobat 5. pdf/a-1 (pdf archiving) standard based on pdf 1.4.

asp.net - Chrome returns "Bad Request - Request Too Long" when navigating to local IIS Express -

i have web application runs fine when use visual studio 2010 development server (cassini). when try use iis express host site chrome displays "bad request - request long" error. iis express site display in other browsers (firefox , ie9) i'm kind of confused. error occurs in chrome when try request pages in application or basic resources image, don't think issue url rewriting or routing. just see if problem somehow result of site's code, created new mvc3 website , tried running that. worked in vs development server, once again produced "bad request" error when running under iis express. i start testing site using mobile devices need running under iis. suggestions appreciated. edit: root url of site (http://localhost:50650/) being requested using get. using chrome v12.0.742.112. i time in chrome , have clear browsing data fix it. wrench > tools > clear browsing data check following: clear browsing history clear downloa...

java - JComboBox Action listener -

i'm having problem. have multiple jcomboboxes (5 total). to each combobox add actionlistener, same actionlistener of them, called: comboboxactionperformed(java.awt.event.actionevent e) and when action performed @ event (e) , do: jcombobox c = ((jcombobox)e.getsource()); //do work relating c thats combobox triggered. but problem when change in of comboboxes action triggered last combo box attaching actionlistner. anyone have idea? i switched itemlistner. im doing a class myactionlistner implements itemlistener { //stuff @override public void itemstatechanged(itemevent evt) { //do stuff } } public jcombobox createcombo() { jcombobox box = new jcombobox(); box.setmodel(new javax.swing.defaultcomboboxmodel(new string[] { "val1", "val2","val3" })); rulesactionlistner actionl = new rulesactionlistner(); box.additemlistener(actionl); return box; } ...

How to integrate jQuery UI.Layout Plug-in in AJAX site? -

i successful used jquery ui.layout plug-in in test pages, failed when tried integrate layouts in ajax website. when load page uses layouts ok first time, second time try load same page layout plugin don't work. simplifying i've noted problem not ajax, else layout plugin. simplest example i've found: function m() { $("body").html('xxx'); } function m2() { $("body").html('<div class="ui-layout-west">west</div><div class="ui-layout-east">east</div><div id="maincontent"></div>') outerlayout = $("body").layout( layoutsettings_outer ); } $(document).ready( function() { m2(); settimeout("m()", 3000); settimeout("m2()", 5000); }); when document loaded, layout ok. after 3 seconds layout disapears (as expected), , 2 seconds later original page back, every div works if layout plugin not loaded. i'll answe...

architecture - GLSL multiple shaderprogram VS uniforms switches -

i'm working on shader manager architecture , have several questions more advanced people. current choice oppose 2 designs are: 1. per material shader program => create 1 shader program per material used in program. potential cons: considering every object might have own material, involves lot of gluseprogram calls. implies creation of lot of shaderprogram objects. more complex architecture #2. pros: shader code can generated each "options" used in material. if i'm not wrong, uniforms have set 1 time (when shaderprogram created). 2. global shader programs => create 1 shader program per shader functionality (lightning, reflection, parallax mapping...) , use configuration variables enable or discard options depending on material render. potential cons: uniforms have changed many times per frame. pros: lower shader programs count. less sp swich (gluseprogram). you might notice current tendency #1, wanted know opinion it. do...

c# - How to create a loop for the following case? -

/html/body/table/tr[1]/td[2] /html/body/table/tr[1]/td[4] /html/body/table/tr[3]/td[2] /html/body/table/tr[3]/td[4] /html/body/table/tr[5]/td[2] /html/body/table/tr[5]/td[4] so, index of tr[ ] odd numbers, , td[ ] either 2 or 4. for(int = 1; < bound; += 2) { for(int j = 2; j <= 4; j += 2) { console.writeline( string.format("/html/body/table/tr[{0}]/td[{1}]", i, j) ); } console.writeline(); }

c# - SqlCommand Parameter not recognized -

why does scins.parameters.add(new sqlparameter("@v30", 0.00m)); lead "@v30 undefined" error, decimal dzero = 0.00m; scins.parameters.add(new sqlparameter("@v30", dzero)); works ok? sqlparamter has 2 different overloads 2 parameters, first being string , second being sqldbtype or object. in first case when 0.00m gets passed in gets converted int64, , in second case because value passed in of type decimal used sqldbtype.decimal. check out link update : found stackoverflow question talks , has detailed answer. :)

java - How to see source code of particular class in eclipse? -

i want see source particular class. example, work junit , in code have line: result result = junitcore.runclasses(myclasstest.class); i want see how implemented result class. possible? i imported junit jar build path. using eclipse 3.6 helios. multiple ways: download sources , add them project build path use maven , set download sources use decompiler - example jd-eclipse

Break a loop when the user just input an enter in visual c++ or code blocks -

i want know how make stop while loop when user input enter without asking continue or , here code: int main() { bool flag = true; int userinput; while(flag){ cout<<"give integer: "; if(!(cin >> userinput) ){ flag = false; break;} foo(userinput); } } thanks in advance. use getline. break if string empty. convert string int. for(std::string line;;) { std::cout << "give integer: "; std::getline(std::cin, line); if (line.empty()) break; int userinput = std::stoi(line); foo(userinput); } std::stoi throw exception on failure, handle want.

c++ - How do you cast unsigned short data[32] to unsigned char* very fast -

if had convert unsigned short data1[32] to unsigned char* data2 in tight loop executed 10 million times function use best performance? using this reinterpret_cast<unsigned char*>(data1); but wondering if there better way reinterpret_cast holy grail of performance seeking coders, namely code results in 0 clock cycles.

objective c - iPhone console for nslog? -

how can see nslog messages when testing on device? way right have uitextview , put message in there, there must better way..thanks. i went seetings , turned on console still don't know how see them. thanks. these calls output devices system log. you'll able these xcode organizer when plug phone in.

sharepoint - Resizing content in RSS web part -

i have added rss viewer web part sharepoint 2010 site consumes daily feed dilbert. the comic strip receive bigger in size webpart size. how can change size of strip fits in web part? i have tried (and failed) following: changed size of web part strip size remained same.instead,horizontal , vertical scrollers appeared. i edited site page.in site page,i changed width of column web part in.in case,the strip got cropped.

How to determine Asp.Net Session Length -

the sessionstate time out value can configured via web.config <sessionstate timeout="x"/> my question is: how can determine through code, sessionstate timeout length is? you should able or set value using httpsessionstate.timeout

windows - Need help passing some LPCTSTR's to a function in C++ -

i'm new c++ , have question obvious. able use msdn example install service (http://msdn.microsoft.com/en-us/library/ms682450%28v=vs.85%29.aspx) if have in stand alone program. i'm trying add function inside project , having trouble passing lpctstr strings needs name, binary path etc. so far have tried: int install(lpctstr servicename, lpctstr servicedisplayname, lpctstr servicepath); i know wrong, having hard time finding out should use exactly. link pointing explanation fine. thanks! lpctstr long pointer const text string depending on whether targeting unicode/mbcs/ansi build you'd need const char* (ansi/mbcs) const wchar_t* (unicode) (from memory)

c++ - How can I convert MIDI Delta Time to Seconds or Microseconds? -

i need formula or explanation convert delta time seconds or microsecods. considering tempo, ticks, beats, time signature , division. on web there lot of information no explained. thank you. you can find formula converting ticks -> seconds in this answer .

Is using Rule Engine to implement chain of rules [complex business logic] overkill? -

recently, reading rule engines in jboss drools manual [ref - 2.2.5. strong , loose coupling]. below excerpt 'if rules coupled, chances rules have future inflexibility, , more significantly, perhaps rule engine overkill (as logic clear chain of rules - , can hard coded. [a decision tree may in order]). not strong or weak coupling inherently bad, point keep in mind when considering rule engine , in how capture rules. "loosely" coupled rules should result in system allows rules changed, removed , added without requiring changes other rules unrelated.' does mean, rule engine not suitable option implement complex business logic [tightly coupled rules or chain of rules]. in current project, have chain of rules i.e. outcome of 1 rule decides outcome of rule , on. application has many internal variables chain rules. thought rules engine might handle complexity added advantage of declarative rules , dynamic business logic. discussion in regard helpful ... s...

asp.net - check uploaded file in vb.net -

i need snippet check file validity (i'm allowing users upload xml files). need check whether uploaded file xml. best can think of check if extension ".xml". if replaced? you can try loading , catch exception: xdocument xdoc = xdocument.load("data.xml"));

liquid - Shopify: Product variant id's are outputting as literal strings, not numbers -

thanks in advance taking time read this. i'm developing "test shop" through partners account. in shop working expected accept product.liquid file. of variant id's products outputting literal strings, not numbers. using option_selection.js file jquery solution build multiple drop downs product. and of course since no id passed cart action "we not able add item shopping cart because no variant id passed us." so, thoughts on solution or what's causing appreciated. below sample of variant loop in place: <form id="add-to-cart" action="/cart/add" method="post" > <select id="variant-select"> <option>product options</option> {% variant in product.variants %} <option value="{{ variant.id }}">{{variant.title }} {{ variant.price | money}}</option> {% endfor %} </select> <input type="image" name="add...

logging - Log monitoring software whilst developing -

we have enterprise product monitor our logs in prod/qa. after run locally whilst i'm programming/developing monitor local log files, , pop-up sys-tray alert (or similar) when error (or other regex match) appears in monitored log file. would prefer lightweight , free. any advice appreciated. you can run splunk locally free under size of logs , has great regex ui slice , dice entries.

objective c - How to keep focus on NSStatusItem until toggling it again -

i'm building app uses nsstatusitem. i'm wanting nsstatusitem open when clicked , stay open until user clicks nsstatusitem again. of right now, opens menu nsstatusitem loses focus when click away or click on app. nsstatusitem's menu stay open until user clicks close it. here's code far make nsstatusitem. thanks -(void)awakefromnib{ statusitem = [[[nsstatusbar systemstatusbar] statusitemwithlength:nsvariablestatusitemlength] retain]; [statusitem setmenu:statusmenu]; [statusitem settitle:@"status"]; [statusitem sethighlightmode:yes]; } you best off implementing custom window opens when click status item rather using view attached status item's menu. menus have well-defined opening/closing/mouse tracking behaviour , trying change in subclass frustrating.

c++ - Determine max length of thrust::device_vector -

is there way determine maximum size of thrust::device_vector<t> can safely allocate? there isn't straightforward way aware of. usual approach has been this: const size_t mb = 1<<20; size_t reserved, total; cudamemgetinfo( &reserved, &total ); char fail = 0; while( cudamalloc( (void**)&pool, reserved ) != cudasuccess ) { reserved -= mb; if( reserved < mb ) { fail = 1; break; } } which starts total free memory returned cudamemgetinfo , decrements "reasonable" size (as best tell in gt200 era, gpu mmu has couple of different page sizes, 1mb being largest). loop continues until either allocation, or memory fragmented or exhausted single page fail. not pretty, seems work 99.999% of time.

variables - jQuery - Is it okay to use $('#ElementId') everytime? -

i learned how 'document.getelementbyid' counterpart in jquery (and it's more powerful). question is, okay use everytime or every line of code? here's how use now: $('#myparentelement').html('<tr id="' + $('#myelement').val() + '"><td>' + $('#myelement').val() + '</td></tr>'; isn't better if using variable reference object? var x = $('#myelement'); $('#myparentelement').html('<tr id="' + x.text() + '"><td>' + x.text() + '</td></tr>'; note i'm more concern of performance, not cleanliness of codes. dom selection expensive. cache it. var x = $('#myelement'); here's jsperf test . in chrome 13 on mac os x, variable reference on 1,000 times faster. this not due dom selection of course, construction of jquery object.

sql - Java JNI and ellipsis mess -

i have function in c adds row table. function takes arguments various orderings of ints, floats, , strings using ellipsis add_row(int arg1, int arg2, ...) , parses information based on how columns set up. i need call function java , using jni. i'm not sure best way java's stricter typing. i've considered few solutions none of them seem / i'm not sure how implement them: passing strings, passing jobjectarray, or passing cell values 1 @ time. any appreciated. thanks, ben this less problem java , jni , more problem of how call var args function in c dynamic list of arguments. see calling c function varargs argument dynamically suggests having 2 versions of var args function (although think convention more allow passthrough of existing va_list , rather constructing 1 (which seems quite involved)). the jni bit should define java native method object array arguments have c equivalent receiving array. use jni api convert values c equivalents (ints , a...

How to read an array from columns in Java? -

i have .csv file 177 rows , 18,000 odd cols.given column label, should pick particular column , default first 2 label columns. please me this, thanks all, priya so, what's question? parse csv file. can either implement or use third party code. if implement read line line, split lines line.split(",") elements , put data structure should map of lists: map<string, list<string>> table = new linkedhashmap<string, list<string>>(); use column name key , column values list elements. linkedhashmap preferable here preserve order of columns. read first line contains column names , create list instances: table.put(columnname, new linkedlist<string>()); additionally create array of column names: string[] columns = new string[0]; table.keys().toarray(); now continue iterating on data , populate table: string[] data = line.split(","); (int = 0; < data.length; i++) { table.get(columns[i]).add(data[i]); ...

How to develop some characteristics of Facebook social flash game? (more specific inside) -

i start learn flash as3 , trying make facebook social flash game. it's still long way go, yup, know that. have newbie questions stuck in head solve ^^ how facebook flash game divide data many parts loading? example, it's found if click on new item (ex: character cloth, hair, eyes, etc) , drag stage, need wait loading ....er sever(host), it? system of , how can learn it? ^^ so there many people playing game. therefore how can store accounts' data , load when start? 3.how fullscreen system work? 2 separate flash? thank lot concern , on silly questions ^^ (if possible, please tell me languages or programs need learn stuff :d) for point 3, mean using state.displaystate ? starts projector takes swf it's original browser location , plays in special full screen player. you use this: //go full screen stage.displaystate = stagedisplaystate.full_screen; //go normal stage.displaystate = stagedisplaystate.normal; in addition, must set allowfullscreen ...

php - SELECTED not working with <option> tag inside a for loop/ while loop -

i want 1 of options in drop down selected default, please see code <?php class html{ function output(){ $html='<td>'.'<select id="out">'; for($i=0;$i<21;$i++){ $html.='<option value="$i" if($i==5) { selected } >'. $i .'</option>'; } return $html; } } echo html::output(); ?> here want value 5 selected default,but getting selected value 20. thank you!! you're line incorrect. use instead: $html .= '<option value="' . $i . '"' . ( $i==5 ? ' selected="selected"' : '' ) . '>' . $i . '</option>'; i'm making use of ternary comparison operator .

How to import a tab delimited file in MySQL database using Java? -

i want import tab delimited file in mysql database. how can using java? this vague, sounds mysql specific question. here's manual loading files . default is: fields terminated '\t' enclosed '' escaped '\\' lines terminated '\n' starting ''

reporting services - How to retrieve data from AX query in SSRS data method -

everybody: i make ssrs report ax report tools. must data ax query. know how add dataset use ax query, not dataset can standard query, must create business logic type dataset because must process these data. when use business logic dataset, had learned how data sql query, , know how return datatable dataset. don’t know how data user-defined ax query. i can fetch data sql query below codes: datatable table = new system.data.datatable(); // new table variable table = axquery.executequery("select * inventtable"); but can’t build success codes below: remark: had created venttablesrs query in ax aot. datatable itemquerytable = fimcommonhelper.getparameterdatatable( fimaxqueries.inventtablesrs, new object[] { }, new object[] { }); i found class of fimaxqueries don’t include query( inventtablesr s). try found class of fimaxqueries is, don’t result. could tell me how write codes, can run ax query , retrieve result in ssrs ...

c# - Loop a DataGrid -

i usin compactframework c# vs 2005. how can loop datagrid in compactframework.i need cell value i binding datatable datagrid. in datagrid have text box column. user enter value in column. need value of column of rows. thanks try: mydgrid[rowindex, colindex];

php - How to secure the sign up process if there is no ssl -

i building sign page user sign member, , wondering how keep user's password secure if have no ssl-server. the way can imagine md5 encrypt user's password before sending server storing, , next time while in login page, password input md5 dynamic secret seed before sending server autheticate if user member. is idea? suggestion? have other option? thanks lot idea. the problem need kind of shared secret between client , server possible eavesdropper not know able encrypt it. eavesdropper can listen traffic between client , server beforehand, have kind of chicken , egg situation. only way out: use public/private key encryption. client encrypts password public key of server , sends it. 1 might open owner of private key, presumably server. have @ http://www.jcryption.org , might want.

c# - ProcessStartInfo WorkigDirectory parameter -

i have web application in want execute .exe file. processstartinfo info = new processstartinfo(); info.workingdirectory = this.workingdirectory; when put info.workingdirecoty = request.mappath("~"); info.filename = server.mappath("~/thefile.exe"); it works. when put them this: info.workingdirecoty = "~"; info.filename = "~/thefile.exe"; it doesnt work, why ?? , how can solve problem ?? or should use server.mappath??? as msdn says server.mappath method the mappath method maps specified relative or virtual path corresponding physical directory on server. and need give direct file path processstartinfo should use server.mappath in case if don't want use server.mappath because of reference system.web can create basedir property in library class, , pass out world have reference it. hope helps.

Win 7, Android, iOS SDK -

i working on application run on windows 7 tablet. suddenly, customers wanted same application runnable on windows 7, android , ios. have looked adobe flex , capable of building android , ios application same code. i wondering there sdk out there same thing flex build win 7, android , ios app @ once? phone gap provides decent support android , ios. not sure windows 7. before start off cross platform mobile article martin fowler worth reading.

javascript - jQuery Ajax post with both file and data?? -

these lines below form data need post using ajax request, , json response. <textarea type='text' id="newstatusbox">your status here...</textarea> link:<input type="text" id="newstatuslink"/> video:<input type="text" id="newstatusvideo"/> image : <input type="file" id="newstatusimage" size="20" /> <input type='button' value="post" id="status-post-button" onclick='poststatus()'/> when use $.ajax of jquery in poststatus() post data, i'm not getting image file in page. is there other solution achieve want? you cannot upload files via ajax unless people use recent browser. anyway, can use jquery form plugin . if have file upload field in form fallback hidden iframe instead of xhr. however, in case response must sent text/html , wrapped in <textarea> since cannot send proper json content type cause bro...

MySQL WHERE statement for finding expiry date within 2 days -

i have column named expiry holds expiry date of item in timestamp format. how execute mysql query select items expiry date within 2 days? thanks!! select * table expiry between(today(), today() + 2)

java - Resizing photos without text .. is RenderingHints necessary? -

i writing quick little java class resizes image various smaller sizes (thumbnail large/small/etc). have seen examples have renderinghints in it. output file larger without. my question is: necessary use renderinghints if images being resized have no text ? int img_width = 100; int img_height = 100; bufferedimage resizedimage = new bufferedimage(img_width, img_height, type); graphics2d g = resizedimage.creategraphics(); g.drawimage(originalimage, 0, 0, img_width, img_height, null); g.dispose(); g.setcomposite(alphacomposite.src); g.setrenderinghint(renderinghints.key_interpolation, renderinghints.value_interpolation_bilinear); g.setrenderinghint(renderinghints.key_rendering, renderinghints.value_render_quality); g.setrenderinghint(renderinghints.key_antialiasing, renderinghints.value_antialias_on); i started 45kb image, , output difference 3kb file (without renderinghints) versus 24kb file (with renderinghints) i suppose, after reading following stackoverfl...

c++ - Selectively populated vectors with substrings extracted from a source string -

i have char array, in contents following: char buffer[] = "i1 i2 v1 v2 i3 v3 i4 v4"; as may see, it's typical blank separated character string. want put sub-string(s) starting letter "i" vector ( ivector ), , sort elements in ascending order. @ same time, i'd want put sub-string(s) starting letter "v" vector ( vvector ), , sort elements in ascending order. other(s) (e.g. "do" in example) ignored. i'm not familiar stl algorithm library. there functions me achieve avove-mentioned job? thank you! you can iterate on substrings using std::istream_iterator<std::string> : std::stringstream s(buffer); std::istream_iterator<std::string> begin(s); std::istream_iterator<std::string> end; for( ; begin != end; ++begin) { switch((*begin)[0]) { // switch on first character // insert appropriate vector here } } then can use std::sort sort vectors, @billy has pointed out. consider using std:...

android - ArrayAdapter is updated late from Webservice in AutoCompleteTextAdapter -

i have autocompletetextview working arrayadapter. adapter updated webservice, when text changes. updated done in asynctask, supposed practice. working more or less, because suggestions after every key pressed based on strings retrieved in previous key pressed. there couple of problems related page, none of answers works me. anyway, had solution, inefficient , don't know why "official solution" fails. i think key in function udpates de arrayadapter in background. in asynchronous call webservices: private class doautocompletesearch extends asynctask<string, void, map<string, string>> { @override protected map<string, string> doinbackground(string... params) { // ask webservice data map<string, string> autocomplete = getresource.datalist(params[0]); return autocomplete; } @override protected void onpostexecute(map<string, string> result) { //mautocompleteadapter.clear(); * shoul...

Android Pre-installing NDK Application -

we trying pre-install ndk application /system/app directory. if open apk file in zip file manager, .so file inside lib directory. however, when preinstall apk file, apk's .so file not copied system/lib directory, causing application fail when launched in device. can please tell me should set in android.mk apk file .so file extracted apk file , copied system/lib directory? need include application in system image. any feedback appreciated. thanks, artsylar i had same need , after 2 days of heavy research, came solution problem. not simple , requires able modify android system code well. basically packagemanagerservice prevents system applications unpack native binaries (.so files), unless have been updated. way fix modifying pms.java (aptly named since trying solve problem put me in terrible mood). on system's first boot, check every system package native binaries writing ispackagenative(packageparser.package pkg) function: private boolean is...

java - How to use Array in Oracle's bpelx:exec BPEL extension -

i have created bpel process in there 2 java embed activity.and have on varibale(array type) @ bpel process level. following array variable xsd. <?xml version="1.0" encoding="utf-8"?> <schema attributeformdefault="unqualified" elementformdefault="qualified" targetnamespace="http://xmlns.oracle.com/registrationupload_jws/registrationupload" xmlns="http://www.w3.org/2001/xmlschema"> <element name="groupidarray"> <complextype> <sequence> <element name="groupid" type="string" maxoccurs="unbounded"/> </sequence> </complextype> </element> </schema> my requirement want add variables in array on java embed activity , use same filled array in next java embed activity. please suggest me points. sample code if possible please refer link. thanks ...

c# - How do I perform actions based upon email received in ASP.NET? -

how programmatically perform actions when e-mail message received ? receive email parse command email (possibly embedded xml) identify command, using switch statement execute command.

c# - WPF memory leak -

i have simple wpf application. in main window have stack panel , 2 buttons. first button adds 100 user controls (without data bindings, events, bitmaps), , second removes of them panel , calls gc.collect(). , there problems: 1. after clicked "remove" button first time not memory releases, , must click few times release more memory. 2. after 5 - 10 min memory releases few megabytes dont. for example after app starts takes ~22mb when adding 500 controls - ~60mb after clicked "remove" button first time - ~55mb (i wait time, memory not deallocated) click few times , memory fell down 25mb, dont understand this, new in wpf, , maybe miss want release memory immediately. <window x:class="wpfapplication10.mainwindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" title="mainwindow" height="385" width="553"> <grid...

android - Setting default App -

my app have feature send mail. if user use prompted open google-mail-app or mail-app. selection haven't checkbox set current user option default. possible extend selection default-checkbox? i know checkbox application such navigation. thx it's not possible hardcode application, user can following: tap menu button on phone , select android settings option. scroll down applications section , tap it. on next screen, tap manage applications , tab on subsequent screen. scroll down list of apps until see old browser listed , tap entry. on next screen "launch default" section , hit clear defaults button. source: http://lifehacker.com/5637923/change-the-default-application-for-any-android-phone-task

activerecord - Storing past relationships in rails -

i have item tracking system has item model has 1 many relationship invoice. meaning 1 invoice can have many items , item can belong 1 invoice. i've run need return item stock system means setting delivered boolean field false, unless set invoice_id nil still show awaiting delivery customer , if nil system have no record of ever invoicing customer item. the way can see of working have previous_invoices field stores ids of invoices been on. doing work items point of view item.previous_invoices make sense not show in invoice.items , items have been returned need db search condition. i'd rather not use many many association tiny fraction of items returned need use table. is there anyway of doing in rails or gem can handle finds on either side? the relationship between invoice , item is many-to-many, , you're causing difficulty avoiding implementing such. cleanest solution invoiceitems table 'returned' field check when pull invoice items, perhaps co...

java - Lwuit virtual keyboard error -

when click in keyboard error coming up java.lang.nullpointerexception @ com.sun.lwuit.virtualkeyboard.actioncommand(+81) @ com.sun.lwuit.form.actioncommandimpl(+81) @ com.sun.lwuit.button.fireactionevent(+47) @ com.sun.lwuit.button.released(+11) @ com.sun.lwuit.button.pointerreleased(+14) @ com.sun.lwuit.form.pointerreleased(+186) @ com.sun.lwuit.dialog.pointerreleased(+6) @ com.sun.lwuit.virtualkeyboard.pointerreleased(+19) @ com.sun.lwuit.component.pointerreleased(+10) @ com.sun.lwuit.display.handleevent(+151) @ com.sun.lwuit.display.edtloopimpl(+118) @ com.sun.lwuit.display.invokeandblock(+84) @ com.sun.lwuit.display.invokeandblock(+6) @ com.sun.lwuit.form.showmodal(+416) @ com.sun.lwuit.dialog.showmodal(+86) @ com.sun.lwuit.dialog.show(+89) @ com.sun.lwuit.dialog.showpacked(+411) @ com.sun.lwuit.virtualkeyboard.show(+7) @ com.sun.lwuit.dialog.showdialog(+9) @ com.sun.lwuit.virtualkeyboard.showkeyb...

sql server - one authentification for different applications -

i'm building 4 websites. should have same login-datas (user can registrate on website 1 , can use website 2 , 3 using same login-name). my idea use ms sql membershipprovider (good idea?). don't know place sql-mebershipprovider (in databse? or websites? -> sound getting chaos^^) a other idea i've read create webservice authentification? but think i'm getting problems data consitency, because think there no way point 1 database other (linking example usertable in database 1 texttable in databse 2). i want use mvc3 , ms sql-database. any experiences or ideas? lot! you can use separate membership database , point providers of each site @ database. if wanted use role provider have have same roles in 4 websites may not want. use central database handle authentication , create local user record in each website links central user database (you have linking manually i.e. no relationship). let role own role provider each site.

c# - To which character encoding (Unicode version) set does a char object correspond? -

what unicode character encoding char object correspond in: c# java javascript (i know there not char type assuming string type still implemented array of unicode characters) in general, there common convention among programming languages use specific character encoding ? update i have tried clarify question. changes made discussed in comments below. re: "what problem trying solve?" , interested in code generation language independent expressions, , particular encoding of file relevant. i'm not sure answering question, let me make few remarks shed light. at core, general-purpose programming languages ones talking (c, c++, c#, java, php) not have notion of "text", merely of "data". data consists of sequences of integral values (i.e. numbers). there no inherent meaning behind numbers. the process of turning stream of numbers text 1 of semantics, , left consumer assign relevant semantics data stream. warning: use...

MS Access setting to ignore date conversion error -

an access db imports fixed width text file; 1 column dates. when date not available, file's creator uses string "null" access puts row in table field null. but, when files started coming different field widths, copied db, tweaked starting/width values in input spec, , imported. now, rows null logging in (table)_import_errors error converting text date. i have found no setting (not changed any) explain it. 1 difference although both dbs in access 2000 format, original on machine still has access 2000, while new 1 being handled access 2003. is behavior change in access version? pre-processing file solution? thanks, david. that's have done (except excel part) if had not fixed itself. posted that, apparently didn't public admission access has bugs. the thing changed 2 other columns in fixed width plain text input wider. yet access "decided" discard whole row instead of date field 3 consecutive attempts. fourth time, still reported ...

objective c - InAppPurchase with Subcription type -

how add inapppurchase subscription type in iphone application? you can read in in-app purchase programming guide http://developer.apple.com/library/ios/#documentation/networkinginternet/conceptual/storekitguide/renewablesubscriptions/renewablesubscriptions.html#//apple_ref/doc/uid/tp40008267-ch4-sw2

Customised Android Home Screen with default Widget -

i have customised home screen sample application there in android sdk samples, , trying add clock widget there.this home screen sample doesn't have option in menus add widgets. , objective digital clock , whether in home screen. can pls suggest me how proceed ? use different home screen basis research. launcher2 home screen in android open source project, , there may third-party home screen implementations open source well. looking classes appwidgethost , appwidgethostview .

memory - Android - view.Surface OutOfResourcesException -

my android app seems not releasing views when move around inside of listview navigation , standard menu key. after hundred or different (of 10 or unique views) loads, starts lagging , black screening. error log: 07-01 09:54:42.913: info/activitymanager(1279): starting: intent { cmp=com.site.android.conferencecompanion/.search } pid 31290 07-01 09:54:43.013: error/msm7x30.gralloc(1279): /dev/pmem: no more pmem available 07-01 09:54:43.013: error/msm7x30.gralloc(1279): couldn't open pmem (no such file or directory) 07-01 09:54:43.013: error/msm7x30.gralloc(1279): gralloc failed err=out of memory 07-01 09:54:43.013: warn/graphicbufferallocator(1279): alloc(480, 800, 1, 00000133, ...) failed -12 (out of memory) 07-01 09:54:43.013: debug/graphicbufferallocator(1279): allocated buffers: 07-01 09:54:43.013: debug/graphicbufferallocator(1279): 0x290740: 1500.00 kib | 480 ( 480) x 800 | 1 | 0x00000133 07-01 09:54:43.013: debug/graphicbufferallocator(1279): 0x307448: 6...

What's the difference between File and FileLoader in Java? -

so have following code should read text file (this main class): import gui.menuwindow; import java.io.ioexception; import javax.swing.joptionpane; public class assessor { public static void main(string args[]) throws ioexception { fileloader file = new fileloader("example.txt"); try{ new menuwindow(file.loader()); } catch(exception exc) { joptionpane.showmessagedialog(null, "error reading file"); } } } then i'd have load text listbox using swing. thing i've found new code read text file: import java.io.bufferedreader; import java.io.file; import java.io.filereader; import java.io.filenotfoundexception; import java.io.ioexception; public class readtextfileexample { public static void main(string[] args) { file file = new file("test.txt"); stringbuffer contents = new stringbuffer(); bufferedreader reader = null; try { reader ...

php - jQuery json_encode -

i've looked around javascript/jquery function emulates php's json_encode , ones find (listed bellow) don't work. http://code.google.com/p/jquery-json/ http://phpjs.org/functions/json_encode:457 to check if wasn't array wasn't faulty used phpjs var_dump expected results. can point me in right direction? the problem cannot this: ret[$(this).attr("id")] = _recursiveitems(this); because var ret = [] declares ret array , not object , $(this).attr("id") non-numeric (its value head_1 ). attempting create associative array not supported. . javascript associative arrays are meant numeric , considered harmful . if change declaration var ret = {} can use jquery-json convert object json. here demo using code in question.

html - Twitter OAuth (PHP): Need good, basic example to get started -

using facebook's php sdk, able facebook login working pretty on website. set $user variable can accessed easily. i've had no such luck trying twitter's oauth login working... quite frankly, github material confusing , useless that's relatively new php , web design, not mention many of unofficial examples i've tried working through confusing or outdated. i need getting twitter login working--i mean basic example click login button, authorize app, , redirects page displays name of logged in user. i appreciate help. edit i'm aware of existence of abraham's twitter oauth provides close no instructions whatsoever stuff working. i tried abraham's twitteroauth github , seems work fine me. did git clone https://github.com/abraham/twitteroauth.git upload webhost domain, say, www.xyz.com go twitter apps , register application. changes need (assuming use abraham's twitteroauth example hosted @ http://www.xyz.com/twitteroauth ) a) ...

android - LinearLayout Styling and XML file -

i want insert new line in layout. in first line have 4 simple textviews , on second line want have buttons .. searching throw internet got answer this: <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:gravity="center" android:layout_width="fill_parent" android:layout_height="wrap_content" <linearlayout android:orientation="vertical" android:layout_width="wrap_content" android:layout_height="fill_parent"> </linearlayout> </linearlayout> but when im looking @ desinger im getting wigets on same line im wrong ? please try this...... <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:gravity="center" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content"> <linearlayout android:orientatio...

jsf application performance improvement tips -

how improve performance of jsf myfaces based application ? some tips have collected far trinidad set following init parameters false in web.xml org.apache.myfaces.trinidad.debug_javascript org.apache.myfaces.trinidad.disable_content_compression org.apache.myfaces.trinidad.check_file_modification use client-side state saving clear pageflow context map when not in use myfaces set following init parameters false in web.xml org.apache.myfaces.compress_state_in_session org.apache.myfaces.serialize_state_in_session org.apache.myfaces.pretty_html org.apache.myfaces.validate reduce value of org.apache.myfaces.number_of_views_in_session init param (default 20) facelets set following init parameters false in web.xml facelets.development facelets.skip_comments set facelets.buffer_size , com.sun.faces.responsebuffersize large value 10000000 set facelets.refresh_period -1 is there else add ? came across following link. useful if you're using ...

Regex to replace email addresses -

i wish replace email addresses in string else. not work me. string body = "this test abc@emailadx.com"; string pattern = @"\b[!#$%&'*+./0-9=?_`a-z{|}~^-]+@[.0-9a-z-]+\.[a-z]{2,6}\b"; regex.replace(body, pattern, "hidden email address"); return body; any hints helpful please. you want this: return regex.replace(body, pattern, "hidden email address"); if @ documentation regex.replace , you'll see returns newly replaced string. not affect string passed in. note : assuming you're using c#. i'm guessing are, syntax. furthermore : if regex still isn't working well, try 1 regular expressions cookbook (by goyvaerts & levithan): @"^[\w!#$%&'*+/=?`{|}~^.-]+@[a-z0-9.-]+$"

javascript - Get my OS from the node.js shell -

this question has answer here: how determine current operating system node.js 6 answers how can access os node shell? context: i'm writing script in node want open file default program, , commands doing vary across os. i've tried standard javascript ways of getting os, haven't worked (for obvious reasons, there no navigator in node). is possible without installing nonstandard modules? warning : might outdated there no navigator object in node.js, because not run in browser. runs in system. "equivalent" navigator process . object holds many information, e.g. process.platform // linux if want run web browser, have execute it.. var sys = require('sys') // open google in default browser // (at least in ubuntu-like systems) sys.exec('x-www-browser google.com') this might not work in newer node.js versions (i...

actionscript 3 - Two native AIR windows from a single AIR app? -

i'm building in flashdevlop pure as3. i'm looking @ building kiosk uses 2 screens. used administer tests. 1 screen has test, second controls admin test. have played wide app not elegant , both screens run full screen on each screen. possible have 1 air app spawn 2 native air windows? secondary question possible detect multiple screens , target screen full screen to? simple checking window size detect work, im not sure can move , if low level api fullscreen on screen. not find examples of in docs. what docs did into? found right away. you'll need screen class if want information on screens connected pc. , here's documentation on using it. to create new windows, instantiate new nativewindow class , call activate() on when you're done configuring. there's lot of other useful stuff in flash.display package. air stuff marked little air icon. have admit have been easier find if had put these classes in separate air package.

r - Having trouble getting coefplot() to plot two regressions on top of each other -

i trying use coefplot(), described in article: http://www.r-bloggers.com/visualization-of-regression-coefficients-in-r/ however, when run exact code, 1 regression plotted, rather 3. here screenshot showing exact code have run, plus output plot. http://i.imgur.com/ytdnd.png i not sure else do. appreciated. the code coefplot not accept argument offset anymore. it's not in documentation , not in formals list. can make version modifying code coefplot: type coefplot2 return . copy-paste function command line , precede with coefplot2 <- # rest of pasted function should follow then add voffset=0 formals list , change line: arrows(ci1, (1:k), ci2, (1:k), lty = lty[1], lwd = lwd[1], col = col, to this arrows(ci1, (1:k)+voffset, ci2, (1:k)+voffset, lty = lty[1], lwd = lwd[1], col = col, and change points line to: points(cf , (1:k)+voffset, pch = pch, col = col) then hit enter , should have new coefplot2 function. should work coefplot2(m2, xlim=c(-2,...

How To Use I18N Messages In A Grails Plugin -

i've added new exception plugin: class unzipexception extends runtimeexception { string message string defaultmessage string filename } . . . else { throw new unzipexception( message:"grailsant.unzipexception.badfile", defaultmessage: "invalid zip file: ${zipfile}", filename: zipfile) } ... and in plugin's messages.properties have: grailsant.unzipexception.badfile=invalid zip file: {0} two questions: how {0} filled in filename? can application override grailsant.unzipexception.badfile message? (1) seems has done app: try { . . . } catch (org.grails.plugins.grailsant.unzipexception e) { flash.message = e.message flash.args = [e.filename] flash.defaultmessage = e.defaultmessage } (2) yep, if message.properties in app has same key plugin, app's values used.

list - Mathematica - Separate elements of a string into columns? -

Image
i'm producing encoded output list of strings lists. there way turn them actual lists can select elements , format them columns? or way select characters in strings , put in columns? button[ "run", {afit = input["please enter id#", deleteme] ; clearall[dat], dat := traumaencoding@afit; clearall[funcel], funcel[p_string] := which[stringmatchq[ p, ("*no new ones*" | "*no new marks*" | "*old wounds healing*"), ignorecase -> true], "0", stringmatchq[p, ("*abrasion*"), ignorecase -> true], "{1,0}", stringmatchq[p, ("*lacer*"), ignorecase -> true], "{1,1}", stringmatchq[p, ("*punct*") | ("*pct*"), ignorecase -> true], "{1,2}", stringmatchq[p, ("*amput*"), ignorecase -> true], "{1,4}", stringmatchq[ p, ("*wound*" | ...