Posts

Showing posts from August, 2011

ios - App taking more time to login and taking more time to load data ionic -

i working on ionic app.when run app in android fine. when build in ios device. taking more time load page , still taking more time in landing screen itself. and in xcode got error in console.: resetting plugins due page load. things did : removed platform , added again added line in index.html http-equiv="content-security-policy" changed wifi connection. 4.quit xcode , done quit ios device. but facing same loading problem long time.please me out. thanks.

xml - Device returns recordings only for the last 24 hours using Onvif method GetRecordingSearchResults -

i'm trying recordings network video recorder using onvif protocol (profile g). first search token using method findrecordings. , recording list via method getrecordingsearchresults using search token. recordings last 24 hours no matter maxmatches, maxresults or recordinginformationfilter use. on web interface of device see contains recordings more last 24 hours. i've tested on app onvif device test tool , same result on app. findrecording method: <soap:body> <tse:findrecordings> <tse:scope> <tse:includedsources> <tse:token>tokenrecordingjob1</tse:token> </tse:includedsources> <tse:includedrecording>tokenrecording1</tse:includedrecording> <tse:recordinginformationfilter>recordingfilter1</tse:recordinginformationfilter> </tse:scope> <tse:maxmatches>10</tse:maxmatches> <tse:keepalivetime>pt60s</tse:keepalivetim

vba - How to Dim a getElementsBy* result -

i doing internet searching vba, , @ 1 point have line set valueresult = currpage.getelementbyid("rg_s").getelementsbytagname("img") where currpage declared htmldocument and i'm wondering how dim valueresult achieve: intellisense (vba's autocomplete) results better execution times (by using specific rather default variant type) when @ locals window, i'm told set gives disphtmlelementcollection type, that's not option when dim . i've read getelementsby* returns node list opposed array, i've been trying follow avenue, can't find vba specific. so how should declare it? - @ moment i've got dim valueresult object that's hardly better variant , doesn't give intellisense prompts. nb. have microsoft html object library ticked it should ihtmlelementcollection type. dim valueresult ihtmlelementcollection '// code here set valueresult = currpage.getelementbyid("rg_s").geteleme

matlab - How create image overlays? change edges color -

how create image overlays? change edges color: changing edges green, @ first used 'sobel' overlay part have error: "img must array of either grayscale or rgb images: writevideo(writer,double(out));" why? out_red(bw)=0; out_green(bw)=255; out_blue(bw)=0; writevideo(writer,double(uint8(out))); close(writer); you set mistake entire img each color channel, should instead: out_red=img(:,:,1); out_green=img(:,:,2); out_blue=img(:,:,3); and end writevideo(writer, uint8(out));

p12 file import failure in windows certificate store by forge JavaScript library -

Image
i using forge library create self signed certificate in .p12 format generates private-public key pair using webcryptoapi . when trying import .p12 file in windows certificate store, getting following error : this link says there might issue private key. following key generation snippet webcryptoapi window.crypto.subtle.generatekey({ name: 'rsa-pss', moduluslength: 2048, publicexponent: new uint8array([0x01, 0x00, 0x01]), hash: {name: 'sha-1'} } and forge code snippet generate p12 follows : var newpkcs12asn1 = forge.pkcs12.topkcs12asn1( keys.privatekey, [cert], password, {generatelocalkeyid: true, friendlyname: 'test'}, {algorithm: '3des'}); var newpkcs12der = forge.asn1.toder(newpkcs12asn1).getbytes(); var p12b64 = forge.util.encode64(newpkcs12der); var downloadlink = document.createelement("a"); downloadlink.download = "example.p12"; downloadlink.innerhtml = "download file"; downloadli

php - Why is this call to strstr not returning false? -

i've stumbled upon issue strstr in old legacy codebase. there's lot of code, test case come down this: $value = 2660; $link = 'affiliateid=1449&zoneid=6011&placement_id=11736&publisher_id=1449&period_preset=yesterday&period_start=2017-03-27&period_end=2017-03-27'; var_dump(strstr($link, $value)); i expect return false since "2660" not in string returns d=1449&zoneid=6011&placement_id=11736&publisher_id=1449&period_preset=yesterday&period_start=2017-03-27&period_end=2017-03-27 . i realise $value should string still don't understand why it's not casted string php , why it's finding number in link. actually, if try $value = '2660'; returns false expected. any idea what's happening? short answer when run strstr($str, 2660) $needle resolved character " d " calling chr(2660) , therefore stops @ first " d " found in given $str , in case righ

java - Remove the hour,minute and seconds from date gotten from server as JSON -

i getting json data server includes dates too. shows date 2017-07-20 00:00:00 want see date this: 2017-07-20 , , checked previous questions issue of them based on date in android side. , problem date json , because of don't know how remove time it. did try simple parse string this? string date_string = "2017-07-20 00:00:00"; string[] parsed = date_string.split(" "); string your_wanted_string = parsed[0]; system.out.println(your_wanted_string); edit you have convert string date here : https://stackoverflow.com/a/4216767/1979882 convert date milliseconds. or use calendar class. calculate difference between values. an example: http://www.mkyong.com/java/how-do-get-time-in-milliseconds-in-java/ public class timemilisecond { public static void main(string[] argv) throws parseexception { simpledateformat sdf = new simpledateformat("dd-m-yyyy hh:mm:ss"); string dateinstring = "22-01-2015 10:20:56"; date

android - Google App Engine: DuplicateFileException -

been using backend on year without problem. today made deployment new computer , of sudden got duplicatefileexception . full error: error:execution failed task ':android:transformresourceswithmergejavaresfordebug'. > com.android.build.api.transform.transformexception: com.android.builder.packaging.duplicatefileexception: duplicate files copied in apk com/google/appengine/repackaged/org/apache/commons/codec/language/bm/sep_approx_spanish.txt file1: c:\users\\.gradle\caches\modules-2\files-2.1\com.google.appengine\appengine-api-1.0-sdk\1.9.42\c972bc847992e5512eb4338a38cc2392e56760f6\appengine-api-1.0-sdk-1.9.42.jar file2: c:\users\\.gradle\caches\modules-2\files-2.1\com.google.appengine\appengine-endpoints\1.9.42\5c25efed254f8f9846d04b156e68283055efd320\appengine-endpoints-1.9.42.jar there answer on stack says need add gradle: dependencies { appenginesdk 'com.google.appengine:appengine-java-sdk:1.9.42' compile 'com.google.appengine:appen

ios - Extremely long compilation times with Swift in Xcode -

i have 3 ios projects: first 1 - 35k swift loc, swift 2.1 (or 2.0?), compiled using xcode 7.2.3 second 1 - 15k swift loc, swift 2.3, compiled using xcode 8.2.1 third 1 - 15k swift loc, swift 3.0, compiled using xcode 8.2.1 the compile times of these abysmal (10+ minutes clean build), , development on each 1 of these slowing crawl. i have tried: using whole module optimization changing c dialect compiler default analyzing build times project , optimizing bottlenecks (a few methods took 6-10s compile array concatenation, nil coalescing operators , such), shaved 15 seconds - unnoticeable difference headermap_uses_vfs = yes a few other don't remember now i'm working on mac mini late 2014 ssd, 8gb ram & 2.6ghz i5, if matters. anyone knows might cause that, or workarounds now? i've read on , other places, seems unresolved compiler issue. edit: yes, i'm using cocoapods dependencies. i'll try moving carthage , see happens. try set f

date - Extend monthly data series to weekly data series in R -

Image
i have monhtly data series , extend weekly series, using r. i created empty weekly data frame , merged time series monthly data. used na.locf function replaces na values value preceding it. weekly.data <- merge(monthlyts, enmptyweekly) weekly.data <- na.locf(weekly.data) this works well. however, there weeks belong 2 months: e.g. week starting 2010-09-28 . week, don't want september value, weighted average of september , octover value ( 3/7*septvalue + 4/7*octvalue ). is there formula result? my immediate thought extend daily , there take weekly averages. seems work, there might simpler/quicker solutions around. library(zoo) par(mar=c(2, 2, 2, 1), mgp=c(3, 0.6, 0), mfrow=c(3, 1), cex=0.8) mo <- seq(as.date(1), as.date(100), by="month") zoo.mo <- zoo(seq_along(mo), mo) plot(zoo.mo, type="b", pch=16, cex=0.5, main="monthly data") zoo.da <- merge(zoo.mo, zoo(, seq(start(zoo.mo), end(zoo.mo)+15, by="day"

python - Tensor multiplication in Tensorflow -

i trying carry out tensor multiplication in numpy/tensorflow. i have 3 tensors- a (m x h), b (h x n x s), c (s x t) . i believe a x b x c should produce tensor d (m x n x t) . here's code (using both numpy , tensorflow). m = 5 n = 2 t = 3 h = 2 s = 3 a_np = np.random.randn(m, h) c_np = np.random.randn(s, t) b_np = np.random.randn(h, n, s) a_tf = tf.variable(a_np) c_tf = tf.variable(c_np) b_tf = tf.variable(b_np) # tensorflow tf.session() sess: sess.run(tf.global_variables_initializer()) print sess.run(a_tf) p = tf.matmul(a_tf, b_tf) sess.run(p) this returns following error: valueerror: shape must rank 2 rank 3 'matmul_2' (op: 'matmul') input shapes: [5,2], [2,2,3]. if try multiplication numpy matrices, following errors: np.multiply(a_np, b_np) valueerror: operands not broadcast shapes (5,2) (2,2,3) however, can use np.tensordot follows: np.tensordot(np.tensordot(a_np, b_np, axes=1), c_np, axes=1) is there equivalent ope

normalizr - Issu normalizing data ( entity with children of same entity ) -

i'm new normalizr. i'm trying normalize json api answer looks this: http://myjson.com/15st3f there nested elements of same entity. exemple: { "id": 1, "name": "a", [...] "children": [ "id": 2, "name": "b", [...] "children": [ "id": 3, "name": "c" ] ] } how should start this? i'm bit confuse. can normalized? can have array of same entity, or ? can ? : const uor = new schema.entity('uors', { uorchildren: [ uor ] }) use define instance method : const uor = new schema.entity('uors'); uor.define({ children: [ uor ] });

azure - How to centralize all IIS-centric data to a shared network drive? -

i have azure windows vm iis shared network drive attached it. add vm combined load balancer, prevent having maintain iis in 2 vm's, thought moving iis settings shared drive (which used data storage webapps). how can this? have similar issues windows taskscheduler, there way move these settings different (shared) locations? is there way move these settings different (shared) locations do mean 2 vms use 1 configure file? yes, same on-prem, can mount shared network drive 2 vms, , delegating configuration sections server-level configuration files web.config files in sites, applications, , virtual or physical directories. more information iis configuration files, please refer link .

solr search boost option rails 4 -

i trying implement solr search in rails 4.0 project.i have user , manufacturer model. user can have many manufacturers. in manufacturer model have rating field , name field. want apply solr search such if scoring 5 , if search query matches manufacturer name result should boost top. i have given scores : rating 1 => score 30 rating 2 => score 31 rating 3 => score 32 rating 4 => score 33 rating 5 => score 34 how can achieve in rails? i trying : user.search keywords(params[:query].strip) boost(30.0) { with(:manufacturer_based_on_rating, params[:query].strip) } boost(31.0) { with(:manufacturer_based_on_rating, params[:query].strip) } boost(32.0) { with(:manufacturer_based_on_rating, params[:query].strip) } boost(33.0) { with(:manufacturer_based_on_rating, params[:query].strip) } boost(34.0) { with(:manufacturer_based_on_rating, params[:query].strip) } end if params[:query].present? end.results and below searchable method :

Excel VBA - Delete rows on multiple values from a single column filter -

i have written code deletes rows based on single input value single column filter, want edit handle multiple input values same column filter. the database's header on a4:z. option explicit sub test() dim ws worksheet dim lastrow long dim rng range dim myvalue variant 'set sheet reference set ws = activesheet 'turn off autofilter ws.autofiltermode = false 'get last row lastrow = ws.cells(ws.rows.count, "a").end(xlup).row 'set range filter set rng = ws.range("a4:z" & lastrow) 'get user input myvalue = inputbox("periods delete?") 'set filter rng.autofilter field:=8, criteria1:=myvalue 'delete visible rows rng.offset(1, 0).specialcells(xlcelltypevisible).entirerow.delete 'show remaining rows removing autofilter ws.autofiltermode = false end sub the input box takes single period (month number) @ present. want take multiple

javascript - error TS5023: Unknown compiler option moduleResolution, lib after npm start -

i have issue when try call npm start in angular 2 project. console show me: $ npm start angular-quickstart@1.0.0 prestart c:\users\jan\desktop\study\ztw lab\ang\myapp npm run build angular-quickstart@1.0.0 build c:\users\jan\desktop\study\ztw lab\ang\myapp tsc -p src/ **error ts5023: unknown compiler option 'moduleresolution'.** **error ts5023: unknown compiler option 'lib'.** npm err! windows_nt 10.0.14393 npm err! argv "c:\\program files\\nodejs\\node.exe" "c:\\program files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "build" npm err! node v6.10.1 npm err! npm v3.10.10 npm err! code elifecycle npm err! angular-quickstart@1.0.0 build: `tsc -p src/` npm err! exit status 1 npm err! npm err! failed @ angular-quickstart@1.0.0 build script 'tsc -p src/'. npm err! make sure have latest version of node.js , npm installed. npm err! if do, problem angular-quickstart package, npm err! not npm i

websphere liberty - IBM MobileFirst platform adapter deployment failed. Missing JMS spec classes in the classpath -

i created new jms adapter in ibm mobilefirst platform project following instructions @ ibm documentation i copied jars in server/lib folder, added them build path , made changes adapter implementation. but when try deploy adapter following error. adapter deployment failed: missing jms spec classes in classpath. make sure application server supports jms , feature enabled in server configuration i checked server.xml , jars added classpath. not sure causing issue.

android - How to get polyline from Google Maps Directions Api -

i'm trying draw polyline using google maps directions api, how use json values make this, because in api, there lot of lat , long , polylines.points this: cxwnftdct@jevglcr?pdtfnhtnnnpjpdrdn?jchcv@i@vqtk`ckf and don't know 1 should use, can me :) { geocoded_waypoints: [ {}, {} ], routes: [ { bounds: { northeast: { lat: 39.2846595, lng: -8.7036795 }, southwest: { lat: 38.7223249, lng: -9.1393372 } }, copyrights: "dados mapa ©2017 google, inst. geogr. nacional", legs: [ { distance: {}, duration: {}, end_address: "lisboa, portugal", end_location: { lat: 38.7223249, lng: -9.1393372 }, start_address: "santarém, portugal", start_location: { lat: 39.2846595, lng: -8.7049071 }, steps: [

javascript - jQuery replace old ID with new one -

i trying replace old id new 1 function not working. how can resolve error? $("#addfield").click(function(){ alert($(this).data('id')+1); $(this).data('id', + $('#addfield').data('id')+1); console.log($(this).data('id')); }) <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <a class="btn btn-success addfield" id="addfield" class="addfield" data-id="1">add field</a> the problem increase value after setting newvalue . in line: var newvalue = currentvalue++ ; happening 2 things: 1) var newvalue=currentvalue; 2) currentvalue=currentvalue+1 $(".addfield").click(function() { $(this).attr('data-id', +$(this).attr('data-id')+1); }) <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <

Custom Application Execution Runtime running on Android -

we trying develop solution/application platform on android embedded device. services of embedded device exposed in form of web services. motive develop custom application platform , install on android , write apps runs on embedded device via application platform. that, need create application execution runtime handles lifecycle of app. since, there android runtime available how can go in creating custom application runtime our solution platform runs on android? we stuck , looking pointers started. kind of info helpful. thanks in advance.

Qt and OpenCV CUDA library integration -

i try use compiled cuda library on qt project. have project library generator , gui project on y first computer. both work fine. when try compile same project on other computer crashs: [thread debugging using libthread_db enabled] using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". program received signal sigsegv, segmentation fault. 0x00007fffef4e6b8c in ?? () /usr/lib/x86_64-linux-gnu/libqttest.so.4 here program: template = lib config += console config -= qt config += no_plugin_name_prefix sources += \ config += link_pkgconfig pkgconfig += opencv includepath += /usr/local/include includepath += /usr/local/include/opencv libs += -l/usr/local/lib libs += -l/usr/lib/x86_64-linux-gnu libs += -l/usr/local/share/opencv/3rdparty/lib libs += -lm libs += -lopencv_core libs += -lopencv_imgproc libs += -lopencv_highgui libs += -lopencv_objdetect libs += -lopencv_calib3d libs += -lgl -lglu -lx11 -lglut -lglew -lpthread # cuda settings &l

python - how to check if value return in plpython query? -

i have assignment in plpythonu in postgresql function: result=plpy.execute("select value table doctitle '%%%s%%'"%projectname) if result: final = result[0]["value"] the query can return 1 text result or nothing. the issue if query returned nothing if result: condition still true (cuz contains value column)... want assignment final happen if there actual value in value column. how check that? the result object emulates list or dictionary object. check length: if len(result) > 0: but test should work empty list or dictionary evaluates false : create or replace function p() returns boolean $$ result = plpy.execute('select 1 false') if result: return true else: return false $$ language plpythonu; returns false : select p(); p --- f pass parameters execute in instead of substitute yourself. otherwise vulnerable sql injection: query = """ select value table doctitle format('

apache zookeeper - Configuring Solr Cloud -

i've installed solr , zookeeper in 2 different machines, , have edited zoo.cfg file instructed on solr wiki, zookeeper launched , connected successfully, when try ingest data on 1 machine, not reflect on other machine, indexed file should go in zookeeper data folder, getting stored in solr data folder. can on this, or give me steps scratch on how configure , check if working. you should have zookeeper ensemble setup, mentioned have it you should setup solr cluster using multiple machines. once solrcloud setup done should start solr zookeeper ensebmle using param -z (ex: bin/solr start -z zookeepermachineip:2181 ) everything explained in detail here . refer wiki setup zookeeper ensemble

Wordpress multiple subdomains and cookies -

i want apologies bad english. i've single wordpress install multiple subdomains. means can access content subdomain, example /my-post/ can accessed via domain.com/my-post/, sub1.domain.com/my-post/, sub2.domain.com/my-post/ etc... it's not redirection, url dynamically generated based on http_host. my issue cookies set on per-domain basis. not wordpress multisite allowing connected on subdomains accross network, single install i'm not able allow it. i've tried set define( 'cookie_domain', '.domain.com' ); no luck. when log domain.com i'm not logged in subdomains. is there way achieve it? thanks lot precious help, anthony

java - Resource class com.x.x.xresource class can not be instantiated due to InvocationTargetException when testing from PostMan -

i have been trying test java adapter postman tool (the 1 suggested ibm mobilefirst), when testing java adapter getting below error message resource class com.x.x.xresource can not instantiated due invocationtargetexception when testing postman this sounds similar issue had well. if recall correctly, in our case issue missing, required java classes/libraries. regrettably, in mfp "swallowed" exception without logging anything, stderr. i wrapped relevant adapter resource class' methods in try {} catch (throwable t) {} blocks, , printed out stack trace myself, catch . in our case, had both constructor , http request methods had find root cause. if have custom logic in application class, might need there well. it's odd, because uncaught exceptions log details in mfp/java ee server's logs, others not. update : product support telling me might specific resource class constructors. if uncaught exception thrown constructor, no details returned or log

javascript - How to place marker head in the middle of the links -

i want place marker in middle of links instead of placing @ end done code. although googled it, not able find solution code. <!doctype html> <html> <head> <meta charset="utf-8"> <script src="../d3/d3.min.js"></script> </head> <body> <style> body { background-color: #3a5795; } svg:not(.active):not(.ctrl) { cursor: crosshair; } path.link { fill: none; stroke:floralwhite; stroke-width: 4px; cursor: default; } svg:not(.active):not(.ctrl) path.link { cursor: pointer; } path.link.selected { stroke-dasharray: 10,2; } path.link.dragline { pointer-events: none; } path.link.hidden { stroke-width: 0; } rect.node { stroke-width: 1.5px; cursor: pointer; } rect.node.reflexive { stroke: #000 !important; stroke-width: 2.5px; } text { font: 12px sans-serif; pointer-events: none; } text.id { text-anchor: middle; font-weig

r - Extrapolate missing data for each group by average percentage of change -

i have data frame containing average income zip code, years 2010-2014. want data years 2015-2017, i'm looking way extrapolate based on yearly average change of each zip code group years available. for example: year zip income 2010 1111 5000 2011 1111 5500 2012 1111 6000 2013 1111 6500 2014 1111 7000 2010 2222 5000 2011 2222 6000 2012 2222 7000 2013 2222 8000 2014 2222 9000 should (roughly) have: year zip income 2010 1111 5000 2011 1111 5500 2012 1111 6000 2013 1111 6500 2014 1111 7000 2015 1111 7614 2016 1111 8282 2017 1111 9009 2010 2222 5000 2011 2222 6000 2012 2222 7000 2013 2222 8000 2014 2222 9000 2015 2222 10424 2016 2222 12074 2017 2222 13986 based on average growth of 8.78% zip code 1111 , 15.83% zip code 2222. here's quick messy data.table idea library(data.table) #create data last_year <- 2014 dt <- data.table(year=rep(2010:last_year,2),

python - ImportError using imp.find_module from subdirectory -

i have project: main |---src.py |---frame_select.py |-----shellsdir |---script_select.py |------scriptsdir |---test.py main has script passes arguments frame_select.py looks inside shelldir appropriate script based on argument passed. returns , using: import imp, sys sys.path.insert(0, '/path/to/shellsdir/') def module_import(mod_name): fp, p, d = imp.find_module(mod_name) py_mod = imp.load_module(mod_name, fp, p, d) def pick(value, window): if value == 'name_passed': c_mod = module_import('specific_name') c_mod.populate(window) there 16 scripts in shellsdir picks based on passed argument script load while looking in shellsdir . within shellsdir directory called scriptsdir , file script_selector . file looks this: import imp, sys sys.path.insert(0, '/path/to/scriptsdir/') def module_import(mod_name):

Powershell - Masking a line with secure string causing -

to log something, have enter username on page1, password on page2, click submit on page3. make easier wrote ps script. double checked hard-coding password, , successful. but not wanting hard-code password used added $pass , how read it. invalid password when run script. i wanted use get-credentials , didn't know how pass in username or password on specific pages. i appreciate advice me in right direction towards goal. $pass = read-host 'd\p password?' -assecurestring [runtime.interopservices.marshal]::ptrtostringauto( [runtime.interopservices.marshal]::securestringtobstr($pass)) $ie = new-object -comobject internetexplorer.application $url = 'https://website/' $ie.visible = $true $ie.navigate($url) while ($ie.busy -eq $true) {start-sleep -milliseconds 1000} $ie.document.getelementbyid('data').value = "p0523586" $submit = $ie.document.getelementsbytagname('input') | ? {$_.type -eq "submit"} $submit.click() while ($ie.