Posts

Showing posts from June, 2015

Upload excel file failed in jenkins -

i working end end testing in protractor test upload excel file feature dragging file dropzone. used approach in below link simulate dragging file: simulate drag , drop of file upload in protractor can work on local machine failed when running on jenkins. seems jenkins can find file , drag file dropzone failed when data transferring. thanks help.

osx - El Capitan does not detect Meizu4 -

currently i'm trying connect meizu4 device el capitan 10.11.6 . i tried using sync-mate , nothing happen. i allow debugging mode , media-transfer-protocol (mtp), still nothing happen would able me. thank you you need download "android file transfer" on mac. https://www.android.com/filetransfer/ , connect usb cable

Android WebView resize default audio player -

Image
i using webview in application giving audio url. its working absolutely fine in devices. see below screenshot: but in device not looking user friendly. is there way set size of webview audio player? update: code snippet: // open doi activity intent podcastintent = new intent(mcontext, doiwebactivity.class); podcastintent.setaction(constants.intent_view_link); podcastintent.putextra(constants.extra_doi_link_url, podcasts.get(0).getpodcastlink()); podcastintent.putextra(constants.calling_fragment,constants.calling_fragment_podcast_listing); podcastintent.putextra(constants.extra_podcast_name,mcontext.getstring(r.string.podcast)); mcontext.startactivity(podcastintent); //called podcastlistingfragment : podcast name if (bundle != null && bundle.containskey(constants.calling_fragment) && bundle.containskey(constants.extra_podcast_name)) { string title = bundle.getstring(silverchairconstants.extra_podcast_name

Android DownloadManager Behaviour when using okhttp -

why buffersize of realbufferedsource(fixedlengthsource) changes 65536 2048 bytes when there exception? 2 issues m facing on downloadmanager code follows: (i m new forum. if more inputs needed, please tell me) issue 1: downloadmanager(a.k.a downloadthread) of android updated once 4 times read of 65536 bytes. implementation done? sorry, not find place done. specific reason update downloadthread once 4 reads? during error scenario, happens is, if partial http fetch request downloadmanager, range: request goes last updated currentbytes value. if error happens inbetween (say, 2nd out of 4th read), range: request goes updated currentbytes may reread same bytes again. // hc: httpconnection.java, fixedlengthsource#read print added. 19:09:10.374 system.out: (httplog)-thread-270-223795676: content-length : 70610220 19:09:10.684 system.out: (httplog)-static: hc:: bytesremaining, bytecount ::: 70610220,65536 19:09:10.694 system.out: (httplog)-static: hc:: bytesremaining, bytec

What setups I need to run a Java Selenium test in Sauce Labs? -

i've eclipse & javascript when run script fails launch configs: org.openqa.selenium.sessionnotcreatedexception: unable create new remote session. desired capabilities = capabilities [{browsername=chrome, version=latest, platform=win8_1}], required capabilities = capabilities [{}] build info: version: 'unknown', revision: '1969d75', time: '2016-10-18 09:43:45 -0700' system info:os.name: 'windows 8.1', os.arch: 'amd64', os.version: '6.3', java.version: '1.8.0_65' driver info: driver.version: remotewebdriver code: import org.openqa.selenium.webdriver; import org.openqa.selenium.remote.desiredcapabilities; import org.openqa.selenium.remote.remotewebdriver; import java.net.url; public class samplesaucetest { public static final string username = "username "; public static final string access_key = "access_key"; public static final string url = "https://" + username + "

android studio - What is best value for "Rendercript Optim Level"? -

android studio --> open module settings --> build types --> renderscript optim level --> (3) // default (3) or else? there recommendations? it's best use default "optim" level 3. what “rendercript optim level”? where renderscript source code

In python what is a response object returned from a website? -

i'm trying use etsy api , able running source. gave key, , returned following when printed out. <etsy._v2.etsyv2 object @ 0xb7284ccc> however have no idea it. github-repo doesn't have documentation, , command suppose follow doesn't work. read etsy api , didn't find mentioned command getfrontfeaturedlistings github listed. i've had issue before http response object , told use response.content check out more info on object. didn't work object i'm wondering if there simple way test generic object, or @ least see object contains? when in doubt can use dir built-in method on arbitrary python object. show methods , fields attached object. https://docs.python.org/3/library/functions.html#dir anyway, sorry hear poor documentation of library. last time used etsy's api created little class used requests. wasn't work since etsy lays out of uris + documentation nicely on developer site. https://www.etsy.com/developers/documentation

Ruby undefined method error -

i'm learning ruby on rails , working on redmine , redmine plugins currently. <% row in rows %> <%row_array = rows.to_a%> <tr class="<%= cycle("odd", "even") %>"> <td class="name"><%= link_to h(row), aggregate_path(@project, field_name, row) %></td> <td> <% aggregate_link data, { field_name => row_array[0].id, "closed" => 0 }, aggregate_path(@project, field_name, row, :op => {"status_id"=>"o", "#{filter_by}"=>"><"}, "v[#{filter_by}]" => formated_dates(@dates), "f" => ["status_id", "#{filter_by}", ""]) %> for reason code throws "actionview::template::error (undefined method `id' []:array):" r

java - Returning a linked list containing keys from another Linked List -

i have following problem. have linked list or positional list containing objects called entry. each entry stores key , value pair. want make linked list grab list keys. have come method so,however reason order in added them not represented when print key list. have following 2 methods: public positionallist1<k> keyset() //i prnted position position while adding , worked. tested addafter positionallist1 class , worked { positioninterface<entry> iterator = map.first(); //gets first position in entry list positioninterface<k> first = keylist.addfirst((k)iterator.getdata().getkey()); //adds list containing keys key entry list(getdata method returns whatever object stored @ node, in case entry object) iterator = map.after(iterator); //go next node in entry list for(int i=0;i<size-1;i++) //get rest of keys { positioninterface<k> p = keylist.addafter(first,(k)iterator.getdata().getkey()); iterator = map.after(iterator);

c++ - To extract a set of feature and cluster data from the given point cloud data -

presently using pcl 1.8.0, having sample cloud data of plate has of components fitted on plate of few centimeters above on actual plate. this cloud data cluster , features data. cloud data by using euclidean cluster extraction, able cluster count , cluter shapes sample data , these clusters saved different pcd depending on cluster data , shape shown below. extracted cluster data now if u observe in above image getting outer boundary of cluster per requirement, want entire outer boundary , inner features of cluster written separate pcd file, further calculation, can 1 suggest me on how extract cluster , feature data given cloud data , write separate pcd files. any suggestion helpful thanks in advance one possible solution problem: compute clusters you're doing. pick cluster you're interested in. compute minimum oriented bounding box containing cluster. use computed box clip original point cloud, getting points within box. the process compute mi

javascript - Getting ID of the first item only on using ng-repeat -

so here's workflow- i've got html file in div tag created on i've placed ng-repeat iterates , gives me list of items. on div tag, i've placed ng-click function. on clicking , item in div tag, modal-popup opened. what need pass id of item ng-repeat , show data of id in modal-popup . now i've written code upto here , things working fine, issue i'm facing if click on of items ng-repeat first item returned, , hence data id of first item being displayed in modal-popup. how id of particular item clicked (and not first item) , pass controller? here's working code - main html: <div id="main"> <div ng-repeat="data in jsondata" ng-click="openmodal()"> <div id="widget"> <div id="{{$index}}"> <div> <h2 class="font-bold no-margins" id="{{data.itemname}}"> {{data.itemnam

python - Sum amount associated with item in a column of lists -

i have dataframe follows: country letter keywords amount c y ['fruits', 'apples', "banana"] 700 c y ["music", "dance", "banana"] 150 c y ['loud', "dance", "apples"] 350 i'd sum amount associated each keyword. note: country , letters not same, in contrived data above. also, list of keywords vary in size. i've tried several solutions. i've attached fastest 1 below. i've tried solutions apply , defaultdicts ... keywords_list = [] in zip(*[df[c] c in df.columns]): data = list(i[0:2]) k in i[2]: row = [k] + data + [i[-1]] keywords_list.append(row) df_expanded = pd.dataframe(keywords_list) df_expanded.groupby(list(range(3)))[3].sum().reset_index() goal country letter keywords amount 0 c y apples 1050 1 c y banana 85

php - How to insert multiple image file in a row on my database -

Image
if(count($_files['upload']['name']) > 0){ //loop through each file for($i=0; $i<count($_files['upload']['name']); $i++) { //get temp file path $tmpfilepath = $_files['upload']['tmp_name'][$i]; //make sure have filepath if($tmpfilepath != ""){ //save filename $shortname = $_files['upload']['name'][$i]; //save url , file $filepath = "../img/slider/" .$_files['upload']['name'][$i]; //upload file temp dir if(move_uploaded_file($tmpfilepath, $filepath)) { $files[] = $shortname; } } } } if(is_array($files)){ foreach($files $file){ $file1 = "img/slider/" . $file; $query = "insert image(image_path,p_number)values('$file1','$number')"; $re

pandas - Count number of counties per state using python {census} -

i troubling counting number of counties using famous cenus.csv data. task: count number of counties in each state. facing comparing (i think) / please read below? i've tried this: df = pd.read_csv('census.csv') dfd = df[:]['stname'].unique() //gives out names of state serr = pd.series(dfd) // converting series (from array) after this, i've tried using 2 approaches: 1: df[df['stname'] == serr] **//error: series length must match** 2: i = 0 name in serr: //this generate error 'alabama' df['stname'] == name in serr: serr[i] == serr[name] print(serr[name].count) i+=1 please guide me; has been 3 days stuff. use groupby , aggregate county using nunique : in [1]: import pandas pd in [2]: df = pd.read_csv('census.csv') in [3]: unique_counties = df.groupby('stname')['county'].nunique() now results in [4]: unique_coun

Netty Http interception proxy -

good morning every body. i investigating netty business case working on: - company wants control employee users not use employee email addresses, post or store these addresses, on internet, leave no trace on internet the solution thinking is: - tracking requests , inspect values in forms. if 1 value match company name, replace fake name. - tracking http responses. if company name found, hihglight company name in page, , log file, compliance department can control it. at moment have seen proxy dumphex of netty. haven't found examples can modify requests , responses. proxy example link channels together. do think approach doable netty? can find examples of modifying content in samples? have not found far. thanks , regards gilles

c++ - How to produce a symmetric layout for a large graph? -

i using boost's kamada-kawai spring layout algorithm implementation produce symmetric graph layouts. works small graphs (up few hundred of vertices). however, slow larger graphs. i looked inside boost code find takes time , discovered algorithm begins computing all-pairs shortest paths, exhibits cubic complexity of course. for application, graphs of interest consist of tens of thousands of vertices. graphs pretty sparse, number of edges small factor larger number of vertices. is there trick or alternative can use obtain symmetric layouts such graphs?

If my application using redisson RMapCache goes down for some time, can i restore it? -

i want use redisson rmapcache set expiry individual entries in map. if application crashes in betweeen, , comes keys supposes expire in downtime expired comes ? or need @ other redisson use case ? then comes keys supposes expire in downtime expired comes ? yes, will.

Slow app build - Xamarin for Visual Studio -

Image
the build/deploy of xamarin.android app painfully slow these days. cannot remember being slow before. i have enabled: use shared runtime fast deployment enabling or disabling these settings doesn't make difference. in both scenarios takes 2 minutes , 20 seconds (up on 3 minutes!) build/deploy app. using real device or visual studio emulator android doesn’t make difference well. why extremely slow? not using right settings? update 2 yesterday (november 14th) updated xamarin.vs 4.2.1.58. no improvements in build duration. we using teamcity build release versions of our app, teamcity statistics show i'm talking about. in graph below, selected last quarter date range. see major increase in build duration. now, don't mind waiting 3 minutes release build, it's not acceptable when debugging. update 3 jon, help. in meantime, have done research myself in build logs , found duration per build task well. found somehow getadditionalresourcesfromassem

c# - Write / Output data from a Process that doesn't support Pipe into Memory? -

been looking on no avail i go process assembles code (from text file nothing special), , outputs compiled file (this can read hex). piping doesn't work process, cause needs whole data , not stream etc, need save files hdd , read/write etc. so wonder, possible trick process? can somehow tell read file memory instead of filename on disk? and can output memory same principle? i can confirm reading/writing standardoutput/input/error doesn't achieve really. the process use: -argument "something.file" -o "outputfile" however outputs without -o it's worth. "-" nothing except produces error (on output): assembler messages: fatal error: can't open bfd on stdout -

REST API structure for multiple countries -

i'm designing rest api can search data in different countries, since can search same thing, @ same time, in different countries (max 4), unsure of best/correct way it. this work start data (i'm using cars example): /api/uk,us,nl/car/123 that request return different ids different countries (uk=1,us=2,nl=3), do when data requested 3 countries? nice structure data 1 @ time: /api/uk/car/1 /api/us/car/2 /api/nl/car/3 but not efficient since hits backend 3 times. i this: /api/car/?uk=1&us=2&nl=3 but doesn't work if want add path: /api/uk/car/1/owner because turn into: /api/car/owner/?uk=1&us=2&nl=3 which doesn't good. anyone got suggestions on how structure in way? i answered similar question before , stick idea: have set of elements -cars- , want filter in way. advice add filter field. if field not present, choose 1 country based on locale of client: mydomain.com/api/v1/car?countries=uk,us,nl this field should dissa

Azure functions github deployment from subfolder -

i'm using azure functions github deployment. place function in src/server/functionname/ within repo, deployment works if function placed directly in functionname/ how deploy functions placed in subdirectories? the documentation states your host.json file , function folders should directly @ root of deploy. but "should" doesn't mean "must", right? what tried: various combinations of locations of host.json , function.json in host.json set routeprefix seems affect function's url: "http": { "routeprefix": "src/server" }, there few ways can customize deployment process. 1 way adding custom deployment script repository root. when .deployment script exists azure run script part of deployment process detailed here . e.g. can write simple script copies files , directories sub directory \src\server root, e.g.: @echo off echo deploying functions ... xcopy "%deployment_source%\src\server&qu

kubernetes persistent volume ReadWriteOnly(RWO) does not work for nfs -

there, according doc: readwriteonce – volume can mounted read-write single node i created pv based on nfs: apiversion: v1 kind: persistentvolume metadata: name: tspv01 spec: capacity: storage: 15gi accessmodes: - readwriteonce persistentvolumereclaimpolicy: recycle nfs: path: /gpfs/fs01/shared/prod/democluster01/dashdb/gamestop/spv01 server: 169.55.11.79 a pvc pv: kind: persistentvolumeclaim apiversion: v1 metadata: name: sclaim spec: accessmodes: - readwriteonce resources: requests: storage: 15gi after create pvc bind pv: root@hydra-cdsdev-dal09-0001:~/testscript# kubectl pvc name status volume capacity accessmodes age sclaim bound tspv01 15gi rwo 4m then created 2 pods using same pvc: pod1: kind: pod apiversion: v1 metadata: name: mypodshared1 labels: name: frontendhttp spec: containers: - name: myfrontend image: nginx ports: - containerpo

jquery - Trouble hiding "dropdown" menu -

i've made "dropdown" menu. works when open/show can't close/hide it? <div class="expand-menu"> <div class="cities"> <!-- menu content --> </div> </div> <ul> <li class="choose-btn"> <a href="">city name</a> </li> </ul> var city_btn = $(".choose-btn"); var city_active = $(".choose-btn a"); var expand_menu = (".expand-menu"); var city_cont = (".cities"); here open/show "dropdown" menu (works) $(city_btn).click(function() { $(expand_menu).animate({top: "0"}, 'normal'); $(expand_menu).fadein({queue: false, duration: 'normal'}); $(city_cont).fadein("normal"); $(city_active).addclass("choose-btn-active"); return false; }); here close/hide $(city_btn).click(function() { $(expand_menu).animate({top: "10

Converting java string to uppercase without using toUpperCase method -

what have far public string touppercase(string str) { int strlength = str.length(); string word = ""; while (strlength > 0) { char newstr = str.charat(strlength); character.touppercase(newstr); character.tostring(newstr); word += newstr; strlength--; } return word; } i'm lost , code illogical. appreciated to change string uppercase without using touppercase(), check below code. if(ch>96 && ch<123) { ch=ch-32; system.out.print( (char) ch); } check char small letter or not , if small subtract 32

javascript - Add items to an array skipping duplicates -

i want add items array skipping duplicates. reason 1 item being added , second item not being added. here code. var add = ['email1@gmail.com', 'email2@gmail.com', 'email1@gmail.com']; var main_messages = [] var function findmessages(messagelist) { return messagelist = from; } add.map(function(map){ = map if(main_messages.find(findmessages) === undefined){ main_messages.push(map) } }); console.log(main_messages) so expected output should ['email1@gmail.com', 'email2@gmail.com'] but output i'm getting in code only ['email1@gmail.com'] what doing wrong , how can fix problem? looks you're missing = in return statement of findmessages , you're setting from messagelist instead of comparing. here's fixed code var add = ['email1@gmail.com', 'email2@gmail.com', 'email1@gmail.com']; var main_messages = [] var function findmessages(messagelist) { return m

c# - Is it possible to auto-generate object initialization code from a runtime object with values? -

maybe long shot, if existed save me time. to explain in more detail. let's have long xml file , mapped class. want test stuff , change values around before run test. re-construct whole xml structure writing c# code initializing mapped class, want know - absolutely have ? so want parse big xml file object @ runtime , generate initialization code string paste somewhere. let's input : <myobject> <prop1>a</prop1> <prop2>b</prop2> <prop2>c</prop2> </myobject> and string example: "new myobject() { prop1 = "a", prop2 = "b", prop3 = "c" }"

vb.net - GetActiveObject from The Excel Worbook -

Image
i have datepicker written in vb.net looks this. i had way because of security settings have. because of that, build in datepicker excel generate error. the date picker works fine if there only 1 excel application open . problem when there multiple excel applications open . the code takes first excel application, want excel workbook that's called " test ". i think problem statement: objexcel = system.runtime.interopservices.marshal.getactiveobject("excel.application") for better understanding code excel , datepicker application below: that's how open vb.net application in excel: set wsh = vba.createobject("wscript.shell") arg = activeworkbook.path & ";" & activeworkbook.name & ";" & activesheet.name & ";" & target.address ' wait shelled application finish: errorcode = wsh.run(strpathdatepicker & " " & arg, windowstyle, waitonreturn) the code date

c# - What is more efficient, bitwise or equality checking? -

i writing few conditional variables, , figured easier set value result of equality between 2 boolean values. what faster/more efficient processing side, marginal? bool output = true&true; or bool output = true&&true; i expect latter single equality check rather computing entire byte thanks , apologies on vagueness previously. robbas answer, if code similar to: bool input1 = generatefirstvalue(); bool input2 = generatesecondvalue(); bool output = input1 && input2; a clear improvement drop first 2 lines declaration mean when value false more efficient on bitwise checks, or presetting values. when logic has intensive methods. bool output = generatefirstvalue() && generatesecondvalue(); and doing that, sort checks least demanding first. in hypothetical example doubt matters evaluating true crazy fast (if not compiled away completely) take example however: bool output = verylongfunction() & otherverylongfunction();

javascript - How to create a node js function that always wait for new lines from java system.out.println? -

i seek ideas on how can create function wait new lines due delay java app via stdout? i want display terminal console in manner data presented progressively instead of 1 whole chunk. here java codes: public class helloworld { public static void main(string[] args) { // prints "hello, world" terminal window. // system.out.println("hello, worldzzz"); (int i=1; i<11; i++) { try { thread.sleep(500); } catch (exception e) { } system.out.println("count is: " + i); } } } here node js codes far: var http = require('http'), util = require('util'), url = require('url'), exec = require('child_process').exec, child, result = '', poort = 8088; http.createserver(function(req, res) { res.writehead(200, { 'content-type': 'text/plain' }); va