Posts

javascript - Print received data from client in NodeJS server -

i have simple html file containing piece of javascript: <script type="text/javascript"> $.ajax({ url: 'http://192.168.x.x:8080', data: '{"data": "1"}', datatype: "jsonp", cache: false, timeout: 5000, success: function(data) { var ret = jquery.parsejson(data); }, error: function (xhr, status, error) { console.log('error: ' + error.message); document.getelementbyid("error").innerhtml = 'error: ' + error.message; } }); </script> i want nodejs server print data received (there: number 1°). here nodejs code: var http = require('http'); var s = http.createserver(); s.on('request', function(request, response) { response.writehead(200); console.log('a: '...

vb.net - SSRS 2008 Report Dynamic Header works on local machine in BIDS but not from Report Server -

Image
i have report consists of single column tablix single row grouped. inside row 3 sub reports. header of report supposed display 3 pieces of information unique data row grouped on header unique each. i attempted populate data in header having hidden controls in body referenced in expressions of controls in header. method didn't work. switched different possible solution found populate variables using vb , reference them in header using =code.variablename in expression. function populate variables called hidden control in body passes data parameters. this method worked. however, seems work on local machine , 1 of coworker's machines in bids preview. when report published report server, runs , seems fine, except header values don't populate. one of variables integer , other 2 strings. integer value initialized 0 , in report report server shows initialized value of 0, strings still blank. makes me think function isn't being called or there might scope issue? or di...

osx - Python "app transport security" error under El Capitan -

some of python shell scripts newly throwing security errors under apple osx 10.11, el capitan. seems new app transport security doesn't how scripts calling http resources in plain text, rather using https. fetching http://blahblah.com python[5553:5648168] app transport security has blocked cleartext http (http://) resource load since insecure. temporary exceptions can configured via app's info.plist file. how might go fixing this? there no https resource can call, i'm stuck http. advice apple make exception in app's info.plist file, python script invoked shell script, there no info.plist file edited. ideas? root problem seems webkit2png, in python. non-https requests being blocked ats, , there no info.plist modify. i found solution here worked me: https://apple.stackexchange.com/questions/210588/how-does-one-configure-a-temporary-exception-to-ats-on-el-capitan-and-fix-webkit first make sure have version of webkit2png new enough have --ignore-...

Swift - how do I pass a type/object (name or instance) into a method and then (a) get the type (b) instantiate it? -

i need this, i'm having sorts of problems: class myclass { } class someclass { func callmethod(object) { let thetype = object.type // need same result myclass.self let newinstance = object() // need same result myclass() } } let someclass = someclass() let object = myclass someclass.callmethod(object) how this? i want able specify 1 type (e.g. myclass). can either type name or instance of , 2 values shown in code comments. it lot easier if passed in 2 separate variables, i'm sure can in one. you can use .dynamictype property of instance type. can call required init method on (or other class / static method). let thetype = object.dynamictype let newinstance = thetype.init() note : code compiles, depending on type of object . if type has required init() method, safe call on dynamictype . however, appears if type nsobject compiler let call init() on dynamictype though subclass may or may not have init() method given how swift ini...

upload - Uploaded App to Android -

when go download uploaded app play store, click purchase , message comes "error please try again" keep retrying , same message. don't know wrong. uploaded correctly. it's published reason can't download it. stackoverflow no place such questions . try you. try remove test application (if debugged on device) restart device check other device try setting via web interface try updating android services if application paid check availability in country in list check relevance of payment card in android market

bluetooth - iBeacon's customisable UUID conflicts -

if understanding correct, there large range of uuids assigned in specification - there's this . since ibeacon's uuid can customised, wouldn't uuid conflict existing codes , create undesirable outcomes? if understanding correct, service uuids @ byte 30 , 31 of ble packet, overlapped ibeacon's uuids. service uuids 2 bytes can't hard collision occur. it important understand there 2 types of bluetooth advertisements: service advertisements manufacturer advertisements advertisements must 1 type or other, not both. only service advertisements use service uuids (either 16 bit or 128 bit). manufacturer advertisements not. manufacturer advertisements have 2 byte company code registered bluetooth sig. else in manufacturer advertisement arbitrary data. beacon types altbeacon , ibeacon manufacturer advertisements, not contain service uuids. there therefore no possible overlap between proximityuuid , service uuid, different things. other beaco...

java - repainting a JPanel and update the screen -

i 'm trying " fade" jpanel using thread . not fading , turning color white black gradually changing rgb values ​​. public class mostrapainel { public static void main(string[] args) { jframe jf = new jframe(); jf.setsize(500, 500); // centraliza jf.setlocationrelativeto(null); painel painel = new painel(); jf.setcontentpane(painel); jf.setvisible(true); new thread(painel).start(); } } so want repaint panel interval set, panel class public class painel extends jpanel implements runnable { // alt+s /** * create panel. */ int cont = 0; public painel() { setbackground(color.black); } @override protected void paintcomponent(graphics g) { if (cont == 1) super.paintcomponent(g); graphics2d g2 = (graphics2d) g; // system.out.println(cont); g2.setcolor(new color(cont, cont, cont)); int w = getwidth...