Posts

Showing posts from 2013

mysql - Select a specific number of records from a record -

i have query working need show 4 record record 5 of database? how query look? select noticias.id, idn, titulo, chamada, foto_a, subcatid, noticias_subcategorias.subcategoria, slug, noticias.rlogdata noticias, noticias_subcategorias noticias.subcatid = noticias_subcategorias.id , noticias.status = 1 , posicao = 1 , noticias.tipo = 2 order idn desc limit 0, 4 thanks. if want start @ record 5, you'd use limit 4 offset 4 skip first 4 records.

Invalid syntax for turtle name (python) -

i trying write program draw flower, no matter keeps throwing "invalid syntax" error turtle name. have taken out of other code, tried naming turtle different, yet nothing works. ideas? import turtle def draw_flower(): window = turtle.screen() window.bgcolor(#42dff4) sam = turtle.turtle() sam.forward(50) window.exitonclick() draw_flower() besides quoting color string, noted in comments, lines of code in wrong order. example, nothing should follow window.exitonclick() : window.exitonclick() draw_flower() make (or window.mainloop() ) last statement of program that's when code ends , tk event handler loop begins. i.e. reverse order of these 2 statements. second problem variable window in wrong scope: def draw_flower(): window = turtle.screen() ... window.exitonclick() since it's defined locally in draw_flower() , it's not available use globally. here's rework of code addressing both issues: import turtle ...

php - Laravel 5.4 Upload images with their own names -

i want upload images own names. when tried, upload diffrent names. example; php0k0saj.57352.jpg (!?) my controller; public function post_savenews(request $request) { $request->all(); /* out of question $head = $request->input('head'); $content = $request->input('content'); $keywords = $request->input('keywords'); */ $featured=$request->post_featured; $extension=$request->post_featured->getclientoriginalextension(); $photoname = $featured . '.' . rand(11111, 99999) . '.' . $extension; $request->post_featured->move(public_path('uploads'), $photoname); news::create(array('head' => $head, 'content' => $content, 'keywords' => $keywords,'post_featured'=>$photoname)); return redirect()->route('index'); } update line. $photoname = $featured . ...

database - SQL Select statement --- more than 1 table and specific rows in select statement -

i know right way select more 1 table in database in select statement? i'm trying code executes both, first select statemnts gets rewriten second ` con.open(); ds.clear(); da.selectcommand = new sqlcommand("select id, username, ime, prezime student", con); da.selectcommand.executenonquery(); da.selectcommand = new sqlcommand("select odjel, smjer studij", con); da.selectcommand.executenonquery(); da.fill(ds); dg.datasource = ds.tables[0]; con.close();` i have been trying using , between tables doesnt work con.open(); ds.clear(); da.selectcommand = new sqlcommand("select id, username, ime, prezime student , odjel, smjer studij", con); da.fill(ds); dg.datasource = ds.tables[0]; con.close(); i don't have need use whole table, rows, --> select * student, studij <--- won't me good. how can select mul...

email - Send excel sheet content in mail body using jenkins -

in jenkins, under editable email notification have set default content fields ${file,path="\\projectfolder\\reports\\htmlreport.html"} content type = default content type and getting html content in email body. when trying set email body content excel using ${file,path="\\projectfolder\\reports\\reportsummary.xlsx"} content type = default content type i not getting email jenkins. someone please help.

How to change the black color in Android dialogs or drawer menu -

Image
in android, when show alert dialog, progress dialog, open drawer , etc, seems have transparent black layer on screen, kind of dialog, pic: my goal changing transparent black layer, not background of dialog, see picture: how change color of transparent black layer red or color? example in xml or code in java this code myexitdialog class public class myexitdialog extends dialog implements android.view.view.onclicklistener { databasehandler userdb; public activity c; public dialog d; public button yes, no; public myexitdialog(activity a) { super(a); this.c = a; } @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); requestwindowfeature(window.feature_no_title); setcontentview(r.layout.mydialog); yes = (button) findviewbyid(r.id.id_exit_yes); no = (button) findviewbyid(r.id.id_exit_no); yes.setonclicklistener(this); no.se...

python - TensorFlow vs. Theano Performance -

in context of neural network research i'm evaluating several approaches on how implement these or library use. i'm comparing tensorflow , theano , i'm struggling getting tenorflow perform well. here simple hello-gradient-benchmark, optimizes scalar multiplication 1 coefficient. import time class timer: def __init__(self, what): self.what = def __enter__(self): self.t1 = time.time() return self def __exit__(self,t,v,tb): t2 = time.time() print("{0} runs {1:.4f} seconds".format(self.what, t2-self.t1)) def run_tensorflow(): import tensorflow tf x = tf.placeholder(tf.float32) y = tf.placeholder(tf.float32) = tf.variable([1.], tf.float32) sess = tf.session() sess.run(tf.global_variables_initializer()) loss = (y-a*x)**2 step = tf.train.gradientdescentoptimizer(0.01).minimize(loss) def one_step(): sess.run(step, {x:1.,y:0.}) timer('tensorflow') t: result = [ one_ste...

javascript - Magento 2 call custom library in select.html -

i need call custom library select. have issue calling library on knockout files. particularly select being rendered file magento_ui/templates/form/element/select.html have tried found online had no luck. tried extended select.js new function , call on afterrender in file, tried usin x-magento-init, , on. i need this select: $('select').select2(); can provide concrete , precise solution problem? thanks! to answer own question. issue when add call custom library in select.js there no jquery in define, needed add jquery. after getting error part return abstract.extend it's not jquery function. after adding 'ko' define before jquery able write new function called inside afterrender method of ui module.

operator precedence - Define variable in IF does not work in PHP -

... elseif ($notes = json_decode($op->notes) && isset($notes->newset)){ // $notes = json_decode($op->notes); $set = \app\set::find($notes->newset); $settitle = $set->title; } ... the above elseif statement generates error trying property of non-object regarding line $set = \app\set::find($notes->newset) passing through elseif block should mean $notes assigned in elseif , value of $notes->newset found. i don't know why above snippet not works! works if uncomment // $notes = json_decode($op->notes); the php version 7.0.18 as pointed out @zerkms, because of operator precedence, part of expression following $notes = is evaluated first, , in success case, json_decode($op->notes) && isset($notes->newset) evaluates true , resulting in $notes being assigned true , rather json_decode() d data want. to fix issue, wrap assignment in parenthesis, , evaluated first, an...

Java Hibernate json infinite recursion with self referencing class -

class employee: @entity @table(name = "employee") public class employee { @id @generatedvalue(strategy = generationtype.auto) @column(name = "employeeid") private int employeeid; @column(name = "managerid") private integer managerid; @manytoone(cascade={cascadetype.all}) @joincolumn(name="managerid", insertable = false, updatable = false) @jsonbackreference private employee manager; @onetomany(mappedby="manager") @jsonmanagedreference private set<employee> employees; @manytoone(cascade={cascadetype.all}) @joincolumn(name = "departmentid") private department department; @manytoone(cascade={cascadetype.all}) @joincolumn(name = "salarytypeid") private salarytype salarytype; @column(name = "name") private string name; //setters , getters here, wont posting them } whenever create instance of employee infi...

python - xlsxwriter chart with multiple categories -

Image
my excel chart has 2 index columns: 'month' , 'year'. how can combine them in python code below achieve graph looks 1 below? specific, how specify multiple categories? chart.add_series({ 'categories': ............., 'values': ['sheet 1', 0, 1, 10, 1] }) excel graph want achieve i tried: chart.add_series({ 'categories': [['sheet1', 0, 0, 10, 0], ['sheet1', 0, 1, 10, 1]] 'values': ['sheet1', 0, 2, 10, 2] }) xlsxwriter supports clustered charts this. see example docs. the main trick work specify categories 2d ranges (from column column b). creates clusters.

javascript - Rails / Facebook SDK - Storing user access token into Rails object -

i'm working on app i'm using facebook javascript sdk allow users login give access manage pages. i'm getting stuck pretty on trying figure out how can store user's user access token after login, , retrieve when want grab other elements later. far have working - application.js- window.fbasyncinit = function() { fb.init({ appid : 'my-app-id', autologappevents : true, xfbml : true, version : 'v2.10' }); }; (function(d, s, id){ var js, fjs = d.getelementsbytagname(s)[0]; if (d.getelementbyid(id)) {return;} js = d.createelement(s); js.id = id; js.src = "//connect.facebook.net/en_us/sdk.js"; fjs.parentnode.insertbefore(js, fjs); }(document, 'script', 'facebook-jssdk')); profile.html.erb - <script> (function (d, s, id) { var js, fjs = d.getelementsbytagname(s)[0]; if (d.getelementbyid(id)) return; js = d.createelement(s)...

amazon s3 - Updating files for my static website on S3 -

i'm trying update static website i'm hosting on amazon aws s3 - need put new version of resume there. i've gone through documentation , seems though need 'invalidate' file - guides i'm finding talk using cloudfront, service don't use. so static website need update single file, how do without cloudfront? "if upload object key name exists in bucket, amazon s3 creates version of object instead of replacing existing object." http://docs.aws.amazon.com/amazons3/latest/user-guide/upload-objects.html may need check in aws s3 console url new version of object. you can update file through aws s3 console , programmatically using package python , ruby , etc., or using aws command line . if using aws command line , can upload file s3 using these commands: $ aws configure aws access key id [none]: akiaiosfodnn7example aws secret access key [none]: wjalrxutnfemi/k7mdeng/bpxrficyexamplekey default region name [none]: us-east-1 default ...

vba - Filtering Access Report based on Access Form field -

i have access form , access report. create macro when user clicks button, report automatically filtered specific record on form. note: [store name] field not identical [store number] field. in past, have been manually going report , filtering report using text filters>contains> value. example: [store name] might "#001 - los angeles", [store number] 001, filtering [store name] field text contains 001. here's got far: private sub command466_click() dim myvariable string myvariable = [storenumber] docmd.openreport "report query", acviewpreview, , [store name] myvariable end sub i'm not great @ vba, i've been receiving error: "microsoft access can't find field '|1' referred in expression". the fourth argument of openreport method must valid sql where clause without word where . try this: private sub command466_click() dim myvariable string myvariable = [storenumber] docmd.openreport ...

Namespace Naming convention for data classes not stored in database -

i'm using framework uses active record pattern, therefore classes represent row in table inside models namespace. these classes have 'helper' classes represent data not stored row, json data inside row. example array of address objects (where it's absolutely no search needed on these objects) address class contains properties such postcode / house number / country etc. array of price contains currency / price / date , again no searching necessary - no need separate table. what / or correct term namespace such classes not models? don't want use namespace helpers .

ios - Showing all deprecated warnings in Xcode -

how show deprecated warnings in xcode ios app? clicking on issue navigator > buildtime > scrolling down deprecations seems show deprecations opened or previously-opened files. when open more files, more deprecations appear. i'd see complete view of deprecated methods across files.

rpc - How to throw an exception from a server API code in Dart? -

i'm developing client-server application in dart , have been following tutorial . server code based on it. in server api code, when goes wrong, want throw exception, example: void checkeverything() { if(somethingwrong) throw new rpcerror(400, "something wrong", "something went wrong!"); } @apimethod(path: 'myservice/{arg}') future<string> myservice(string arg) async { checkeverything(); // ... return myserviceresponse; } and exception should processed in main server, e.g. // ... var apiresponse; try { var apirequest = new httpapirequest.fromhttprequest(request); apiresponse = await _apiserver.handlehttpapirequest(apirequest); } catch (error, stack) { var exception = error error ? new exception(error.tostring()) : error; if((error rpcerror && error.statuscode==400) { // code creating http response apiresponse = new httpapiresponse.error( httpstatus.bad_request, "something went wrong"...

Python Flask returning a html page while simultaneously performing a function -

i'm creating web app using python flask , i've run road block , i'm not sure if i'm thinking correctly. so website's homepage simple landing page text input required perform websites function. trying accomplish web app perform 2 things after text input. first, server takes username input , performs function doesn't return user creates bunch of data logged sqlite database, , used later on in process. then, server returns web page survey has taken after username input. however, function server performs can take upwards of 2 minutes depending on user. way have coded, server performs function, once has finished, returns web page, user stuck @ loading screen 2 minutes. @app.route("/survey") def main(raw_user): raw_user = request.args.get("steamid") < games = creategamedict(user_obj) <----- function tag_lst = get_tags(games) < return render_template("survey_page.html") s...

How do we stop Wordpress auto updates -

how stop wordpress auto updates auto updates theme design , functionality distributed. you can disable automatic updates in wordpress adding line of code in wp-config.php file: define( 'wp_auto_update_core', false ); this disable automatic wordpress updates. visit wpbeginner

php - foreach gives me a warning of undefined variable -

this question has answer here: reference: variable scope, variables accessible , “undefined variable” errors? 3 answers i'm making class, "item", intent used this: require_once("item.php"); $myitem = new item(); $myitem->setname("test"); $myitem->adddeal(5,25); $myitem->show(); the show() function should add object on global array called $items the class in item.php looks this: $items = array(); class item { public $name = "undefined"; public $image; public $deals = array(); public function setimage($path) { $this->image = (string)$path; } public function setname($name) { $this->name = (string)$name; } public function adddeal($amount, $price) { $this->deals[(string)$amount] = (string)$price; } public functi...

.net - C# await task Console splash -

this question has answer here: can't specify 'async' modifier on 'main' method of console app 15 answers static void main(string[] args) { print(); } static async void print() { try { await task.factory.startnew(() => { thread.sleep(3000); console.writeline("3"); debug.write("3"); }); } catch (exception) { } console.read(); } console splashed without error occurs! it happens because print method called in parallel main goes on , since there nothing else do, returns. after main finished program exits. if want wait print method, change returns task instead of void , wait task in main method: static void main(string[] args) { print().wait(); } static async task print() {...}

html - combination selector - Plus selector in css not working -

may don't understand plus selector, want, when user click on radio button home, div 1 should displayed, , when user click on radio button about, div 2 should displayed, did not work, strip down code, problem, code accepted div 1 displayed home default checked. did not happened, know problem dont know why, please read comment, in code, said line giving problem hint it's css last section, html code <div class="container"> <input type="radio" name="option" id="home" checked /> <input type="radio" name="option" id="about" /> <div class="navigation"> <label for="home" class="link">home</label> <label for="about" class="link">about us</label> </div> <div class="display"> ...

angular - Textbox is not hitting the "TextUpdated" event when the text is wrapped in double asterisks -

i new angular2 , having issue 1 of components not hit "textupdated" event when text wrapped in double asterisks. there no character limit , works fine single asterisks not two. on text input have <input type="text" (ngmodelchange)="onjobtitleselected($event)" /> onjobtitleselected(jt: any): void { if ((typeof jt) !== "string") { this.model.jobtitle = jt; this.model.jobtitleid = jt.id; this.model.jobtitletext = jt.text; } else { this.model.jobtitletext = jt; } this.onjobtitleupdated.emit(this.model.jobtitletext); }

Android - AsyncTask inside Fragment doesn't work in Marshmallow -

i created asynctask fetch scores. shows progressdialog split-sec , disappears. doinbackground method never gets executes. task called inside fragment. private class getscore extends asynctask<string,string,string> { @override protected void onpreexecute() { final progressdialog show = progressdialog.show(getactivity(), "", yourname); super.onpreexecute(); } @override protected string doinbackground(string... args) { scoremap = scorecalc.getengscore(yourname); // toast.maketext(loveactivity.this, engagemap.tostring(), toast.length_short).show(); return null; } @override protected void onpostexecute(string img) { } } . . . . . . . private void confirmyes() { string s =medittext.gettext().tostring(); if(s.equals("")) return; new getscore().execute(); } help? use asy...

tensorflow - serializing and reading 2D sequence into/from TFRecords -

i'm trying serialize 2d vector (spectrogram of speech, varied in length) tfrecord. there example this? have tried code here , here , seem not suit needs. how serialize 2d (or n-d array) varied in length sequence tfrecords? my current implementation (no errors, think it's not correct): # extract spectrogram wav rate, wav = wavfile.read(wav_path) _, __, sxx = spectrogram(wav, fs=rate, nperseg=254, noverlap=127) spectrogram_feat = np.moveaxis(sxx, 0, -1) # shift axis [freq, time] -> [time, freq] # make example ex = tf.train.sequenceexample() ex.context.feature['seq_length'].int64_list.value.append(spectrogram_feat.shape[0]) ex.context.feature['n_feature'].int64_list.value.append(spectrogram_feat.shape[1]) fl_spectogram = ex.feature_lists.feature_list['spectrogram'] fl_label = ex.feature_lists.feature_list['label'] in range(spectrogram_feat.shape[0]): # print(spectrogram_feat[i, ...

google analytics - How to create a custom metric for GA in GTM, this custom metrics should increment everytime the event action "TEST" is fired -

how create custom metric ga in gtm custom metrics should increment every time event action test fired first need create custom metric in google analytics. go property settings, custom definitions, custom metrics. click "new metric", provide name , scope. make note of numeric index given new metric, need adress field in gtm. in gtm go analytics tag fires event. in "more settings" "custom metrics". click "new custom metric". in first field enter numeric index metric (see above), in second enter number "1". number added metric in ga every time tag fired. if use google analytics settings variable in gtm need check "enable overwriting settings tag" access "more settings" pane.

kubernetes - Can minikube handle oidc authentication? -

i have installed k8s using minikube on ubuntu 16.04 machine virtualbox driver. i confused various documents related topic. not possible minikube, minikube documents suitable test purpose. believe maybe there way achieve oidc authentication minikube. there link can follow? i want enable oidc in production environment. not familiar k8s, thought minikube ideal test feature first. reason want know if minikube support oidc. if yes, can make changes here , replicate same in production environment. i have referred official documentation, not give detailed explanation on how obtain oidc parameters , files modified. now have spent time on this, answering question can someone. answer yes. minikube provides k8s setup supports oidc based authentication. have been able configure it. here details on how configured kube-apiserver parameters. minikube start \ --extra-config=apiserver.authorization.mode=rbac \ --extra-config=apiserver.authentication.oidc.issuerurl=ht...

sql server - SQL Select All Columns with grouped 2 columns have count = 1 -

i trying select 3 columns table based on first 2 columns (as group) having count = 1 . once have been identified bring in 3rd column of row. this statement works first 2 columns can't add 3rd column don't want search group defined this. select defect_point, report_num mycount group defect_point, report_num having count(*) = 1 any ideas go here? if understand right, use on clause , subquery achieve want. select * ( select defect_point, report_num, third_column, count(*) over(partition defect_point, report_num) your_count mycount ) your_count = 1;

jvm - What is Unit Object in Kotlin -

this question has answer here: what purpose of unit-returning in functions 2 answers right learning kotlin, in guide run these 2 methods, 1 with unit , 1 doesn't method with unit fun printsum(a: int, b: int): unit { println("sum of $a , $b ${a + b}") } method without unit fun printsum(a: int, b: int) { println("sum of $a , $b ${a + b}") } my question is, unit actually? void in java? if it's void why 1 of method above doesn't have unit run fine. which 1 should use when want method returning nothing? , when best time use unit . anyone can explain? cause it's confusing me. in advance. yes .it mentioned in website @ github source that object unit type 1 value: unit object. type corresponds void type in java . also in repository, /** * type 1 value: unit object. type corresponds void ...

php - XDebug: IDE Key settings cannot be changed -

i following instruction on xdebug site, want use phpstorm ide. follow steps , set following in c:\xampp\php\php.ini : [xdebug] zend_extension=c:\xampp\php\ext\php_xdebug-2.5.4-5.6-vc11.dll dbgp_idekey=phpstorm xdebug.idekey=phpstorm xdebug.enable=1 xdebug.remote_enable=1 i set dbgp_idekey=phpstorm in environment variables. @ chrome side, set ide key phpstorm as well. but no matter how hard try, each time when restart xampp apache, in phpinfo() shows ide key xdebug_eclipse . don't know set , why doesn't overwritten.

php - Data in CSV file only being imported partially into phpMyAdmin database table -

i'm trying import csv file complete data phpmyadmin database table. however, part of data in csv file being imported. if import csv file @ phpmyadmin, data being imported. there no error show , i'm not sure problem occurs. i'm using load data infile load data database table. here code: <?php session_start(); $host = "localhost"; $user = "root"; $password = ""; $db = "smposi"; $con = mysqli_connect($host,$user,$password,$db); $message = ""; $m_sfile = $_session['sfile']; if (isset($_post['submit'])) { $allowed = array('csv'); $filename = $_files['file']['name']; $ext = pathinfo($filename, pathinfo_extension); if (!in_array($ext, $allowed)) { // show error message $message = 'invalid file type, please use .csv file!'; } else { move_uploaded_file($_files[...

html - CSS Button with Gradient Border -

Image
i want make button seen in picture silver-ish border gradient. have done except border stuck it. below current css button. .button_submit { background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #0cbbc8), color-stop(1, #008995)); background:-moz-linear-gradient(top, #0cbbc8 5%, #008995 100%); background:-webkit-linear-gradient(top, #0cbbc8 5%, #008995 100%); background:-o-linear-gradient(top, #0cbbc8 5%, #008995 100%); background:-ms-linear-gradient(top, #0cbbc8 5%, #008995 100%); background:linear-gradient(to bottom, #0cbbc8 5%, #008995 100%); filter:progid:dximagetransform.microsoft.gradient(startcolorstr='#0cbbc8', endcolorstr='#008995',gradienttype=0); background-color:#0cbbc8; -moz-border-radius:6px; -webkit-border-radius:6px; border-radius:6px; border:1px solid #ffffff; display:inline-block; cursor:pointer; color:#ffffff; font-family:arial; font-size:15px; font-wei...

bash - Escaping character only when it appears between parenthesis -

i've searched around internet , tried many combinations can not seem work. i trying write script creates latex table code. works fine until have ampersand inside 1 of values, e.g., {1702} & {12389122} & {topic 1 online quiz} & {1.7} & {2} & {83.3} \\\hline {1702} & {12389122} & {topic 2 & 3 online q...} & {1.9} & {2} & {93.3} \\\hline {1702} & {12389122} & {topic 4 online quiz} & {} & {2} & {} \\\hline {1702} & {12389122} & {topic 5 online quiz ...} & {} & {2} & {} \\\hline i need able read in input.txt file containing data , output result output.txt file, same data apart in line 2 need escape ampersand, e.g., {1702} & {12389122} & {topic 1 online quiz} & {1.7} & {2} & {83.3} \\\hline {1702} & {12389122} & {topic 2 \& 3 online q...} & {1.9} & {2} & {93.3} \\\hline {1702} & {12389122} & {topic 4 online quiz} & {} & {2} & {}...

email - PHP Imap Download Attachment Script Not working -

my script works fine unless there image in body, doesn't work. can't seem figure out. below code: if(!isset($http_user_agent)) $http_user_agent = $_server['http_user_agent']; $isie = $isie6 = 0; $mbox = imap_open("{localhost:143/novalidate-cert}inbox", $email, $login_pass); $partno = "2"; $filename = base64_decode($_get[filename]); function structure function get_structure($structure) { $primarymimetype = array("text", "multipart", "message", "application", "audio", "image", "video", "other"); if ($structure->subtype) { return $primarymimetype[(int)$structure->type] . "/" . $structure->subtype; } return "text/plain"; } function mime_content_type (has been edited reduce size) function mime_content_type($filename) { $mime_types = array( 'txt' => 'te...

android - How to implement passive authentication in smart card reader? -

i found on icao 9303_11 5.1: inspection system performs following steps: the inspection system shall read document security object (so d ) (which must contain document signer certificate (c ds ), see doc 9303-10) contactless ic. the inspection system shall build , validate certification path trust anchor document signer certificate used sign document security object (so d ) according doc 9303-12. the inspection system shall use verified document signer public key (kpu ds ) verify signature of document security object (so d ). the inspection system may read relevant data groups contactless ic. the inspection system shall ensure contents of data group authentic , unchanged hashing contents , comparing result corresponding hash value in document security object (so d ). i'm stuck on step 2. certificate path , how build , validate certification path trust anchor document signer certificate? me out? a certificate path or chain sequ...

c# - Why does await not wait? -

this actual code: async task getdata() { thread.sleep(5000); console.writeline("step 1"); using (httpclient api = new httpclient()) await api.getasync("http://google.com/").continuewith( (gettask) => console.writeline(gettask.result.statuscode); ); console.writeline("step 2"); } private void button1_click(object sender, eventargs e) { task<task> task = new task<task>(getdata); task.start(); task.wait(); console.writeline("step 3"); } i following output: step 1 step 3 ok step 2 why step 3 not come after step 2 ? how work in sequence, ie return caller of getdata until in getdata done? you should mark event handler async private async task button1_click(object sender, eventargs e) and await instead of wait : private async task button1_click(object sende...

java - Selenium click() no longer functioning (w/ Eclipse/Maven/Firefox) -

i started working on selenium tests yesterday. use eclipse run maven builds in java test on firefox. morning, tests running fine. went out lunch , click() function no longer works on computer. the way it's used this: driver.findelement(by.xpath(".....")).click() from can see, selenium still works. sendkeys function still automatically fills in fields, no clicking occurs. manually clicking buttons , boxes still works. i thought had accidentally changed something, deleted tests , recloned whole project, still not functioning on computer. tests work fine on mentor's computer. we're stumped here. you mentioned selenium test works @ mentors computer... it's important know webdriver variant using when starting tests. if webdriver using real installed browser instance (e.g. firefox) , machine runs browser version explain situation. i suggest: first of all: check if got same code base , there no change @ all are using same webdriver versio...

php - Getting message in angularjs chat application without refresh. -

i using angularjs 1.5.5 , codeigniter 3.0 . when send message 1 user user offline working fine after uploaded project come know not working because receiver received message in time when send message sender. $scope.sendsendermessage = function(bsid,srid,message) { //bsid sender id while srid receiver id $http.post(url + 'c_chat/sendsendermessagejson', { 'bsid' : bsid , 'srid' : srid , 'message' : message }) .success(function(data) { $scope.startchat(fksc_id); }); } after sending message through following function data: $scope.startchat = function(fksc_id=false) { if(fksc_id) { $http.get(url + 'c_chat/startchatjson/' + fksc_id).success(function(data) { //console.log(data); $scope.chats = data; }); } } and in view: <div ng-init="startchat()"> <div ng-repeat="chat in chats" > ...

c++ - Difference in amount of time it takes to build using G++ -

i practicing building linked list , thought of separating functions separate files , decouple main file. this file structure came with ./ functions printlist.cpp functionbcd.cpp functions.h linkedlist.cpp node.h header file in linkedlist.cpp #include "functions.h" #include <bits/stdc++.h> using namespace std; header files in functions.h #include <bits/stdc++.h> #include "node.h" header files in "any function implemented".cpp #include <bits/stdc++.h> #include "..\functions.h" using namespace std; compile command g++ -ggdb -o2 -std=c++14 linkedlist.cpp functions\*.cpp now if keep structure mentioned above, compile time 4-5x more structure keep , define functions in 1 file along main. i unable understand this. and if there better way structure files , improve compile time, please tell. thank you. there's fixed overhead each of files, namely launching actua...

node.js - Error while deploying a node app on Heroku -

i used git push heroku command push node app heroku shows following errors. remote: compressing source files... done. remote: building source: remote: remote: -----> node.js app detected remote: parse error: expected key-value pair @ line 17, column 3 remote: ! unable parse package.json remote: remote: remote: -----> build failed remote: parse error: expected key-value pair @ line 17, column 3 remote: parse error: expected key-value pair @ line 17, column 3 remote: remote: we're sorry build failing! can troubleshoot common issues here: remote: https://devcenter.heroku.com/articles/troubleshooting- node-deploys remote: remote: if you're stuck, please submit ticket can help: remote: https://help.heroku.com/ remote: remote: love, remote: heroku remote: remote: ! push rejected, failed compile node.js app. remote: remote: ! push failed remote: verifying deploy... remote: re...

azure - {"error":{"code":"InvalidContentLink","message":"Unable to download deployment content -

below code used deployment in azure: templatelink: { uri: "https://xxx.xxx.xxx.xxx:4443/fulfillment_engine/resources/azure/tmp_miaasafd7c68e51f3_1/template.json", } error: {"error":{"code":"invalidcontentlink","message":"unable download deployment content ' http://xxx.xxx.xxx.xxx:4443/fulfillment_engine/resources/azure/tmp_miaasafd7c68e51f3_1/template.json '. tracking id 'a361db85-8982-4afc-b0c4-94f9f8ba2bef'. please see https://aka.ms/arm-deploy usage details."}} the same code used on different port 4080 , works properly. when port 4080 4443 changed, gives error.

an array of self-defined swift object can't be converted to objective-c type -

a newbie swift i'm doing mixed-language (swift & objective-c) program, , encounter error when trying import swift objective-c here code @objc public enum itemtype: int { case left, right } public class myclass { @objc var items: [itemtype] = [] } here error enter image description here it seems there's wrong itemtype see definition of itemtype in -swift.h file could 1 give me hint? swift , objective-c enums different in nature. old objective-c enum little subset of modern swift enum. compiler doesn't know how use swift's enum objective-c code can't @objc type. myclass can't @objc type while contain swift's enum.

c - java/jni: Can't find dependent libraries in windows -

i error message java.lang.unsatisfiedlinkerror: c:\users\flex\test\lib\native\mylib.dll: can't find dependent libraries mylib.dll jni wrapper uses other c-libraries . when open mylib.dll dependency walker shows dependent libraries available! is there way check library not found within java ? i compiled 3rd party libraries visual studio , mylib mingw32 . could problem? you using windows need put dll current working directory. or can use java.library.path system property.

jquery - Change radio button status when i click on any place of div -

eventprices += "<div class='after-price' id=divprice>"; if (localstorage.getitem('selectedrolename') != null) { if (localstorage.getitem('selectedrolename').tostring().trim() == "admin") { eventprices += "<span class='price'><input type='radio' value='" + item.priceid + "' id='chkeventprices' class='fa fa-check' name='chkeventprices' title='" + item.price + "' onclick='calculatetotal();'><label> $" + item.price + " </label> </span> "; } else { eventprices += "<span class='price'><input type='radio' value='" + item.priceid + "' id='chkeventprices' ...

javascript - Smallest Common Multiple Code produces the wrong answer on one array -

[edit] i should clarify, attempting find smallest common multiple of range of numbers. sorry that. have attempted solution still run incorrect answer on last array [23, 18]. function smallestcommons(arr) { arr = arr.sort(function (a, b) { return - b; }); var count = 1; (var = arr[0]; <= arr[1]; i++) { if (count % !== 0) { = arr[0]; count++; } } return count; } smallestcommons([23,18]); my solution produces 2018940 when should 6056820 your endless loop becouse of inner loop starts @ value 19 , runs 22 414 (smallestmultiple of 18 & 23) % 19 == 15 414 % 20 = 14 414 % 21 = 15 414 % 22 = 18 which leads statement if(count % == 0) being false , loop goes on 415 416 ... if u want least common multiple var issmallestmultipe = 0; while(issmallestmultiple == 0) { for(var = 1; <= arr[1]; i+) { if((arr[0]*i) % arr[1] == 0) { issmallestmultiple = arr[0] * i; } } }

encoding - German letters (accented characters) read wrongly in JavaScript and shows wrong on the page -

Image
i have simple german localization global object in page: germanlocalization = { required: "alle pflichtfelder müssen belegt werden.", addattacbeforesave: "datei kann nicht hochgeladen werden, bevor der datensatz erstellt ist.", filetobig: "die dateigröße überschreitet die maximale uploadgröße." } when read variable in code special german letter read wrong, question mark (image below). my index.html page has utf-8 encoding: <meta http-equiv="content-type" content="text/html; charset=utf-8"> my page acctualy frame other page succesfully shows german letter. not know problem page, or javascript since debuger shows how variable read chars wrongly. your file not saved utf-8. make sure editor configured save utf-8.

javascript - Unable to load view through ng-Route with no errors -

view not getting rendered although there no error. i have added angular-route.js file in head.below mentioned angular js code present in angroute.js file.the html code written in index.html file.i have created 2 html files in view folder named 1>course.html , 2>student.html don't know why url links appear - http://127.0.0.1:57420/index.html#!/index.html <!doctype html> <html lang="en" ng-app="module"> <head> <meta charset="utf-8"> <title>test</title> <script src="angular-1.6.5/angular.js" type="text/javascript"> </script> <script src="angular-1.6.5/angular-route.js" type="text/javascript"> </script> <script src="angroute.js" type="text/javascript"></script> <style type="text/css"> body{ margin: 0px; padding: 0px; ...

osx - How can I use "cached" consistency for named volumes with docker swarm mode / improve io performance on osxfs? -

i trying set development stack similar possible docker swarm production deployment. unfortunately members of team prefer work on osx has severe performance issues when comes mounting , syncing of volume data osxfs. came across docker blog entry consistency setting "cached" docker-compose setup on mac, e.g.: volumes: - /www:/var/www:cached this does not work in swarm mode however. getting following error on docker stack up : invalid spec: webapp-volume:/var/www:cached: unknown option: cached is option removed v3, supposed used differently, or there better way improve io performance on osx swarm mode?

Only one .ts file is generating while encoding mp3 file to m3u8 using ffmpeg -

i not able play m3u8 link specific files. details follows: ffmpeg -i low_30.mp3 -codec:v libx264 -b:v 64k -maxrate 64k -bufsize 64k -vf scale=-2:480 -threads 0 -vsync 2 -pix_fmt yuv420p -codec:a aac -b:a 64k -hls_list_size 0 abc.m3u8 error: [libx264 @ 0x7fc83280ba00] mb rate (81000000) > level limit (2073600) [libx264 @ 0x7fc83280ba00] using cpu capabilities: mmx2 sse2fast ssse3 sse4.2 avx fma3 avx2 lzcnt bmi2 [libx264 @ 0x7fc83280ba00] profile high 4:4:4 predictive, level 5.2, 4:4:4 8-bit [hls @ 0x7fc832809e00] using avstream.codec pass codec parameters muxers deprecated, use avstream.codecpar instead. sample file url: https://s3-ap-southeast-1.amazonaws.com/hog-original/low_30.mp3 only 1 ts file generating in case , not able play m3u8 link. use ffmpeg -i low_30.mp3 -c:a aac -b:a 64k -vn -hls_list_size 0 abc.m3u8 default segment duration 2 seconds. add -segment_time n create segments of n seconds.

uistoryboard - Set specific background color in iOS LaunchScreen.storyboard (Visual Studio for Mac) -

ok, can't believe i'm asking but... how set specific color background of uiview. mean: i select uiview. i set #2374a5 background color (using color picker). visual studio sets #1d5f93 background color (what??). edit: ok, after posted question remembered edit storyboard in xcode interface builder and, there, worked expected. however, i'm still puzzled why vs changes color choose. bug, or there obtuse logic behind i'm not seeing?

c++ - Why is vector::push_back of local variable not move optimized? -

this question has answer here: can compiler generate std::move last use of lvalue automatically? 3 answers do compilers automatically use move semantics when movable object used last time? 1 answer in c++11 can use std::vector::push_back in combination std::move avoid copies while inserting elements vector. there section in standard forbids compilers use std::move automatically local variables not used after calls push_back ? when filling vectors large elements, huge performance benefit. i checked following code gcc 7.1.0 , -o3 , version 1 prints move while version 2 prints copy . #include <iostream> #include <string> #include <vector> struct s { s() = default; s(s const&) { std::cout << "copy" << std::endl; } s(...