Posts

Showing posts from March, 2011

javascript - Query entire class vs first object in the class -

javascript - Query entire class vs first object in the class - in cloud code want retrieve first object in "messages" class. want grab info object, send class, , delete object "messages" class pulled from. my question need query entire "messages" class first object in it? don't want slow downwards app due inefficient code. parse.cloud.aftersave("sendmessage", function(parse.message, response) { var body = null; var sendername = null; var senderid = null; var randusers = []; var query = new.parse.query(parse.message); query.find({ success: function(results){ body.push(results[1].get("messagebody")); sendername.push(results[1].get("sendername")); senderid.push(results[1].get("senderid")); response.success(getusers); }, error: funtion(error){ response.error("error"); } }); }); to avoid confusion: "getusers" arbitrary f

regex - GREP with wildcard, but exclude a specific term and return file name -

regex - GREP with wildcard, but exclude a specific term and return file name - i'm new using grep , need perform quite complicated query here goes: i recursively grep directory string: ====\d+ \d+ 1 or more decimals (perl syntax) , string different ====0 . i want grep homecoming file name of file containing ====\d+ . to show file names without paths, do grep -erl '====[1-9]\d*' . | while read name; basename $name; done or, if file names can contain spaces, newlines or other strangeness, use grep -zerl '====[1-9]\d*' . | while ifs= read -r -d '' name; basename "$name"; done the grep flags used (from gnu grep 's manual): -e, --extended-regexp interpret pattern extended regular look (ere, see below). (-e specified posix.) -r, --dereference-recursive read files under each directory, recursively. follow symbolic links, unlike -r. -l, --files-with-mat

jquery - How to remove the last comma in JavaScript, while formatting currency? -

jquery - How to remove the last comma in JavaScript, while formatting currency? - i have code : function money_format(number) { //if (isnan(number)) homecoming ""; var str = new string(number); var result = "" , len = str.length; for(var i=len-1;i>=0;i--) { if ((i+1)%3 == 0 && i+1!= len) { result += ","; } result += str.charat(len-1-i); } homecoming result; } event: $("#number").keyup(function() { var tot = 0; tot = $(this).val().substr(0).replace(/\./g,'') $(this).val(money_format(tot)); $("#msg").html(tot); }); se jsfiddle :http://jsfiddle.net/bx5bu3j0/ how remove lastly coma?? like : 1.000.000,01 if utilize string replace stops when reaches non-digit can add together commas string decimal- function addcommas(n){ var rx= /(\d+)(\d{3})/; homecoming string(n).replace(/^\d+/, function(w){

c - How to grab mouse on Windows -

c - How to grab mouse on Windows - i'm writing cross-platform application on status takes command of user input period of time. on gnu/linux i've used gtk+, allows me retrieve mouse , keyboard events such motion or presses. that's need application responds them. has little graphical interfce created gtk+. i've been trying grab mouse input on windows without success gtk work graphically, not grab user input. i've tried using blockintput() not works expected because: i need administrator priviledges run application i can't read mouse nor keyboard input is there way grab mouse , keyboard input on windows , still beingness able read inputs without administrative rights? i found solution fits requirements. 1 of marc's links guided me utilize of hooks on windows had tried no success, ended implementing them both keyboard , mouse grabbing. my windows code uses windows libraries , when need block input create thread calls function:

angularjs - How to test an Angular Factory which uses Parse SDK -

angularjs - How to test an Angular Factory which uses Parse SDK - this first question here. i'll seek best. searched lot before posting i'm developing angularjs application relying on javascript parsesdk. have convinced myself dive in testing recently, beginner. i have mill userfactory wraps around sdk clean , modular angular way. ie: sdk used through factories (not controller nor directives). it goes this: mymodule.factory('userfactory', ['$q', function($q){ var user = parse.user.extend({ // instance methods },{ // static/class methods // overrides parse.user.current() wrap current user in promise current: function(){ var deferred = $q.defer(); var currentuser = parse.user.current(); if(currentuser) deferred.resolve(currentuser); else deferred.reject("no current user"); homecoming deferred.promise; } }); homec

binary search tree - from where we need to start in max-heapify algorithm? -

binary search tree - from where we need to start in max-heapify algorithm? - i need no have way apply max-heapify algorithm?do have apply bottom top or top bottom?or can apply places heap property not there? when going maintain heap property in tree. can body help? i not able question absolutely think uncertainty whether moving top bottom or bottom top. in heapify move top node(i) bottom(leaf nodes), , seek maintain heap property move. a: array left , right children of root heaps, i: array index have @ resource. http://homepages.ius.edu/rwisman/c455/html/notes/chapter6/heapify.htm see pdf more details. http://courses.csail.mit.edu/6.006/fall10/handouts/recitation10-8.pdf hope clears doubt. algorithm binary-search-tree heapsort max-heap

msbuild - CSDEF and CSPKG file for Azure Website -

msbuild - CSDEF and CSPKG file for Azure Website - am new azure , websites. on boarded azure cloud services cspkg file. am looking create bundle websites build , utilize later deploy in azure subscription. was wondering if can have cspkg file website , how generate it. or there improve way bundle azure website contents ( without knowing target deployed). please note: aware of ftp, git , deploy straight visual studio. want know process of getting bundle out of msbuild without targets , deployment. thanks, pradeep. azure websites not back upwards cspkg. an alternate approach webdeploy package. azure msbuild azure-web-sites azure-deployment

javascript - Best pattern to rerender my react component? -

javascript - Best pattern to rerender my react component? - i have global data object update , phone call react.rendercomponent() 1 time again on top/main component. is right pattern triggering update? i'm bit lost. thanks! this right pattern. react.rendercomponent either mount component first time, or mounted component update. if you're using global object though, might want in flux architecture here: http://facebook.github.io/flux/docs/overview.html javascript reactjs

android - NullPointerException when initializing the media player on url -

android - NullPointerException when initializing the media player on url - i need help, there osvnonoe activiti in history loaded tracks, when click on track opens alert dialog loading page, link redirected, , output link track, send media player in service, nullpointerexception example link http://s.spynetstation.com/m/8/loud%20sound/tamfree026/unknown-blitzkrieg-320kbps.mp3 error fatal exception: main java.lang.nullpointerexception @ android.media.mediaplayer.setdatasource(mediaplayer.java:783) @ android.media.mediaplayer.setdatasource(mediaplayer.java:761) @ com.spynetstation.mediaservice.initt(mediaservice.java:132) @ com.spynetstation.mainactivity$14.shouldoverrideurlloading(mainactivity.java:716) @ android.webkit.callbackproxy.uioverrideurlloading(callbackproxy.java:224) @ android.webkit.callbackproxy.handlemessage(callbackproxy.java:324) @ android.os.handler.dispatchmessage(handler.java:99) @ android.os.looper.loop(looper.java:137) @ android.app.activitythread.main

android - SharedPreferences int not updated after apply -

android - SharedPreferences int not updated after apply - i running: int value = mpreferences.getint(key, 0); mpreferences.edit().putint(key, value+1).apply(); int newvalue = homecoming mpreferences.getint(key, 0); however same result value , newvalue . updated result appears when phone call getint() later in code. thought updates sharedpreferences object using apply() instantly visible in sharedpreferences object. not case? if want synchronous update have utilize commit() http://developer.android.com/reference/android/content/sharedpreferences.editor.html#commit() android sharedpreferences

multithreading - java multithreding , creating object for each thread -

multithreading - java multithreding , creating object for each thread - i have 2 class callispsubscriberdump (this class reads database total no of process id , each process id calls ispsubscriberdump class create file) , ispsubscriberdump (used create isp subscriber dump file sent network provioning ). using executor service create multiple threads , passing process id ispsubscriberdump in constructor , in approach have create many objects many threads running. process working fine. have run thread each process id , there other way in can create single object , crate multiple objects? public class callispsubscriberdump { public void createfile() { list<integer> totalid = new arraylist<integer>(); list<string> dataflag = new arraylist<string>(); //reading process id , dataflag database , populating in list seek { if (totalid.size() == 0) { throw new exception(&

Template not calling rendered since upgrading meteor to version 0.9.4 -

Template not calling rendered since upgrading meteor to version 0.9.4 - since upgrading latest version of meteor templates rendered helper isn't getting called. read release docs , didn't mention changes concerning rendered . having same issue , if how did prepare it? since meteor version > 0.9.3 have utilize rendered outside of template.name.helpers . illustration rendered not called when using this: template.name.helpers({ rendered : function () { console.log("this wont called"); }, }); the right way utilize rendered outside of helper construct. template.name.rendered = function () { console.log("this called"); }; meteor

Downloaded files going missing in Android 4.4.2 -

Downloaded files going missing in Android 4.4.2 - we using built-in downloadmanager grab files our server. if figure out there has been update file delete local version , re-queue download downloadmanager . runs when kill , re-start app (timely updates files not priority, have files , updated whenever notice it). scheme works on of personal testing devices, however, when testing in api 19 emulator or on co-worker's htc 1 files download , disappear (no longer in app's external info folder). i've figured out both version 4.4.2 of android (where devices either 4.4.4 or 4.0.4). it's weird because stick around time, random files disappear. here code: assetmanager setup (setup of output folder) private assetmanager(context activity){ if(singleton != null&&ioutils.hasexternalstorage() != ioutils.extstoragestate_ok){ return; } context = activity; external = contextcompat.getexternalfilesdirs(context, "")[0]; extern

php - Getting Day name from day of week -

php - Getting Day name from day of week - i have 7 records in mysql database each corresponsing day of week 0-6 now php script want display instead of 0, 'sunday' or instead of 1 show 'monday'. is there function available takes numeric days of week , returns name of week day? you utilize date function, format l : l (lowercase 'l') a total textual representation of day of week http://php.net/manual/en/function.date.php and utilize fact sunday 0: echo date('l', strtotime("sunday +{$day_number} days")); or function: function getdaynamefromdaynumber($day_number) { homecoming date('l', strtotime("sunday +{$day_number} days")); } php cakephp

android - Java ClassCastException on getting JSON parsed java object -

android - Java ClassCastException on getting JSON parsed java object - hi guys have problem in java. problem around parsing json jackson instructed. json parsed well, that's not problem. problem lies in have multiple json items in 1 json. i've parsed this: objectmapper objectmapper = new objectmapper(); seek { list<unit> unitlist = objectmapper.readvalue(json,list.class); system.out.println("unitsize " + string.valueof(unitlist.size())); system.out.println(unitlist.get(0).getunitemail()); } grab (ioexception e) { e.printstacktrace(); } and @ unitsize it'll tell me have exactly 5 objects of unit type, okay, when want out of list says me this: exception in thread "main" java.lang.classcastexception: java.util.linkedhashmap cannot cast com.reddatura.api.httprequest$unit i've googled it, nil relevant. should problem edit: here class snippet: @jsonignoreproperties(ignoreunknown = true) public class unit

excel - Get date value based on month name -

excel - Get date value based on month name - the scenario have follows: cell a1 - contains name of current month, e.g. "october" cell a2 - contains value of current year, e.g. "2014" cell a3 - contains value of given day, e.g "22" i'd populate a3 formula give value 22 oct 2014 , have formatted date can perform comparisons , calculations in other cells - along lines of 22 + a1 + a2 . i've tried using concatenate function doesn't allow me format cell date. is possible using standard excel functions? you're looking datevalue function. can convert month names numerical date expression, can format date ( dd/mm/yyyy in illustration below). =datevalue(a3 & " " & a1 & " " & a2) as bonus, work if a1 contains short-form month names i.e. jan, feb, mar, etc. i did bit of testing, showed can drop " " space delimiters entirely: =datevalue(a3&a1&a2) in fact,

python - Groupby multiple columns -

python - Groupby multiple columns - i have dataframe want sum values in 20 different columns based on mutual enteries in 'value' column here how single column: df.groupby('value').aggregate({'count':numpy.sum},as_index=false) is there improve way extend 20 columns not write names out explicitly? i.e, way pass list of column names. please see hernamesbarbara's reply below illustration can used illustrate thhis issue. you can select columns sum list of column names using sub notation on pandas group. you're looking for? import numpy np import pandas pd info = { "dim1": [np.random.choice(['foo', 'bar']) _ in range(10)], "measure1": np.random.random_integers(0, 100, 10), "measure2": np.random.random_integers(0, 100, 10) } df = pd.dataframe(data) df out[1]: dim1 measure1 measure2 0 bar 9 86 1 bar 24 64 2 bar 47 46 3

parse xml using dom java -

parse xml using dom java - i have bellow xml: <modelingoutput> <listoftopics> <topic id="1"> <token id="354">wish</token> </topic> </listoftopics> <rankeddocs> <topic id="1"> <documents> <document id="1" numwords="0"/> <document id="2" numwords="1"/> <document id="3" numwords="2"/> </documents> </topic> </rankeddocs> <listofdocs> <documents> <document id="1"> <topic id="1" percentage="4.790644689978203%"/> <topic id="2" percentage="11.427632949428334%"/> <topic id="3" percentage="17.86913349249596%&

reactjs - Login ajax request Flux React? -

reactjs - Login ajax request Flux React? - how can do after login form submit (react component) using flux structure ajax request provides response ? can provide illustration ? basically need create ajax request, , create success/error handlers. within handlers, create actions inform stores of result. it's thought have appstore or sessionstore or hold info related current user , auth token. controller-views can hear store , render children when current user becomes authenticated. reactjs flux reactjs-flux

scheduled tasks - Handling embargoed content scenario in MarkLogic -

scheduled tasks - Handling embargoed content scenario in MarkLogic - i have marklogic 7 database in several documents inserted , every document has own created-on , released-on . illustration if document inserted database @ 1400 hrs , released-on value 1700 hrs need post document external rest service @ 1700 hrs. i have tried next options: configure cpf pipeline such whenever document inserted it's released-on value read , scheduled task created trigger based on timestamp value read released-on . following queries/ observations approach: since admin configuration manipulation apis not transactionally protected operations need forcefulness lock on uri in order create scheduled tasks within cpf action modules running in parallel. details read here when insert 1000 documents takes around 20 minutes cpf action modules trigger , create 1000 scheduled tasks based on released-on value read inserted document. how can pass uri of document triggered cpf action module

redirect to dynamic URL have PHP content in URL -

redirect to dynamic URL have PHP content in URL - how redirect form dynamic url dynamic content i start in php mode echo string , want variables in strings i sorry if not clear . new php work servers , network found intrest in web designing rephrasing question first time registered forum first time . learned how show code . learning php hobby project making myself. learning <a href="modify_pages.php?pages=<?php echo urlencode($current_pages["id"]); ?>"> modify page</a> works fine copied sample code maintain simple not sure question length if supposed come in whole code please allow me know future if reqiured come in total code <?php //current page id , current step id info sql database table page function redirect_to($new_location) { header("location: ".$new_location); exit; } if ($some_var1==$some_var2) { redirect_to("edit_pages.php?pages=<?php echo urle

php - How to get the week slot of activity in Moodle? -

php - How to get the week slot of activity in Moodle? - i add together activity (say assignment) in particular week section moodle .consider have access activity. how know start , end date of activity? consider add together activity under 30 september - 6 october. how can date?? i know logged in user details available in $user object , accessable page. similarly have date slot of activity pages. how can this. think question clear , help great.... this part of availability api : https://docs.moodle.org/dev/availability_api it depends on context want pick informations. for example, assign activity has database fields duedate , allowsubmissionsfromdate allow start , end date of activity. this query 1 above : global $db; $query = 'select id, duedate, allowsubmissionsfromdate {assign} id = :id'; $results = $db->get_record_sql($query, array('id' => 1)); edit : you should mdl_course_sections table. week course of study format d

c# - How do I show errors on a current DataGridViewCheckBoxCell? -

c# - How do I show errors on a current DataGridViewCheckBoxCell? - i have application in 1 of screens makes heavy utilize of datagridviewcheckboxcells . in short, have table set in virtualmode undo scheme involved, validation, , on. in cases doesn't create sense check box box not first checked , on. allow users it, have checking function sets cell's errortext property , doesn't allow them continue. blah, blah. i've verified it's not code clearing errortext or that. problem datagridviewcheckboxcells not paint error icon / glyph thingy when current cell. cannot reason why designed way. indeed reference source (datagridviewcheckboxcell.cs) backs me up: in datagridviewcheckboxcell.cs: protected override rectangle geterroriconbounds(graphics graphics, datagridviewcellstyle cellstyle, int rowindex) { // checks ... point ptcurrentcell = this.datagridview.currentcelladdress; if (ptcurrentcell.x == this.columnindex && ptcurre

c# - Attach a WatiN.Core.Browser instance to a Coypu.BrowserSession? -

c# - Attach a WatiN.Core.Browser instance to a Coypu.BrowserSession? - i have specflow feature has populate , submit (pesky!) windows authentication dialogue box. to creating instance of watin.core.browser; i'm doing opposed using coypu straight not can populate aforementioned dialog abstraction framework. can using waitn. i need re-use browser session created waitn (i.e. watin.core.browser) existing coypu.browsersession (creating new coypu.browsersession associated instance ok too). "browsersession.driver" , "browsersession.native" readonly can't create association here. is possible? if how? c# coypu waitn

html - PNG with white background renders as transparent on mobile Chrome -

html - PNG with white background renders as transparent on mobile Chrome - i have png transparent parts white parts. on desktop browser images renders correctly. on mobile device (motorola g, chrome) white parts appear transparent. why happen? how can solve , have white parts show white , not transparent? there no css applied image. pleace check logo top-left corner: http://brinquedoteca-xelepeti.com/ images different on web browser file 545901c612cef.png while in chrome mobile 5458fe627564d.png html css google-chrome

restkit - setWillMapDeserializedResponseBlock and RKPaginator -

restkit - setWillMapDeserializedResponseBlock and RKPaginator - i seek setwillmapdeserializedresponseblock rkpaginator object next code: [[self.paginator objectrequestoperation] setwillmapdeserializedresponseblock:^id(id deserializedresponsebody) { homecoming deserializedresponsebody; }]; but objectrequestoperation nil. can help me define willmapdeserializedresponseblock: rkpaginator ? thank restkit

sql - MySQL seems to have a bug with distinct, avg, and group-by -

sql - MySQL seems to have a bug with distinct, avg, and group-by - the next query seems behave incorrectly. grouping on single field , average on field distinct avg should homecoming 1 row every distinct average. if avg replaced count illustration query homecoming 2 rows , if distinct removed or replaced query returns 3 rows. create table x (x real); insert x values (1), (2), (3), (3); select distinct avg(x) x grouping x; mysql returns: +--------+ | avg(x) | +--------+ | 1 | +--------+ postgres returns: avg ----- 1 2 3 below query homecoming output : avg ----- 1 2 3 query select avg(x) x grouping x; here sql fiddle demo mysql sql rdbms

javascript - Accessing fields in a JSON response -

javascript - Accessing fields in a JSON response - i have class defined this: // widget class has lots of properties don't want display // utilize displaywidget class carry want display public class displaywidget { public string widgetid {get; set;} public string description {get; set;} public displaywidget(widget widget) { widgetid = widget.widgetid; description = widget.description; } } i have actionresult method ends with:: var widgets = new list<displaywidget>(); foreach (var widget in matchingwidgets) { widgets.add(new displaywidget(widget)); } homecoming json(widgets); my problem is, don't know how access widgetid , description properties within of ajax .done handler: .done( function(response) { $('#widgetsection').html(''); var html = ''; var jsondata = json.parse(response); $.each(jsondata, function (index, element)

java - Duplicated JSF messages -

java - Duplicated JSF messages - i'm using jsf richfaces , message shows error in console , generates 2 repeated messages. i have xhtml: <h:form> <h:panelgrid columns="3"> <h:outputlabel value="proyecto" /> <h:selectonemenu id="cbo_proyecto" value="#{planmaestro.idproyecto}" required="true" requiredmessage="debe seleccionar united nations proyecto."> <f:selectitem itemvalue="0" itemlabel="seleccione" itemdisabled="true"/> <f:selectitems value="#{planmaestro.listaproyectos}" var="p" itemvalue="#{p.idproyecto}" itemlabel="#{p.nombre}" /> </h:selectonemenu> <h:commandbutton value="seleccionar" action="#{planmaest

c# - Display multiple txt files using openFileDialog in seperate forms -

c# - Display multiple txt files using openFileDialog in seperate forms - i attempting create sticky note app, have form contains textbox , several buttons, arguments sake lets phone call form: form1() buttons 'new' (open empty form1 , 'save' button ( savefiledialog1 ) , 'load' button ( openfiledialog1 ). the issue im having have multi-select set true, in openfiledialog cant seem multiple selected text files open in each separate new forms. i have tried playing foreach statements no avail. any advice guys can offer great below segment of code; //load properties private void button3_click(object sender, eventargs e) { int size = -1; dialogresult result = openfiledialog1.showdialog(); // show dialog if (result == dialogresult.ok) // test result { txtuser.text = file.readalltext(openfiledialog1.filename); string file = openfiledialog1.filename; seek

Loading from multiple databases in Django custom command -

Loading from multiple databases in Django custom command - if creating django custom command, can info more 1 database? in c:/project/myproject/settings.py , have: databases = { 'default': { 'engine': 'django.db.backends.sqlite3', 'name': os.path.join(base_dir, 'db.sqlite3'), } } then in c:/project/myproject/myapp/management/commands/mycommand.py , have: users = user.objects.all() where user defined in c:/project/myapp/models.py . but if have several databases, called db1.sqlite3 , db2.sqlite3 , db3.sqlite3 etc., , want load user objects these databases in custom command? possible? from the documentation: you can select database queryset @ point in queryset “chain.” phone call using() on queryset queryset uses specified database. you define more databases in settings.py, give them names , pass name using('db_name'). django

Nested Directory Searching in Batch File -

Nested Directory Searching in Batch File - i trying run recursive loop on few directories. works: for /r "dir1" %%f in (*.c *.cpp *.h) ( echo %%f ) /r "dir2" %%f in (*.c *.cpp *.h) ( echo %%f ) but since silly (the echo part block of commands, , number of directories large), tried this: for %%d in (dir1 dir2) ( /r "%%d" %%f in (*.c *.cpp *.h) ( echo %%f ) ) which didn't work (it didn't run anything). there way work? for reason for /r doesn't late-expansion variables search path. ran procmon , found cmd.exe attempting access file/directory named %d ! one documented feature of /r if leave out directory, search cwd. used come altered form of script appears function. for %%d in (dir1 dir2) ( pushd "%%~d" /r %%f in (*.c *.cpp *.h) ( echo %%f ) popd ) fwiw, sake of script maintainability, if there more few dirs, rather list them in command, set directories search in sep

java - Comparator not sorting properly -

java - Comparator not sorting properly - i trying write test set under stress behaviour of next class. comparator website, reason section of 'propertiescreatedby' not working. unusual issue long rest of fields working , can sorted properly, when trying sort column order seems random: import java.io.serializable; import java.util.comparator; import java.util.hashmap; import java.util.map; public class casenotedtocomparator implements comparator, serializable { /** * */ private static final long serialversionuid = 1l; protected class casenotedtocomparatorinternal implements serializable { private string[] properties = null; boolean[] shouldreverse = null; public casenotedtocomparatorinternal(string[] properties, boolean[] shouldreverse) { this.properties = properties; this.shouldreverse = shouldreverse; } public int compare(object obj1, object obj2) { int resul

curl - How do I get custom headers with PHP 5.5 -

curl - How do I get custom headers with PHP 5.5 - im using php 5.5 on wamp. ahve very simple api. want read request headers request. i'm printing out headers: foreach ($_server $name => $value) { echo "name ".$name." , value ".$value."...."; } i request via curl: curl -i -h "accept: application/json" -h "content-type: application/json" -h "api_key: hv7vgd4jsbb" -h "device_id: 63843" http://localhost/schoolspace.me/device_api/project/beaufort as can see there 2 custom request headers api_key , device_id. not appear in output since upgrading php 5.5 (i content-type , take headers fine). i've done years , never had issues. how custom headers php 5.5? php curl

blade template laravel get stuck with wamp server -

blade template laravel get stuck with wamp server - i new in laravel. watched tutorials on youtube , seek did blade template couldn't load, gave me message whoops, looks went wrong. my code route.php <?php route::get('list', 'hscontroller@getlist'); hscontroller.php <?php class hscontroller extends basecontroller { public function getlist() { homecoming view::make('list'); } } in views folder have folder named layout include files such as: main.blade.php, foot.blade.php, menu.blade.php main.blade.php <!doctype html> <html> <head> <meta charset="utf-8"> <title>test</title> <link rel="stylesheet" type="text/css" href=""> </head> <body> @include('layout.menu'); @yield('content'); @include('layout.foot'); </body> </html> foot.blade.php &

android - Possible to hide POIs on Google Maps? -

android - Possible to hide POIs on Google Maps? - i have embedded google maps v2 in app. there lot of pois restaurants , parks on map, want have removed. talking things "google bldg 44" on lef image below , "charleston park" on right image below: does know way hide these points? seems possible in google maps javascript api found nil in google maps android sdk documentation. it not possible google maps android api v2, has been requested in gmaps-api-issue. indeed possible in javascript api, , possible develop javascript version mobile devices. not solve issue native android apps, way of getting done. android google-maps google-maps-android-api-2

user interface - Qt-designer: enlarging the window does not replace my items -

user interface - Qt-designer: enlarging the window does not replace my items - to maintain question simple possible, prepared simple qt designer form below there tab widget on left side , empty qwidget on right side, qwidget groupbox. groupbox has radio , pusbuttons (you can see them on object inspector window on photo ). tab widget has line edit. central widget has gridlayout , horizontal qsplitter used. my issue when enlarge window, items (lineedit, radiobutton, pushbutton) on prepare position. here illustration mean: what want when window enlarged items should placed on bottom of window, or if in middle, should remain in middle. ( don't want size of buttons/lineedits changed). how can it? the items want move dynamically, window resizing must in layout. so, in illustration you've posted, need 2 layouts; 1 within tab widget, qlineedit , @ to the lowest degree 1 in groupbox radio button , force button. if want radio , force button aligned hor

Python multiprocessing - watchdog process? -

Python multiprocessing - watchdog process? - i have set of long-running process in typical "pub/sub" setup queues communication. i 2 things, , can't figure out how accomplish both simultaneously: addition/removal of workers. example, want able add together consumers if see pending queue size has grown large. watchdog processes - want notified if of producers or consumers crashes. i can (2) in isolation: try: while true: process in workers + consumers: if not process.is_alive(): logger.critical("%-8s%s died!", process.pid, process.name) sleep(3) except keyboardinterrupt: # python propagates ctrl+c workers, no need terminate them logger.warn('received ctr+c, shutting down') the above blocks, prevents me doing (1). so decided move code own process. this doesn't work, because process.is_alive() works parent checking status of children. in case, processes want check siblings i

python - Create permanent access token -

python - Create permanent access token - im trying write script in python convert grouping names id. way doing via graph.facebook.com/search?q=groupname&type=group&access_token=xxxxx i can create access token through graph api explorer on developers.facebook.com under tools lasts couple of hours. this must possible websites such http://lookup-id.com/ https://www.wallflux.com/facebook_id/ offer service already how can create permenant token? ive tried looking around soloution involve needing access single page/group own. as grouping search needs user access token, you'll not able eternal access token. long-lived user access tokens valid 60 days , need refreshed afterwards. see https://developers.facebook.com/docs/graph-api/using-graph-api/v2.0#search https://developers.facebook.com/docs/facebook-login/access-tokens#extending python facebook facebook-graph-api

How to make a dynamic menu part in a cms with infinite submenus in php and mysql? -

How to make a dynamic menu part in a cms with infinite submenus in php and mysql? - i have question topic. purpose designing other menus in cms joomla. thought tables in database? illustration there should possible way create infinite submenu. how many tables should have have? give thanks much :) one table should enough. give every row parentid column , reference primary id of same table. there should root node no pid set. php mysql codeigniter content-management-system

communication - What happens to my MQ if my application get down after send message to biztalk -

communication - What happens to my MQ if my application get down after send message to biztalk - i'm new biztalk , have uncertainty status of message. illustration application(a) reads input client, formats , places mq (ibm).biztalk server read message mq , send other client(b). question if application(a) , mq server downwards after pushing message biztalk..will message still resides in biztalk or discorded? what result if biztalk downwards after owning message? still hold message? what result if biztalk own message consumer application(b) down? biztalk will hold message till application(b) read message 1 time up? this might simple question experts newbie i'm worried it. clarification in advance. if application pushes message queue, crashes, message still in queue. @ point, doesn't matter 'state' application in, message owned wmq , delivered destination. biztalk still read message, unaware application may have crashed. biztalk commu

c - breaking up a preformatted string -

c - breaking up a preformatted string - i trying code parse line formatted in predetermined fashion. format: nn nn/nnc... nn 2 digit number should int nnc 2 digit nubmer followed char want maintain string without \ ex. (10 0/0d 1/0d 2/1s 3/3s 4/2s 5/2s 6/5s 7/4s 8/4s 10/9d) this have code break up int state = 0; char *tokline; char *buff = "0 0/0d 1/0d 2/1s 3/3s 4/2s 5/2s 6/5s 7/4s 8/4s 10/9d" tokline = strtok( buff, " \n\0"); state = atoi( &tokline[0] ); for( int = 1; < sizeof( tokline ); i++ ){ sscanf( tokline[i], "%i %s", type, instr ); printf("(%i,%i) = %s",state,type,instr); } but giving me segmentation fault error. #include <stdio.h> int main(void) { int state, type; char instr[2]; char *tokline; char *buff = "0 0/0d 1/0d 2/1s 3/3s 4/2s 5/2s 6/5s 7/4s 8/4s 10/9d"; char token[7];//7: nn/nnc\0 int

google maps - Native View Within MasterDetailPage Xamarin Android -

google maps - Native View Within MasterDetailPage Xamarin Android - i have map view trying create bit more advanced map implementation provided xamarin.forms. wondering if there pattern embedding native view withing master detail page. in illustration image top navigation bar built in xamarin , content part highlighted in violet should created individually per platform. this typically renderer take over. see customizing controls each platform , forms2native sample. you create mapcontentpage extend contentpage , have attribute on top : [assembly: exportrenderer (typeof (mapcontentpage), typeof (mapcontentpagerenderer))] then you'd create renderer android called mapcontentpagerenderer , in onelementchanged, instanciate map using 'regular' mono android code. android google-maps xamarin xamarin.forms

java - HQL: Handling special characters -

java - HQL: Handling special characters - i trying fetch value database using hql getting exceptions because value contains special characters. not able figure out why. below code trying: hotelmapping hotelmapping = null; sessionfactory sessionfactory = hibernateutil.getsessionfactory(); session session = sessionfactory.opensession(); transaction tx = session.gettransaction(); tx.begin(); string hotelname = "a fisher's inn motel"; query query = session.createquery("from hotelmapping hm hm.hotelid.hotelname='"+hotelname+"'"); hotelmapping mapping = query.uniqueresult(); } tx.rollback(); sessionfactory.close(); the pojos below: hotel.java public class hotel{ string hotelname; double price; //getters , setters } hotelmapping.java public class hotelmapping{ @onetoone(cascade = cascadetype.all) hotel hoteid string location; } the query string query

prolog - How to get values existing in two lists -

prolog - How to get values existing in two lists - i have 2 lists song names , singer - top 10 european union , top 10 us. result should list containing songs exists in both lists. here predicates sets lists: top10us([ song(all_about_that_bass, "meghan trainor"), song(shake_it_off, "taylor swift"), song(black_widow, "iggy azalea featuring rita ora"), song(bang_bang, "jessie j, ariana grande & nicki minaj"), song(anaconda, "nicki minaj"), song(habits, "tove lo"), song(dont_tell_em, "jeremih featuring yg"), song(animals, "maroon 5"), song(stay_with_me, "sam smith"), song(break_free, "ariana grande featuring zedd") ]). top10eu([ song(prayer_in_c, "lilly wood & prick"), song(lovers_on_the_sun, "david guetta & sam martin"), song(chandelier, "sia"), song(rude, "magic!"),

optaplanner - Patient transportation -

optaplanner - Patient transportation - i searching algorithm , jsprit or optaplanner project seems in order resolve problem. work java. have take @ jsprit bike example, entry point, , need solve problem arround patient transportation. a stretcher can carry bed, wheelchair or valid patient. can carry wheelchair , valid @ same time if go same area , come same area. for long distance, bed require 2 stretchers a bed mover (a kind of electrical truck fixed bed) replace 1 stretcher bed movers efficient long distance may utilize short too a bed mover helps bed (nor wheelchair nor valid patient) when finish, bed mover stays in place or returns empty park area (maybe 1..n places) general rules : the total time of transportation per agent must equals possible each others (equity) transports time windowed , delay must short possible (depending on priorities) new transport requests comes every time it's improve utilize bed movers 2 stretchers can give me how start resolve k

amazon web services - EMR Hadoop-streaming job fails while looking for container_tokens -

amazon web services - EMR Hadoop-streaming job fails while looking for container_tokens - attempt run emr streaming job fails with: 2014-10-15 18:36:36,560 error [main] org.apache.hadoop.yarn.yarnuncaughtexceptionhandler: thread thread[main,5,main] threw exception. java.io.ioexception: exception reading /mnt/var/lib/hadoop/tmp/nm-local-dir/usercache/hadoop/appcache/application_1413396780703_0003/container_1413396780703_0003_01_000218/container_tokens @ org.apache.hadoop.security.credentials.readtokenstoragefile(credentials.java:177) @ org.apache.hadoop.security.usergroupinformation.loginuserfromsubject(usergroupinformation.java:744) @ org.apache.hadoop.security.usergroupinformation.getloginuser(usergroupinformation.java:703) @ org.apache.hadoop.security.usergroupinformation.getcurrentuser(usergroupinformation.java:605) @ org.apache.hadoop.mapred.yarnchild.main(yarnchild.java:98) caused by: java.io.filenotfoundexception: /mnt/var/lib/hadoop/tmp/nm-local-dir/u