Posts

Showing posts from 2014

c++11 - auto with const_cast reference behaves strange -

can me understand "weird" behavior? playing around c++11 after long pause in c++ programming. why works fine until use auto? static void printit(int a,const int *b, const int &c) { std::cout << "\narg1 : " << << "\narg2 : " << *b << "\narg3 : " << c << std::endl; } int main() { int myvar { 0x01 }; const int *pmv { &myvar }; const int &rmv { myvar }; printit(myvar,pmv,rmv); //ok prints 1,1,1 *(const_cast<int *>(pmv)) = 0x02; //remove constness pmv , sets new value printit(myvar,pmv,rmv); //ok prints 2,2,2 (const_cast<int &>(rmv)) = 0x03; //remove constness rmv , sets new value printit(myvar,pmv,rmv); //ok prints 3,3,3 myvar = 0x04; printit(myvar,pmv,rmv); //ok prints 4,4,4 //so far good... auto = const_cast<int *>(pmv); //creates new variable of type int * *a = 0x05; printit(myvar,a,rmv...

@Transaction annotation between layers in Spring -

what difference in using @transactional annotation in domain/service layer , dao layer. provide advantage using in domain layer. it practice use @transactional in service layer because governs logic needed identify scope of database and/or business transaction. persistence layer design doesn't know scope of transaction. daos can made @transactional other bean, it's common practice use in service layer. tend because want separation of concerns . persistence layer retrieve / stores data , forth database. for example, if want transfer amount 1 account another, need 2 operations, 1 account needs debited other needs credited. so, scope of these operation known service layer , not persistence layer. the persistence layer cannot know transaction it's in, take example method person.updateusername() . should run in it's own separate transaction always? there no way know, depends on business logic calling it. here few thread should read where @transactio...

Getting git fetch output to file through python -

i trying save git fetch output file through python, using: subprocess.check_output(["git", "fetch", "origin", ">>", "c:/bitbucket_backup/backup.log", "2>&1"], cwd='c:/bitbucket_backup/loopx') but believe there missing in subprocess.check_output args because when adding >> c:/bitbucket_backup/backup.log 2>&1 receive error: traceback (most recent call last): file "<pyshell#28>", line 1, in <module> subprocess.check_output(["git", "fetch", "origin", ">>", "c://bitbucket_backup//backup.log", "2>&1"], cwd='c://bitbucket_backup//loopx') file "c:\users\fabio\appdata\local\programs\python\python36-32\lib\subprocess.py", line 336, in check_output **kwargs).stdout file "c:\users\fabio\appdata\local\programs\python\python36-32\lib\subprocess.py", line 418...

java - WebSocket: OnClose() is never called -

i'm implementing application websocket endpoint. here code: @applicationscoped @serverendpoint(value="/socket", encoders = {messageencoder.class, commandencoder.class}) public class socketendpoint { /** default-logger */ private final static logger log = loggerfactory.getlogger(socketendpoint.class); @inject sessionhandler sessionhandler; @onopen public void open(session session, endpointconfig config) { log.debug("connected session => '{}' - '{}'", session, config); sessionhandler.initsession(session); } @onmessage public void onmessage(session session, string messagejson) { // } @onclose public void onclose(session session, closereason reason) { log.debug("closing session => '{}' - '{}'", session, reason); sessionhandler.removesession(session); } @onerror public void onerror(session session, throwable e...

llvm - llc: unsupported relocation on symbol -

problem llc giving me following error: llvm error: unsupported relocation on symbol detailed compilation flow i implementing llvm frontend middle-level ir (mir) of compiler, , after convert various methods many bitcode files, link them ( llvm-link ), optimize them ( opt ), convert them machine code ( llc ), make them shared library ( clang it's linker wrapper), , dynamically load them. llc step fails of methods compiling! step 1: llvm-link : merge many bitcode files i may have many functions calling each other, llvm-link different bitcode files might interact each other. step has no issues. example: llvm-link function1.bc function2.bc -o lnk.bc step 2: opt : run optimization passes for using following: opt -o3 lnk.bc -o opt.bc this step proceeds no issues, that's 1 causes problem! also, it's necessary because in future need step pass passes, e.g. loop-unroll step 3: llc : generate machine code (pic) i using following command: llc -m...

javascript - Download SVG with images -

i want download svg image in dom. i've searched around on stack overflow , common approach following these steps: serialize svg xml string var svgimage = document.getelementbyid('maskedimage') var svgxml = (new xmlserializer).serializetostring(svgimage) create javascript image xml string source var img = new image(); var svgblob = new blob([data], {type: 'image/svg+xml;charset=utf-8'}); var url = domurl.createobjecturl(svgblob); img.onload = function () { /* next steps go here */ } img.src = url; draw image on canvas var canvas = document.createelement('canvas') var ctx = canvas.getcontext('2d') canvas.width = width canvas.height = height ctx.drawimage(img, 0,0, width, height) dump canvas url , make user download that window.open(canvas.todataurl('image/png')) // not point of question the thing is, svg has <image> tag svg mask (which black , white <image> ). make things worse, 1 of these images has ...

python - numpy get column indices where all elements are greater than threshold -

i want find column indices of numpy array elements of column greater threshold value. for example, x = array([[ 0.16, 0.40, 0.61, 0.48, 0.20], [ 0.42, 0.79, 0.64, 0.54, 0.52], [ 0.64, 0.64, 0.24, 0.63, 0.43], [ 0.33, 0.54, 0.61, 0.43, 0.29], [ 0.25, 0.56, 0.42, 0.69, 0.62]]) in above case, if threshold 0.4, result should 1,3. you can compare against min of each column using np.where : large = np.where(x.min(0) >= 0.4)[0]

python - Pip is rolling back uninstall of setuptools -

i using this ansible-django stack deploy django project aws ec2 instance. worked fine long time, suddenly, error below when deploying. it seems there new setuptools build not updated. why rollback uninstall of setuptools ? why not install setuptools 36.2.2? specifying explicitly version of setuptools in requirements solves issue, since indirectly dependent on setuptools , should not responsibility know version keep. installing collected packages: shared-django, setuptools found existing installation: shared-django 0.1.0 uninstalling shared-django-0.1.0: uninstalled shared-django-0.1.0 running setup.py install shared-django: started running setup.py install shared-django: finished status 'done' found existing installation: setuptools 36.2.0 uninstalling setuptools-36.2.0: uninstalled setuptools-36.2.0 rolling uninstall of setuptools :stderr: exception: traceback (most recent call last): file \"/webapps/catalogservice/lib...

My Gallery Lags a lot when i try to load images from sd card(Android Recyclerview) -

i trying implement gallery app using recycler view , sub sampling gallery. since image count around 850. when try load images gallery, gallery lags. here recyclerview adapter:- public class recyclerviewadapter extends recyclerview.adapter<recyclerviewadapter.recyclerviewholders> { private arraylist<string> yeniliste; private context context; public recyclerviewadapter(context context, arraylist<string> itemlist) { this.yeniliste = itemlist; this.context = context; } @override public recyclerviewholders oncreateviewholder(viewgroup parent, int viewtype) { view layoutview = layoutinflater.from(parent.getcontext()).inflate(r.layout.gallery_item, null); recyclerviewholders rcv = new recyclerviewholders(layoutview); return rcv; } @override public void onbindviewholder(final recyclerviewholders holder, final int position) { try { bitmap bitmap = bitmapfactory.decodefile(yeniliste.get(position)); holder.countryphoto.setima...

WordPress Multisite "Switch To" option behaves differently at local and staging server even all settings are same -

i here strange problem , seeking help! local: have multisite setup @ local in vip (chassis) environment. when logging in super admin can "switch to" between users , see how individual dashboard , admin menu restricted based on roles. staging: have same multisite setup well. when logging in super admin although can "switch to" between users cannot see admin dashboard more, rather being taken homepage of main site query string ( ?user_switched=true ). when hover on "switch to" link under each user urls similar in both staging , local environment: local: http://vagrant.local/wp-login.php?action=switch_to_user&user_id=42&_wpnonce=ee21787758 staging: http://staging.esbella.july.com/wp-login.php?action=switch_to_user&user_id=48&_wpnonce=a74cd726c6 config.yaml settings both local , staging same: paths: base: . wp: wp content: wp/wp-content multisite: yes plugins: - query-monitor - user-switching php...

php - using simplexml_load_file() to get attributes from xml file for Amazon Affiliate API -

i using amazon affiliate api here. new of actually. i have php code generate working url products, having issues extracting data url's generated xml. looking return formattedprice xml. here example of xml file: https://pastebin.com/hnttevfv here code trying pull "formattedprice". neither of examples below working , returning empty values. sidenote: $request_url full http:// valid url of xml file. $getxml = simplexml_load_file($request_url); $price = $getxml->itemlookupresponse->items->item->itemattributes->listprice['formattedprice']; nor does $price = $getxml->itemlookupresponse->items->item->itemattributes->listprice->formatedprice; every xml document has single "root element". in example, top-level element <itemlookupresponse> . when load document in simplexml, first object gives root element. access chlidren of element ->elementname notation. so instead of $getxml->itemloo...

python - non-square C-order matrices in cuBLAS ( numba ) -

i'm trying use cublas functions in anaconda's numba package , having issue. need input matrices in c-order. output can in fortran order. i can run example script provided package, here . script has 2 functions, gemm_v1 , gemm_v2 . in gemm_v1 , user has create input matrices in fortran order. in gemm_v2 , can passed cuda implementation of gemm , transposed on device. can these examples work square matrices. however, can't figure out how gemm_v2 work non-square input matrices. there way work c-order input matrices non-square? note: ideally, both input , output matrices stay on device after call gemm used in other calculations ( part of iterative method ). the problem example is, works square matrices. if matrices not square cannot calculate a^t*b^t because of dimension missmatch (assuming dimensions right a*b ). i don't have working cublas-installation @ hand, kind of shot in dark, surprised if cublas work differently usual blas. blas expects matric...

Angular Material : alternative of $mdMedia('gt-md') in angular 4 -

i'm trying add sidenav web-application , want responsive , i'm using angular material2 , angular 4 <md-sidenav #sidenav layout="column" class="md-sidenav-left" md-component-id="left" md-is-locked-open="$mdmedia('gt-md')" hide-gt-md opened="true"> the "md-is-locked-open="$mdmedia('gt-md')"" doesn't seem job here , wonder if deprecated or has alternative it appears you're mixing material 1.x material 2. here example of how material 2 works: <app> <md-sidenav-container> <md-sidenav align="left" opened="true">drawer content</md-sidenav> <div class="my-content">main content</div> </md-sidenav-container> </app> check out most recent docs make sure have right format. note: in api calls @input means set item in dom (like align, , opened).

hadoop - Perform sql join using sqlcontext spark -

i tried running query querying oracle db joins using sqlcontext like, val sql="select b,c b.join=c.join" val dataframe = sqlcontext.read.jdbc(url,sql,connection_properties) i getting invalid tablename error. if try querying table below works fine. val df1 = sqlcontext.read.jdbc(url,"b",connection_properties) val df2 = sqlcontext.read.jdbc(url,"c",connection_properties) will not possible run join queries using sqlcontext. this need do, create 2 dataframes tables below val df1 = sqlcontext.read.jdbc(url,"b",connection_properties) val df2 = sqlcontext.read.jdbc(url,"c",connection_properties) and join 2 dataframes key want join df1.join(df2, <join condition>, <which join>) //example df1.join(df2, df1($"id") === df2($"id"), "left") i think better option far know hope helps!

What's the proper way to do assignment for struct array in Julia? -

i have issue assignment struct array (or constructor struct array) in julia. suppose want below tasks: # define struct struct grn_net gene_net::matrix{float64} init_s::vector{float64} end # define empty struct array net = array{grn_net}(100) # initialize struct array n in 1:100 net[n] =grn_net(rand(5,5),rand(-1.:2.:1.,5)) end # make copy of net new_net = deepcopy(net) # initialize temporary matrix temp_mat = zeros(float64,5,5) n in 1:100 # gernerate 2 unique random positions rand_pos = randperm(100)[1:2] # randomly swap rows selected matrices index = rand(0:1,gene_n) m in 1:5 if index[m]==1 temp_mat[m,:] = net[rand_pos[1]].gene_net[m,:] else temp_mat[m,:] = net[rand_pos[2]].gene_net[m,:] end end # save result matrix new net new_net[n] = grn_net(temp_mat,rand(-1.:2.:1.,5)) end so, if run code, find new_net have same gene_net entries in struct array. when debug code, found, although te...

python - Efficiently serialize tensorflow graph / session to db? -

from can tell, tf.train.saver() interface can take file-prefix input, , tensorflow handles serialization of model directly disk. i'm interested in writing current state of tensorflow model postgresql database, , have been looking serializing current state of tensorflow object location in memory, can save serialized state postgresql bytea column. how might go doing this? my current workaround involves allowing tf.train.saver() write disk @ tempfile location, reading , serializing contents of files, re-writing file locations , allowing tf.train.saver() read them load graph in @ inference time.

c++ - SystemC: Multiple module implementations in single cpp file -

edit: solution found moving sc_has_process(module); statements .cpp file class definition in header file. i writing module in systemc has small sub-modules. keep of declarations in single header file, , implementation on single .cpp file. don't think there inherently wrong approach, getting error related use of sc_has_process macro redefining sc_current_user_module . in file included /.../systemc/2.3.1/include/systemc:72:0, src/decoder.cpp:39: /.../systemc/2.3.1/include/sysc/kernel/sc_module.h:403:30: error: conflicting declaration ‘typedef struct fifo_shift sc_current_user_module’ typedef user_module_name sc_current_user_module ^ src/decoder.cpp:146:1: note: in expansion of macro ‘sc_has_process’ sc_has_process(fifo_shift); ^ /.../systemc/2.3.1/include/sysc/kernel/sc_module.h:403:30: error: ‘sc_current_user_module’ has previous declaration ‘typedef struct decoder sc_current_user_module’ typedef user_module_name ...

r - How do I Remove Data From Non-Scaled Dataframe against a Scaled One -

i'm using r right i'm scaling original data, removing outliers z-score of 3 or more, , filtering out unscaled data contains non-outliers. want left data frame contains non-scaled numbers after removing outliers. these steps: steps 1. create 2 data frames ( x, y ) of same data 2. scale x , leave y unscaled. 3. filter out rows have greater 3 z-score in x 4. currently, example, x may have 95,000 rows while y still has 100,000 5. truncate y based on unique column called row id , made sure unscaled in x . unique column me match remaining rows in x , rows in y . 6. y should have same number of rows x , data unscaled. x has scaled data. at moment can't data unscaled. tried using unscale method or data frame comparison tools r complains cannot work on data frames of 2 different sizes. there workaround this? tries i've tried dataframe <- dataframe[dataframe$row %in% remainingrows] left nothing in data frame. provide data, has sensitive infor...

Twitter sent status 401 for URL -

i learning function of python aims retrieve trends twitter. below following code wrote import pickle import os if not os.path.exists('secret_twitter_credentials.pkl'): twitter={} twitter['consumer key'] = '' twitter['consumer secret'] = '' twitter['access token'] = '' twitter['access token secret'] = '' open('secret_twitter_credentials.pkl','wb') f: pickle.dump(twitter, f) else: twitter=pickle.load(open('secret_twitter_credentials.pkl','rb')) !pip install twitter !pip install python-twitter import twitter auth = twitter.oauth.oauth(twitter['access token'], twitter['access token secret'], twitter['consumer key'], twitter['consumer secret']) twitter_api = twitter.twitter(auth=auth) # nothin...

Wrong output in MYSQL -

i have question follows: the total score of hacker sum of maximum scores of challenges. write query print hacker_id , name, , total score of hackers ordered descending score. if more 1 hacker achieved same total score, sort result ascending hacker_id . exclude hackers total score of 0 result. 2 tables given follows: table: hackers ======================================== hacker_id: integer (id of hacker) name: string (name of hacker) ======================================== table: submissions =================================================== submission_id: integer (id of submission) hacker_id: integer (id of hacker) challenge_id: integer (id of challenge) score: integer (score of submission) =================================================== the mysql query i've written follows:- select a.hacker_id, a.name, a.total from( select h.hacker_id, h.name, sum(case when s.hacker_id=h.hacker_id s.score...

dynamically naming multiple slots in aurelia view -

in aurelia have created custom element interacts container. container creates ui elements around child nodes. these custom elements can used in view follow: <wizard-container ref="container"> <wizard-step title="step 1" view-model="step1"></wizard-step> <wizard-step title="step 2" view-model="step2"></wizard-step> <wizard-step title="step 3" view-model="step3"></wizard-step> </wizard-container> in wizard-container class read children @children('wizard-step') steps = []; , loop on them in template: ... <div class="step" repeat.for="step of steps"> <slot name="step-${$index}"><p>slot-${$index}</p></slot> </div> ... the problem slots not going created. i'm not able add element these slots this <template slot="slot-${idx}"> <p>hello world</p...

sqlite3 - SQLITE: Error while executing SQL query on database 'database': row value misused -

i'm using sqlite in windows application (done visual c#); while inserting columns table i'm getting following error: error while executing sql query on database 'database': row value misused the following insertion query: insert d_logindetails (userid,registration_no,logintime,expected_logout,machinesno,is_uploaded)values (234,'1233',current_timestamp,(current_timestamp,'+60 minutes'),'s12452',0); '+60 minutes' string. when used built-in date/time functions , interpreted modifier. computation, have call such function: insert ... values (..., current_timestamp, datetime('now', '+60 minutes'), ...);

Reverse Engineer Database with Bookshelf.JS? -

what process generating bookshelf model objects existing mysql database? the examples on bookshelf.js site show several model objects... var knex = require('knex')({client: 'mysql', connection: process.env.mysql_database_connection }); var bookshelf = require('bookshelf')(knex); var user = bookshelf.model.extend({ tablename: 'users', posts: function() { return this.hasmany(posts); } }); the closest knex.js site comes mentioning migrations. however, using syntax... $ npm install -g knex $ npm install knex --save $ npm install mysql --save $ knex init $ knex migrate:make knextest ... generates 1 file empty functions ... exports.up = function(knex, promise) { }; exports.down = function(knex, promise) { }; ... makes sense, since knex not orm. guess ended here because bookshelf didn't mention tools this. on side note, i've checked knexfile.js , made sure has valid configuration: development: { clie...

php - Woocommerce + isotope problems with post_classes to filter products -

i'm using command wc products. problem need add classes corresponding name of product slug. <?php while ( $products->have_posts() ) : $products->the_post(); ?> my isotope filters named correctly ( .item1 , .item2 etc.) have add names product loop filter products. have default post classes included because theme css style classes , plugin require it. like <li=class="product type-product status-publish... item1 ?>

html - load progress bar smoothly and within certain time -

hi have multi group progress bar loads left right smoothly takes around 5 secs load. how can update load smoothly left right , in 3 secs? the group bar have 6 or more groups , should load in 3 secs here link working code https://codepen.io/nick1212/pen/wovlab?editors=1100 html: <div> <h1 class="u-pb--lg text-bold">grouped progressbar component examples</h1> <div class="space"> <div> example: user earning points</div> <div class="well-progressgroup"> <!-- react-text: 94 --> <!-- /react-text --> <div class="well-background--concept1 well-progressgroup--progress" style="width: 50%; animation-delay: 1s; z-index: -1; height: 50px;"></div> <div class="well-background--concept2 well-progressgroup--progress" style="width: 75%; animation-delay: 2s; z-index: -2; height: 50px;"></div> <div ...

javascript - Update Line Chart d3.js -

i creating line chart using d3.js , svg, populated data returned adobe analytics real-time api. i able create line chart initially, able loop through api call , call new data every 5 seconds. can update linedata object new data. i can't line chart update new data. below code update function. please advise have gone wrong , changes need make line chart update new data. //update data loop function updatedata() { //add time dates if(inputstartminute > 55) { if(inputstarthour == 23) { inputstarthour = 0; } else { inputstarthour = inputstarthour + 1; } inputstartminute = inputstartminute - 60 + 5; } else { if(inputstarthour == 23) { inputstarthour = 0; } else { inputstarthour = inputstarthour + 1; } inputstartminute = inputstartminute - 60 + 5; }; if(inpu...

Can the Google Speech API be configured to return only numbers / letters? -

can google speech api configured return numbers , letters, opposed full words? the use case translating canadian postal codes. ex. m 1 b 0 r 3. google may return "em 1 0 3" we have tried: using speechcontexts , feeding in letters - z, individual phrases. improved accuracy us. did not have success passing in individual numbers (ex 1, 2, 3). specifying codec , sample rate of our wav file using encoding , sampleratehertz configuration options. saw no improvement in doing believe google great job of auto-recognizing the sample rate , encoding. our audio file 8000hz , encoded "m-ulaw". have no flexibility in changing sample rate or encoding. is there way more accurate response google use case? ideas better speechcontexts phrases welcome. thank you

c++11 - mmap and C++ strict aliasing rules -

consider posix.1-2008 compliant operating system, , let fd valid file descriptor (to open file, read mode, enough data...). following code adheres c++11 standard* (ignore error checking): void* map = mmap(null, sizeof(int)*10, prot_read, map_private, fd, 0); int* foo = static_cast<int*>(map); now, following instruction break strict aliasing rules? int bar = *foo; according standard: if program attempts access stored value of object through glvalue of other 1 of following types behavior undefined: the dynamic type of object, a cv-qualified version of dynamic type of object, a type similar (as defined in 4.4) dynamic type of object, a type signed or unsigned type corresponding dynamic type of object, a type signed or unsigned type corresponding cv-qualified version of dynamic type of object, an aggregate or union type includes 1 of aforementioned types among elements or non-static data members (including, recursively, element or non-static d...

c++ - Sending special ascii char through usb converter rs232 -

i need send special chars through usb rs232 converter device. b.cpp: unsigned char message[] = "Àwlo~p"; int main(void) { openport(port, 9600); int = 0; // while (i < 2000) { writeport(message); char* readchar = readport(); cout <<"rr "<< static_cast<string>(readchar); // i++; // sleep(5); // } closeport(); return exit_success; } my writeport function: void writeport(unsigned char* message) { int e; (int = 0; < 7; i++) { e = message[i]; printf("out: %d", e) ; write(tty_fd, &message[i], 6); usleep(10); } } beacose first sign out of range normal char "À" 192 see in printf it's divide 2 bytes. printf output: out: 195 out: 128 out: 119 out: 76 out: 79 out: 126 out:80 how can send that's specyfic char? putting non-ascii characters c source file risky. if want specific byte sequence, write out array of numbers: unsigned char message[] =...

part of object missing when creating a Purchase Order Object for the Quickbooks php sdk -

<?php ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(e_all); require "vendor/autoload.php"; use quickbooksonline\api\core\servicecontext; use quickbooksonline\api\dataservice\dataservice; use quickbooksonline\api\facades\purchaseorder; use quickbooksonline\api\data\ipppurchaseorderitemlinedetail; use quickbooksonline\api\data\ippline; use quickbooksonline\api\data\ipppurchaseorder; use quickbooksonline\api\data\ipppurchase; //use quickbooksonline\api\data\ //$dataservice = dataservice::configure("sdk.config"); $dataservice = dataservice::configure(array( 'auth_mode' => 'oauth1', 'consumerkey' => "", 'consumersecret' => "", 'accesstokenkey' => "", 'accesstokensecret' => "", 'qborealmid' => "", 'baseurl' => ...

scala - How do I access "filtered" items from collection? -

i have string val trackingheader = "k1=v1, k2=v2, k3=v3, k4=v4" parse , convert map(k1 -> v1, k2 -> v2, k3 -> v3, k4 -> v4) . following code used this: val trackingheadersmap = trackingheader .replaceall("\\s", "") .split(",") .map(_ split "=") .map { case array(k, v) => (k, v) } .tomap i able desired output. but, need handle malformed input case val trackingheader = "k1=v1, k2=v2, k3=v3, k4=" . notice there no value key k4 . above code start breaking scala.matcherror: [ljava.lang.string;@622a1e0c (of class [ljava.lang.string;) changed to: val trackingheadersmap = trackingheader .replaceall("\\s", "") .split(",") .map(_ split "=") .collect { case array(k, v) => (k, v) } .tomap great have handle malformed case using collect know key had issue , log (in example k4 ). tried following , able desired result not sure if right way it: val b...

How to deserializae POST data in Laravel and validate? -

i have incoming $_post data as: array("data" => "{"id" : 2, "name" : "ok", "orders": {"f" : "ok"}}") so, need deserialize $_post["data"] , , validate fields inside $_post["data"] using standard validation in laravel this: $validator = validator::make($request->all(), [ "data.id" => "required|integer" ]); how to that? after json_decode got array: array:13 [▼ "id" => 17 "unique_code" => null "name" => "Михаил" "secondname" => "Попов" "lastname" => "Яковлевич" "datebirth" => "12/10/1992 00:00:00" "taxcode" => "5656" "gender" => "1" "created_at" => null "file" => "" "orders" => {#324 ▶} "http_code" ...

How can I find the jenkins job that were last build 30 days ago -

team, i want find out jobs in jenkins build 30 days ago , have not build since 30 days. is there rest api or can me that. jenkins api: {jenkins_url}/job/{job_name}/api/json?tree=allbuilds[url,result,timestamp,name,description,actions] give builds ran far job. , can iterate json using java or preferred code language match search criteria in case timestamp.

Excel Conditional Formatting - numbers including text -

Image
i need uncommon conditional formatting applied column in excel. have 1 4 digit numbers, if "(tested)" comes after number, acceptable too. examples of valid values follows: 1 10 100 1000 1 (tested) 10 (tested) 100 (tested) 1000 (tested) here examples of invalid values: 10000 10000 (tested) since cells don't have numerical, can't make use of "greater 9999" rule. how can use conditional formatting highlight these invalid values? try formula: =--left(a1,find(" ",a1 & " ")-1)<9999

mysql - Parse returned value with Regexp on SQL query result -

following query returns form field tb2. select tb1.*, tb2.form jj_books tb1 inner join jj_users tb2 on tb1.book_id = tb2.book_id group data_id form field contains delimeted data (text^book1^booktitle~text^book2^booktitle2~text^book3^booktitle3~...) , need retrieve 1 string (booktitle2) it. is possible use preg_match (regexp) in query , how? if third ^ -delimited field in second - -delimited field, use nested instances of substring_index() . lot simpler regexp. see https://dev.mysql.com/doc/refman/5.7/en/string-functions.html#function_substring-index

mongodb - Apache OpenNLP Persist Model to DB -

i exploring apache opennlp product in project , 1 of requirement persist trained model in db - mongo db / couchbase in case. right looking store document categorizer model output db not have rerun unless modified i see library classes not serializable e.g. documentcategorizerme , getting json deserilization exception if try retrieve persisted records want know if doing that. in general approach persist if want use other open source nlp products.

vba - Actualize a document with weekly Excel received through outlook -

i trying update information in dashboard information received 2 excel sheet received weekly in 2 documents (infoprivate, infopublic). my dashboard contains (basically) 2 sheets (infoprivate, infopublic), , others make local calculus. how can update info ny looking mos recent email , change each of 2 sheets data recent version? my actual code follow: public sub saveolattachmentspu() dim isattachment boolean dim olfolder outlook.mapifolder dim msg outlook.mailitem dim att outlook.attachment dim sht worksheet, wb1, wb2 workbooks on error goto crash isattachment = false set olfolder = outlook.getnamespace("mapi").folders(1) set olfolder = olfolder.folders("inbox") if olfolder nothing exit sub each msg in olfolder.items if ucase(msg.subject) = "pac paho sales current year" while msg.attachments.count > 0 set wb1 = msg.attachements.open wb1.sheets("pac paho sales curren...

javascript - AngularJs: Applying ng-class for input element in a directive -

i trying enhance our directive. used 1 input type='submit' class="btn" element , directive had replace: "true". i've changed template directive following: <input type="submit" value="{{value}}" id="btnchoose" ng-class="{{ngclass}}" style="width: 85% !important; margin-top: 0;" class="btn_file_select" ng-click="click()" /> (showing top part of html). changed replace false , added ngclass: '@' directive. in form set ng-class , can see set when inspect element using dev. tools. can see same ng-class expression added button. however, doesn't work , it's not being evaluated. how should update directive able receive ng-class property on parent's div in form , pass button? sample of using directive in form right now: <data-desc:type ng-class="{greentext: (currentsalespoint['lremotes' + n] == 0 && meta...

Using multiple conditions in an if statement in C++ -

i trying create complex if statement in c++ save me writing whole bunch of if statements, wondering if code below makes sense or overlooking error. if(input==choice) { cout << "tie!" << endl; }else if(input=="rock" && choice=="scissors" || input=="scissors" && choice=="paper" || input="paper" && choice=="rock") { cout << input " beats " << choice << ", win!" << endl; }else if(input=="rock" && choice=="paper" || input=="scissors" && choice=="rock" || input=="paper" && choice=="scissors"){ cout << choice << " beats " << input << ", lose!" << endl; } what trying achieve is: "if input x , choice y, or if...." basically i'm testing multiple ...

Should I POST to the collection when creating a resource with a known ID in my REST API? -

i'm implementing new rest api. in api typically post collections create resources. 1 of resources, id known before created. make more sense post collection id in body or post instance (as yet non-existent) id in url? i'd keep existing endpoint , add id in body when post ing collection, there's no point in adding new separate route what's same thing.

timer - clearTimeout no working But setTimeout is -

i have image wish rotate every 5 seconds or so... have got image rotate once only. there seems nothing wrong coding, no errors , can console log show functions being called , timeout too, still not looping rotation... ideas.. thank you. <script> function countit(){ var img = document.getelementbyid("weather").style.transitionduration = "3s" var img = document.getelementbyid("weather").style.webkittransform = "rotatey(360deg)"; cleartimeout(inter2); }; </script> <script> function countrev(){ var img = document.getelementbyid("weather").style.transitionduration = "3s" var img = document.getelementbyid("weather").style.webkittransform = "rotatey(0deg)"; cleartimeout(inter); }; </script> <script type="text/javascript"> var inter = (function doit(){ settimeout(countit,1000); })(); var inter2 = (function doit(){ settimeout(countrev,...

c# - Controlling a DC motor with a sensor -

i'm controlling dc motor blocking sensor , open when send command it. need dc motor stop when not blocking sensor anymore. should mention methods called native dll. believe there no way me position of motor. in documentation, doesn't getting position. i tried create loop keep hitting motor until sensor unblocked should stop motor. unfortunately, think motor goes fast when sensor unblocked it's late check condition , when sensor being blocked again. tried slow down motor , didn't change anything. have solution on how can make motor run stop when sensor unblocked? have code. int boardtwo; int motoronespeed, motoronedir, motortwospeed, motortwodir; int inputshutter = 0; boardtwoshutter = 2; motoronespeed = 0; motoronedir = mhk_stopped; motortwospeed = 195; motortwodir = mhk_forward; motor_getdigitalinputs(boardtwo, ref inputshutter); while (inputshutter > 0) { motor_setdcmotors(boardtwo, motoronespeed, motoronedir, motortwospeed, motortwodir); } mot...

sms - Twilio API - How to Opt-Out a phone number -

when new user signs up, we're going give them checkbox can opt- in or opt- out of receiving sms messages. i can track on own making sure our application doesn't send texts way, i'm wondering if makes more sense me add them opted out on twilio? i'm still playing around idea, regardless i'm not seeing api endpoints ( https://www.twilio.com/docs/api ) opt-in or opt-out . questions: how opt-out phone number if choose go route? is better manage list on end, or use twilio (if it's possible), or redundant , manage own list in addition twilio enforcing it? twilio developer evangelist here. there no api developers opt users' phone numbers in or out of messages you should maintain opt out list yourself within own application described @ start of question. twilio make possible users opt out of messages number (or messaging service) using industry standard opt out words (stop, stopall, unsubscribe, cancel, end, , quit) . when user sends...