Posts

javascript - How to add request headers when uploading a file using iframe? -

my form should upload file , should work older versions of ie. that's why use hidden iframe. thing need add couple of headers request required 3rd party api i'm using. how set request headers when using iframe? you cannot. xmlhttprequest api browsers provide allows setting of http headers javascript.

java - Convert Map to ArrayList where entry value = something -

i using map<user, integer> , need select users specific integers , add them arraylist, easiest way users arraylist<user> integer = 1? this tried, works, appreciate shorter code. arraylist<user> users = new arraylist(); (map.entry<user, integer> entry : useranswers.entryset()) { if(entry.getvalue()==1) users.add(entry.getkey()); } edit: thank danil gaponov, answer looking for! requires java 8: map.entryset().stream() .filter(e -> e.getvalue().equals(1)) .map(e -> e.getkey()) .collect(collectors.tolist());

How to access external usb camera on unrooted android devices -

i want access extern usb cameras via v4l on android. i tried simplewebcam . after slight modifications of original source codes, achieved make work on rooted android device. however, on unrooted devices, keeps complaining "not have permission access "/dev/video*". checked permission of /dev/video* "ls -l /dev/video*", , got crw-rw---- system camera 81, 0 2015-08-18 18:31 video0 i understand means /dev/video* owned system, , readable/writable users in group "camera". think if add <uses-permission android:name="android.permission.camera" /> in manifest of app, user id of app added group "camera", app allowed read data /dev/video*. but, still complains "not have permission access /dev/video*" now. i tried <uses-permission android:name="android.permission.camera" /> <uses-feature android:name="android.hardware.camera" /> <uses-feature android:name="and...

database - How to set up a server for android app? -

i trying create android application in user pretty save data in database-like user data, photos , able retrieve. but clueless how set server, connect database etc. can me point right resources end-to-end installation of server, database, , interaction android application just set basic server works on http, , use http libraries android make requests , handle results in device. there plenty of technologies make server, google building rest api php/.net/java (whichever language comfortable with).

openerp - Tasks in Kanban View: card rearrangement error when Project/User is only authorized to modify his own tasks -

Image
this happens when project/user drops task unto destination stage containing tasks not owned him. apparently, odoo remembers stack ordering of tasks within stage via project.task.sequence , , updates task cards' sequence fields when project/user completes drop action. since project/user not authorized modify other users' tasks (of project.task object type). odoo server raises exception shown below. access restriction implemented via following record rule project/user: name: project/task: assignee , creator can modify task object: task (project.task) apply for: write domain filter: ['|',('user_id','=',user.id),('create_uid','=',user.id)] group name: project/user is there workaround problem? at time of writing, error can reproduced @ http://demo.odoo.com running odoo version 8.saas~6. note default human resources / employees allowed modify tasks not assigned them, write , delete access of record rule "project/task...

c# - MongoDb Search in Document's Collection returns only fully matched result - Why? -

i'm trying locate user username , password match. have office collection each office document contains many users var builder = builders<mnoffice>.filter; var filter = builder.anyeq(o => o.users, new officeuser() { username = username, password = password }); var office = await offices.find(filter).firstordefaultasync().configureawait(false); return office; the above query returns null. although should result back. officeuser class has 3 properties, username, password, , name. mongo forces me 3 properties match in query, want have 2 properties matching (usename , password) in order result back, how can accomplish that? no documentation that. thanks! var filter = builder.elemmatch(o => o.users, user => user.username == username && user.password == password); solved using elemmatch, still dont understand logic behind first attempt.

javascript - Implementing d3-2way-tree for multilevel tree -

i referring d3 widget, d3 2 way tree . want tree grown further more both @ top , bottom, not able form json data it. in following json, added 2 nodes parents , 2 nodes children : { "name": "airlines", "parents": [ { "name": "aviation", "isparent": true }, { "name": "transparent_companies", "isparent": true }, { "name": "transport_operators", "isparent": true, "parents": [ { "name" : "parent-foo1", "isparent" : true }, { "name" : "parent-foo2", "isparent" : true } ] } ], "childre...