Posts

Showing posts from September, 2015

sql - Is there any inbuilt stored procedure which will return the output of a query as an XML document..? -

is there inbuilt stored procedure in sql-server return output of query xml document..? need convert result of query or stored proc xml of desired format , save xml desired folder. there several ways. blog post shows some.

asp.net mvc - Performance in MVC web application -

Image
i struggling performance in mvc application.i loading partial page (popup) taking hardly 500ms. each time popup loads downloads 2 jquery files well. possible use jquery cache or parent page? i have attached image in red shows 2 additional request server. in order improve performance can try following approaches: see if application server supports gzip , configure application/server return responses archived in gzip use minified version of jquery there packing libraries can pack imported resources, such css files , js files, , browser 1 request per resource type. instance, in java have library called packtag. in general, recommend using google chrome browser , performance analyzer. give hints.

sql - how to search for an id from a group of id using mysql? -

in table have feild user_ids . user_ids feilds containeing values 12,45,78,95,21,78,98 what need need mysql query search specific id(for ex:45) in feild. i used like operator not working expected. ex: when search 5 return tru, id 5 not in list. i know there default function available in mysql . could pls me... my query. select * `friendslist` `users_id` '%'.$id.'%'; nb: dont know whether question meets standard,pls dont down vote. pls me.... this works: select * friendslist find_in_set( $id, users_id ) <> 0

asp.net - how to split the string in LINQ? -

i have bind search results in grid view based on search criteria. in database primary store id value 10,12. when select particular primary store id dropdown list i.e. 10, search result corresponding primary store id need shown in grid view.how that? public static list<searchkeyword> getallkeywords(string key, string primarystoreid, string keywordstatus, int keywordid, string categoryname, string subcategoryname) { keys = db.searchkeywords.where(c => c.keyword.contains(key) && (c.primarystoreid == primarystoreid || c.primarystoreid.split(',').tolist().contains(primarystoreid)) && (string.isnullorempty(categoryname) || c.storecategorymapping == categoryname) && (string.isnullorempty(subcategoryname) || c.storesubcategorymapping == subcategoryname)).tolist(); } edited! assumption -- search db.searchkeywords elements in attribute primarystoreid (a comma separated list) contains key. ...

jquery - Passing parameters to Javascript Function -

this view in ruby on rails.i need make call removehistory function when image clicked <div class=float-right> <img src="/images/active_star.png" onclick="removehistory('<%= detail.message%>')" /> </div and script looks this: <script type="text/javascript"> function removehistory(text){ alert(text); } </script> this works fine when details.message contains no single or double quotes. need do, make single or double quotes work? try <%= j detail.message %> or <%= escape_javascript detail.message %> i not sure j alias escape_javascript in rails < 4

java - What is the difference between OMNode and OMElement in AXIOM -

what differences , usages between omnode , omelement in axiom ? have implemented xml parser , used both of objects in implementation. omelement sub class of omnode ? as example both behaves in same way: @ this //omelement omelement omelement = nodeelement; string attributevalue = ((omelementimpl) omelement).gettext(); //omnode omnode omnode = nodeelement; string attributevalue = ((omelementimpl) omnode).gettext(); both support casting , in same way first of all, code refers omelementimpl . shouldn't that. name of class (and name of package contains class) indicates, implementation class should not used directly in application code. anyways, cast omelementimpl useless because gettext method defined omelement interface. to answer question, yes, omelement extends omnode , can see in javadoc: http://ws.apache.org/axiom/apidocs/org/apache/axiom/om/omelement.html as name indicates, omelement represents xml element. omnode on other hand implemented axiom cl...

c# - wp8: programmatically created textblock is not displayed in app? -

well, i have created textblock programmatically in c#. not displayed in app. whats wrong ? here's updated c# code: double left = 0, top = 15, right = 0, bottom = 0; double left1 = 0, top1 = 12, right1 = 0, bottom1 = 12; textblock filename = new textblock(); filename.margin = new thickness(left, top, right, bottom); filename.fontsize = 30; filename.foreground = new solidcolorbrush(colors.white); filename.textalignment = textalignment.center; filename.text = "hello"; stackpanel content = new stackpanel(); content.margin = new thickness(left1, top1, right1, bottom1); content.setvalue(grid.rowproperty, 0); content.children.add(filename);; you've added textblock stackpanel haven't added stackpanel visual tree. assuming want add layoutroot , can this layoutroot.children.add(content); as side note, there...

java - Libgdx game slower and slower on restart -

i'm testing game , i've encountered problem. main game class restarting (not whole application) when user dies, whenever restarts, runs slower , slower. i'm thinking of possible memory leak. i'm switching on screen screen setscreen(screen sc) method. i'm cleaning in dispose() method, , can't find reason. so i'm asking maybe point me in direction causing app slow down on restart? it might shaperenderer since i'm rendering huge amount of shapes in loops- maybe that's problem? app works perfect unill call new instance of main game class. there code post it, i'm sorry huge amount of text. hope somehow point me wrong! something might you. use jmap ( http://docs.oracle.com/javase/7/docs/technotes/tools/share/jmap.html ). jmap displays instances of objects held jvm. make runnable jar of game, start game, check jmap, die bit , check jmap again. maybe see increase in texture-objects might not cleaning of ( easy forget if using assetm...

javascript - Google Maps - center map on marker click -

i have following code placing several markers on google map. what want when user clicks on marker zooms in , centers map marker position (this bit that's not working - towards end of code in setmarkers function). any ideas? var infowindow = null; var sites = []; var partsofstr = []; var partsofstr2 = []; var bounds; $(document).ready(function () { $("select[id*='coordlist']").find("option").each(function () { partsofstr = $(this).val().split(','); partsofstr2 = $(this).text().split('^'); sites.push([partsofstr2[0], parsefloat(partsofstr[0]), parsefloat(partsofstr[1]), partsofstr[2], partsofstr2[1], partsofstr2[2], partsofstr2[3], partsofstr[3], partsofstr[4], partsofstr[5]]); }); initialize(); }); function initialize() { bounds = new google.maps.latlngbounds(); var mapoptions = { zoom: 6, center: new google.maps.latlng(54.57951, -4.41387), scrollwheel: false, ...

How to find substring in a string and return a new string with a number of characters surrounding the substring - Javascript -

first of new javascript. my question: let's have string this var str = "john doe in name used people no identity"; i need function 3 arguments like pullsubstring(text, string, number) it return new string this *length of number in strings* + string + *length of number in strings* to more specific here's example : if call function this pullsubstring("for", "john doe in name used people no identity", 5) the result "used peop" . you can use function: function pullsubstring(searched,text,borderslenght) { var idx = text.indexof(searched); if (idx == -1 ) return ""; var startfrom = idx-borderslenght; var endat = idx + borderslenght + searched.length; if (startfrom < 0) startfrom=0; if (endat > text.length-1) endat = text.length-1; return text.substring(startfrom,endat); } you have choose return when searched string not found (my funct...

c# - Return results from a call to Yield Return -

i find scenario return ienumerable using yield return statement, have other methods call function different parameters , directly return result. is there performance benefit iterating through results end yield return ing these opposed returning collection? i.e. if use return on resulting ienumberable rather looping through these results again , using yield return compiler know generate results they're required, or wait entire collection returned before returning results? public class demo { private ienumerable<int> getnumbers(int x) { //imagine operation more expensive demo version //e.g. calling web service on each iteration. (int = 0; < x; i++) { yield return i; } } //does wait full list before returning public ienumerable<int> getnumberswrapped() { return getnumbers(10); } //whilst allows benefits of yield return persist? public ienumerable<int> getnu...

linux - Can't rename a file name -

i have small bash script download , rename files. problem gibberish not standard characters bash can't understand. for example: �������� ���� ���'�-2.jpg my bash while read line; if [ ! -z "$line" ]; new_filename=$(echo "$line" | uniconv -encode russian-translit | uniconv -encode latin | tr -d '\[\]\!\@\#\$\%\^\&\*\(\)\?\'') mv "$line" "$new_filename" fi done <<< "$files_to_convert" why don't delete characters : sed 's/[^a-za-z0-9_\.-]//g'

android - Is it possible to change actionbar tab indicator programmatically -

Image
how can change programmatically selected tab indicator of action bar ? have read tab styling , , tab.setcustomview() method, none of these helps : with tab styles, can change indicator color, remain tabs (i want have indicator each tab). with tab custom view, have used layout textview tab title, , view managing indicator color. in java change view 's background dynamically, problem view 's background doesn't match tabs bounds. <textview android:id="@+id/custom_tab_text" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_centerinparent="true" android:layout_centerhorizontal="true" android:gravity="center|center_horizontal" android:textstyle="bold"/> <view android:id="@+id/custom_tab_view" android:layout_width="match_parent" android:layout_height="10dp" android:layout_al...

c++ - What happens if i don't free/delete dynamically allocated arrays? -

this code not written bt me! in class webserver overload +=operator. class uses dynamically allocated array of objects of type webpage(another class, composition) defined webpage *wp; webserver & operator +=( webpage webpage ) { webpage * tmp = new webpage [ count + 1]; (int = 0; < count ; ++) tmp [i] = wp[i]; tmp [ count ++] = webpage ; delete [] wp; wp = tmp; return * ; } so create new array of dynamically allocated webpages space 1 object, assign them values wp held, , object wanted add array. if remove delete[] wp; program still works ok. happens if remove line of code? , wp=tmp, mean, wp new name dynamically suit name in class, location in memory still same? or? so if remove delete[] wp; program still works ok. happens if remove line of code? you have introduced memory leak . each time operator invoked process waste portion of address space until runs out of memory. and wp=tmp , mean, wp new name dynamically suit name in class, location in...

c# - How serialize one listener and don't serialize other listener of same event -

i have 2 objects(both serializable) in domain model , 1 winform control. first object , winform control listeners of same event of second object. want serialize second object first object listener , without winform control listener. class secondobject { public event eventhandler someevent; } class firstobject { secondobject object; object.someevent += secondobject_someevent(); } class winformcontrol { secondobject object; object.someevent += secondobject_someevent(); } right now, so: class secondobject { [field: nonserialized] public event eventhandler someevent; } class firstobject { secondobject object; [ondeserialized()] internal void subscribetoeventsondeserialized(streamingcontext context) { object.someevent += secondobject_someevent(); } } but can without nonserialized event? p.s. sorry bad english. frankly, advise: do not serialize events... ever . pure implementation, where-as seria...

c# - Cross thread error, but not using threads -

i keep getting cross-thread operation not valid: control 'keyholdertxt' accessed thread other thread created on. on various controls on various forms in project, , have googled , found lot's of responses how access stuff various threads, far know, i'm not using other threads in project, , change hundreds of possible places in code unmanageable. it never used happen, since added various code seems unrelated. include sample of places errors below, has occurred in many places on solution. keyholdertxt.text = "keyholders in:\r\n \r\n nibley 1: + keyholders"; or this, better example, can see happends form loading until error: private void identification_load(object sender, system.eventargs e) { _timer.interval = 1000; _timer.tick += new eventhandler(_timer_tick); _timer.start(); txtidentify.text = string.empty; rightindex = null; sendmessage(action.sendmessage, "place finger on reader....

javascript - How to achieve floating div on scrolldown -

i newbie on jquery, , want div hang on top of screen when page scrolldown more 50, how can achieve this? i want div absolute , not fixed. http://jsfiddle.net/8uccy/ $(document).ready(function () { $(window).scroll(function () { if ($(window).scrolltop() > 50) { $(".articlebutton").css("top", "0px"); //i want value change dynamically scrollbar moves down, div stays on top of screen } else { $(".articlebutton").css("top", "-50px"); } }); }); you can set position top -100 since -50 , scroll occurs after 50: $(".articlebutton").css("top", ($(window).scrolltop()-100)+"px");

classification - Using mahout in java code, not cli -

i want able build model using java, able cli folowing: ./mahout trainlogistic --input candy-crush.twtr.csv \ --output ./model \ --target hd_click --categories 2 \ --predictors click_frequency country_code ctr device_price_range hd_conversion time_of_day num_clicks phone_type twitter is_weekend app_entertainment app_wallpaper app_widgets arcade books_and_reference brain business cards casual comics communication education entertainment finance game_wallpaper game_widgets health_and_fitness health_fitness libraries_and_demo libraries_demo lifestyle media_and_video media_video medical music_and_audio news_and_magazines news_magazines personalization photography productivity racing shopping social sports sports_apps sports_games tools transportation travel_and_local weather app_entertainment_percentage app_wallpaper_percentage app_widgets_percentage arcade_percentage books_and_reference_percentage brain_percentage business_percentage cards_percentage ca...

Get row when checking checkbox in html table -

i have html table checkbox in 1 of columns. want know how row data when user clicks on checkbox javascript (without jquery)? can please me this? thanks you try this: html: <table> <thead> <tr><th></th><th>row text</th></tr> </thead> <tr> <td><input type="checkbox" /></td> <td>test</td> </tr> <tr> <td><input type="checkbox" /></td> <td>test 2</td> </tr> <tr> <td><input type="checkbox" /></td> <td>test 3</td> </tr> </table> javascript: checkboxes = document.getelementsbytagname("input"); (var = 0; < checkboxes.length; i++) { var checkbox = checkboxes[i]; checkbox.onclick = function() { var currentrow = this.parentnode.parentnode; ...

php - Fatal error: Class 'Zend_Locale' not found -

i'm developing web app zend framework 2. i want achieve urls current locale automatically built-in, i.e. /locale/controller/action/etc. wrote this: <?php $locale = new zend_locale(); ?> <ul class="nav"> <li> <a href="/<?php echo $locale->getlanguage(); ?>/devices">devices</a> <ul> <li> <a href="/devices/add"><img src="img/navbar/add.png" alt="+"> add</a> </li> </ul> </li> <li> <a href="/<?php echo $locale->getlanguage(); ?>/favorites">favorites</a> <ul> <li> <a href="/favorites/add"><img src="img/navbar/add.png" alt="+"> add</a> </li> </ul> </li> </ul> and put in navbar.pht...

c# - Get internet bandwidth/speed information in a Windows Store App -

i need relatively close information on actual internet speed in windows store (c#) app. need because user can play videos hosted online. there 2 versions of video available (high quality/low quality). according internet speed of user, app should stream corresponding video version. i've tried download dummy file of 5mb , @ time needed task (for getting idea of internet speed). i've found results scattered , changing. might better results larger file, that's not in favour of user experience. is there more simple way of getting current internet bandwidth? p.s.: iis smooth streaming not possible. pps.: maybe right path follow not know how use class in case: streamsocketinformation.bandwidthstatistics get downloading speed below given code. var connectionprofile = networkinformation.getinternetconnectionprofile(); var dataplanstatus = connectionprofile.getdataplanstatus(); ulong? outboundbandwidth = dataplanstatus.outboundbitspersecond; if (outboundbandwid...

sql server - xml to sql - need a few more data from the xml -

while having xml data: <machine>zsk40-2</machine> <date>2013/08/28</date> <hour>12:37</hour> <collecteddata> <variable> <name>product</name> <value>filler 580</value> </variable> <variable> <name>lot_number</name> <value>cg 00063 0</value> </variable> <variable> <name>shift_supervisor</name> <value> covaliu l</value> </variable> <variable> <name>kgh_all_set</name> <value>90</value> </variable> <variable> <name>kgh_all_real</name> <value>133.183883666992</value> </variable> <variable> <name>kgh_f1_set</name> <value>90</value> </variable> <variable> <name>kgh_f1_real</name> <value>133.183883666992</value> </va...

mainframe - Generation Data Groups (GDG) -

if (+1) generation dataset created in first step of job, how can referenced in later steps of same job input? once job step creating (+1) generation data group (gdg) file has completed, recent gdg file (+1). the current gdg not become 0 until after job ends or abends. here's example 1 of our batch jobs. //step05 exec pgm=outbound,region=4m,time=60 //steplib dd dsn=m5.m593cllv.load,disp=shr //systcpd dd dsn=m5.m51tcdlv.ibm.tcpparms(tcpdata),disp=shr //indd1 dd dsn=j3.j3dvlp.w.j1ppb70.rdexfile(+1),disp=old //obnstat dd dsn=j3.j3pzoutb.dvlp.obnstat,disp=shr //sysprint dd sysout=* //sysudump dd sysout=* //sysin dd dummy this not practice, restarting after abend becomes difficult. have change of gdg (+1) (+0) or (0). better practice create ordinary file use throughout job. then, in last job step, copy ordinary file gdg (+1). ...

javascript - Add new Dropdownlist on link click -

Image
i have dropdownlist this but there must shown single dropdownlist , add other dropdownlist click on other time. how should done??? this this asp.net code <table width="100%" border="0"> <tr> <td> <asp:dropdownlist class="chzn-select validate[required]" id="ddlconvenient1" runat="server"> </asp:dropdownlist> </td> <td> <div class="wrapper"> <div class="checkboxes"> <asp:checkboxlist id="chkday1" cssclass="chzn-choices " runat="server" repeatdirection="horizontal"> </asp:checkboxlist> </div> </div> </td> <td><button id="...

javascript - Underscore template issue - Uncaught SyntaxError: Unexpected token < -

i'm getting above error when try load 1 of underscore templates. i'm guessing sort of issue in loop (which should -.each don't quite structure of yet). my template <script type="text/html" id="customer-list-view"> <p> please click on customer select </p> <table > <thead> <th> customer name </th><th>last invoice date</th><th>last item added</th> </thead> <tbody> <% (var = 0, < customers.length, i++){ %> <tr class="custablerow" id="<%=customers[i].objectid %>" > <td> <%= customers[i].custname %> </td> <td> <%= customers[i].custlastinvoicedate %> </td> <td> <%= customers[i].custlastitemdate %> </td> ...

drupal - Ideographic space in solr query -

i have issue solr don't seem able on with... when searching "マルチェロ ブラック" (with normal space between words) i'm getting expected results (15 of them). when searching "マルチェロ ブラック" (which has ideographic space \u3000 between words instead of normal one) i'm not getting results. my fieldtype configuration pretty basic: <fieldtype name="text_cjk" class="solr.textfield"> <analyzer> <tokenizer class="solr.cjktokenizerfactory"/> </analyzer> </fieldtype> i've tried adding <charfilter class="solr.mappingcharfilterfactory" mapping="mapping-japanese.txt"/> with mapping like "\u3000" => "\u0020" or even "\u3000" => " " but didn't help. also tried adding <filter class="solr.positionfilterfactory" /> as suggested in language analysis: chinese, japanese, korean , started getting ...

stringified json vs json object memory usage in mongodb -

just seeing if has experience following. if want store nested json object may have anywhere 10 500 key:string pairs, better store nested json object string or keep object? memory penalty keeping value json object rather string? you can check size of document object.bsonsize() in mongoshell for example: > object.bsonsize({}) 5 > object.bsonsize({a:''}) 13 > object.bsonsize({a:'',b:''}) 21 > object.bsonsize({a:'',b:'',c:''}) 29 > object.bsonsize({a:{a:'',b:'',c:''}}) 37 > object.bsonsize({a:{a:'',b:''}}) 29 > object.bsonsize({a:{a:''}}) 21 > object.bsonsize({a:"{a:'',b:'',c:''}"}) 29 > object.bsonsize({a:"{a:'',b:''}"}) 24 > object.bsonsize({a:"{a:''}"}) 19 > object.bsonsize({a:""}) 13 > object.bsonsize({ab:""}) 14 > object.bsonsize({abc:...

c# - File Type Not Supported -

im trying send image remote server i'm taking current program. how i've done first image must saved user's workstation, i'm storing location , passing method in order pass server. however, when run code pass image along error saying file type not supported. here run down of code: public static void httpuploadfile(string url, string file, string paramname, string contenttype, namevaluecollection nvc) { console.write(string.format("uploading {0} {1}", file, url)); string boundary = "---------------------------" + datetime.now.ticks.tostring("x"); byte[] boundarybytes = system.text.encoding.ascii.getbytes("\r\n--" + boundary + "\r\n"); httpwebrequest wr = (httpwebrequest)webrequest.create(url); wr.contenttype = "multipart/form-data; boundary=" + boundary; wr.method = "post"; wr.keepalive = true; wr.credentials = system.net.cre...

php - How I make a htacces for he redirect my application to my subfolder from my domain? -

excuse low english. i have zend framework project , need upload in server. can’t ssh acces, ftp. there many projects in public_html (htdocs or www) of server, project needs own folder. how make htacces redirect application subfolder domain?? my structure: public_html/.htaccess public_html/project/ application public_html/project/library public_html/project/public ... thanks! try code in .htaccess, replace "yourdomain.com" domain , "foldername" website folder name. rewriteengine on rewritecond %{http_host} ^(www.)?yourdomain.com$ rewriterule ^(/)?$ foldername [l] for other information on can .htaccess file recommend following site: http://www.javascriptkit.com/howto/htaccess.shtml http://perishablepress.com/stupid-htaccess-tricks/

playframework - Calling webservice from within Play 2.0 -

am having trouble calling webservice within play 2.0 application. here how code looks future<object> promise = ws.url("http://myurl").get().map(testfunc1, null); function1 testfunc1 = new function1(){ public void $init$() {} public object apply(object v1) { system.out.println("apply"); return ""; } public function1 andthen(function1 g) { return null; } public function1 compose(function1 g) {return null;} }; but ide throwing me compile time exception saying error: <anonymous myclass$1> not abstract , not override abstract method andthen$mcvj$sp(function1) in function1 function1 testfunc1 = new function1(){ i have these packages imported import play.api.libs.ws.ws; import scala.function1; import scala.concurrent.future; clearly seem missing here. can tell me it. or need map promise object function1? thanks karthik your code looks java use scala libraries. package play.api scala...

javascript - Is there any way to remove Ajax headers set by setRequestHeader()? -

i’m writing js script lives within system adding custom xid header ajax requests via jqxhr.setrequestheader() in function registered jquery.ajaxprefilter(). in script, need make ajax request third party site, access-control-allow-headers not set allow custom xid header. it seems have 3 options: find way remove xid header in $.ajax()’s beforesend function, have confirmed gets called after ajaxprefilter() function. forgo using $.ajax() entirely , write ajax stuff myself. have $.ajax() point system’s backend accept custom xid header, , perform request third party site via curl. option #1 preferred, if there’s simple way it, since cleanest , fastest route. can’t figure out how . i have tried overriding this, didn’t work: beforesend: function(jqxhr, settings) { jqxhr.setrequestheader('custom-xid-header', null); } any ideas? $.ajaxsetup({ beforesend: function(jqxhr, settings) { jqxhr.setrequestheader('custom-xid-header', null); ...

android - Errors when importing support library as a project -

i'm playing action bar , want use in older version of android. i try import library boredt said in this topic, when imported library by import/existing project workspace , find folder(sdk/extras/android/support/v7/appcompat). error this: adb connection error:an existing connection forcibly closed remote host when try make 1 more time see info project exists in workspace. ok try make reference it. added android-support-v7-appcompat , cleaned project , rebuild, haven't got new things in gen folders. i don't know mistake. want import library because need make actionbar. when add android-support-v7-appcompat.jar file ...sdk\extras\android\support\v7\appcompat\libs . problem if manipulate theme in androidmanifest.xml, delete file libs folder in project. you importing wrong way, need select existing android code workspace should imported , can reference library project project. check link http://developer.android.com/tools/support-library/setup.html ...

jsf - PrimeFaces FileUpload Filter ClassNotFound Exception -

i getting error while running jsf project. here error log; org.apache.catalina.core.standardcontext filterstart severe: exception starting filter primefaces fileupload filter java.lang.classnotfoundexception: org.primefaces.webapp.filter.fileuploadfilter @ org.apache.catalina.loader.webappclassloader.loadclass(webappclassloader.java:1714) @ org.apache.catalina.loader.webappclassloader.loadclass(webappclassloader.java:1559) @ org.apache.catalina.core.defaultinstancemanager.loadclass(defaultinstancemanager.java:527) @ org.apache.catalina.core.defaultinstancemanager.loadclassmaybeprivileged(defaultinstancemanager.java:509) @ org.apache.catalina.core.defaultinstancemanager.newinstance(defaultinstancemanager.java:137) @ org.apache.catalina.core.applicationfilterconfig.getfilter(applicationfilterconfig.java:260) @ org.apache.catalina.core.applicationfilterconfig.<init>(applicationfilterconfig.java:107) @ org.apache.catalina.core.standardcontext.fil...

serialization - Persist Data Across Wizard Steps - ASP.NET MVC -

i working on wizard interface in asp.net mvc. wizard has 3 steps. understand how data first step second step, curious best way persist data first step next step. coming classic asp background have used hidden fields and/or session storage solve problem in past, wonder if there more elegant way in asp.net mvc? example there way pass entire model contained first step next step or need split data separate hidden fields/ session variables?

winapi - What would be an alternative for parameters? -

we may have used (sooner or later) parameters define how our application should start or add more infos it. either can use lpparameters/lpcommandline in shellexecute(ex)/createprocess or use in direct call in cmd myapplication.exe -parameter1 -parameter2 -n . sometimes there conflicts applications use same parameter names different purposes or nowadays can see parameters have been used application. wondering if possible use different method on how add more infos application before starts (like parameters). don't know pe system (yet), wondering if possible use createprocess api , start application suspended - write/change/modify (with writeprocessmemory ) offset of constant (or var) have declared in sourcecode (or that...) , resume it. i'm sure possible comes questions like: how/where can offset of constant pe file? what happens if file packed/crypted? many more so final question - alternative parameters? (maybe based on idea?!) there other ways pass ...

Android: set android:process for a receiver -

my app has 2 processes , b. have receiver belongs process b , specify through android:process in manifest below: <receiver android:name=".myapp.receiver.receiverb" android:process=":processb" > <intent-filter> <action android:name="something" /> </intent-filter> </receiver> but register receiverb in processa when receive intent process can in processb. when debugging in receiverb, find out android.os.process.mypid() returns processa's id. i'm wondering how i'm able processb's id within receiver? thought setting android:process=":processb" can guarantee code running within receiverb must reside in processb.

reporting services - How to pass a specific Parameter value to Jump to report in SSRS -

i have report created in reporting services using bids. have multiple text boxes have jump assigned go same report. however, want able pass specific parameter value query of jump report display specific data user clicked. how can accomplish that? i'm not sure if talking if you: 1.right click textbox have jumps report 2.click texbox properties 3.select action tab 4. enable action: choose go report 5. on specify report can choose report jumping 6. on same window click add these parameters, choose value parameter passing , parameter (make sure parameter exists in other report first) 7. in report being jumped make sure same selected value being passed parameter. cheers!

c# - ASP.NET MVC - Set default value for static Select (dropdownlist) -

i using regular html drop downlist (select) in view. don't want use html.dropdownlistfor reason. able selected value in controller class. how assign selected value view? <select name='ddllocation' id='ddllocation'> <option value="">all </option> <option selected="selected" value="1">city1</option> <option value="2">city2</option> <optgroup label="group"> <option value="3">city2</option> <option value="4">city3</option> <option value="5">city4</option> </optgroup> </select> well there go, you've done using selected attribute: <option selected="selected" value="1">city1</option> you should put selected attribute on value want preselected. i guess realize madness of not using html.dropdownlistfor helper automatically...

Selenium Page Factory How.Custom C# Examples -

does using c# selenium's pagefactory know how implement how.custom locator? have searched internet high , low no avail. examples in java , seem far , few between. create class - public class ngbymodelfinder : { public ngbymodelfinder(string locator) { findelementmethod = (isearchcontext context) => context.findelement(ngby.model(locator)); } } and attach findsby attribute webelement - [findsby(how = how.custom, using = "value locator", customfindertype = typeof(ngbymodelfinder))] protected iwebelement testdiv { get; set; } i hope above you.

python - How can I parse this list of comma separated values -

i have list of comma-separated users , permissions, users have 8 permissions: user_a, permission_1 user_b, permission_1, permission_2 user_c, permission_1, permission_2, permission_3 i need output list of comma-separated users , permissions, every user , permission pair on separate line: user_a, permission_1 user_b, permission_1 user_b, permission_2 user_c, permission_1 user_c, permission_2 user_c, permission_3 my python code below using csv module not working: import csv open('user_list.csv') user_list: dict_reader = csv.dictreader(user_list) ul = [] row in dict_reader: ul.append(row) open('output.txt','w') output: fields = 'user','perm1','perm2','perm3','perm4', 'perm5','perm6','perm7','perm8' dict_writer = csv.dictwriter(output, fields) csv.dictwriter.writeheader(dict_writer) in ul: dict_writer.writerow(i) it's giving m...

Validate URL with PHP -

this question has answer here: php validation/regex url 18 answers i need check if form field valid url (it can done through html5, not every browser has yet), , can't find url checker function. it's strange, because email-checking, there lots of already-done functions. i've seen (i discovered it) filter_var() function, read, there issues urls. can find regular expressions, don't seem exhaustive. do know url checker function? it's because url format can versatile : http// optionnal www optionnal .com, .net, .us, etc many possible pattern .html, /, .php, or nothing possible ends rather using pre-made function, i'd recommend build own function depending on how of users send url, ending etc ... my 2 cents.

AngularJS function undefined when uncommenting it -

i have weird problems related defintion of method inside scope. once it's defined, , when want call (just entering code) disappears. have part of code if (configurationservice.isconfigurationchanged() === true) { configurationservice.getconfiguration().then(function(data) { $scope.configuration = data.configuration; $scope.lunchers = data.lunchers; $scope.configuration.vegies.all_in_one_group = data.configuration.vegies.all_in_one_group; var luncherslength = data.lunchers.all.length; (var = 0; < luncherslength; i++) { $scope.selectedvegies[i] = $scope.isvegie(data.lunchers.all[i]); $scope.selectedspecialgroup[i] = $scope.isinspecialgroup(data.lunchers.all[i]); $scope.isabsent[i] = $scope.isabsent(data.lunchers.all[i]); } }); } else if (configurationservice.isconfigurationchanged() === false) { var cached = configurationservice.getcachedconfiguration(); console.log($scope.isvegie); $scope.configuration = cached.confi...

vba - Sort Excel columns through COM from LotusScript -

i have lotusscript agent creates excel spreadsheet notes documents, 5 columns, this: vendor name plan year plan month project name store advantage 2013 2 dairy_biproducts 136 kraft 2013 2 dairy_biproducts 330 daymon 2013 2 dairy_biproducts 382 advantage 2013 2 dairy_biproducts 398 daymon 2013 2 dairy_biproducts 616 advantage 2013 2 dairy_biproducts 691 the following line sorts sheet: sheet.columns.entirecolumn.sort sheet.cells(2, 1), 1, , , , , , 1, 1, false, 1, and ends giving me first , second columns sorted (although @ moment second column contains "2013" way down, don't know if line of code or not sorting column). i got sort end of line here , can't find documentation method signature, have no idea each argument stands for, , how change sort spreadsheet way want. documentation can find using ...

Git and file content (text) encoding (utf8) -

my problem i'm using git keep track of files , move them between 2 computers. 1 work on over windows 8, , 1 compile under centos 6. i used work windows xp , bitbucket, moved windows 8 , deveo. my problem is: let's figure out have file called "/example.sql" contains: "categoría" (without quotes). once committed , pushed, file on deveo, looks should: categoría. however, once "git clone" or "git pull" it, it's got converted to: "categoría" that inconvenient, file imported mysql utf8. what i've checked for i code in notepad++ , i've made sure saves files "utf8 without bom". on centos i've checked file encoding "file -bi example.sql", reports text/x-c; charset=utf-8 my question what may have happend? deveo problem? did not have when working on bitbucket , win xp how may solve it? thank you! wild guess: log centos box using putty. configured putty display output e...

jquery - ajaxComplete, previously array empty -

// start <div id="ms"> <img src="img1.jpg"> <img src="img2.jpg"> </div> // after ajax completion <div id="ms"> <img src="img3.jpg"> <img src="img4.jpg"> </div> var ik = new array(); var ls = function(){ $('#ms img').each(function() { ik.push($(this).attr("src")); }); return ik; } var bs = function() { ls(); //img1.jpg, img2.jpg $(document).ajaxcomplete(function(event,request, settings){ ls(); //img1.jpg, img2.jpg, img3.jpg, img4.jpg should img3.jpg, img4.jpg }); return ik; }; console.log(bs()); i want before ajaxcompletion, array empty (img1.jpg , img2.jpg). if no values​​: ik = []; for grateful. first problem - repeating id's, should unique. after first call ls() array ik contain: 0: "img1.jp...

c - printf format string lint warning -

i'm stuck fixing ancient code, , here today's issue: output_file_status = fprintf ( data_file, "%03d%08s%+014.2f%06.3f%", longvalue, charstarvalue, double1, double2 ); lint32 produces: lint32 results in “malformed format string” 1) agree format string can not end in % sign? don't believe standalone % has meaning. 2) when either remove trailing % , or append additional % , still same warning. this using oracle pro*c compiler (so charstarvalue (char*)varchar.arr ). taking piece piece: "%03d" expects int . op supplies longvalue . long , specifier should "%03ld" . "%08s" expects pointer char . op supplies charstarvalue . ok. "0" in specifier undefined behavior %s . recommend "%8s" "%+014.2f" expects double . ok. flags '+', '0' ok. "%06.3f" expects double . ok. flags '+', '0' ok. "%" should have after else be...

restriction - When to restrict a class from extending a class? -

is there point in programmer's lifetime restrict class extending class? example don't want package extend box . yes. in java call final class. in c# call sealed class. it done because cannot predict many ways consumer might extend class, prevent having design class account possible ways might extend it, seal , require consumer use composition instead of inheritance. further reading why many of framework classes sealed?

django - Formatting template with custom form parameters -

i have custom form multiple fields i'd format in template. there way align outcomevalue fields right of relevantoutcome choice options? if there no way there way name outcomevalue_%s fields such link relevantoutcome option? example if relevantoutcome = time, label outcomevalue_%s = time value forms.py self.fields['relevantoutcome']=forms.modelmultiplechoicefield(queryset=outcome.objects.all(),required=true, widget=forms.checkboxselectmultiple) self.fields['relevantoutcome'].label="outcomes" outcome_qs=outcome.objects.all() outcome in outcome_qs: self.fields['outcomevalue_%s' % outcome.pk] = forms.charfield(required=false) self.fields['outcomevalue_%s' % outcome.pk].label = "outcome value" template.html {{form.as_table}} best way go writing own templatetag forms. template.html {% load yourapp_tags %} {{ form|as_table }} yourapp_tags.py from django import template regis...

osx - adding and subtracting cells in excel -

say have 7 groups of columns of 2 columns , each group of column represent 1 day " monday tuesdays ect... & in 1 group of columns there's either "win" or "lost" want add columns win add , lost subtract automatically. have set can 1 "win" or 1 "lost" in each group of 2 columns. exp: {a(win) b(lost)} {c(win) d(lost)} so want if "a" win , " c" win , "f" lost , "h" lost , "i" win ect... come total exp: a[1234] +c[1234] - f[1234] -h[1234] = [total] i want lose shown in negative ... how can make whole column show has negative value everytime enter number : -1234 if enter 1234 in "lose" column if want sum number of wins , loses can use countif on ranges care about, e.g. =countif(b4:b13,"win") -countif(b4:b13,"loss") you'll need change b4:b13 ranges match wherever tracking wins/loses , change "win" , "loss" ...

MongoDB Aggregation: Counting distinct fields -

i trying write aggregation identify accounts use multiple payment sources. typical data be. { account:"abc", vendor:"amazon", } ... { account:"abc", vendor:"overstock", } now, i'd produce list of accounts similar this { account:"abc", vendorcount:2 } how write in mongo's aggregation framework i figured out using $addtoset , $unwind operators. mongodb aggregation count array/set size db.collection.aggregate([ { $group: { _id: { account: '$account' }, vendors: { $addtoset: '$vendor'} } }, { $unwind:"$vendors" }, { $group: { _id: "$_id", vendorcount: { $sum:1} } } ]); hope helps someone

c# 4.0 - Find out if HDD is GPT or MBT in C# -

how find out if hard drive type gpt or mbr c#? looked @ win32_diskdrive , doesn't seem have it. you'd want use pinvoke (see http://pinvoke.net ) createfile , deviceiocontrol ( dwiocontrolcode = ioctl_disk_get_partition_info_ex ), , partition_information_ex structure's partitionstyle field tell ( partition_style_mbr , partition_style_gpt or partition_style_raw ).

java - Working with JPasswordField and handling the password with getPassword + server login procedure -

after day of long programming want post useful else. few days ago wondering how handle jpasswordfield 's method getpassword() correct procedure pass value server , answer. and question: how can correctly value jpasswordfield in safe way , handle create login procedure server? this solution reached. first of decided procedure of login safe enough purpose, didn't want send plain password server , didn't want store plain password (obviously) in database. the first thing way secure password is never ever exchanged on network in plain , readable form, because of possible "man in middle", in few words reading messages in way server. the password need hashed, means transformed quite long sequence of hexadecimal characters. thing of hash is (hopefully) one-way. can't de-hash password. there many algorithms this, choose sha256. the password hashed, between us, can not enough. if hacker able steal hash there techniques can bring him succes...