Posts

Showing posts from July, 2010

google analytics - What does field `hits.publisher.adsRevenue` mean in GA to BigQuery export schema? -

i have integrated ga bigquery , checking consistency of data. found of metrics in ga correctly matches data aggregated in bigquery. got stuck following metrics description not available in bigquery export schema https://support.google.com/analytics/answer/3437719?hl=en . hits.publisher.adsclicked hits.publisher.adsrevenue etc. i looked both ga , bigquery metrics guess mapping of above listed fields unfortunately not able find related metrics in ga. these fields when use adsense or adexchange serve ads in website. if don't use of these products think they'll blank.

compression - Powershell Scripting - Zipping, Moving BAK files to a new folder named for the date of BAK file creation -

firstly, hello , apologies stupidly long title... secondly, hope out there can should simple task has annoyed me past 4days, elaborate; i have 4 x bak file created between 22:30 , 23:00hrs each night. each bak file named differently , append date in format "yyyy_mm_dd". i need 7z each bak file separate archives , move them new directory either named date created or appended date of file keep format "yyyy_mm_dd". (both same code different, whichever easiest) i believe have separate lines of script need... for creating 7z dir *.bak | foreach-object { & "c:\program files\7-zip\7z.exe" -t7z -mx3 ($ .name+".7z") $ .name } for creating folder $folder = new-item -itemtype directory -path "drive2:\folder1\folder2\$((get-date).tostring('yyyy-mm-dd'))" for moving files get-childitem 'drive1:\folder1\folder2\*.7z' | copy-item -destination $folder can point out being complete n

excel - Compare multiple data from rows -

Image
i'm looking way compare multiple rows data each other, trying find best possible match. each number in every column must approximately match other numbers in same column. example: customer #1: 1 5 10 9 7 7 8 2 3 customer #2: 10 5 9 3 5 7 4 3 2 customer #3: 1 4 10 9 8 7 6 2 2 customer #4: 9 5 6 7 2 1 10 5 6 in example customer #1 , #3 quite similar, , need find way highlight or sort rows can find best match. i've tried using conditional formatting highlight numbers similar, quite confusing, because amount of data quite big. any ideas of how solve this? thanks! the following formula entered in (say) l1 , pulled down gives best match current row based on sum of absolute differences between corresponding cells:- =min(if(row($c$1:$k$4)<>row(),(mmult(abs($c1:$k1-$c$1:$k$4),transpose(column($c$1:$k$4))^0)))) it array formula , must entered ctrl shift enter . you can sort on column l bring customers lowest si

javascript - Working in Angular js with remote REST API -

i want know if there way call remote rest api call within angular js . as of now, have setup , bower dependency management , grunt server , other build task runner (minification,compression,). angular js front-end framework. i have rest api deployed on server xxx.xxx.xxx.xxx:9090 . , have configured cors filters on server . if access rest api within angular js app, makes 2 requests 1 option , http verbs . on many blogs, found opening cors filter on server security risk. so there safe way without enabling cors on server , , consuming rest api in angular without domain problem. as running angular app on localhost , rest api deployed remotly and after building application using grunt running in tomcat server . know not right don't have choice apart due various access issues on client side thanks in advance there more 1 way, if using grunt, can use grunt-connect-proxy route call different server api. if using apache, can set proxypass.

java - Problems from Tomcat using different JDK as recommended by vendor -

we have confluence running on tomcat on linux server. vendor stated should use jdk7 , not new one. given mistake in past, jdk has been upgraded jdk7 jdk8. cought after months of operation. my question is: implications can there if run using different jdk? java versions backward compatible: oracle takes great care make sure java program works on older java version work on newer java version. should work without need make changes program. despite great care oracle takes, it's possible there small incompatibilities. each new version of jdk comes documentation explains these possible incompatibilities older versions. jdk8, see: compatibility guide jdk 8 . however, it's still possible write java programs won't work correctly on future java versions, example when directly use classes supposed internal jdk (see: why developers should not write programs call 'sun' packages ). with regard confluence, it's case vendor didn't formally test version

Polymer iron-scroll-threshold with iron-ajax -

is there instruction/example on how iron-scroll-threshold iron-ajax. basically, iron-scroll-threshold load more content using iron-ajax overtime scrolling reaches threshold. however, examples can find resort using javascript load more content via ajax. if there way using iron-ajax can keep code lot cleaner. check out jsbin complete example. in short, need handle iron-scroll-treshold 's on-lower-threshold or on-upper-threshold event, call iron-ajax 's generaterequest() method. need handle new items in iron-ajax 's on-response event. code: <dom-module id="test-app"> <template> <iron-ajax id="ajax" url="https://randomuser.me/api/" handle-as="json" params='{"results": 20}' on-response="categoriesloaded"> </iron-ajax> <iron-scroll-threshold on-lower-threshold="loadmoredata" id="threshold">

sql - How to fetch data from a query by extracting month from the created date field -

i have table , want extract data on basis of month value of created date field. how can obtained? here query: select * (table name a) select extract (month a.createddate )from table name table contains field timestamp type. if need apply filter on month of timestamp column: select * yourtable extract (month yourfield) = ...

maps - Mapserver projection conversion -

i have spent dozens of hour trying find possible change projection mapserver no luck far. input format epsg 3067 , need convert epsg 900913 google map use. in map object add projection "init=epsg:900913" end this sets output projection of map. in t layer object add projection "init=epsg:3067" end this set projection incoming data layer in. you need add following line /usr/share/proj/epsg or equivalent path if on windows: spherical mercator projection <900913> +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +over +nadgrids=@null +no_defs <>

gruntjs - Use npm module in Grunt registerTask -

i use npm module on new tasks, i've no result : grunt.registertask('done', function () { var prepend = require('prepend'); var file = 'app.bundlees6.js', string = '// string'; prepend(file, string, function(error) { if (error) console.error(error.message); else console.log('yeah'); }); }); when run grunt done , i'm not see console.log, : running "done" task done, without errors. do know how can use npm module on grunt registertask ? thank ! the problem task it's asynchronous. you can register asynchronous grunt tasks, have call this.async() obtain completion callback , have call callback, when task complete (passing false if task has failed). like this: grunt.registertask('done', function () { var callback = this.async(); var prepend = require('prepend'); var file = 'app.bundlees6.js', string = &#

r - Filtering on duplicated attributes -

i have dataframe of widgets want created predictions: mydata<-data.frame(widget=c(1,2,3,4,5), type=c("a","e","c","c","d")) the way model works create type a:e every widget , predict. each prediction assigned attribute state model used generate prediction: alltypes<-merge(mydata[,-which(names(mydata)=="type")], data.frame(type = c("a","b","c","d","e"), = true)) names(alltypes)[1]<-"widget" alltypes$predictions<-5*1:25 attr(alltypes$predictions,"modelused")<- c(rep("model1",5),rep("model2",5),rep("model1",5),rep("model3",5),rep("model2",5 )) i want return predictions jsutfor original type in mydata join on original table: library(dplyr) finaldata<- inner_join(alltypes, mydata, = c("widget", "type")) an examination of att

php - Remove last value in a string -

<?php $values = "aaa,bbb,ccc,ddd,";//remove last comma $values = "aaa,bbb,,,";//remove commas after bbb aaa,bbb ?> how remove commas in example you can trim "," using below code: use php function rtrim . <?php $values = "aaa,bbb,ccc,ddd,";//remove last comma echo rtrim($values,','); echo "<br/>"; $values = "aaa,bbb,,,";//remove commas before bbb aaa,bbb echo rtrim($values,','); ?>

user interface - Using input to create UI in Shiny R -

Image
i building app in shiny (r). @ beginning user can upload file use (i doing sort data analysis). goal able use files without knowing how many columns file has, , how data looks like. so have select columns number, , made small preview app select columns , display them next original: library(shiny) ui <-fluidpage( headerpanel("select data"), sidebarlayout( sidebarpanel( fileinput("uploadfile", "xlsx file"), textinput('vec1', 'choose training columns', "3,4"), actionbutton("choose","choose data") ), mainpanel( fluidrow( column(6,tableoutput("data_raw")), column(6,tableoutput("data_selected")) ) ) ) ) server <- function(input, output) { output$data_raw <- rendertable({ infile <- input$uploadfile if (is.null(infile)) return(null) data_raw <<-read.xlsx(infile$datapath, 1) }) observe({ if(input$choose>0){

angularjs - Plivo events not registering -

Image
i created sample application using plivo websdk in angular js through can recieve call on web browser. initate call using node server works fine. when integrated sample code project connecting plivo not not registering events whenever call triggered not performing task. this project integrated plivo logs.events not registered.it stops after printing os version , "plivo client connected.." , ends. while in sample app prints following logs. i not able figureout missing becoz of events not getting registered,what can possible scenario.can please help.thanks i found solution,actually in sample app passing data like: { "plivo_sip_credentials":{ "username":"abc", "password":"sdfg345" } } but in actual application did silly mistake , directly passing object.plivo_sip_credentials like: { "username":"abc"

ch - Count of field of 3 tables -

i have 3 table employee,home,office in employee 2 fields available emp id,tag ,home has 2 filed home id,htag , office has 3 fields emp id,tag,ofzname employee emp id tag 1 yellow 2 pink 3 green home home id htag 1 pink 2 pink 3 blue office emp id tag ofzname 1 blue mumbai 2 green chennai i want query result pink 3 blue 2 green 2 by combining 2 table posting query punctuation better understandable people going help. anyway... use join combine 2 tables have information need should in join , them select , write where clause common field id.

php - Laravel - How to do nested where with And and OR in same query -

i have following query $updates = folderlocker::where('created_at', 'like', $date . '%') ->orwhere('date_forwarded', 'like', $date . '%') ->orwhere('date_locked', 'like', $date . '%') ->orwhere('date_completed', 'like', $date . '%') ->wherein('videographer_id', $videographerarray) ->orderby('client_id', 'desc') ->tosql(); it generates select * `folder_lockers` `created_at` ? or `date_forwarded` ? or `date_locked` ? or `date_completed` ? , `videographer_id` in (?, ?, ?, ?, ?, ?, ?) order `client_id` desc how can make wherein clause main 1 , or clauses in and? you can group wheres in closure, this: $updates = folderlocker::wherein('videographer_id', $videographerarray) ->where(function ($query) use ($date)

jquery - Angular2 - Binding of datepicker -

how chosen date of input , put tag <p> . i'm using jqueryui datepicker, tried binding trying capture change , click events, did not work. can me? import "rxjs/rx"; import {component, afterviewinit} '@angular/core'; declare var $: any; @component({ selector: '<my-evento></my-evento>', template: `<input (change)="updatedate($event)" type="text" id="datepicker"> <p>{{ date }}</p>` }) export class eventocomponent implements afterviewinit{ date: string; constructor(){} ngafterviewinit() { $(function() { $("#datepicker").datepicker(); }); } updatedate($event): void { this.date = $event.target.value; } } when bind model this: <input [(ngmodel)]="date" type="date" id="datepicker"> does compiler tell format has in yyyy-dd-mm format? if so, may

java - Batch insert in MariaDB with on duplicate key update -

i have following table cl: id - int(10) primary key contact - int(10) list - int(10) with unique index on contact , list. when run concurrently following query in batch 100 records: insert cl(list, contact) values (?, ?) on duplicate key update cl.id = cl.id under high pressure fails in 20% following error: java.sql.sqlsyntaxerrorexception: have error in sql syntax; check manual corresponds mariadb server version right syntax use near 'on duplicate key update cl.id = cl.id' @ line 1 80% of queries runs fine. when rerun failed queries same parameters, again 20% fail. why of queries fail , produce no errors when executed second time? changing query to insert ignore cl(list, contact) values (?, ?) solved issue. though unclear why mysql throwing java.sql.sqlsyntaxerrorexception instead of more unambiguous.

css - Is there a way to break a list into columns? -

my webpage has 'skinny' list: example, list of 100 items of 1 word in length each. reduce scrolling, want present list in 2 or 4 columns on page. how should css? <ul> <li>item</li> <li>item</li> <li>item</li> <li>item</li> <li>item</li> <li>item</li> <li>item</li> <li>item</li> <li>item</li> <li>item</li> </ul> i prefer solution flexible if list grows 200 items, don't have lot of manual adjustments accommodate new list. the css solution is: http://www.w3.org/tr/css3-multicol/ the browser support you'd expect.. it works "everywhere" except internet explorer 9 or older: http://caniuse.com/multicolumn ul { -moz-column-count: 4; -moz-column-gap: 20px; -webkit-column-count: 4; -webkit-column-gap: 20px; column-count: 4; column-gap

Overflow error when mixing numpy arrays and regular python 2.7 arrays -

i'm having trouble understanding type conversions occur when try put data numpy array regular python array. figured out enough generate minimal example reproduces error: import numpy import array array_l = array.array('l', [0xff000000]) numpy_l = numpy.array([1], dtype='l') #this code raises , overflow #overflowerror: python int large convert c long array_l[0] += numpy_l[0] why final line ever convert intermediate value c long? shouldn't use c unsigned long? from python array documentation , type 'l' corresponds unsigned long of @ least 32 bits. element in numpy_l array has type numpy.uint32 . realize these not same type, have expected compatible. if addition performed using unsigned long integers, there no overflow. if perform same calculation using numpy arrays, or standard library arrays, have no issues. however, whole purpose of code take large numpy array , reformat use different object. i can fix problem using explicit cast

bash - How do I set case for tar, gz and tar.gz files? -

i have few files in directory this: xxx.tar.gz xxx.tar yyy.tar.gz yyy.tar zzz.txt.gz ... ... i have list.txt files this: list.txt: /home/phe/xxx.tar.gz /home/phe/xxx.tar /home/phe/yyy.tar.gz /home/phe/yyy.tar /home/phe/zzz.txt.gz ... ... i need extract these files this: for file in (cat list.txt); tar zxvf $file done how can open tar.gz, txt.gz , tar files in same command? you that: while ifs= read -r file; file="${file##*/}" # remove directory case $file in *.tar.gz) tar xzvf "$file" ;; *.txt.gz) gzip -d "$file" ;; esac done < list.txt note tar command suspect need specify output directory -c because otherwise extracted in current directory.

How to transfer XML-nodes unchanged to output with XSLT? -

i transforming xml document html document via xslt. xml document tolerates html-tags used within special tags: <sequence>order pizza</sequence> or alternatively <sequence> <ol> <li>order pizza</li> <li>switch on television</li> </ol> </sequence> how tell transformation transfer on tags <ol> , <li> etc. unchanged output - in case html follows: <p> <ol> <li>order pizza</li> <li>switch on television</li> </ol> </p> in general, can choose 1 of 2 possible strategies. either: pass all nodes output unchanged default, , add templates matching nodes want modify exception; or: have template matches nodes want pass unchanged explicitly. here's implementation of first strategy: xslt 1.0 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform"> <xsl:output met

json - How to join nested values into one column with tidyjson? -

i want join 2 values in 1 column instead of spreading '{"name": {"first": "bob", "last": "jones"}, "age": 32}' %>% spread_values( first.name = jstring("name", "first"), age = jnumber("age") ) %>% unite(conc, c("first.name", "age"), sep=" ") but keep having following error all select() inputs must resolve integer column positions. following not: c("first.name", "age") my desire output have 1 new column "conc" replacing both first.name , age , concatenate every string value. such "jones 32" which weird because if remove last line gives me proper data.frame , can access first.name , age. any hint? though tbl_json objects inherit tbl_df , not play nicely once done parsing , begin further manipulation in tidyjson , dplyr . reason have additional methods , attributes tagging along not

pascalscript - External Pascal in Inno script which gives Unknown Preprocessor directive -

Image
i trying use synopse json library in inno setup. getting unknown preprocessor directive. obviously inno setup uses limited form of pascal doesn't include things synopse using. question is, there way compile synopse library or otherwise transform file can still call external library? don't want go in , mess synopse code-i think code complaining crucial, anyways. minimal example generates error (script in same dir folder called lib contains *.pas): #define myappname "minimal" #define myappversion "2.0" [setup] ; note: value of appid uniquely identifies application. ; not use same appid value in installers other applications. ; (to generate new guid, click tools | generate guid inside ide.) appname={#myappname} appversion={#myappversion} appvername={#myappname} [code] #include "lib\syncrossplatformjson.pas"

Android SDK Path is Missing on Eclipse -

Image
when trying set android sdk manager path location in eclipse, surrounded error massage. here snapshot of it.

job scheduling - job scheduler in android N with less then 15 minutes interval -

part of question, how can set job less 15 minutes interval in "nougat", answerd "blizzard" in answer here: job scheduler not running on android n explained problem , suggested use following workaround: jobinfo jobinfo; if (build.version.sdk_int >= build.version_codes.n) { jobinfo = new jobinfo.builder(job_id, servicename) .setminimumlatency(refresh_interval) .setextras(bundle).build(); } else { jobinfo = new jobinfo.builder(job_id, servicename) .setperiodic(refresh_interval) .setextras(bundle).build(); } however, using suggested .setminimumlatency(refresh_interval) just starts job once; how periodic period of around 30 seconds on android nougat device (not using handler or alarm manager)? i struggled same thing when wanted setup job refresh small part of data. found out solution problem may setting job 1 more time same id after called jobfinished(jobparameters, boolean) . think should work every tim

java - JAXB marshall elements with comments -

so have class @xmlaccessortype(value = xmlaccesstype.field) public class item { @xmlattribute private string ida; private string namea; @xmlattribute private string idb; private string nameb; @xmlattribute private string idc; private string namec; public item() { } public item(string ida, string namea, string idb, string nameb, string idc, string namec) { this.ida = ida; this.namea = namea; this.idb = idb; this.nameb = nameb; this.idc = idc; this.namec = namec; } @override public string tostring() { return "item [namea = " + namea + ", nameb = " + nameb + ", namec = " + namec + "]"; } } and container: @xmlrootelement @xmlaccessortype(xmlaccesstype.field) public class items { private list<item> items; public items() { } public items(list<item> items) { this.items = items; } } and i'm using listener write comments after each item: public class addcommentslistener extends mars

php - ZF2 + Doctrine: Read data from a database via TableGateway and hydrate Doctrine entity including its related objects with it -

i developing centralized management software our legacy web shops. these shops have been developed third party , quite old, use pretty old practices too. orders , related objects stored in 1 single table, therefore table has lot of fields , quite bloated. our new management system uses relational approach. i. e. have table order store orders , table address store addresses. each order references shipping , billing address via foreign keys. doctrine 2 used handling these entities , relations. obviously have import orders shops database of our management system. happens directly accessing database of each shop, querying order data , inserting in management system's own database. i using zf2 tablegateway retrieve data shops , hydrate entities using doctrine's doctrineobject hydrator little processing possible. however, out of box doctrineobject hydrator expects related objects passed in nested arrays. because have not yet figured out if tablegateway can produce mult

ios - Type Any has no subscript members Swift 3.0 -

trying convert function make swift 3.0 compatible. had change parameter json anyobject any : fileprivate func checkforauthorizationfailure(_ json: any) -> bool { let responsemessage = json["response"]! as? string if responsemessage == "unauthorized. invalid token or email." { return true } return false } however @ line: let responsemessage = json["response"]! as? string getting error: "type has no subscript members" . doing wrong here? you have cast anyobject before using subscript. fileprivate func checkforauthorizationfailure(_ json: any) -> bool { let responsemessage = (json anyobject)["response"]! as? string if responsemessage == "unauthorized. invalid token or email." { return true } return false }

mysql - Multiple UPDATEs and INSERTs with PHP/MySQLi -

i need reconcile between existing set of tables , new/changed information on regular basis, , have set of ~30 update/insert operations has run every time. since 'mysql_query' deprecated, , i'd prefer not recode in oo, there reasonable procedural way run of these in sequence without having call ' mysqli_free_result() ' after every single one? just record, i've tried running them set of mysqli_query statements without mysqli_free_result() , , it's mess: of operations go through while others fail silently. frankly, shell script bunch of ' mysql -e ' commands in more reliable... needs web-driven app, that's not viable anymore. your assumptions wrong. mysqli_query's behavior similar 1 of mysql_query , don't need other modifications. neither mysqli_free_result() related problem. the meaningful part of question queries fails silently. make them fail noisily, tell mysqli so. add line before mysqli_connect mysqli_report(mysql

bash - Unix cUrl cookie login to a .jsp servlet page, request and save file requested -

i have tried export text file resulted request .jsp page java script enabled oracle bi publisher framework below command in unix: curl 'http://server/xmlpserver/report.xdo&_xt=new+template+1&_xf=text' -h 'accept-encoding: gzip, deflate, sdch' -h 'accept-language: en-us,en;q=0.8' -h 'upgrade-insecure-requests: 1' -h 'user-agent: mozilla/5.0 (windows nt 6.1) applewebkit/537.36 (khtml, gecko) chrome/53.0.2785.116 safari/537.36' -h 'accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8' -h 'referer: http://server/xmlpserver/report.xdo' -h 'cookie: jsessionid=qq!11!22; ora_xdo_ui=en_us; jsessionid=qq!11; oracle.uix=0^^gmt+3:00^p' -h 'connection: keep-alive' --compressed -o test.txt this command 'copy bash curl command' google chrome debugger , work syntax command use id jsession in cookie expire. i need login on .jsp page generate cookie jsession=qq!11!22 , jsess

crash - import CallKit crashes randomly on iOS 9 -

i have imported callkit framework optional only. import callkit crashes while running on ios 9 @ launch. works on ios 10. worked fine in xcode 8 beta 6 issue happening on xcode 8. code in swift 3. any appreciated. callkit api ios 10.0+. won't work ios 9.0. use condition ios version 9.0 , 10.0 avoid crash. reference : https://developer.apple.com/reference/callkit?language=objc

c# - "CrystalDecisions.Windows.Forms.ReportDocuments' does not contain a definition for 'Load'" error while loading ReportDocuments -

reportdocuments rdoc = new reportdocuments(); string apppath = application.startuppath; string reppath = @"reports\report.rpt"; string fullpath = path.combine(apppath, reppath); rdoc.load(fullpath); crystalreportviewer1.reportsource = rdoc; crystalreportviewer1.refresh(); this code gives error error1'crystaldecisions.windows.forms.reportdocuments' not contain definition 'load' , no extension method 'load' accepting first argument of type 'crystaldecisions.windows.forms.reportdocuments' found (are missing using directive or assembly reference?) c:\users\acs\documents\visual studio 2013\projects\crystalreportdemo\crystalreportdemo\form1.cs at line rdoc.load(fullpath); please me solve problem. change reportdocuments reportdocument.

powerpoint - Creating PPT with Perl - error 0x8001010a "application is busy" -

actually i'm writing perl script creating powerpoint presentation automatically. reason is, need slides same look. so copy first slide , update text in boxes new text out of excel file. atm works fine rly unstable, pp created , creation interrupted error win32::ole<0.1712> error 08001010a: "the message filter indicated application busy" in method/propertyget "textframe" @ [pfad] line 150 would nice if me fix or explain me error comes from

c# - dotnetcore GetTypeInfo() not defined on variables of type object? -

the code below stripped down version of original code demonstrates problem. in dotnetcore (1.0.1) .isenum property moved system.reflection. made changes work expected. however, 1 cannot make work of type object. compiler throws error: c:\tmp\netcore\repro\program.cs(14,17): error cs0103: name 't' not exist in current context public class program { enum kleur {red, blue, green} public static void main(string[] args) { object mytype = kleur.green; if (mytype.gettypeinfo().isenum) { console.writeline("yes enum"); } } } is there workaround test if object of type enum in dotnetcore? there specific reason why there no extension method type object (all other types needed seem work). when moving type typeinfo , replacement .gettype() not .gettypeinfo() , it's .gettype().gettypeinfo() . that's because type not removed, instead split type , contains basic members, , typeinfo , has rest.

objective c - String substitution with variable constants -

this question has answer here: objective c macro append string 3 answers in project, define urls such: #define termsurl @"http://127.0.0.1:8000/terms/" #define privacyurl @"http://127.0.0.1:8000/privacy/" ... since root url ( http://127.0.0.1:8000/ ) same, there way set constant, , use string substitution remaining pieces? for example, in other files, this: nsstring *devbaseurl = @"http://127.0.0.1:8000/"; nsstring *url1 = [nsstring stringwithformat:@"%@terms/", devbaseurl]; is there way current approach? shared.h #define termsurl @"http://127.0.0.1:8000/terms/" #define privacyurl @"http://127.0.0.1:8000/privacy/" #define url_base @"http://127.0.0.1:8000/" yourclass.m nsstring * stringurlbase = url_base; nsstring *url1 = [nsstring stringwithf

redis - Python multithreaded profiling for method that uses background process workers -

i'm trying find best way profile method uses redis queue set number of jobs running workers, waits till they're done, , returns. i tried using cprofile , profiles what's going on in main thread. there way configure see what's going on workers, or tool can this?

swift3 - How do you write a completion handler in Swift 3? -

i wondering how make completion handler function i'm creating in swift 3. how did function right before updated swift 3: func logout(completionhandler: (success: bool) -> ()) { backendless.userservice.logout( { ( user : anyobject!) -> () in print("user logged out.") completionhandler(success: true) }, error: { ( fault : fault!) -> () in print("server reported error: \(fault)") completionhandler(success: false) })} but can't figure out best approach works right now. in swift 3 function parameter labels in closures gone. remove occurrences of success: , add @escaping func logout(completionhandler:@escaping (bool) -> ()) { backendless?.userservice.logout( { user in print("user logged out.") completionhandler(true) }, error: { fault in print("server reported error: \(fault

CMake autodetect Visual Studio directory on windows -

currently, in order create static libs on windows, manually have specify visual studio directory is. cmake -g "mingw makefiles" -dcmake_c_compiler=gcc -dcmake_gnutoms=1 -dcmake_gnutoms_vcvars="c:\program files (x86)\microsoft visual studio 14.0\vc\vcvarsall.bat" .. is there way cmake automatically query location of visual studio? windows-gnu.cmake module seems able query registry location of lib.exe executable, still forces user manually specify it's location. excerpt cmake: find_program(cmake_gnutoms_vcvars names vcvars32.bat doc "visual studio vcvars32.bat" paths "[hkey_local_machine\\software\\microsoft\\visualstudio\\12.0\\setup\\vc;productdir]/bin" #d "[hkey_local_machine\\software\\microsoft\\visualstudio\\11.0\\setup\\vc;productdir]/bin" "[hkey_local_machine\\software\\microsoft\\visualstudio\\10.0\\setup\\vc;productdir]/bin" "[hkey_local_machine\\software\\microsoft\\visua

hosting - Uploading Laravel Project into the Web Server -

i have folder web server / , put files/folders except public folder(with index.php) of new laravel project , in /public_html/ put files public folder. i didn't have change paths in bootstrap folder containing 2 files app , autoload, , did in first path in uploading laravel project onto web server instead of showing notorious welcome laravel, shows nothing. i using godaddy web hosting. doing wrong? solution: 1. have home directory in web server / which parent of public_html folder, here upload folder created files contenting laravel project files, folders except public folder. in the /public_html you upload files containing in public folder of laravel project 2. open index.php public_html , change these things: require __dir__.'/../bootstrap/autoload.php'; $app = require_once __dir__.'/../bootstrap/app.php'; into require __dir__.'/../laravelfoldernameinroot/bootstrap/autoload.php'; $app = require_once __dir__.'/../larav

css - Fullscreen map with Semantic UI -

Image
i'm trying display semantic-ui sidebar , full-screen map. the deal construct map events toggle sidebar(s). problem css. i'm able show expected, i'm having first item on menu shown, pushing lot of stuff down. this relevant html structure: <body> <div class="ui sidebar vertical menu"> <a class="item"> item 1 </a> <a class="item"> item 2 </a> <a class="item"> item 3 </a> </div> <div class="pusher"> <div id="map"></div> </div> <script type="text/javascript" src="bower_components/jquery/dist/jquery.min.js"></script> <script type="text/javascript" src="bower_components/semantic/dist/semantic.min.js"></script> <script type="text/javascript" src="bower_components/leaflet/dist/leaflet.js"></

nginx - Make PHP call an application in another server -

i have webpage (html, css, javascript) hosted in nginx & ubuntu & digital ocean server. webpage has part users submit file , call application php. wondering if possible host application alone in windows server 2012 r2 & microsoft azure , have already. here example. the webpage (though real webpage has more contents) hosted in ubuntu server. upload file button linked uploadfile.php : <?php copy($_files["file"]["tmp_name"], "uploads/" . $_files["file"]["name"]); $n1 = "uploads/" . $_files["file"]["name"]; echo "uploaded: " . $n1 . "<br>"; exec("mono c1.exe $n1"); ... ?> the application c1.exe developed in c# under windows. because new feature uses ode32.dll , cannot run mono anymore. have host c1.exe in windows server. and don't want move whole website windows server. moreover, if possible, want web address in browser address bar cons

acumatica - Add Excel upload control to grid toolbar -

Image
is there way grid control allows 1 upload data excel sheet? haven't found command put control on toolbar. you need decorate data view pximportattribute . example: [pxviewname(messages.soline)] [pximport(typeof(soorder))] [pxcopypastehiddenfields(typeof(soline.completed))] public pxselect<soline, where<soline.ordertype, equal<current<soorder.ordertype>>, and<soline.ordernbr, equal<current<soorder.ordernbr>>>>,orderby<asc<soline.ordertype, asc<soline.ordernbr, asc<soline.linenbr>>>>> transactions; pximport attribute enables user load data file grid. attribute placed on data view grid uses retrieve data. we have used pximportattribute(type) constructor input parameter first (primary) dac referenced primary view of graph current view declared. set grid's allowupload property true . allowupload property controls display of load records file toolbar button.

javascript - Angular js how to highlight first point on line graph/chart -

a name filter (text box) should present filter cities based on input value , should displayed on graph, not able find way out. var temp = [{"name":"bangalore","temprature":25},{"name":"chennai","temprature":45},{"name":"mumbai","temprature":40},{"name":"goa","temprature":35},{"name":"madurai","temprature":38}]; var label= []; var value= []; var value1 = []; var array = eval( temp ); for( var = 0; < array.length; i++ ) { label.push(array[i].name); value.push(array[i].temprature); } value1.push(value); var myapp = angular.module('myapp',['chart.js']); myapp.controller('mycontroller',function($http,$scope){ $scope.labels = label; $scope.data = value1; $scope.idselectedvote = 1; i have requirement of highlighting first node in plotted graph, not able find wayout in an

parsing - ANTLR4 grammar not behaving as expected -

Image
i have data required parsed. using antlr4 tool auto generate java parsers , lexers, can use form structured data input data given below grammar: grammar subdata; subdata: data+; data: array; array: '[' obj (',' obj)* ']'; intarray: '[' number (',' number)* ']'; number: int; obj: '{' pair (',' pair)* '}'; pair: key '=' value; key: word; value: int | word | intarray; word: [a-za-z0-9]+; int: [0-9]+; ws: [ \t\n\r]+ -> skip; test input data: [ {omedademographictype=1, omedademographicid=100, omedademographicvalue=4}, {omedademographictype=1, omedademographicid=101, omedademographicvalue=26}, { omedademographictype=2, omedademographicid=102, omedademographicvalue=[16,34] } ] ouput: line 5:79 mismatched input '16' expecting int line 5:82 mismatched input '34' expecting int parser failing although have

ios - Share Realm Data with WatchOS -

in project want use 1 realm database ios 10 application , watchos 3 application @ same time. did adding frameworks embedded binaries 3 different targets. happened work watchkit extension doesn't seem recognize objects created within ios environment. how possible have shared realm database between 2 devices? update: okay, chrisamanse 's heads-up, did more research on this. it turns out app groups no longer possible on watchos 2. watch apps no longer run extensions on phone; 2 isolated processes without shared resources. as such, means necessary maintain separate realm file on both watch , phone , communicate changes made either through watchconnectivity framework. original: ios applications , extensions (both today widgets , watchos apps) need considered 2 wholly separate entities in own separate containers. default, extension cannot access files inside container of parent application. if you're saving realm file default path (i.e., 'documents'

excel vba - Is it possible to provide a hover functionality over bubble chart using VBA in Powerpoint? -

Image
i exploring powerpoint world project. need know whether can customise bubble chart in power point. need provide hover element individual data points , color data points according range values. please provide me resources start if possible. https://www.experts-exchange.com/questions/28049828/powerpoint-2010-programming-charts-with-vba.html http://www.clearlyandsimply.com/clearly_and_simply/2010/12/better-chart-tooltips-with-microsoft-excel-2010.html above few of resources have gone through. thanks in advance.

javascript - Working on a clock script. I need to add a Zero in front of single digits -

as easy may sound seasoned coder. newbie trying implement on clock page. can contain errors. idea generate 0 in front of single digits (like "02" instead of "2") display purposes. works fine double digits. got, doesn't trick. includes commented lines of different tries have done. appreciate input guys. <script> $(function() { getdata(); myinterval = setinterval(getdata, 30000); }); function getdata(){ var dt = new date(); console.log(dt.getminutes()); var myhr = dt.gethours(); var mymin = dt.getminutes(); //if(myhr < 10) myhrstr = '0' + myhr.tostring(); else myhrstr = myhr.tostring(); //if(myhr.tostring().length < 2) myhrstr = '0' + myhr.tostring(); else myhrstr = myhr.tostring(); //if(myhr.tostring().length < 2) myhr = "0"+myhr; if(myhr.tostring().length == 1) myhrstr = "0" + myhr.tostring(); else myhrstr = myhr.

ruby - How to clear database before seeding in rails -

is there simple line of code can include @ top of seed file clear out each table before inserting new seed data without running rake commands rollback tables or databases? i thinking like: [foo, bar].each{|class| class.destroy_all} the point want add new data each new insertion starts id: 1. want avoid deleting table 100 rows , when add new data it's starting 101. updated answer you've install (or can add gem 'database_cleaner' gemfile) gem called database cleaner helps clean database without affecting database schema._ clean database each time whenever rake db:seed paste # updated require 'database_cleaner' databasecleaner.clean_with(:truncation) on top of seed file. it'll clear database , start count 1 again. disclaimer : updated answer tested, , working in system. =========================================================================== previous untested answer ya can it's depends on database you're using.

C# Selenium Invalid Selector Exception -

i'm using firefox add on select xpath of image want click during automation test using c#, , keep running invalidselectorexception error. here xpath found using firefox. id('ctl00_left_content')/x:div[4]/x:div[1]/x:table/x:tbody/x:tr/x:td[5]/x:p/x:a[2]/x:img i'm using xpath: //*[@id('ctl00_left_content')/x:div[4]/x:div[1]/x:table/x:tbody/x:tr/x:td[5]/x:p/x:a[2]/x:img]" and returns invalidselectorerror and have tried: //*[@id=('ctl00_left_content')/div[4]/div[1]/table/tbody/tr/td[5]/p/a[2]/img] but returns "unable locate element" error. any appreciated. thank you. can add relevant page source? should have closing bracket after the id value part in xpath. missing in xpath.

c# - Completing check boxes within a PDF using iTextSharp -

i'm trying take existing pdf, find existing check boxes , complete them based on criteria using c#. after reviewing other related questions: https://stackoverflow.com/a/4827996/6328714 the main issue having finding of checkbox objects within pdf - believe need able reference correct checkbox within code. as tools view pdf's internal structure using pdfxplorer, i'm not having luck finding actual check boxes within tree-structure. so: do ~need~ object able check box? is checking boxes simple posted code below? (it seems straight forward if so) below example taken linked question: pdfreader reader = new pdfreader(filenamein); pdfstamper stamper = new pdfstamper(reader, new fileoutputstream(filenameout)); acrofields form = stamper.getacrofields(); form.setfield("name","test name"); form.setfield("odot","123456"); form.setfield("consortium","a testing co"); form.setfield("pname","

Artifactory OSS: LDAP authentication timeout errors -

i installing artifactory oss @ company. worked during our tests, in production receive ldap authentication errors. details below: os: centos 7 docker 1.10.1 artifactory version: oss 4.12.0.1 in docker container problem: several times per day artifactory oss stops authenticating users ldap. @ same time, other services in neighbor containers continue operating same ldap server. user authentication rare, release rolling. we found 1 workaround: - restarting artifactory container. the error appears in logs during problem is: 2016-09-22 09:34:55,698 [http-nio-8081-exec-6] [error] (o.a.s.l.abstractldapservice:70) - error connecting ldap server: org.springframework.ldap.uncategorizedldapexception: uncategorized exception occured during ldap processing; nested exception javax.naming.namingexception: ldap response read timed out, timeout used:60000ms.; remaining name '/' @ org.springframework.ldap.support.ldaputils.convertldapexception(ldaputils.java:217) ~[spring

Xamarin iOS : Facebook logout issue -

i using xamarin.facebook.ios sdk (v 4.13.1.0) facebook login. current scenario: in app, once user logs in through facebook credentials , logs out, can hit login , authenticated. expected scenario: once user logs in through facebook credentials , logs out, if wants login again, needs enter facebook , password once again. right log out using following code: nshttpcookiestorage storage = nshttpcookiestorage.sharedstorage; foreach (nshttpcookie cookie in storage.cookies) { if(cookie.domain == ".facebook.com") { storage.deletecookie(cookie); } } but doesn't work. right now, expected result have to: sign out , close app, open safari , clear history. sign out , close app, open safari -> goto facebook website ( won't ask credentials has when logged in our app) , logout. clearly, not best way desired result. can please advise me better approach ?? a

react native - Am i implementing redux correctly in my ReactNative app? -

i implementing mobile application using reactnative redux, app implementing looks that: login (screen) |--> search object (screen) |--> show object , edit (screen) |--> take 2 photos (each photo screen) |--> last screen make new object , save the above flow shows how each screen work , pass next screen. my application state next: { auth: { logged: false, token: '' }, somethingofsidebar... } but feel doing things in wrong way, because of screens have own state, example searchsomethingscreen fetch data server, check if valid , enable pass next screen. feel not doing things in redux way, suppose make actions change entire state application, feel not need more state have. me global things auth data , sidebar (because present across entire application). should make actions every screen change? should put more information in global state application? a 1 more thing, have appcontainer component used in connect have acce