Posts

Showing posts from June, 2015

testing - GeoLocation App not working on Android Emulator -

i testing geo-location app using emulator created in android studio. have passed latitude , longitude using ddms seems work. confirmed going google , checking location. location changes based on changes on lat/long. however, app under test not getting location information. app displays location services not turned on when in fact turned on , working fine. there specific command can target app on emulator? have tried geo fix commands experiencing same issue. this worked me once. best use actual device there no guarantee work everytime. the android 2.x simulators not return geolocation result unless enablehighaccuracy option set true. also use in code navigator.geolocation.getcurrentposition(onsuccess, onerror, { maximumage: 2000, timeout: 10000, enablehighaccuracy: true }); and use telnet in emulator enter fixed co-ordinates samvid@locahost:~$ telnet localhost 5554 trying 127.0.0.1... connected localhost.localdomain. escape character '^]'. and

wordpress .html / .css remove space between <img> and <div> -

Image
<div class="main-navigation"> .... </div> <img src="" width="961" height="10px" alt="greyline"> hi problem after div element want insert img , can see ( in google chrome browser developer tools screenshot ) there space between red horizontal menu , grey line. i have no clue how eliminate space. cannot find padding, border or margin between <div class="main-navigation"></div> , <img> tag , restircted .css knowledge there should no space if provide url can give exact answer. but..... here options remove img tag , add div css background gradient colors in image make img "position:absolute" , adjust position "top" or "margin-top" try adding margin:0, padding:0 img tag(not sure)

java - jaxb xjc falg in base class accessible from inner ones -

maybe didn't use right words many searches on topic, couldn't find answer. intro i have xsd file contains complex types. need ("expensive") xslt transformation returns string before marshal. when has changed since last marshal, otherwise use previous transformation output. need string value in other places too, not upon doing marshal. (by way, xsd file changes every year or two) the problem to prevent transformation happening when nothing has changed, need kind of flag "true" whenever field changed. think best place flag base extracted class, each instance of keeps updated. problem comes when need change flag within contained class, since doesn't have reference base class. i remember asking few years in jaxb mailing-list. don't remember answer ended making base class singleton , added static fields in using binding files. using aop changed 1 of added fields every time setter invoked (for short). now, need class not singleton. need h

diff - How to get modified files and lines impacted at a given revision with mercurial style? -

i trying extract files impacted revision , changed lines in files mercurial. so far, i've list of files : hg log --stat -p -r r --style my_style my_style changeset = "{date|hgdate}\n{files}\n" file = "{file}\n" here's output example : 1200467360 0 groovy.editor/src/org/netbeans/modules/groovy/editor/lexer/groovylexer.java 1 files changed, 3 insertions(+), 2 deletions(-) diff -r a72d4e87d6cf -r 260a269563c6 groovy.editor/src/org/netbeans/modules/groovy/editor/lexer/groovylexer.java --- a/groovy.editor/src/org/netbeans/modules/groovy/editor/lexer/groovylexer.java wed jan 16 06:16:32 2008 +0000 +++ b/groovy.editor/src/org/netbeans/modules/groovy/editor/lexer/groovylexer.java wed jan 16 07:09:20 2008 +0000 @@ -112,7 +112,7 @@ if (antlrtoken != null) { int intid = antlrtoken.gettype(); - int len = lexerinput.readlength() - mycharbuffer.getextracharcount(); + int len = lexerinput.r

rest - Paw returns wrong web page compared to browsers -

Image
the requests appear sent wrong host (not entirely sure host they're being sent response can sent 4 different servers). chrome returns right json response: paw's nsurlconnection library : but default paw http library returns 404 not found : you have 2 local servers listening on port 8000, 1 listens ipv6 connections (note: it's default php apps) , 1 listening ipv4 connections. when connect "localhost" don't specify ip protocol want use, , sounds clients (including chrome, asihttprequest , nsurlconnection in paw) choose connect ipv6 first. whereas paw http library chooses connect ipv4 (we made choice ipv4 still used, , wanted avoid bugs as possible) . so when run main web app specifying localhost:8000 server (php in case) listens [::1]:8000 (which ipv6 equivalent 127.0.0.1:8000 ), , guess other server listens actual ipv4 127.0.0.1:8000 . chrome , other libraries connect [::1]:8000 (ipv6) , main php application, whereas "paw

javascript - Is it possible to access a mobile devices battery status or charge via a web browser api? -

i've spend time looking around see if possible access mobile devices battery status or charge via web browser api haven't found resources or discussing topic. makes me believe it's not possible isn't in spec of whatever reason (security?). either way i've found possible battery status / charge percentage ios, cordova, phonegap, appcelerator etc.. of has api might able work might work looking developing. of these solutions still required app run native app — i'm hoping able run in browser on device. is possible? if so, browser api should looking into? thanks tapani , michael, your pointed me in right direction. info provided able find more info on spec , browsers support api. chrome 42.0.2311.90 (64-bit) not seem support battery api. chromium version 22.0.1225.0 (149762) not support battery api. chrome canary version 44.0.2387.0 canary (64-bit) supports spec on mdn ( https://developer.mozilla.org/en-us/docs/web/api/battery_status_api ) not

vmware - How should I tune an Ubuntu server for many high memory php-cli processes causing high load with good hardware? -

i run many php-cli scripts via crontab on ubuntu server running within vmware vsphere. php scripts memory hogs (fixing simultaneously) seems should have resources needed on vm. load average high in 100+ range high-performance 8core , 120g ram box. i'm puzzled why load high when see: large amount of memory free no swapping top reports 80+ cpu idle environment info: #uname -a linux tasks 3.0.0-2-amd64 #1 smp fri oct 7 20:48:45 utc 2011 x86_64 gnu/linux the following items have been adjusted in sysctl: #head /etc/sysctl.conf fs.file-max = 2097152 vm.swappiness = 10 vm.dirty_ratio = 60 vm.dirty_background_ratio = 2 top top - 10:51:27 219 days, 21:50, 3 users, load average: 190.18, 171.37, 152.70 tasks: 400 total, 179 running, 220 sleeping, 0 stopped, 1 zombie %cpu(s): 11.4 us, 1.7 sy, 0.0 ni, 86.2 id, 0.4 wa, 0.0 hi, 0.3 si, 0.0 st mb mem: 121121 total, 51993 used, 69128 free, 17 buffers mb swap: 6257 total, 0 used, 62

Swagger document for spring security using xml configuration -

i tried using swagger, spring-rest-doc , spring-fox generate documentation spring mvc based rest services. however, challenge document spring security xml configuration based endpoints. far spring-fox has been winner. documents of methods spring security supports. ideas on how filter out ones need? for instance, when use /swagger-ui.html pull documentation page see following groups: basic-error-controller authorization-endpoint whitelabel-approval-endpoint health-checker of need authorization-endpoint , health-checker. ideas? have looked @ documentation to transition 2.0 ? @bean public docket swaggerspringmvcplugin() { return new docket(documentationtype.swagger_2) .groupname("business-api") .select() //ignores controllers annotated @customignore .apis(not(withclassannotation(customignore.class)) // , paths .paths(paths()) .build() .apiinfo(apiinfo()) .se

python - multithreading - overwrite old value in queue? -

i have 2 threads: producer , consumer. producer periodically acquires information , provides consumer. consumer wants current copy of information , check aperiodically , maybe long intervals. it seems simplest mechanism facilitate communication create queue.queue(maxsize=1) . however, if producer acquires new information before old information consumed block until consumer uses out of date information first. there way producer overwrite old information? is there better threadsafe mechanism accomplish this? the simplest fix let producer consume old value, if there one, before putting. can use queue.get_nowait() this. stylistically, i'm not keen on using queue ever intended hold 1 object. normal lock + reference variable make more obvious code does.

Stop and Continue Looping of For Loop In Java -

i have project in having "for loop" iterating on arraylist. need stop iteration in between , continue again. tried doing applying "if else" condition in between didn't work. i have arraylist of size 2500 , need loop iterate 500 times , wait , call function , again continue looping , stop after next 500 , on. here have tried far: int msgcount = 0; arraylist<jsoninput > savearraylist = new arraylist<jsoninput >(); for(jsoninput jsoninput: arrxmlstring){ publisher.send(jsoninput); savearraylist.add(jsoninput); if(msgcount<500){ // loop 500 times , increment msgcount msgcount++; } else { msgcount=0; sentservice.sendarraylist(savearraylist); savearraylist.clear(); } } this not working. loop not stop , when debug stops in "else" condition loop not wait condition complete. i have arraylist of size 2500 , need loop iterate

Convert Jquery slidetoggle code to Javascript -

how can convert jquery slidetoggle() function javascript? var $context = getcontext(context); $($context).on('click', '.m_menu', function () { $('.w_nav').slidetoggle(); }); well not converting jquery code javascript, rather doing in plain javascript. can achieved in different ways. here 2 comes mind: html: <button id="mbtn" onclick="slidetoggle()">slidetoggle</button> <div id="mdiv">some context</div> 1. using javascript's setinterval : having boolean value keep track of whether need slideup or slidedown (toggle) , using setinterval increase/decrease height. jsfiddle demo javascript: var open = true; var heightchecked = false; var initheight = 0; var intval = null; function slidetoggle() { window.clearinterval(intval); var mdiv = document.getelementbyid('mdiv'); if(!heightchecked) { initheight = mdiv.offsetheight;

actionscript 3 - Remove duplicate enteries/items from XML in AS3 -

i'm getting duplicate results xml file. want delete excess ones having trouble achieving using splice , indexof . can point me in right direction?? var xmlloader:urlloader = new urlloader(); var xmlreq:urlrequest = new urlrequest("data.xml"); xmlloader.load(xmlreq); var background:bkg; var textvar:textfield = new textfield; xmlloader.addeventlistener(event.complete, convertdata); function convertdata(event:event){ var xmlinfo:xml = new xml(event.target.data); //trace(xmlinfo); var list:xmllist = xmlinfo.profile.photography; var totalimage:number = list.length(); trace("length " + totalimage); enterbtn.addeventlistener(mouseevent.click, entersite); function entersite(event:mouseevent){ (var i:int =0; i<totalimage; i++){ trace(xmlinfo.profile.photography[i]); background = new bkg(); background.y = i*40; background.x =80; addchild(back

javascript - Staged Donation Form in Bootstrap -

Image
i have been trying create staged donation form in bootstrap, use forward , backward buttons move part of same form. have nice indicator @ top, denoting step of completion at. staged donation forms increases donation rates average of 4.8%, have it. i found tutorial online , it's nice, has problems hope can me fix (code @ link): 1) if placed in column side side another, glitches out when next button pressed, shifting content down row. 2) unable apply css min-height attribute , have hold true after next button pressed. keep each part of form same height , button @ bottom in same place. 3) not include javascript button. 4) don't need form validation, it's useless bulk. thanks guys can give me, know it's quite lot of ask in 1 question, js not specialty , it's pro bono work charity. for button, have create new button go previous step , add html 2nd , 3rd steps. can duplicate nextbtn functionality , reuse previous button (but can remove input val

c# - Xamarin Forms PCL Consuming WCF does not always return a value -

i have simple wcf service validating login , return object representing user. it being run xamarin forms pcl project. when click login button, returned object returns null first time, when pressing second time returns user object. the object being created in async functions on completed method. i not quite sure missing. here pieces of code clarify. thanks , assistance! the function called clicking button... private void buildloginuser(string strusername, string strpassword) { if (strusername == null || strpassword == null) { strresult = "please enter user name , password."; displayalert("alert",strresult,"ok"); } else { //if username , password received validate against db //cl.validateuserasync (strusername, strpassword); //strresult = struserrole; buildclientservice bcs = new buildclientservice (); //authenticateuser au = new authe

Writing a Python module using C/API and C++ classes -

i new business of writing custom python modules , bit confused how capsules work. use python 2.7.6 system osx installation , try use capsules (as recommended python > 2.7) passing pointers around (before used pycobject that). code not work @ moment , insights how things should handled in principle here. code should define class luscherclm , want able following: >>> c40=luscher(4,0) >>> >>> c40(0.12) >>> <print result of evaluation> first question: @ moment have like: >>> c40=luscher.init(4,0) >>> >>> c40.eval(0.12) segfault my first question therefore: how have modify method table have more operator-style casts instead of member functions init , eval. however, code has other problems , here relevant part (the underlying c++ class works smoothly, use in production lot): the destructor: //destructor static void clm_destruct(pyobject* capsule){ void* ptr=pycapsule_getpointer(capsule,"zetfun

java - Swagger Error Expected type string but found type integer -

i started working on swagger generate documentation our restful apis. use yamlbeans-1.09.jar convert java dtos yaml file. works fine , yaml validated on http://www.yamllint.com/ still while testing swagger interface, gives error "expected type string found type integer" , "no enum match for: 2" wherever mention swagger : 2.0 in file. my sample yml file is: basepath: /employment host: api.xxxx.com schemes: - https swagger: 2.0 info: title: api doc description: description info goes here version: 1.0.0 it tends give error line number before swagger version. appreciated. edit: have defined swagger version string in java code , written described below: hashmap<string, object> rootelementsforyml = new hashmap<string, object>(); rootelementsforyml.put(swagger, "2.0"); rootelementsforyml.put(host, "api.xxxx.com"); rootelementsforyml.put(basepath, basepath); rootelementsforyml.put(schemes, new string[]{&qu

How to read a large file of Strings in chunks, each time from different offset, in Java? -

i have large file consists of several lines, each line 1 word of english. complete file not fit in memory. such, want process chunk chunk. so, need implement this: method1 : read 1 chunk, call method 2. method2: processing on strings in chunk , go step 1. i have 2 questions. 1. how can 1 implement method1? know how implement method2. i know how use bufferedreader read large file line-by-line. e.g., bufferedreader br = new bufferedreader(new filereader(file)) { string line; while ((line = br.readline()) != null) { // process line. } but read more lines instead of 1 line, , process of them in method2. then, when method1, want load several lines once again... 2. assumption is more efficient (performance wise), process chunk of lines rather process each line. assumption correct? the bufferedreader takes care of reading lines in chunks. so choice between: after each call readline(), call method process it after each call readline(),

javascript - How can i convert all factories to one factory? -

how can convert below different factories 1 factory.i confuse how implement , save method if have 1 factory. factory.js angular.module("app").factory('riskservice', function ($resource) { 'use strict'; return $resource('app/risk/rest/risk/:id'); }); //riskeventtypeinfo angular.module("app").factory('riskeventtypeinfo', function ($resource) { return $resource('app/risk/rest/risk/getriskeventtypeinfo/:id', {}, { 'query': { method: 'get' }, 'get': { method: 'get' } }); }); //riskcausecategoryinfo angular.module("app").factory('riskcausecategoryinfo', function ($resource) { return $resource('app/risk/rest/risk/getriskcausecategoryinfo/:id', {}, { 'query': { method: 'get'

Google app script stop running after close browser -

i have google sheets add-on process large amount of data. when user submits task, might take long time process. might close sidebar or browser. how can make app script keeps running add-on closed. have script set near future trigger function in question , add-on poll successful completion of previous processing on timeout or startup (using hashed script properties say). no matter if sheet open or closed triggered function runs standalone process.

php - Grabbing data from two HTML forms from the same page -

so i've searched through posts, , i've seen can't use html form within html form. like: <form method="post" action="x.php"> <input type="..."/> <form method="post" action="x.php"> <input type="..."/> </form> </form> ok, problem want make different page, contains html code this: <?php if(isset($_get['vote']) && $_get['vote']=='yes'){ echo 'vote inserted'; } # gets email value main form $email = isset($_post['email'] : $_post['email'] : null; #grab infos bd user email, $stmt = $db->prepare('select name,email,vote tbl email=:e'); $stmt->execute(array(':e'=>$email)); while($row = $stmt->fetch(pdo::fetch_obj)){ if($row->vote == 'no'){ # if user didn't voted, if(isset($_post['vote'])){ # if <a> pressed, update db

java - Closing a thread that is currently running but has no loop -

while creating app have run issue of closing thread runs user inputted code using beanshell. thread.stop(); failed kill thread ideas? running code line @ time isn't plausible due loops in users code. final thread thread = new thread() { public void run() { try { interpreter.run(); } catch (runtimeexception runex) { runex.printstacktrace(); log.d("end of bsh", "end of bsh"); } } }; thread.start(); thread.interrupt();

c# - How can get access to Unity container in a class library ActionFilterAttribute? -

so, have web project utilizes unity inject userrepository interfaces iuserrepository . have class library contains custom actionfilterattribute . custom attribute class used on many actions already. want add code check value in database based on user. this, need access userrepository . old fashioned way using statements , directly access userrepository , utilize di , resolve iuserrepository . how can access web resolving iuserrepository to, inside custom attribute class since actionfilterattribute needs empty constructor? attributes metadata objects. shouldn't involved in database access. use separate service read attribute values , result access database.

.net - Can you split a visual studio project (c#) and reference it? -

Image
not sure how explain here goes. i have 2 projects reference sqlite. 1 windows , 1 windows phone. now need create class library each platform, , reference correct sqlite project each. ideally create code in 1 place , reference in each project. problem code uses sqlite. i not want have separate copy in each project each platform. can want, or not possible? i thought maybe able because if create windows application using cordova, somehow creates 3 projects, 1 windows, 1 phone , other has shared resources in. here sort of thing of like sqlite - windows sqlite - phone library - windows (references sqlite windows) library - phone (references sqlite phone) library - shared (shared code both library projects can use) cordova - windows (references library windows) cordova - phone (references library phone) cordova - shared (shared resources both cordova projects can use) this because sqlite cannot run on both windows , phone, need separate project each this o

javascript - How to verify Do Not Track (DNT) in HTTP request headers? -

Image
i setting dnt value in http request header doing this: request.setrequestheader("dnt","1"); and can see in dev tools network tab but there other way verify on ui or console logs demonstrate how , specific sources (like scripts) of websites not allowed track user. "dnt" advisory. browser nothing besides sending it; it's servers process it.

methods - Java: Parameter list without comma -

i came across method parameter list parameter not separated comma , no declaration of variable type: public int comparewith(choice anotherchoice){ later these parameters called without further declaration inside body in if-else statement in combination method: if ((this.type == 0)&&(anotherchoice.gettype() == 1)){ return -1; this brief summary of entire class: public class choice { private int type; public choice(int type) { //initialize "type" instance varialble this.type = type; } public int gettype() { return type; } public int comparewith(choice anotherchoice) { choice choice1 = new choice(0); choice choice2 = new choice(1); if ((this.type == 0)&&(anotherchoice.gettype() == 1)){ return -1; the program goes on. don't link between anotherchoice, gettype() , choice2. task in online course , program works intended, don't know why. i'm guessing you're new programming, i'l

html - Table width border cellspacing cellpadding all 0 in HTML5 error validation -

Image
i need use tables data changing html5 , new css. problem html5 validators giving me validation problems tables here table <table width="600" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="200" align="left" valign="top"> td 1 must 200px width </td> <td width="200" align="left" valign="top"> td 2 must 200px width </td> <td width="200" align="left" valign="top"> td 3 must 200px width </td> </tr> </table> i tried css cannot make work. need have table 600px width, 1 tr , 3 td, each td must 200px (600px / 3 = 200 each ) tested adding style="align:left; valign:top;" not work. neither cellspacing or cellpadding. need no cellspacing no cellpadding no border don´t know how achieve ... any ideas? looked info online see new way of css add collapse or can

PHPExcel - Export Missing Row -

can tell me wrong code exports headers ok missing 1 record export. many thanks $rownumber = 1; //start in cell 1 while ($row = mysql_fetch_assoc($result)) { $col = 'a'; // start @ column // returns title row if ( $rownumber == 1 ){ $headers = array_keys($row); foreach($headers $header) { $objphpexcel->getactivesheet()->setcellvalue($col.$rownumber,$header); $col++; } $rownumber++; }else{ //returns content rows $col = 'a'; $rownumber foreach($row $cell) { $objphpexcel->getactivesheet()->setcellvalue($col.$rownumber,$cell); $col++; } $rownumber++; } } $objphpexcel->getactivesheet()->removecolumn('a',3); you're displaying headers first row retrieved database, not data row.... $rownumber = 1; //start in cell 1 while ($row = mysql_fetch_assoc(

html - How to put column of same height using overflow on one of them? -

hi i've search lot around cant find answer suit me. here problem: i specify right i'm using bootstrap . have 2 columns working : --------------------- | content | aside1 | | |------- | | | aside2 | --------------------- the idea put content @ same height aside1 , aside2 incorporating overflow:scroll content. html : <div class="container-full"> <article class="col-md-8 col-xs-12"> <p>long content there</p> </article> <div class="aside_full_screen"> <aside class="col-md-4 col-xs-12"> <p>social network content</p> </aside> <div class="col-md-4 col-xs-12"> <p>kitten content</p> </div> </div> </div> css : article{ border: 2px solid black; background-color: rgba(240, 116, 90, 1); overflow: auto; height: 1200px; /* — there example, had remove — */ } ::-

windows - Active Directory VBScript Issue -

i'm creating script assign active directory user group want use text box input instead of predefining username. know i'm doing stupid here strusername predefined dim value @ top of code. userpath = "ldap://cn=users" & "cn=" & strusername) & "cn=users,dc=domain......." you have spurious cn=users before username, spurious parenthesis after username, , must have commas between path segments. userpath = "ldap://cn=" & strusername & ",cn=users,dc=example,dc=org"

Does RPGLE has a ternary operator? -

i did find old posts on forums question. old, wondering if changed. i know that, maybe in 2004, rpg did not have ternary operator. having work bit in c# , java, did use them , them. wondering if rpgle included them, somehow. in c#, ternary operation looks : myvar = var1 > var2 ? var1 : var2; so if var1 greater var2, myvar var1. basic example. so... guys know if there's ternary operator in rpgle , if there is, what's syntax? no, rpgle not have ternary-operators. http://www-01.ibm.com/support/knowledgecenter/ssw_ibm_i_72/rzasd/expropt.htm

bioinformatics - Galaxy localhost reference data uploading -

anyone knows how upload reference files galaxy localhost? i've tried using ftp filezilla couldn't connect localhost, i've tried data manager provided galaxy resulted in errors(fatal error: exit code 127 (error); fatal error: exit code 126 (error)). can help??? this galaxy has nothing samsung galaxy way.

php - Select specific username and display something in his profile -

<?php if(!isset($_post['searchito'])){ } $search_sql="select status users id=id"; $search_query=mysql_query($search_sql); if(mysql_num_rows($search_query)!=null){ $search_rs=mysql_fetch_assoc($search_query); } if(mysql_num_rows($search_query)!=null){ do{?> <span>status:&nbsp;</span><?php echo $search_rs['status'];?><br> <?php }while($search_rs=mysql_fetch_assoc($search_query)); } else{ echo "no results found"; } ?> this code echo status of registered, want display status of specific user logged in. if user1 has status value of 1 display 1 , user2 has status value of 2 display 2 after few debugging, found solution: <?php $startna = $_session['user_id']; $search_sql="select status users id='$startna'"; $search_query=mysql_query($search_sql); if(mysql_num_rows($search_query)!=null){ $search_rs=mysql_fetch_asso

ios - AFHTTPRequestOperationManager isn't call (no response/no faillure) -

here's code : [[afnetworkreachabilitymanager sharedmanager] startmonitoring]; mainmanager = [afhttprequestoperationmanager manager]; mainmanager.requestserializer.timeoutinterval = 30; i initialise afhttprequestoperationmanager this. urltowhere = @"myurl.php"; parameters = @{@"user_id": "1"}; nslog(@"a"); [mainmanager post:urltowhere parameters:parameters success:^(afhttprequestoperation *operation, id responseobject) { nslog(@"result"); } failure:^(afhttprequestoperation *operation, nserror *error) { nslog(@"error"); }]; nslog(@"b"); the fact display in logs, none of "result" or "error" displayed, , b displayed. is there exception afhttprequestoperationmanager dodge ? i can not comment @ moment, using answer options. shouldn't urltowhere parameter this urltowhere = @"http://myurl.php";

bolt cms - Config.php -error when logging in -

after updating 2.1.7 error in backend saying " warning: invalid argument supplied foreach() in /domains/domaindomain.nl/default/src/config.php on line 641 warning: cannot modify header information - headers sent (output started @ /domains/ityhardy.nl/default/src/config.php:641) in /domains/ityhardy.nl/default/src/users.php on line 287 " using sqlite on site. frontend seems work fine. i must add @ time of updating making small changes in contenttypes.yml, don't know in exact order did what. found it: there stray “uses” in wrong field somewhere in contenttypes.yml

Build a Visual Studio 2013 project in pure C -

Image
what best way this? templates seem allow c++ (which compatible c, not same.) proper way this? (a particular #define or whatever.) appreciated. the solution simple , easy you create new win32 console project remove default .cpp file add new .c file wish in properties, under c/c++ --> options, find "compile as", select "compile c code" simple sanity check. code doesn't work c++ since "new" reserved word c++. int new = 10;

asp.net mvc - Client doesn't make a connection to the SignalR server -

Image
i'm trying implement signalr application. start things of started basic, reason i'm getting error whole time. pease have @ code , see i'm doing wrong. in advance. starup code using microsoft.owin; using owin; [assembly: owinstartupattribute(typeof(cdvportal.startup))] namespace cdvportal { public partial class startup { public void configuration(iappbuilder app) { configureauth(app); app.mapsignalr(); } } } hub code using system; using system.collections.generic; using system.linq; using system.web; using microsoft.aspnet.signalr; using microsoft.aspnet.signalr.hubs; namespace cdvportal.hubs { public class reservationshub : hub { public void newreservations() { clients.all.newreservation("hey works"); } } } client side code <script src="~/scripts/jquery-2.1.3.js"></script> <script src="~/scripts/jq

How to get User details using Team Foundation Server (TFS) java SDK -

i trying access tfs user details(profile details) user performed activities in tfs server. getting user display name using 'assigned to' or 'created by' fields. i trying user identity using following code. iidentitymanagementservice identitymanagementservice = (iidentitymanagementservice)tpc.getconfigurationserver().getwebservice(identitymanagementservice.class); teamfoundationidentity userid = identitymanagementservice.readidentity(identitysearchfactor.display_name, "chunky garg", membershipquery.direct, readidentityoptions.extended_properties); using above code end in following exception exception in thread "main" com.microsoft.tfs.core.config.webservice.unknownwebserviceexception: unknown web service: [com.microsoft.tfs.core.clients.webservices.identitymanagementservice] @ com.microsoft.tfs.core.config.webservice.defaultwebservicefactory.newwebservice(defaultwebservicefactory.java:226) @ com.microsoft.tfs.c

wordpress - MYSQL remove word from a column in a table -

i'm using wordpress , want go through entire wp_posts database using mysql remove word "on" slugs. i've tried these 2 lines; update wp_posts set post_name = replace(post_name, '%on-%', '') post_type = "post"; select *, replace(post_name, '%on-%', '') wp_posts post_type = "post"; they dont remove word 'on' things such "12th-annual-helmets-on-kids-campaign" thanks guys try update wp_posts set post_content = replace(post_name, 'on-', '') post_type = "post"; and omit % .

javascript - Sweet alert timer - done function -

i have been playing little sweetalert plugin: sweet alert i wanted make delete button, user gets prompted before actual delete. when user presses "delete" again, says "done" , user has click "ok" again prompt go away good. sweetalert has timer function, can auto close last "done" prompt after few seconds or so, works fine. have feature, can implement function run when user clicks "ok" on "done" prompt. problem is, function not run, if prompt auto closes after timer done. any ideas how can done? with timer , function not being run: swal({ title: "deleted!", text: "your row has been deleted.", type: "success", timer: 3000 }, function () { location.reload(true); tr.hide(); }); without timer, working function (on click "ok" button): swal("deleted!", "your row has been deleted.", "success&qu

python - Pygame Pixel Array generator -

i'm trying draw functions , graphs using generators in python (2.7.9), , found problem: can't flush generated pixel data (rgb tuples) pygame pixel array. here's code (which tryied run): using 2d arrays pixarr = pygame.pixelarray(surface) pixarr=[[(0,0,function(x,y)) x in range(1,screenx)] y in range(1,screeny)] del pixarr here i've realized pixarr isn't ordinary 2d list becouse of failure output (print pixarr) then i've tryied using range pixarr[0:screenx*screeny] = [(0,0,function(curpix%screenx, curpix//screeny)) curpix in range(0,screenx*screeny)] i've found code on pygame website here , gives me error "valueerror: sequence size mismatch", after playing around became clear works single color (for example pixarr[0:screenx*screeny]=(0,0,255) colors whole screen blue) tl;dr: how can set each pixel without using loops for y in range(0,1000): x in range(0,1000): gfx.draw(surface,x,y,(0,0,function(a,b))) #or pixarr

sql server 2008 - Arithmetic overflow error converting varchar to data type numeric - Can't find answer that fits -

Image
been searching hour , can't find answer addresses what's happening code. query happily returns data: with results_test_component_cte(requisitionnumber, resultsname, resultvalue) ( select [requisitionnumber] ,[resultsname] ,ltrim(rtrim([resultvalue])) dbo.results_test_component --where testgroupnumber in ('t4367', 't8033') substring(requisitionnumber, 2, 4) = '1521' , resultsname = 'hemoglobin a1c' , isnumeric(resultvalue) = 1 ) , results_test_component_cte2(requisitionnumber, resultsname, resultvalue) ( select requisitionnumber ,resultsname ,cast(resultvalue decimal(3,1)) resultvalue results_test_component_cte ) select * results_test_component_cte2 here first few rows of data, expected: requisitionnumber resultsname resultvalue c1521020510 hemoglobin a1c 5.9 c1521044250 hemoglobin a1c 5.4 c1521123010 hemoglobin a1c 5.6 c1521121420 hemoglobin a1c 5.8 c1521102210 he

javascript - Get LCSK (Live Chat Starter Kit) to always be expanded, or do so at page_load -

i'm trying incorporate lcsk website. since requires .net 4.5 , site on 4.0, , can't upgrade atm, i'm trying workaround, host chat on separate sub domain on it's own app. have iframed inside ajax collapsible pane l website. problem once expand ajax panel, still need click "chat us" blue bar start actual chat. i'd assume need sort of javascript simulate on_load.click, or run functions me, can't seam work.i tried $(document).ready(function () { $("#chat-box-header").click(); }); but didn't work, , similar no success. the main action happens trough .js file thanks! this trick fine: $(document).ready(function () { lcskchat.config(); lcskchat.init(); $("#chat-box-header").click(); }); i'd need hide blue bar, , iframe or include link chat page when user clicks ajax bar, other that, trick allow add chat sites 4.0 or less (if can host separate web app chat only).

Accessing field in decoded json string PHP -

i'm trying access field 'id' of first song in decoded json string using php. i've tried possible combinations one: $response->songs[0]->id this decoded json string: array ( [response] => array ( [status] => array ( [version] => 4.2 [code] => 0 [message] => success ) [songs] => array ( [0] => array ( [artist_id] => arrh63y1187fb47783 [id] => sokgwes13d647be466 [artist_name] => kanye west [title] => of lights ) [1] => array ( [artist_id] => arrh63y1187fb47783 [id] => sohbkvu14509a9f6c3 [artist_name] => kanye west [title] => of lights ) [2] => array ( [artist_id] => arrh63y1187fb47783 [id] => sodelay13ad1acc8cf [artist_name] => kanye west [title] => of lights ) [3] => array ( [artist_id] => arrh63y1187fb47783 [id] => soudiym14b7c7b2d95 [artist_name] => kanye west [title] => of lights ) [4] => array ( [artist_id] => arrh63y1187fb47783 [id] => sotempj13db921f71f [artist_

cordova - Phonegap+ jquery mobile windows phone 8 app slow loading local html file -

we developing phonegap jquery mobile app windows phone 8. facing problem. getting blank black screen between page transitions of htmls. htmls local, no internet required. each page takes hell lot of time load. please suggest solution. my suggestion not use jqm. library heavy , not many phones today can handle easily. alternative use sencha touch. if know backbonejs go it. if dont know backbone or dont want use sencha, use plain javascript. can everyting need plain js.

css - Displaying images in email by default -

i sent test email using mailchimp of edm have custom designed coded. works fine except images won't display unless click 'display images'. i'm viewing in gmail on firefox. strange considering other emails sent me have images displayed automatically. coding or setting in mailchimp? <!doctype html public "-//w3c//dtd xhtml 1.0 strict//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>grill10 | results</title> </head> <body> <center> <table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%" id="bodytable" style="background:#3b4040; padding-bottom: 100px;">

Migration from Oracle to SAP HANA -

i might getting project need migration oracle sap hana, hope there must sap product perform migration. ( yes, can see many tools released dell or ispirer system performing migration want know how sap product can on ) thank you, the question rather broad , unspecific. transfer db schema design can use sap powerdesigner or sap data services. for conversion of pl/sql code there nothing "automatic" available. pl/sql , sqlscript don't overlap language/feature wise.

apache - ssl error record too long using UI CloudStack -

i have finished automatic installation of cloudstack. now want connect user interface firefox on remote host. so enter https://192.168.xxx.xxx:8080/client and error ssl_error_rx_record_too_long how can solve this? can use cli interact cloudstack server. this weird symptom of using https on port listening on http. change protocol http or find out actual https port.

java - How to make a scrolling effect for a background image -

i need make scrolling background platformer. needs scroll 2400x500 image while frame size 1440x900. if gradually change on time great. code: import java.awt.*; import java.awt.event.actionevent; import java.awt.event.actionlistener; import java.util.*; import javax.swing.*; public class main extends jframe { public main() { //creates title image jlabel title = new jlabel(" "); imageicon tl = new imageicon("title.gif"); title.seticon(tl); //creates start image final jbutton start = new jbutton(""); imageicon st = new imageicon("start.gif"); start.seticon(st); //creates options image jbutton options = new jbutton(""); imageicon opt = new imageicon("options.gif"); options.seticon(opt); options.setbackground(color.black); //creates label level 0 background image jlabel background = new jlabel(&q