Posts

vb.net - Loop through folders and only copy files that match certain criteria -

i writing program copies files needed 1 folder another. however, want copy files fit criteria, more specifically, should copy files not in banned files, banned extensions, or banned folders list stored in array this: public bannedextensions string() = {".bak", ".bak2", ".cry", ".max", ".psd", "log", ".lib", "pdb", ".exp"} public bannedfolders string() = {"tools", "editor", "code", "logbackups", "statoscope", "bintemp", "user", "rc"} public bannedfiles string() = {"editor.exe", "error.bmp", "error.dmp", "luac.out", "tags.txt"} the code should move them temporary directory , zip them , save them location stored in file_name variable. this code whole: option strict on public class form1 'define 2 variables used tracking file nam...

javascript - Load image from a url and convert it to a base64string -

this question has answer here: how convert image base64 string using javascript 8 answers i trying load image url , convert base64 string. all string when use html source of image, images blank. what doing wrong? function getbase64image(imgurl) { var image = new image(); var canvas = document.createelement("canvas"); var context = canvas.getcontext('2d'); image.src = imgurl; context.drawimage(image,0,0); return canvas.todataurl(); } the function returns string. thank you. simple way that: $image = file_get_content($url); $result = "data:image/png;base64,". base64_encode($image);

java - Newly opened window is not getting preferences from parent window in selenium webdriver -

i'm automating application having digestive authentication process. 1 window, when clicking on particular link new window have digestive authentication. i'm using firefox browser automation. when system profile, it's working fine, when use custom profile selenium, it's not automatically authenticated. suspect preferences parent window not shared new window. can me on ? you need make sure window opening in profile need to. if isn't, idea go through , check webdriver settings connected correct profile. if correct, ensure settings within custom firefox profile exact same ones within system profile. you can check profile running in terminal: firefox -p this should open profile manager. hope i've helped :)

How to search for lines in a file between two timestamps using Bash -

in bash trying read log file , print lines have timestamp between 2 specific times. time format hh:mm:ss. example, searching lines fall between 12:52:33 12:59:33. i want use regular expression becouse can use in grep function. each logline begins some_nr 2014-05-15 21:58:00,000000 rest_of_line . my solution gives me lines 1 min margin. cut out ss , take lines hh:mm:[0-9]{2} . $2 has format filename_hh:mm:; example: "24249_16:05:;24249_16:05:;24249_16:07:;24249_16:07:;24249_16:08:" my code: b=$2 line in ${b//;/ } ; tent=`echo $line | awk '{split($0,numbers,"_"); print numbers[1]}'`"_logs.txt" time=`echo $line | awk '{split($0,numbers,"_"); print numbers[2]}'`"[0-9]{2}" grep -ie ${time} ${tent} >> ${file1} done i need solution 15 sec margin time not 60. want have input in format filename_hh:mm:ss , take lines hh:mm:ss +/- 15s or filename_hh:mm:ss(1)_hh:mm:ss(2) , take lines betw...

Integrating QTP Script in teamcity -

i'm trying add qtp script team's build steps in team city. i've tried searching web didn't find anything. does know if possible? if possible, how achieve this? thanks. i not experience team city, wanted offer suggestion since have not had other feedback yet. answer question same type of integration... have use qtp api execute tests , pull results. hp provides little direct support integrating tools outside of own, have use api build integrations. if use quality center/alm, set test set of build validation tests executed using api qc/alm instead.

sparql - Querying an Open RDF Repository -

i trying query open rdf repository loaded turtle file. when selecting query - "select ?s { ?s ?p ?o } "; working fine when using little complex query not working. attaching code query portion - private static void queryingrdf(repository repo) { try{ repositoryconnection con = repo.getconnection(); try{ string querystring = "select ?s { ?s uml:lineofbusiness cp:lobequities .}" ; tuplequery tuplequery = con.preparetuplequery(querylanguage.sparql, querystring); tuplequeryresult result = tuplequery.evaluate(); try { while(result.hasnext()){ bindingset bindingset = result.next(); value valueofx = bindingset.getvalue("s"); //value valueofy = bindingset.getvalue("p"); //value valueofz = bindingset.getvalue("o"); //system.out....

Add A Value to Rows And Cells In WPF -

i developing program datagridview. need adding values rows , cells: my code: (int = 0; < 0x18; i++) { this.dataview1.updatedefaultstyle(); this.dataview1.rows[i].cells[0].value = i; this._dataview1[i].cells[1].value = getname(i); application.doevents(); } it dont work error:system.windows.controls.datagrid not contain rows. same error cells. works fine in c#. wpf code; <grid background="#ffe5e5e5"> <datagrid x:name="dataview1" horizontalalignment="left" verticalalignment="top" height="337" width="809"> <datagrid.columns> <datagridtextcolumn binding="{x:null}" clipboardcontentbinding="{x:null}" header="client"/> <datagridtextcolumn binding="{x:null}" clipboardcontentbinding="{x:null}" header="name"/> ...