Posts

javascript - Types of conversion of images -

i converting images base64 , sending them websocket. using javacript: var reader = new filereader(); reader.onload = (function(aimg){ return function(e){ aimg.src = e.target.result; imagemessage = aimg.src; }; }(image)) var ret = reader.readasdataurl(file); in socket server string: data:image/jpeg;base64,/9j/4aaqskzjrgabaqeayabgaad/4rfgrxhpzgaatu0akgaaaagacaeyaaiaaaauaaaiege7aaiaaaahaaaijkdgaamaaaabaamaaedjaamaaaabadiaaikyaaiaaaahaaailodpaaqaaaabaaaiujydaaeaaaaoaaarmoocaacaaagmaaaabgaaaaac6gaaaagaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.........

java - call a parameterized Junit test case from main method -

class containing test case public class seleniumtestcaseparameterized { webdriver driver; private string username, password, baseurl; public seleniumtestcaseparameterized(string username, string password) { this.username = username; this.password = password; } @before public void setup() { } @test public void testseleniumtestcaseparameterized() throws exception { driver.get(baseurl + "url"); driver.findelement(by.id("username")).sendkeys(username); driver.findelement(by.id("password")).sendkeys(password); } @after public void teardown() { driver.quit(); } class test case called in main method public class mainclass { public static void main(string[] args) { string name =joptionpane.showinputdialog("please enter username"); seleniumtestcaseparameterized c = new seleniumtestcaseparameterized(name,name); junit.textui.testrunner.run(c.getclass()); } i unable pass parameters test case...

tfsbuild - TFS Online build server post build scripts not available -

Image
according this link , there option add powershell scripts build via post build script path property. to invoke our script front-end build tasks (clientcompile.bat), need configure build process. open ‘process’ tab , expand section ‘5. advanced’ inside build section. we’re going provide ‘post-build script’ information. script executed on build infrastructure after source code has been compiled, hence post-build. i'm using tfs online , have 3 sections, '3. advanced' , no option enter post-build script information. how can option available? available on online tfs build? build process parameters surfaced build process template. build process templates in existing projects don't upgraded because of potential break customizations, that's why you're not seeing new parameters. new build process template, create new team project, create new build definition , download process tab. alternatively, i've uploaded here . once you'...

objective c - iOS UITableView content offset not working in iOS7 -

in app have search bar in header of my uitableview . tried set content offset uitableview hiding search bar giving me problems. finally solved this: - (void)viewwillappear:(bool)animated { [self performselector:@selector(hidesearchbar) withobject:nil afterdelay:0.0f]; } - (void)hidesearchbar { self.tblview.contentoffset = cgpointmake(0, 40); } the problem works ios 8. how can achieve correctly work both ios 7 & 8 ???? sorry poor english. in advance. if set header self.tblview.tableheaderview = yoursearchbar (recommended way),try self.tblview.tableheaderview = nil; or self.tblview.tableheaderview = [[uiview alloc] initwithframe:cgrectzero]; to hide it. ps. yoursearchbar should instance variable or property displayed conveniently in future.

c# - How can I edit controls inside master page? -

in short want edit controls inside master page in .net framework content page during design time. because in content page during design time master page controls not accessible content page question is: how can make master page controls accessible content page during design time? possible or not? in advance i think can't edit them in derived page. not make sense. can edit them in master page in designer, , can still change master page's control in derived page's codebehind @ runtime.

linux - make: nothing can be done for all -

i'm trying run make using makefile below command line. receive following error make: nothing can done all . contents of makefile given below. generated_files = \ dw.js/dw-2.0.js \ www/static/css/datawrapper.css \ www/static/css/chart.base.css all: $(generated_files) clean: rm -f -- $(generated_files) dw.js/dw-2.0.js: dw.js/src/*.js cd dw.js grunt assets: www/static/css/datawrapper.css www/static/css/chart.base.css # www/static/js/dw-2.0.js: dw.js/dw-2.0.js # @cp dw.js/dw-2.0.js www/static/js/ # www/static/js/dw-2.0.min.js: dw.js/dw-2.0.js # @php -r "require 'vendor/autoload.php'; file_put_contents('www/static/js/dw-2.0.min.js', \jshrink\minifier::minify(file_get_contents('dw.js/dw-2.0.js')));" messages: scripts/update-messages.sh www/static/css/datawrapper.css: assets/styles/datawrapper/* assets/styles/datawrapper/**/* node_modules/.bin/lessc assets/styles/datawrapper/main.less > $@ www/stati...

Searching an element of array type struct in c -

i have array of structures store basic informations pc within company (code,model,connected internet). typedef struct database{ char code[5]; char brand[20]; char model[20]; int lab; int connect; }database; now want search through array find pc coresponding code c01a here little example of info stored in struct: c01a hp sjh1740 1 0 b02a hp sj1290 3 1 a03b dell pq240 2 1 a02b dell pq240 3 1 c09h fujitsu np0001 1 0 a06d dell pq240 3 1 c00x fujitsu lp1050 2 0 b89a hp sj1290 3 1 a03f dell pt1000 2 0 c12p hp aa0012 1 1 d01d dell bb2300h 3 0 you can see first pc has code c01a . here see 11 pc's randomly picked file in there can millions of pc's (imagine big company, array able hold 10 million pc's because can). i search every single element in array until find right one. (using quick calculation dunno if it's ok). means have scroll trough 10.5mb of memory, quite lot if searching process not optimalized. so came this: step 1: sort arr...