Posts

Showing posts from March, 2011

bash - spark-submit: command not found -

a simple question: i try use bash script submit spark jobs. somehow keeps complaining cannot find spark-submit command. when copy out command , run directly in terminal, runs fine. my shell fish shell, here's have in fish shell config: ~/.config/fish/config.fish : alias spark-submit='/users/my_name/downloads/spark-2.0.2-bin-hadoop2.7/bin/spark-submit' here's bash script: #!/usr/bin/env bash submit_command="hadoop_user_name=hdfs spark-submit \ --master $master \ --deploy-mode client \ --driver-memory $driver_memory \ --executor-memory $executor_memory \ --num-executors $num_executors \ --executor-cores $executor_cores \ --conf spark.shuffle.compress=true \ --conf spark.network.timeout=2000s \ $debug_param \ --class com.fisher.coder.offlineindexer \ --verbose \ $jar_path \ --local $local \ $solr_home \ --solrconfig 'resource:solrhome/' \ $zk_quorum

ibm mobilefirst - direct update failing in MFP 8.0 -

when trying direct update app getting below error. using mobilefirst 8.0.0.00-20170220-1900 [8/17/17 17:21:29:813 cdt] 000f8292 deploymentreg 1 com.ibm.mfp.server.core.internal.deployment.registry.deploymentregistryimpl getall:255 deploymentregistryimpl: getting all- type: com.ibm.mfp.server.core.internal.configuration.analytics.analyticsdynamicconfigurationimpl returned: [] [8/17/17 17:21:29:813 cdt] 000f8292 deploymentreg 1 com.ibm.mfp.server.core.internal.deployment.registry.deploymentregistryimpl get:198 deploymentregistryimpl: (one)- type: com.ibm.mfp.server.core.internal.configuration.analytics.analyticsdynamicconfigurationimpl returned: null [8/17/17 17:21:29:814 cdt] 000f8292 analyticsconf 1 com.ibm.mfp.server.core.internal.configuration.analytics.analyticsconfigurationdeploymenthandler getadditionalpackages:51 entering method: getadditionalpackages(). [8/17/17 17:21:29:814 cdt] 000f8292 analyticsconf 1 com.ibm.mfp.server.core.internal.configuration.analytics.analyticscon

lambda - Best practices for storing data with Azure Functions -

Image
i've been working lot microservices , common pattern every service responsible own data. service "a" can not access service "b" data directly without talking service "b" via http api or message queue. now i've started pick work azure functions first time. i've looked @ fair few examples , seem have old function dabbling data in shared data store (which seems we're going old style of having massive monolithic database). i wondering if there common pattern follow data storage when using function service? , responsibilities lie? the following screen snippet example of event-driven distributed model of business processors in cloud-based solutions without using monolithic database. more details concept , technique can found in article using azure lease blob note, each business context has own lease blob holding state of processing references other resources such metadata, config, data, results, etc. concept allows create m

jquery - css code issue using style and div no answer online -

would know how increase height of menu when scrolls on demo? part loads links? demo: http://tympanus.net/tutorials/collapsingsitenavigation know style css under submenu, make rise higher if that's possible? can help? appreciated. the top of ul slides in bottom being determined height given it. being uses jquery, hover effect , height change, not being done css. when browse css files using, see no indication of :hover or css transitions. wrong, best answer

ios - Custom init UIViewController query -

i hoping can me understand why below code segment works , other not. wanting create custom initialiser uiviewcontroller has custom nib file have created. my issue want understand why in below code references newmember , facebooklogin retained when hit viewdidload method in other segment of code not? can shed light why case? working code block class registrationformviewcontroller: miosbaseviewcontroller { var newmember:member! var facebooklogin: bool = false init(member: member, facebooklogin: bool = false) { self.newmember = member self.facebooklogin = facebooklogin super.init(nibname: "registrationformviewcontroller", bundle: nil) } required init?(coder adecoder: nscoder) { super.init(nibname: "registrationformviewcontroller", bundle: nil) } override func viewdidload() { super.viewdidload() let view = self.view as! registrationformview view.loadviewwith(member: newmembe

How to use Python to analyse cvs file? -

Image
i beginner of programming, trying work out how average of elements in csv file. content of csv file: and code: import csv suburbs_average = {'north':0,'south':0,'east':0,'west':0} suburbs_count = {'north':0,'south':0,'east':0,'west':0} csvfile = open("ps1_3_data.csv") csv_reader = csv.reader(csvfile, delimiter=',') row in csv_reader: print (row[0],float(row[1])) print(suburbs_average) i have spent whole day trying figure out how calculate average of each suburbs(east,north...). need sort same suburb before calculate , how? please me on this? in advance. cheers. i working standard library think should stick can understand base implementations before installing modules willy-nilly. the csv module part of standard library, , reading docs learn each module capable of when looking solution. given problem, i'd following: iterate through csv.reader() object , put values d

javascript - Swiper slider, pause html5 video when it's slide -

i using idangero.us swiper slider project. have 3 html5 videos in slider playing @ same time. need pause video when click next , play again when it's visible. html: <div class="swiper-container"> <div class="swiper-wrapper"> <div class="swiper-slide"> <video preload="auto" loop="" autoplay=""> <source src=".../> </video> </div> <div class="swiper-slide"> <video preload="auto" loop="" autoplay=""> <source src=".../> </video> </div> </div> </div> js: var swiper = new swiper('.swiper-container', { nextbutton: '.swiper-button-next', prevbutton: '.swiper-

C#- I'm trying to retrieve image from the MySQL Database -

its saved in blob format. 3 tier architecture followed, data retrieved database in datatable. others working fine except byte[]. appreciated. c# gives parameter not valid exception foreach (datarow row in datta.rows) { byte[] bytearray = row.field<byte[]>(10); system.drawing.image returnimage; using (var ms = new memorystream(bytearray, 0, bytearray.length)) { returnimage = system.drawing.image.fromstream(ms); } }

Determining if key is pressed in expression (Python) (PyQT) -

in mousemoveevent method i've seen code below check if either left or right mouse buttons being pushed (as shown below). there way check if keyboard keys being pressed? ideally have action performed when mouse leftclicked , moved , key being pushed. don't see way use keypressevent called separately mousemoveevent (just mousepressevent not used in example). def mousemoveevent(self, event): if event.buttons() & qtcore.qt.leftbutton: #run when mouse moved left button clicked elif event.buttons() & qtcore.qt.rightbutton: #run when mouse moved right button clicked edit: based on ekhumoro's comment method looks this. works key modifiers: def mousemoveevent(self, event): modifiers = qtgui.qapplication.keyboardmodifiers() if bool(event.buttons() & qtcore.qt.leftbutton) , (bool(modifiers == qtcore.qt.controlmodifier)): #run when mouse moved left button , ctrl clicked elif event.buttons() & qtcore.qt.leftbutton:

tensorflow: predicting multi-label accuracy considering top-k predicted values -

my set if given set of data labels of them can have multiple ones (the max number of one's each example known denoted n): 1,0,0,0,1,0 0,0,1,0,1,1 .... 1,1,1,0,0,0 when predict want see indices top n logits if prediction indices contains label indices one's it's correct prediction. how can achieve in tensorflow? you can this: #inputs labels = tf.constant([[1,1,0,0,0,0],[0,0,1,0,1,1]]) logits = tf.constant([[.6,.5,.5,.4,.2,0.1],[.05,.15,.2,.15,.05,.5]]) k = 2 # predict top-k each row topk, idx = tf.nn.top_k(logits, k) # sort index input sparse_to_dense matrix idx, _ = tf.nn.top_k(-idx, k) # obtain full indices indices = tf.stack([tf.tile(tf.range(0, idx.get_shape()[0])[...,tf.newaxis], [1, k]), -idx], axis=2) indices = tf.reshape(tf.squeeze(indices), [-1,2]) #convert them dense matrix pred_labels = tf.sparse_to_dense(indices, logits.get_shape(), tf.ones(idx.get_shape()[0]*k)) #calculate whether each row of labels contained in logits sum1 = tf.reduc

java - How to check if user disable Google text to speech from Application manager -

i working on text speech, in device not work because users have disable google text speech a pplication manager , there way can check user disable app or not before making text speech request i solve problem, not best solution know, me work texttospeech = new texttospeech(context.getapplicationcontext(), new texttospeech.oninitlistener() { @override public void oninit(int status) { if (status == texttospeech.success) { // speak code goes here } else { toast.maketext(context, "tts_failed error code "+status, toast.length_long).show(); if(status == -1) // { // open play store if use have not install or disable google text speach try { context.startactivity(new intent(intent.action_view, uri.parse("market://details?id=com.google.android.tts"

ros - How to combine two plugins in rviz -

i have 2 rviz plugins: ez_interactive_marker( https://github.com/neka-nat/ez_interactive_marker.git ) , rviz_textured_quads( https://github.com/mohitshridhar/rviz_textured_quads.git ), should use 2 plugins together? tried combine 'src' , 'include', met difficult in modifying 'cmakelists.txt'

python - Does maximum vocabulary count is related to word vector dimensions in Glove model -

i have implemented glove model following implementation link https://github.com/stanfordnlp/glove/tree/master/src . have specified max vocab parameter 100000000 while generating vocab.txt file , word vector dimensions 100 while training model , generated vectors.txt 100 dimensions. when trying evaluate word_analogy.py eval folder in above link, getting following error file "c:\users\jayashree\anaconda2\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 714, in runfile execfile(filename, namespace) file "c:\users\jayashree\anaconda2\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 74, in execfile exec(compile(scripttext, filename, 'exec'), glob, loc) file "c:/users/jayashree/documents/1 billion words/word_analogy.py", line 77, in <module> w, vocab, ivocab = generate() file "c:/users/jayashree/documents/1 billion words/word_analogy.py", line 32, in generate

php - using ajax in laravel 5.4 ERROR : Not found -

why have error not found in network console web browser? here i've done : my ajax: function getproducts(category_id) { $("#product-list").empty(); $.ajax({ url:'{{url::to('home.products')}}/"+ category_id', type:"get", datatype: "json", success: function(data) { } }); } my route: route::get('/home/products', 'homecontroller@productsbycat')->name('home.products'); my controller: public function productsbycat($category_id) { $products = db::table('products') ->select('products.product_id','products.featured_img','products.product_name','products.description', 'products.price','products.quantity') ->join('products', 'categories.category_id', '=', 'products.category_id') ->where(

Vapor client close stream -

app upload through interface server, server , upload picture storage space.i know method not best if there ways thank share code this: with main.swift let config = try config() try config.addprovider(postgresqlprovider.provider.self) let drop = try droplet(config) let flecrl = filecontroller(); flecrl.addroutest(drop: drop); drop.resource("files", flecrl); with filecontroller.swift final class filecontroller: resourcerepresentable{ var drop:droplet?; public func addroutest(drop: droplet) -> void { self.drop = drop; let d = drop.grouped("file"); d.post("updatefile", handler: updatefile) } func updatefile(req:request) throws -> responserepresentable { let picname = req.data["name"]?.string ?? string(); let bytes:[uint8] = (req.data["data"]?.bytes)!; let request = request(method:.post,uri:"http://up.qiniu.com"); let t = "image/\(picname)"; let token = req.data[

php - How to total-up data in loop -

Image
i have following data in html table: all data in html table fecth using current query , html code: $query=" select a.daily_budget ideal, c.lab_hour actual, b.store_name, b.storenum, c.busidate dummy_daily join site_store b on a.storenum = b.storenum join site_labour c on a.storenum = c.storenum (b.store_region='cr1') , (case when a.busidate between '2017-07-01' , '2017-07-05' a.daily_budget else 0 end) , (case when c.busidate between '2017-07-01' , '2017-07-05' c.lab_hour else 0 end) , (a.busidate = c.busidate)"; html code display in table: $result2 = $dbhandle->query($query) or exit("error code ({$dbhandle->errno}): {$dbhandle->error}"); $no = 1; while ($row = mysqli_fetch_array($result2)) { $outlet= $row["store_name"]; $daily_ideal = $row["idea

My Ajax in select2 is not working in rails app. -

no error, results won't appear when key in ones exist in database. what's happening? help slim file select box = select_tag "groups", nil, id: 'power-search', class: "select-example", multiple: true 2.javascript ajax: { url: "/groups", datatype: 'json', delay: 250, data: function (params) { return { q: params.term, // search term page: params.page }; }, processresults: function (data, params) { // parse results format expected select2 // since using custom formatting functions not need // alter remote json data, except indicate infinite // scrolling can used params.page = params.page || 1; return { results: data.items, pagination: { more: (params.page * 30) < data.total_count } }; }, cache: true },x }); controller resp

visual studio code - VSC folder structure in the side bar -

Image
i right clicked on project name in side bar , removed side bar. but, now, can't find way add project folder structure again side bar. how can it? you can right-clicking on top bar of explorer , checking "folders":

cocoa - What's the relationship between NSAppearance, NSEffectView.Material, and "Vibrancy" -

as in question title, what's relationship between nsappearance , nseffectview.material , , "vibrancy"? i've found through experimentation that, materials, choice of nsappearance can change how material appears (e.g. nseffectview.material.titlebar light or dark depending on active nsappearance ), while other materials (e.g. .light ) don't seem care. i suspect materials .titlebar proxies select .dark , .ultradark , .light , , .mediumlight depending on nsappearance , seem role of .appearancebased . see in description nsappearance.name.vibrantlight ... this should set on nsvisualeffectview or 1 of subviews. ...which contradicts statement nseffectview documentation... the view’s effective appearance must allow vibrancy... in cases set appearance on window or on visual effect view—subviews inherit appearance. ...suggesting correct set vibrantlight nsappearance of entire window (if that's wanted). finally, i'm confused "vibranc

android- multiple alpha set in xml can't work -

i trying make alpha animation this: <alpha android:duration="300" android:fromalpha="0.0" android:toalpha="0.9"/> <alpha android:duration="300" android:fromalpha="0.9" android:startoffset="300" android:toalpha="0.6" /> <alpha android:duration="300" android:fromalpha="0.6" android:startoffset="600" android:toalpha="0.9" /> <alpha android:duration="300" android:fromalpha="0.9" android:startoffset="900" android:toalpha="1" android:fillafter="true"/> but imageview not opaque set toalpha = 1 in end. because can set once in xml? this worked me: <?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android" android:fillenabled="true"

python - Time.sleep() and win32api.Sleep() cannot work when convert .py file to .exe file -

i'm writing script using selenium webdriver python. when run program in ide script run good, when convert .py file .exe , run exe file in window delay function not working. maybe passed delay function. used both time.sleep() , win32api.sleep() of them not display when running exe file. here example: import time import win32api time.sleep(10) win32api.sleep(1000) could know this? thank you! i'm using python 3.6, spyder ide. used cx_freeze convert py file exe file.

sdn - Opendaylight Dlux how to make flow table? -

Image
i downloaded mininet, opendaylight, etc.. , wanted add flow table switches.i used dpctl , sh ovs-ofctl command. hard add flow tables each switches. i want add flow table on dlux ui. don't know how fill in blank. made topology by: sudo mn --controller=remote,ip=127.0.0.1,port=6633 --switch ovsk --topo tree,2,2 i see node id of switches. "openflow:1","openflow:2","openflow:3" so input openflow:1.. occured error! don't know how fill blank you need add flow manually through mininet terminal : ovs-ofctl add-flow [switch_name] ip,nw_dst=192.168.0.1,actions=drop note : try typing sh before command if not work. that example flow. see this link whole ovs commands reference.

Python Bokeh - Making example standalone - Widget error -

i'm learning bokeh, make example 'stocks' script https://demo.bokehplots.com/apps/stocks produce standalone html file...i have added following code: from bokeh.embed import components plots = [corr, ts1, ts2] script, div = components(plots) print(script) print(div) html = """<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>bokeh scatter plots</title> <link rel="stylesheet" href="http://cdn.pydata.org/bokeh/release/bokeh-0.12.6.min.css" type="text/css" /> <script type="text/javascript" src="http://cdn.pydata.org/bokeh/release/bokeh-0.12.6.min.js"></script> <!-- copy/paste script here --> {} </head> <body> <!-- insert divs here --> {} </body> </html>""".format(script, div)

python - Pandas value counts without sorting results -

Image
i using python's value_counts(sort=false) function on column called 'order_id' on dataframe, order of output different order data displayed in dataframe. for instance, when df['order_id'].value_counts(sort=false) , result order different order in dataframe (2398795,473747) etc. the dataframe looks this: the end goal this: each order id, want count of product_ids order , days_since prior order. iiuc, use groupby , agg : df.groupby('order_id', sort=false)\ .agg({'product_id': 'size','days_since_prior_order': 'sum'}) output: product_id days_since_prior_order order_id 2398795 6 90.0 473747 5 105.0 2254736 5 145.0 431534 2 56.0

authentication - Could we destroy JWT token in Asp.NET Core? -

i use asp.net core & asp.net core identity generate jwt token. in client side, react (spa) app call api create token include authorization: bearer tokenfromapi in subrequests. when want logout how can expire token in server side? currently delete bear token in client side , not included in next request? reference : https://blogs.msdn.microsoft.com/webdev/2017/04/06/jwt-validation-and-authorization-in-asp-net-core/ code in configure section in startup.cs app.usejwtbearerauthentication(new jwtbeareroptions { automaticauthenticate = true, automaticchallenge = true, tokenvalidationparameters = new tokenvalidationparameters { validissuer = "mysite", validaudience = "mysite", validateissuersigningkey = true, issuersigningkey = new symmetricsecuritykey(encoding.utf8.getbytes("veryl0ngkeyv@lueth@tissecure")), validatelifetime = true } }); api create token [httppost("to

Convert python list into dictionary and adding values having same keys -

datalist = [[868, 's00086', 640.80, 38.45], [869, 's00087', 332.31, 19.94], [869, 's00087', 144.00, 8.64],] how convert datalist dictionary assigning keys [868,869] , add values @ index 2 , 3 of inner list having similar key value i.e 332.31,144.00 , 19.94, 8.64 result : datadiict{868:['s00086', 640, 38.45], 869:['s00087', 476.31, 28.58]} please suggest effective solution , in advance you use itertools.groupby() , grouping on first item of each sublist: from itertools import groupby datalist = [[868, 's00086', 640.80, 38.45], [869, 's00087', 332.31, 19.94], [869, 's00087', 144.00, 8.64],] datadict = {} k, group in groupby(sorted(datalist), key=lambda x: x[0]): v in group: if k not in datadict: datadict[k] = v[1:] else: datadict[k][1] += v[2] datadict[k][2] += v[3] print(datadict) # {868: ['s00086', 640.8, 38.45], 869: ['s00087

javascript - React ES6, How to keep decorators in separate files -

we have created lots decorator in reactapp. now have write decorators in every file, typical code this. ******** mycomponent.js ************* import {decorators} 'decoratorlib'; import react, {component} 'react'; const {moduleloader, moduleconfig, log} = decorators; @moduleloader({ config: { k1: 'value 1', k2: 'value 2', viewclass: moduleviewclass, ...moduleconfig }, proptypes: { name: proptypes.string.isrequired, age: proptypes.number, address: proptypes.string, quantity: proptypes.number } }) @moduleconfig({ config: { k1: 'value 1', k2: 'value 2', viewclass: moduleviewclass, ...moduleconfig } }) @log({ config: { warning: true, error: true, breakonerror:false } }) class mycomponent extends component { } i wondering how, can write these decorators in sperate file , write

jquery - Time Validation in Javascript -

i'm working on time , validation in javascript, in validation time entered user , validate through conditions, date gets validate time not getting validate code : html <input type="date" id="date-input" required /> <input type="time" id="stime" required/> <input type="time" id="etime" required/> <button id="submit">submit</button> javascript $('#submit').on('click', function(){ //date validation ------------------------------------ var date = new date($('#date-input').val()); var today = new date(); var date1 = date.getdate(); var date2 = today.getdate(); if(date1 < date2){ alert("please fill valid date"); } //-------------------time validation----------------------- var t1 = new date($('#stime').val()); var t2 = new date($('#etime').val()); var time1 = t1.gethours(); var time2 = t2.gethours(); if(time1==ti

batch file - Taking mysql backup using .bat and taskscheduler failed run viataskscheduler -

Image
i create "export.bat" , put these line of code @echo off c:\program files\mysql\mysql server 5.6\bin\mysqldump.exe --user=root --host=localhost --password=mind --protocol=tcp --port=3306 --default-character-set=utf8 --single-transaction=true --routines --events --no-data "db_ows" > ows_back.sql when direct run working fine. but trying task scheduler on windows server 2012, failed. action setting of task scheduler follows. i change action settings in task scheduler action tab its works.. (:

.htaccess - OpenCart 3.X SEO URLs are all going to the homepage -

i'm running opencart 3.0.2.0 , i've turned on seo urls. they're displaying home page. htaccess file came default (yes, changed htaccess.txt .htaccess). i can't life of me figure out why they're not working. has else had problem? i've posted in open cart forums, no 1 ever seems reply there.. awesome. here's htaccess file: # 1.to use url alias need running apache mod_rewrite enabled. # 2. in opencart directory rename htaccess.txt .htaccess. # support issues please visit: http://www.opencart.com options +followsymlinks # prevent directoy listing options -indexes # prevent direct access files <filesmatch "(?i)((\.tpl|.twig|\.ini|\.log|(?<!robots)\.txt))"> # require denied ## apache 2.2 , older, replace "require denied" these 2 lines : order deny,allow deny </filesmatch> # seo url settings rewriteengine on # if opencart installation not run on main web folder make sure folder run in ie. / becomes /shop/ rewriteb

Using cookies in Universal Rendering using angular-cli -

i have made angular app using angular-cli , doing universal rendering in following steps given here . mentioned can't use global variables window , document in app if doing universal rendering, how can set cookies @ front end maintain user session. using jwt, doing need set cookies in browser. i have had success using npm package ng2-cache (i using angular 4 , works fine). using local storage, have in module providers array this: providers: [ cacheservice, {provide: cachestorageabstract, useclass: cachelocalstorage}, ... ] another option use isplatformbrowser() shown here . the ugliest option put code dealing cookies in try-catch statements. way work on browser , ignored on server side.

java - How to integrate an Angular 4 app with a Spring Boot stack? -

i integrate angular 4 client app java spring application working on http://localhost:8080/ , offering rest endpoints. goal able call angular app url http://localhost:8080/adminisitration . how can that? thanks in advance, you need prod build ng app , place in spring-boot folder 1. create public folder under resources in spring-boot project 2. ng-build --prod, type command on angular project create dist folder under angular project directory 3. copy files dist folder , place in public folder under resources of spring-boot project. this run angular-app under spring-boot. then hit http://localhost:8080/adminisitration , should work fine

Django inernal server Error -

i'm working on django website. when upload image , name in english, uploaded. when try in arabic can't upload, gives internal server error. i think got unicode error in server. set both in system environment check. lang='en_us.utf-8' lc_all='en_us.utf-8' https://code.djangoproject.com/wiki/django_apache_and_mod_wsgi#additionaltweaking

python - Why does this not identify the variable s? -

this question has answer here: python nested function scopes 3 answers python nested functions variable scoping 10 answers consider python code: def lower_it(s): def charr(): s = s.lower() #error ans = s return ans return charr() the place have written #error gives error because says s referenced before assignment. don't think should give error because if call function lower_it('hello') , should make s = 'hello' , s in scope of charr , right? variable defined in body of lower_it should in scope of charr , right?

c# - How to get rid of properties not belonging to the class? -

this question has answer here: how hide inherited property in class without modifying inherited class (base class)? 9 answers say have these 2 classes class car { public string carname {get;set;} } class employeecar:car { public string employeename {get;set;} } when call api [httpget] public car getcar(employee employee) { return getemployeecar(employee); } assuming private employeecar getempoyeecar(employee employee) { return new employeecar { carname: "car 1", employeename: "employee 1" }; } i getting this { carname: "car 1", employeename: "employee 1" } note employeename not belong car . how can api return properties of car ? (which return type of api) ie. { carname: 'car 1' } solution this longer hoped (not sure if there shorter version) hope can someone public car getcar(emplo

java - A way to differentiate OnDismiss from dialogfragment - Android Studio -

i need on somehow differentiate ondismiss coming from. i'm using 2 different dialogfragments. dialogclass1 dialog1 = new dialogclass1(); dialogclass2 dialog2 = new dialogclass2(); public void ondismiss(dialoginterface dialoginterface){ if(dialoginterface.equals(dialog1){ //code# }else if(dialoginterface == dialog2){ //code# } ) is there way work? thanks if both of different types check instanceof. if(dialoginterface instanceof dialoginteface1){}

c# - How do use Random by WebDriverWait? -

i know webdriverwait use method. for example: var wait = new webdriverwait(driver, timespan.fromseconds(1000)); i use random method replace 1000 position,please tell me how can do? use random : random random = new random(); var wait = new webdriverwait(driver, timespan.fromseconds(random.next())); random.next() can customised for eg; random.next(0, 1000) yield random values between 0 , 1000 so code become var wait = new webdriverwait(driver, timespan.fromseconds(random.next(0,1000)));

html - Custom Field in Rmarkdown Header -

Image
i attempting make template html rmarkdown document used team @ work. word document i'm hoping replace has header set of fields required our data management process. the image below shows both word document want replace , current best attempt markdown. title, author , date fields nice , simple, exist in (yaml?) header. struggling job, version , folder path fields. current workaround i've used subtitle including folder path. final template i'd prefer fields in order of in word document , version, job , path fields have same font author , date. from i've read believe may possible editing default.html html knowledge extremely limited! the header used markdown template is, --- title: "title" subtitle: "s:/path/to/job" author: richard haydock date: "`r format(sys.date(), '%d %b %y')`" output: html_document: code_folding: hide toc: true toc_float: collapsed: false smooth_scroll: false df_print: pa

php - No route found, Symfony routing not updating properly -

my routing.yml: user_user: resource: "@useruserbundle/resources/config/routing.yml" prefix: /user book_book: resource: "@bookbookbundle/resources/config/routing.yml" prefix: /book index_index: resource: "@indexindexbundle/resources/config/routing.yml" prefix: / app: resource: "@appbundle/controller/" type: annotation fos_user: resource: "@fosuserbundle/resources/config/routing/all.xml" app_api: resource: "@appbundle/controller/api" type: annotation mvms_api: type: rest prefix: /api resource: "@appbundle/resources/config/api-routing.yml" my api-routing.yml: blog_api_articles: type: rest resource: "@appbundle/controller/articlescontroller.php" name_prefix: api_article_ blog_api_reviews: type: rest resource: "@appbundle/controller/reviewscontroller.php" name_prefix: api_reviews_

loader - Incompatible error in loadmanager in android studio -

i getting error in public loader<list<earthquake>> oncreateloader(int i, bundle bundle) method, giving error - "error:(116, 16) error: incompatible types: earthquakeloader cannot converted loader<list<earthquake>>" also showing error in loadermanager loadermanager = getloadermanager(); so using getsupportloadermanager() instead. loadermanager loadermanager = getsupportloadermanager(); and resolves earthquakeactivity.java package com.example.android.quakereport; import android.content.intent; import android.net.uri; import android.os.bundle; import android.support.v4.app.loadermanager; import android.support.v4.content.loader; import android.support.v7.app.appcompatactivity; import android.util.log; import android.view.view; import android.widget.adapterview; import android.widget.listview; import java.util.arraylist; import java.util.list; import static android.r.attr.data; public class earthquakeactivity extends appcompat

python 2.7 - Tensorflow Sound Classfication not computing prediction scores -

i'm new tensoflow serving , have written code in tensorflow used predict sound (sound classification) when build response without labels nor scores *the labels supposed numeric 1-2 error output snapshot i know problem asked before response.

Excel VBA formula R1C1 Vlookup -

i using vlookup function in excel. right formula this: "=vlookup([engagement id],pivots!al:au,10,false)" when vba, changes range("ct2").formular1c1 = _ "=vlookup([engagement id],pivots!c[-60]:c[-51],10,false)" i dont want -60:-51 , want letters itself. once change formula have al: au instead of -60 :-51 doesnt work. knows do? adrian r1c1 formulas use indexed cell coordinates (numbers), if want use letters don't use r1c1 formula classic ones: range("ct2").formula = "=vlookup([engagement id],pivots!al:au,10,false)"

tsql - How to use case clause in where condition using SQL Server? -

hi going filter 1 query in sql server. getting error thing incorrect syntax near '=' . i have 1 table. in table store 2 column 1 socialtype , 2 isfuser this. want filter on 2 column.my filter param all,instagram,isfuser. need select want data. after select instagram instagramusers. this. here query. declare @filter nvarchar(max) = 'instagram' select * users isdeleted = 0 , @filter = case when @filter = 'instagram' socialtype when @filter = 'isfuser' (isfuser = 1) else @filter = 'all' (1 = 1) end this query want apply filter how can have no idea. getting error. you expand condition to: declare @filter nvarchar(max) = 'instagram'; select * users isdeleted = 0 , ( (@filter = 'instagram' , socialtype = 'instagram') or (@filter = 'isfuser' , ifuser = 1) or @filter = 'all' );

python 3.x - When creating a text file, should it appear in the project navigator straight away? -

yesterday, files created appeared in project navigator created. today, no changes made code, reason files appear in navigator after execute other parts of code or when terminate code. i'm including of code because it's when user chooses options 3, 4 , 5 files appear in navigator. said, yesterday, files appeared created reason today don't, though have made no changes code. import sys def main(): main_menu_choice = input("""please choose following 1. register child. 2. register staff member. 3. children. 4. staff. 5. exit.""") if main_menu_choice == "1": child_first_name = input("enter child's first name") # check no empty string or digit entered if child_first_name == "" or any(str.isdigit(c) c in child_first_name): print("invalid entry.") main() return() else: child_last_name = inpu

java - How to build a PDF file under multiple threads document.close() performance? -

i build pdf file under multiple threads , add text embedded font(the font true type unicode encoding). code snippet below: basefont basefont = basefont.createfont("/pathto/font.ttf", basefont.identity_h, basefont.embedded); font chinesefont = new font(basefont, 14, font.bold); pdfreader pdfreader = new pdfreader(tmpfile); document doc = new document(pdfreader.getpagesize(1), 50, 50, 50, 50); bytearrayoutputstream baos = new bytearrayoutputstream(); pdfwriter pdfwriter = pdfwriter.getinstance(doc, baos); pdfwriter.setencryption(null, null, pdfwriter.allow_copy, pdfwriter.standard_encryption_128); doc.open(); pdfimportedpage importpage = pdfwriter.getimportedpage(pdfreader, 1); doc.newpage(); pdfcontent.addtemplate(importpage, 0, 0); doc.add(new paragraph("測試", chinesefont)); //chinese-characters doc.close(); //**takes long time** but doc.close() takes long time. problem? at java/io/filedescriptor.read(native method) @ java

C++ reference deleted function error -

void user::addaccount(const account& _account) { this->account = _account; } is giving me error, as void user::adddevice(const device& _device){ this->device = _device; } does not give error. error is severity code description project file line suppression state error c2280 'account &account::operator =(const account &)': attempting reference deleted function i have used same construct , error you need overload = operator able this. see, when type x = y in code , if both of same type , compiler(provided not using interpreted language) knows how assign them work fine. now account custom type, have tell c++ compiler how assign them. device class/structure have overloaded it. quite simple example same check out link tutorialpoint = operator overloading

twitter bootstrap 3 - All text along with button text is displaying in the parent control of typehead -

i have implemented boot-strap typehead.js in my application , have used highlighter building custom list label , button . when traversing option using down , up key in parent text box along label text button text showing.but in selection label text showing. want behaviour in option traversing also.