Posts

fiware - iotagent-json tutorial error -

during tutorial: https://github.com/telefonicaid/iotagent-json/blob/master/docs/stepbystep.md when execute curl: curl -x post -h "content-type: application/json" -h "accept: application/json" -h "fiware-service: myhome" -h "fiware-servicepath: /environment" -h "cache-control: no-cache" -d '{ "value" : "300" }' 'http://localhost:1026/v1/contextentities/livingroomsensor/attrs/sleeptime' i'm getting error response: { "orionerror" : { "code" : "400", "reasonphrase" : "bad request", "details" : "service not found" } } how fix this? cumps it seems "mixing" url styles ngsiv1 , ngsiv2 :) mean, should either: /v2/entities/livingroomsensor/attrs/sleeptime or /v1/contextentities/livingroomsensor/attributes/sleeptime my recomendation use ngsiv2, more powerfull, flexible , simple version of context ...

cordova - when I play a mp4 video file in phonegap app on my ipad, it can't display, but it works in my iphone and the xcode simulator -

now developing phonegap app, app include static pages play videos in html video tag. first, use xcode simulator debug app, works fine, video display. then, install app in iphone, works fine. last, install in ipad, unfortunately, video can't play, shows 'video box' , play button forbidden slash. the code video play in html below: <div class="video"> <video src="video/2.mp4" controls="controls" autoplay type="video/mp4"> your browser not support video tag </video> </div>

ember.js - Transition to route's action from Ember object -

i new ember. have existing ember app , need implement functionality in it. have ember object below `import ember 'ember'` callservice = ember.object.extend ... other code here _updateconnectedleadid: (-> console.log "do here??" **pass route action here** ).observes('some_other_here') `export default callservice` unfortunately, couldn't put whole code here. my route looks like applicationroute = ember.route.extend actions: showlead: -> console.log data console.log "did here?" @transitionto('dashboard') `export default applicationroute` i tried using @send('showlead') , @sendaction('showlead') in method no luck. my main intention make transition once console.log "do here??" displayed. not sure if on right way here. i tried using @transitionto('dashboard') , @transitiontorote('dashboard') directly throws me errors. i have been st...

APK doesn't work on phone but App works normal in Android Studio -

i have app works without problems in android studio, when build apk , install shows stranges behaviors: 1- when app installing, phone shows me notification no 1 permission necessary app (and not true, app works awareness) 2- after installation, , running, app crushed, no 1 screen showed. i thinking maybe problem manifest, said in emulator works without problem. first time see behavoir. idea how solve ?? 03-28 13:15:22.851 7334-7334/com.itelma.tele d/androidruntime: shutting down vm 03-28 13:15:22.851 7334-7334/com.itelma.tele e/androidruntime: fatal exception: main process: com.itelma.tele, pid: 7334 java.lang.runtimeexception: unable instantiate service com.itelma.tele.api_ac.fcminstanceidservice: java.lang.classnotfoundexception: didn't find class "com.itelma.tele.api_ac.fcminstanceidservice" on path: dexpathlist[[zip file "/data...

node.js - How to handle url+multiple otpional query params in node? -

i making rest api. , have multiple optional params. here solution have taken, there solution? url can be www.myurl.com/ or www.myurl.com/faqid/22 or www.myurl.com/faqid/22/locale/english here implementation var getfaq = (req, res) => { let faqdetails = faq.map(obj => obj);//it mock json faqdetails = req.params.faqid ? faqdetails.filter(obj => obj.id == req.params.faqid) : faqdetails; faqdetails = req.params.topic ? faqdetails.filter(obj => obj.topic == req.params.topic) : faqdetails; return res.status(200).send(faqdetails); } router.get('/:faqid/topic/:topic', getfaq) router.get('/:faqid', getfaq) router.get('/', getfaq) i suggest should try organise app routes in such way methods follow single responsibility principle every function write should 1 thing. should have 1 defined goal. in above getfaq seems doing many things. you'd ideally want divide them getall() , getsingle() , gettopic() function...

python - Empty SVG file errror while it's not -

working pycairo, create "svgsurface" (which create me svg file) , write on using "context". after finish, need use svg file, seems file not closed gave me error telling document empty. ps = cairo.svgsurface("header.svg", width, height) cr = cairo.context(ps) drawrectangle (cr, papersize.convert_length(int(lg[0]), "px","pt"), papersize.convert_length(int(lg[2]), "px","pt"), papersize.convert_length(int(lg[1])-int(lg[0])-1, "px","pt"), papersize.convert_length(int(lg[3])-int(lg[2])-1, "px","pt"), 0, 0, 0.5 ) cr.show_page() head = st.fromfile("header.svg") it gives me error : file "/usr/local/lib/python2.7/dist-packages/svgutils/transform.py", line 249, in fromfile svg_file = etree.parse(fid) file "src/lxml/lxml.etree.pyx", line 3427, in lxml.etree.parse (src/lxml/lxml.et...

Python - Data analysis of XML file with ElementTree -

this going pretty long question since problem quite specific , needs explaning sorry that. i have xml file contains multiple 'spreekbeurten'. want obtain text spreekbeurten, problem spreekbeurten not have 'al-group' , do. (see code below example piece ofthe xml file) <handelingen> <spreekbeurt nieuw="ja"> <spreker> <voorvoegsels>de heer</voorvoegsels> <naam> <achternaam>recourt</achternaam> </naam> (<politiek>pvda</politiek>):</spreker> <tekst status="goed"> <al-groep> <al>much</al> <al>very</al> <al>hungry</al> <al>i am</al> <al>hello.</al> </al-groep> </tekst> </spreekbeurt> <spre...