Posts

Showing posts from 2011

javascript - executing preventDefault() with BootstrapDialog -

i using bootstrapdialog (nakupanda) , selectize (brian reavis) the process follows: open html defined modal dialog several selectize fields on it, each of has list of items , top of list create new when create new selected onchange event of selectize triggered , call function , opens bootstrapdialog below user input. the problem when user fills in field , presses enter both first , second dialog box close. happens when user presses enter. not if okay button pressed. i call event.preventdefault() when open first dialog box not stop problem. as appreciated. first modal dialog definition <div class="modal fade " id="mymodal" role="dialog"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">&times;</button>

angularjs - TypeError: 'caller' and 'arguments' are restricted function properties -

i @ loss here error. know there questions asked on not able around issue. i have angularjs app spring boot in backend. index.html: <body> <h2 align="center">opus configurable comparison tool</h2> <div ng-controller='storeconfigurableinputcontroller storeconfigurableinput'> <div class="center"> <input class ="id1" type="text" ng-model="storeconfigurableinput.storeorrepid2" placeholder="store id 2 or rep id 2"> <input class ="channel" type="text" ng-model="storeconfigurableinput.channelid" placeholder="channel id"> <span><input class ="subchannel" type="text" ng-model="storeconfigurableinput.subchannelid" placeholder="subchannel id"></span> <span><button style="margin-left: 300px;" ng-click="storeconfigur

jquery - Turning a Javascript Object Value into a Global Variable -

i have object fullcalender events: [ <? $sql = "query removed"; if ($result=mysqli_query($link,$sql)) { // fetch 1 , 1 row while ($row=mysqli_fetch_assoc($result)) { echo " { title: '".$row['ename']."', backgroundcolor: 'green', start: '".$row['scheduleddate']."', eventid: '".$row['eid']."' }, " ; } // free result set mysqli_free_result($result); } ?> ], eventclick: function(event) { $('#modifydialog').dialog('open'); $("#notes").val(event.event

sql - Need to create a table with values filled in before dates -

using redshift. have table following fields: column: type: department | varchar employee_id | varchar event | varchar date | date and date table has 1 field , lists dates. there few departments employees within each department. "event" field has 2 possible values: join or leave. join record date joined company/department , leave record date left company/department. looks this: department employee_id event date marketing 001 join 6/17/2017 marketing 002 join 6/19/2017 marketing 002 leave 6/20/2017 marketing 001 leave 6/22/2017 i want make table has every day listed (again have table dates well) , value 1 when employed , value of 0 when not employees. this: date department employee_id employed 6/17/2017 marketing 001 1 6/18/2017 marketing 001 1 6/19/2017 marketing 001 1 6/19/2017 marketing 002 1 6

Using REGEX to remove all characters between 2 given strings (Python 3) -

lets have string , variable, string = '(-500)x^3' = 100 i want replace characters within brackets value of a. such string returned as, string = '(100)x^3' thanks! try regex: import re re.sub(r'\((.*)\)', r'(%s)' %s a, string)

bit manipulation - C - Swap a bit between two numbers -

i tried code: void swapbit(unsigned char* numba, unsigned char* numbb, short bitposition)//bitposition 0-x { unsigned char oneshift = 1 << bitposition; unsigned char bita = *numba & oneshift; unsigned char bitb = *numbb & oneshift; if (bita) *numbb |= bita; else *numbb &= (~bita ^ oneshift); if (bitb) *numba |= bitb; else *numba &= (~bitb ^ oneshift); } to swap bit position x of , b because of if() think there's better. also when see this: *numbb &= (~bita ^ oneshift); i think there's easier way it. if have me, take :) thanks in advance first should set corresponding position in number 0 , , or actual bit, removing of conditions: *numbb &= ~oneshift; // set bit `0` *numbb |= bita; // set actual bit value the same other number.

mysql - Laravel query pivot result. -

i having problem query. have 4 tables users,prospects,leads,items. of them related onetomany relation users hasmany prospects, prospects hasmany leads, leads hasmany items. items table need data from. item table below. $table->increments('id'); $table->integer('lead_id'); $table->string('sales_phase',11); // sale_phase has 4 category a,b,c,d $table->string('product_name',32); $table->decimal('price',8,2)->default(0.00); $table->integer('qty'); $table->integer('probability')->default(0); $table->decimal('forcast',8,2)->default(0.00); $table->string('note')->nullable(); $table->timestamps(); i need the sum of forcast , group sales_phase. need 2 result. 1. sum of forcast group sales_phase , whos lead_id active(leads table active=1) 2. sum of forcast group s

How to exit a 'while' loop in OVM / verilog after checking for a specific timeout condition -

i have 'while' loop part of ovm test looks this: while (signal_val == 0) begin signal_val = sla_vpi_get_value_by_name ("blah"); end i want restrict loop 120 microseconds , exit after that. want quit test if (signal_val == 0) still not being satisfied @ end of 120µs. how achieve this? i figured i'll have call 'global_stop_request()' quit test, trying check existing condition in while loop fixed timeout value (120µs) seems tricky. also, 'break' not seem working. ideas? tried using 'break' way, 'break' gives syntax error: while (signal_val == 0) begin signal_val = sla_vpi_get_value_by_name ("blah"); #120us; break; end your code won't work expecting. let take look: while (signal_val == 0) begin signal_val = sla_vpi_get_value_by_name ("blah"); #120us; break; end signal_val evaluated once @ while statement, , since 0, enter while loop signal_val gets val

Link to Google Drive from Content of Google Sheets -

i'm absolutely swimming in code issues , can't seem working. i'm hoping group of wise google apps script-geniuses can help. first: google drive uses following folder structure (with first subfolders each letter of alphabet , second subfolders each matter, e.g. /clients /a /albert, bob (1-15-0003) re matter /b /bork, mat (1-54-0003) re other matter i have google sheets document various sheets each refer different matter number in respective cell g2. script automatically searches google drive second subfolders , creates hyperlink folder. my code follows, sadly doesn't work. seems can't find subfolders. function searchfolder() { // searches google drive folder active sheet var ss = spreadsheetapp.getactivespreadsheet(); var sheet = ss.getactivesheet(); var searchterm = ss.getrange('g2').getvalue(); var folders = driveapp.searchfolders("title contains '"+searchterm.replace("'","\'")+"&#

multithreading - How to get speed by multiprocessing in Python (linux), insteed of losing -

i search way use cores. try, decrease spreed. i tried following: from joblib import parallel, delayed import multiprocessing time import time import numpy np inputs = range(1000) def processinput(i): return * using multiprocessing num_cores = multiprocessing.cpu_count() start=time() results = parallel(n_jobs=num_cores)(delayed(processinput)(i) in inputs) print 'multiproc time ', time()-start without multiprocessing start=time() results =[] in inputs: results.append(processinput(i)) print 'simple time ', time()-start and output: multiproc time 0.14687204361 simple time 0.000839948654175 this classic problem multi-threading / multi-processing. whenever want process in parallel, should make sure time saving because of parallelism greater time takes manage parallel processes. try increasing input size. see impact of parallelism.

Filtering arrays based on the value of a key inside of that array in PHP -

i have ton of parsed xml records related 2 attributes: id , rid . these xml records, when parsed, create following (example) php array: array( 'master' => array( [0] => array( 'id' => 123, 'info' => 'hello' ), [1] => array( 'id' => 456, 'info' => 'world' ) ), 'tbl-ex' => array( [0] => array( 'rid' => 123, 'test' => 'aye', 'num' => 88 ), [1] => array( 'rid' => 123, 'test' => 'bbb', 'num' => 99 ), [2] => array( 'rid' => 456, 'test' => 'zzz', 'num' => 102, 'o' => 'h') ), 'tbl-ey' => array( [0] => array( 'rid' => 456, 'mama' => 'mia' ), [1] => array( 'rid' => 123, 'oof' => 'foo' ) ), 'tbl-ez' => a

ruby on rails - Retrieve nested results with Nokogiri -

i'm trying parse nmap xml retrieve various values via nokogiri, having quite time figuring out recursion. want grab ip_address , port element has child element of status='open' . want able put each group json object save database column later display: so far, here's code: require 'nokogiri' require 'json' doc = file.open("network_ports.xml") { |f| nokogiri::xml(f) } doc.xpath('//host').each |host| @ip_address = host.at_xpath("address[@addrtype='ipv4']").at_xpath("@addr").value puts "found host: #{@ip_address}" host.xpath('ports/port').each |port| if port.at_xpath("state[@state='open']") puts port.at_xpath("port[@portid]").value end end end however output broken right following error: port_parser.rb:11:in `block (2 levels) in <main>': undefined method `value' nil:nilclass (nomethoderror) some same input fi

c++ - How to find the time difference in milliseconds between an epoch timestamp and std::chrono::system_clock::now -

hi have created c++ app among others uses std::chrono in order calculate time differences. @ point upload file server , response epoch timestamp receive.php informs timestamp when file uploaded server. i'd calculate time diff between epoch time stamp , starting point of choice since should not change receive.php way of working. far tried achive using following code: #include <iostream> #include <chrono> using namespace std; int main() { auto epoch1 = std::chrono::system_clock::now().time_since_epoch() ; auto epoch2= std::chrono::duration<long long>(epoch_time_stamp); auto diff = epoch1 - epoch2 ; auto s = std::chrono::duration_cast<std::chrono::milliseconds>(diff); cout << s.count() << endl; } where epoch_time_stamp 13 digit epoch timestamp e.x 1501190040123. false results. tried pass epoch_time_stamp both int64_t , time_t no success.since i'm quite new @ using std::chrono assume cast of epoch2 not correct. any ideas should d

google tag manager - Push Tag to all Containers in a GTM account -

is possible save single tag containers within google tag manager account? example: want add html tag containers (200 individual containers within single gtm account), there way around having manually add tag 200 times? the way through using google tag manager api. easiest form use gtm tools - created simo ahava - allows tags added 'cart' , copied accounts. still has done every individual container, though might speed process. if have experience google tag manager api, retrieve container id's , loop through them save html tag. though more complex.

How to track SEO Conversion in Google Analytics? -

Image
i've been trying track conversion rate of users acquired through organic search direct (users discover site through organic medium , start coming site on own through direct search). way decided go create segment sequencing of following kind- results counter-intuitive leads me think maybe understanding of how sequencing works not correct. change measure of organic direct search conversion? changing scope of segment 'sessions' 'users' should fetch desired result.

Anyone can help me to explain this `length<-` in R -

i don't know `` mean here in r after searching many online resources. values<<-`length<-`(values,x) for example: if values 1, x 3, got values 1 na na. can explain how `length<-`(values,x) work result? thanks.

javascript - whats the meaning of this condition if (buffer[0] & 0x80) -

i came across code below , trying understand meaning of condition if (buffer[0] & 0x80) biginteger.frombuffer = function (buffer) { if (buffer[0] & 0x80) { var bytearray = array.prototype.slice.call(buffer) return new biginteger([0].concat(bytearray)) } return new biginteger(buffer) } this bitwise and-operator. and-operation on each bit position of these 2 integers , returns new integer. as example: 10010001 10000000 that be: 10000000 https://en.wikipedia.org/wiki/bitwise_operation#and

sql - Select n largest count by category in Redshift -

i select x common pairs per group in table. let's consider following table: +-------------+-----------+ | identifier | city | +-------------+-----------+ | ab | seattle | | ac | seattle | | ac | seattle | | ab | seattle | | ad | seattle | | ab | chicago | | ab | chicago | | ad | chicago | | ad | chicago | | bc | chicago | +-------------+-----------+ seattle, ab occurs 2x seattle, ac occurs 2x seattle, ad occurs 1x chicago, ab occurs 2x chicago, ad occurs 2x chicago, bc occurs 1x if select 2 commons per city, result should be: +-------------+-----------+ | identifier | city | +-------------+-----------+ | ab | seattle | | ac | seattle | | ab | chicago | | ad | chicago | +-------------+-----------+ any appreciated. thanks, benni you can use count in row number order number of appearances pe

subdomain - Point a domain to my website -

i have domain name need to point sub domain of existing website. both domain name in question , website held same host have cpanel website (which has own domain name , online. note host not provide cpanel (or similar) domain-names (i.e. without hosting). i have seen subdomains , addon domains description in cpanel cant figure if either want ... or aliases. how can point domain name sub-domain? if possible. not want existing websites domain name appear in url when visiting sub-domain pointed new domain name. thanks. since you're using cpanel... https://documentation.cpanel.net/display/ald/setup+edit+domain+forwarding if deal registrar instead of provider, typically point '@.domain.com' ' http://sub.domain.com ' - @.domain.com represents direct name, domain.com.

javascript - Error: Unknown action from worker: ReaderHeadersReady when loading a PDF using PDF.js -

this code working fine yesterday morning getting error pdf.js:276 uncaught error: unknown action worker: readerheadersready @ error (pdf.js:276) @ messagehandler.messagehandlercomobjonmessage (pdf.js:1565) @ messagehandler.messagehandlercomobjonmessage (pdf.js:1565) pdf.js:276 uncaught error: unknown action worker: getreader @ error (pdf.js:276) @ messagehandler.messagehandlercomobjonmessage (pdf.js:1565) code function render(file) { pdfjs.getdocument(file.path).then(function (pdf) { pdfdoc = pdf; totalpages = pdf.numpages; renderpage(pagenumber) }).catch(function (reason) { console.error(reason); }); } and using worker pdfjs.workersrc = '//mozilla.github.io/pdf.js/build/pdf.worker.js'; the version of pdf.js using 1.7.225 lastest stable version. does know cause error? use specific version of worker pdfjs.workersrc = 'https://npmcdn.com/pdfjs-dist@

c# - KeyUp And KeyDown arent registering -

i don't registered when i'm key down , key heres code: private void form1_keydown(object sender, keyeventargs e) { switch(e.keycode) { case keys.a: messagebox.show("hi"); walking = true; break; } } private void form1_keyup(object sender, keyeventargs e) { walking = false; } i don't :( heres rest of code if helps public partial class form1 : form { //graphic vars graphics g; bitmap bb; graphics bbg; rectangle srect; rectangle drect; bitmap bmptile; bool allowgrid = false; int allowgrid = 0; //color pen rainbowpen = pens.black; int rainbowpenstate = 0; //wh int w; int h; //other vars bool isrunning = true; //map vars int[,,] map = new int[151, 151, 11]; int mapx = 20; int mapy = 20; //mouse vars int mousex; int mousey; int mma

javascript - Disable/enable input box type 'number' on tick of checkbox in an HTML table -

i want disable/enable input tag type number when checkbox ticked. checkboxes on same row input tag placed. have tried method $(document).on('change', '.ch_attend', function () { if(this.checked){ $(this).closest('tr').find('input:text').prop('disabled', false); $(this).closest('tr').find('button').prop('disabled', false); $(this).closest('tr').find('input:text').val(0); computekpi(); }else{ $(this).closest('tr').find('input:text').prop('disabled', true); $(this).closest('tr').find('button').prop('disabled', true); $(this).closest('tr').find('input:text').val(0); computek

Access ref of a redux connected component -

i used have component this: class blahdumb extends component { toggleme = () => console.log('toggling') render() { ... } } i use this: class app extends component { doit = () => this.el.toggleme() refel = el => this.el = el; render() { return ( <div> <blahdumb ref={this.refel} /> <button onclick={this.doit} /> </div> ) } } now worked until connected blah redux. i changed blah this: const blah = connect(function() { ... })(blahdumb); now can no longer access toggleme this.el got via ref. bad pattern? or there way childs refs?

javascript - Equivalent of SELECT * in NEDB node.js -

i new on nedb using node.js wondering how display records or select * tablename know nedb different mysql need embed database inside electron application, need know if nedb capable of db queries mysql can do. the code below able me find single records want display records. var datastrore = require('nedb'); var db = new datastrore({filename: 'guitars.db'}); db.loaddatabase(function(err){ db.find({year : 1990}, function (err,docs){ console.log(docs); }); }); just use db.loaddatabase(function(err){ db.find({}, function (err,docs){ console.log(docs);//all docs }); });

javascript - Inject values into html function via jQuery on modal -

i have trigger button modal, passing id , value . in script section need "inject" form modal-body. my problem pass variables in html function of script . how it? html <button value="{{ $etapaano->trabalho_id }}" id="{{ $etapaano->id }}" class="btn btn-primary btn-sm" title="enviar arquivo" data-toggle="modal" data-target="#mymodaluploadarquivos"><i class="fa fa-upload"></i> enviar</button> <div id="mymodaluploadarquivos" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="mymodallabel" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true"

android - What's the influence of Log? -

private static byte[] encodeddata = new byte[20]; private static speex speex = speex.getinstance(); public static byte[] raw2spx(short[] audiodata) { //log.e("abc", "length:" + audiodata.length); speex.encode(audiodata, encodeddata, audiodata.length); return encodeddata; } i wrote function this, makes strange if don't comment function of log.e() , app can run well. if comment, logcat shows me arrayindexoutbounds exception. why?

momentjs - Reactjs - Moment -

am not able parse date mongodb , render in textbox. mongodb date format : mmm dd yyyy hh mm ss a <input name="date" type="date" disabled={ this.state.mode } value={ this.state.item.date ? <moment format="dd-mmm-yyyy">{ this.state.item.date }</moment> : null } classname="form-control" onchange={ this.handleinputchange } /> am trying above code. please suggest.. you can make use of moment.js library. install package dependency like npm install -s moment then use in input like <input name="date" type="date" disabled={ this.state.mode } value={ this.state.item.date ? moment(new date(this.state.item.date)).format("dd-mmm-yyyy"): ''} classname="form-control" onchange={ this.handleinputchange } /> demo: var data = 'thu dec 29 2011 20:14:56 gmt-0600 (cst)'; console.log(moment(new date(data)).format(

mysql - Export SQL query to JSON formatted text file -

i need way run sql command , export results json formatted text file. i have link: https://falseisnotnull.wordpress.com/2014/11/23/creating-json-documents-with-mariadb/ but don't understand create_column section of statement, nor terminology uses understand how relates db. can please simplify example me on query this? select * thisismy.database; if above outfile command, data looks this: 1 armand warren 56045 taiwan, province of china 0 0 2 xenos salas 71090 liberia 0 0 3 virginia whitaker 62723 nicaragua 0 0 4 kato patrick 97662 palau 0 0 5 cameron ortiz p9c5b6 eritrea 0 0 but need this: { "aadata": [ [ "1", "armand", "warren", "56045", "taiwan, province of china" ], [ "2", "xenos", "salas", "71090&

javascript - ES6 API Fetch Login WebApp -

i'm asking if codes correct. i'm trying access post login api. should have response website api. problem on fetch function. doesn't post data api. says email , password required function submitinfo(){ let form = document.forms["myform"]; let fd = new formdata(form); let data = {}; (let [key, prop] of fd) { data[key] = prop; } value = json.stringify(data, null, 2); console.log(value); fetch('http://example_website/api/login', { method: 'post', body: value }) .then(data => data.json()) .then(data => { console.log(data) }) .catch((err) => { console.error(err); }) } <body> <form id="myform" name="myform"> <div> <input type="text" id="email" name="email" value="example@gmail.com"> </div> <div> <input type="password" id="password" n

Keras Tensorboard callback not writing images -

Image
i trying visualize weights of keras model tensorboard. here model using: model = sequential([ conv2d(filters=32, kernel_size=(3,3), padding="same", activation='relu', input_shape=(40,40,3)), maxpooling2d(pool_size=(2, 2)), conv2d(filters=64, kernel_size=(5,5), padding="same", activation='relu'), maxpooling2d(pool_size=(2, 2)), flatten(), dense(1024, activation='relu'), dropout(0.5), dense(43, activation='softmax'), ]) model.compile(optimizer='sgd', loss='categorical_crossentropy', metrics=['accuracy']) and training call: model.fit_generator( ... callbacks = [ modelcheckpoint('models/gtsrb1-{epoch}.hdf5', verbose=1, save_best_only = true), tensorboard(log_dir='tblogs/', write_graph=true, write_grads=true, write_images=true), earlystopping(patience=5, verbose=1), ],) however, when start tens

python - Modify Keras Output Shape -

i developing feed forward deep neural network uses 3d input 2d output. how can change network architecture reflect this?? have following code: data_dim = x_train.shape[2] # 7 timesteps = x_train.shape[1] # 30 batch_size = 32 # expected input batch shape: (batch_size, timesteps, data_dim) # note have provide full batch_input_shape since network stateful. # sample of index in batch k follow-up sample in batch k-1. model = sequential() model.add(dense(64, activation='relu', batch_input_shape=(batch_size, timesteps, data_dim))) model.add(dropout(0.2)) model.add(dense(64, activation='relu')) model.add(dropout(0.2)) model.add(dense(64, activation='relu')) model.add(dense(1, activation='linear')) model.compile(loss='mean_squared_error', optimizer='rmsprop', metrics=['accuracy']) history = model.fit(x_train, y_train, batch_size=batch_size, epochs=80,

Dapper not returning selected/desired rows -

i newbie dapper , copied sql script(from test doing entity framework) , tried return list of theses rows, returning entire class , not ones want! using (idbconnection connection = new sqlconnection(@"data source=desktop-cd2uqi5\sqlexpress;initial catalog=servercontext;integrated security=true")) { var res = connection.query<table>("select images,addressfrom, table table.id = 1").tolist(); response = request.createresponse(httpstatuscode.ok, res); } please help. dapper doesn't processing of sql (well, does in very limited scenarios). so: whatever being returned because of your query - isn't changing query remove where clause, , isn't inventing data. if mean returning more columns expect, again: check query. 1 shown in question isn't valid (trailing comma in select ), can't comment based on question. check rogue * . so: take query, , try running ssms or sql tool; see rows , colu

Shopify Ajaxify Product filtering on collection page -

i want add shopify ajaxify product filtering on collection page, https://bc-sf-filter-demo-1.myshopify.com/collections/tops without third app. can't find documentation on it. can give me thought or helpful resource manually? there number of shopify apps provide type of search functionality. in case app: https://apps.shopify.com/product-filter-search

OpenCV - How to downsample and upsample a cuFloatComplex image present in device memory -

i have downsample image , filtering operations on , upsample image original size, these images present in cuda device memory. planned moving images opencv gpumat , using resize function doesn't working, wanted know if me resizing images of type 'cufloatcomplex'. pasting snippet of attempt below: /* inputs dg = image of datatype cufloatcomplex m = rows. n =columns. d_input= expected output. */ cuda::gpumat d_input(m,n, cv_64fc2, dg); cuda::gpumat components[2]; cuda::split(d_input,components); cuda::gpumat real = components[0], imag = components[1];

Python :: chaining generators for API call -

i hitting api responses consists of many pages, say, 100. this takes long, trying use generators can yield values each page , process until condition met down pipeline. import requests import json import itertools i defining generator make requests: def api_query(query): page=1 while true: # requests, result in body: title = result["result"]["title"] primaryartist_name = result["result"]["primary_artist"]["name"] yield title, primaryartist_name page+=1 then, want filter first page response using other generator : def api_filter(): api_response = api_query('query') # 10 first results page1 = [api_response.next() in range(10)] # filtering page1 results yield results lastly, test condition , try return desired values: def api_print(): results = api_filter() page1 = list(it.islice(resu

aws devicefarm - How to connect via adb to a (Remote Session) Android Device on AWS Device Farm -

can connect android device during remote session via adb? i need connect android device via adb( using tcpip mode) presume, can't connect specific device via public ip(?) how can connect ubuntu-server ec2 instance or local machine device farm android device during remote session? during remote access session, device has private ip, offcourse (e.g. 192.168.1.10). using vpc in regard? any help/pointers appreciated. thanks.

javascript - How to detect if a function inside a constructor was called as an constructor -

so have created function checks if called constructor: { this.x = function() { if (!this instanceof x) { return new x; } ... } } but want have function inside should called constructor { this.x = function() { if (!this instanceof x) { return new x; } this.y = function(){ if (!this instanceof y) { return new y; } } } } however, when try this, typeerror: uncaught typeerror: right-hand side of 'instanceof' not object how can check if function y called constructor? thanks in advance

r - ggplot2 identical scales (non-continuous) on both sides -

Image
goal use ggplot2 (latest version) produce graph duplicates x- or y-axis on both sides of plot, scale not continuous. minimal reprex # example data dat1 <- tibble::tibble(x = c(rep("a", 50), rep("b", 50)), y = runif(100)) # standard scatterplot p1 <- ggplot2::ggplot(dat1) + ggplot2::geom_boxplot(ggplot2::aes(x = x, y = y)) when scale continuous, easy identity transformation (clearly one-to-one). # works p1 + ggplot2::scale_y_continuous(sec.axis = ggplot2::sec_axis(~ .)) however, when scale not continuous, doesn't work, other scale_* functions don't have sec.axis argument (which makes sense). # doesn't work p1 + ggplot2::scale_x_discrete(sec.axis = ggplot2::sec_axis(~ .)) error in discrete_scale(c("x", "xmin", "xmax", "xend"), "position_d", : unused argument (sec.axis = <environment>) i tried using position argument in scale_* functions

insert into select on duplicate mysql query -

i trying update on duplicate record in mysql, i have table many column want update column table same desc current table not updating records. my query is: insert backup_prochart.symbol_list(ticker,end_date,cur_date) select ticker,t.end_date,t.cur_date prochart.symbol_list t ticker=t.ticker , ticker= 'may17' on duplicate key update end_date=t.end_date,cur_date=t.cur_date; another query tried insert backup_prochart.symbol_list(ticker,end_date,cur_date) select t.ticker,t.end_date,t.cur_date prochart.symbol_list t ticker=t.ticker , t.ticker= 'may17' on duplicate key update end_date=t.end_date,cur_date=t.cur_date; can tell me whats wrong query.? you try : insert backup_prochart.symbol_list (ticker, end_date, cur_date) select ticker, end_date, cur_date prochart.symbol_list ticker = 'may17' on duplicate key update end_date = values(end_date), cur_date = values(cur_date); of course column "ticker" must defined uniqu

orchardcms - How to achieve a brother taxonomy between bolg and blogpost in orchard? -

my blog post define taxonomyfield (inclue:taxonomya\ taxonomyb\ taxonomyc) in dashboard.so selected 1 of taxonomy(a or b or c). now,my idea define blogpost template .not need modify . if add taxonomyfield in blogpost ,all blogs have same taxonomyfield .but ,i need every blog has taxonomy itself. want choose taxonomy in blog (in edit view), taxonomy auto appear in blogpost(in edit view). if brother taxonomy between bolg , blogpost .how it? thanks!

Android - Remove Place Autocomplete Search Bar from Action Bar -

i using placeautocompletefragment in application. working fine, problem doesn't want have place autocomplete search in action bar. insted want use edittext below action bar. i want use full screen mode, want remove search places action bar. this full activity.xml code: <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="example.fragmentsample.mainactivity"> <button android:id="@+id/btncurrentlocation" android:layout_width="match_parent" android:onclick="fncgetcurrentlocation" android:background="@drawable/btn_current_location" android:text="detect location" android:backg

reactjs - Fetch React router paths from server -

i have website around 10,000 urls , these urls cleaned using server side url rewrite. means, if have url http://example.com/best-cakes-in-sydney maps http://example.com/cakes?city=sydney . want use http://example.com/best-cakes-in-sydney url in react app. but problem that, impossible include parameter in these urls, not follow specific pattern. due forced write down these urls in react router config. writing down 10,000 paths in react router file not seems idea. please me of following: if possible generate react router config file work. in on rendering of file ajax request go on server , pull paths hence things not hardcoded. is there other way tackle problem? i think can send server information component want render on specific url. if request /best-cakes-in-sydney server return json {component: "cakes", city: "sydney", content: "...", ...} then pick right component: switch(response.component){ case 'cakes': ...}

ibm bluemix - IBM Watson Visual recognition{"code":400,"error":"Cannot execute learning task. : no classifier name given"} -

when try train classifier 2 positive classes , api key (each class contains around 1200 images) in watson visual recognition, returns "no classifier name given" - have provided. code: $ curl -x post -f "blank_positive_examples=@c:\users\rahansen\desktop\altmuligt\training\no_ocd\no_ocd.zip" -f "ocd_positive_examples=@c:\users\rahansen\desktop\altmuligt\training\ocd\ocd.zip" -f "name=disease" "https://gateway-a.watsonplatform.net/visual-recognition/api/v3/classifiers?api_key={x}&version=2016-05-20" {"code":400,"error":"cannot execute learning task. : no classifier name given"} what have done far: removed special characters in file names thought might problem: tried give other names classifeir, e.g. "name=ocd" i tried train on smaller dataset, 40 images in each positive class , works fine. maybe size of dataset problem. however, according watson training guidelines, comp