Posts

Showing posts from April, 2012

android - Service is not working as expected -

i have written 1 service.it work nexus, samsung, sony , moto in phones xiaomi, leeco not work. when kill app service stopped in xiaomi worked in other phones. i'm not able figureout exact issue. can me find out. have tested in xiaomi phone , not working expected. here code please try figure out. have declare in manifest file well.thanks as every said remove location interface.so, have removed , sill not work in background in mi phone.any solution please suggest.one more things ondestroy of service not call.when try kill app i have tried other ways alarm manager, job scheduler, broadcast receiver public class myservice extends service { private final localbinder binder = new localbinder(); @override public ibinder onbind(intent paramintent) { return this.binder; } @override public int onstartcommand(intent intent, int flags, int startid) { return service.start_sticky; } @override public void oncreate() { super.oncreate(); } public class localbinder ex...

linux - Remove Lines from File which not appear in another File, error -

i have 2 files, similar ones below: file 1 - phenotype informations, first column individual, orinal file has 400 rows: 215 2 25 13.8354303 15.2841303 222 2 25.2 15.8507278 17.2994278 216 2 28.2 13.0482192 14.4969192 223 11 15.4 9.2714745 11.6494745 file 2 - snps information, original file has 400 lines , 42,000 characters per line. 215 20211111201200125201212202220111202005111102 222 20111011212200025002211001111120211015112111 216 20210005201100025210212102210212201005101001 223 20222120201200125202202102210121201005010101 217 20211010202200025201202102210121201005010101 218 02022000252012021022101212010050101012021101 and need remove file 2 individuals not appear in file 1, example: 215 20211111201200125201212202220111202005111102 222 20111011212200025002211001111120211015112111 216 20210005201100025210212102210212201005101001 223 20222120201200125202202102210121201005010101 ...

ms access - Conditional Formatting Less than issue -

i using conditional formatting on 150 text boxes, if value >85% background green, if <85% background red. firstly, there quick way set formatting 150 of them quickly, instead of doing them 1 @ time secondly, amusing following expression format text box val([text168])>0.84 this works , background green. when use code set background red nothing background stays white: val([text168])<0.85 i can not head around why happening have tried changing number 0.85 whole number of 85? may data not directly bound table. hope helps

java - How to add OnClickListner to CardView use with ListView -

i trying follow tutorial android working card view , recycler view . want attach onclicklistner each card. tried many answers available on stackoverflow, not working me.there part of code. mainactivity.java /** * adding few albums testing */ private void preparealbums() { int[] covers = new int[]{ r.drawable.album1, r.drawable.album2}; album = new album("附近警察局", covers[0]); albumlist.add(a); = new album("附近医院", covers[1]); albumlist.add(a); adapter.notifydatasetchanged(); } /** * recyclerview item decoration - give equal margin around grid item */ public class gridspacingitemdecoration extends recyclerview.itemdecoration { private int spancount; private int spacing; private boolean includeedge; public gridspacingitemdecoration(int spancount, int spacing, boolean includeedge) { this.spancount = s...

.net - How to read the content of service bus messages only for monitoring -

is there way read messages in queue or topics without pulling or changing behavior (just monitoring)? azure service bus allows peek messages. for example, can use queueclient.peekasync() to peek messages queue. there's equivalent topics , subscriptions well. in case don't need differentiate between messages queues , subscriptions, there's messagereceiver.peekasync() option.

c# - Clear all FilterQuery in Sitecore.ContentSearch linq query -

i can solr query with var index = contentsearchmanager.getindex(indexname); var context = index.createsearchcontext() var results = context.getqueryable<solrcoremodel>().getresults()... but there's added in raw solr query fq parameter indexname &fq=_indexname:(solr_core) how can remove , send 'clear' query? you can not sitecore , contentsearchmanager . this how sitecore stores data in solr - splits in "indexes". cannot query using sitecore api , without passing index name solr. when sitecore indexes item, e.g. home item, if home item master database, stored field _indexname set e.g. sitecore_master_index . same item web database marked sitecore_web_index .

python - Python3 Tkinter - Write input (y) to console for subprocess -

i've been looking around answer problem have been unlucky. answer work native python , simple. my problem i'm using subprocess in tkinter application, 1 of commands require write y/n sure want proceed action. so i'm looking way write y terminal when message appears: sure want continue? (y/n) i've tried running subprocess.run("y") doesn't seem work. i'm testing on debian linux , call command asks if want proceed, subprocess.getoutput() can check errors. code class removepublickeydialog: def __init__(self, parent): top = self.top = toplevel(parent) label(top, text="who remove?").pack() self.e = entry(top) self.e.pack(padx=5) b = button(top, text="remove", command=self.ok) b.pack(pady=5) def ok(self): #print("value " + self.e.get()) key = self.e.get() cmd = subprocess.getoutput("gpg --delete-keys " + key) print(cmd) if ("key \"" + key + ...

objective c - iOS PHPhotoLibrary cannot save video to Camera Roll -

i'm trying save video file application's documents folder device's camera roll. error occurs when albumchangerequest tries copy asset camera roll. fails copy file album, , gives error message (domain=nscocoaerrordomain code=-1 "(null)", operation couldn't completed). used deprecated method ( writevideoatpathtosavedphotosalbum ) copy video, , used same file path, problem should not file path url. ... phphotolibrary *photolibrary = [phphotolibrary sharedphotolibrary]; nsurl *filepathurl = [nsurl fileurlwithpath:videopath isdirectory:no]; __block nsstring* asseturl = nil; phfetchresult *fetchresult = [phassetcollection fetchassetcollectionswithtype:phassetcollectiontypesmartalbum subtype:phassetcollectionsubtypesmartalbumuserlibrary options:nil]; phassetcollection* album = fetchresult.firstobject; if (album) { [photolibrary performchanges:^{ phassetchangerequest *assetchangerequest = [phassetchangerequest creationrequestforassetfromvideoatfi...

Sentiment analysis in Spanish with google cloud natural language api -

it looks new api gives sentiment analysis in english, not in spanish, there that? when expected? google research nlp pm here. we planning launch sentiment in spanish, don't yet have timeline. 1 thing can in meantime run text through translate api, fail badly syntax works reasonably sentiment. what kind of data planning send through?

typescript - How to detect when an @Input() value changes in Angular2 -

i have parent component ( categorycomponent ), child component ( videolistcomponent ) , apiservice. i have of working fine i.e. each component can access json api , relevant data via observables. currently video list component gets videos, filter videos in particular category, achieved passing categoryid child via @input() . categorycomponent.html <video-list *ngif="category" [categoryid]="category.id"></video-list> this works , when parent categorycomponent category changes categoryid value gets passed through via @input() need detect in videolistcomponent , re-request videos array via apiservice (with new categoryid). in angular1 have done $watch on variable. best way handle this? actually, there 2 ways of detecting , acting on when input changes in child component in angular2+ : you can use ngonchanges() lifecycle method mentioned in older answers: @input() categoryid: string; ngonchanges(changes: simplechanges) { ...

Pandas dataframe of sums from another dataframe -

i have pandas dataframe. want make dataframe, columns sums of selected columns first frame. for example in first dataframe have columns named 'a' , 'b' , 'c' , 'd' . new columns 'x' , 'y' , 'x' has them sum of 'a' , 'b' , 'c' , 'y' contains 'd' . "mapping" may saved in dictionary: {'x': ['a', 'b', 'c'], y: ['d']} , not need be. shall initialize empty data frame keys 'x' , 'y' , add columns or there quicker way? you can directly initialize dataframe data in it: df2 = pd.dataframe({'x': df[['a', 'b', 'c']].sum(axis=1), 'y': df['d']}) or can build column column: df2 = df[['a', 'b', 'c']].sum(axis=1).to_frame(name='x') df2['y'] = df['d'] for first column, you'll need call to_frame name desired col...

html - Center text and button elements within Orbit slider? -

i having hardest time figuring out how make 2 text elements , button centered within orbit slider in foundation. apologize such beginner question, brand new foundation , of syntax confusing me. it slider 4 images, , i'm trying superimpose centered h3, p , button elements on top. pulled left. html: <div class="row columns"> <div class="orbit" id="featured" role="region" aria-label="favorite space pictures" data-orbit> <ul class="orbit-container" data-caption="#captionone"> <button class="orbit-previous" aria-label="previous"><span class="show-for-sr">previous slide</span>&#9664;</button> <button class="orbit-next" aria-label="next"><span class="show-for-sr">next slide</span>&#9654;</button> <li class="orbit-slide is-a...

java - Android: Intent and exchanging data between components -

i read interprocess communication (ipc) , creating send data 1 component component. knew ipc defines communication channel between different components. channel have programming interfaces components send data through. ways create interface such aidl, binder, , messenger. after creating interface, data sent on must parcel . summary steps follows: 1. create programming interface. 2. bind interface application component. 3. components sending data component must convert data parcel. found called intent can send data 1 component without overhead. need explanation how intent can send data without having interface created? intent internally have interface? relation between intent , ipc, bound service, , interface? wow have lot of confusion here. let's see if can clear things up. 1)ipc not send data 1 component (it can, inefficient way that). ipc sends data 1 process another. android app 1 process, although doesn't have (services placed process develop...

python 2.7 - Can festival tts's speed of speech be changed? -

i want festival tts read bit slower, can me that? use python 2.7 , run code in gnome-terminal. what ~/.festivalrc like? use festival alsa, have: (parameter.set 'audio_method 'audio_command) (parameter.set 'audio_command "aplay -dplug:default -f s16_le -r 15000 $file") using aplay, rate of playback determined value after -r flag, can increase make speak faster, or decrease make slower. if you're not using alsa, adding (parameter.set 'duration_strech 1.5) or similar may help.

jquery - asp textbox Placeholder and autocomplete doesnt work together in IE8 -

i have asp texbox , has placeholder , jquery autocomplete functionality. both working fine in chrome in ie8 placeholder not working. in order make work place watermark placeholder in jquery watermark displaying autocomplete not working. issue in ie8: <asp:textbox id="txtlocation" runat="server" cssclass="frmhometxtlocation" placeholder="locations" onblur="javascript:formatlocation();"></asp:textbox> $("#txtlocation") // don't navigate away field on tab when selecting item .bind("keydown", function (event) { if (event.keycode === $.ui.keycode.tab && $(this).autocomplete("instance").menu.active) { event.preventdefault(); } }) .autocomplete({ delay: 0, minlength: 1, source: function (request, response)...

javascript - How to make a button stick to the Angular Material Sidenav? -

with angular material sidenav trying achieve functionality similar 1 in this control sidenav has "sticky" button next controls state, changes shape based on , moves sidebar itself. there implementations/examples it?

html - How to keep image size correct in different resolutions, in Bootstrap? -

i working on website, in need create 4 columns of equal width. on top of columns, need place image. following code: <div class="row"> <div class="col-xs-1"></div> <div class="col-xs-10"> <div class="row" style="margin-bottom:30px;"> <div class="col-xs-3"> <div class="row" style="width:100%;height:auto;"> <img src="images/small/one.jpg" /> </div> <div class="row" style="height:200px;"> <div class="col-xs-12">first column title</div> </div> </div> <div class="col-xs-3"> <div class="row" style="width:100%;height:auto;"> <img src="images/small/tw...

mongodb - Query on 2 properties of the same embedded object in an array -

i have collection of objects : db.coll.find().pretty(); { "_id" : "1", "elements" : [ { "key" : "a", "value" : 10 }, { "key" : "b", "value" : 1 }, ] }, { "_id" : "2", "elements" : [ { "key" : "a", "value" : 1 }, { "key" : "c", "value" : 33 }, ] } i want find documents contain element "key" equal "a" , "value" greater 5. not sure if possible without using aggregation framework. without aggregation, using $elemmatch , query below : db.coll.find({"elements":{"$elemmatch":{"$and":[{"key":"a"},{"value":{"$gt":5}}]}}}).pretty() or if want use aggregation used following query aggregation db.coll.aggregate({"$unwind":"$el...

ios - Sinch: How do I set the SINCall variable in Swift? -

i'm having bit of confusion on how create sincall object. understand sincall type protocol, , in swift tried create such: var _call: sincall? when try call, app crashes because _call nil. however, if add sincall list of protocols next sincalldelegate, , sincallclientdelegate, error i'm not conforming sincall protocol. class callviewcontroller: uiviewcontroller, sincalldelegate, sincallclientdelegate { var username: string? { didset { } } var recepientuser: string? { didset { } } var _call: sincall? var appkey = "xxx" var appsecret = "xxx" var host = "xxx" var client: sinclient { return sinch.clientwithapplicationkey(appkey, applicationsecret: appsecret, environmenthost: host, userid: username!) } override func viewdidload() { super.viewdidload() print("lock , load") client.callclient().delegate = self client.setsupportcalling(t...

laravel - add to select box values from multiple model attribute -

i want dynamically set options select box model in laravel. want similar this: $handymans = handyman::lists('firstname', 'handyman_id'); but, add select box firstname's of handymans. how can add lastname option value, shown user? ( not firstname ). try this: $handymans = handyman::lists('firstname', 'lastname','handyman_id'); but doesnt work :( . you values through mutator in class, appending full_name attribute model, this: protected $appends = ['full_name']; ... public function getfullnameattribute() { return $this->firstname.' '.$this->lastname; } then try list it, calling way: $handymans = handyman::all()->lists('full_name', 'handyman_id');

e commerce - Hotcakes 1.10 - Password has been reset email is begin sent when using checkout as a guest -

we having issue on website. when customer checkouts guest, system sends email random generated password user. after trying follow guide @ https://hotcakescommerce.zendesk.com/hc/en-us/articles/209539786-replacing-the-user-account-creation-workflow-task customize behavior no emails sent, realized demo code not compile. functions seem missing (probably breaking changes in earlier versions). code not work inside loginnewuser(). private static void loginnewuser(ordertaskcontext context, customeraccount n) { string errormessage = string.empty; string userid = string.empty; useraccount useracc = null; hotcakes.commerce.dnn.dnnaccountservice.logindnnuser(n.username, n.password, context.hccapp.currentrequestcontext.routingcontext.httpcontext, out errormessage, out useracc); } the errors here : useraccount class not defined. logindnnuser method not defined. does know how fix these 2 errors? after that, custom workflow allow me not send emails. thanks try cha...

Retrieving values from MySQL using php -

here have made mysql has columns of "id","name","username","email",age" . made the php code retrieve data given id. eg:if user enter id=3 shows datas corresponding id. but want set multiple inputs user can type more 1 id , list corresponding datas of particular id. my php code: <?php if($_server['request_method']=='get'){ $id = $_get['id']; require_once('dbconnect.php'); $sql = "select * user id='".$id."'"; $r = mysqli_query($con,$sql); $result = array(); while($res = mysqli_fetch_array($r)){ array_push($result,array( "id"=>$res['id'], "name"=>$res['name'], "username"=>$res['username'], "email"=>$res['email'], "age"=>$res['age'] ) ); } echo json_en...

node.js - Node js javascript folder 404 not found -

i'm using express 4.10, nginx, ubuntu 16.04 lts , want create javascript folder in public folder. public/js/myfile.js i see lot of question on stackoverflow 404 on javascript file. then here html code: <script src="js/login.js" type="text/javascript"/> and in node.js file have : app.use(express.static(path.join(__dirname, '/public'))); here nginx node configuration upstream node { server 127.0.0.1:3000; keepalive 8; } location ~ ^/(node|socket\.io) { proxy_pass http://example.com:3000; proxy_http_version 1.1; proxy_set_header upgrade $http_upgrade; proxy_set_header connection 'upgrade'; proxy_set_header host $host; proxy_cache_bypass $http_upgrade; } thanks. the script source should /node/public/js/myfile.js , or else nginx not pass request express.

VS Code & Chrome Debugging extension - open new instance of Chrome? -

using vs code , chrome debugging extension launch open new instance of chrome if 1 not present, or open new tab if (but won't work debugging ports not open). upon close closes tabs. this real pita if i've got pages open want stay open (e.g. documentation). is there way open own instance of chrome if 1 open, , close instance on terminate? i.e. open own instance of chrome , leave existing instances alone. if specify userdatadir in launch.json , launch new instance of chrome you. also, unhelpfully, offer 'restore pages' everytime launches after first time unless specify runtimeargs , runtimeexecutable . here's sample launch.json : "configurations": [ { "name": "launch localhost", "type": "chrome", "request": "launch", "url": "http://localhost:3000", "webroot": "${workspaceroot}", "...

c++ - Missing dependences sybase -

i need compile project requires tdspp(who uses sybase), when compile , install source of tdspp(downloaded via git), it's ok, main project requires library, , when try compile, next errors: //usr/local/lib/libtds++.so: referencia `ct_results' sin definir //usr/local/lib/libtds++.so: referencia `ct_connect' sin definir //usr/local/lib/libtds++.so: referencia `ct_exit' sin definir //usr/local/lib/libtds++.so: referencia `cs_ctx_alloc' sin definir //usr/local/lib/libtds++.so: referencia `ct_init' sin definir //usr/local/lib/libtds++.so: referencia `cs_ctx_drop' sin definir //usr/local/lib/libtds++.so: referencia `ct_cancel' sin definir //usr/local/lib/libtds++.so: referencia `ct_cmd_drop' sin definir //usr/local/lib/libtds++.so: referencia `ct_con_props' sin definir //usr/local/lib/libtds++.so: referencia `ct_con_drop' sin definir //usr/local/lib/libtds++.so: referencia `ct_con_alloc' sin definir //usr/local/lib/libtds++.so: referencia...

xml - how to extract wsse BinarySecurityToken using PL/SQL -

how can extract binarysecuritytoken following soap payload using pl/sql ? <wsse:security xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/12/secext"> <wsse:binarysecuritytoken valuetype="string" encodingtype="wsse:base64binary">expectedtoken</wsse:binarysecuritytoken> </wsse:security> i expect extract " expectedtoken " result thanks you don't neex pl/sql; can use xquery in plain sql: select xmlquery('declare namespace wsse = "http://schemas.xmlsoap.org/ws/2002/12/secext"; (::) /wsse:security/wsse:binarysecuritytoken/text()' passing xmltype('<wsse:security xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/12/secext"> <wsse:binarysecuritytoken valuetype="string" encodingtype="wsse:base64binary">expectedtoken</wsse:binarysecuritytoken> </wsse:security>') returning content) dual; xmlquery('declarenamespacewsse...

dataframe - R - removing rows from data frame according to a column in another data frame -

this question has answer here: removing rows based on column in dataframe [duplicate] 1 answer i have 2 data frames, 1 called athletes.df , 1 called medals.df. both have column named athlete_id unique key. problem have rows appear on medals.df table not in athletes.df, in case need remove them medals.df. example of data: athletes.df athlete_id v1 v2 'ttt' 5 6 '45d' 4 5 'tjd 4 5 medals.df athlete_id v3 v4 'ttt' 2 4 '45d' 5 5 'tjd 4 5 'err' 6 7 if @ last row in medals.df has athlete_id of 'err' not appear in athletes.df,in case remove entire row.basicaly looking remove rows medals.df when thier athlete_id cannot found in ateletes.df table. know can done loop real data 30000 rows each data s...

Most Efficient Sorting Algorithm for Generated Data -

i have following formula: a=(x+x0)^.5 * (y+y0) * (z+z0)^.5 x0, y0, , z0 constant given run, may change between runs of program. x, y, , z randomly generated item , uniform integers in [0, 15]. means there 16^3=4096 possible combinations. i trying find efficient way percentile of given value (x0, y0, , z0 given well). have 2 questions: is there way create analytic formula solve percentile directly, without generating possible , sorting them? if not, efficient way sort data, given have information how structured? i kind of assumed answer #1 "no" pleasantly surprised if can come analytic solution. proceeding #2, here current progress: data generated via 3 nested loops: for x = 0 15 y = 0 15 z = 0 15 array(n) = a(x,y,z) n=n+1 next z next y next x we know (at least) 3 things data: array(0) < array(1) < array(2)... array(0) < array(16) < array(32) ... array(0) < array(256) < array(512)... so...

c# - Trouble loading the training dataset in LibSVMSharp -

if familiar libsvm ( https://www.csie.ntu.edu.tw/~cjlin/libsvm/ ), working libsvmsharp, same thing, in c# wrapper, believe. on github, give following example of how write simple classification, using svm: svmproblem problem = svmproblemhelper.load(@"dataset_path.txt"); svmproblem testproblem = svmproblemhelper.load(@"test_dataset_path.txt"); svmparameter parameter = new svmparameter(); parameter.type = svmtype.c_svc; parameter.kernel = svmkerneltype.rbf; parameter.c = 1; parameter.gamma = 1; svmmodel model = svm.train(problem, parameter); double target[] = new double[testproblem.length]; (int = 0; < testproblem.length; i++) target[i] = svm.predict(model, testproblem.x[i]); double accuracy = svmhelper.evaluateclassificationproblem(testproblem, target); that makes perfect sense, loading in training data path specified, , same test data...well, that's run problems. i wanted test out in c# ensure full understanding of how works, before implement...

parentheses - Can I use parenthesis to encapsulate information I want to convert into a string? (ruby) -

i want divide 2 integers , convert result string. have done putting division parentheses in attempt convert result of division string, instead of denominator. there don't seem errors way wanted double check proper syntax. note:@numer , @denom both integers. def redfrac gcd = @numer.gcd(@denom) if @denom != 0 rednumer = (@numer/gcd).to_s reddenom = (@denom/gcd).to_s if reddenom == "1" puts rednumer else puts rednumer + "/" + reddenom end else puts "cannot divide 0" end end > (1.0 / 4.0).to_s => "0.25"

html - After changing the default response from a required statement form doesn't behave normal -

so after made these changes form won't accept input. meaning if don't put in first name says 'please enter first name". works should. if put in name still says same thing. won't recognize put in name. happens in each field , have refresh page make work. ideas? <form action="register.php" method="post"> <p>first name: <input type="text" name="first_name" size="15" maxlength="20" required oninvalid="this.setcustomvalidity('please enter first name')"></input> </p> <p>last name: <input type="text" name="last_name" size="15" maxlength="40" required oninvalid="this.setcustomvalidity('please enter last name')"></input>></p> p>email address: <input type="text" name=...

java - How cloudant client can connect to shared database? -

i have used cloudant client connect database code as: public void setconfig(){ this.client=new cloudantclient(this.username, this.username, this.password); this.database=this.client.database(this.dbname, true); } it runs in own data in ibm cloudant. i want use cloudant client connect shared data. instance, other account named "user1" shared database "user1db" me full permission. when declare this.dbname="user1/user1db or this.dbname="shared/user1/user1db "; . doesn't work. so how can connect cloudant client shared database.

vb.net - Syntax error in INSERT INTO statement for Access 2010 -

my insert statement apparently has syntax error. please explain why might be? private sub register_click_1(byval sender system.object, byval e system.eventargs) handles register.click dim studentnum string dim password string dim firstname string dim lastname string dim yrandsec string studentnum = number.text() password = pass.text firstname = first.text lastname = last.text yrandsec = yrsec.text() sql = "insert accounts(studno,password,firstname,lastname,yrandsec) values ('" & studentnum & "', '" & password & "', '" & firstname & "', '" & lastname & "', '" & yrandsec & "')" - error here cmd = new oledbcommand(sql, con) con.open() objcmd = new oledbcommand(sql, con) if repass.text = pass.text = false re.text = "*password didn't match!" number.text...

Variables in a Javascript module visible outside of it? -

to start, i'm coming .net world, there static classes (c#, known modules in vb) , instance classes - can instantiate. this question javascript, i'm trying recreate pattern know , make module / static class. here code: var mymodule = { variable1: 0, variable2: 1, method1: function() { //code goes here }, method2: function() { //mode code goes here }, method3: function() { //and more prove pattern } } method1(); //error - no such method - ok, good, expect variable1 = 5; //silently assigns variable inside mymodule 5 ? please explain why methods declared inside namespace not visible, variables ? also, there way prevent variables being visible outside of mymodule , in same script ? i start trying address misconceptions - module plain javascript object initialised using literal. object not hide information - javascript not have private , public scope same way as, java does. furthermore, way access ...

javascript - Dim background when video is played -

i using html5 video element lot more now. i'd dim background of page when user presses play on video. when press pause or video ends, want screen turn off dim. i have div on page set display: none not visible on page when loads i'm not familiar enough javascript want. here div on page sets dim. <div id="overlay" style="display:none;position:fixed;width:100%;height:100%;top:0;left:0;opacity:0.6;"></div> video html <div class="col-md-6"> <div id="introright"> <video poster="img/whoweare.jpg" preload="auto" controls> <source src="video/whoweare_hi.mp4" type='video/mp4; codecs="avc1.42e01e, mp4a.40.2"'> <source src="video/whoweare_hi.ogv" type='video/ogg; codecs="theora, vorbis"'> <source src="video/whoweare_hi.webm" type='video/webm; codecs="vp8, vorbis...

how to make slidebar in react native? -

Image
im trying make music app react-native. , i'm trying make sound volume slide bar. , not find code source how make one. great if 1 know how make one. wanna make similar attached image in below. the component looking called slider in react native. provided react-native library. can import , start using this: import { slider } 'react-native'

xcode7 - Xcode: code coverage percentage -

Image
any of knows how can percentage of code coverage in xcode?. right see bars: i'll appreciate help. unfortunately, code coverage overview in xcode bad. if not use xcode server test projects way obtain percentage mouse on each bar. if use xcode server see percentage every device type in table.

Concatenating at the end of a string - Python -

i have file looks this: atom coordinatex coordinatey coordinatez atom coordinatex coordinatey coordinatez ... i'm trying add atom number (starting 0) file this: atom0 coordinatex coordinatey coordinatez atom1 coordinatex coordinatey coordinatez ... here's code , problem: readfile = open("coordinates.txt", 'r') writefile = open("coordinatesformatted.txt", 'w') index = 1 counter = 0 linetoread in readfile: linetoread = linetoread.lstrip() if index % 2 == 0: counter = counter + 1 linetoread+=str(counter) writefile.write(linetoread) index = index+1 readfile.close() writefile.close() f = open('coordinatesformatted.txt','r') temp = f.read() f.close() f = open('coordinatesformatted.txt', 'w') f.write("0") f.write(temp) f.close() instead of having desired output after run code this: 0atom coordinatex coordinatey coordinatez 1atom coordinatex coordinatey c...

Dockerized MongoDB on Heroku? -

i'm not sure if right stackexchange asking this, i'm in process of setting mean stack application , want right get-go. i use docker , heroku (due new pipelining groups , ease of deployment sole developer), can't find guides on how run mongodb docker image on heroku. is possible? don't understand how can put database binary image (docker image) anyways, yet every guide i've read says separate micro-services. has else done this? thanks. edit: or better idea leave mongo undockerized , use mongolabs , have 2 separate instances dev/prod databases? there official mongodb docker image can use. need make sure have docker installed on heroku. if concerned data persistance can mount host directories container have physical access data. if worried accebility can expose ports inside comtainer host can connect it. having database in container makes able worried on db configuration , not ehole stack . when goes down know look.

MongoDB: Cannot refer to field with a space -

i have mongodb collection ph_location , , 1 document in it: > db.ph_location.findone({}) { "_id" : objectid("579662fec773d83e625f71e8"), "postal code" : 2800, "town" : "bangued", "province" : "abra", "metro" : "" } i having trouble referring field "postal code" . find , update operations use field cannot locate it. instance: > db.ph_location.findone({},{"postal code":1}) { "_id" : objectid("579662fec773d83e625f71e8") } and > db.ph_location.updatemany({}, {$rename:{"postal code":"zip_code"}}) { "acknowledged" : true, "matchedcount" : 2271, "modifiedcount" : 0 } any ideas problem be? i'll bet non-breaking space , not regular space. try this: db.ph_location.find({"postal\u00a0code" : 2800}) you can debug characters in keys using this: f...

html - CSS Padding is overflowing parent -

Image
i'm trying make horizontal navbar, , i've got sitting @ top of page each of 3 list items filling third of space, on part. the issue when try make anchor tag (which within list item) fill of list item's space. set display: block; , takes full width, can't fill vertical space how want to. can use height: 100% , fill space, if way anchor tag's text rests @ top of list item's space, want vertically centred. top , bottom padding came mind this, tried setting padding: 100%; . when happened, no longer see text of anchor tag. dragging space mouse looks tag taking more space in list item. this image of nav bar height: 100%; : note: red lines surrounding each section borders set visible view boundaries the relevant html code follows: <ul class="main_nav"> <li><a href="#">home</a></li> <li><a href="#">test page</a></li> <li><a href="#">test pa...

javascript - How to sort values in my json object -

i sort "years" in yearobject of type object menu starts 2016 instead of 2013. please help. example of code provided here. my html: <form name="myform" id="myform"> <select name="optone" id="yearsel" size="1"> <option value="" selected="selected">select year</option> </select> <br> <br> <select name="opttwo" id="statesel" size="1"> <option value="" selected="selected">please select year first</option> </select> <br> <br> <select name="optthree" id="citysel" size="1" citysel.onchange = function();> <option value="" selected="selected">please select state first...

c# - HTTP WCF Service, JSON date formatting issue returning IEnumerable<class> -

i have restful wcf http service returns json , works great, except datetime doesn't format correctly: e.g. "adjuddate": " /date(1349409600000-0400)/ " after looking around found old post here not code work. last updated in 2011. there maybe more current version or implementation? json.net serializer wcf rest services here's code returns ienumerable. //all json values except dates: private ienumerable<customer> processwcfpost(customer searchmodel) { return _repository.getcustomers(searchmodel); } edit i've of course tried changing return type string instead of ienumerable as: private string processwcfpost(customer searchmodel) { var result = _repository.getcustomers(searchmodel); return newtonsoft.json.jsonconvert.serializeobject(result); } but json not quite right: [{\"claimprocessid\":1599986,\"clmhdrid\":1011,\"clmlineid\":1011,\"clmadjid\":1011,\"receiv...

javascript - Html, CSS - How to create a donut chart like this? -

Image
i want donut chart this. how create it? not sure what's correct process this. thank much. refer link http://www.highcharts.com/demo/gauge-activity has tons of free charts, , little animation site dynamic. , provide nice feature edit in jsfiddle , test out before incorporate. 3d donut chart http://www.highcharts.com/demo/3d-pie-donut

treemap highcharts group by -

i have designed treemap using highcharts custom algorithm.it has drilldown 1 level. there drop down chart , has 2 options selection. treemap displayed on basis of dropdown selection has group feature implemented using underscore.js library. feature working fine. problem is, tiles grouped together, placed next each other. requirement : want tiles packed in 1 big tile 1 label. header title in d3(exactly same). please let me know how go it. treemap within treemap? wanted know if feasible have different labels , tooltips parent , children in same treemap. leads helpful. actual image

java - Hackerearth Remove Friends: Runtime Error - NZEC -

i stuck on problem. code passes testcases given in example there error in code. kindly point out error. problem statement ( https://www.hackerearth.com/problem/algorithm/remove-friends-5 ) after getting phd, christie has become celebrity @ university, , facebook profile full of friend requests. being nice girl is, christie has accepted requests. now kuldeep jealous of attention getting other guys, asks delete of guys friend list. avoid 'scene', christie decides remove friends friend list, since knows popularity of each of friend has, uses following algorithm delete friend. algorithm delete(friend): deletefriend=false = 1 friend.length-1 if (friend[i].popularity < friend[i+1].popularity) delete th friend deletefriend=true break if(deletefriend == false) delete last friend input: first line contains t number of test cases. first line of each test case contains n, number of friends christie has , k ,the number of friends ...