Posts

Showing posts from June, 2014

excel vba - Appending ranges based on a two dimensional conditional loop and exporting to a PDF -

i've tried looking @ other questions, doesn't seem work me. have worksheet called materialflow in have many columns , rows need columns (ones hard code) , rows (ones have word "card") in 8th column copied tab exported pdf keep getting errors. here code. i've managed copy "card" containing rows don't know how simultaneously of columns , associated headers. additionally, column qualifies row excluded, makes difficult. sub racks_list() dim sws worksheet dim rl worksheet set sws = sheets("materialflow") set rl = sheets("reports") dim slr long dim sr long dim l long dim counter range dim comb_range range dim bigrange range dim headers range dim cardcount long dim mycount long cardcount = 0 mycount = 1 each counter in worksheets("materialflow").range("h9", "h500") if counter.value = "card" cardcount = cardcount + 1 if mycount = 1 set comb_range = counter.entirerow

ruby on rails - SimpleForm 3 initializer for Bootstrap4 beta -

the current bootstrap 4 beta adds error class attributes directly input tag this: <div class="col-md-6 mb-3"> <label for="validationserver03">city</label> <input type="text" class="form-control is-invalid" id="validationserver03" placeholder="city" required> <div class="invalid-feedback"> please provide valid city. </div> </div> simpleform however, adds class field wrapper. there way change initializer adds error class input field instead of field wrapper?

How to exclude a folder from rsync -

i using rsync deploy git branch production server. currently, got js files stored in 2 locations: assets/js/ js/ when run rsync using --exclude js , non of both folders sync, while want assets/js/ folder synced , js/ folder inside root folder skipped. how can achieve this? you need specify pattern files , directories: using: cwrule [pattern_or_filename] cwrule,modifiers [pattern_or_filename] so have cw- js/ for more detailed info can see man page @ section include/exclude pattern rules from this link, hope helps

java - How to keep a users selection even after they close the app? Android -

so @ moment user select colour, shape , time. when app first starts there default each. want happen keep users selection 3 of these after close app while runs in background. if need me post ask away. thanks. after writing out problem was, it's not they're not being saved it's fact selections being saved not being displayed properly. i.e border or dropdown menu results it's default value instead of users selection. so values being saved(my bad) app overwrites these saves , doesn't use border or beings dropdown menu it's default value. circularimageview = (circularimageview)findviewbyid(r.id.activity_main_silver_color_button); circularimageview.setbordercolor(getresources().getcolor(r.color.unselected_border)); circularimageview = (circularimageview)findviewbyid(v.getid()); circularimageview.setbordercolor(getresources().getcolor(r.color.selected_border)); these work independent of each other when border selected, if color selected becomes

python - ~/virtualenvs/venv instead of ./venv -

i in team programmers. integrated virtualenvwrapper , since working on several projects. in team project, take account virtualenv located directly in project. hence, many files path directly ./venv/bin/python , , supervisor didn't want customize it. virtualenv on project located in ~/.virtualenvs . there clever idea link ./venv/bin/python ~/.virtualenvs/bin/python without changing nature of files? clear, path of virtual ~/virtualenvs/venv instead of ./venv . works if write ln -s ~/virtualenvs/venv ./venv , not clean such things. that's why wanted clean. update i have shell command , works well. #!/bin/bash cd ~ cd ./projects/work_projects/24-django/ workon venv i have management command named reboot-db-local #!/bin/bash source .mysql-context \ && mysql -u $mysql_user -p$mysql_password -e "drop database credit24h_dev;" \ && mysql -u $mysql_user -p$mysql_password -e "create database credit24h_dev charset=utf8;" \ &&

caching - Laravel - Which cache driver to use? -

this first time dealing caching, , though looked through laravel docs , other various sites instructions of how set up, i'm still @ bit of loss 1 use , different cache drivers do. my current scenario have scheduling system can create pdfs of current week of classes. can choose date in future , make pdf of week well. frontend feature, visits site able use it. there many classes , variations of patterns classes can have, query have lot of records through. driver best out of supported cache drivers?? (apc, array, database, file, memcached & redis) brownie points i'd understanding of use , why can make best decisions future projects. each do/when best use them?? -- doesn't need answered accepted answer, i'd know. thanks! typically use cache frequent queries (when need perform particular read op write not frequently). if isn't case, fallback db. looking @ use case, sounds it's batch job run once week. so, it's infrequent task , data fre

javascript - Detect that the Internet connection is offline? -

how detect internet connection offline in javascript? you can determine connection lost making failed xhr requests . the standard approach retry request few times. if doesn't go through, alert user check connection, , fail gracefully . sidenote: put entire application in "offline" state may lead lot of error-prone work of handling state.. wireless connections may come , go, etc. best bet may fail gracefully, preserve data, , alert user.. allowing them fix connection problem if there one, , continue using app fair amount of forgiveness. sidenote: check reliable site google connectivity, may not entirely useful trying make own request, because while google may available, own application may not be, , you're still going have handle own connection problem. trying send ping google way confirm internet connection down, if information useful you, might worth trouble. sidenote : sending ping achieved in same way make kind of two-way ajax request,

c - How to include three IRQ handlers in one kernel module? -

Image
i'm learning derek molloy's example in book " exploring raspberry pi - interfacing real world embedded linux ". took example @ listing 16-3 , unfortunately not found online. the example contains kernel module code single interrupt. read signal button @ gpio 17 , send interrupt turn on led @ gpio 27. book uses default gpio pin numbering, same. what want modifying code include 2 other button-led pairs. want this: gpio 17 turns on/off gpio 23 gpio 27 turns on/off gpio 24 gpio 22 turns on/off gpio 25 this modified code use. static unsigned int gpiodevice1 = 17; static unsigned int gpiodevice2 = 27; static unsigned int gpiodevice3 = 22; static unsigned int gpiobutton1 = 24; static unsigned int gpiobutton2 = 23; static unsigned int gpiobutton3 = 25; static unsigned int irqnumber1on; static unsigned int irqnumber2on; static unsigned int irqnumber3on; static unsigned int buttoncounter1 = 0; static unsigned int buttoncounter2 = 0; static unsigned int but

python - Add a prefix to all Flask routes -

i have prefix want add every route. right add constant route @ every definition. there way automatically? prefix = "/abc/123" @app.route(prefix + "/") def index_page(): return "this website burritos" @app.route(prefix + "/about") def about_page(): return "this website burritos" the answer depends on how serving application. sub-mounted inside of wsgi container assuming going run application inside of wsgi container (mod_wsgi, uwsgi, gunicorn, etc); need mount, @ prefix application sub-part of wsgi container (anything speaks wsgi do) , set application_root config value prefix: app.config["application_root"] = "/abc/123" @app.route("/") def index(): return "the url page {}".format(url_for("index")) # return "the url page /abc/123/" setting application_root config value limit flask's session cookie url prefix. else automatically handled

javascript - Is it possible to fetch / query the pressed keys on keyboard without events? -

i wanted know if events required pressed keys (or mouse buttons extension) javascript. is there way fetch or query keys without events, , able them simple loop (for example). the act of pressing key fires event, regardless of whether or not have event handler event configured. as whether or not need event handler detect key press - believe answer yes do. however, simulate functionality requesting global object variable, , event handler each keydown , keyup stores pressed key , removes released key in aforementioned variable. loop can take @ global variable.

python - pyspark intersection by key and cogroup performance -

i'm new spark , have following problem: in previous job created 2 large files each line holds pair of ids , according value e.g. (id1, id2, value) first thing reading files hdfs , map them tuples like: ((id1, id2), value) def line_to_tuple(line): x = eval(line) return ((x[0], x[1]), x[2]) rdd0 = sc.textfile('hdfs:///user/xxx/file1') .map(lambda x: line_to_tuple(x)) rdd1 = sc.textfile('hdfs:///user/xxx/file2') .map(lambda x: line_to_tuple(x)) q1: there more efficient way this? can store data in way such don't have eval each line every time read in? in next step use cogroup , filter out empty results in post write results hdfs: pyspark, intersection key rdd0.cogroup(rdd1).filter(lambda x: x[1][0] , x[1][1]) .map(lambda x: (x[0], list(x[1][0])[0], list(x[1][1])[0]) ) .saveastextfile('hdfs:///user/xxx/cogrouped_values') the results of jobs looks this: ((id1, id2), value_

java - MPAndroid Line Chart XAxis Label with formatter not splitting string in new line -

i using mpandroid line graph. using xaxis formatter display axis label. on x-axis have show date jan 2016(with new line between month , year), not overlap other text, month , year vertically aligned. i using following code, it not able create new line in between white space of string "mmm yyyy"(like jan 2016, feb 2016). xaxis.setvalueformatter(new iaxisvalueformatter() { @override public string getformattedvalue(float value, axisbase axis) { return xaxisvaluemap.get((int)value).replaceall("\\s+",system.getproperty("line.separator")); } });

playframework - Play framework external Javascript URL syntax -

Image
how use external javascript files in play framework? i used syntax: <script src="https://www.gstatic.com/charts/loader.js" type="text/javascript"></script> i put in <head> section of main.scala.html . https://www.gstatic.com/charts/loader.js correct link, doesn't load , status of package (blocked:csp) : headers: local javascript files work fine, example: <script src="@routes.assets.versioned("javascripts/hello.js")" type="text/javascript"></script> csp stands content security policy ( see more ): corresponding header defines sources components allowed loaded. usually, default settings default-src: 'self' . means own host allowed source scripts, css, images, etc. in case localhost:9999 , local javascript file passed. need add gstatic.com allowed script-src . thus, configuration needs done in application.conf -file: play.filters.headers.contentsecuritypolicy

java - bus company using only arithmetics -

my homework assignment is: run bus company , need know how many buses need used, based on number of seats in bus , number of passengers. example: if have 17 passengers , 3 seat bus, have use 6 buses. 5 buses first 15 people , 1 2 remaining. i cant use loops, if statements, or recursion, arithmetic. this pseudo code it's wrong: numbus=numofpeople / seat; remain=numofpeople % seat; temp=numofbus % remain; orderbus=numbus+temp; system.out.println(orderbus); since given strict requirement on no loops , ifs, can't use ternary operator well. in fact, don't need those. it can simple as: system.out.println(math.ceil(passengers/seat)); for example (math.ceil(17/3.0)); gives 6.0 . need quotient dividing passengers seats . if quotient not whole number, round one. achieved using math.ceil() . so if there remainders, round 1 (1 more bus ferry rest of passengers)

javascript - How can I inject a library to my Angular 1.5 App only when I load a certain page (view, controller)? -

my library quite big , i'm looking ways load when needed. use mechanism named $oclazyloadprovider example here: $oclazyloadprovider.config({ 'debug': true, // debugging 'true/false' 'events': true, // event 'true/false' 'modules': [{ // set modules name : 'state1', // state1 module files: ['app/components/state1/state1module.js'] },{ name : 'state2', // state2 module files: ['app/components/state2/state2module.js'] }] }); using can simple load these javascript libraries need. can load javascript files, css files.

Subtract date time from current datetime of csv file in python -

i trying calculate time difference in minutes when file created , updated until current moment calculate number of missing data. unable subtract them properly. code follows. the data in file looks this: date,temp1 2017-08-14 17:10:01,0.44 2017-08-14 17:15:01,0.62 2017-08-14 17:20:01,0.99 2017-08-14 17:25:01,0.85 2017-08-14 17:30:01,0.13 2017-08-14 17:35:01,0.24 2017-08-14 17:40:02,0.95 2017-08-14 17:45:01,0.65 and code is: #!/usr/bin/env python # -*-coding:utf-8 -* import os import sys import time time import mktime, strftime, localtime, sleep datetime import datetime, timedelta def missing_data(expect, missed): . . . . def main(): fmt = '%y-%m-%d %h:%m:%s' open('/home/kamil/desktop/sensor1/temp.dat', 'rb') f: read = f.readlines()[1:] line in read: line = line.strip().split(',') # print line start_date = line[0] # type str convert datetime start_date = datetime.strpt

How to read files with similar names but without writting all the names? python -

i have written code, wish in cleverer way, using loop write names instead. my code is: file_name_01 = os.path.join(input_folder_name,'subject101.dat') file_df_01 = pd.read_table(file_name_01, ' ', header=none) file_name_02 = os.path.join(input_folder_name,'subject102.dat') file_df_02 = pd.read_table(file_name_02, ' ', header=none) file_name_03 = os.path.join(input_folder_name,'subject103.dat') file_df_03 = pd.read_table(file_name_03, ' ', header=none) file_name_04 = os.path.join(input_folder_name,'subject104.dat') but want this: for(i=0, i<9, i++) file_name_0%i = os.path.join(input_folder_name,'subject10%i.dat') file_df_0%i = pd.read_table(file_name_0%i, ' ', header=none) i looked answer, found solutions r, java , other languages. i need in python, if me, happy. instead of dynamically building variable names, use dict files = dict() in range(9): file_name = os.path.join(i

postgresql - Need the ID of the current row inserted within a transaction -

within transaction i'm inserting row . how can access , return id of inserted row . can see in code below( see under comment // return last inserted id. ) tried use lastinsertedid() function, gives me error back. btw, i'm using postgres. what missing here? thx! /** * creates order , returns id. */ func createorder(w http.responsewriter, r *http.request) (orderid int) { // begin. tx, err := db.begin() if err != nil { log.fatal(err) } // db query. sqlquery := `insert order_customer (customer_id) values ($1) returning id` // prepare. stmt, err := tx.prepare(sqlquery) if err != nil { log.fatal(err) return } // defer close. defer stmt.close() customeremail := validatesession(r) id := getidfromcustomer(customeremail) order := order{} order.customerid = id // exec. ret, err := stmt.exec(order.customerid) // rollback. if err != nil {

pdf - Lowercase letter L in R plot/expression -

i trying use computer modern font when making pdf r. have expression should contain lowercase l. since looks 1, instead use â„“. have far been incapable of doing this. minimal working example: library(extrafont) pdf("ell_plot.pdf", width=5.5, height=5, font="cm roman") plot(1, xlab="\u{2113}") dev.off() embed_fonts("ell_plot.pdf", outfile="ell_plot.pdf") error message: 47: in text.default(x, y, ...) : conversion failure on 'â„“' in 'mbcstosbcs': dot substituted <e2> and "..." there should \ell. it shows if use cairo_pdf instead of pdf, computer modern doesn't work.

sql - Using python psychopg2 to get a count on all variables in the database that contain a specific string -

i have list, words = [word1, word2, word3, ...] want use sql return number of times each word appears in column of sql file. can't figure out how pass variable sql query. appreciated! code far looks like: import psycopg2 sql word in words conn = sql.connect(**params) c = conn.cursor() #create query , parameters usernames , ids query = """ select count(column a) file column similar '% **variable word** %' limit 1000; """ try: c.execute(query) except: conn.commit() print("error in query") result = c.fetchall() also, count return total number of times word appears or number of lines of column in appears? (will count of in "the team won game" return 1 or two?) the replaceable parameter flag used psycopg2 "%s", , use plain "%" in query replaceable parameters need double (i.e., "%%"). code should like:

ios - unrecognized selector for UITapGestureRecognizer in RxSwift -

im new in rxswift , want use uitapgesturerecognizer dismiss keyboard: let tapgest = uitapgesturerecognizer() tapgest.rx.event.subscribe(onnext: {[weak self] _ in self?.view.endediting(true) }).disposed(by: disposebag) view.addgesturerecognizer(tapgest) but when use gesture, app terminating error : *** terminating app due uncaught exception 'nsinvalidargumentexception', reason: '-[ ttgc7rxcocoa13gesturetargetcso22uitapgesturerecognizer eventhandler:]: unrecognized selector sent instance 0x600000446bd0' there helper methods put tap gestures onto views in rxcocoa. there, want filter gesture recognizer's state don't pick events don't matter. like: view.rx.tapgesture() .filter { $0.state == .ended } .subscribe(onnext: { _ in // }) .disposed(by: disposebag)

python - pytz and astimezone() cannot be applied to a naive datetime -

i have date , need make time zone aware. local_tz = timezone('asia/tokyo') start_date = '2012-09-27' start_date = datetime.strptime(start_date, "%y-%m-%d") start_date = start_date.astimezone(local_tz) now_utc = datetime.now(timezone('utc')) local_now = now_utc.astimezone(local_tz) i need find if true: print start_date>local_now but error. start_date = start_date.astimezone(local_tz) valueerror: astimezone() cannot applied naive datetime i convert utc tokyo no issue. need make start_date timezone aware ad in tokyo. thanks for pytz timezones, use .localize() method turn naive datetime object 1 timezone: start_date = local_tz.localize(start_date) for timezones without dst transition, .replace() method attach timezone naive datetime object should work: start_date = start_date.replace(tzinfo=local_tz) see localized times , date arithmetic of pytz documentation more details.

java - Error Parsing XML while running Tomcat Server 9. Project Spring 3.2 along with hibernate ORM -

console log : while running server. have tried deleting .m2 folder jars not corrupted still same error. because i'm running spring 3.2 tomcat 9.0 , java 8? i'm using mysql database , no table created. aug 14, 2017 10:19:15 pm org.springframework.web.context.contextloader initwebapplicationcontext info: root webapplicationcontext: initialization started aug 14, 2017 10:19:15 pm org.springframework.web.context.support.xmlwebapplicationcontext preparerefresh info: refreshing root webapplicationcontext: startup date [mon aug 14 22:19:15 ist 2017]; root of context hierarchy aug 14, 2017 10:19:16 pm org.springframework.beans.factory.xml.xmlbeandefinitionreader loadbeandefinitions info: loading xml bean definitions servletcontext resource [/web-inf/applicationcontext.xml] aug 14, 2017 10:19:16 pm org.springframework.web.context.contextloader initwebapplicationcontext severe: context initialization failed org.springframework.beans.factory.beandefinitionstoreexception: ioexcept

Use if statement for each cell of a dataframe in R -

i have 2 dataframes, a , b , each 64 rows , 431 columns. each dataframe contains values of zeros , ones. need create new dataframe c has values of 1 when cell of a equal cell of b , , value of 0 when cell of a different cell of b . how apply if statement each cell of 2 dataframes? example of dataframes <- data.frame(replicate(431,sample(0:1,64,rep=true))) b <- data.frame(replicate(431,sample(0:1,64,rep=true))) example rows x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 1 0 1 1 0 1 0 1 0 0 1 2 1 1 0 1 1 0 0 0 0 0 3 1 0 0 0 1 0 0 1 1 0 4 0 0 0 0 1 1 1 1 1 0 5 1 0 1 1 0 0 0 1 1 1 example rows b x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 1 1 0 1 0 0 1 0 1 0 1 2 0 0 0 1 0 1 1 1 1 1 3 1 0 1 1 1 1 0 0 0 0 4 1 0 0 0 0 1 1 0 0 0 5 0 0 0 0 1 1 1 1 1 0 output obtain, dataframe c x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 1 0 0 1 0 0 0 0 0 1 0 2 0 0 1 1 0 0 0 0 0 0 3 1 1 0 0 1 0 1 0 0 1 4 0 1 1

angular 2 best way to constantly update dom position -

i'm building game in angular (v4) , aware direct dom manipulation (if ever) correct route angular. however, i'm building, i'm not sure see viable avenue. what i'm needing component handles it's dom updating rotational positions of several elements simultaneously (think of solar system model). there 2 main routes see, first direct dom manipulation updates on component input change. second component has inline style tags e.g. [style.whatever]="thing.whatever" . my second route seems kind of it's still direct dom manipulation, not in javascript. i doing things 'right' way whenever possible, input helpful. i not use/plan/want use jquery @ in project. update just realized i'm idiot, , wouldn't need programmatic dom updates, need set initial css properties need start, , animation speed. since it's constant thing, predictable animation, can let css work. still know if proper set css properties in code, or attributes of comp

mysql - How to call R script from PHP? -

i have bunch of r scripts calculations , return result. planning of building php website user can submit form data gets passed r script, processed , return result php , update interface. the plan have database when user submits form, data gets stored in database r can read, process input , insert result in database php can grab it. however, there 2 problems: how r script knows values have been stored in database can grab values , processing? when r script finishes processing data , insert mysql db, how php understand @ moment php needs query database , grab value? let's r script following: range<-1:20 m<-mean(range) s<-sum(range) print(m) print(s) as can see input @ case 1 , 20 define range, , output show values of m , s on webpage. any idea how accomplish that? thanks! shell_exec() or exec() best choices in php. this answer explains difference. echo shell_exec("rscript my_script.r {$_get['range']}");

html - css label absolute position, but still taken into account for parent width -

i have flexbox layout div containing label last item. has position: absolute . possible still make parent div expand contain label? <div class='container'> <div class="item">flex1</div> <div class="item">flex2</div> <div class="item no-flex"> <div> <label>nfdfesrsawe</label> <div> </div> </div> .container{ width: 100%; display: flex; background-color: red; justify-content: space-between } .item { border: solid black 1px; flex: 1; } .no-flex { flex: 0 } label { position: absolute; } https://codepen.io/anon/pen/yozvwx edit: simplified example: <div class='container'> <label>make container fit around me, please</label> <div> .container{ background-color: red; } label { position: absolute; } i need work because absolute positioning defined framework (vuetify) , can

mp3 - How to install FFMPEG in DSX? -

i want process .mp3 files in dsx music information retrieval. using librosa library in python purpose. unable load .mp3 files due absence of ffmpeg . there way install ffmpeg in dsx or other walk-around load .mp3 files in dsx? any of libraries need sudo permissions cannot installed on spark service associated notebook on dsx user. you can install libraries --user flag in pip. only ibm spark service team can install libraries need sudo permissions. please raise request/idea here library installed:- https://ibmwatsondataplatform.ideas.aha.io/?category=6441922592725708622 thanks, charles

Google Analytics API sometimes returns nothing -

i using google analytics api in javascript within mvc project. when make queries, data , empty object. there no errors in console when happens. also, happens queries , never happens others. don't think it's sampling issue, because dealing low numbers (usually single digit). also, have tried setting sampling level high no change in behavior. here example of query returns empty me: var rangedfirstload = new gapi.analytics.googlecharts.datachart({ query: { 'ids': viewid, 'start-date': mindatechart, 'end-date': maxdatechart, 'metrics': 'ga:totalevents', 'dimensions': 'ga:operatingsystem', 'filters': filterquery + ';ga:eventaction==first load', 'samplinglevel': 'higher_precision' }, chart: { 'container': 'cha

vba - Excel Macro: Can someone replace the delete and add sheet lines with one that clears the content of the sheet? -

i have macro combines specific sheets , works fine except 1 thing. want combined sheet able update , refresh , entries added individual sheets, , have formulas on other sheets reference combined sheet. in code combining, combined sheet gets deleted if present , added again, messes formula references. therefore, edit code , remove part deletes , re-adds combined sheet , instead clear contents of sheet combining data. here code have far... sub copyrangefrommultiworksheets() dim sh worksheet dim destsh worksheet dim last long dim copyrng range application .screenupdating = false .enableevents = false end 'delete sheet "combinedreport" if exist application.displayalerts = false on error resume next activeworkbook.worksheets("combinedreport").delete on error goto 0 application.displayalerts = true 'add worksheet name "combinedreport" set destsh = activeworkbook.worksheets

sql - Convert Update statement to select statement -

i'm struggling convert following update statement select statement. hoping can provide tips on how convert this. update inventory_part_tab set planner_buyer = (select hb.buyer_code info.hb_pur_plan_upd1 hb hb.part_no = inventory_part_tab.part_no , hb.contract = inventory_part_tab.contract), last_activity_date = decode(contract, '01', to_date(sysdate), '06', (to_date(sysdate) - (3 / 24)), '20', to_date(sysdate), '21', to_date(sysdate)), rowversion = decode(contract, '01', sysdate, '06', (sysdate-(3 / 24)), '20', sysdate, '21', sysdate, '12', (sysdate + (6 / 24))) contract in ('01', '06', '20', '21') , prime_commodity not in ('spcsl','spckt','spccc','spcgk','spcmt') , planner_buyer <> (select hb.buyer_code info.hb_pur_plan_upd1

tensorflow XLA not producing the dot file -

i trying follow tutorial on xla , jit ( https://www.tensorflow.org/performance/xla/jit ). according https://www.tensorflow.org/performance/xla/jit#step_3_run_with_xla , when run command https://www.tensorflow.org/performance/xla/jit#step_3_run_with_xla it should produce output location xla graph. however, output not include info. extracting /tmp/tensorflow/mnist/input_data/train-images-idx3-ubyte.gz extracting /tmp/tensorflow/mnist/input_data/train-labels-idx1-ubyte.gz extracting /tmp/tensorflow/mnist/input_data/t10k-images-idx3-ubyte.gz extracting /tmp/tensorflow/mnist/input_data/t10k-labels-idx1-ubyte.gz 0.9172 only timeline file generated. build: tensor flow r1.3 xla jit cpu

android - Optimize rendering of multiple Model instances using Textures from a TextureAtlas -

i have model g3dj file loaded on android device: assets = new assetmanager(); assets.load("my_3d_obj.g3dj", model.class); i want create approx. 80-100 instances of model each unique texture textureatlas optimal performance. optimal way understand combine objects 1 mesh in example: https://xoppa.github.io/blog/a-simple-card-game/ my question how best combine multiple models 1 mesh using textureatlas . can how create sprite textureatlas , apply on model extract vertices , indices model , add them using meshbuilder each instance of model .

laravel - Forge cannot deploy to Digital Ocean (Permission denied) Public key -

i have looked , tried again , again , need reach out help. i can push local machine gitlab no problem. but when forge attempts deploy responds error: permission denied (publickey). fatal: not read remote repository. please make sure have correct access rights , repository exists. key = xxx i can ssh server forge@my-ip , cd /.ssh/ , cat authorized_keys. public key @ /users/me/.ssh/id_rsa.pub there , forge key error message on there on forge user account too. when log in digital ocean, id_rsa.pub there on forge, server, ssh keys, id_rsa.pub there on gitlab, id_rsa.pub there can suggest what's wrong? appreciate it! first laravel app in production has been lying idle while , putting production upgrade 5.3 5.4 maybe laravel config issue?

How to protect a sqlite3 database made with python of "outside" editing -

first of sorry bad english, not native lenguage. so have python (2.7) program read, delete, , insert data sqlite3 database. (the program done , works fine). my new problem don't want database can edited with, example, "sqlite data browser". want database can edited (delete , insert) through python program. ¿is possible? working on linux (raspbian). python 2.7. code large , don't think necesary either. thanks in advance ! your english fine. suppose possible. mean program able authenticate database. means gets credentials somewhere or stores them somewhere.. your code lives on raspberry pi. if can touch raspberry pi, can pull sd card , access database , code.

wso2 - Handling key-value-pair arrays in ESB API -

we working esb 4.8.1 , bps 3.5. we'd love upgrade, management resistant. the bps returns of data in form of arrays of key-value-pairs, example "variables": [{"name":"valid","type":"boolean","value":true,"scope":"global"}, {"name":"processcomments","value":null,"scope":"global"}, {"name":"vesselstatus","type":"string","value":"s","scope":"global"}, ...] some of need parse more conventional json, e.g. "variables":{"valid":true, "vesselstatus":"s"} and in many cases variable names , formats of values must me massaged ui, or specific values must extracted call soap services. there didn't seem obvious iterative logic mediator, , don't think i'd want use if there was, we've been using class medi

php - WordPress Sorting by characts - Swedish characters -

my website in swedish , write different kind of topics. in sweden have these kind of characters ö, ä & å. have created page show cpt posts start character a. problem getting that when showing posts start Ä shows posts starting & Å. same thing if example want show posts starting o shows posts starting Ö also. how go filter out right. here code <?php //get post ids posts start letter a, in title order, //display posts global $wpdb; $char_a = 'a'; $postids = $wpdb->get_col($wpdb->prepare(" select id $wpdb->posts substr($wpdb->posts.post_title,1,1) = %s order $wpdb->posts.post_title",$char_a)); if ($postids) { $args=array( 'post__in' => $postids, 'post_type' => 'encyklopedi', 'post_status' => 'publish', 'posts_per_page' => -1, // 'caller_get_posts'=> 1 ); $my_query = null; $my_query = new wp_query($args); if( $my_query->h

security - run part of python script as sudo -

i'm trying run part of script task.py in sudo mode. ideally run task.py following structure: if __name__ == '__main__': print('running normal parts') . . . . [running normal commands] . . . . print('running sudo parts') . . . . [running sudo commands] . . . . where don't have enter password sudo parts of script can make single call $ python task.py command line. is there nice tell python run second block sudo ? saw subprocess module had way call command sudo privelages, i'd rather not put "sudo parts" separate script "running sudo commands" part. i highly recommend putting sudo parts separate script documentation recommended. approach improves security posture of script dramatically part necessary execute elevated privileges (aka "least privilege"--a fundame

java - Selenium Webdriver - Drag and drop does not work -

i know there several posts issue. tried solutions in project unable make drag , drop work. using following code: webdriver driver = new chromedriver(); webelement dragableelement = driver.findelement(by.classname("dragelement")); webelement dropablecontainer = driver.findelement(by.xpath("//* [@id='contentcollection_xyz']")); actions builder = new actions(driver); action draganddrop = builder.clickandhold(dragableelement) .movetoelement(dropablecontainer) .release(dropablecontainer) .build(); draganddrop.perform(); this drops dragable element before dropable container. i have gotten drag , drop work selenium, poorly worded question though. need more details, , stack overflow not place find "share screen with".

mvvm - WPF: Changing tabs makes Windowsformshost child disappear -

if can spare time, working on problem can't find solution on internet. i need 2 tabs' richtextboxes bind same property. both richtextboxes hosted in wpf via windowsformshost. if alternate between tabs, 1 richttextbox dissapear (always first 1 visible). migrating app , far, forced use windowsforms richtextbox. i hope managed convey problem - sorry, not native speaker. thanks in advance edit: asked provide clear example of problem. note. rewrote question. further, have uploaded micro app have isolated problem. click 2 tab buttons alternately , 1 richtextbox dissapear. below, provide code if serves: this mainwindow (xaml): <stackpanel orientation="horizontal" height="35" margin="0,35,0,0" verticalalignment="top" > <button x:name="tab1" command="{binding leftcommand}" content="left" minwidth="100" /> <button x:name="tab2" command="{bindi

go - Golang deadlock that I resolved by luck, need explanation -

i'm trying understand go channel , go routine. so, i'm doing online exercises. found 1 here: http://whipperstacker.com/2015/10/05/3-trivial-concurrency-exercises-for-the-confused-newbie-gopher/ i resolved 3rd 1 (named "internet cafe"). there's resolved "luck", , it's bother me because don't understand issue , why "hack" fixed it. in code below, replace "enterchan <- next" "go func() { enterchan <- next }()", , solved deadlock. can explain me why deadlock before, , why works hack ? proper solution, or ugly 1 ? don't hesitate criticize code, i'm searching improve :) many thanks! this code: package main import ( "fmt" "math/rand" "strconv" "time" ) const ( maxnumberofuser = 8 ) func usecomputer(tourist string, leaverchan chan string) { seed := rand.newsource(time.now().unixnano()) random := rand.new(seed) fmt.print