Posts

Showing posts from January, 2010

interpolation - How to interpolate scattered data on a predefined 3D surface in Matlab? -

i need interpolate scattered data on model represented 3d surface in matlab. tried using "scatteredinterpolant", results quite bad. function allows specify query points not 'connectivitylist' because internally performs own delaunay triangulation specified point set. however, know not points 'connectivitylist', can create matlab 'triangulation representation' using "triangulation". so question following. there way give predefined 'triangulation' "scatteredinterpolant"? if not possible, there other maltab function or class able perform data interpolation on triangulated 3d surface instead of performing own triangulation query points?

android - Couldn't connect to Google API client -

i can't fetch last known location. have enabled geocoding api , google places api android in google console. added api key manifest file: <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" /> <meta-data android:name="com.google.android.geo.api_key" android:value="@string/google_api_key" /> but keep getting message in console: " couldn't connect google api client: connectionresult{statuscode=api_unavailable, resolution=null} " update i use google sample protected synchronized void buildgoogleapiclient() { mgoogleapiclient = new googleapiclient.builder(this) .addconnectioncallbacks(this) .addonconnectionfailedlistener(this) .addapi(locationservices.api) .build(); } @override public void onconnected(bundle connectionhint) { location mlastlocation = locationservices.fusedl

java - NDK application Signature Check -

i have security key in application. want store securly. store in native shared library (maybe generated code). after want returned method check signature of original apk. no 1 can use file except trusted applications. know, ndk library decompiled, harder make reverse engineering of native code java .class files. question: is there way calk signature of origin apk native code (c/c++)? how can make sure library called trusted application? i try answer first question here: signature of application stored in dex(dalvik executable) file of apk. dex files have following structure: header data section (contains strings, code instructions, fields, etc) arrays of method identifiers, class identifiers, etc so, beginning of header of dex file: dex_file_magic constant - ubyte[8] adler-32 checksum of application(except dex_file_magic , checksum itself) - uint sha-1 signature of application(except of dex_file_magic, checksum , hash itself) - ubyte[20] so, c

c++ - The perfect callback function -

goal : obtain callback function take type of parameters callback function's parameters .h template <typename f, typename a> void delayedcallback(f&& callbackfunction, a&& args = null); / .cpp void delayedcallback(f&& callbackfunction, a&& args) { //timer function received function pointer "callback" function timer((std::bind(std::forward<f>(callbackfunction), std::forward<a>(args)))()) } / delayedcallback(&hudexit); void hudexit() {} / error : delayedcallback(fname,float,f &&,a &&)' : not deduce template argument 'a' what doing wrong? i'm new of these concept in c++, more of c# programmer edit : it's not error, i'm pretty sure it's not 1 making. your error message doesn't match signature of delayedcallback template <typename f, typename a> void delayedcallback(f&& callbackfunction, a&& args = null) delayedcallb

neo4j - Find the nodes with the most mutual connecting nodes? -

i'm working data set contains customers, purchases , businesses purchased from, , i'm trying determine businesses share highest number of mutual customers. ideally output table lists connected businesses , number of mutual customers. i.e.: | business_1 - business_2 | 4 | | business_1 - business_5 | 3 | | business_3 - business_7 | 2 | | business_4 - business_9 | 2 | i don't have @ point, query i'm working looks this: match (c:customer)<-[:trans_cust]-(t:transaction)-[:trans_business]->(b:business) return c, t, b thanks in advance i guess should trick, maybe provide sample dataset on http://console.neo4j.org help. match (b:business) match (b)<-[:trans_business]-(t:transaction)-[:trans_cust]->(c:customer) match (c)<-[:trans_cust]-(:transaction)-[:trans_business]->(other:business) b <> other b, other, collect(distinct(customer)) customers return b, other, size(customers) sharedcustomers order sharedcustomers desc

javascript - Get North,South,East,West street names from Geocode in Google Map -

i have implemented property search through google maps , each property marked pin in google map. in need, user can able know street names of single property (geocode) north, south, east, west, northeast, northwest, southwest , southeast directions.i need list out each direction street names. for example searching below property has return property : 18,maha street,coimbatore,tamilnadu (27.268255,-95.55666) north : main street south : anna street east : river road west : school street northeast : kmskj street northwest : ring road southwest : hasbdagh road southeast : outer ring road is possible achieve in google map. please me out. if geocode direction can apply reverse geocode right? i have achieved server side geocode process, below methods involved: public geocoderlocation locate(string query) { geocoderlocation n = new geocoderlocation(); geocoderlocation s = new geocoderlocation(); geocoderlocation e = new geocoderlocation

node.js - Can I install an NPM module from GitHub from a certain branch or tag? -

when have now: "dependencies": { "mymodule": "owner/repo" } or "dependencies": { "mymodule": "git+ssh://git@github.com/owner/repo.git" } npm installs module github master branch. is there way tell npm install tag or head of branch other master ? https://docs.npmjs.com/files/package.json#git-urls-as-dependencies "dependencies": { "mymodule": "git+ssh://git@github.com/owner/repo.git#commit-ish" } the commit-ish can tag, sha, or branch can supplied argument git checkout. default master.

javascript - Wrong result for filtering by substring -

i creating filtering input brings results according keyup. doing filtering, through backbone's collection: var brand = backbone.model; var brands = backbone.collection.extend({ model: brand, filterbyname: function () { return this.filter(function (model) { return model.get('name').indexof('h') > -1; }); } }); var fiat = new brand ({ name: 'fiat' }); var honda = new brand ({ name: 'honda' }); var chevrolet = new brand ({ name: 'chevrolet' }); var peugeot = new brand ({ name: 'peugeot' }); var mitsubishi = new brand ({ name: 'mitsubishi' }); var hyundai = new brand ({ name: 'hyundai' }); var brands = new brands ([ fiat, honda, chevrolet, peugeot, mitsubishi, hyundai ]); console.log(brands.filterbyname()); playground: http://jsfiddle.net/lgcb0skm/ the point is: when type h , instance, brings me mitsubis h i , c h evrolet , instead of possible results, such h on

css - How to select a web element by text with Selenium WebDriver, Java -

i need find following element on web page <div class="b-datalist__item__addr">noreply@somedomain.com</div> i'm coding java selenium webdriver. need exact css selector element use driver.findelement(by.cssselector(the-selector).click command. div[class='b-datalist__item__addr'] selector not enough since must search according noreply@somedomain.com text not link can't use findelement(by.linktext()) command. css not allow text based search. xpath option there. //div[contains(text(),'noreply@somedomain.com')]

elasticsearch - Nested Object in Kibana visualize -

i have uploaded json file in elasticsearch , mapping contains of nested objects. the problem that, in kibana, in visualize can not see them this mapping: "comments": { "type": "nested", "properties": { "count": { "type": "integer" }, "data": { "type":"nested", "properties": { "created_time": { "type": "integer" } } } } } but in kibana when insert comments.count cannot see result, in discover page, comments.count field exist! how can search field? as found, kibana can not deal nested or parent/child

javascript - Uncaught TypeError: Cannot read property 'friends' of null -

i have facebook multifriends selector script shows error. script : window.fbasyncinit = function () { //sdk loaded, initialize var curloc = window.location; fb.init({ appid: 'xxxxxxxxxxxxx', xfbml: true, version: 'v2.0' }); (function (d, s, id) { var js, fjs = d.getelementsbytagname(s)[0]; if (d.getelementbyid(id)) { return; } js = d.createelement(s); js.id = id; js.src = "//connect.facebook.net/en_us/sdk.js"; fjs.parentnode.insertbefore(js, fjs); }(document, 'script', 'facebook-jssdk')); fb.canvas.setautogrow(); }; function rendermfs() { // first list of friends user graph api fb.api('/me/friends', function (response) { var container = document.getelementbyid('mfs'); var mfsform = document.createelement('form'); mfsform.id = 'mfsform';

android - at 0 of type java.lang.String cannot be converted to JSONArray -

i facing exception @ 0 of type java.lang.string cannot converted jsonarray don't know why? have use before in different work didn't exception list<namevaluepair> pair = new arraylist<>(); pair.add(new basicnamevaluepair("id", string.valueof(getitemno))); json = jsonparser.makehttprequest("http://192.168.1.51:80/stopviewapi/index.php","post",pair); log.d("route response", json.tostring()); int success = 0; try { success = json.getint(tag_success); routearrray = new arraylist<string>(); } catch (jsonexception e) { e.printstacktrace(); } try { if (success == 1) { jsonarray jsonarray; json = new jsonobject(jsonparser.result); jsonarray jarray = json.getjsonarray("data"); (int = 0; <= jarray.length(); i++) { jsonarray = jarray.getjsonarray(i); stopnames = jsonarray.getstring(0); counter++; if (counter <=jarray.length()) { //routearrray.add(stopnames

java - Hive shell throws Filenotfound exception while executing queries, inspite of adding jar files using "ADD JAR" -

1) have added serde jar file using "add jar /home/hduser/softwares/hive/hive-serdes-1.0-snapshot.jar;" 2) create table 3) table creates 4) when execute select query throws file not found exception hive> select count(*) tab_tweets; query id = hduser_20150604145353_51b4def4-11fb-4638-acac-77301c1c1806 total jobs = 1 launching job 1 out of 1 number of reduce tasks determined @ compile time: 1 in order change average load reducer (in bytes): set hive.exec.reducers.bytes.per.reducer=<number> in order limit maximum number of reducers: set hive.exec.reducers.max=<number> in order set constant number of reducers: set mapreduce.job.reduces=<number> java.io.filenotfoundexception: file not exist: hdfs://node1:9000/home/hduser/softwares/hive/hive-serdes-1.0-snapshot.jar @ org.apache.hadoop.hdfs.distributedfilesystem$18.docall(distributedfilesystem.java:1122) @ org.apache.hadoop.hdfs.distributedfilesystem$18.docall(distributedfilesystem

jquery - Need help building a javascript array from given object values. -

this object have. var myobject = { 'stop1-start': "0", 'stop1-color': "#0074a2", 'stop2-start': "32", 'stop2-color': "#ff6600" }; this array need. var newarray =[ { 'stop-start': "0", 'stop-color': "#0074a2", }, { 'stop-start': "32", 'stop-color': "#ff6600", } ]; i tried loops, jquery each cant wrap head around it. any appreciated. object keys not guaranteed in order, you'll need find array's index within key itself: var myobject = { 'stop1-start': "0", 'stop1-color': "#0074a2", 'stop2-start': "32", 'stop2-color': "#ff6600" }; var newarray= []; object.keys(myobject).sort().foreach(function(key) { var num= key.match(/(\d+)/)[0] - 1; newarray

c - zmq_socket() is giving segmentation fault -

i learning zeromq , have following test code: void *context = (void *)zmq_ctx_new(); if (context == null) { printf("context null\n"); } else { printf("context created successfully\n"); } printf("connecting 0mq server\n"); void *responder = zmq_socket (context, zmq_req); printf("got socket\n"); if (responder == null) { printf("responder null\n"); } else { printf("responder created successfully\n"); } when run code, crashes when zmq_socket() called. here output: starting 0mq server context created connecting 0mq server segmentation fault (core dumped) i'm not sure why zmq_socket() fails. have tried move zmq library in beginning of linking series in makefile. still fails. any highly appreciated. change void context = (void)zmq_ctx_new(); into void *context = (void *)zmq_ctx_new(); and, tried code, void context = (void) zmq_ctx_new() cause compile error. here code can

Using Google Analytics for android widget -

i want use google analytics first time. i have simple widget , when click simple activity opens up. not complicated. put following code in oncreate-method of activity: public static googleanalytics analytics; public static tracker tracker; ... here in oncreate if(analytics == null || tracker == null){ analytics = googleanalytics.getinstance(this); analytics.setlocaldispatchperiod(1800); tracker = analytics.newtracker("ua-11111111-1"); tracker.enableexceptionreporting(true); tracker.enableadvertisingidcollection(true); tracker.enableautoactivitytracking(true); } do have put same code in onupdate-method of appwidgetprovider or enough? widget on screen counted active user in google analytics , if so, google analytics count 2 active users if have widget on screen , open app or google smart enough know both (widget , app) on same device?

javascript - Angular.js service factory $http.get not calling my service -

Image
i trying data in service factory. nothings happen.it executed code. nothings happened. dont know why? here service code: 'use strict'; app.factory('accountservice', function($http, $location, $rootscope) { return { accounts: function() { $http.get('http://localhost:29045/accountoperation.svc/getaccounts').success(function(data, status, headers, config) { console.log(status); var $promise = data; console.log(data); }).error(function(data, status, headers, config) { }); } } }); here controller(calling factory here): 'use strict'; app.controller('accountcontroller', function($scope, accountservice, $rootscope) { $scope.accounts = function() { accountservice.accounts(); } }); also didnt error. on account function not creating promise or returning anything. try: app.factory('accountservice', function($http, $lo

c++ - Random function keeps on getting same result -

this question has answer here: srand() — why call once? 6 answers i writing program simulate knight's tour randomly. (see wikipedia means: http://en.wikipedia.org/wiki/knight%27s_tour ) first, create chess object, 8*8 array numbers indicate position of knight. create chess object , randomly assign position knight. then, moved knight randomly until there no more legal moves , returns number of moves performed. int runtour () { srand (time(null)); chess knight(rand()%8, rand()%8); //initialize random chess object. knight.printboard(); //prints board before moving int movenumber = 0; //a number 0 7 dictates how knight moves int counter = 0; while (movenumber != -1) //a movenumber of -1 means there no more legal move { movenumber = knight.findrandmove(knight.getrow(), knight.getcolumn()); //findrandmove function returns

typescript - Unable to compile swift file in Visual Studio code and Windows 10 -

what trying use visual studio code compile swift language code trying run unfortunately getting error tasks.json file error ts6054: file 'section-1.swift' must have extension '.ts' or '.d.ts'. i have followed steps mentioned david owens ii http://owensd.io/2015/05/21/swift-vscode.html , referenced older stuff stack overflow , installed typescript npm command prompt , modified tasks.json file shown below { "version": "0.1.0", // command tsc. "command": "swiftc", // show output window if unrecognized errors occur. "showoutput": "silent", // under windows use tsc.exe. ensures don't need shell. "windows": { "command": "tsc.cmd" }, // args helloworld program compile. "args": ["section-1.swift"], // use standard tsc problem matcher find compile problems // in output. "p

apache - Install google mod- pagespeed on elastic beanstalk on every instance added -

i've installed google mod-pagespeed following code: container_commands: 01-command: command: rm -rf /pagespeed/ebextensions 02-command: command: mkdir -p /pagespeed/ebextensions 03-command: command: cp -r .ebextensions/* /pagespeed/ebextensions/ 04-command: command: rpm -u /pagespeed/ebextensions/mod-pagespeed.rpm thanks answer is possible use aws beanstalk's .ebextensions config install mod_pagespeed apache module? the problem apache running commands every time deploy, , make error second time (because mod-pagespeed installed), had remove commands, then, when new instance added, made lots of bugs, because 1 machine had mod-pagespeed. (not recomended!) i need upload code installs mod-pagespeed on every new instance, , wont give me errors every time deploy new applications. ideas? can make commands idempotent? may keep commands in script run script on instance through container commands. script create lock file

testing - Writing Test cases for Agile user stories -

im incharge of writing manual test cases web application comprises of 15 pages. application starts login , user performs operations after that. have user story in 10th page or 10th step after login. userstory describes how user can use 10th page. question when write use case user story should write steps page 1 page 10 or should start test case page 10 or should user must on page 10 pre-condition ? thanks it's pretty simple: if use case requires specific set of steps taken in order set test, need part of use case. if it's possible skip first 10 pages, don't need part of use case. there middle ground. example, if you're working on dozen different use cases , require same first 10 steps, can move steps separate scenario or use case, , start use case "assuming user has performed common setup steps...". above all, main goal clarity. if make assumptions within use case (ie: did steps 1-10 first), need spelled out unless entire team aware of assu

java - How to install Java3D on Mac OS X 10.10 -

i'm using agent-based modelling toolkit called mason in eclipse on mac os x 10.10 yosemite , need java3d of tutorials work. can guide me through installing java (jdk, jre, 3d etc.) on mac , getting eclipse setup correctly? i have tried follow instructions here , here , here , still no luck. i've downloaded apple's java osx , can non-3d tutorials work, i'm halfway there. think. myself , others in department have tried day no avail. has different setup , no 1 can work on macbook.

Pass object to a controller using state.go() in angularJs -

so want pass object(json)(ex: person entity) parameter state.go() without send url. tried using params this .state('send-to',{ url:'/:id/options', views:{ 'content@':{ templateurl:'page.jsp', params: ['ref'], controller:'optionctrl' } } }) and in controller1 use this: $state.go('home.referentiel.option',{id:$scope.selected,ref:p}); and in controller 'optionctrl' use this: $scope.selectedreferentiel = $stateparams.ref; thanks

javascript - how can i restrict that image dont resize more than a particular limit -

i have used effect.scale property image goes on resizing without anylimit. suppose remove mouse image in between time image scales full percentage specified , again keep mouse cursor on there..... again grows bigger.. downscaling much. how can prevent it? please me out <img src="test.gif" id="test"alt="online test portal" style="position:absolute;top:935.5px;left:300px" title="online test portal" onmouseover= "new effect.scale('test', 150,{scalex: true, scaley: true}); return false;" onmouseout="new effect.scale('test', 66.67,{scalex: true, scaley: true}); return false;" /> you pure css. img { transition: .2s linear; } img:hover { transform: scale(1.1); }

How to set UserID and Password in Progress Developer Studio 11.5 -

i new progress. using progress developer studio 11.5. 1 know how set userid , password. documentation helpful. complete documentation 11.5 available here... https://community.progress.com/community_groups/openedge_general/w/openedgegeneral/2352.openedge-11-5-product-documentation.aspx setting userid , password db @ connection time handled -u , -p options. setting code uses setuserid function.

Running Django test on project database -

in django project, loading model instances new test database takes time. possible test modules run against same project database (project_db) instead of test database (test_project_db), since same querying identical model instances? i suggest write tests dont need complete production database. can create fixtures have initial data (as need, not as have in prod db sure). or use tools mixer , mock . , yes, https://pypi.python.org/pypi/django-nose/ sthzg suggests (fast fixtures!) worth try. as @brandon said, "running tests against production database suicide" quite true. 1 error in code can ruin production database. also, having fixtures , consistent data give reliable test results, whereas production db change, , tests break out of nothing, while dont know why @ all.

php - dotenv requires .env file on production -

i'm using dotenv php manage environment settings (not lavarel tagged because lavarel uses dotenv) i have excluded .env code base , have added .env.example other collaborators on github page of dotenv: phpdotenv made development environments, , should not used in production. in production, actual environment variables should set there no overhead of loading .env file on each request. can achieved via automated deployment process tools vagrant, chef, or puppet, or can set manually cloud hosts pagodabox , heroku. the thing don't understand following exception: php fatal error: uncaught exception 'invalidargumentexception' message 'dotenv: environment file .env not found or not readable. this contradicts documentation says "the actual environment variables should set there no overhead of loading .env file on each request." so question if there's reason why dotenv throws exception and/or missing something? first of behavior different

java - Proguard configuration for Android Support v4 22.2.0 -

after updating dependencies on gradle android build use com.android.support:support-v4:22.2.0 local maven extras repository (within sdk), proguard started throwing these problems. warning: android.support.v4.app.dialogfragment: can't find referenced class android.support.v4.app.dialogfragment$dialogstyle warning: android.support.v4.app.fragmenttransaction: can't find referenced class android.support.v4.app.fragmenttransaction$transit warning: android.support.v4.view.viewcompat: can't find referenced class android.support.v4.view.viewcompat$resolvedlayoutdirectionmode warning: android.support.v4.view.viewcompat: can't find referenced class android.support.v4.view.viewcompat$layoutdirectionmode warning: android.support.v4.view.viewcompat: can't find referenced class android.support.v4.view.viewcompat$layertype warning: android.support.v4.view.viewcompat: can't find referenced class android.support.v4.view.viewcompat$accessibilityliveregion warning: android.

jquery - Validate dynamically added fields -

i'm adding table row jquery on button click: $("#add_row").click(function () { zeile++; $("#artikeltabelle > tbody").append('<tr id="reihe' + zeile + '">' + '<td rowspan="2"><b>' + (zeile + 1) + '</b></td>' + '<td><input class="form-control" id="cctabelle_' + zeile + '__ccartikelnr" name="cctabelle[' + zeile + '].ccartikelnr" type="text" /></td>' + '<td><input class="form-control" id="cctabelle_' + zeile + '__ccwarentarifnr" name="cctabelle[' + zeile + '].ccwarentarifnr" type="text" /></td>' + '<td><input class="form-control" data-val="true" data-val-number="das feld &quot;anzahl&quot; muss eine zahl sein." data-v

c - Comparison between unsigned int and int without using cast operator -

everyone looked around there exists topic question yet not find. unsigned int x = 5; int y = -3; if(y<x) func1(); else func2(); func2 called . want func1 called. i know must use cast operator when comparing these values. not allowed use cast operator or changing type of variable. how can solve problem? first check if y negative value, knowing that, know x bigger since unsigned. if y not negative, compare value directly x . not think cause issue since there no negative sign present. see below example: if(y<0) { //x>y func1(); } else if (y<x) { //lets y=3, , x=5 func1(); } else { func2(); }

google apps script - Calling FormApp within doGet(e) function -

Image
i relatively new scripting, please kind. i trying create function bound form within google apps, including webapp captures 3 variables (requestnum, approvernum, , status) , obtains various other information formapp (e.g titles, responses, etc). i receiving - typeerror: cannot call method "getid" of null on line 3 of below code (which bound form). any guidance in being able call form information within doget function appreciated! thank you. function doget(e){ var form = formapp.getactiveform(); var formid = form.getid(); var items = form.getitems(); var d = new date(); var formatteddate = utilities.formatdate(d, "gmt+11", "mmm dd yyyy"); var conn = jdbc.getconnection(dburl, user, userpwd); var stmt = conn.preparestatement('insert approvals ' + '(formid, requestnum, approvernum, status, date) values (?, ?, ?, ?, ?)'); stmt.setstring(1, formid); stmt.setstring(2, e.parameter.requestnum); stmt.setstri

match - R: Matching by row and column -

i have 2 data frames, below: equitydata valuationdate currency opening closing 02/01/2003 chf 0 0 02/01/2003 dkk 0 0 03/01/2003 chf 0 0 02/01/2003 sek 0 0 03/01/2003 sek 0 0 04/01/2003 sek 0 0 05/01/2003 chf 0 0 03/01/2003 dkk 0 0 which contains information trades done each day, in different currencies , historicalfx date chf x dkk x.1 sek x.2 02/01/2003 0.6885 0.688 0.1347 0.1346 0.1094 0.1096 03/01/2003 0.688 0.6858 0.1346 0.1345 0.1096 0.1099 04/01/2003 0.6858 0.6858 0.1345 0.1345 0.1099 0.1099 05/01/2003 0.6858 0.6858 0.1345 0.1345 0.1099 0.1099 which contains historical fx rates, opening price below currency ticker, , closing price in column next it. i trying corresponding fx price in equitydata data frame. i have tried following, works, inefficient:

javascript - Interrogation on DB with PHP textarea -

hi guys want query on db (i use mysql) gived input textarea , want show resurts, tried : <textarea id="area"rows="4" cols="50" name="query" form="form1"> </textarea> <input type="submit"onclick="take()"value="do"> this js function function take() { var query = document.getelementbyid("area").value ; then use php function show table result function stamp($query){ $result = mysqli_query($globals['conn'], $query); // stamp $result ecc...} can me fixate , have advice stamp function ? ty

php strict error by including -

it looks strict errors not occur if classes in 1 file this: abstract class food{} class meat extends food{} abstract class animal{ function feed(food $food){ } } class cat extends animal{ function feed(meat $meat){ parent::feed($meat); } } but if put class definition in separate files , include them that: abstract class food{} class meat extends food{} require 'animal.php'; require 'cat.php'; strict standards error message thrown: strict standards: declaration of cat::feed() should compatible animal::feed(food $food) in c:\path\to\cat.php on line... if in 1 file ok: class dog extends animal{ function feed($qty = 1){ for($i = 0; $i < $qty; $i++){ $meat = new meat(); parent::feed($meat); } } } is intended behavior? because meat food , there shouldn't complain in first place, right? solution plain ,

OpenXML Merging Documents - How to See Content using Productivity Tool -

Image
i'm new , struggling openxml. have word template , depending on number of records user selects in website have, pull records out of database , use template create word document. assemble these documents 1 master word document served user. use openxml , altchunks this: string altchunkid = "altchunkid" + itemno.tostring(); maindocumentpart mainpart = mydoc.maindocumentpart; alternativeformatimportpart chunk = mainpart.addalternativeformatimportpart( alternativeformatimportparttype.wordprocessingml, altchunkid); using (filestream filestream = file.open(createdfilename, filemode.open)) { chunk.feeddata(filestream); filestream.close(); } altchunk altchunk = new altchunk(); altchunkproperties altchunkproperties = new altchunkproperties(); matchsource matchsrc = new matchsource(); matchsrc.val = true; altchunkproperties.append(matchsrc); altchunk.appendchild(altchunkproperties); altchunk.id = altchunkid; mainpart.document.body.app

Google Spreadsheets: match multiple variables in multiple columns using match -

google spreadsheets: trying match multiple variables in multiple columns i have tried code =match(t7&c7&"v";t$2:t6&c$2:c6&k$2:k6) that expected woork, not .... ideas how can this? try this: =arrayformula(match(t7&c7&"v",arrayformula(transpose(split(concatenate(t$2:t6&c$2:c6&k$2:k6&"|"),"|"))),0)) if not work, please give example of data

python - Merging two CSV files on common column - result: empty -

i have 2 csv files: filmdata: userid, age of user, filmid, sex of user filmnames: filmid (which common column) , filmname i merge 2 files, have 1 csv file userid, age, filmid, sex , filmname (based on filmid). i using following code snippet: import pandas pd = pd.read_csv("c:/users/alex/box sync/cs109/predictions/filmdaten.csv.csv") b = pd.read_csv("c:/users/alex/box sync/cs109/predictions/filmnamenneu.csv.csv") b = b.dropna(axis=1) merged = a.merge(b, on='filmid') merged.to_csv("c:/users/alex/box sync/cs109/predictions/filmoutput.csv", index=false) filmdaten.csv looks this: userid,alter,geschlecht,beruf,plz,filmid,bewertung 1,24,m,technician,85711,61,4 1,24,m,technician,85711,189,3 filmnamenneu.csv this: filmid, filmnamen 1, toy story 2, jurassic parc when column names indeed merge, filmname column in output file remains empty. know solution?

How to block read permission for Google Cloud Data Store -

we looking store nosql data , have specific permission requirements. want have 2 type of interactions cloud datastore: 1. via api 2. via developer console via api, want create/upload objects api should not able read/search entities. api should have write permissions. via console, want our support team read/download objects, not let them edit/upload objects. we able figure out possible give read access team members, able read/retrieve objects console problem facing how block read access via api. there way control access google cloud data store api or work around solve problem? cloud datastore not support write-only permissions. as you've noted, can assign read-only permissions assigning team members "can view" role instead of "can edit" or "owner" role.

Bokeh, combination of bar and line chart -

Image
i trying plot line on top of bar chart within bokeh. have tried: p1 = figure()... p1.renderer.append(bar(...)) p1.renderer.append(line(...)) show(p1) so far had no luck. combination of 2 or more graphs in 1 plot in bokeh possible using basic glyphs . for question can use line , rect. from bokeh.plotting import figure, output_file, show bokeh.models.ranges import range1d import numpy output_file("line_bar.html") p = figure(plot_width=400, plot_height=400) # add line renderer p.line([1, 2, 3, 4, 5], [6, 7, 6, 4, 5], line_width=2) # setting bar values h = numpy.array([2, 8, 5, 10, 7]) # correcting bottom position of bars on 0 line. adj_h = h/2 # add bar renderer p.rect(x=[1, 2, 3, 4, 5], y=adj_h, width=0.4, height=h, color="#cab2d6") # setting y axis range p.y_range = range1d(0, 12) p.title = "line , bar" show(p) and plot get:

ios - Display virtual keyboard with barcode scanner attached -

we have written enterprise app wholesaler client. app directs warehouse staff different locations in warehouse, telling them products pick. the app allows picker double check picking correct product entering barcode of product have picked up. client has purchased usb barcode scanner allows them scan directly app. scanning of barcode , validation works fine. problem comes when picker needs enter number of units have picked up. can't because virtual keyboard has been hidden . the virtual keyboard hidden because (i assume) ios thinks barcode scanner hardware keyboard. there way force virtual keyboard remain on screen? i have searched, various solutions either not work ios8 , or use private apis (which i've not attempted implement, pretty ropey). if not solve-able programatically, happy advise client use different scanner (i have seen seem have button press bring virtual keyboard, etc). if happen know of scanner this, please advise! i realise use camera on device,

javascript - How do I sort a <ul> list by datetime? -

i have <ul> list generated using javascript when page loads (by appending var <li> tags <ul> element). how can make <li> newest date @ top when page loads? also, code extremely long (~6000 words) , include outside sources (to google's api), understand how can implement code. here's pseudo-code explain how stuff generated js/html: i have <ul> element nothing inside tags i information user's last 5 uploaded videos youtube using google's api, information includes channel name, video title, video id, thumbnail url, , date , time video published @ (a string iso 8601 format). next information used make var (which includes html tags , styles) example: var output = '<li><p>'+videotitle+'</p><p>'+publishedat+'</p>\ <img src="'+videothumbnail+'" height="90px"></li>' this code added via 2 functions. 1 gets info

Minizinc: How to apply this constraint for scheduling model? -

i working on scheduling model , i'd figure out how use constraint: using minizinc 2.0.2 version & minizincide-0.9.7-linux , g12-mip & gecode solvers. array[1..2,1..48] of var 0..1: table; array[1..48] of int:demand; array[1..2] of int: cost; constraint forall(j in 1..48)(sum(i in 1..2)(table[i,j]) >= demand[j] ); solve minimize sum(i in 1..2)(sum(j in 1..48)(table[i,j])*cost[i]); output [show(table)]; sample data.dzn file: demand=[0,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]; cost=[3,5]; output table array using g12-mip solver gives result: [0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] this model 2 points , 48 hours(i.e 2 days).the constraint wanted add each employe

java - MultipartServletWebRequest.getFiles() returns empty map -

in wicket 1.5 processed uploaded files in way: public uploadvaluepage(pageparameters parameters) { super(parameters); bytes maxsize = bytes.kilobytes(20000); servletwebrequest swr = (servletwebrequest) getrequest(); multipartservletwebrequest mswr = swr.newmultipartwebrequest(maxsize, "uploadid"); fileitem item = mswr.getfile("fileinput").get(0); // process item } but after migrating wicket 6 there no files in map . why? after searching on web found this: http://wicketinaction.com/2012/11/uploading-files-to-wicket-iresource/ so need line since wicket 6.18.0 : public uploadvaluepage(pageparameters parameters) { super(parameters); bytes maxsize = bytes.kilobytes(20000); servletwebrequest swr = (servletwebrequest) getrequest(); multipartservletwebrequest mswr = swr.newmultipartwebrequest(maxsize, "uploadid"); mswr.parsefileparts(); // since wicket 6.18.0 fileitem item = mswr.getfile("f

r - Overcoming "Error: unexpected input" in RCurl -

i trying , failing use rcurl automate process of fetching spreadsheet web site, china labour bulletin's strike map . here url spreadsheet options set i'd them: http://strikemap.clb.org.hk/strikes/api.v4/export?fromyear=2011&frommonth=1&toyear=2015&tomonth=6&_lang=en here code i'm using: library(rcurl) temp <- tempfile() temp <- getform("http://strikemap.clb.org.hk/strikes/api.v4/export", fromyear="2011", frommonth="1", toyear="2015", tomonth="6", _lang="en") and here error message in response: error: unexpected input in: " toyear=2015, tomonth=6, _" any suggestions on how work? try enclosing _lang backtick. temp <- getform("http://strikemap.clb.org.hk/strikes/api.v4/export", fromyear="2011", frommonth="1", toyear="2015", tomonth=&quo

Does stripe allow to charge multiple customers in on api call? -

i want create job runs once month , charges customers different fees. is possible charge multiple customers in 1 api call ? if not, rate limit of api ? there no way charge multiple customers in 1 api call. you'd need create 1 charge each customer. rate limit of api, it's not published officially , you'd need contact stripe's support directly here .

epson - Printing to a kitchen printer via email -

all, when orders sandwich website, want able print order out in kitchen. there printer poll email box , when new 1 received print out ? i can use laptop plugged reciept printer if helps. you can printers cloud printing nowadays. let send email specific email address , print out automatically. check link out more info on printers , availability. http://www.google.co.uk/cloudprint/learn/printers.html

How to calculate upload and download frequency in android? -

now getting current network type. how calculate uarfcn? api have use? int nettype = telephonymanager.getnetworktype(); switch (nettype) { case telephonymanager.network_type_gprs: case telephonymanager.network_type_edge: case telephonymanager.network_type_cdma: case telephonymanager.network_type_1xrtt: case telephonymanager.network_type_iden: return "2g"; case telephonymanager.network_type_umts: case telephonymanager.network_type_evdo_0: case telephonymanager.network_type_evdo_a: case telephonymanager.network_type_hsdpa: case telephonymanager.network_type_hsupa: case telephonymanager.network_type_hspa: case telephonymanager.network_type_evdo_b: case telephonymanager.network_type_ehrpd: case telephonymanager.network_type_hspap: return "3g"; case telephonymanager.network_type_lte: return "4g";

sysadmin - Crontab and its logs -

frist time writing crontab. following structure of time , date # * * * * * command execute # │ │ │ │ │ # │ │ │ │ │ # │ │ │ │ └───── day of week (0 - 6) (0 6 sunday saturday, or use names; 7 sunday, same 0) # │ │ │ └────────── month (1 - 12) # │ │ └─────────────── day of month (1 - 31) # │ └──────────────────── hour (0 - 23) # └───────────────────────── min (0 - 59) i put entry following 00 06 * /bin/sh /opt/cleanup.sh think not woring. where can see log of crontab?? usually cron commands' output sent owner via mail ( man mail ), when execute code returns output (stdout , stderr). when login should see "there new mails". don't know though if wrong cron schedules yours (see @fedorqui's reply) throw error log. in case have output , error of scheduled cron jobs on file instead of on mail, can redirect output this: 00 06 * * * /bin/sh /opt/cleanup.sh > /where/you/have/write/permission/cleanup.log 2>&1 if want append r