Posts

Showing posts from July, 2011

python - Pandas: replace empty cell to 0 when write to file -

i have df , there empty cells. want write excel , need print there 0 instead empty. try result.fillna(0) , result.replace(r'\s+', np.nan, regex=true) doesn't help. you creating copy of dataframe original 1 not keeping changes, need specify "inplace=true" if want dataframe persist changes result.fillna(0, inplace=true)

android - Is possible to set firebase custom properties analytics as array? -

i'm planning use firebase analytics apps. according firebase docs possible set custom user properties docs here android , ios . latter 1 can use properties create audiences in firebase analytics dashboard described here analytics dashboard i want use user custom property array. for example: setting user property tagsuserlikes =[" hashtagblue "," hashtagred "," hashtaggreen "] latter 1 i'll able track audience of users follow particular tag, meaning users contain tag in array. so latter in analytics dashboard audience defined solely tagsuserlikes=" hastagblue " match users contain tag [" hashtagblue "," hashtagred "," hashtaggreen "] , [" hashtagblue "," hashtagdogs "],? is supported in google analytics dashboard (create audience)? supported in google big query? if yes how can achieve this? tks although theoretically concatenate list of tags in 1 user property ...

fine uploader - How to set content-length-range in FineUploader S3? -

when content-length-range set validation, results in files greater size not being able added uploader @ all: validation: { sizelimit: 1048576 }, how can set content-length-range without other bells/whistles? the simplest solution leave validation.sizelimit option alone in case , set properly formatted content-length-range parameter via request.params option . fine uploader s3 include these params in policy document (if policy document used). option maintain 2 separate fine uploader instances. 1 instance accepts files user w/out validation . instance used scale images, passed "main" fine uploader s3 instance via addfiles api method . "main" instance has validation set.

android - GPS location only onClick button -

i've got problem. need 1 information location. want click on button, location , stop gps. in case gives me informations location every 5 seconds. it's possible make work, how want it? because want save data start of road in sqlite database. need 1 information location. first idea, or simple thing can do, making time interval larger 5 seconds, 5 000 000 seconds. it's not best solution think. :) this code button.setonclicklistener(new view.onclicklistener() { public void onclick(view v) { intent dbmanager = new intent(mainactivity.this, androiddatabasemanager.class); startactivity(dbmanager); } }); loclist = new locationlistener() { @override public void onlocationchanged(location location) { gps1.append("\n " + location.getlatitude() + " " + location.getlongitude()); } @override public void onstatuschanged(string provider, int status, bu...

mysql - Get everything from table, but if network_id is 9, only take 2 of them -

1st select b.*, network_9.*, c.id click `banners` b, ( select id `banners` b left join `clicks` c on b.id = c.banner_id , c.user_id = 1 b.`network_id` = 9 , b.`status` = 1 , b.`type` in(1, 2) , c.`id` null limit 2 ) network_9 left join `clicks` c on b.id = c.banner_id , c.user_id = 1 b.`network_id` not in(network_0) , b.`status` = 1 , b.`type` in(1, 2) , c.`id` null limit 0, 10 2nd select b.*, c.id click `banners` b left join `clicks` c on b.id = c.banner_id , c.user_id = 1 b.`status` = 1 , b.`type` in(1, 2) , c.id null limit 0, 10 i'm trying rows banners, if network_id 9, take 2 of them, , still others. the 1st attempt somethin tried, failed. and 2nd basic sql, takes rows, doesn't check on network_id my first , realy simple aproche is: select rows banner network_id not equal 9 select select rows banner network_id equal 9 , limit them 2 s...

ssh - sshd_config all parameters commented out -

i've inherited administration of server (and not admin) , unfortunately there ton of things i've never been exposed to. all of parameters in sshd_config commented out. ssh working fine however. mean default configuration being used? reason previous admin may have done this? yes, means default configuration being used. there no particular reason, can connected blank sshd_config. may previous admin debugging sshd issues.

css - Part of footer is getting hidden -

Image
i working on developing site company. stuck on 1 issue layout not working correctly. footer @ bottom partially being covered. have added z-index , changed nothing. have played margins , paddings no avail. can see causing partially covered. here image showing see: and website here: http://clubschoicemagic.com/ #slide03.slide .footer-container { background-color: #06060d; color: rgba(255, 255, 255, 0.5); font-size: 14px; margin-bottom: 0; text-align: center; } #slide03.slide .footer-container .wrapper { background-color: #06060d; bottom: 0; color: #ffffff; left: 0; margin: 0 auto -20px; padding-top: 5px; position: absolute; text-align: center; text-shadow: none; top: auto; transform: none; width: 100%; } <div class="footer-container"> <footer class="wrapper"> <img src="http://clubschoicefundraising.com/content/img/logo.png" class="center-block" width=...

assembly - AArch64 relocation prefixes -

i noticed gnu asm relocation syntax arm 64-bit assembly. pieces #:abs_g0_nc: , :pg_hi21: ? explained? there pattern them or made on go? can learn more? introduction elf64 defines 2 types of relocation entries, called rel , rela : typedef struct { elf64_addr r_offset; /* address of reference */ elf64_xword r_info; /* symbol index , type of relocation */ } elf64_rel; typedef struct { elf64_addr r_offset; /* address of reference */ elf64_xword r_info; /* symbol index , type of relocation */ elf64_sxword r_addend; /* constant part of expression */ } elf64_rela; the scope of each relocation entry give loader (static or dynamic) 4 pieces of information: the virtual address or offset of instruction patch. given r_offset . the runtime address of symbol accessed. given higher part of r_info . a custom value called addend value, eventually, operand in expression used calculate value written patch instruction. rela entries have v...

android - Reloading the Main Activity : Navigation Stops working -

in main activity want reload activity want app reload since user logging in. dont know if thats idea when validating user credentials , calling these lines of code in main activity. var viewgroup = (viewgroup) ((viewgroup)findviewbyid(android.resource.id.content)).getchildat(0); viewgroup.removeallviews(); finish(); startactivity(intent); what happens screen flashes , activity loaded again scratch(that doesnt not mature). problem app works fine navigation stops working when call showviewmodel(someviewmodel); i know doing wrong, or may not following best practise here. intent reload application setting flags , load users profile making user feel if user logged in. version: 4.1.4 platform: xamarin android your navigation breaks because you're trying handle navigation on own instead of letting mvvmcross you. as can see in default android presenter , method receives intent not public. when call showviewmodel , instance of imvxandroidviewmodelrequesttra...

vba - Split file in excel for avoiding row limit -

i have .all file exceeds limit of 1048576 rows imposed excel. im using code: sub open() book1 = activeworkbook.name file1 = application.getopenfilename("all files (*.all), *.all") worksheets("res").range("k1").value = file1 workbooks.opentext file1, origin:=xlwindows, startrow:=1, datatype:=xltextformat del = activeworkbook.name activesheet.copy before:=workbooks(book1).sheets(1) workbooks(del).close false sheets(1).activate activesheet.name = "acti" end sub but code doesent work long files because limit. idea copy original .all file, split copy in files limited 1048576 rows, copy each of splited files in individual sheet , revome copies. im pretty new in vba...any write code? thank much. you can split file separate parts using code below. public sub split_wb() dim integer, arr variant, wb variant, ws_source worksheet set ws_source = activesheet = 1 5 arr = ws_source.range("a" & * 1000 - 999 & ...

ios - AVAudioSession disable Background Audio at runtime -

i using ios background capabilities <key>uibackgroundmodes</key> <array> <string>audio</string> </array> i want users able change value @ runtime. possible change value @ runtime or need add logic stop audio in applicationdidenterbackground method? the settings describing left aside app , cannot changed @ runtime. correct way add logic describe.

ssl - How to use http.Get in a TLSClient in Go? -

hi want perform request in go after creating tlsclient, example: client, err := docker.newtlsclient(sconf.dockconf.endpoint, sconf.dockconf.cert, sconf.dockconf.key, sconf.dockconf.ca) then how can perform request in go? not sure package using http package has newrequest function req, _ := http.newrequest("get", url, nil) client.do(req) --edit in addition, here full working tls example client certificates (i did not create gist) https://gist.github.com/michaljemala/d6f4e01c4834bf47a9c4

database - MySQL syntax checking if parameter is null -

i looking way execute mysql statement checking if given parameter exists. remember can following in oracle achieve that: select s.* site s s.study = :study , (:enabled null or s.enabled = :enabled) is possible in mysql too? same code executes without error never return records. my goal here avoid multiple lfs , elses in java code. should work way query looks when enabled parameter null: select s.* site s s.study = :study and if parameter not null: select s.* site s s.study = :study , s.enabled = :enabled and want single query i believe asking: select s.* site s s.study = "some_study" , (s.enabled null or s.enabled = '' or s.enabled = "enabled");

Sharepoint 2013 workflow update all items in dictionary -

is possible build dictionary, , perform actual action (such set field value) on every item in dictionary? the objective - have list lets say"test list" (for simplicity let's has 4 columns) , running workflow on item 1 example "test list" now when cost field updated on item id 1, lookup cost change items id 3 & 5, calculated fields in 3 & 5 not update until items modified in way. solution far - have done create string variable "domain/site/_api/web/lists('test list')/items?$filter=lookup on id eq '([%currentitem:id)' to create call "domain/site/_api/web/lists('test list')/items?$filter=lookup on id eq '1' which when count returns 2 items. build dictionary these 2 items the problem - have seen many posts showing how can iterate through dictionary values out of it, , log them in variable can use in log history or send email. want items in dictionary such set 5th column "say date modified...

powershell - How to invoke bunch of git commands from the remote location without going to that location -

i want invoke git commands in tfs post build script push artifact aws code commit. need invoke git commands form artifact location. how it, can't cd. check below commands , created 1 powershell script contains these commands , when invoking script manually going inside folder. it's running fine. if invoke tfs build. looks invoking command somewhere else. please help... git init git clone https://git-codecommit.us-east-1.amazonaws.com/v1/repos/mv git remote add origin https://git-codecommit.us-east-1.amazonaws.com/v1/repos/mv git checkout -b mvtest git add mv.txt git commit -m "first commit" git push origin mvtest i use invoke-command, below should work assuming git installed , integrated powershell. invoke-command -computername remotecomputer -scriptblock ` {set-location c:\;git init;git;git clone https://git-codecommit.us-east-1.amazonaws.com/v1/repos/mv} use ';' separate each command.

javascript - SignalR Variables are being Reset -

with signalr program had client call server side method. global variables weren't working correctly did quick little test , figured out global variables seemed reset every single time, wondering doing wrong , if keep variables being reset. javascript method: $.connection.hub.start().done(function () { $('#send').click(function () { chat.server.send(0, document.getelementbyid("name").value, document.getelementbyid("content").value);//send calls broadcastarray }); }); hub method: int = 0; public void broadcastarray() { var hubcontext = globalhost.connectionmanager.gethubcontext<chathub>(); hubcontext.clients.all.broadcastarray(messagearr); = + 1; } no matter how many times called method i returned 1, how can stop variables being reset? there way in hub class or store variables in different class? i'm not quite sure how go this. the first...

android - Switch findViewById returns null -

i trying 2 days solve problem. made fragment in made switch enable , disable bluetooth. in main activity wrote: bluetoothswitch = (switch) findviewbyid(r.id.bluetooth_switch); bluetoothswitch.setonclicklistener(clicked); where clicked: clicked = new buttonclicked(); and: class buttonclicked implements adapterview.onclicklistener { @override public void onclick(view view) { switch (view.getid()) { case r.id.bluetooth_switch: if (bluetoothadapter.isenabled()){ bluetoothadapter.disable(); log.d("log", "bluetooth disabled"); } else{ bluetoothadapter.enable(); log.d("log", "bluetooth enabled"); } break; case r.id.buttonsearch: arraylistbluetoothdevices.clear(); startsearching(); break; ...

c# - Access App key data from class libraries in .NET Core / ASP.NET Core -

to access app keys in class library, need following code in every class library , class need access appkey? public static iconfigurationroot configuration = new configurationbuilder().addjsonfile("appsettings.json").build(); this found in microsoft docs , looks redundant. startup class in project below public class startup { public iconfigurationroot configuration { get; set; } public startup() { var builder = new configurationbuilder() .addjsonfile("appsettings.json"); configuration = builder.build(); } public void configureservices(iservicecollection services) { services.addentityframework().addentityframeworksqlserver() .adddbcontext<dbcontext>(options => options.usesqlserver(configuration["data:mydb:connectionstring"])); } } then how should inject " iconfigurationroot ...

python - Redefining indexing in N-dimensional arrays -

so have n-dimensional array of values, let's call a. now, can plot in contour map, coordinate axes x , y, using plt.contourf(x,y,a) now, have carry out mapping of these points plane, so, set of coordinates. let transformation be x - x1 y - x1 now, each point magnitude "i" in matrix @ (x,y) @ (x- x1, y - y1). can plot using plt.contourf(x-x1, y-y1,a) my question is, how index array such obtain array b indexing corresponds x-x1 , y-y1 instead of x , y can plot directly using following plt.contourf(x,y,b) thanks!

php - Yii - 1 form 2 models in one view -

i have maintenance controller attributes of students , instructor , make in 1 view values comes student , instructor model not save. model : student public function tablename() { return 'student'; } /** * @return array validation rules model attributes. */ public function rules() { // note: should define rules attributes // receive user inputs. return array( array('studentid', 'required'), array('studentid', 'unique'), array('studentid, year, cellphonenumber', 'numerical', 'integeronly'=>true), array('lastname, firstname, middlename, course, email', 'length', 'max'=>32), // following rule used search(). // @todo please remove attributes should not searched. array('studentid, lastname, firstname, middlename, course, year, cellphonenumber, email', 'safe', 'on'=>'search'), );...

Android Service is not running in ASUS Mobile -

Image
i working on app working background service. service in running on other device not running on asus z008d. disable asus mobile manager did not work. device company: asus mobile device model: asus z008d in asus there pre-installed app called asus mobile manager. option in app "auto start manager" prevent apps running in background. have give permission app running in background there.

sql - Issue With Pulling Remote XML Data into Oracle Database -

in oracle database, reading xml restful web service looks this: <ns1:parent xmlns:ns1="http://www.example.com/xml" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xs1:schemalocation= "http://www.example.com/xml http://www.w3.org/2001/xmlschema-instance"> <ns1:child> <ns1:options></ns1:options> <ns1:variables></ns1:variables> <ns1:values> <ns1:value qualifiers="x" date="sometime">value1</ns1:value> <ns1:value qualifiers="x" date="someothertime">value2</ns1:value> ... <ns1:value qualifiers="x" date="some100thtime">value100</ns1:value> </ns1:values> </ns1:child> i trying take data , extract database using code below. however, when creates 1 record sysdate field , other 2 values blank. attempted xmltable, had same result. i...

algorithm - How do I find all points of an isosceles triangle given the vertex point, base midpoint, and base width? -

Image
i'm trying make properly-rotated isosceles triangle. have following data: the (x, y) coordinates of vertex point, a the (x, y) coordinates of midpoint of base, a m the width of base, a and need find coordinates of other 2 points, b , c . what algorithm finding these last 2 points above information? searching google got me lot of equations assume it's pointed directly up, need these placed before transformation performed. to find b , c : find normalized direction vector a_ma = (a - a_m)/|a - a_m| find vector orthogonal vector a_ma – let's call a_ma' a_ma' = (-a_ma.y, a_ma.x) to find b , step width/2 units in direction of a_ma' , add a_m : b = (width/2)*a_ma' + a_m to find c , step -width/2 units in direction of a_ma' , add a_m : c = (-width/2)*a_ma' + a_m jsfiddle example: https://jsfiddle.net/asq7h2jd/

sql - SSIS - Send Mail Task - Attache multiple newly generated Log files -

i executing ssis package batch file execution. @ end generate multiple predefined named log files. want attache log files in send mail task. log files located e.g. (d:\folder1\folder2\folder3\abc.log) , (d:\folder 1\folder 2\folder 3\xyz.log). i using following expression in send mail task file attachment. "d:\folder 1\folder 2\folder 3\*.log" doesn't recognize log file. (there "2 slashes" in entire path) please me attach log files. try creating 2 variables. vpath = d:\folder 1\folder 2\folder 3\ vlogfilemask = *.log , add these 2 variables in expressions vpath + vlogfilemask.

What is difference between spend and social_spend in Facebook Ads API? -

Image
working facebook marketing api - https://developers.facebook.com/docs/marketing-api/insights/fields/v2.7 what difference between spend , social_spend? i assume spend total, , social spend out subset of spend. have search, , read , googled , can't find straight answer. you correct in social_spend subset of 'spend'. 'spend' total have spent on object you're querying. social_spend subset of budget went towards stories due people liking/commenting/sharing on object. example, may have seen video on news feed showed because 1 of friends liked it. social_spend owner of video increase.

java - Jenkins thinks failing junit test is passing -

one stage in jenkins pipeline runs mvn verify . test phase broken 2 execution stages, , in second stage, 1 of junit tests first stage re-run different parameters. works locally maven. when jenkins runs same configs, seems ignore repeated test in second phase. if test fails, jenkins reports tests pass, though in jenkins console logs can see test did fail. is there jenkins-friendly way of re-running same test in 2 different execution stages? my maven pom.xml file contains: <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-surefire-plugin</artifactid> <executions> <execution> <id>default-test</id> <goals> <goal>test</goal> </goals> <configuration> <!-- configs --> </configuration> </execution> <execution> <id>another-test</id> <goals> <goal>te...

javascript - Visual glitch in a three.js animation -

Image
i coding animation using three.js (r76) and, while works fine on computer, friend got visual glitch when running it. object leaves trace upon rotation, can seen in screenshot: here mwe, able reproduce bug. var camera, scene, group, renderer, container, stats; var width = 450; var height = 400; var mouse = new three.vector2(-1, -1); var clic = false; var mouseglob = new three.vector2(); var raycaster = new three.raycaster(); var pause = false; var inters = 0; function init() { scene = new three.scene() camera = new three.orthographiccamera(-width/2, width/2, -height/2, height/2, 1, 1000); camera.position.z = 300; scene.add(camera); atomradius = 50; var segments = 15, rings = 15, bondlength = 2*atomradius*1.5 bondradius = 10, atompos = bondlength/math.sqrt(3); var atom = new three.spheregeometry(atomradius, segments, rings); var material = new three.meshbasicmaterial({color:0x6f919a...

kotlin - With Kodein dependency injection, I don't want to pass around kodein instances everywhere -

using kodein, find have pass kodein instances around or inject them modules , classes. have classes disconnected want them able discover "one true kodein". since server side app, , have 1 kodein scope should easy. can create global object, such as: val kodeinglobal: kodein = kodein { ... } but doesn't work when of modules re-used across different projects , cannot share 1 instance. maybe separate module hold global work, need var , i'd prefer not changeable. can kodein find main, top-level or global scope on own? note: this question intentionally written , answered author ( self-answered questions ), idiomatic answers commonly asked kotlin/kodein topics present in so. in kodein 3.x there new module available called kodein-conf . allows create modifiable instance of kodein (as long modify before first injection done), , contains kodein global instance shared use if desired instead. contrary normal kodein instance must have bindings defi...

.net - Pass Objects from a controller to a view MVC -

this question has answer here: viewmodels or viewbag? 2 answers i started in new job, must create app using mvc 5, have no experience in .net not sure if using best practice. i have 2 models classrom , students, public class student { public int id { get; set; } public string name { get; set; } public int age { get; set; } } public class classrom { public int id { get; set; } public string name { get; set; } } i passing icollection<> controller views using viewbag ilist<classrom> classes = db.classes.tolist(); ilist<student> students = db.students.tolist(); viewbag.classes = classes; viewbag.students = students; return view(); and using data in view <div> @foreach (var student in viewbag.students) { <div>@student.name</div> <div>@student.age</div> } it works pretty need, a...

database - How to get Contacts in a Table in Android using SQLite? -

i want contacts stored on phone table created in sqlite db. columns show different fields e.g name, phone number, email etc , each row shows different contact. how achieve this? use androids content provider contacts data cursor , iterate cursor rows , save data sqlite first add permission:- <uses-permission android:name="android.permission.read_contacts" > </uses-permission> then in java class:- cursor phones = getcontentresolver().query(contactscontract.commondatakinds.phone.content_uri, null,null,null, null); while (phones.movetonext()) { string name=phones.getstring(phones.getcolumnindex(contactscontract.commondatakinds.phone.display_name)); string phonenumber = phones.getstring(phones.getcolumnindex(contactscontract.commondatakinds.phone.number)); } phones.close(); in while loop add sqlite data base

Do we still store program data in C:\ProgramData or in C:\Users\user1\AppData in Windows 10? -

first explain problem. updating software fit needs windows 10 users. using c:\programdata store product databases , product pricing databases. each quarter release new version of software has updated product pricing databases , maybe new and/or edited product database user installs. should data continue stored in programdata or should switch store in c:\users\user1\appdata ? i have been looking through questions between difference between program data , appdata. stackoverflow question data user downloading software isn't customized appdata doesn't seem correct place verified. thank in advanced.

C++ character concatenation with std::string behavior. Please explain this -

here cases c++ std::string couldn't understand. 1. string ans = ""+'a'; cout << ans << endl; //prints _string::copy 2. string ans=""; ans=ans+'a'; cout << ans << endl; //prints 3. string ans=""; ans = ans + (5 + '0'); // throws error 4. string ans=""; ans += (5 + '0'); //works 5. in code, had line ans += to_string(q); q single digit integer. program threw runtime error. changed ans+= (q+'0'); , error got removed. please clearing idea. string ans = ""+'a'; "" address of empty string literal. 'a' gets interpreted integer, ascii code 65. adds 65 address of literal string, results in undefined behavior, possibly crash. ans=ans+'a'; ans std::string . std::string defines overloaded + operator. several, actually. 1 of them, in particular, overloads + parameter character, , appends character...

java - Spring MVC - Page Not Found -

so here's project : webconfig.java : @enablewebmvc @configuration public class webconfig extends webmvcconfigureradapter{ @override public void addviewcontrollers(viewcontrollerregistry registry) { registry.addviewcontroller("/").setviewname("index"); } public internalresourceviewresolver internalresourceviewresolver() { internalresourceviewresolver resolver = new internalresourceviewresolver(); //strings views //success controller -* prefix/success/suffix //success controller -* /web-inf/pages/success.jsp resolver.setprefix("/web-inf/pages/"); resolver.setsuffix(".jsp"); return resolver; } } appinitializer.java : public class webappinitializer implements webapplicationinitializer{ public void onstartup(servletcontext container) throws servletexception { annotationconfigwebapplicationcontext rootcontext = new annotationconfigwebapplicationcontext(); rootcontext.register(webconfi...

mysql - Rails: simple_form that fills multiple, connected tables -

i have 4 mysql tables should filled @ same time click on simple_form button. in form there input fields existing columns tables. domain table has no id other tables below, others have domain_id in tables. here dependencies: class domain < activerecord::base has_many :whitelists has_many :blacklists has_many :product_infos end class whitelist < activerecord::base belongs_to :domain end class blacklists < activerecord::base belongs_to :domain end class productinfo < activerecord::base belongs_to :domain end my simple_form stored in view of domain. <%= simple_form_for @domain |f| %> <%= f.input :name, placeholder: 'example shop' %> <%= f.input :domain, placeholder: 'http://www.example.com' %> <h3><b>whitelist</b></h3> <%= f.input :url_start, as: :text %> <%= f.input :url_end, as: :text %><br> <h3><b>blacklist</b></h3...

BroadcastReceiver register and unregister not working in Android -

i use broadcastreceiver , register , works when press button , app show force close , in ondestroy() unregister it, have problem here code @suppresslint("newapi") @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { view v = inflater.inflate(r.layout.fragment_three, container, false); net = new networkreceiver(); mswiperefreshlayout = (swiperefreshlayout) v.findviewbyid(r.id.activity_main_swipe_refresh_layout); list = (listview) v.findviewbyid(r.id.list1); try { intentfilter filter = new intentfilter(); filter.addaction(action); //filter.addaction(action2); getactivity().registerreceiver(net, filter); } catch (nullpointerexception e){ log.d(tag, "" + e); }} @override public void ondestroy() { try { if (net!=null) { getactivity().unregisterreceiver(net); net = null; ...

html - Bootstrap pushing image gallery content below the body -

hey i'm trying setup simple gallery using bootstrap — layed gallery out in rows unordered lists. rows start pushed below fold of body. two things i'm curious about: 1. how can keep gallery items (the list items) in same row, while using bootstrap column conventions. 2. what's wrong current html layout — why push content below fold , not keep them within body. here pen check out here code ... html, body { width: 100%; height: 100%; min-height: 560px; } body { position: relative; background-color: #fff; -webkit-font-smoothing: antialiased; line-height: 1.4; font-size: 100%; } header { width: 100%; z-index: 10; background: #212121; padding: 40px 0 21px 0; .wrapper { overflow: visible; height: 40px; width: 940px; margin: 0 auto; { color: #fff; text-decoration: none; } #logo { ...

Python pandas - remove group based on collective NaN count -

i have dataset based on different weather stations several variables (temperature, pressure, etc.), stationid | time | temperature | pressure |... ----------+------+-------------+----------+ 123 | 1 | 30 | 1010.5 | 123 | 2 | 31 | 1009.0 | 202 | 1 | 24 | nan | 202 | 2 | 24.3 | nan | 202 | 3 | nan | 1000.3 | ... and remove 'stationid' groups, have more number of nans (taking account variables in count). if try, df.loc[df.groupby('station')['temperature'].filter(lambda x: len(x[pd.isnull(x)] ) < 30).index] it works, shown here: python pandas - remove groups based on nan count threshold but above example takes account 'temperature' only. so, how can take account collective sum of nans of available variables? i.e.: remove group, collective sum of nans in [variable1, variable2, variable3,...] less threshold. this should work: df...

android - ActiveAndroid and Gradle Wrapper -

i know confusing have read on multiple posts how rectify error having. hope. when try run first activity, error due me using active android library: java.lang.string com.activeandroid.tableinfo.gettablename() i have read online due me using higher version of gradle.(classpath 'com.android.tools.build:gradle:2.1.2') , people have had success version 1.5.0. here issue, must put in gradle properties file downgradle level of gradle not sure , have had errors while trying this?

r - devtools::build and devtools::check bottleneck - Cannot bundle package -

hopefully can me understand process causing bottleneck. i'm building r package using packrat (i don't believe packrat issue, i've run problem since installing it). when try build source package, far. have rtools installed , devtools::find_rtools returns true . have same problem when use devtools::check . ==> devtools::build() "c:/progra~1/r/r-33~1.0/bin/x64/r" --no-site-file --no-environ --no-save \ --no-restore --quiet cmd build "c:\my\working\directory" \ --no-resave-data --no-manual * checking file 'c:\my\working\directory/description' ... ok then stops anywhere 15-20 minutes before continuing with: warning in file.copy(pkgname, tdir, recursive = true) : problem copying .\my_pkg\.rproj.user\b8520658\sdb\s-10b6532e\lock_file c:\users\me\appdata\local\temp\rtmp6jzytz\rbuild2edc10811bab\my_pkg error copying build directory failed my .rbuildignore file looks this: ^.*\.rproj$ ^\.rproj\.user$ ^readme\.rmd$ ^read...

python - Pandas resample to return just one column after an apply as been made -

def wk(args): return args['open'].mean() - args['close'].mean() df = pd.dataframe() df = data.resample("2b").apply(wk) i run following code on below dataframe: open high low close volume date 2016-01-04 860.0 868.0 849.0 856.0 314041.0 2016-01-05 867.5 870.0 844.0 853.5 292475.0 2016-01-06 863.0 863.0 844.0 861.0 312689.0 2016-01-07 872.0 901.0 871.5 899.5 870578.0 which returns: open high low close volume date 2016-01-04 9.00 9.00 9.00 9.00 9.00 2016-01-06 -12.75 -12.75 -12.75 -12.75 -12.75 it's dubious have fives columns same data. how can make resample , apply return 1 column? so may write df['one column'] = data.resample("2b").apply(wk) instead of df = data.resample("2b").apply(wk) row-wise apply , resampler dispatch use row-wise...