Posts

Showing posts from February, 2015

How to find the drive letter of an USB mass storage drive using VID and PID in C#? -

we design usb msd product, need write c# application processing on files stored in memory. can advise me,how detect whether usb device particular vid+pid connected computer , if so, drive letter(or root drive path)? i able find examples detect whether particular( vid+pid ) usb device present or not. , able find example programs detect available removable drives , path...etc. is there example programs in c# combining these together? thanks support. i going suggest using wrapper around setupapi looks else has put answer. devcon.exe (driver tool) , openvpn

c - Find the length of a string array in the form of char**? -

this question has answer here: how find 'sizeof' (a pointer pointing array)? 15 answers i know how 1 find length of string array initialised way char* arr[] = {"some", "thing"}; just this, size_t length = sizeof(arr)/sizeof(char*); and length 2, yes? had assumed char** same thing char* array above, , whole sizeof thing not work (i @ least know pointer pointer). have looked on place trying find way length of array stored char** opposed char* [], feel don't understand enough on how this, though seems should straightforward. in program, have char** array values @ indexes 0...n, when try getting length using way above, length 1. any help? there's way it: char* arr[] = {null, null, null}; printf("%d\n", sizeof(arr)/sizeof(*arr)); this prints out 3 . there's problem approach, though, might not awar

remote request nginx with lua -

i trying make works lua code in nginx.conf file, trying connect web application proxy_pass , depending of http result render resources. here´s code location /_auth { proxy_set_header accept-encoding ""; proxy_pass http://127.0.0.1:8080/welvi-rest; } location /server/ { content_by_lua " local res = ngx.location.capture('/_auth'); ngx.print(res.status); if res.status ~= ngx.http_ok ngx.exit(ngx.http_forbidden) end "; } but dont know why web application server in 8080 never invoked. i read related issue because headers need add in lua, not found fix of problem

ios - Does NSMutableAttributedString automatically concatenate identical adjacent attributes? -

we have simple markup parser in our ios app takes text html-like tags , converts nsattributedstring iterating on each character in simple nsstring , producing nsmutableattributedstring . in worst case scenario added new set of attributes every single character iterated through string, nsmutableattributedstring intelligent enough join identical adjacent attribute ranges , optimize? or horribly inefficient , slow render in core text? i'm not suggesting algorithm in general! i'm looking @ worst case scenario, , wondering whether nsmutableattributedstring has built in intelligent behaviour? i tried (a simplified version of real code): nsmutableattributedstring *text = [[nsmutableattributedstring alloc] initwithstring:@"testfoobarhey"]; uifont *font = [uifont fontwithname:@"georgia-bold" size:12.0]; [text addattribute:nsfontattributename value:font range:nsmakerange(4, 3)]; [text addattribute:nsfontattributename value:font range:nsmakerange

java - Can I get additional information about the error from SAXParseException and XMLStreamReader -

i using default javax.api.validator validating xml file against xsd i.e saxparser schemafactory factory = schemafactory.newinstance(xmlconstants.w3c_xml_schema_ns_uri); schema schema = factory.newschema(new file(schemapath)); streamsource xml = new streamsource(new file(xmlpath)); xmlstreamreader reader = xmlinputfactory.newfactory().createxmlstreamreader(xml); validator validator = schema.newvalidator(); validator.seterrorhandler(new basicerrorhandler(reader)); validator.validate(new staxsource(reader)); here errorhandler: public class basicerrorhandler implements errorhandler { private xmlstreamreader reader; public basicerrorhandler(xmlstreamreader reader) { this.reader = reader; } @override public void error(saxparseexception e) throws saxexception { warning(e); } @override public void fatalerror(saxparseexception e) throws saxexception { war

scala - What is a good way to handle default values with spray-json -

in cases default values make more sense optionals in case classes: case class car(numberofwheels:int = 4, color:string) case class car(numbeofwheels:option[int], color:string) //silly in first case i'd expect able convert following json instance: {"color":"red"} but standard jsonformat2(car) , spray-json complains missing value numberofwheels . how work around cleanly? i stumbled upon same problem. i've create patch solves me. makes fields default value optional. https://github.com/spray/spray-json/pull/56 update: pr updated , still open https://github.com/spray/spray-json/pull/93

javascript - Add/Remove a Class Every 15 seconds using jQuery and stop on hover. -

i'm not great @ jquery , i'm stumped here, i'm trying make jquery carousel rotates every 15 seconds automatically , stops on hover. right have html: <section id="featured"> <div id="hero"> <div class="slide" style="background-image: url(/wp-content/uploads/2016/02/rsz_shutterstock_323582282.jpg)"></div> <div class="slide" style="background-image: url(/wp-content/uploads/2016/01/rsz_shutterstock_246059269.jpg)"></div> <div class="slide" style="background-image: url(/wp-content/uploads/2016/01/rsz_shutterstock_342971345.jpg)"></div> <div class="slide" style="background-image: url(/wp-content/uploads/2016/01/rsz_shutterstock_327686162.jpg)"></div> </div> <div class="wrap clearfix" id="latest-wrap"> <div class="clearfix&qu

Python: function that gets n-th element of a list -

i have list of strings ['abc', 'def', 'ghij'] and want list of strings containing first letter of each string, i.e. ['a', 'd', 'g']. i thought doing using map , function returns first element of list: my_list[0] . how can pass map ? thanks. you should use list comprehension, @avasal since it's more pythonic, here's how map : >>> operator import itemgetter >>> l = ['abc', 'def', 'ghij'] >>> map(itemgetter(0), l) ['a', 'd', 'g']

.net - from excel to sql server -

i have excel files contains information need convert sql server database. problem face these information not structures database model need modifications.i using .net , i'm thinking use open xml sdk parse excel files, choice or there better ? why not use ssis package if available? http://www.mssqltips.com/sqlservertip/1393/import-excel-unicode-data-with-sql-server-integration-services/ you can execute ssis package recursively, or... if need 1 time, i'd take @ ssms import / export wizard... not sure if excel, know .csvs, can use excel convert spreadsheets to. not fun if need bunch of times though, quicker other approach in regards time.

php - phpexcel setprintara not working -

i need print selected area pdf. used $phpexcelobj->getactivesheet()->getpagesetup()->setprintarea('f1:o56'); for setting print area. not working me. entire worksheet pdf. that's because setprintarea() doesn't think. when excel workbook opened in ms excel, it's possible print specified area of worksheet rather whole worksheet specifying print area. that's purpose of setprintarea() method, define that. applies when file saved excel file (excel5 or excel2007 writers), , opened again in ms excel. it not apply other writers. not tell phpexcel save part of worksheet when using writer. writers save whole worksheet defined in phpexcel object, whether excel formats, or csv or html or pdf. if want save part of worksheet, you'll need remove parts of sheet don't want deleting rows , columns.

javascript - Node.js Seperate each line into an array of integers -

i'm trying access text file , have array , have each line array of numbers. it returns on node.js 9235 9096 637 and want return [[9235], [[9096],[637]] index.js console.log("hello world"); var fs = require('fs'); var array = fs.readfilesync('txt/numbers.txt').tostring().split("\n"); for(i in array) { console.log(array[i]); } numbers.txt 9235 9096 637 if other answers aren't correct , wanted array of arrays each line: array.map(function(line) { return line.match(/\d+/g).map(function (n) { return [+n]; }); });

symfony - PHP: Check whether an integer is in a certain interval or not -

i working on achievement system small online game. achievement entity has 4 attributes: id earnedby earnedon progress the last 1 supposed percentage, meaning number between 0 , 100. in order make sure no numbers greater 100 or smaller 0 saved in database, setter-method looks followed (i using symfony2 / doctrine orm): public function setprogress($progress) { $this->progress = max(min($progress, 100), 0); return $this; } the important line here max(min($progress, 100), 0) . it works totally fine, wanted ask, if there built-in function in php doing thing, , if doing okay (concerning good-developing style) you should consider adding constraints on entity the validation component of symfony2. use symfony\component\validator\constraints assert; class achievement { /** * @assert\range(min=0, max=100) */ protected progress; } the validator service called automatically when example validating forms, can call manually

c++ - operator overloading "+" for types complex/double -

i put useful information in complex.cpp. here problem: made class complex means can calculate in complex. in + operator want enable complex + double, can use complex + double in main.cpp . when use double variable + complex there error. why that? can fix it? complex.h #ifndef complex_h #define complex_h using namespace std; class complex { public: complex( double = 0.0, double = 0.0 ); // constructor complex operator+( const complex & ) const; // addition complex operator-( const complex & ) const; // subtraction complex operator*( const complex & ) const; // mul bool operator==( const complex & ) const; bool operator!=( const complex & ) const; friend ostream &operator<<( ostream & , const complex& ); friend istream &operator>>( istream & , complex& ); complex operator+( const double & ) const; //complex &operator+( const double & ) const; void print() const; //

Writing a file to users HOME directory in C -

i trying write .txt file user's home directory. i have tried: char str[] = "test"; char* file = strcat(getenv("home"), "/datanumbers.txt"); //i concatenating user's home directory , filename created. myfile = fopen(file,"w"); fwrite(str , 1 , sizeof(str) , myfile ); however, not create file. you can't strcat() environment variable. need buffer: char file[256]; // or whatever, think there #define this, path_max strcat(strcpy(file, getenv("home")), "/datanumbers.txt"); myfile = fopen(file,"w"); edit address 1 of comments below, should first ensure data concatenated doesn't overflow file buffer, or allocate dynamically - not forgetting free afterwards.

html - Footer not placed correctly (not taking full width) -

i'd footer take whole width of page reason not work when preview in safari (it looks ok within dreamweaver). wrong? i'd placed @ bottom of page , take whole width. <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title> liveweave </title> <!-- place cursor after , select javascript library menu above --> <!-- supports context-sensitive css3 auto-completion --> <!-- style starts here. try adding new css tags. --> <style type="text/css"> @charset"utf-8"; /* css document */ html, body { padding: 0; margin: 0; height: 100%; font-family: tahoma, geneva, sans-serif; background: rgb(255,255,255); /* old browsers */ /* ie9 svg, needs conditional override of 'filter' 'none' */ background: url(data:image/svg+xml; base64,pd94bwwgdmvyc2l

php - Updating ID based on views -

currently have following block of code. <?php $count = get_tptn_post_count_only($post_id); $rating_class = 'hot3'; if( $count >= 0 && $count <= 3 ) { $rating_class = 'hot3'; } elseif( $count > 4 && $count <= 10 ) { $rating_class = 'hot2'; } elseif( $count > 11 && $count <= 20 ) { $rating_class = 'hot1'; } elseif( $count > 5000 ) { $rating_class = 'hot1'; } ?> now trying track views on post , if on number provided update image on index page accordingly how ever not seem work other hot3 portion first tier. i basing of view tracking off of plugin called top 10 . if you're interested in seeing entire loop can here . edit: plugin settings . also $totalcntaccess = get_tptn_post_count_only( $id, 'total', $blog_id ); inside of file counter.php <-- fiddle link. found fix without using plugin above , using tool found on

asp.net MVC3 Unit Testing - Role Provider -

unit testing of role provider fail. [testmethod] public void findusersinrole() { mock<iusersinrolerepository> userinrolemock = new mock<iusersinrolerepository>(); userinrolemock.setup(m => m.usersinroles).returns(new usersinrole[] { new usersinrole { userid = guid.parse("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"), roleid = guid.parse("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa") }, new usersinrole { userid = guid.parse("bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb"), roleid = guid.parse("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa") }, new usersinrole { userid = guid.parse("cccccccc-cccc-cccc-cccc-cccccccccccc"), roleid = guid.parse("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa") }, new usersinrole { userid = guid.parse("dddddddd-dddd-dddd-dddd-dddddddddddd"), roleid = guid.parse("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa") }, new usersinrol

java - Checking enum value index -

i having issue while checking index of enums value, have enum varargs integer, if integer greater 1 , replaceable item, when next index increment one. but, when there not integer after increment, game crashes, i've been trying come solution past half hour or so, can't seem check if last index within enum. know localized question need help. the code: private int getnextid(food food, int id) { if (food.gettype().equals(replace)) { (int = 0; < food.getids().length; i++) { if (food.getids()[i] == id) { return food.getids()[i + 1]; } } } return -1; } enumeration: private enum food { shrimp(remove, 3, 315), lobster(remove, 12, 379), manta_ray(remove, 22, 391), monkfish(remove, 16, 7946), mackrel(remove, 6, 355), salmon(remove, 9, 329), sea_turtle(remove, 22, 397), shark(remove, 20, 385), swordfish(remove, 14, 373), trout(remove, 7, 333), tuna(remove, 10, 361

session - Tracking user activity in Java EE -

i track user's sessions. interested in getting user logname, context accessed , time when accessed context. i thinking of using class implements httpsessionlistener (overriding sessioncreated(final httpsessionevent se) , sessiondestroyed(final httpsessionevent se)) on these methods don't access request (from pull user's logname , context accessed). any suggestions welcome. i think servlet filter more suitable want. suggest write custom filter around urls want track. in dofilter() method have access httpservletrequest needed. request object can httpsession too. here example: @webfilter("/*") public class trackingfilter implements filter { private filterconfig filterconfig; @override public void init(filterconfig config) throws servletexception { this.filterconfig = config; } @override public void dofilter(servletrequest req, servletresponse res, filterchain chain) throws ioexception, servl

doctrine2 - zf2 acl doctrine 2 -

actually using zend framework 2, looking way implement performant acl strategy based on database. the whole idea directly filter dql queries depending on logged in user, , it's permissions. i found implementation of mecanisme in symfony 2 http://symfony.com/doc/current/cookbook/security/acl_advanced.html , in case 1 table seems store each user if has access single row, can dynamically load allowed rows joining table. to synthesize,i looking way define access rules entities based on criterias, want able results in single query able ordering, , pagination. are there zf2 modules resolve case ? it looks integrating sf2 security component standalone not option: security component symfony 2.0 standalone you have use doctrine filter load things current member example of codes adding filter member query : $em = $sm->get('doctrine.entitymanager.orm_default'); $ormconfig = $sm->get('doctrine.configuration.orm_default'); $ormconfig->addf

Java 8 post grouping by -

i have list of objects of class job, every object has collection of tags (networks), collection mutable , has no impact on hashcode , objects equality. what need list of unique job objects , each such object combine tags, example, have list: [{position: "cto", dates: "2012-2014", city: "new york", networks: ["foo"]}, {position: "cto", dates: "2012-2014", city: "new york", networks: ["bar"]}] this should reduced [{position: "cto", dates: "2012-2014", city: "new york", networks: ["foo", "bar"]}] public class job { private final string position; private final string dates; private final integer startyear; private final integer endyear; private final string city; private set<networktype> networks; public string getposition() { return position; } public string getdates() { return dates; }

message - AS3 TextInput into TextField -

i creating small chat application. want edit message in textinput field , when user hit's enter on keyboard message transferred textinput on textarea. how do this? thank you you need add event listener keyboard events see here http://help.adobe.com/en_us/flashplatform/reference/actionscript/3/flash/events/keyboardevent.html#keycode enter have specific keyboard code on event can right logic eg; addeventlistener(keyboardevent.key_down, handlekeyboard); function handlekeyboard(e:keyboardevent):void { // eg if (e.keycode == //the code enter ) { //your chat send message logic } //of course find different keycodes trace(e.keycode) }

html - Using an index with ng-table over multiple pages -

i using ng-table display below data. i want first column index number persists on pages (eg page rows 100-199 should have index 100-199). currently index resets , starts @ 0 every page. have tried {{ (farmparams.page() * farmparams.count()) + index }} but first page start @ index 100 in case. <table ng-table="vm.farmparams" class="table table-hover"> <tr ng-repeat="row in $data"> <td data-title="''" filter="{index : 'text'}" sortable="'index'">{{$index}}</td> <td data-title="'planted:'" filter="{planted : 'text'}" sortable="'planted'">{{row.planted}}</td> <td data-title="'harvested'" filter="{harvested: 'text'}" sortable="'harvested'">{{row.harvested}} </td> </tr> </table> seems subtract 1 page then. {

ruby - Rails 4 - Parsing and iterating through Google Places API JSON response -

using rails 4 http gem make simple requests. hitting googles api url , couple of parameters in order return nearby stadiums in json. my goal here iterate through of different stadium results , pull out photo_reference. i able pull out photo_reference first array so: def nearby_places(lat, long) response = http.get("https://maps.googleapis.com/maps/api/place/nearbysearch/json?key=mykey&location=#{lat},#{long}&radius=3000&types=stadium") parsed_response = json.parse(response.body) parsed_response["results"][0]["photos"][0]["photo_reference"] end but having trouble iterating through , pulling out photo references if multiple stadiums returned. best way go this? here example response google. { "html_attributions" : [], "results" : [ { "geometry" : { "location" : { "lat" : 32.2285419, "lng" : -110

jquery - How to get third row value in jqgrid calculated based on other two column value -

i have there column in jqgrid 2 vales getting json third column have calculate value other 2 , show how can jquery("#vehicleresultgrid").jqgrid({ data : jsontext, datatype : 'local', rownum : 20000, width : '100%', height : 'auto', colnames : [ 'fin', 'vin','balnce' ], colmodel : [{ name : 'value1', sortable:false, width : 190, classes: "col1" },{ name : 'value2', sortable:false, width : 190 },{ name : 'blance', formatter: calculatedformatfunction }] }); function calculatedformatfunction(cellval, opts, rowobject, action) { return rowobject[0]*rowobject[1]; } i have try code. if need implement filling of third blance column on client side have 2 main implementat

c++ - How to template this kind of function? -

its part of sorting algorithm, started out this inline void cmp2(float* a, float* b, int ia, int ib, int &ra, int &rb) { if (a[ia] > b[ib]) ra++; else rb++; } inline void cmp3(float* a, float* b, float* c, int ia, int ib, int ic, int &ra, int &rb, int &rc) { if (a[ia] > b[ib]) cmp2(a, c, ia, ic, ra, rc); else cmp2(b, c, ib, ic, rb, rc); } inline void cmp4(float* a, float* b, float* c, float* d, int ia, int ib, int ic, int id, int &ra, int &rb, int &rc, int &rd) { if (a[ia] > b[ib]) cmp3(a, c, d, ia, ic, id, ra, rc, rd); else cmp3(b, c, d, ib, ic, id, rb, rc, rd); } and thought "but hey, totally recursive template function". started over inline void cmp2(float* a, float* b, int ia, int ib, int &ra, int &rb) { if (a[ia] > b[ib]) ra++; else rb++; } template <int n> inline void cmp(float** data, int* i, int* r) { if (data[0][i[0]] > data[1][i[1]]) cmp<n - 1>( ???

Simple change in cmd isn't working -

i'm typing d: in cmd , i'm transfered d:\documents how can type d: , enter in d drive? it usual. when change drive in cmd, takes folder path when visited last time destination drive within time period of current session of cmd. so, can go path , give cd.. command go parent directory. command bring d:\documents path d:\ path. or can open new session of cmd , change drive. remember, in case of c: drive, windows in, take defined folder named after user name under users folder.

actionscript 3 - Google Drive AS3 API for web environment -

i'm working on application using flex 4.x , as3 show videos one's google drive. need use oauth can connect drive username , password. but, seems google hasn't provided api as3 make applications can access drive. saw answer here api provided standalone, window based application. please provide isight options available? [i tried commenting in question itself, seems cant comment without points.] assuming application embedded web page, anwser use of javascript make oauth call. after can use google drive api actionscript, using as3 api. approach let skip authentication if user logged onto google drive. illustration how works without actionsript can found here: https://developers.google.com/drive/v2/reference/files/list#try-it

java - String to Array Int -

write function takes number represented string argument, example "12345" or "4321432143214321" , returns digits of number in array. your function should create int[] array 1 digit of number per element. can please hint how can approach problem? public int[] converttoarray(string str){ int array[] = new int[str.length()]; for(int = 0; < array.length; i++){ try{ array[i] = integer.parseint(str.substring(i,i+1)); }catch(numberformatexception e){ e.printstacktrace(); array[i] = 0; } } return array; }

regex - HowTo prevent matching an empty string ('') at the beginning of a string include match within the string -

i trying match name following regex /^[a-za-zàáâäãåąčćęèéêëėįìíîïłńòóôöõøùúûüųūÿýżźñçčšžÀÁÂÄÃÅĄĆČĖĘÈÉÊËÌÍÎÏĮŁŃÒÓÔÖÕØÙÚÛÜŲŪŸÝŻŹÑßÇŒÆČŠŽ∂ð ,\'\-]+$/ this matches following examples: tom dooley d'agaene-venus tom however, when application starts don't want validator match /''/ string in text input, want match /'/ in body of name in d'agaene above. how best achieve this. have tried many options without success. suspect negation should include bu have not gotten it.

github - does gh-pages requires travis.yml? -

Image
i trying push changes gh-pages/index.html failed, the pr located https://github.com/bulkan/robotframework-archivelibrary/pull/20 however travis-ci documentation https://docs.travis-ci.com/user/customizing-the-build/#building-specific-branches by default, gh-pages branch not built unless add whitelist. i don't exact reason why travis-ci started building gh-pages, need add .travis.yml gh-pages or there anythin missed here https://github.com/bulkan/robotframework-archivelibrary/tree/gh-pages it looks build failed run on different branch named doc-update , wouldn't block default, it's not named gh-pages what can enable our setting run builds on branches have .travis.yml file on them, shown in below screen cast

How do I dynamically add items to a ListView in Android? -

this question has answer here: dynamically add elements listview android 5 answers i using custom adapter display listview. it working fine. but need add 3 items listview. how add them , have them display? i tried notifydatasetchanged() method not working. you have add items list using list.add(...) tell adapter adapter.notifydatasetchanged() .

javascript - $.ajax() and "Uncaught ReferenceError: data is not defined" -

i tried out several ways .json file , data using $.getjson , $.ajax() overthere my js code n⁰2 fails : $.ajax({ type: "get", url: 'js/main.js', data: data, success: 1, }).done(function ( data ) { var items = []; $.each(data.tata.entities.q142.labels.fr.value, function(key, val) { items.push('<li id="' + key + '">test 2:' + val + '</li>'); }); $('<ul/>', { 'class': 'my-new-list', html: items.join('') }).appendto('body'); }); in chrome console, message error is : "uncaught referenceerror: data not defined" refering to line : data: data, what going wrong ? ? edit: done client side. the problem being caused because didn't define variable data, try removing data: data line, looks you're getting javascript file wouldn't take query string: $.ajax({ type: "get", url: 'js/ma

c# - Different representations of a decimal point -

i'm seeing difference in behavior between emulator in visual studio , lumia 820 when trying parse double. if have string represent string stringdouble = 3.434233 , emulator correctly parses corresponding double value, on lumia 820 in debug mode, have replace dot comma work. causing difference? that culture problem. your simulator , phone probably have different cultures set up , that's why have differences in results. use device or invariant culture. i recommend either use invariant culture everywhere double.parse("3.5", cultureinfo.invariantculture) or current users culture double number = double.parse("202.667,40", cultureinfo.currentculture); for both parsing , translating numbers strings, avoid bugs described

css - How do I remove the extra height in my <li>? -

i'm not sure how ask clearly, post code: body { background-color: #232026; background-image: url('galaxy16cropped.jpg'); background-position: center top; background-repeat: repeat-y; background-size: 2000px; background-attachment: fixed; font-family: 'lato', 'arial', sans-serif; color: #ffffff; padding: 0px; margin: 0px; line-height: 1.5; } a:hover:not(.nav) { background-color: yellow; } div.nav { background-color: #232026; width: 100%; margin: 0px; padding: 6px 0px 6px 0px; height: 40px; } .nav li { color: #ffffff; display: inline; list-style-type: none; text-align: center; text-transform: uppercase; margin: 0px; } li.current { background-color: #424242; } .nav li.current:hover { background-color: #424242; } .nav a:hover { background-color: #737373; } .nav { color: #ffffff; text-decoration: none; display: inline-block; border: none; width: 14

How to change the icon of a different .NET application dynamically (from C#) -

i working on installer , want installer have same icon (on windows taskbar , in explorer) application it's installing. i don't want recompile installer different icon each time, how installer's icon changed (c#) application (the installer creator app)? ideally, icon pulled out of .exe being installed if possible. how done?

python - How to reflect changes in data base automatically? -

i have ndb entry can changed rpc call app engine app. have python web app creating html site show entry. how show changes when happen without need refresh page? new @ writing server side need hint look, thanks! you can use channels api push (server-to-client) updates in browser.

symfony - How to refer to route name with FOSRestBundle -

candidate controller class defaultcontroller extends previewmecontroller { /** * complete registration process candidate * * @apidoc( * section="candidate", * tags={"common"}, * ) * * @rest\view() * @post("/ua/register/candidate/{token}") * * @param request $request * @return \fos\restbundle\view\view */ public function registercandidateaction($token) { } } candidate routing.yml candidate_api_routes: type: rest prefix: /v1 resource: "candidatebundle\controller\defaultcontroller" name_prefix: "api_1_c_" appbundle controller /** * register new user on website * * @apidoc( * section="common functionalities", * tags={"common"}, * requirements={ * {"name"="email", "datatype"="string", "description"

javascript is not sending data through php code -

hi have requirement need execute mysql queries once user confirm ok confirmation box.in case ever data passing insert_details.php not working. 1 more thing bring notice need send data different script , navigate different page.kindly suggest problem? <script type="text/javascript"> var r=confirm("this email address exits in our database. want continue?"); if (r==true) { var dataobj = { fname : document.getelementbyid('fname').value, phone : document.getelementbyid('phone').value, pemail : document.getelementbyid('email').value } var xhr = new xmlhttprequest(); xhr.open("post","insert_details.php", true); xhr.setrequestheader('content-type', 'application/json; charset=utf-8'); xhr.send(json.stringify(dataobj)); xhr.onreadystatechange = function() { if (xhr.readystate>3) { window.location = 'http://lo

wpf - Powerbuilder .net, MVVM and unit testing -

i'm complitely new powerbuilder .net , working wpf , used mvvm. is there way work powerbuilder .net wpf , use mvvm design? can tell me please best practices , frameworks work , unit tests? this demos : http://gopowerbuilder.web12.hubspot.com/rich-resources/tutorials---demos/

php - QUICKBOOKS_ADD_CUSTOMER function doesn't trigger (“no data exchange”) -

i'm trying synchronize opencart qb desktop. doesn't work. qb web connector says "no data exchange". here code: // map quickbooks actions handler functions $map = array( quickbooks_add_customer => array( '_quickbooks_customer_add_request', '_quickbooks_customer_add_response' ), ); $errmap = array( '*' => '_quickbooks_error_catchall', ); $hooks = array(); $log_level = quickbooks_log_develop; $soapserver = quickbooks_soapserver_builtin $soap_options = array(); $handler_options = array( 'deny_concurrent_logins' => false, 'deny_reallyfast_logins' => false, ); // see comments in quickbooks/server/handlers.php file $driver_options = array( // see comments in quickbooks/driver/<your driver here>.php file ( i.e. 'mysql.php', etc. ) 'max_log_history' => 32000, // limit number of quickbooks_log entries 1024 'max_queue_history' => 1024