Posts

Showing posts from April, 2015

Setting primary color for Android Wear app -

i creating android wear app , trying set it's primary color. create , set theme same way mobile app. every attribute changed correctly except primary color. default teal color android uses. using same theme on companion app , works there. there missing done differently in wear? there override setting? i have tried changing parent theme material or compact.app. android manifest: <application android:name="com.turndapage.navmedia.app" android:allowbackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:theme="@style/theme.nav"> styles.xml <resources> <style name="theme.nav" parent="@android:style/theme.devicedefault"> <!-- app branding color app bar --> <item name="colorprimary">@color/primary</item> <!-- darker variant status bar , contextual app bars --> <item name="c

css - How to set onsenui popover max width and max height -

i'm using onsenui2 (in monaca) without framework (pure js , jquery). a popover under button doesn't open wide enough , therefore looks bad. i want set wider , shorter. how restrict height, , allow width grow? for popover on device, had change topleft different location, , change width . want done dynamically. how? here's an example codepen vue-onsenui , (i think) it's same question onsenui popover. html: <v-ons-button @click="showpopover($event, 'up')" style="align-self: center">pop up</v-ons-button> <v-ons-popover cancelable :visible.sync="popovervisible" :target="popovertarget" :direction="popoverdirection" :cover-target="covertarget" > <p style="text-align: center">a lot of text tiny little popover. want <strong>change width </strong><p /> please note want make changes margins popover has. how do that? </p> &l

javascript - How to use the "or" command within JS regEx properly? -

i tried write more or less complex regex js. passes tests except 2 , don't know why. code function telephonecheck(str) { regex1 = /^[1]\s(\d{3}[-]){2}\d{4}|(\d{3}[-]){2}\d{4}$/; regex2 = /^\d{10}$/; regex3 = /^[1]\s(\d{3}\s){2}\d{4}|(\d{3}\s){2}\d{4}$/; regex4 = /^[1]\s[(]{1}\d{3}[)]{1}\d{3}[-]{1}\d{4}|[(]{1}\d{3}[)]{1}\d{3}[-]{1}\d{4}$/; regex5 = /^[1]\s[(]{1}\d{3}[)]{1}\s\d{3}[-]{1}\d{4}|[(]{1}\s\d{3}[)]{1}\d{3}[-]{1}\d{4}$/; if (regex1.test(str) || regex2.test(str) || regex3.test(str) || regex4.test(str) || regex5.test(str)) { return true; } else { return false; } } and 2 test doesn't pass correctly (both should come false true instead): telephonecheck("2(757)622-7382") , telephonecheck("(555-555-5555") . question how use | (or) operator (i think make code way nicer) , how describe expression within regex match specific character (e.g. "1" @ beginning of number)? did [1]{1} or [1]$ didn't seem work.

c# - What do the highlighted keywords in Visual Studio mean? -

Image
when type if , visual studio shows context menu: then when hit tab , tab , expanded: the keyword “true” highlighted. highlighting mean? they called code snippets . the highlight means if continue typing, go highlighted section. for example, if type "if" tab tab, this: if (true) { } and true highlighted. if continue typing, true replaced whatever typing such condition x == 2 etc. they handy if there more parameters, type , press tab , go next highlighted section.

C# Razor Task<string> async not working -

so unfortunately i'm dealing c# razor web-forms (not mvc) web application. i given c# program class consisting of async functions need make work on cshtml page , cannot figure out how... the 2 functions below c# class worked c# forms application. (notice "textbox1" assigned text). my problem need string variable "xml" displayed on cshtml page (preferably in "textarea" element) , cannot seem call showdata() function retrieve value can help? public static async void showdata(string gid) { string xml = ""; try { xml = await waitasynchronouslyasync(gid); //the original code set textbox string value //i need revise code can display on cshtml page textbox1.text = xml; } catch (httprequestexception) { throw new applicationexception("could not connect server"); } } public static async task<string> waitasynchronouslyasync(string gid) { await ta

java - Detect when view has been dismissed (touched) -

i'm using materialshowcaseview: https://github.com/deano2390/materialshowcaseview how can detect if specific showcaseview has been touched (dismissed). in activity, have 3 showcaseviews. i may have misunderstood question, here goes. if make custom view extends showcaseview, might able override ontouchevent(motionevent event) , put whatever functionality need inside method. see page views: https://developer.android.com/reference/android/view/view.html

topicmodels - tidy Error in eval(substitute(expr), envir, enclos) : binding not found: 'Var1' -

when apply tidy function result of lda model in dataset, following error "error in eval(substitute(expr), envir, enclos) : binding not found: 'var1'". same error when used on associated press example, shown below. tried reinstalling tidytext via devtools::install_github("juliasilge/tidytext") , still same result. there else can try? library(tidyr) library(tidytext) library(tidyverse) library(topicmodels) library(broom) data("associatedpress") associatedpress ap_lda <- lda(associatedpress, k = 2, control = list(seed = 1234)) ap_lda ap_topics <- tidy(ap_lda, matrix = "beta") ap_topics <> non-/sparse entries: 302031/23220327 sparsity : 99% maximal term length: 18 weighting : term frequency (tf) ap_lda <- lda(associatedpress, k = 2, control = list(seed = 1234)) ap_lda lda_vem topic model 2 topics. ap_topics <- tidy(ap_lda, matrix = "beta") error in eval(substitute(e

html - Issue creating the correct CSS Selector -

Image
i have been @ while , throwing in towel help. trying scrap this page trying access every table row has information in highlighted green in following picture. no need table headers, rows. with scrapy able each section area (where says "main campus") following selector response.css('.datadisplaytable .datadisplaytable') i use .datadisplaytable twice because tables trying select inside table class. after seems logical me table row after use following selector response.css('.datadisplaytable .datadisplaytable tbody:nth-child(2)') however, nothing selector. doing wrong? your selector bit off. you're not trying 2nd <tbody/> tag. .datadisplaytable .datadisplaytable tbody tr:nth-child(n+2) that rows, , skip header each table.

salt stack - saltstack: run powershell script in a state -

i'm trying download uru bitbucket , try install using vagrant default login credentials. i'm able download archive. when ever try run script see error - invalidly-formated env parameter. see documentation. i'm able run script without errors. i'm running locally using vagrant in masterless mode. appreciated. download_uru: file.managed: - name: c:\uru-0.8.3-windows-x86.7z - source: https://bitbucket.org/jonforums/uru/downloads/uru-0.8.3-windows-x86.7z - source_hash: sha256=f2a7b4ed8ef6b02613b134da19a31293c7423e8fbbd8e49ec5c1c86c5f3a0815 install_uru: cmd.run: - source: salt://ruby/files/install_uru.ps1 - shell: powershell - env: "-executionpolicy bypass" - runas: "vagrant" - password: "vagrant" - require: - file: download_uru $cat install_uru.ps1 set-alias sz "$env:programfiles\7-zip\7z.exe" sz x -oc: c:\uru-0.8.3-windows-x86.7z -r ; c:\salt\salt-call.bat --version salt-

php - how to manage a special error with special message in laravel -

i'm using laravel 5.4. , need handle error. imagine user logged in , opened 2 windows (his profile). when user click on logout in window, have still logout button in window, , clicking on that, laravel show csrf_token error page. my logout in not ajax , submitting form /logout how can handle error special message or redirect home without error logout controller? (not of csrf_token errors, controller). logout form : i submit form clicking on logout button using jquery: <form id="logout-form" action="/logout" method="post" style="display: none;"> <input type="hidden" name="_token" :value="token"> </form> and logout method in controller : public function logout(request $request) { $this->guard()->logout(); $request->session()->flush(); $request->session()->regenerate(); return redirect('/'); } in app\exceptions\handler.php re

html - Large images with overflow: hidden; don't get centered in Firefox -

i'm trying rid of horizontal scroll bar (a) when changed footer images got messed (b) , i'm not sure happening or do. a: unwanted horizontal scroll: https://mabonzo.github.io/prj-rev-bwfs-tea-cozy/teacozy/ b: commented out footer , images go wonky: https://mabonzo.github.io/prj-rev-bwfs-tea-cozy-test/teacozy/ initially trying change footer rule-set having left: 20px; margin-left: 20px; or padding-left: 20px; when ran problem! speculate related actual resolutions of images, i'm not sure. resizing browser fixes centers images. i asked on slack group no avail, tested on different browsers , seems issue on firefox. on chrome , edge load no problem... guess updated question how fix firefox users. edit: going update website, problem won't in (a) link. test site (b) still , broken. thanks! your footer element has auto width (which full width of screen, because it's block level element) left: 20px (combined position:relative ) it's full wi

javascript - Stripe Wordpress Config -

i'm trying recreate subscription example stripe uses here: https://stripe.com/docs/recipes/subscription-signup when submit test payment, seems go thru on page, redirects www.mysite.com/create_subscription.php, , throws me 404 page doesn't exist. there easier way without using plugin? form <form action="/create_subscription.php" method="post"> <script src="https://checkout.stripe.com/checkout.js" class="stripe-button" data-key="test-key" data-image="images/marketplace.png" data-name="emma's farm csa" data-description="subscription 1 weekly box" data-amount="2000" data-label="sign me up!"> </script> </form> server side code <?php // manually load stripe contents require_once($_server[&#

NPM Dependency Incompatibilities -

Image
i'm trying install videojs on ubuntu, having problems. it's complaining missing package.json file incopatible grunt version. pointers appreciated.

javascript - Google Directions, bug in common.js? -

i've been using google directions api few days. javascript code worked fine day or two, late 1 night didn't work. in ff console: typeerror: b undefined[learn more] common.js:49:155 fwiw, common.js line 49 (not code!): e;_.sb(d);window.gm_authfailure&&window.gm_authfailure()}el();c(b)})})}; .cn=function(a,b){a.b();return function(){var c=this,d=arguments;a.f(function(a){a&&b.apply(c,d)})}};dn=function(a,b,c,d,e,f){this.b=new km;this.b.seturl(c.substring(0,1024));f&&(this.b.data[8]=f);d?this.b.data[1]=d:e&&(this.b.data[2]=e);this.b.data[4]=0;this.b.data[5]=1;this.l=a;this.j=b};en=function(a){dl=!0;0!=a.getstatus()|| .aj(a,2)||($m(), .p(a,3)&& .sb(_.p(a,3)));el()}; i'm pretty sure error related call in client-side app: directionsservice.route(myrequest,mycallback); it's google method asks google directions 1 geographical point another. here's code: https://pastebin.com/atcfq9tz ost.setpickupcharge

java - Spring schedule graceful shutdown not working when using a cron scheduled -

i have small standalone application configures scheduler terminate gracefully. following configuration: @bean public taskscheduler taskscheduler() { threadpooltaskscheduler scheduler = new threadpooltaskscheduler(); scheduler.setwaitfortaskstocompleteonshutdown(true); scheduler.setawaitterminationseconds(60); return scheduler; } i can gracefully terminate scheduler, if don't have @scheduled(cron = ) task. once have 1 of those, no matter scheduler stuck until timeout. tried configuring executor , shutdown/await manually , effect same. these cron jobs not running. set run @ fixed time during night example. spring version: 4.2.8.release this happen when timeout reaches end: 2017.07.28 01:44:56 [thread-3] warn timed out while waiting executor 'taskscheduler' terminate any thoughts?

Log4net Raygun Tags -

is there way set raygun tags in config level have tried in code level exception new raygunclient().sendinbackground(exception, new list<string> { "error", "mq-translator" }); but need set tag in project level service if using raygunappender log4net raygun on nuget , tags set from: .settags(extracttags(loggingevent.getproperties())) this extract properties set in logging context. if set properties explained on set properties on context manual show in tags.

scala - Unable to get artifact com.elsevier:spark-xml-utils:jar:1.6.0 -

i trying utilize capabilities provided spark-xml-utils library within apache spark application. unable spark-xml-utils library in mavenized spark-scala project. pom.xml config is: - <project xmlns="http://maven.apache.org/pom/4.0.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://maven.apache.org/pom/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelversion>4.0.0</modelversion> <groupid>com.alpha.beta</groupid> <artifactid>spark2</artifactid> <version>0.0.1-snapshot</version> <pluginrepositories> <pluginrepository> <id>scala-tools.org</id> <name>scala-tools maven2 repository</name> <url>http://scala-tools.org/repo-releases</url> </pluginrepository> </pluginrepositories> <name>spark2</name> <url>http://maven.apache.org</url>

ios - How to show lyrics on my app -

now i'm going create audio player app on iphone so, looking information building music app swift. there many information but, not find 1 thing how can show song lyrics on phone. although there many music app supported show lyrics need customized app me. have build music app me. want play , pause song , show playlist , show lyrics. maybe there reference? if there reference. please inform me. @d why, it's hard tell aspect of development might asking specifically. i've been there before myself--wanting hash out high level ideas-- i'd out. i'd start finding song lyrics database; mldb.org . programmableweb.com contains apis may exist have in mind. next, check out dev communities (objc, rubymotion, etc.) audiobooks, etc. here's example out of code project that's pretty old already, give idea.

bash - Why `uname -a` invoke exit1 for sslocal? -

the shadowsocks client running in pc. uname -a linux miwifi 3.16.0-4-amd64 #1 smp debian 3.16.43-2+deb8u2 (2017-06-26) x86_64 gnu/linux [1]+ exit 1 sudo sh -c '/usr/bin/nohup /usr/local/bin/sslocal -c /etc/shadowsocks_racks.json > /var/log/ss.log 2>&1' why command uname -a invoke exit1 sslocal here? exit 1 sudo sh -c '/usr/bin/nohup /usr/local/bin/sslocal -c /etc/shadowsocks_racks.json > /var/log/ss.log 2>&1' mean ? why command uname -a invoke exit1 sslocal here? you've misinterpreted output. before uname ran, background command running job 1 exited status code of 1. shell couldn't tell until command run, , have been told.

curl - PHP request hangs when using guzzle -

i have following code: $client = new guzzlehttp\client( array( 'base_uri' => 'https://somesite.com' ) ); $response = $client->request('post', '/api', [ 'form_params' => array( 'action' => 'getusers', 'api_key' => $_post['key'], 'id' => $_post['id'] ) ]); when multiple users accessing same page following code above, other users waits first or recent request finish before loading request. i'm not using session . i have tag curl because guzzle built on top of it. maybe has it? any workaround this? using xhr won't fix because site i'm requesting api not accept other origins. check available php processes if using php fpm. has status page (the setup described there ) information. if workers busy, client's requests wait. need increase amount of workers able process more request

Classic ASP File Sharing Concern -

whenever disable file sharing (via folder properties\sharing\share) or remove list, no longer able browse website via internet explorer. is requirement classic asp? our website deployed in intranet, don't want user able browse directory via windows explorer (e.g. \server-name\path). thanks. nope, isn't requirement run asp pages. however, need add specific users folder permissions if don't wish use everyone. if you're not using windows authentication, need add account runs site through iis / apppool settings. account named iusr_. you'll need add network services account permissions. after adding them, restart iis , should go.

c - I want position, but I get ncols and nrows of array -

i'm student, , i'm trying last piece of code working on assignment. has been asked million times, haven't been able find solution works me. can last position of array print when run program. can't use shortcuts (vectors, maxelement(), etc). can help? #define inputfile "c:\\c_txt_files\\wind.txt" int i, j, nrows, ncols; double wind_max, wind_min, wind_array[12][5], index_minmonth=0, index_minyear=0, index_maxmonth=0, index_maxyear=0; fscanf(wind, "%d %d", &nrows, &ncols); /*find min , max, , compute average each row. locate min , max*/ wind_min = wind_array[0][0]; wind_max = wind_array[0][0]; for(i=0; i<nrows; i++) { for(j=0; j<ncols; j++) { if(wind_array[i][j]<wind_min) wind_min = wind_array[i][j]; index_minmonth = i; index_minyear = j; if(wind_array[i][j]>wind_max) wind_max = wind_array[i][j]; index_maxmonth = i; index_maxyear = j; } } index_minmonth +=

netbeans jsf attribute title not defined -

Image
i work netbeans 8.2 , jsf. imported maven project. in netbeans's editor have following error do have add in pom.xml?

pandas - How can I choose what to print out from a python dictionary and write it out to another file? -

i have file read in called 'peaks_ee.xpk' , have dictionary in atom name key , chemical shift value. this sample of peaks_ee.xpk file: label dataset sw sf 1h 1h_2 noesy_f1ef2e.nv 4807.69238281 4803.07373047 600.402832031 600.402832031 1h.l 1h.p 1h.w 1h.b 1h.e 1h.j 1h.u 1h_2.l 1h_2.p 1h_2.w 1h_2.b 1h_2.e 1h_2.j 1h_2.u vol int stat comment flag0 flag8 flag9 0 {1.h1'} 5.82020 0.05000 0.10000 ++ {0.0} {} {2.h8} 7.61004 0.05000 0.10000 ++ {0.0} {} 0.0 100.0000 0 {} 0 0 0 1 {2.h8} 7.61004 0.05000 0.10000 ++ {0.0} {} {1.h1'} 5.82020 0.05000 0.10000 ++ {0.0} {} 0.0 100.0000 0 {} 0 0 0 2 {1.h8} 8.13712 0.05000 0.10000 ++ {0.0} {} {1.h1'} 5.82020 0.05000 0.10000 ++ {0.0} {} 0.0 100.0000 0 {} 0 0 0 3 {1.h1'} 5.82020 0.05000 0.10000 ++ {0.0} {} {1.h8} 8.13712 0.05000 0.10000 ++ {0.0} {} 0.0 100.0000 0 {} 0 0 0 4 {2.h8} 7.61004 0.05000 0.10000 ++ {0.0} {} {2.h1'} 5.90291 0.05000 0.10000 ++ {0.0} {} 0.0 100.0000 0 {} 0 0 0 5 {2.h1'} 5.90291 0.05000 0.10000 ++

ios - How do you determine the customer/user when receiving an Apple statusUpdateNotification for auto renewing subscriptions? -

so, apple has implemented server server notification various events in subscription lifecycle. i excited going on seems there sort of glaring thing i'm missing. i'm not sure how match notification data user on side. i'm surprised there isn't uid/apple id passed notification match on. maybe i'm supposed using original_transaction_id unclear whether unique. does know use in status response? i use original_transaction_id match event user.

c++ - How to get a function pointer from lambda expressions or so? -

this question has answer here: passing lambda function pointer 5 answers i have c language function called: f_api(void(*callback)(int)) and have static class method callback: struct { static void callback(int i) { a::count = i; } static count = 0; }; i can call function this: f_api(&a::callback) however, have change callback non-static now, because have create multiple a objects. but cannot change definition of f_api() . i tried using lambda: f_api([this](int i)->void{this->count = i;})` but failed, because cannot convert lambda capture simple function pointer. std::bind() cannot work, because of f_api() definition. what can this? how can function pointer lambda expression? there method sidestep? if cannot change c api don't think can situation. because c functions require information require pas

javascript - Trying to slide an entire div off the page and slide a new one onto the page. Console is logging but div is not moving. Why? -

the problem javascript function not moving div .poop out of screen: $('#placeholder').mouseup(function() { console.log(answeredcorrectly); if (answeredcorrectly === true) { $('.poop').animate({left: '-50%'}, 500); } }); the div not want move, have feeling has me changing .html. remember reading somewhere bad practice. maybe when add these classes #placeholder not translate over. im unsure. vision keep bottom bar stationary, entire div off page , replace new div (i have yet create). if have anymore tips i'd appreciate it, learning. filler fluff because according notification on side post code. var $square = $('.square'); var $china = $('#chinabox'); var $checkanswer = $('#checkanswerwrapper'); var answeredcorrectly = false; $('.square').on('click',function(){ $('this').removeclass('selectedsquare'); $(this).addcl

php 5.6 - Fixing PHP Codeigniter Pagination button -

i trying modify pagination library in version 3.1 of codeigniter. this numbering of pagination in use default. my controller: $config['num_links'] = 2; example : 1 234 > >> 4 page button click 123 4 567 > >> what want : 1 2345 > >> 4 page button click 123 4 5 > >> i trying modify pagination library in version 3.1 of codeigniter. this numbering of pagination in use default. what want as can see in example, page button not static. want have page button fixed , move next range when click on icon. trying in version codeigniter3.1 , not know how modify pagination class. please me. you can try code , refer https://www.codeigniter.com/userguide3/libraries/pagination.html $config["base_url"] = base_url().'example'; $config["total_rows"] = $count;//total number of result $config["per_page"] = 5; $config["uri_segment"] = 2; $config['use_page_numbers'

Convert Umlaut in existing HTML String (Java function) -

i need java function convert umlaute in existing html-string. example have <html> <body> äü </body> </html> now function should convert types of umaute escaped form. should leave html code intact replace -> ä , ü -> ü in above example resulting in <html> <body> &auml;&uuml; </body> </html> i aware of fact there loads of escaping functions in escapehtml4 . problem html converted html code escaped. looking function identifies text-parts within html code , encodes them. furthermore setting utf-8 encoding not option me in case. you have parse html file first, , apply escaping on relevant parts. for example, jsoup html parser. can iterate on html elements, , manipulate content. update: turns out simple jsoup: import org.jsoup.jsoup; import org.jsoup.nodes.document; public class stackoverflow { static final string html = "<html><body>äü</body></html>"; pu

java - Incompatible type error when attempting to use variable length argument -

i attempting use variable length argument in constructor, error messages: 'incompatible types string cannot converted int' illegal start of operation, ';' expected public class personnel { private string pname; private string rank; private string certs []; public static int totalpersonnel = 0; public personnel(string name, string rank, string... certs) { this.pname = name; this.rank = rank; this.certs = certs; incrpersonnel(); } public static void incrpersonnel(){ totalpersonnel++; } public static void main(string myargs[]){ personnel alex = new personnel ("alex", "cpt", ["none"] ); } } if try pass array way using not correct instead have use new string[]{"none"} , code should : public static void main(string myargs[]) { personnel alex = new personnel("alex", "cpt", new string[]{"none"}); } or can use : public static void main(str

Angular Form Validation $invalid not working -

i trying disable submit button, when fields empty. not working. don't know why not working. saw many blogs, could't figure whats issue. <form name="createform"> <div class="form-group col-md-6"> <label for="createname">student</label> <select class="form-control" name="student" id="createname" ng- model="createstudent.studentid" ng-options="item.name item in allstudent" required> <option value="" selected disabled>select</option> </select> </div> <div class="form-group col-md-6"> <label for="createclass">class</label> <select class="form-control" name="class" id="createclass" ng- model="createstudent.classid" ng-options="item.number item in allclass" required> <opt

Custom View constructor in Android 4.4 crashes on Kotlin, how to fix? -

i have custom view written in kotlin using jvmoverloads have default value. class myview @jvmoverloads constructor( context: context, attrs: attributeset? = null, defstyle: int = 0, defstyleres: int = 0 ) : linearlayout(context, attrs, defstyle, defstyleres) all works fine in android 5.1 , above. however crashes in 4.4, since constructor in 4.4 doesn't have defstyleres . how have supported in 5.1 , above have defstyleres not in 4.4, without need explicitly having 4 constructors defined did in java? note: below works fine in 4.4, loose defstyleres . class myview @jvmoverloads constructor( context: context, attrs: attributeset? = null, defstyle: int = 0 ) : linearlayout(context, attrs, defstyle) best way have class way. class myview : linearlayout { @jvmoverloads constructor(context: context, attrs: attributeset? = null, defstyleattr: int = 0) : super(context, attrs, defstyleattr) @targetapi(build.version_codes.lollipop) c

angularjs - Why is it necessary to run 'npm install' when I already have all the dependence in node_module folder -

why necessary run 'npm install' when have dependence in node_module folder. after running 'npm install' on machine, want setup same project on machine, why require run 'npm install' again when have downloaded dependence in node_module folder? npm install extract dependencies package.json, download , save them in node_modules folder. don't need run npm install again , again if have installed dependencies locally. when ever installs new dependency run npm install <package-name> --save , why --save first time? because adds new installed dependency on package.json. never push node_modules our git repo updated package.json pushed repo. in case if new person pulls code repo going run npm install , dependencies mentioned on package.json going available on project locally. thats small intro why use package.json hope helps.

Location returning null sometime after Location Service is turned on Android -

i trying latitude , longitude device using fusedlocationapi . if location turned off asking user turn on location service through dialog . once location service turned on sometime getting longitude , latitude . sometime returning location null. here code latitude , longitude using fusedlocationapi . problem comes when user has turn on location service using dialog private void getlatlong() { mgoogleapiclient = new googleapiclient.builder(this) // next 2 lines tell new client “this” current class handle connection stuff .addconnectioncallbacks(this) .addonconnectionfailedlistener(this) //fourth line adds locationservices api endpoint googleplayservices .addapi(locationservices.api) .build(); } @override protected void onpause() { super.onpause(); overridependingtransition(0, 0); //disconnect api onpause() if (mgoogleapiclient.

INITIAL_TRIGGER_EXIT doesn't trigger geofence exit -

when add new geofence outside of current location, should immediate exit transition if initial_trigger_exit flag set setinitialtrigger. isn't working @ thought. on 1 device, immediate exit first ever time (of app's lifetime), , on device (running android o) never receive transition. i'm connected wifi , have location accuracy. has faced similar problem , possibly came solution this?

VBA Excel date yyyy/mmm/dd to yyyy/mm/dd -

i'm writing small vba manage , convert date external tables , i'm stuck on strange date format like: yyyy/mm/dd need convert date a1 , paste b2 as tamplate use columns a1 , b1: a1= date converted b1= paste destinaton of converted dat a1 2012.jan.04 2012.nov.04 2012.dct.04 b1 04.01.2012 04.11.2012 04.12.2012 what tested is: formula convert (with created dictionary) - cannot use in case of many dates convert vba date convert - cannot see date a1 proper date , nothing format date in excel build-in function "formating" - nothing also function "text-to-column" tested - still nothing it looking i'm stuck on simple hard move forward why i'm asking help. thanks ideas. i use following formula in b1 : =date(left(a1,4),match(mid(a1,6,3),{"jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","d

Pushing and Pulling Columns - Bootstrap 4 -

this need: desktop: b a mobile: a b here html: <div class="row"> <div class="col-md-7 col-sm-7 push-md-5"> </div> <div class="col-md-5 col-sm-5 pull-md-7"> b </div> </div> it in correct order on mobile device not on desktop. have tried couple of guides , material without luck. in guides moving equal columns 4 or 6 it's bit confusing understand clearly. here go solution https://jsfiddle.net/kzmz7qal/1/ .div1{ background: blue; color: #fff; } .div2 { background: red; color: #fff; } <link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" rel="stylesheet"/> <div class="container-fluid"> <div class="row"> <div class="col-md-7 col-sm-7 push-sm-5 div1"> </div> <div class="col-md-5 co

r - Aggregating time on hourly basis and counting it -

i have following dataframe in r. date car_no 2016-12-24 19:35:00 abc 2016-12-24 19:55:00 def 2016-12-24 20:15:00 rty 2016-12-24 20:35:00 wer 2016-12-24 21:34:00 der 2016-12-24 00:23:00 abc 2016-12-24 00:22:00 ert 2016-12-24 11:45:00 rty 2016-12-24 13:09:00 rty date format "posixct" "posixt" i want count hourly movement of car traffic. 12-1,1-2,2-3,3-4 , on currently approach following df$time <- ymd_hms(df$date) df$hours <- hour(df$time) df$minutes <- minute(df$time) df$time <- as.numeric(paste(df$hours,df$minutes,sep=".")) and after apply ifelse loop divide in hourly time slots,but think long , tedious way it. there easy approach in r. my desired dataframe be time_slots car_traffic_count 00-01 2 01-02 0 02-03 0 . . . 19-20 2 20-21

java - Merge two sorted linklist recursively? -

i cant find wrong code when submit 2 of testcases giving runtime error . please me figure out error. have checked atleast 30 custom testcases gives right output of them. code public static node mergetwolist(node head1, node head2) { node c = null; if (head1 == null) { return head2; } else if (head2 == null) { return head1; } if (head1.data < head2.data) { c = head1; c.next = mergetwolist(head1.next, head2); } else { c = head2; c.next = mergetwolist(head1, head2.next); } return c; } if figure out please tell me. i think reason stackoverflow, because use recursion, , recursion produce stack, , if linklist long, may cause stackoverflow. there similar question on leecode, , solve iterative, paste solution in blog, although explanation in madarin, code can still reference. link provided below: http://codecrazer.blogspot.tw/2017/07/leetcode-21-merge-two-sorted-lists.html

java - Which is better way to create multiple directories in Azure file storage? -

i creating application need create 1 directory inside another. : directory1/directory2/directory3/directory4/directory5 here , directory5 in directory4 ,directory4 in directory 3 , on.. so, have 2 available options : 1) call rest api related 'create directory' in loop explained here : https://docs.microsoft.com/en-us/rest/api/storageservices/create-directory (i haven't code yet logic) 2) code in java applying loop create multiple directories required. code : public jsonobject createdirectory(jsonobject jsoninput) throws ioexception, invalidkeyexception, urisyntaxexception { cloudfileclient fileclient = null; string storageconnectionstring = "defaultendpointsprotocol=https;accountname=" + jsoninput.get("accountname") + ";" + "accountkey=" + jsoninput.get("accountkey"); system.out.println(storageconnectionstring); cloudstorageaccount

Excel VBA Diagonal Sorting -

click view image good day! image attached contains sorting want data. vba code this? the code use is: for b = 1 30 if < 2 cells(b, a).value = 1 = + 1 else cells(b, a).value = 1 = 1 end if next b it can sort 2 rows before resets. how expand 1 in image? thanks! like this: for b = 1 30 = 1 3 if = 1 cells(b, a).value = 1 elseif = 2 cells(b, a).value = 1 else cells(b, a).value = 1 end if next next b

oracle - Want to create serial numbers -

i want generate serial no.s e.g. i have, nid ----- abd90 bgj89 hsa76 and want, id nid --------- 1 abd90 2 bgj89 3 hsa76 what code should run outcome? please me. since tagged sas, i'll answer sas. based on question, getting result input simple this data result; id=_n_; set input; run; or proc sql; select id monotonic() ,nid input ; quit; in pure oracle this select rownum, nid input however might want throw on order in there because you'll different results every time run that.

css - Why position: relative without z-index creates a new stacking context? -

from article : two elements same stack level layered based on source order. successive elements stack on top of predecessors. and this : a stacking context formed, anywhere in document, element in following scenarios: ... 2. element position value "absolute" or "relative" and z-index value other "auto". now please @ piece of code: .c1 { position: relative; top: 50px; } .c2 { background: green; width: 200px; height: 200px; } <div class="c1"> why i'm visible? </div> <div class="c2">&nbsp;</div> as follows 2 previous quotes, div.c1 shouldn't create new stacking context, because doesn't have z-index . therefore, div.c1 , div.c2 in <html> stacking context, , should rendered in order. why div.c2 rendered under div.c1 ? here c1 has got stacking context since has position:relative in it, if give position absolute c2

python - How to create a multiple part in a same model in abaqus using abaqus script -

from part import * material import * section import * assembly import * step import * interaction import * load import * mesh import * optimization import * job import * sketch import * visualization import * connectorbehavior import * import numpy np math import sqrt fd =open('circle_input.txt','r') d=np.loadtxt(fd,delimiter=',',dtype={'names':('co1','col2','col3'),'formats':('float','float','float')}) in range(0,len(d),1): description = 'as particles: '# + 'x = ' + str(x) + ' y = ' + str(y) + ' z = ' + str(z) model = 'model' print description print model mdb.model(modeltype=standard_explicit, name=model, description=description) j in range(i+1,len(d)): ## sketch square mdb.models[model].constrainedsketch(name='__profile__', sheetsize=200.0) mdb.models[model].sketches['__profile__'].circleby