Posts

Showing posts from January, 2013

javascript - Inserting GTM variable instead of HTML object -

i'm trying implement marketing tag on website value needed on tag should come html object, although when trying replace gtm variable, no data transferred tag. these instructions documentation: for google tag manager (gtm) integration, create html-object (jquery required) containing , replace variables real data values (cf. next section). html-object @ checkout page <div id='transactionstring' data-transaction-string='data'></div> create custom html-tag in gtm following code snippet , pass data new html object. finally, can add checkout page trigger rules of gtm. create custom html tag in gtm <script src="https://tracking.crealytics.com/lib/multi_conversion.min.js"></script> <script type="text/javascript"> var transactionstring = $("#transactionstring").data("transaction-string"); __multi_conversion_tracking(70, "transactionstring"); </script> &

android - Sending multiple dynamic fields with Retrofit -

we need send post request web service needs dynamic multiple fields. i mean, need send post request: question1='answer1'&question2='answer1'&question2='answer2'&question3='answer1' where question1 , question2 not set in compilation time. know can use @fieldmap using dynamic fields, cannot send same field more 1 time. this our retrofit code: @formurlencoded @post("/desafios/send/") observable<baseservermsgarray> postsubmitsurvey(@field("customerid") long customerid, @field("upload_from_app") int uploadfromapp, @fieldmap hashmap<string, arraylist<string>> hashfields); could us? thanks in advance, what need map can contain duplicate keys. unfortunately there no such map in standard android. might use one https://github.com/greenrobot/essentials/blob/master/java-essentials/src/main/java/org/greenrobot/essentials/collections/multimap.java if won't work, try manually c

Decimal point showing error in Lua -

i'm using esplorer programming esp8266. a = 7.5 print(a) this lua code shows error "malformed number near '7.5' ". need add library or file? which exact firmware (file) did flash esp? i expect might have used 'integer' version, doesn't support floating point arithmetics, use 'float' firmware version instead.

php - Image Rename Zip And Download codeigniter -

currently zip downloading , images within zip off names stored on server need rename them have 3 images on server need download images before adding files zip need rename them public function downimages(){ $this->_check(); // session checker $this->load->helper('download'); $this->load->library('zip'); $idm=$this->uri->segment(3); $ab=$this->adminmod->downimg($idm); $down=explode('-/,-', $ab[0]->director); //gets directory stores in array $fname=explode('-/,-', $ab[0]->file_oname); //gets file names stores in array foreach ($down $key =>$value){ $name = $fname[$key]; // name stored need use this rename $data = "./"($value); $this->zip->read_file($data); //adds images zip archive } $this->zip->download($idm.'.zip'); //downloads zip fles // redirect($_server['http_referer']); } my server image names xfasf.jpg 2) sadweq.jpg 3)w

android - GSON java how can i make different names between mapping and printing? -

i have json this: { "aggregation": { "cityagg" : { "key" : "paris" } } } i create mapping , each field, add @serializedname because want create custom names variables. for example in json, there key names key , want variable in java cityname . so, this: @serializedname("key") public string cityname i can dynamically map response json objects this: gson gson = new gson(); query2 query2 = gson.fromjson(response, query2.class); it working perfectly. however, when want print mapped object, this: string query2string = gson.tojson(query2); gson gsonpretty = new gsonbuilder().setprettyprinting().create(); string prettyjson = gsonpretty.tojson(query2string); the problem that, in prettyjson , can see key , not cityname . i know if there way customize that. don't want see key . either should use custom deserializer or should alter value of annotation using reflection. update: worst s

asp.net mvc 4 - publish web application in azure facing permission issue with office365 -

we doing office 365 asp.net mvc , in example working fine local system,(we using vs2015), when publish azure web application published. after open url click email button go login page , enter credentials logged , redirect mail page showing error message, local working fine everything. please let me know required after publish. oops you've reached error! weren't able process action requested. caused exception in below table: exception cause action adalexception exception thrown when either have stale o365 access token can cause authentication errors, or attempted access resource don't have permissions access. you'll may need refresh access token. try signing out , signing in app again, or refreshing session click here. make sure app configured correct service permissions in services manager menu. if of these permissions not configured, or configured incorrectly, parts of app may throw error. example right click project, select connected service...,

set cookie and redirect in express -

i'm trying set cookie response , redirect user if haven't been verified (inside route) //add jwt token on successful login res.cookie('jwt', user.token) console.log(user) if(user.security.active === false ){ res.status(401).json({error: 'your account has been deactivated'}) } //if user.security.verified == true if(user.security.verified === false){ res.redirect('/verify'); } if(user.security.approved === false) { res.redirect('/approval') } res.redirect('/') i error on server error: can't set headers after sent. does mean can't use redirect when set cookie? wait sorry, added return before each res , works should if contribute comment further explain please do.

python - pandas delete the 0 appears most times -

i have dataframe this: a b c d 1 0 0 0 0 1 0 7 5 2 0 4 6 3 0 0 0 0 8 8 0 7 7 7 0 0 0 1 1: fow each row, if counts of 0 >90% of column counts(in case: mean: 0.9*4 ), delete row. 2: fow each column, if counts of 0 >90% of row counts(in case: mean: 0.9*7 ), delete column. i guess want like: mask_rows = pd.dataframe.sum(df == 0, axis=1) > 0.9*len(df.columns) mask_cols = pd.dataframe.sum(df == 0, axis=0) > 0.9*len(df.columns) this creates mask following interpretation of question...

python - what's the difference between webView.load(QUrl) and QNetworkAccessManager.get(Qurl) in QT? -

update:i use javascriptconsolemessage , got message on there sites: can't find variable: jquery i use pyqt on project。 today want change web access way webview.load(qurl) qnetworkaccessmanager.get(qurl),because webview.load(qurl) can't use async. just below: before: self.webview.load(qurl(input_url)) after: am = qnetworkaccessmanager(parent=self) self.net_reply= am.get(net_requests) am.finished.connect(self.setweb) def setweb(self, netreply): replyarray = netreply.readall() self.qwebview.page().mainframe().setcontent(replyarray ) after changed,it work in websites, in websites(eg, http://www.china.com.cn ) view not ,just dont have css style.how can change code right view webview.load(qurl)? i suspect issue setcontent() not being able load external resources (like css) because you're not using baseurl parameter tell qwebview make external requests from. can use qwebview::sethtml(...) shortcut not set mime type in setcontent() .

asp.net mvc 4 - How To make own Template Inbox view use MVC using C# -

i using smtp mail sending . wokring normal mail message send inbox want own custom template mail . have using trying simple layout own @{ viewbag.title = "mylayout"; } <h2>mylayout</h2> in contact page i have added layout @model inspinia_mvc5.models.mailmodel @{ viewbag.title = "index"; @layout = "~/views/shared/mylayout.cshtml"; } <script src="~/scripts/jquery-2.1.1.min.js"></script> <script> $(document).ready(function () { $('.summernote').summernote(); if ('@viewbag.message' == 'sent') { alert('mail has been sent successfully'); } $(document).ready(function () { $('.summernote').summernote(); }); }); </script> <div class="wrapper wrapper-content"> <div class="row"> <div class="col-lg-2">

android - Options menu showing at different fragments(mostly in neighbour Fragment) -

my view pager's adapter like: public pager(fragmentmanager fm, int tabcount) { super(fm); this.tabcount = tabcount; } @override public fragment getitem(int position) { switch (position) { case 0: return new frag1(); case 1: return new frag2(); case 2: return new frag1(); case 3: return new frag2(); case 4: return new frag1(); default: return null; } } @override public int getcount() { return tabcount; } } how set tablayout , viewpager in java class: (int = 0; < 5; i++) { tablayout.addtab(tablayout.newtab()); } pager adapter = new pager(getsupportfragmentmanager(), tablayout.gettabcount()); viewpager.setadapter(adapter); viewpager.beginfakedrag(); viewpager.addonpagechangelistener(new tablayout.

Why does this federated SPARQL query work in TopBraid but not in Apache Fuseki? -

i have following federated sparql query works expect in topbraid composer free edition (version 5.1.4) not work in apache fuseki (version 2.3.1): prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix movie: <http://data.linkedmdb.org/resource/movie/> prefix dcterms: <http://purl.org/dc/terms/> select ?s { service <http://data.linkedmdb.org/sparql> { <http://data.linkedmdb.org/resource/film/1> movie:actor ?actor . ?actor movie:actor_name ?actorname . } service <http://dbpedia.org/sparql?timeout=30000> { ?s ?p ?o . filter(regex(str(?s), replace(?actorname, " ", "_"))) . } } i monitor sub sparql queries being executed under hood , notice topbraid correctly executes following query http://dbpedia.org/sparql endpoint: select * { ?s ?p ?o filter regex(str(?s), replace("paul reubens", " ", "_")) } while apache fuseki executes follow

python - Is this a bug in Pandas? FloatingPointError on ewm().std() -

when execute following, floatingpointerror. import traceback import warnings import sys import pandas pd import numpy np np.seterr(all='raise') def warn_with_traceback(message, category, filename, lineno, file=none, line=none): traceback.print_stack() log = file if hasattr(file,'write') else sys.stderr log.write(warnings.formatwarning(message, category, filename, lineno, line)) warnings.showwarning = warn_with_traceback pd.series(np.random.randn(50)).pct_change().ewm(span=35, min_periods=35).std() i following error: floatingpointerrortraceback (most recent call last) <ipython-input-2-3db1ff4816cf> in <module>() ----> 1 pd.series(np.random.randn(50)).pct_change().ewm(span=35, min_periods=35).std() /projects/anaconda3/lib/python3.5/site-packages/pandas/core/window.py in std(self, bias, **kwargs) 1285 def std(self, bias=false, **kwargs): 1286 """exponential weighted moving stddev""" -&g

windows - Batch file: renaming mutiple files -

i've been searching through archives on here can't quite find i'm looking -- i need copy xlsm files may directory june directory (that parts easy, i'm doing that). issue files end "may16.xlsm". want "may" part of filename removed , replaced "jun". i can take off last 5 characters...but can't figure out how add them. i've got 350+ files rename...and i'd rather not manually! any appreciated. -s it's not complex thought ren may* jun* will work. or if want *.xlsm files ren may*.xlsm jun*.xlsm

nullpointerexception - java ternary conditions strange null pointer exception -

this question has answer here: why ternary conditional expression returning null , assigned reference type cause nullpointerexception? [duplicate] 2 answers can explain me why in first case null pointer detected, no on other ? maybe looks on first type, why if condition false.. @test public void test1() { final integer = null; final integer b = false ? 0 : a; //===> null pointer exception } @test public void test2() { final integer b = false ? 0 : null; //===>not null pointer exception } @test public void test3() { final integer = null; final integer b = true ? 0 : a; //===>not null pointer exception } @test public void test4() { final integer = null; final integer b = false ? new integer(0) : a; //===> not null pointer exception } @test public void test5() { final integer = null; final i

c# - Updation on DB with the different categories in Asp.net MVC -

Image
i creating project related leave absence. leave maintained & manipulated according different categories. every flow of concept working, except calculating leave days & showing balance. i have created model named, leavereq.cs public class leavereq { public int id {get; set; } [display(name = "employee name")] public string emp_name { get; set; } [display(name = "requested day")] public string day_ctg { get; set; } [display(name = "start date")] [datatype(datatype.date)] [displayformat(dataformatstring = "{0:mm-dd-yyyy}", applyformatineditmode = true)] public datetime startdt { get; set; } [display(name = "end date")] [datatype(datatype.date)] [displayformat(dataformatstring = "{0:mm-dd-yyyy}", applyformatineditmode = true)] public datetime enddt { get; set; } [display(name = "time-off category")] public string category { get; set; }

python - Obtain the value of a dictionary after select on of the combobox value -

i have created dictionary combobox's value. trying use .get(keys) obtain value set combobox. example if select a, should print out haha what , b should print out lala sorry , both of them values in dictionary how can correct code? from tkinter import * tkinter import ttk class application: def __init__(self, parent): self.parent = parent self.value_of_combo='a' self.combo() def textarea(self, e): self.value_of_combo = self.box.get() # content of text widget r=self.thistextarea.get('1.0','1.end') # if empty insert selected value directly if not r: self.thistextarea.insert(insert, self.box_values) # if not empty delete existing text , insert selected value else: self.thistextarea.delete('1.0','1.end') self.thistextarea.insert(end, self.box_values) def combo(self): self.box_value = stringvar() mydict={

asp.net - Partial view for container -

say, i'm using following html in asp.net mvc application: <div class="a"> <div class="b"> (varying content) </div> </div> i'd put repeating div part separate file , reuse (notice, content may, , change). how can that? keep in partialview, eg: _commondiv call partial view view @html.partial("_commondiv", null, new viewdatadictionary {{ "yourvaringcontentkey", yourcontent}}) get content in partialview string yourcontent= (string)this.viewdata["yourvaringcontentkey"]; and use same want.

java - How to detect whether the user has selected an item on a ListView? -

i have listview items in it, , go next page, user must select item, because next page modifying selected item. to go next page, user clicks button labeled "next". have grayed out default, i'd un-grayed moment user clicks on element in listview . at moment, have set on onmouseclick isn't effective because activates quite literally whenever listview node clicked, not when element is. how solve this? you can check original tutorial , section "processing list item selection" (example 11-5). listview.getselectionmodel().selecteditemproperty().addlistener((obs, oldval, newval) -> { // newval contains selected item }); also can bind disableproperty of button selecteditemproperty of selection model of listview conditionally: nextbutton.disableproperty().bind(listview.getselectionmodel().selecteditemproperty().isnull());

c# - Modifying remote JavaScripts as they load with CefSharp? -

i building custom browser part of interface remote website. gui sucks i'm doing javascript hacks make better. currently, make modifications ui using following greasemonkey script (on firefox): // ==userscript== // @name winman-load // @namespace winman // @description stuff when winman.js loads // @include https://addons.mozilla.org/en-us/firefox/addon/greasemonkey/ // @version 1 // @grant none // @run-at document-start // ==/userscript== document.addeventlistener("beforescriptexecute", function(e) { src = e.target.src; content = e.target.text; //console.log("src: " + src); if (src.search("winman.js") > -1) { console.info("============ new winman ===========\n" + src); var newcontent = ""; $.ajax({ async: false, type: 'get', url: '/script/winman.js', success: function(data) { newcontent = dat

ios - Infer type to generics from function's return type -

i have storyboard , view controllers in it. storyboard id of every view controllers same class name assigned it. like: walkthrough view controller assigned walkthroughvc class , storyboard id walkthroughvc. i made function below, instance of view controller storyboard: func getviewcontroller<t: uiviewcontroller>() -> t? { let sb = uistoryboard(name: "main", bundle: nil) sb.instantiateviewcontrollerwithidentifier(viewcontroller.rawvalue) as? t } is possible infer type of t? if yes, how? i think looking for. class viewcontrollers { class func getviewcontroller<t : uiviewcontroller>(fromstoryboard : string, fromclass : t) -> t? { let storyboard = uistoryboard(name: fromstoryboard, bundle: nil) let controller = storyboard.instantiateviewcontrollerwithidentifier("\(fromclass)") as? t return controller } }

Kill and restart Jenkins task in a job without failure -

is there way kill , restart jenkins slave task in job without failure? if directly, job fails because connection lost. i need refresh path environment variable after job changes it. i don't know how changing path variable, jenkins subtasks in own shell... so export path=$path:/custom/bin have live of jenkins task , not whole job , not future jobs if editing like: /etc/bashrc stop that... you can source custom script if changing bunch of stuff @ top of task, like: source ./some/file/that/exports/path appdefinedincustompath -s dothings

Differences in Powershell environments -

is there difference between running powershell script: from command line powershell.exe -file my_scipt.ps1 from powershell ise (open script in editor , press green play button run) from windows powershell host application? and if there difference, there way in powershell check it? the reason asking seeing 1 script have different behaviour in these 3 environments, though had expected see same outcome. behaviour (3rd party non-public) .net library using crashes in second 2 environments, works fine in first one. we have checked obvious things, such as: directory of powershell process set same (which set via [system.io.directory]::setcurrentdirectory($my_path) in script) powershell , .net version (confirmed via identical $psversiontable ) system path my hope in asking question there difference unaware of, , identifying can resolve crash seeing. i'd interested hear of similar experiences here.

Android Camera API Advance Features -

i start working on android custom camera app. want know there way add following features app: beauty level red eye removal acne removal i want know if possible, can suggest or give me idea how can code app. though familiar android camera api functions, , worked on several simple custom camera apps. thanks in advance for beginning, can use facedetector detect faces in picture.for example , can remove red eyes searching red pixels in picture , try decrease red level of them.and , can use opencv detecting eyes.i found sample eye detection in here

docusignapi - Integrate DocuSign with Wrike -

we trying integrate docusign wrike using wrike tasks, projects management , work flow. our documents available on wrike , want use docusign digital signature service. i explored documentation , did not found relevant material except request sign (it's long process , don't need it). is there api automatic digital signature? consider following work flow: our marketing team created task distribute 100 chips stands different shops. this request directly goes brand manager. if brand manager approve request goes our director. now want director level approval digital signature. how can use docusign wrike? re: can use docusign wrike ? yes. if want director approve/sign document digital signature, use envelopes: create , request digital signature. are sure need digital signature? internal approval processes work fine electronic signatures. depending on want do, of docusign's new digital signature capabilities , announced in june 2016 still in

php - How do I programmatically apply a coupon in Woocommerce for first order made by a customer? -

in woocommerce i'm trying find way apply 20% discount first order made new customer. appears can use functions woocommerce_after_checkout_validation , check_new_customer_coupon doesn't work. function.php: add_action('woocommerce_after_checkout_validation','check_new_customer_coupon', 0); function check_new_customer_coupon(){ global $woocommerce; // might change name of coupon $new_cust_coupon_code = 'test'; $has_apply_coupon = false; foreach ( wc()->cart->get_coupons() $code => $coupon ) { if($code == $new_cust_coupon_code) { $has_apply_coupon = true; } } if($has_apply_coupon) { if(is_user_logged_in()) { $user_id = get_current_user_id(); // retrieve orders $customer_orders = get_posts( array( 'meta_key' => '_customer_user', 'meta_value' => $user_id,

c# - MVVM passing control handle to the model -

in model using external .dll file needs handle ui control in order display images on it. guess .dll related logic belongs model - not ui. i have view. inside view i've got: <windowsformshost x:name="winformshost" horizontalalignment="stretch" verticalalignment="stretch" margin="5,0,5,0"/> now, in model need handle control placed in windowsfromshost. doing passing reference windows formshost viewmodel: //view public mainwindow() { initializecomponent(); datacontext = new mainwindowviewmodel(this.winformshost); } then in viewmodel, passing model: public mainwindowviewmodel (windowsformshost containerforrenderpanel) { model = new model (containerforrenderpanel); } finally in model, creating new control , have access handle within model: public class model : bindablebase { private windowsformshost renderpanelcontainer; public windowsformshost renderpanelc

c# - .NET external configuration server -

i developing web application contain quite few hosts. have seen external configuration storages been used in java e.g. spring cloud config server. are there non-custom alternatives in .net? currently, looking @ msdn external configuration store pattern , , implementing custom , re-using of code page. essentially, each node have initial configuration file (json) containing e.g. node name , url db find other configuration parameters. have separate service can queried other services return configuration data. caches config data locally. there concerns this: how performs, i.e. configuration service may need scaled on multiple instances, config data needs cached, , may need distributed cache config services have unified view of cached config data, this custom implementation , need maintenance, how config data changed, e.g. through custom admin ui interface crud operations?

wordpress - Match XML elements/nodes that contain 'X' with XPath -

i'm using wp-property , wp-property: importer plugins manage properties on wordpress powered website. importer uses xpath rules map fields in imported xml file corresponding field on site. e.g. 'display address' maps 'address/full' i have set of elements this: <property> <feature1>feature</feature> <feature2>feature</feature> <feature3>feature</feature> <feature4>feature</feature> <feature5>feature</feature> <address> <full>abc</full> <street>def</street> <postcode>ghi</postcode> </address> </property> i want group these 1 entry rather setting separate fields each one, i'm looking means match feature* i've tried far seems have missed mark. goes without saying i've never dabbled xpath before today!

Where to place a socket within a rails app? -

i have rails-based webapp , unity-based app. these have communicate each other on udp-socket. where best place within rails app create such socket? me necessary socket exist before user visits webapp , socket accessible within controller . in rails files under config/initializers loaded when application starts. so 1 way want create new file there initializes socket connection , assign constant rest of application uses. class utility def self.socket_connection @connection ||= connect_socket end def self.connect_socket # logic connecting socket end end and later when need connection use utility.socket_connection if "real" application, need more sophisticated approach that: pools connections handle when different parts of applications want use socket connections @ same time. (they'd check out & in connection, how activerecord's #with_connection works monitor connections, closing , re-establishing them necessary

arrays - How to diagnose an issue with php exec function when $return is false -

hi i'm having problem script meant run multiple times successfully. using following code have diagnosed script running half time, whereas other half doesn't seem running correctly @ all. i have figured out using $return value of exec function shown below: exec("exec /bin/bash ./ygtoyn.sh $filename $yname 2>&1", $output, $return); if($return !== 0){ // exec successful if $return_var set 0. !== means equal , identical, is integer , zero. echo "file not created"; } else{ echo "file created successfully"; } print_r($output); however need figure out why script not running correctly half of time. there method can use diagnose issue is? $output variable appearing empty array. here output when run code: file not created array ( ) file created array ( ) file not created array ( ) file created array ( ) file created array ( ) file not created array ( ) update

incompatible pointer type sending NSString to parameter of type NSDate* _Nonnull ios Objective c -

i have following code. here tried 2 methods date , time. if use formatter gives me above error. if not use date format not correct , plus time incorrect. kindly help. nsdate *pickuphourslate; nsdate *drophourslate; formatter = [[nsdateformatter alloc] init]; [formatter setdateformat:@"dd-mm-yyyy hh:mm"]; nslog(@"old date , time : %@",[formatter stringfromdate:[nsdate date]]); this give me output 12-07-2016 18:32 want nscalendar *calender = [[nscalendar alloc] initwithcalendaridentifier:nscalendaridentifiergregorian]; nsdatecomponents *components = [[nsdatecomponents alloc] init]; int pickhourstoadd = [[[nsuserdefaults standarduserdefaults] objectforkey:@"pickuppriortimeperiod"] intvalue]; [components sethour:pickhourstoadd]; pickuphourslate = [calender datebyaddingcomponents:components todate:[formatter stringfromdate:[nsdate date]] options:0]; this line gives me error int drophourstoadd = [[[nsuserdefaults standarduserd

Conditional ng-disabled in AngularJS 1.0.7 -

is possible like: ng-disabled="x >= y" in case y == undefined take z (another value) inside ng-disabled expression in angularjs 1.0.7? you can use code, surely work ng-disabled="x >= ( y == undefined ? z : y )"

javascript - Preloader fade out and content fade in -

i'm sure easy fix. need preloader fade out slowly. tried css animation didn't work. can tell me how should in javascript ? can see in example, transition rough. don't want that. <script> <!--preloader--> var myvar; function preloader() { myvar = settimeout(showpage, 1500); } function showpage() { document.getelementbyid("preloader").style.display = "none"; document.getelementbyid("wrapper").style.display = "block"; } </script> codepen example add following changes codes. #preloader { transition:1s ease; } #wrapper { opacity:0;/*remove display , hide opacity*/ } function showpage() { document.getelementbyid("preloader").style.opacity = 0; document.getelementbyid("wrapper").style.opacity = 1; }

javascript - Using PHP login along side OAuth2 -

so creating website learn php/javascript/html/css , on , ran problem can't come solution. have regular login form using php uses post send data , authenticate. want integrate external twitch.tv oauth2 authentication. by using normal php login store information inside postgresql database using php. want similar using oauth2. example store twitch.tv name username inside database , token password. the problem external authentication using based on javascript api , stores information inside dom storage found unable access using php. redirect_uri token fragment can't retrieved php. should scrap js part , try doing entirely in php? side question: checked other website uses twitch authentication , uses these callback links " https://api.nightbot.tv/auth/twitch/callback?code= ****". these callbacks? you should use redirects implied js frameworks. works same facebook. redirects used token. generate on side random token store in session. once user logs in

Can you plot a location on the UWP Map Control with an altitude? -

i have uwp app mapcontrol , draw mapicons on map specific locations. can give them altitude? in order position elements @ specific locations on map, 1 use mapcontrol.location attached property: <image source="ms-appx:///assets/pinstore.png" width="30" maps:mapcontrol.location="{x:bind location}" maps:mapcontrol.normalizedanchorpoint="{x:bind anchor}"/> i haven't checked myself but, given mapcontrol.location property of type geopoint , geopoint supports altitude value , reference system assume work. need display map in 3d mode (use style property of mapcontrol) , tilted (use 'desiredpitch` property on mapcontrol) altitude "makes sense" though.

javascript - Dynamic & Complex rowspan in HTML table -

Image
link jsfiddle here json format { "result": { "buildname1": [{ "table1": ["xxx","yyy"] }, { "table2": ["xxx","yyy"] }, { "table3": ["xxx","yyy"] }], "buildname2": [{ "table1": ["xxx","yyy"] }, { "table2": ["xxx","yyy"] }, { "table3": ["xxx","yyy"] }] }, "build sets": "yyy", "destinationpath": "xxx", "status": 1 } this function using dynamically create table. function generatetable(data){ //data parsed json object ajax request $("#test-table tbody").empty();//empty table first if(data.result != null){ $.each(data.result,function(key,value){

linux - Solr server memory and disk space -

context: i have aws ec2 instance 8gb ram 8gb of disk space it runs solr 5.1.0 with java heap of 2048mb -xms2048m -xmx2048m extra: (updated) logs generated on server imports happen in intervals of 10s (always delta) importing db ( jdbcdatasource ) i don't think have optimization strategy configured right now gc profiling? don't know. how can find out how large fields .. , large? situation: the index on solr has 200.000 documents , queried not more once per second. however, in 10 days, memory and disk space of server reaches 90% - 95% of available space. when investigating disk usage sudo du -sh / returns total of 2.3g . not as df -k tells me ( use% -> 92% ). i can, sort of, resolve situation restarting solr service. what missing? how come solr consumes memory , disk space , how prevent it? extra info @tmbt sorry delay, i’ve been monitoring solr production server last few days. can see roundup here: https://www.dropbox.com/s/x5diy

Android: Open external app, close it and return to original -

i'm new android development, , creating app remote control use in test enviroment. what i'm trying open app, in case netflix, wait x seconds , closing external app , return own app. open netflix i'm using url: intent browserintent = new intent(intent.action_view, uri.parse("https://www.netflix.com/watch/80015343?preventintent=false")); browserintent.setflags(intent.flag_activity_new_task); context.startactivity(browserintent); this in return opens media client app installed on device. though might able close netflix, , return own app, tried running through open processes following: for(activitymanager.runningappprocessinfo runningprocess : runningprocesses){ system.out.println(runningprocess.processname); if(runningprocess.processname.equals(netflix_package_name)) { android.os.process.sendsignal(runningprocess.pid, androi

php - I want to stop order complete notification for local-pickup in wp-woocommerce -

i want stop order complete notification local-pickup in wp-woocommerce code in child theme function.php not working please me ... function wc_stop_order_notification( $email_class ){ global $post; $order = new wc_order($post->id); $wc_oreder_status = $post->post_status; $shiping_method_used_in = $order->get_shipping_method(); if( $shiping_method_used_in == 'local pickup' && $wc_oreder_status == 'wc-completed'){ remove_action( 'woocommerce_order_status_completed_notification', array( $email_class->emails['wc_email_customer_completed_order'], 'trigger' ) ); } } add_action( 'woocommerce_email', 'wc_stop_order_notification' ,99); 'woocommerce_email' may not work. use hook 'woocommerce_order_status_completed' instead.

ruby on rails - Cached fragment never expires -

i have rails application managing public events. within view trying cache fragment expires every 8 hours. fragment caches never expires. looking @ site today fragment showing events 23rd june, last time manually flushed fragment cache. i'm using following snippet renders list of event titles , dates: - cache('sidebar-cache', :expires_in => 8.hour) = render "shared/sidebar_festivals" i have tried following (24 hours instead of 8) same issue: - cache "sidebar_cache", expires: 1.day.from_now(time.now.beginning_of_day) = render "shared/sidebar_festivals" i have caching enabled in production.rb config file: config.action_controller.perform_caching = true is there else need enable or fragment caching expire? i'm using rails 4.2.1 any appreciated. the issue having related timezones. time zone on server set eastern standard time whereas server located in london. rails app using utc. mismatch enough cause i

php - Doctrine querybuilder TO_DAYS -

is there equivalent doctrine of sql query? select tbl_name to_days(now()) - to_days(date_col) <= 30; entity has /** * @var \datetime * @orm\column(type="datetime",nullable=true) */ protected $newstatusdata; so, need records condition "nowdate - newstatusdata =< 30 days" update thanks alok , answer given below namespace appbundle\entity; use doctrine\orm\entityrepository; class questrepository extends entityrepository { function getnewquests(){ $query = $this->getentitymanager() ->createquery('select q appbundle:quest q date_diff(current_date() , q.newstatusdata) >= 30'); $result = $query->getresult(); return $result; } } may you're looking date_diff() dql function. calculate difference in days between given dates. it accepts 2 arguments of date . so can query data this, <?php $result=$this->getentitymanager() ->createquery("s

javascript - On typing character on drop down it is selecting any random match from options and triggering change event -

below code in backbonejs + coffeescript. scenario: open countries drop down , type 'i' select countries starting 'i' typing triggers change event drop down gets closed expected: drop down should not closed , should highlight countries starting 'i' i trying event triggered on select of options note: have used jquery easy drop down plugin link backbonejs code - class brown.views.home.operatorsignup extends backbone.view events: 'change #country' : 'getstate' getstate: (event)-> unless _.isempty($('#country').val()) $('#state').html @statestemplate(states: '') html code - <div class="form-group colcountry customselectrow"> <select id='country' name='country' class="form-control search"> <option value="" class="countrylabel">country</option> <% _.each(countries, function(val, key, object){%>

javascript - bootstrap navbar doesn't toggle -

Image
when try mobile version of jumbotron-based page, navbar doesn't toggle. want fold out in the example doesn't. maybe i'm missing code, can me make work? screenshot how supposed when navbar folds out in [the example. this my page , based on jumbotron navbar foldout doesn't work when press button upper right, doesn't toggle. my code (identical example). <nav class="navbar navbar-inverse navbar-fixed-top"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar"> <span class="sr-only">toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"