Posts

Showing posts from August, 2014

Populate DataTable with Datagrid data in WPF -

i want store data of datagrid in datatable. how can populate datatable data? need way access data in row , column format rather item format. so, solution same welcomed , needed asap. thanks. to second question, think can. try this dataview myview = new dataview( mydatatable ); icollectionview cv = collectionviewsource.getdefaultview(myview); hopefully helpful rachel

jsf 2 - JSF Redirect page based on User role -

i have 2 types of admin. super admin , normal admin. both start on page admin.xhtml. i want forward super admin users super-admin.xhtml , normal admin normal-admin.xhtml. how do in jsf (i'm using spring security)? i'm unfamiliar jsf, assuming functions under hood spring mvc jsp application, can have controller deliver different page depending on role(s) held user: @requestmapping("/admin.xhtml") @preauthorize("hasanyrole('role_admin', 'role_superadmin')") public string getadminpage(modelmap model, principal principal) { collection<? extends grantedauthority> authorities = securitycontextholder.getcontext().getauthentication().getauthorities(); (grantedauthority authority : authorities) { if (authority.tostring() == "role_superadmin") { return "superadminpage"; } } //no need check admin privileges, since annotation took care of //if you're not using annotations (or ...

How to manage multiple alfresco repositories? -

problem description: i have multiple alfresco installations (development, testing, production) of 1 project. need copy files under data dictionary folder (scripts, templates, web scripts) 1 in 1 direction (development -> testing -> production). current solution: i copy files manually via webdav, annoying , unreliable (i can forget copy some.). desired solution: i'd have tool, copy changed files @ command, ready next step. had idea, internally use git repository branches each installation, being able fetch files devel , push files testing , production . way (with git) support reverting changes. it looks quite common problem, wasn't able google it, i'm asking here. such tool exist or there better way of managing multiple repositories? if have brand new installation of development/testing/production alfresco instances, migrate alf_data dir content, contains default db, indexes, content-store, backup files. if need, migrate "shared" ...

javascript - How to intercept the event when all controls are completely bound to data? -

i'm working on mvc3 application uses knockout.js client side js library. have complex screen list-like controls , grids populated data javascript using knockout.js. problem don't know how intercept event when controls bound, i.e. ready used end user. currently, page loads in browser in 7 seconds takes around 20-30 seconds controls bound data makes page unusable until ready. there way know when controls bound ? in advance. as long don't have asynchronous logic in viewmodels or custom binders, can put line of code directly after applybindings : ko.applybindings(myviewmodel); dosomethingelse(); here fiddle long-running binder demonstrates (be sure open console see output): http://jsfiddle.net/tlarson/bpacb/ however, if have asynchronous logic (such calling web service ajax), you'll need use callbacks run code after done. here typically is: set view model boolean observable indicating data not yet loaded: self.isloaded = ko.observable(false); add ...

api - how to make this call from shopify ? (GET/POST) python -

i have make call standard shopify api (python) https://store.myshopify.com/admin/shop.json what getting : ipdb> shopify.shop.current() shop(2330215) but : ipdb> shopify.shop.get(2330215) *** resourcenotfound: not found:https://store.myshopify.com/admin/shops/2330215.xml ipdb> what right way make such call . as far can tell, there no /admin/shops (plural) api path, at all . you use api per shop , shop_url parameter gives access specific shop , cannot access other shops nor need use shopify.shop.get() . the python library uses generic base class resource types, , .get() method comes from, method has no meaning shops. the shopify.shop.current() returns 1 shop resource need care about. has .attributes attribute holds data returned shopify api; keys in mapping work attributes on main resource object: shop = shopify.shop.current() print shop.attributes.keys() print shop.name

css - How to convert an image to retina display? -

i have 40px 20px image 72 pixels / inch. i create retina display version. what should do? double size? change resolution? and in format should save it? png? jpg? ... i using image on web site ... in image editor, double size of image 80px 40px. in markup set width 40 , height 20. <img src="example.png" width="40" height="20" /> you should save png if need transparency or image line art. save photographs jpg.

html - How to fix the table width content independently? -

i trying fix width no matter of content is. but, width of table changing according it's content. how can fix it? here code: <style> table{width:25px; background:#66f;} </style> <table> <tr> <td>sn</td> <td style="width:20px;">name</td> </tr> <tr> <td>1</td> <td>wolfeschlegelsteinhausenbergerdorff</td> </tr> </table> try this <table> <tbody><tr> <td>sn</td> <td style="width:20px;">name</td> </tr> <tr> <td>1</td> <td style="word-break: break-all;">wolfeschlegelsteinhausenbergerdorff</td> </tr> </tbody> </table>

html - Twitter bootstrap table messed up? -

Image
i fiddling around bootstrap came grinding halt error of being misplaced. the source code generated was <!doctype html> <html> <head> <title>anjul photo copy</title> <link rel="stylesheet" href="/css/bootstrap.min.css"> <link rel="stylesheet" href="/css/bootstrap-responsive.min.css"> </style> <script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script> <script src="js/textrace.js"></script> </head> <body> <div class="page-header"> <center><h1>header <small>header 2!</small></h1></center> </div> <span class="span2"> <div class="well"> <ul class="nav nav-list"> <li ><a tabindex="-1" href...

Python Output to html file -

have looked on web fail. running python script want output data html file in table format. how can done since getting cgi , have no idea about! an html file normal file. with open("/tmp/myfile.html", "w") my_file: my_file.write("<html><body><table>") x in range(5): my_file.write("<tr><td>%d</td></tr>" % x) my_file.write("</table></body></html>")

php - Jquery ajax POST response is null -

i have js script ajax request , posts data php script, script echo depending if works or not. here js $(document).ready(function(){ var post_data = []; $('.trade_window').load('signals.php?action=init'); setinterval(function(){ post_data = [ {market_number:1, name:$('.trade_window .market_name_1').text().trim()}, {market_number:2, name:$('.trade_window .market_name_2').text().trim()}]; $.ajax({ url: 'signals.php', type: 'post', contenttype: 'application/json; charset=utf-8', data:{markets:post_data}, datatype: "json", success: function(response){ console.log("response " + response); }, failure: function(result){ ...

c# - Mapping an Array using Fluent N Hibernate -

i not sure if fluent n hibernate can or not, cannot figure out how. i have table - cases , properties ownerid, brokerid, shipperid i want map property: int[] orgswithaccess is possible? this way when checking if org has access case, can check property orgswithaccess rather ownerid == myorg.id or brokerid == myorg.id etc. if understand question correctly, wouldn't recommend trying map in way have asked. cases table looks form of junction table between other tables. i'll assume these other tables each contain data represented entities in application, , there 3 tables, owner , broker , shipper . orgswithaccess should mapped using references entities has in application i.e. assume class looks like public class orgswithaccess { public virtual owner { get; set; } public virtual broker { get; set; } public virtual shipper { get; set; } } then mapping like public class orgswithaccessmap : classmap<orgswithaccess> { public o...

php function inside of jquery mobile creates "error loading page" in server? -

i have created function inside of jquery mobile code. working fine locally. in server have hosted not working properly. please here sample code <!doctype html> <html> <head> <title>site title</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="shortcut icon" href="images/scbd.ico"> <link rel="stylesheet" href="css/themes/default/jquery.mobile-1.1.0.css" /> <link rel="stylesheet" href="docs/_assets/css/jqm-docs.css"/> <script src="js/jquery.mobile-1.1.0.js"></script> <script src="js/jquery.js"></script> <script src="docs/_assets/js/jqm-docs.js"></script> </head> <body> <div data-role="page" class="type-index...

PHP Echo Order Behaviour -

i have php script requires yahoo sdk. when include following no echo output until script completes: require("/root/yahoosdk/ysdk/examples/common.inc.php"); i can comment line , see echo's occurring each iteration , when should. everything works ok output must getting held in ram until script complete, im iterating thousands of posts become problemtic. driving me nuts! appreciated! sam look @ code in /root/yahoosdk/ysdk/examples/common.inc.php make sure not enabling output buffering whiuch prevent output until script completion. see ob_start

android - Graphics Acceleration Enable: No “Hardware Section” in AVD -

i want have graphics acceleration enabled avd , instructions if want have graphics acceleration enabled default avd, in hardware section, click new, select gpu emulation , set value yes. problem not have hardware section can see. help? while creating new avd select "use host gpu" option given @ bottom. new avd layout not show hardware section @ bottom used show previously.

Jquery Live Preview in Text Area with function -

i have here code when click div insert textarea , show preview. content inserted in textarea image doest show image live instead needs type character on textarea. <script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script> <script> $(document).ready(function() { $('.image').click(function(e){ var tav = $('#image_code').val(), strpos = $('#image_code')[0].selectionstart; front = (tav).substring(0,strpos), = (tav).substring(strpos,tav.length); $('#image_code').val(front + '<img src=\"' + $(this).attr("alt") + '\">' + back); }); $('#image_code').keyup(function() { $('#image_preview').html( $(this).val() ); }); }); </script> <textarea id="image_code"></textarea> <div id="image_preview"></div> <div id="1" class="image...

qt - How to set a image source outside Component -

i have image showing in dialog in qml app, , want able change image later on using onclicked, pass function check if variable want in new source url 1 of them want. i've tried using image.source = "newurl" no go. id of component image in, , dialog like: id.source = "neurl" - no go. how do that? edit: added more code; both function , listitm used click. image web image, , want have conncecteduser value (which user name) inside url. here related code: // check if users user, , if; show skin function checkcurrentuser(currentuser) { console.debug('debug: check user "'+currentuser+'" if user.') if (currentuser == "ingen online") { currentuser = "notch" // reset currentuser if pushed earlier console.debug('debug: not real user. showing '+currentuser+' instead') image.source = "http://blabla"+currentuser+"yesyes" } else { cons...

javascript - How to Replace an element with another element entirely with data and events? -

i have cloned element this var myvar = null; myvar = $(someothervar).clone(true, true) now want replace anothervar entirely myvar . how that? i tried $(anothervar).replacewith(myvar) doesn't work. other way replace anothervar entirely data , events of myvar ? update since want 2 references: var myvar = $(someothervar).clone(true, true); var anothervar = $(myvar).clone(true, true);; if need 2 clones, have clone twice. there's no way around it.

java - How to build desktop applications with Apache Karaf/OSGi? -

well im building osgi application while , can't find tutorials show way build desktop application ( in languages ) osgi/karaf. i want use karaf because can wrap felix/equinox. of tutorials found enteprise application(web). there tutorials, talk building desktop application based on osgi/karaf? here example of gui application project uses apache karaf: https://bitbucket.org/lorainelab/igb-fx using karaf run gui-based desktop application decreases development time. developer makes change bundle, builds bundle, , uses karaf shell commands reload 1 bundle running application. there no need restart entire application view effects of new code. why using it. we using osgi because want greater modularity in code base , because want support dynamically loaded "apps" developed 3rd party developers write against our genome browser api.

sending data to log file - shell script -

can please explain these expressions me: cd - 1>> $log // q - 1 represent ? ./build_we2s 1>> $log 2>> $log // q - 2 represent ? 1 stdout standard output 2 stderr standard error cmd 1>> $log append stdout (only) $log cmd 1>> $log 2>>$log append stdout , stderr $log you do cmd >> $log 2>&1 or cmd &>>$log too

bash - sort -g not working as expected for exponential notation -

from awk script output list @ bottom of post, , i'd sort numerically on first column. since it's in exponential notation, tried sort -gk1,1 , didn't work - output in listing. what problem here? thought -g able handle exponential notation? i have sort (gnu coreutils) 8.20 under ubuntu 13.04. the data: original output "sorted" output 0.12000000e-07 2.27723e-26 0.10000000e-07 1.84556e-26 0.17000000e-07 3.4771e-26 0.10000000e-08 2.99263e-27 0.13000000e-07 2.50426e-26 0.11000000e-07 2.05792e-26 0.90000000e-08 1.64135e-26 0.12000000e-07 2.27723e-26 0.18000000e-07 3.73627e-26 0.13000000e-07 2.50426e-26 0.80000000e-08 1.44369e-26 0.14000000e-07 2.73749e-26 0.70000000e-08 1.25438e-26 0.15000000e-07 2.97754e-26 0.60000000e-08 1.07324e-26 0.16000000e-07 3.22419e-26 0.50000000e-08 9.01209e-27 0.17000000e-07 3.4771e-26 0.14000000e-07 2.73749e-26 0.18000000e-07 3.73627e-26 0.40000000e-08 7.37598e-27 0.19000000e-07 4.00053e-26 0.30000000e-08...

html - What is the best way to hold data for jquery -

some time ago wrote quick jquery code select , advert @ random below $(function () { var theimages = [ '*****.jpg', '******.jpg', '*****.jpg' ]; var thelinks = [ 'http://www.****.co.uk', 'http://www.****.co.uk', 'http://www.*****.co.uk' ] var therandomnumber = math.round(math.random() * (theimages.length - 1)); $("#ad1").attr('src','images/' + theimages[therandomnumber]); $("a#adl1").attr('href', thelinks[therandomnumber]); var therandomnumber2 = math.round(math.random() * (theimages.length - 1)); while (therandomnumber == therandomnumber2) { therandomnumber2 = math.round(math.random() * (theimages.length - 1)); } $("#ad2").attr('src','images/' + theimages[therandomnumber2]); $("a#adl2").attr('href', thelinks[therandomnumber2]); } ); </script> i have code on 29 html pages in...

java - Using FileDialog on MacOS X instead of JFileChooser for file AND directory -

here's problem. have java application runs on macos x. right i'm trying make application available on mac app store. unfortunately, apple reject application because i'm not using native filedialog access files , directories. in cases user has select files in other has select directories. here's i've tried create directory chooser: // go in directory chooser mode system.setproperty("apple.awt.filedialogfordirectories", "true"); filedialog dialog = new filedialog(tamaggoapp.getframe()); dialog.setdirectory(defaultdir); dialog.setvisible(true); // set property file chooser. system.setproperty("apple.awt.filedialogfordirectories", "false"); unfortunately, doesn't work me. seems property has set in main() method can't toggle between file , directory choose. using swing jfilechooser not option since apple reject (i tried). i figured out working time jdk1.7u21. problem can select directory still can choose...

graph - Matlab 3D plot quadratic? -

how plot 3d graph of quadratic funciton. here code 2d plot there anyway adapt 3d code ? z = (startv2:step:endv2); y = (a2.*(z.^2))+(b2.*z)+c2; plot(z,y); text(value1,0, ['x1 = ',num2str(value1),' ']); text(value2,0, ['x2 = ',num2str(value2)]); grid these matlab functions might help: plot3 or contour3 or surf depending on want show. matlab (click on functions above) has examples of them.

android - adding $ANDROID_HOME/tools to $Path in windows -

Image
i'm trying run code: cd google-play-services_lib android update project -p . ant debug from tutorial . installed ant using winant , regarding android, can not add path. i tried adding variable screen shot, did not me. how can add this? i'm not sure relation between android command , android_home/tools folder. can not find android.exe file in android_home/tools folder. maybe should try solution run this. edit when change variable base on tom's reply result is: $android_home environment variable directory have android sdk installed in - it's not specific directory. don't have create environment variable (although make scripting things easier later on). so in example, add directory c:\program files (x86)\android\android-sdk\tools path . update : hmmm, don't have xcopy command in path? bizarre. typically xcopy.exe found in c:\windows\system32 . check path statement , see if directory contained within.

soap - lighttpd, php, SoapClient not found -

i trying install on switch using buildroot, added php , lighttpd build. start server , webpage gives error: fatal error class 'soapclient' not found i went php.ini , uncommented extension=php_soap.dll (changed .dll .so i'm on linux, right?) stuck in cgi.fix_pathinfo = 1 the error still there, ideas? do have enable option soap supported? can't find php_soap anywhere

jquery - Populate select options dependent on their corresponding table value -

i have table select dropdowns , values of places left shown in html: <table class="day-choices"> <thead> <tr> <th>time</th> <th class="day-choices-pleft">places left</th> <th class="day-choices-preq">places req.</th> </tr> </thead> <tbody> <tr> <td>10.30</td> <td class="day-choices-pleft">6</td> <td class="day-choices-preq"> <select name="places-req[]" class="places-req"> </select> </td> </tr> <tr> <td>11.30</td> <td class="day-choices-pleft">8</td> <td class="day-choices-preq"> <select name="places-re...

Python increment pulling from an array in a loop -

i trying create would read file separate ever thing array use first string in array , something after done go second array , something keep repeating process until array done. so far have users = open('users.txt', "r") userl = users.read().splitlines() what want open text file, separated 1 line per string, have python part put array, first string , set variable. there variable used in url xbox.com. after checks have json read page , see if gamertag list have being used, if being used go array , go second string , check. needs constant loop of checking gamertags. if find gamertag in array (from text file) isn't used, save text file entitled "available gametags" , keep moving on. what want (requested in comments) open program have read text file of usernames have created have program test each program @ end of gamertag viewer link xbox json read page , if contains info name taken goes list , uses next gamertag on page. keeps do...

c++ - It is said abstract class for a virtual function that is implemented. It works with three of four similar implementations -

it seems problem circle.cpp if code looks same in point.cpp. i've been looking @ code long time , haven't found different in 2 files. here error message: >------ build started: project: ou5, configuration: release win32 ------ 1> circle.cpp 1> ou5.cpp 1>c:\users\jonas\documents\visual studio 2010\projects\ou5\ou5\shapeptr.h(52): error c2259: 'shape' : cannot instantiate abstract class 1> due following members: 1> 'shape *shape::clone(void) const' : abstract 1> c:\users\jonas\documents\visual studio 2010\projects\ou5\ou5\shape.h(21) : see declaration of 'shape::clone' 1>ou5.cpp(20): error c2259: 'shape' : cannot instantiate abstract class 1> due following members: 1> 'shape *shape::clone(void) const' : abstract 1> c:\users\jonas\documents\visual studio 2010\projects\ou5\ou5\shape.h(21) : see declaration of 'shape::clone' 1>ou5.cpp(27)...

javascript - How to validate a url address ( not syntax but the network )? -

i want validate url address returns valid page. there 2 approaches 1 take. iframe - create , iframe points url ajax - create ajax request url , @ status codes - here fiddling the ajax method not working because returns status code of 0 cross domain requests whether page there or not. the iframe method not working b.c. can not find mechanism capturing status or errors of frame. most of google hits i'm getting syntax checking. fiddle code ajax var urltest = function (url) { var xhr = new window.xmlhttprequest(); xhr.open('get', url, true); xhr.onreadystatechange = function () { console.log('readystate | status : ' + this.readystate + ' | ' + this.status); if (this.readystate === 4) { if (this.status === 200) { // console.log('4 | 200'); // xhr.responsetext; } } }; xhr.send(null); } urltest('http://www.google.com'); // cross d...

Clear form fields with JQuery on a asp.net page that includes IHttpHandler -

none of solution above( clear form fields jquery ) works on simple case when page includes call web user control involves ihttphandler request processing (for captcha regenaration). after sending requsrt (for image processing) code below not clear fields on form (text ntered before sending httphandler request ). if ihttphandler request not isuued user, everythings works correctly , form cleared. <input type="reset" value="clearallfields" onclick="clearcontact()" /> <script type="text/javascript"> function clearcontact() { ("form :text").val(""); } </script> you missed $ jquery before selector. change ("form :text").val(""); to $("form :text").val(""); your code be <script type="text/javascript"> function clearcontact() { $("form :text").val(""); } </script>

system.reactive - Reactive Extensions Group By, Unique BufferWindow till time span with cancellation -

i have hot stream of events coming of following type: event { string name; int state ; // 1 or 2 ie active or unactive } there function provides parent name of given name - string getparent(string name) i need buffer event per parent 2 minutes, if during 2 minute , recv event child state =2 given parent , buffer should cancel , should output 0 otherwise count of events recvd . i know have use groupby partition, , buffer , count unable think of way create buffer unique per parent, though of using distinct doesnt solve problem, dont want create buffer till parent active (as once parent's buffer gets cancelled or 2 minutes over, parent buffer can created again) understand need create custom buffer checks condition creating buffer, how do via reactive extensions. appreciated. regards thanks brandon help. main program using testing. not working.as new reactive extension problem can in way testing namespace testreactive { class program { static int abc = 1; ...

C# Taking a listbox with many values, and dividing it up into mulitple text files -

i having hardest time figuring out how this. i have listbox lot of data in it. want take listbox , have button save it. the button choose directory put files in. afterwards, program should start saving these values text file naming schema seed1.txt , seed2.txt , etc. the thing is, put 100 items each text file generated until list done. for saving path have: stream s; string folderpath = string.empty; using (folderbrowserdialog fdb = new folderbrowserdialog()) { if (fdb.showdialog() == dialogresult.ok) { folderpath = fdb.selectedpath; messagebox.show(folderpath); } for saving in 1 shot, believe work: int total = list_failed.items.count; (int = 0; < list_failed.items.count; i++) { streamwriter text = new streamwriter(s); text.write(list_failed.items[i]); s.close(); i'm not sure r...

web services - Custom Uri or endpoint on WSO2 -

we have installed our wso2 esb, , trying create proxies services customs endpoints. the default endoint format is: http://{host}:{port}/services/{proxy service name} i'd have like: http://{host}:{port}/services/utilities/{proxy service name} http://{host}:{port}/services/public/{proxy service name} i followed tutorial: http://wso2.org/library/knowledge-base/2011/01/custom-urls-wso2-esb-proxy-services but have problem, when send request custom endpoint, have no answer. suggestions? i assume able create custom endpoint , "i have no answer" means didn't response. if case following possible reasons that, proxy service endpoint didn't receive request proxy service didn't configured response back so test whether 1 reason can put log mediator following configuration in insequence, <log level="full"/> then if proxy service received message log in console. if works please post proxy service configuration ch...

jQuery: Script to append when checkbox is checked half working - why is checkbox not actually checking now? -

goal: (jquery mobile) popup searchable list of people can checked off. when checked displayed in table list (and removed when unchecked, haven't figured part out yet). i've gotten working show in list when checkbox clicked - seems have broken actual checkbox doesn't display check. why , how fix? feel free suggest better way whole thing. fiddle: http://jsfiddle.net/2srac/ html: <a href="#roundaddvol_pop" data-rel="popup" data-position-to="window" data-role="button" data-transition="pop">assign volunteer(s)</a> <table data-role="table" data-mode=""> <thead> <tr> <th>volunteer(s)</th> </tr> </thead> <tbody id="volunteerslist"> <tr> <td>sample</td> </tr> </tbody> </table> <div data-role="popup" id="r...

How to delete a dyanmic DNS record using Python or Bash? -

the following code in python updates import dns.query import dns.tsigkeyring import dns.update import sys keyring = dns.tsigkeyring.from_text({'host-example.' : 'xxxxxxxxxxxxxxxxxxxxxx=='}) update = dns.update.update('dyn.test.example', keyring=keyring) update.replace('host', 300, 'a', sys.argv[1]) response = dns.query.tcp(update, '10.0.0.1') but not find out how remove dns entry. the delete() method of dns.update.update can used delete record. import dns.query import dns.tsigkeyring import dns.update keyring = dns.tsigkeyring.from_text({'host-example.' : 'xxxxxxxxxxxxxxxxxxxxxx=='}) update = dns.update.update('dyn.test.example', keyring=keyring) update.delete('host', 'a') response = dns.query.tcp(update, '10.0.0.1')

java - hibernate batch select from get and criteria -

i batch bunch of get , criteria queries , ask hibernate issue them in single batch. hibernate have such interface? if not, there way extract hql get , criteria objects can manually issue them myself? i know possible sql criteria ( how sql hibernate criteria api (*not* logging) ), think better issue queries in hql don't need reconstruct objects raw sql data returned.

rest - How to handle pagination and count with angularjs resources? -

i have build angularjs client api outputting json this: { "count": 10, "next": null, "previous": "http://site.tld/api/items/?start=4" "results": [ { "url": "http://site.tld/api/items/1.json", "title": "test", "description": "", "user": "http://site.tld/api/users/4.json", "creation_datetime": "2013-05-08t14:31:43.428" }, { "url": "http://site.tld/api/items/2.json", "title": "test2", "description": "", "user": "http://site.tld/api/users/1.json", "creation_datetime": "2013-05-08t14:31:43.428" }, { "url": "http://site.tld/api/items/3.json", "title": "test3", "description": ""...

Renaming a new folder file to the next incremental number with powershell script -

i appreciate should first mention have been unable find specific solutions , new programming powershell, hence request i wish write (and later schedule) script in powershell looks file specific name - rfunnel , renames r0000001. there 1 of such 'rfunell' files in folder @ time. when next script run , finds new rfunnel file renamed r0000002 , on , forth i have struggled weeks , seemingly similar solutions have come across have not been of - perhaps because of admittedly limited experience powershell. others might able less syntax, try this: $rootpath = "c:\derp" if (test-path "$rootpath\rfunnel.txt") { $maxfile = get-childitem $rootpath | ?{$_.basename -like "r[0-9][0-9][0-9][0-9][0-9][0-9][0-9]"} | sort basename -descending | select -first 1 -expand basename; if (!$maxfile) { $maxfile = "r0000000" } [int32]$filenumberint = $maxfile.substring(1); $filenumberint++ [string]$filenumberstring = ($filenumberint).to...

android - Find outstanding requestLocationUpdates -

i want know if there way tell if (not application) has called requestlocationupdates. writing service monitors location, don't want interfere other apps (e.g. waze, endomondo) might monitoring location. don't see api in locationmanager object can tell me if there outstanding request location update. thoughts? yes api >= 8, can find out if application has called requestlocationupdates calling requestlocationupdates(locationmanager.passive_provider, mintime, mindist, listener); official document public static final string passive_provider added in api level 8 a special location provider receiving locations without initiating location fix. this provider can used passively receive location updates when other applications or services request them without requesting locations yourself. provider return locations generated other providers. can query getprovider() method determine origin of location update. requires permission acce...

android - Notify user within app that a new version is available -

i have android app in market , i've noticed can take quite while app updated when release new version. what hoping google google chrome app (may beta version not sure). what want when user launches app, can check see if there new version available, , if so, display small message @ bottom inform user there new version available download. if click user taken straight app within play store can commence update. how done? i've not managed find android, i've found couple of things relating ios no me. thanks can provide. there no api or service when can check google play latest version of app is. instead, should maintain latest version code on server, , have app check periodically against own version code. if version code higher on server, app needs updated , can tell user accordingly.

How can I disable the JVM on a Windows platform for running background matlab scripts -

Image
i found similar question here doesn't me i'm asking own. have matlab script works under linux nohup command. unfortunately, need run on windows also. can't understand why command still doesn't work. script loop after first stops giving me error java or something. must tell same problem occur under linux if don't put -nodisplay command. my batch line following matlab -nodisplay -automation -r "run('myfile.m')" -logfile output.txt -minimize please me. edit: think found issue problem when use -nodisplay under linux command usejava('awt') works because java environment disabled, not happen under windows! why? second edit: think found quite similar needed. matlab -noawt -nofigurewindows -r "run('myfile.m')" -logfile output.txt -minimize the analysis runs, without saying nothing, matlab command window still opens minimized..uhm i'd rather having open up! i must add thing.. nohup never waits , go forw...

startup - How do you command an AppleScripts document to open at login? -

how command applescripts document open @ login? i new applescript. trying create program opens 2 applications @ login. how command open @ startup/ login? thanks! you can create launch daemon run on startup creating launch daemons , agents using launchd applescript access flash drive automatically save the plist file in "~/library/launchagents", edit path point script, , restart computer. <?xml version="1.0" encoding="utf-8"?> <!doctype plist public "-//apple//dtd plist 1.0//en" "http://www.apple.com/dtds/propertylist-1.0.dtd"> <plist version="1.0"> <dict> <key>label</key> <string>com.lucy.launchapps</string> <key>programarguments</key> <array> <string>osascript</string> <string>/users/lucy/desktop/lucy.scpt</string> </array> <key>runatload</key> <t...

debugging - VB2010 Watch Window -

i've looked on , can't find out how this. know it's possible have seen implemented in other code. i have ton of events in classes makes scrolling through watch window on object tedious , cumbersome. keep events showing in watch window, allow me hide private or non-critical variables, constants, etc... i'm sure can done when debug code, know has events, events not show in objet model in watch window. have read debugproxy, haven't tried yet. because annnoys me , makes debugging other parts of code harder haven't spent time on implementing solution, searching information online. can advise?

php - Array parts access -

i'm trying understand arrays better. pardon elementary questions opened first php book 3 weeks ago. i can retrieve key/value pairs using foreach (or loop) below. $stockprices= array("google"=>"800", "apple"=>"400", "microsoft"=>"4", "rim"=>"15", "facebook"=>"30"); foreach ($stockprices $key =>$price) what confused multi dimensional arrays one: $states=(array([0]=>array("capital"=> "sacramento", "joined_union"=>1850, "population_rank"=> 1), [1]=>array("capital"=> "austin", "joined_union"=>1845,"population_rank"=> 2), [2]=>array("capital"=> "boston", "joined_union"=>1788,"population_rank"=> 14) )); my first question basic: know "capital', "jo...

cordova - PhoneGap – prevent screen lock -

i doing investigation in developing app target android/ios/windows phone mainly. i use phonegap build. i can not answer regarding following: can prevent screen locking when application running? this critical app track gps data 3 hours potentially. if use plugins, prevent me using phonegap build? prefer not have set different environments target different platforms. do need continuous tracking or need app visible, time? have tried setting (ios only), instance: exit-on-suspend app continue run while being in background, if set flag in config.xml . <preference name="exit-on-suspend" value="false" /> phonegap documentation: configuring remote builds

c# - whats the use of data adapter -

can explain why sqldataadapter used in following code? code working fine without adapter. also, why use dataadapter ? please me understand dataadapter usage. namespace windowsformsapplication1 { public partial class form1 : form { public form1() { initializecomponent(); private void button1_click(object sender, eventargs e) { try { sqlconnection con = new sqlconnection("data source=.....\\sqlexpress;initial catalog=......;integrated security=true"); con.open(); sqldataadapter da =new sqldataadapter(); // why use `sqldataadapter` here? sqlcommand sc = new sqlcommand("insert bhargavc values(" + textbox1.text + "," + textbox2.text + ");", con); var o = sc.executenonquery(); messagebox.show(o + "record inserted"); con.close(); } ...

groovyshell - recursion not working in groovy -

i have following piece of code def normalfactorial = { biginteger n -> n <= 1 ? 1 : normalfactorial(n - 1) * n } println normalfactorial(1) println normalfactorial(2) normalfactorial(1) method works fine , prints 1 expected. second call fails below exception. clues.. ???? may 09, 2013 10:39:23 pm org.codehaus.groovy.runtime.stacktraceutils sanitize warning: sanitizing stacktrace: groovy.lang.missingmethodexception: no signature of method: tailrecursion.normalfactorial() applicable argument types: (java.math.biginteger) values: [1] @ org.codehaus.groovy.runtime.scriptbytecodeadapter.unwrap(scriptbytecodeadapter.java:55) the closure isn't defined when define closure (if makes sense) try: def normalfactorial normalfactorial = { biginteger n -> n <= 1 ? 1 : normalfactorial(n - 1) * n }

.net - Can't suppress CA1709 in any way -

i want suppress ca1709: identifiers should cased correctly, on public class idd . example want use idd correct word. can't. tried @ code analysis dictionary: <?xml version="1.0" encoding="utf-8"?> <dictionary> <words> <unrecognized> <word></word> </unrecognized> <recognized> <word>d</word> <word>idd</word> </recognized> <deprecated> <term preferredalternate=""></term> </deprecated> <compound> <term compoundalternate="idd">idd</term> </compound> <discreteexceptions> <term>idd</term> </discreteexceptions> </words> <acronyms> <casingexceptions> <acronym>idd</acronym> <acronym>id</acronym> <acronym>d</acronym> ...

javascript - Control flow: Run two asynchronous array maps -

i have 2 functions asynchronous – accept function parameter called when done (callback). function a(item, cb) { someasyncoperation(function () { cb(item) }) } function b(item, cb) { someasyncoperation(function () { cb(item) }) } i have array. need run these functions, using array.prototype.map , on array 2 times. when both maps done, have callback invoked 2 parameters: error , mapped array. what sort of control flow need achieve this? in async library i'm guessing. in pseudo-ish code: var example = [1, 2, 3] async.series([ function () { example.map(a) }, function () { example.map(b) } ], function (error, mappedexample) { }) you can use async library sort of thing, in case, can handle chaining functions together: var items = ["a", "b", "c", "d" ], foo = function (array, cb) { "use strict"; array = array.map(function (element) { return "foo-" + ...

javascript - dropdown menu outside of shadowbox -

i creating shadowbox on website pop , allow users pick number of options including in submenus. content within shadowbox going pretty extensive, needs able scroll vertically , not scroll horizontally. the problem have submenus supposed pop out right of list , overflow outside of shadowbox. worked until implemented overflow-y: scroll; in css. now, if use overflow-x: visible; still acts though x-axis should scroll. has encountered problem before or have tips on how approach it? try messing jsfiddle here see http://www.w3.org/tr/css3-box/#collapse-scroll : the computed values of ‘overflow-x’ , ‘overflow-y’ same specified values, except combinations ‘visible’ not possible: if 1 specified ‘visible’ , other ‘scroll’ or ‘auto’, ‘visible’ set ‘auto’. i can't think of solve issue using css only, should possible javascript if dropdowns outside block overflow: auto

Table-valued parameter error in SQL Server -

i'm working on reporting module company project. although use orm our application, i've decided write stored procedures reports in anticipation of migrating ssrs. these stored procedures require table-valued parameter input. such, i've created table type: use mydatabase go /****** object: userdefinedtabletype [dbo].[intlist] script date: 5/8/2013 5:20:59 pm ******/ create type [dbo].[intlist] table( [id] [int] not null, primary key clustered ( [id] asc )with (ignore_dup_key = off) ) go i have following sql server stored proc: set ansi_nulls on go set quoted_identifier on go use mydatabase go -- ============================================= -- author: <lunchmeat317> -- create date: <05/06/2013> -- description: <file type report> -- ============================================= alter procedure report_filetype @filetype varchar(20) = null, @user intlist readonly, @group intlist readonly begin set nocount on;...

apache - PHP SNMP - Cannot find module -

i've enabled snmp module trying functions in module. have set mibdirs environment variable have mibs i'm still getting these "cannot find module" warnings: cannot find module (ip-mib): @ line 0 in (none) cannot find module (if-mib): @ line 0 in (none) cannot find module (tcp-mib): @ line 0 in (none) cannot find module (udp-mib): @ line 0 in (none) cannot find module (host-resources-mib): @ line 0 in (none) cannot find module (snmpv2-mib): @ line 0 in (none) cannot find module (snmpv2-smi): @ line 0 in (none) cannot find module (notification-log-mib): @ line 0 in (none) cannot find module (ucd-snmp-mib): @ line 0 in (none) cannot find module (ucd-demo-mib): @ line 0 in (none) cannot find module (snmp-target-mib): @ line 0 in (none) cannot find module (net-snmp-agent-mib): @ line 0 in (none) cannot find module (disman-event-mib): @ line 0 in (none) cannot find module (snmp-view-based-acm-mib): @ line 0 in (none) cannot find module (snmp-community-mib): @ line 0 i...