Posts

Showing posts from April, 2012

Flag MySQL table records based on a second table -

i have 2 tables: table has list of records. recordid datetime clientid 1 2017-07-01 17:20:21 1 2 2017-07-01 17:01:41 2 3 2017-07-01 17:20:30 1 4 2017-07-01 17:10:23 2 5 2017-07-01 17:01:20 2 6 2017-07-01 17:15:11 2 .... table b holds number of valid records client. clientid date validrecords 1 2017-07-01 1 2 2017-07-01 2 i need query takes number (n) table b , flag (1 or 0) amount (n) of records in table a. the expected result: recordid datetime clientid valid 1 2017-07-01 17:20:21 1 1 2 2017-07-01 17:01:41 2 1 3 2017-07-01 17:20:30 1 0 4 2017-07-01 17:10:23 2 1 5 2017-07-01 17:01:20 2 0 6 2017-07-01 17:15:11 2 0 client 1 has 1 correct record, other 1 0. client 2 has 2 correct records, others should marked 0. any ideas welcome...

sql - Msg 242: conversion of a varchar data type to a datetime data type resulted in an out-of-range value -

Image
i have gone through bunch of posts here error , tried changing data types , used convert nothing seems fix this. ask here. try give info, feel free ask if not enough. this getting error: insert prompt(id, date) select row_number() on (order b.idloc), [dbo].[fn_getgptime](cast (replace(datecollected, '/', '-') + ' ' + a.utctime datetime)) img inner join tloc b on a.filename = b.filename order b.idloc the date column in prompt table has datatype of float . utctime , datecollected both varchar(20) the error is: msg 242, level 16, state 3, line 274 conversion of varchar data type datetime data type resulted in out-of-range value. here function: [dbo].[fn_getgptime] (@utctime datetime) returns varchar(50) begin return (datepart (weekday, @utctime) - 1) * 86400 ---day + datepart (hour, @utctime) * 3600 ---hour + datepart (minute, @utctime) * 60 ...

java - getting "oauth_signature does not match expected value" error while authenticating tumblr -

i got request token (oauth_token , oauth_token_secret) using https://www.tumblr.com/oauth/request_token url. constructed authorize url using oauth_token got in previous step. when try access token using app consumerkey, consumersecret, , oauth_token , oauth_token_secret, getting "oauth_signature not match expected value" error message. message constructed hmacsha1, string signaturebasestring = "get&" + urlencoder.encode(accessurl, "utf-8") + "&" + "oauth_callback%3d" + urlencoder.encode(urlencoder.encode(redirecturl, "utf-8"), "utf-8") + "%26oauth_consumer_key%3d" + urlencoder.encode(consumerkey, "utf-8") + "%26oauth_nonce%3d" + urlencoder.encode(string.valueof(millis), "utf-8") + "%26oauth_signature_method%3d" + urlencoder.encode("hmac-sha1", "utf-8") + "%26oauth_token%3d" + urlencoder.encode(oauthtoken, "utf-8...

vb.net - How to let .NET know that I have an instance of the right class? -

let's suppose have a class viewermanager(of viewtable) and inside have a protected readonly property storedview viewtable which has get inside have this #region "view object properties" enum viewermanagertemplate unkown = 1 tblmemorizedfilterpage = 2 tblmemorizedaev = 3 end enum protected _managertemplate viewermanagertemplate = viewermanagertemplate.unkown protected readonly property managertemplate viewermanagertemplate if _managertemplate = viewermanagertemplate.unkown if pageid > 0 _managertemplate = viewermanagertemplate.tblmemorizedfilterpage else _managertemplate = viewermanagertemplate.tblmemorizedaev end if end if return _managertemplate end end property protected initializedstoredview boolean = false protected _storedview viewtable = nothing protect...

python - Pywinrm and Active Directory PowerShell cmdlets -

i encounter weird issue python code uses pywinrm module. let me explain bit. have linux server launch following python script: import winrm """create security group""" s = winrm.session('https://servername:5986/wsman', auth=(none, none), transport='kerberos', server_cert_validation='ignore') name = "test" path = "ou=security groups,dc=test,dc=org" ps_command = 'new-adgroup -name "{0}" -groupscope universal -groupcategory security -path "{1}" -server ldap.ubisoft.org'.format(name, path) r = s.run_ps(ps_command) if r.status_code == 0 : print(r.std_out.decode('utf-8')) else: print(r.std_err('utf-8')) this 1 connect on https listener of windows server (not dc) launch command of group creation. when launch ad cmdlet directly on windows server, works , security group created within ad. via script, have following response: $ python3 test_win...

php - Get the repeated values of the first character in a string -

i have strings similar one, $string = "01110111011101110111101110111110111111"; i need first character in string (in case, 0). need positions of occurrences of character in string. occurrences should put array first element being 1 (the first occurrence first character of string). for example, above string should produce array this, $return_value = array([0]=>1, [1]=>5, [2]=>9, [3]=>13, [4]=> 17....); this should trick, $string = "01110111011101110111101110111110111111"; $offset = 0; $return_value = array(); $character = substr($string, 0, 1); while (($offset = strpos($string, $character, $offset))!== false) { $return_value[] = $offset + 1; $offset = $offset + strlen($character); } var_dump($return_value); which return_value produce, array(8) { [0]=> int(1) [1]=> int(5) [2]=> int(9) [3]=> int(13) [4]=> int(17) [5]=> int(22) [6]=> int(26) [7]=> int(32)}

image processing - OpenCV HOG and SVM implementation -

Image
i trying use hog , svm methods find person walks under camera. working opencv train_hog example. changed size( 96, 160 ) size( 240, 240 ) in lines 433 437 438 , 442 because size of video (240x240). i use inria dataset negative samples , frames walking person video positive samples. after running train_hog.cpp, got no error. problem when give video input test_it() function, couldn't find same person walking around. what problem here? i have 100 positive sample. few? or problem default hog , svm parameters? (because didn't change parameters) or else? example pos sample: p.s : can done background subtraction want use hog , svm.

c# - Remote validation with a select input in MVC CORE -

hy , thank taking time read question. i'm working on mvc core website , i'm try add remote validation entity framework on select input. unfortunately seems doesn't work... here code : html select --> <select asp-for="idsociety" asp-items="@(new selectlist(@viewbag.listofsociety,"id", "name"))"></select> c# viewmodel --> [remote("verifynameservice", "parameter", additionalfields = "servicename", errormessage = "ce nom de service existe déjà pour cette société !")] public int idsociety { get; set; } thank in advance help. i believe have arguments backwards. it's trying call action named verifynameservice on controller named parameter . here constructors remoteattribute in core: public remoteattribute(string routename); public remoteattribute(string action, string controller); public remoteattribute(string action, string controller, stri...

cloudfoundry - Deploying Shiny app on Bluemix through Cloud Foundry : Fails at 15 mins -

i trying deploy r shiny application on ibm bluemix through cloud foundry. however, fails after 15 minutes every time. attempted change time cf_staging_timeout , cf_startup_timeout variable, did not help. i not sure how fix issue. below parameters defined in mainfest.yml file: --- applications: - name: myshinyapp memory: 500m instances: 1 buildpack: git://github.com/beibeiyang/cf-buildpack-r.git env: cran_mirror: https://cran.rstudio.com cf_staging_timeout: 60 cf_startup_timeout: 60 the env parameters in manifest.yml file valid application container only. change cf_staging_timeout , cf_startup_timeout value have export them in shell (or command line) running cf command line: for example, if using unix, linux or mac: export cf_staging_timeout=60 cf push myapp

python - Adding weights when using lmfit to fit a 3D line on a cloud of points -

i using following code fit 3d line on cloud of 3d points. using least squares method of lmfit minimize. i need add weights different points , not know how when using array (and not scalar ) distance output. problem when using scalar is not when using array. assume because of larger number of variables. so question - there way add weights each element of array minimizer ? using nelder w/scaral input not perform 3d fit well. from lmfit import minimize, parameters, parameter,report_fit,fit_report, minimizer, printfuncs import numpy np #parameters params = parameters() params.add('y1', value= 0) params.add('x0', value= 129) params.add('x1', value= 0) params.add('y0', value= 129) params.add('y1', value= 0) #function calculating point-line distance def fun(params,x,y,z): x0 = params['x0'].value; x1 = params['x1'].value; y0 = params['y0'].value; y1 = params['y1'].value distance = [] ...

How to remove first element from every sub-array in 2-Dimentional class numpy.ndarray in Python -

i have numpy.ndarray - [[1,2,3],[-7,7,2],[2,-3,4]] i want remove first element of each array , convert [[2,3],[7,2],[-3,4]] is there function can this, rather having use explcit for loop?

tensorflow.python.framework.errors_impl.NotFoundError while generating TFRecord files Object Detection API -

i trying generate tfrecord files pascal voc format dataset. following this guide , used this instructions create pascal_train.record and pascal_val.record . i have prepared annotations, images , image sets in imagesets -> main . generated label map in pascal_label_map.pbtxt . now, when run following command tf_worspace/models : python3 object_detection/create_pascal_tf_record.py \ --label_map_path=object_detection/data/pascal_label_map.pbtxt \ --data_dir=vocdevkit --year=voc2012 --set=train \ --output_path=pascal_train.record i get: file "/usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/errors_impl.py", line 466, in raise_exception_on_not_ok_status pywrap_tensorflow.tf_getcode(status)) tensorflow.python.framework.errors_impl.notfounderror: vocdevkit/voc2012/imagesets/main/marlboro_red_train.txt my project structure follow: tf_workspace models (tf staff here...) object_detection vocdevkit voc2012 annotatio...

python 2.7 - Parallel Processing of (Stratified) K-fold Cross Validation of a Keras LSTM model -

i know parallel processing of stratified k fold cross validation of keras lstm model should possible theoretically, uncertain how go it. want use parallel processing speeding computation time processing multiple evaluation folds @ time. i implementing k fold cross validation keras model seen in this github issue comment . using pathos.multiprocessing.processingpool.map . works simple perceptron, fails lstm setup following error: valueerror: tensor("embedding_1/embeddings:0", shape=(3990, 300), dtype=float32_ref) must same graph tensor("model_1/embedding_1/cast:0", shape=(?, 49), dtype=int32). i have tried using keras.backend.set_learning_phase have had no luck in have put (setting 1 when doing model fit, 0 when evaluationg in train_and_eval() , moving setting 1 before create_model() called). have tried running code with tf.graph().as_default(): . the code setup located @ gist reference , including perceptron code. missing embedding code different fil...

"instance member cannot be used on type" error on Swift 4 with nested classes -

i have class nested class. i'm trying access variables of outer class within nested class: class thing{ var name : string? var t = thong() class thong{ func printme(){ print(name) // error: instance member 'name' cannot used on type 'thing' } } } this however, gives me following error: instance member 'name' cannot used on type 'thing' is there elegant way circumvent this? hoping nested classes capture lexical scope, closures do. thanks you this class thing{ var name : string = "hello world" var t = thong() init() { t.thing = self t.printme() } class thong{ weak var thing: thing! func printme(){ print(thing.name) } } }

spring boot - Internal Server error -- Java.lang.RuntimeException:java.io.IOException: Missing initial multipart boundary, -

i trying upload picture file system. using spring boot , jetty server. getting internal server error -- java.lang.runtimeexception:java.io.ioexception: missing initial multipart boundary when trying upload picture. following piece of code @requestmapping(value = "/setprofilepic", method = requestmethod.post) public datumresponse<identry> setprofilepic(@requestparam("file") multipartfile file, httpservletrequest request) { datumresponse<identry> response = new datumresponse<identry>(); if (file.isempty()) { response.setdata(new identry("file not uploaded")); return response; } try { // file , save somewhere byte[] bytes = file.getbytes(); path path = paths.get("/data/pic/" + "myfile" + ".jpeg"); files.write(path, bytes); response.setdata(new identry("you uploaded")); system.out.println(...

constructor - JAVA call factory methods implicitly -

i have 1 constructor , 1 factory method date class. first 1 have 3 int parameter represent month, day , year. , second one, provide in case user give string 1 parameter represent month/day/year. as can see in main(), forget call parseit, factory method. compiler still provide correct result. question is: can java call factory method implicitly? please take 1st constructor , 2nd factory methods: import java.io.*; class date { private int month; private int day; private int year; public date(int month, int day, int year) { if (isvaliddate(month, day, year)) { this.month = month; this.day = day; this.year = year; } else { system.out.println("fatal error: invalid data."); system.exit(0); } } public static date parseit(string s) { string[] strsplit = s.split("/"); int m = integer.parseint(strsplit[0]); int d = integer.parseint(strsplit[1]); int y = integer.parseint(strsplit[2]); retu...

ios - Check user settings for Check Spelling and Autocorrect -

i make switch turning on/off autocorrect , checkspelling function in uitextview . as far know when user disabled checkspelling in ios (settings > general > keyboard > check spelling) there no way turn on programatically. apple says spellcheckingtype override iphone settings. as turns out doesn't. it works when user have autocorrect , checkspelling turned on, can turned off programatically, sadly other way around it's not working. so there way check if user has turned off these properties in ios settings? provide kind of feedback user how can turn them on.

android - RxJava how two sum response of two list called asynchronous? -

i have 2 lists of different objects called using retrofit2. these 2 list work fine , return elements ok. second part both objects have property "importe" (represents money), first need sum objects of each list subtotal , sum subtotal of 2 lists total (totallist1 + totallist2) , show value in textview . my problem i'm using 2 asynchronous requests can not sum subtotals. code can found here . i tried use retrofit2 synchronous request error: android.os.networkonmainthreadexception so other guys suggested me use rxjava. can explain details how implement in case? not perfect strict syntax tell me e.g.: //here create rxjava adapter ...... // here call first request first list<objecta> //here call second request second list<objectb> .... //and here subtotal of each list , sum total , put in textview... any suggestion , welcome, in advance! my sdkversion: minsdkversion 21 targetsdkversion 25 first move out of main thread using op...

git - Cannot clone my bitbucket repository after doing a commit with a 3.6 GB bin file -

Image
i relatively new git user , have bit of strange situation. wanted push few changes bitbucket repository. however, forgot pull updated version first changes done team-member. got error push command (using jenkin deploy) should pull changes first. @ point had executed following commands: git add files git commit -m "commit message" jenkin deploy # here got error after error message, pulled updated version master branch using git pull resulted in conflict. resolved conflict version in pycharm (ide, in use). conflict version number. after that, did commit (merge commit). git commit however, cannot enter src folder in bitbucket. nothing happens when click on src folder. cannot clone repository. can open rest of folders. 500 error when try open commit e3895f0 (in below screenshot) executed before pull command. rest of commits, can open them. can't figure out. either wrong on bitbucket side can open other folders or broke something. commit executed properly? ran...

php - URL masking to completely different url -

i have 2 x domain names https://www.example1.co.uk - main site. http://www.example2.co.uk this regional sub website example1.co.uk/ i've presently got url forwarding www.example2.co.uk above url, in frame, responsive nature of sub site crap! i've switched off forwarding stealth (frame) , waiting replicate. now question. there way of using .htaccess file when open example2.co.uk open / page can display example2.co.uk url , not example1.co.uk one? thanks stephen

javascript - JS works fine in Chrome but not in FireFox -

it's simple window scroll triggers when user clicks on nav item life of me cant seem figure out why ff wont recognise it, i've read similar q&a's recommend defining var's first i've done, appreciated. heres code: $("#mynavbar a").on('click', function(){ var hash = this.hash; //make sure this.hash has value if (hash !== ""){ //prevent default anchor click behavior event.preventdefault(); //use jquerys animate() method add smooth scroll $('html, body').animate({ scrolltop: $(hash).offset().top }, 800, function(){ window.location.hash = hash; }); } // end of if }); this "works" in chrome because chrome implements non-standard window.event property. as noted in comments, should use event argument provided jquery event handler instead. $("#mynavbar a").on('click', function(event){ ... event.preventdefault(); ... });

WooCommerce Single Product Checkout -

i'm in process of moving site on infusionsoft's singular order form pages (no cart, buy 1 product @ time) woocommerce powered site shopping cart. part going well. however, there's circumstances client wants site behave infusionsoft checkout. basically... user goes url nothing checkout page specified product, thing can purchase. if doing class , offering special offer attendees (via custom url). i've tried woocommerce single product checkout, , while gets close doesn't i'd want. 2 big issues 1) still requires user add item cart , 2) cart still site wide, meaning if user had added product cart checkout on single product page wants check both products out. any suggestions? thanks ended writing own plugin. here's code function add_and_forward($atts, $content=null) { global $woocommerce; $ids = explode(",", $atts['product_ids']); $empty_cart = $atts['empty_cart']; $checkout_url = $woocommerce->car...

html - Indeterminate progress bar CSS -

i wondering how make animation html progress tag , progress bar in indeterminate state. in code, have 1 keyframe animation, 1 div, 1 progress bar (created using progress tag). put keyframe animation on both div , progress bar show works on div, not progress bar... why this? i've gathered google , css-tricks website (from i've seen) indeterminate state difficult animate. i've tried progress (it mentioned should try in random post read last night) instead of progress:not([value]) still no luck. reason i'm needing use state on creating own progress bar js or css once figure out this, i'm going modifying existing 1 that's created on webpage it's atom theme , i've read posts on atom. posts i've read this, none of solutions worked me. here's codepen: https://codepen.io/anon/pen/nvpxmy here's css: progress:not([value]) { -webkit-appearance: none; appearance: none; height: 10px; } progress:not([value])::-webkit-progress-bar { back...

json - Formatted Text via webservice -

i have webservice, returns json-objects. json objects (among other properties) contain text. text has formatted display in clients browser. server holds database texts stored in it. planning have 50.000 texts stored , thousand requests day. i wondering, how should handle formatting. should store texts html , send html inside json objects. in personal opinion approach contradicts idea of json webservice, used not have send html every time... as formatting limited basic stuff (strong, emphazised , maybe 3 or 4 more) should mark them in way , formatting clientside (like on stackoverflow *foo* becomes foo . are there other ways didn't thought of? advantages , disadvantegs of approaches? to clarifiy: storing texts in database , sending them via json-webservice unalterable decisions are there existing libraries handle clientside formatting performant?

How to use Calculated Route ID to Load Interactive Bing Map v8 with that Route? -

i have used bing maps rest service driving directions list of route options. in these returned routes, receive route id id . able use route ids load static image maps, 1 each route option. here 1 example bing api key removed . route id can seen in response example here: https://msdn.microsoft.com/en-us/library/gg636957.aspx given can load static image map using route id, how can load interactive bing maps v8 controls route id? directionsmanager class not take route id. route id not documented or supported part of bing maps platform. shouldn't use rest services, let alone of other bing maps api's. rest services that's in route options documented here: https://msdn.microsoft.com/en-us/library/ff701724.aspx of these same route options available in directions module of bing maps v8 interactive sdk.

html - media queries working locally but not when uploaded to website -

so have weird problem. media queries work when test them locally, however, when uploaded files website, server doesn't seem notice media queries, notices 1 of them first 1 ones smartphones, skips , displays elements i've hidden screen sizes. i'm they're correct because work locally. anyway, here's html , css. <meta name="viewport" content="width=device-width"> <header> <div class="container"> <h1 id="logo"><a href="index.html"><img src="index/logo.png" alt="logo"/></a></h1> <div class="dropdown"> <img src="index/mobilemenubutton.png" id="menubutton"> <div class="dropdown-content"> <ul id="nobullets"> <li class="center"><a href="index.html">home</a></li> <li class="center"><a href="a...

javascript - How change the title of a page before it loads JSX -

Image
i want change title of class, , achieve document.title = "flayers" put code in constructor,then firt have default title , change when refer url, show old title. first have title next change and when refer url : i don't know if explain :d are familiar react-router? can change name of title page placing componentdidmount in desired component, fire when component loaded. then, you'll use document.title target , change page's title. here's example , took issue ticket #49 in react-router github repository: var handler = react.createclass({ componentdidmount: function() { document.title = "amazing page"; } });

orm - Python - Class references another class before assignment -

i working sqlalchemy's orm create classes mapped sql tables. running issues generating relationships between these classes since reference each other before class declared. when run code interpreter complains nameerror: name 'account' not defined i've included code sample below demonstrates how declaring these classes. class location(base): __tablename__ = 'locations' id = column(integer, primary_key=true) name = column(string) address = column(string) city = column(string) state = column(string) zip_code = column(string) account = sa.orm.relationship('account', order_by=account.id, back_populates='location') entity = sa.orm.relationship('entity', order_by=entity.id, back_populates='location') def __repr__(self): return "<location(name='{}', address='{}', city='{}', state='{}', zip_code='{}')>".\ fo...

RegEx Groovy for assertion -

this question has answer here: learning regular expressions [closed] 1 answer can regular expression following (only alphanumeric upper , lower case - after 12 characters) need use in in groovy assertion. 7aynehfjeee4-ajixjp2jg assert '7aynehfjeee4-ajixjp2jg' =~ /^[a-za-z0-9]{12}-[a-za-z0-9]{9}$/

php - What does trim() actually do in this validation check? -

i'm reading php book, below phrase mean? to eliminate leading , trailing whitespace, use trim() function. it's being used in following condition check: if(!empty(trim($_post['username'])) && !empty(trim($_post['email']))) { } empty checking make sure username , email variable not empty ! signifies not here empty http://php.net/manual/en/function.empty.php a variable considered empty if not exist or if value equals false. empty() not generate warning if variable not exist. trim removes whitespace beginning , end of stringstrip whitespace (or other characters) beginning , end of string http://php.net/manual/en/function.trim.php so if have string " user " trim(" user ") returns "user"

momentjs - Convert string in javascript using moment -

i try convert string moment , check same. protected showevent(event: ievent, hour: moment): boolean { let formatdate: moment = moment(event.futuredate); console.log('--> formatdate', formatdate); console.log('--> hour', hour); return formatdate.issame(hour, "hour"); // return true same } this console result --> formatdate: moment {_isamomentobject: true, _i: "07-24-2017 07:00:00.000", _isutc: false, _pf: object, _locale: locale…}_d: mon jul 24 2017 07:00:00 gmt+0200 (cest)_i: "07-24-2017 07:00:00.000"} --> hour: moment {_isamomentobject: true, _isutc: false, _pf: object, _locale: locale, _d: tue jul 25 2017 07:00:00 gmt+0200 (cest)…} how can convert date see if time same? edit: whole looks this protected showevent(event: ievent, hour: moment): boolean { return moment(event.futuredate).hour() == hour.hours() } try comparing hour value alone. return format...

rxjs - Chained Observable after takeWhile completes is not being called? -

i have following methods should called this: registerdomain should called , should return operationid after 10 seconds, getoperationdetail should called passing in operationid getoperationdetail should called every 10 seconds until successful returned. once getoperationdetail finishes, createrecordsets should called. finally, getchangestatus should called until returns insync if of api calls throw exception, how can handle error on client side? the following code below calls registerdomain , getoperationdetail, after getoperationdetail completes, not move onto createrecordsets. registerdomain(domain) { return this._adminservice.registerdomain(domain) .concatmap(operation => this.getoperationdetail(operation.operationid)) .concatmap(() => this._adminservice.createrecordsets(domain)); } getoperationdetail(operationid) { return observable.interval(10000) .mergemap(() => this._adminservice.getoperationdetail(operationid)) ...

javascript - How can you use Sinon (or something similar) to stub a method that's not on the relevant prototype? -

suppose create object using constructor: function myconstructor() { this.mymethod = () => console.log('foo'); } const myobject = new myconstructor(); and in test file want stub mymethod method. if had defined mymethod on prototype, pretty straightforward. 1 use: sinon.stub(myconstructor.prototype, 'mymethod') but doesn't work when method defined in constructor using this , in example above. this issue that's hard avoid because 3rd-party libraries define instance methods in way, i.e., within constructor instead of on prototype. , need way stub such methods when testing.

tensorflow - how do I represent an input tensor with multiple data types? -

i have far used tensor flow input tensor of 1 data type, example, float32. i want have input can represented table rows , column such: column0 column1 column2 column3 ... columnn person0 catx float float cat0 person1 caty float float cat1 person2 catz float float cat2 . . . personn cataa float float cat00 a mixture fo floats , categorical values 1 hot encode. cat placeholder strings drawn restricted domain of values such as, say, unique identifiers of machine parts. categorical columns this. how create input tensor these sorts of mixed inputs? possible 1 hot encodings way well?

java - Execute war application with selenium from glassfish -

i'm trying run web application uses selenium libraries open web page in firefox. war application deployed in glassfish 4.1 in centos 7. however, browser not open firefox or error observed in log. attaching java code , log. java code: `system.setproperty("webdriver.gecko.driver", "/usr/local/bin/geckodriver"); system.out.println("pasa gecko driver"); driver = new firefoxdriver(); system.out.println("pasa firefox driver"); driver.manage().timeouts().pageloadtimeout(20, timeunit.seconds); // open browser , go javatutorial network website driver.get("https://muisca.dian.gov.co/webrutmuisca/defconsultaestadorut.faces"); system.out.println("pasa pagina");` log: `inicia webintegration ingresa abrirsesionnavegador pasa gecko driver` the error displayed in line driver = new firefoxdriver (); however, error in log not appear.

How to retrieve a "Run" tab in WebStorm? -

this might stupid question, closed tab of "run" tool window (the 1 access alt+4 ) , can't find way it. i closed tab app still running. now, when try run app again, "port xxxx in use". what's catch? you go top bar menu, click run tab, , select show running list . pop list of running process , can select process want view there. more info can found in webstorm documentation

Adding Additional Y-Axis in R with ggplot2 -

Image
let's have following (x0,y0) data have plotted (the y0-axis plotted on left-hand side): x0,y0 ----- 500,1 200,3 ... further, have set of data (x1,y1) given as: x1 y1 ----- 1.5,1 3.2,2 ... i wanting add addition y1-axis on right-hand side, have x1 break points , y1 labels. x1 , y0 on same scale, 2 datasets of different lengths, , there no formula 1 can use derive x1 y0. thanks it's not entirely clear you're looking for. this? df1 <- data_frame(x0 = c(500, 300), y0 = c(1, 3)) df2 <- data_frame(x1 = c(1.5, 3.2), y1 = c(1, 2)) ggplot(df1, aes(x0, y0)) + geom_point() + scale_y_continuous(expand = c(0.5,0.5), sec.axis = sec_axis(trans = . ~ ., breaks = df2$x1, labels = df2$y1))

django - Is it possible to delegate celery tasks and block until all is processed? -

i have task: @app.task(name='somesmalltask') def some_small_task(some_input): some_list = [] #do some_list return some_list is possible like: all_results = map(lambda x: some_small_task.delay(x), inputs) #do stuff later all_results but instead of returning celery task, result. would have every task id? result = some_small_task.asyncresult(task_id) result.get() if want start multiple tasks group, this: >>> job = group([ ... add.subtask((2, 2)), ... add.subtask((4, 4)), ... add.subtask((8, 8)), ... add.subtask((16, 16)), ... add.subtask((32, 32)), ... ]) >>> result = job.apply_async() >>> result.join() [4, 8, 16, 32, 64] this processes tasks simultaneously , returns result using join() wait last task end. more information groups , other workflows here .

uikit - UIView.convert(_:to:) - use frame or bounds? -

if want cgrect of arbitrary view b in root view a 's view hierarchy, typically use uiview.convert(_:to:) method on b . second argument view a coordinate system want first argument's cgrect expressed in. if have correct question is, should use a 's frame or bounds first argument, , why? using 1 on affect returned cgrect expressed in terms of b ?

ios - nib must contain exactly one top level object which must be a UITableViewHeaderFooterView instance -

i running weird issue when creating customheader tableview. error receiving following: nib must contain 1 top level object must uitableviewheaderfooterview instance i ran through code , xib file examples couldnt find wrong ideas missing? the header xib created regular view , sub view label, class created following: customtableheader class: class customtableheader: uitableviewheaderfooterview { static var customtableheaderidentifier = "customtableheader" @iboutlet weak var titlelabel: uilabel! override awakefromnib(){ super.awakefromnib() self.titlelabel.text = "header" } override func prepareforreuse() { super.prepareforreuse() } } viewcontroller class: class viewcontroller: uiviewcontroller, uitableviewdelegate, uitableviewdatasource { @iboutlet weak var tableview: uitableview! override func viewdidload() { super.viewdidload() self.tableview.register(uinib.init(nibname: ...

java - Rewarded Videos doesn't load the first time but loads after -

my app has button open reward videos >> when button pressed first time, toasts "check internet connection", when hit second or third time, shows video no problems mobileads.initialize(getactivity(), getstring(r.string.vid_app_id)); mrewardvideoad = mobileads.getrewardedvideoadinstance(getactivity()); mrewardvideoad.loadad(getstring(r.string.vid_app_unit_id), new adrequest.builder() .addtestdevice(getstring(r.string.testdeviceid)) .build()); mrewardvideoad.setrewardedvideoadlistener(this); loadrewardedvideoad(); here methods used : private void loadrewardedvideoad() { mrewardvideoad.loadad(getstring(r.string.vid_app_unit_id), new adrequest.builder() .addtestdevice(getstring(r.string.testdeviceid)) .build()); } @onclick(r.id.button_more_money) public void more_money() { if (mrewardvideoad.isloaded()) { mrewardvideoad.show(); } else ...

python - Add categorical feature before the dense layer in Keras? -

i working on cnn model , want add new categorical feature before dense layer. tried concatenate feature flattened output of cnn layer looks concatenate function in keras requires input of tensors , not arrays. how should go it? here code have tried far: model = sequential() model.add(conv2d(128, (6, 6), padding='same')) model.add(activation('relu')) model.add(conv2d(128, (6, 6))) model.add(activation('relu')) model.add(maxpooling2d(pool_size=(2, 2))) model.add(dropout(0.25)) model.add(flatten()) i trying use concatenate function can join tensors, feature numpy array of shape (1, 3). appreciated. you should create new model on side of actual model. second model take in input numpy array , nothing else. then concatenate them. like -> m1 = sequential() m1.add(conv2d(128, (6, 6), padding='same')) m1.add(activation('relu')) m1.add(conv2d(128, (6, 6))) m1.add(activation('relu')) m1.add(maxpooling2d(pool_size=(2, 2))) m...

Apache Storm (Java): Bolt not receiving tuple from other Bolt -

Image
i'm working apache storm topology: topologybuilder builder = new topologybuilder(); builder.setspout("socketspout", new socketspout(ip_host,port)); builder.setbolt("filterone", new filterone()).shufflegrouping("socketspout"); builder.setbolt("filtertwo", new filtertwo()).shufflegrouping("filterone"); the methods of first bolt (filteone), class extends baserichbolt: public void declareoutputfields(outputfieldsdeclarer declarer) { declarer.declare(new fields("id1","signal1")); } public void execute(tuple input) { int sig; try { sig=input.getinteger(1)*2; system.out.println("filter one.."+integer.tostring(sig)); collector.emit("ack1", new values(input.getstring(0), sig)); collector.ack(input); } catch (exception e) { collector.fail(input); } } the methods of second bolt (filtetwo), class extends baserichbolt...

list - Looping through variables to subset -

i have same data exported game experiment. files json , each respondent given specific code name a001 a010 , b001 b010. json file in list survey responses, player moves, , player messages. i want subset player response questions multiple data sets, each player getting object. names.list <- names(data$surveys) survey.results <- sapply(names.list, function(x) { x <- data$surveys$x }) namelist = a001, a002, a003...b010. know how hard code this, have varying numbers of participants different experiments, , easier if can write loop through player codes.

sql - How to update a field with a varchar + incrementing int -

im trying update values in table have unique values in format 'unknown' + 0001 next 1 'unknown' + 0002. im runnign trouble when trying update field. declare @idtest varchar(15) set @idtest = '' update table1 set @idtest = id = convert(int,'unknown'+ cast(@idtest + 1 varchar(15))) id null or ltrim(rtrim(id )) = '' go any suggestions great. can use sql supported 2008 r2. update: with tempupdatetable ( select t1.*, row_number() on (order (select null)) seqnum table1 t1 id null or ltrim(rtrim(id)) = '' ) update tempupdatetable set id= 'unknown' + right('000' + cast(seqnum varchar(255)), 4); use row_number() , updatable cte: with toupdate ( select t1.*, row_number() on (order (select null)) seqnum table1 id null or ltrim(trim(id )) = '' ) update toupdate set i...

c# - Short jump and large jump with Strength of Keyboard input -

i met problem when jumped gameobject. make action largjump , shortjump. problem how can make conditional statement. want distinguish weak keyboard input, , strong keyboard input. here code. if (input.getbuttondown("jump")) { float jumptime = 0; jumptime = jumptime + time.deltatime; if (input.getbuttonup("jump") && jumptime < 0.3f) { playerctrl.actionshortjump(); } else if (input.getbuttonup("jump") && jumptime > 0.3f) { playerctrl.actionjump(); } } getbuttondown returns true first frame button pressed, never jump since button cannot down , on same frame. need use getbutton increase jump time while button held down, , getbuttondown reset timer when button first pressed, while declaring jumptime outside of overall method. float jumptime; void update() { if (input.getbuttondown("jump")) { jumptime = 0; } if (input.getbutton("jump...

vcl - How to determine which component has the program focus in C++Builder -

i using c++builder xe4 32bit vcl platform. writing windows os. i have mainform lot of components on it. when press keyboard arrow key , form's onshortcut event triggered, how determine component has program focus? i have different actions must taken based on component has focus. void __fastcall tmainform::formshortcut(twmkey &msg, bool &handled) { //determine component has focus. } use global screen->activecontrol property: indicates control has input focus on screen. read activecontrol learn windowed control object in active form receives input keyboard. void __fastcall tmainform::formshortcut(twmkey &msg, bool &handled) { twincontrol *ctrl = screen->activecontrol; if (ctrl == control1) { // something... } else if (ctrl == control2) { // else... } // , on... } or, can use form's own activecontrol property: specifies control has focus on form. use activec...

react native - Expo Android Permissions set to nothing -

what like : want able publish apk file play store has 0 permissions, because app not require any. what i'm experiencing when running expo command exp publish i'm getting following warning/issue [exp] making sure project set correctly... [exp] warning: problem in app.json. see https://docs.expo.io/versions/v19.0.0/guides/configuration.html. [exp] - additional property "permission" exists in app.json when not allowed. extra details expo has released version 19 of sdk has ability set permissions android. see docs link there no details on how set no permissions , , docs default applied when permissions not set in app.json without describing defaults are. my config looks this: { "expo": { "name": "test-publish", "description": "an empty new project", "slug": "test-publish", "privacy": "public", "sdkversion": "19.0.0", ...

ruby on rails - Rake Task to parse JSON, some objects might be missing -

i made simple rake task parse json , i'm using apply attributes game collection. to avoid massive list of json in block json can previewed here , here - these steam store's api returning game details. rake worked when pulling 2 pieces of information present on every single record (assuming success) desc 'update steam game info' namespace :update_steam_games task scrape_info: :environment require 'open-uri' #require 'nokogiri' require 'json' games = steamgame.first(10) games.each |game| base_url = "http://store.steampowered.com/api/appdetails?appids=#{game['appid']}" puts "base_url: #{base_url}" results = open(base_url) { |f| result = json.parse(f.read) puts result.inspect next if result[game['appid'].to_s]['success'] == false type = result[game['appid'].to_s]['data']['type...