Posts

Showing posts from January, 2010

android - How correctly test if subscriber is called with correct data in onNext() (RxJava2) -

i test method: void updateavailablescreens() { safiecam.availablecameras() .flatmap(this::getavailablescreensforcameras) // causing failure .observeon(schedulers.mainthread()) .subscribe( screens -> { view.setavailablepagesonviewpager(screens); view.setavailablepagesonbottomsheet(screens); }, timber::e ); } with test (so giving known data, expect calling view expected enum list): @test public void widgetsshouldgetallscreens() { when(camera.availablecameras()).thenreturn( observable.just(arrays.aslist( safiecam.cameratype.selfie, safiecam.cameratype.rear))); testedvppresenter.updateavailablescreens(); list<viewpagerview.pages> pages = arrays.aslist( viewpagerview.pages.selfie, vie...

sql - How to compare with date in mm/yy format in MySQL? -

i have column named 'exp_date' , date mm/yy. i.e: 07/17. want select rows exp_date less or equal 2 months remaining today. how can this? you need post sql dialect using. assume sql92. cast function first step: cast('20' || substring (exp_date,4,2) || '/' || substring (exp_date, 1,2) date) . mssql uses ' + instead of || . after that, compare current_date - interval '1 month' . caps here optional.

Street and Road names in Google Map -

i retrieve road , street names, if enters area in search box. possible in google api ? i have checked list of street , road names in google in api solution, there been given auto complete box , request not requirement. also learnt open street maps provide these data, unfortunately perform operations based upon google api's. can suggest me way, otherthan osm. google maps api not provide such functionality. however, there google maps roads api 1 of premium paid apis lets query nearest road names , other road metadata. can check out here: https://developers.google.com/maps/documentation/roads/intro you can try overpass-turbo ( https://overpass-turbo.eu/ ) lets query osm data. can set bounds , osm tags interested in.

hp ux - Limitation of HP awk -

a simple awk script works fine in linux , own hpux 11.31 platform, doesn't work in other hpux 11.31 system. can't access problematic hpux system not able test now. @ input data mystring my.linuxsrc running 16840 yourstring your.linuxsrc running 41794 @ myawk.awk /mystring / { printf "%s#%s#%s#%s",$1,$2,first,$3; printf "\n"; flag="yes"} @ error in other hpux system syntax error source line 1 error context <<< >>> awk: quitting source line 1. the version of awk in other hpux system: other_hpux] /usr/bin/awk /usr/bin/awk: main.c $date: 2009/02/17 15:25:17 $revision: r11.31/1 patch_11.31 (phco_36132) run.c $date: 2009/02/17 15:25:20 $revision: r11.31/1 patch_11.31 (phco_36132) $revision: @(#) awk r11.31_bl2010_0503_1 patch_11.31 phco_40052 my hpux system: my_hpux] /usr/bin/awk /usr/bin/awk: main.c $date: 2008/05/19 14:40:42 $revision: r11.23/3 patch_11.23 (phco...

Python Pandas Dataframe Column of Lists, convert list to string in new column -

i have dataframe column of lists can created with: import pandas pd lists={1:[[1,2,12,6,'abc']],2:[[1000,4,'z','a']]} #create test dataframe df=pd.dataframe.from_dict(lists,orient='index') df=df.rename(columns={0:'lists'}) the dataframe df looks like: lists 1 [1, 2, 12, 6, abc] 2 [1000, 4, z, a] i need create new column called ' liststring ' takes every element of each list in lists , creates string each element separated commas. elements of each list can int , float , or string . result be: lists liststring 1 [1, 2, 12, 6, abc] 1,2,12,6,abc 2 [1000, 4, z, a] 1000,4,z,a i have tried various things, including converting panda df list string : df['liststring']=df.lists.apply(lambda x: ', '.join(str(x))) but unfortunately result takes every character , seperates comma: lists liststring 1 [1, 2, 1...

html5 - Whether browser recognize document HTML version -

i have html document written in html 4. used required attribute html 5 worked surprise. saw error red border when input empty. think browser recognized document html 5 document , ignored doctype. question is, how browser google chrome recognize html document version. thanks hints. <!doctype html public "-//w3c//dtd html 4.01//en" "http://www.w3.org/tr/html4/strict.dtd"> <html> <head> <style> input:invalid { border: 2px dashed red; } input:valid { border: 2px solid black; } </style> </head> <body> <form> <label for="name">name</label> <input id="name" name="name" required> <button>submit</button> </form> </body> </html> how browser google chrome recognize html document version they don't. parse html. (the ex...

node.js - Why would someone create an index on a collection in MongoDB? -

db.collection.createindex()¶ creates indexes on collections. i understand why need indexes on documents, why on collections? thanks helping! we not creating indexes on documents, index documents on collections, selecting 1 or more keys. index columns in tables on relational db world. just find right document (row) collection (table).

c# - Validating binding, depending on which button is clicked -

i searched lot, didn't find right solution. i have textbox , datagridview , 3 button s , bindingsource . when click button 'change' set binding , data loaded datagridview textbox , works: textbox.databindings.add("text", bindingsource, "name", true, datasourceupdatemode.onpropertychanged); when click button 'cancel' binding cleared: textbox.databindings.clear(); but data still transferred datagridview . think it's because of onpropertychanged . when change onvalidation , know saved, when it's validated. but how can validate or refuse validation? have 2 button s, , depending on whether 'save' button or 'cancel' button clicked, should transferred datagridview or not. and event textbox.validating += textbox_validating; i didn't running, because function called before can click button. how can achieve this? you can create binding datasourceupdatemode.never , store in form level varia...

php - exclude file with Glob -

i using glob list of files in directory. foreach(glob(dirname(__file__) . '/{data-,list-}*.{php}', glob_brace) $filename){ $filename = basename($filename); echo "<option value='" . $filename . "'>".$filename."</option>"; } let file list in directory follow data-financebyyear.php data-finance.php data-hrbyyear.php how exclude files byyear in filename ? i tried , not working ..all files still displayed foreach(glob(dirname(__file__) . '/{data-,list-}*.{php}', glob_brace) $filename){ $filename = basename($filename); if (strpos($filename, 'byyear') !== false) { echo "<option value='" . $filename . "'>".$filename."</option>"; } } foreach(glob(dirname(__file__) . '/{data-,list-}*.{php}', glob_brace) $filename){ $filename = basename($filename); if (strpos($filename, 'by...

excel - How to plot graphs on their corresponding sheet? -

i taking data multiple spreadsheets , plotting them on chart, each of respective spreadsheets. want data spreadsheet1 plot graph on spreadsheet1. currently, code plots of graphs on last sheet, graphs sheets 1,2,3, etc plotted on last sheet. unsure how fix new vba. recorded macro code plot data. here plotting code: for j = 1 size 'creates chart activesheet.shapes.addchart2(240, xlxyscatter).select activesheet.shapes("chart 1").incrementleft 696.75 activesheet.shapes("chart 1").incrementtop -81.75 activesheet.shapes("chart 1").scalewidth 1.3333333333, msofalse, _ msoscalefromtopleft activesheet.shapes("chart 1").scaleheight 1.6909722222, msofalse, _ msoscalefromtopleft application.cutcopymode = false application.cutcopymode = false application.cutcopymode = false application.cutcopymode = false application.cutcopymode = false application.cutcopymode = false activechart.seriescollection.newseries activechart.fullseriescollection...

angular - how to perform multiple buttons event handling onclick in listview -

i have 3 buttons in listview. need perform multiple button click trigger same method checkinstall . dont know how do. have added relevant code: html file: <listview [items]="allappslist" class="list-group"> ....... ....... <stacklayout row="0" col="2"> <button text= "install" (tap) ="checkinstall($event, myindex)" > </button> <button text= "open" (tap) ="checkinstall($event1, myindex)" > </button> <button text= "remove"(tap) ="checkinstall($event2, myindex)" > </button> </stacklayout> </listview> ts file: checkinstall(args: eventdata, index : number) : void { } for performing first button, checkinstall method working fine.but dont know how button id second , third button trigger separately checkinstall handle functionalities hide , show buttons. $event angul...

Sort highscores in file python programming -

i have game programming, highest score saved down onto file in shall sorted after best score etc. have coded class , way save down score, cannot figure out how sort them after eachother like: ex: 16 9 3 the final score process! # display final score. drawboard(mainboard) scores = getscoreofboard(mainboard) change def save_highscore(self, highscore): highscores = set(self.get_highscores(false)) if highscore in highscores: return highscores.add(highscore) open(self.highscore_file, "w") f: f.write(" ".join(str(score) score in highscores)) to def save_highscore(self, highscore): highscores = set(self.get_highscores(false)) if highscore in highscores: return highscores.add(highscore) open(self.highscore_file, "w") f: f.write("\n".join(str(score) score in sorted(highscores, reverse=true)))

Trying to execute HTML after PHP code -

i making website can log in using http basic authentication. once person logs in correct credentials, start new session , have link continue page. on other page want check see if session has been started getting username session variable created on last page. if session variable exists, want execute pages html code. if session variable not exist, should give user link login page. know how can achieved? // second page checking see if session variables exists code <?php session_start(); if (isset($_session['username'])) { $username = $_session['username']; // command execute rest of webpage after php closing tag } else { die("<a href='index.php'>login</a>"); } ?> <!-- html code needs executed --> <p>hi!</p> you try , wrap webpage content around if in php tags. <?php session_start(); if (isset($_session['username'])) { $username = $_session['username']; ...

c# - Why does WebClient freeze my program? -

i can try string url when program gui freezes private void button1_click(object sender, eventargs e) { try { if (listbox1.items.count > 10) { messagebox.show("wow ! try hack iran ? :)"); application.exit(); } long fromnumber = convert.toint64(textbox1.text); long = convert.toint64(textbox2.text); int badn = 0; int godn = 0; int ern = 0; string slas; long gethow = ((to - fromnumber) + 1); if (fromnumber < 9010000000 && > 9399999999 && fromnumber > to) { messagebox.show("you entered wrong numbers !"); } if (fromnumber >= 9010000000 && >= 9010000000) { this.text = "myirancell bruteforce [ status : attacking ]"; (long = 1; ...

c# - How to abort an async wait for a pipe connection? -

this question has answer here: what way shutdown threads blocked on namedpipeserver#waitforconnection? 7 answers in following code namespace ns { public partial class form1 : form { public form1() { initializecomponent(); } string processcommand(string cmd) { return "i got " + cmd; } streamreader d_sr; streamwriter d_sw; namedpipeserverstream d_pipe; iasyncresult d_ar; void connected(iasyncresult ar) { d_pipe.endwaitforconnection(ar); d_sw.autoflush = true; while (true) { var cmd = d_sr.readline(); if (cmd == null) break; var answer = processcommand(cmd); d_sw.writeline(answer); } ...

ARKIT ARCamera zFar -

anyone know how change zfar or arkit arcamera? or current value of it. i have large model thats being clipped. think. in blender had same issue , fixed setting far value on frustum. i can create projection matrix each camera frame cant set it. func session(_ session: arsession, cameradidchangetrackingstate camera: arcamera) { textmanager.showtrackingqualityinfo(for: camera.trackingstate, autohide: true) let projectionmatrix: matrix_float4x4 = camera.projectionmatrix(withviewportsize: camera.viewport.size, orientation: .portrait, znear: 0.1, zfar: 5000) //error - readonly camera.projectionmatrix = matrix_float4x4 ... arcamera has nothing rendering 3d virtual content. docs say, it's "information camera position , imaging ...

Unable to run pyspark -

i installed spark on windows, , i'm unable start pyspark . when type in c:\spark\bin\pyspark , following error: python 3.6.0 |anaconda custom (64-bit)| (default, dec 23 2016, 11:57:41) [msc v.1900 64 bit (amd64)] on win32 type "help", "copyright", "credits" or "license" more information. traceback (most recent call last): file "c:\spark\bin..\python\pyspark\shell.py", line 30, in import pyspark file "c:\spark\python\pyspark__init__.py", line 44, in pyspark.context import sparkcontext file "c:\spark\python\pyspark\context.py", line 36, in pyspark.java_gateway import launch_gateway file "c:\spark\python\pyspark\java_gateway.py", line 31, in py4j.java_gateway import java_import, javagateway, gatewayclient file "", line 961, in _find_and_load file "", line 950, in _find_and_load_unlocked file "", line 646, in _load_unlocked file "", line 616, in _load_backwar...

amazon web services - Cant access Elasticsearch with AWS instance -

Image
as shown in photo below, can reach localhost elasticsearch, however, when try reach aws public url:9200, denies connection. may know how connect aws server's elasticsearch? probably running default settings elasticsearch bound localhost. means no 1 else localhost can connect it. read important settings section .

dataframe - R and dplyr : how to use values from a previous row and column -

i trying create new variable function of previous rows , columns. have found lag() function in dplyr can't accomplish like. library(dplyr) x = data.frame(replicate(2, sample(1:3,10,rep=true))) x1 x2 1 1 3 2 2 3 3 2 2 4 1 3 5 2 3 6 2 1 7 3 2 8 1 1 9 1 3 10 2 2 x = mutate(x, new_col = # if x2==1, value of x1 in previous row, # if x2!=1, 0)) my best attempt: foo = function(x){ if (x==1){ return(lag(x1)) }else{ return(0) } x = mutate(x, new_col=foo(x1)) we can use ifelse x %>% mutate(newcol = ifelse(x2==1, lag(x1), 0))

currency - ethermint: command not found, When attempting ethermint installation? -

i'm following steps install ethermint on top of tendermint listed on readme on github page: https://github.com/tendermint/ethermint , @ step ethermint --datadir ~/.ethermint init setup/genesis.json , following error: ethermint: command not found and yes, installed tendermint previous attempted installation of ethermint. while solution figured out problem contained on github issue page linked above, wanted include here sake of people have same issue. ok, fixed problem, , infuriating. turns out whenever opened terminal, go version default go1.6, if in go1.8.3 directory. solve error, need delete old go version off of computer, , use gvm set right go version. helped me solve issue.

vba - Excel: Center across selection with cells containing nothing (as in "") but formulas -

i building list in excel. user can fill 10 lines per kpi multiple kpis. width fixed 8 columns. afterwards, extract same list without empty lines sheet (w/o vba). , export ppt ole object via vba. problem is: kpi title cannot read because cut off when cell ends though next cell visibly empty (only formula in there enters "" empty cells) , center across selection activated. i somehow need make kpi name visible (preferably without vba). note: adding in front of each line not feasible due width limitations imposed through slides' size. copy , paste special of ole data did not work. input selection without empty rows. problem cell a3 example without vba, not sure how that. perhaps find/replace on formula, find formulas don't equate "" . if want clear such cells, sub may work. change range required range: sub remove_empty_formula() dim rng range, cel range set rng = range("b1:b10") each cel in rng if worksheetfunction.isformul...

javascript - jwt.sign added parameter to token error -

i added user id login token user gets when logs in access in index.html. i've done program unable find user edit in database. "user not exist" message. reason user cannot found in database don't know how fix this. if (!user) { res.json({ success: false, message: 'username not found' }); i added _id token , .select: user.findone({ username: req.body.username }).select('username active email _id resettoken name').exec(function(err, user) wt.sign({ username: user.username, email: user.email, id: user._id } could please me?

gradlew - How do I provide credentials for Gradle Wrapper without embedding them in my project's gradle-wrapper.properties file? -

in order bootstrap gradle-wrapper, need pull gradle distribution artifactory requires http basic-auth. there's no way build environment access outside world - blocked corporate proxy. problem how provide credentials gradle can bootstrap. the gradle documentation suggests putting username & password gradle-werapper.properties . if put gradle-wrapper.properties project has access source code would have access credentials. alternatively, if put gradle-wrapper.properties file build image of builds tied same credentials. neither of these acceptable. what i'd rather have gradle wrapper pick it's credentials environment variables. run-time environment makes easy provide credentials in right way - there way make gradle consume credentials environment variable?

javascript - Price String spliting into amount and currency -

i need splitting string in javascript. i have string currency. string depends on location. for example: "1,99€" or "$1,99" i split string , extract "amount" , "currency" out of it. if fails, return empty string or null. does know how solve that? if expect inputs include both decimals of cent value (ie, comma followed 2 digits) use this: const amount = money.match(/\d/g).join('') / 100; const curren = money.match(/[^\d,]/g).join(''); javascripts hated implicit type coercion allows divide string numerator number denominator , end number. to currency, extract non- digit or comma characters , join them. if can't rely on input including cent value (ie, might receive whole dollar amount without comma or cent digits) try this: const amount = money.match(/d/g).join('') / (money.includes(',') ? 100 : 1);

appmaker - creating a link to the record in a completed form -

i pretty new app maker. have form user completes called creditapplication (it's linked datasource called creditapplication ). form has submit button. upon submission, want email link record completed emailed user. i having trouble creating link. link bring emailed user same record in creditapplication form. have listed have below. the creditapplication form has submit button onclick set to: createrequest(widget). the creditapplication datasource has following code in oncreate event: var = "jdoe@gmail.com"; var subject = "new online credit application submission - " + record.firstname + " (sales contact: " + record.salescontact + ")"; var msg = "a credit application has been submitted " + record.firstname + "." + "<br><br>"; var appurl = scriptapp.getservice().geturl() + '#creditapplication?requestid=' + record._key; msg = msg + appurl; mailapp.sendemail(to, subject, msg...

Module export of pg-promise object derived from promise chain -

we're using hashicorp's vault store database connection credentials, constructing connection string pg-promise those. 'catch' vault details provided promise wrapper, due request callbacks vault api. example database.js module: const pgp = require('pg-promise')(/* options obj */); const getdbo = () => { return new promise( (resolve, reject) => { vault.init().then(secrets => { let credentials = secrets.dbuser + ':' + secrets.dbpass let connstr = 'postgres://' + credentials + '<@endpoint/db>' let dbo = pgp(connstr, (err) => { reject(err) }) resolve(dbo); }) } module.exports = { get: getdbo } this being imported in multiple routes. seeing warning "warning: creating duplicate database object same connection." there better way resolve there 1 object per connection details? creating , initializing connection pg-promise synchrono...

Java SQL Server Application Stuck On statement.executeUpdate() -

i have rather annoying issue. in piece of code below, trying insert new row "revisiondispersion" table in database. however, whenever call stmt.executeupdate() program freezes , there ends being no transaction database. no matter how long wait; database won't updated. below code of interest: private static final string insert_dispersion = "insert revisiondispersion(" + assignments.id + ", " + persons.email + ", " + handins.id + ")" + " values(?, ?, ?)"; public static void disperse(datasource source, assignment assignment) throws exception { list<string> handins = assignment.gethandins(); //used decide checks assignment int maxrng = math.max(1, handins.size() / assignment.getpeercount()); int rng = new random(...

python - Detecting vertical lines using Hough transforms in opencv -

Image
i'm trying remove square boxes(vertical , horizontal lines) using hough transform in opencv (python). problem none of vertical lines being detected. i've tried looking through contours , hierarchy there many contours in image , i'm confused how use them. after looking through related posts, i've played threshold , rho parameters didn't help. i've attached code more details. why hough transform not find vertical lines in image?. suggestions in solving task welcome. thanks. input image : hough transformed image: drawing contours: import cv2 import numpy np import pdb img = cv2.imread('/home/user/downloads/cropped/robust_blaze_cpp-300-0000046a-02-hw.jpg') gray = cv2.cvtcolor(img,cv2.color_bgr2gray) ret, thresh = cv2.threshold(gray, 140, 255, 0) im2, contours, hierarchy = cv2.findcontours(thresh, cv2.retr_tree, cv2.chain_approx_simple) cv2.drawcontours(img, contours, -1, (0,0,255), 2) edges = cv2.canny(gray,50,150,aperturesize = 3) minlin...

applying commands on multiple lists in R -

i have 2 lists: list.1 list.2 i have command list of tables. works well: foreach(x=iter(list.1)) %do% { assign(x, mutate(get(x), date = make_datetime( shana, hodesh, taarich, shaa)) %>% select( -shana, -hodesh, -taarich, -shaa)) # selecting relevant columns. } but want apply command multiple lists. tried write this, didn't go well: foreach(x=iter(list.1 , list.2 )) %do% { assign(x, mutate(get(x), date = make_datetime( shana, hodesh, taarich, shaa)) %>% select( -shana, -hodesh, -taarich, -shaa)) # selecting relevant columns. } you can lapply(list(list.1, list.2), function(list.i) { foreach(x=iter(list.i)) %do% { assign(x, mutate(get(x), date = make_datetime( shana, hodesh, taarich, shaa)) %>% select( -shana, -hodesh, -taarich, -shaa)) # selecting relevant columns. } }

python - Can you set a tkinter background image without adding a new canvas element? -

i have python tkinter program simplified to import tkinter tk root = tk.tk() canvas = tk.canvas(root, height=200, width=200, bg="salmon") canvas.pack(fill=tk.both, expand=tk.yes) def click(event): print(event.x) print(event.y) def release(event): print(event.x) print(event.y) canvas.bind("<button-1>", click) canvas.bind("<buttonrelease-1>", release) root.mainloop() with canvas main element. canvas has click/release events bound (e.g. returning event.x , event.y ). want add background image canvas in manner: canvas = tk.canvas(root, bg='/path/to/image.png') i have managed set background image creating image on canvas using canvas.create_image method, explained in adding background image in python . however, broke program event.x , event.y return position of background image. i looking solution force me change least of existing code. we need use photoimage load image use use create_image s...

Returning specific table data from the view to the controller? asp.net MVC -

Image
so have view displaying table of data database select/selectall checkbox in place. i'd able list of customernumbers , whether or not have been checked , return controller further action. below how view written. have tried numberous ways work , stumped. @model massinactiveinspections.models.customerinfolist <div class="container"> <h2>@viewbag.title</h2> <div class="bs-callout bs-callout-info" style="margin-bottom: 0px;"> </div> <div class="col-md-8"> @using (html.beginform("selectedcustomers", "home", new { returnurl = viewbag.returnurl }, formmethod.post, new { @class = "form-horizontal", role = "form" })) { @html.antiforgerytoken() <hr /> @html.validationsummary(true) <div class="form-group"> <table class...

c# - Error CS0436 : a resource has conflict with itself if the resource and caller is in a same folder -

i have class named " basehelper " in " app_code " folder. class contains few static methods use in projects give me functionalities have write multiple lines of code use functionality. now problem have few other helper methods in folder. there no problem using class' helper methods in whole project when want use methods in other helper methods in " app_code " folder warning this: warning cs0436 type 'basehelper' in 'c:\users[username]\documents\visual studio 2015...\app_code\basehelper.cs' conflicts imported type 'basehelper' in '[project name], version=1.0.0.0, culture=neutral, publickeytoken=null'. using type defined in 'c:\users[username]\documents\visual studio 2015...\app_code\basehelper.cs'. c:\users[username]\documents\visual studio 2015\projects...\app_code\sitemanager.cs and once more should emphasize problem present when want use helper methods in same folder not when wan...

jpa - Storing some class fields in more than one table simultaneously using hibernate -

how should design classes store fields of class in more 1 table. class child { private int id; private string name; private int age; private string favgame; } i want create 2 tables- table 1 : containing id, name, age , favgame table 2 : name , age also want referential integrity between these 2 tables, whenever record created/updated/deleted in table1, table2 should updated. i have seen @secondarytable concept in following link https://www.youtube.com/watch?v=f3bct8tkfcs but not provide option store field in 2 tables simultaneously. please suggest. in advance.

c++ - MSVS 2015 Profile Guided Optimization - Deploy Instrument Build on Various Machines -

i perform following: build instrumented pgo exe using msvs 2015 ide copy generated exe along .pgd file several other machines run exe command line on machines. note these machines not have msvs compiler on them. currently, can run exe on machine compiled on , through ide option build->profile guided optimization->run instrumented/optimized application. if try run through command line (on of machines), following error: the application unable start correctly (0xc00007b) could please let me know if trying possible , steps make work if is? thanks. to pgo instrumented version run on remote machines, had install msvs 2015 redistributable package use correct pgort140.dll. on local machine had following versions: c:\program files (x86)\microsoft visual studio 14.0\vc\bin\pgort140.dll (49 kb) c:\program files (x86)\microsoft visual studio 14.0\vc\bin\amd64\pgort140.dll (55 kb) c:\program files (x86)\microsoft visual studio 14.0\vc\bin\arm\pgort140.dll (49...

Black screen when emulating Linux kernel -

i'am trying build linux arm (versatile board) , emulate using qemu: i folowed folowing tutorial after downloading qemu , arm-linux-gnueab toolchain steps basically: make -c build arch=arm distclean make -c build arch=arm versatile_defconfig make -c build arch=arm cross_compile=arm-none-linux-gnueabi- qemu-system-arm -m versatileab -m 256m -kernel build/arch/arm/boot/zimage -append "console=ttys0" -serial stdio -dtb build/arch/arm/boot/dts/versatile-ab.dtb what black sreen cursor @ top , following messages: pulseaudio: set_sink_input_volume() failed pulseaudio: reason: invalid argument pulseaudio: set_sink_input_mute() failed pulseaudio: reason: invalid argument uncompressing linux... done, booting kernel. vpb_sic_write: bad register offset 0x2c i'am not sure problem come from: bad configuration of kernel ?, dtb ?; messages don't give lot of informations so suggestions welcome qemu version: qemu-system-arm --version qemu emulator version ...

database - Not suitable driver - Android Studio -

Image
i have problem android studio, while trying connect sap hana database. i based on guide i've found here: https://help.sap.com/viewer/0eec0d68141541d1b07893a39944924e/2.0.00/en-us/ff15928cf5594d78b841fbbe649f04b4.html firstly wanted check if work on inteljj. , worked, decided to same in android studio. unfortunatelly when i'm debugging application receive information, "not suitable driver" has found. my next steps to: right click on app ->module -> import ndbc jar package. then in module settings: app ->dependencies->+->module->ndbc jar. unfortunatelly solution doesn't work. i grateful ideas cause issue.

Airflow SLA miss implementation -

i new airflow , trying implement sla miss functionality in dag default_args = { 'owner': 'airflow', 'depends_on_past': false, 'start_date': datetime(2017,07,24), 'email': ['jspsai@gmail.com'], 'email_on_failure': false, 'email_on_retry': false, 'retries': 5, 'retry_delay': timedelta(minutes=5), 'sla':timedelta(seconds=30), 'pool':'demo', 'queue':'slaq', 'run_as_user':'ec2-user' } but sla not applied , not able figure out issue is i gave sla @ task level no luck. any appreciated. thanks

Fortran - lbound throws error 6366 "The shapes of the array expressions do not conform" -

so i've been confounded again fortran. go figure. anyway, i'm trying write pretty simple routine strips values off end of array. complicated works fine, except want write subroutine such don't have pass lower bound of input array it. here subroutine: subroutine strip(list,lstart, index) implicit none integer :: i, index, isize, tsize, lstart, istart real, dimension(:), allocatable, intent(inout) :: list real, dimension(:), allocatable :: tlist isize = size(list) tsize = index-1 print *, 'index', index print *, 'isize', isize print*, 'lbound', int(lbound(list)) print*, 'tsize', tsize istart = lbound(list) !<---- lines throws error !these commented out because below here works !allocate(tlist(lstart:tsize)) !tlist = list(lstart:index-1) !deallocate(list) ...

pyspark sql - in SQL, why is this JOIN returning the key column twice? -

i'm sorry if stupid question, can't seem head around it. i'm new sql , behavior strange in r or pandas or other things i'm used using. basically, have 2 tables in 2 different databases, common key user_id . want join columns with select * db1.first_table t1 join db2.second_table t2 on t1.user_id = t2.user_id great, works. except there 2 (identical) columns called user_id . wouldn't matter, except doing in pyspark , when try export joined table flat file error 2 of columns have same name. there work-arounds this, i'm wondering if can explain why join returns both user_id columns. seems inner join definition columns identical. why return both? as side question, there easy way avoid behavior? thanks in advance! select * returns columns tables of query. includes both user_id columns - 1 table a, 1 table b. the best practice list column names want returned specifically, though option shorten list be: select tablea.*, tableb.c...

c# - How can I conditionally hide the TabPanel portion of a TabControl in its entirety? -

i've found lot of variations of question, conversation seems revolve around individual tabitems , , not tabpanel thing unto itself. my main window has tabcontrol on it. tabs views. 1 of views special...a navigation display, whereas of others "sections" nav view can open. what trying accomplish when user viewing nav view, tabs go away. i.e. hide whole tabpanel instead of having hide each tabitem one-by-one. while viewing other page, tabs show, easy movement between views. i created question in response suggestion made on my other question . the problem have tabpanel not seem have template can override in order datatrigger bound visibility property. closest have gotten plain old style.setter . any suggestions on how after? you provided answer - right combination use style datatrigger . trick define style targettype set {x:type tabpanel} , , put resource of tabcontrol - way style applied tabpanel (because it's implicit style ). he...

javascript - Difference between `x in y` vs `y[x]` -

using javascript, there difference in terms of performance or behavior between let foo = { a: true, b: false, c: true } 'c' in foo , foo['c'] ? always wondered that, not sure how search answer. obvious difference foo['c'] return false if 'c' points falsy value, 'c' in foo return true if foo has key 'c'. the reason ask question: in many cases want store key (for quick search) , not care value: let foo = { // keys important, values of no consequence a: undefined, b: undefined, c: undefined } i wondering if best practice store keys, without assigning value. if(!('a' in foo)){ foo['a'] = undefined; } it seems strange give hash values, when don't need use values, need store key. you answer own question the obvious difference foo['c'] return false if 'c' points falsy value, 'c' in foo return true if foo has key 'c'. ...

mediawiki - Wikimedia Commons query stopped working -

i had url photo searches on wikimedia commons : https://commons.wikimedia.org/w/api.php? action=query& prop=imageinfo|categories& generator=search& gimlimit=10& gsrsearch=file:"${title}"& iiprop=extmetadata|url& iiextmetadatafilter=imagedescription|objectname& gsrnamespace=6& format=json& origin=* where ${title} search term. working beautifully. of sudden stopped working. error: unrecognized parameter: gimlimit i tried taking parameter out , nothing gets returned @ all. used work. has changed? parameter names ['g' generator][module prefix][base parameter name] . if want limit number of search results, gsrlimit . if want limit number of image revisions return info per search result, iilimit (it defaults 1 though don't need change it). as can see own link, go results (and removing gimlimit not change anything, beyond warning not showing up).

VBA Dynamic Save As, Microsoft Project to Excel -

i trying create macro export microsoft project file excel file. through use of macro recording have got line of code accomplishes using export wizard, want file path , file name dynamic can use macro on different projects. have been searching many other threads , microsoft website no luck. possible? here have: sub formatandsave () filesaveas name:="c:\users\xxxxxx\sharepoint\projects\projecttype\hxh\myproject.xlsx",_ formatid:="msproject.ace", map:="mymap" end sub one idea tried was: active.workbook.saveas filename:=title any appreciated! for sake of simplicity, let's assume answers below project located @ c:\projects\myproj.mpp i think you're after string replace function. like: dim excelfilepath string excelfilepath = replace(activeproject.fullname, ".mpp", ".xlsx") debug.print excelfilepath 'the output c:\projects\myproj.xlsx if you're unfamiliar string manipula...

python - Pyomo constraints for specific range -

following part optimization code i'm trying run. >from pyomo.environ import * >model = concretemodel() >## define sets >model.k = set(initialize=['diesel','diesel_hybrid', 'battery_electric'], doc='vehicle type') >model.i = set(initialize=[0,1,2,3,4,5], doc='age') >model.t = set(initialize=[2018,2019,2020,2021,2022,2023], doc='years') >## define variables >model.p = var(model.k, model.t, bounds=(0,none), doc='number of k type vehicle purchased in year t') >model.a = var(model.k, model.i, model.t, bounds=(0,none), doc='number of k type year old bus in use @ end of year t') >model.r = var(model.k, model.i, model.t, bounds=(0,20), doc='number of k type year old bus salvaged @ year t') i'm trying write constraint says, age of bus i<=4, salvaged number of buses r[k,i,t] = 0 tried following. doesn't seem work. >def constraint_5(model,k,t): > if (i<=4)...

c# - Can't get around ImageResizer error: File may be corrupted, empty, or may contain a PNG image with a single dimension greater than 65,535 pixels -

not sure i'm missing. trying take jpg simple input[type=file] post , scrub 2 versions (1800x1800) , (400x400). code: stream.position = 0;//probably need 1 of these lines stream.seek(0, seekorigin.begin);//i've tried both no avail imagejob job = new imagejob(stream, origstream, new instructions("maxwidth=1800&maxheight=1800")).build(); throws: file may corrupted, empty, or may contain png image single dimension greater 65,535 pixels. stream comes context.request.inputstream i'm passing through method call. , other memorystream origstream = new memorystream() wrapped using i've read through of docs , of other posts reference error. of ones found on reference using plugin, i'm using no plugins. my best guess i'm missing configuration imageresizer work, haven't been able find yet. ps able save file if skip image processing step, image stream good, can't use imageresizer change it. problem in input stream....

Calling batch file that calls python script that uses parameter defined in initial batch file -

this question has answer here: how read/process command line arguments? 16 answers i've 2 batch files, a.bat , b.bat, python script c.py a.bat looks this: call b.bat hello now of course, if use %1 in b.bat, batch file view value "hello". now, if have b.bat call c.py, need c.py able recognize %1 hello, same way b.bat recognizes that. of course, i've tried writing in b.bat: call c.py %1 and using %1 in c.py in batch file, did not work. don't know if means can't use %1 parameter or if can't use parameter of type in python, or both. so, how able use parameter in c.py defined in a.bat? to access parameters in python, use: import sys print(sys.argv[1]) # view first parameter, similar %1 in .bat ref: https://docs.python.org/3/library/sys.html#sys.argv

html - Making an image inside a figure a link - image size changes -

hi when wrap image anchor image becomes small. have image inside of figure , using flex-box, not sure how keep image size changing. .foo{ display:flex; flex-direction:row; justify-content:space-around; } <figure class="foo"> <a href="#"><img src="#"></a> <a href="#"><img src="#"></a> <a href="#"><img src="#"></a> </figure> you can add css img tags inside foo class. gave 100px height , width each img . .foo{ display:flex; flex-direction:row; justify-content:space-around; } .foo img{ height:100px; width:100px; } <figure class="foo"> <a href="#"><img src="https://i.stack.imgur.com/ce5lz.png"></a> <a href="#"><img src="https://i.stack.imgur.com/ce5lz.png"></a> <a href="#"><img src="ht...

Why Android View class has 'outValues style' getters for handful of properties? -

you can view properties height , alpha , id , matrix , drawingtime or elevation using standard getters (like getheight() , getalpha() , getid() ...). but then, have of view's properties (most of them point or rect return type) locationinwindow , globalvisiblerect , locationinscreen , drawingrect , drawingcache hidden under getters forcing create returning objects beforehand empty constructor, , pass objects getter parameter data being 'saved' them. example of getter globalvisiblerect : public final boolean getglobalvisiblerect(rect r) forces (kotlin): val rect = rect() getglobalvisiblerect(rect) dosomestuffwithrect(rect) it's not consistent, nor debuggable in realtime expressions tab in android studio , it's cumbersome, really. why done way? see of methods returning false boolean value if view not visible, know returned data invalid, shouldn't solved returning null value, if method knows produced unusable information? on other hand, getlo...

sql - Select closest match -

i trying merge 2 tables (pc mc), statement below yield multiple records mc. i'd query return match in mc cast(pc.ten date) - cast(mc.to date) positive small possible. how do that? create table test select distinct pc.number, mc.number pc inner join mc on pc.member = mc.member , pc.ned = mc.ned , cast(pc.ten date) between cast(mc.to date) + 1 , cast(mc.to date) + 11 , pc.ned not null , mc.ned not null; create or replace view test select n1, n2 ( select pc.number n1, mc.number n2, row_number() on (order cast(pc.ten date) - cast(mc.to date) asc) rank pc inner join mc on pc.member = mc.member , pc.ned = mc.ned cast(pc.ten date) - cast(mc.to date) > 0 ) rank = 1

apache - Rewriting Query string values -

i have url this https://hello.co.uk/foo?page_uri=/eggs/1979&other_url=https://twitter.com/ i need rewrite page_uri value, if contains /eggs/ /cake/ resulting url https://hello.co.uk/foo?page_uri=/cake/1979&other_url=https://twitter.com/ i thought rewriterule ^(.*)/eggs/(.*)$ $1/cake/$2 would work, ignores query strings. possible this, doesnt matter order of query parameters, swaps out word?

object - c++ dependency injection and more complex structures -

i'm trying understand di , separation of object construction , logic, have problems implementation in cases. here example. class { public: void load_bs(); // create bs , push them bs_ vector // , call load_cs on every created b private: std::vector<b> bs_; }; class b // not need reference real work { public: void load_cs(); // create cs , push them cs_ vector private: std::vector<c> cs_; }; class c // needs , b { public: c(a &a, b &b) : a_(a), b_(b) {} private: &a_; b &b_; }; how can construct structure according di? first create instance of class, call load_bs() method , create b objects, it's time create c objects in b instance. since should inject object dependencies needed object, not pass through use in object, reference inside b during c creation? mean c should created somewhere else , passed b? when inject dependency injected else real hard refactoring when 1 of these dependencies sh...