Posts

Showing posts from July, 2015

jQuery throws out a wrong number? -

i'm working on simple roulette wheel using jquery. i can spin wheel using jquery want strange reason jquery code spits out wrong number! here code: jquery code: <script type="text/javascript">//<![cdata[ $(function(){ window.wheeloffortune = { cache: {}, init: function () { console.log('controller init...'); var _this = this; this.cache.wheel = $('.wheel'); this.cache.wheelmarker = $('.marker'); this.cache.wheelspinbtn = $('.wheel'); //mapping backwards wheel spins clockwise //1=win this.cache.wheelmapping = [5,24,16,33,1,20,14,31,9,22,18,29,7,28,12,35,3,26,0,32,15,19,4,21,2,25,17,34,6,27,13,36,11,30,8,23,10].reverse(); this.cache.wheelspinbtn.on('click', function (e) { e.preventdefault(); if (!

php - PHPUnit error undefined variable -

i'm running phpunit test zf2 application. tried on windows machine (under xampp), , worked fine. when moved virtual ubuntu 14.10 server, keep getting following error every test: undefined variable: services i went /etc/php5/cli/php.ini , set error reporting follows: error_reporting = e_all & ~e_deprecated & ~e_strict & ~e_notice the code tests pointing 1 of module.php files public function onbootstrap(mvcevent $event) { $sharedeventmanager = $event->getapplication() ->geteventmanager() ->getsharedmanager(); $sharedeventmanager->attach('user', 'log-fail', function($event) use ($services) { $username = $event->getparam('username'); $log = $services->get('log'); $log->warn("error logging user [$username]"); }); } it's complaining line $sharedeventmanager->attach('user', 'log-fail', function($event) use ($services) . s

How to create multiple drop pane on same page using filepicker.io -

basically have table , each rows have image icon want turn drop pane. example code helpful. working example: http://jsfiddle.net/krystiangw/mb4o7kfc/1/ js file: $('td').each(function(e, element){ filepicker.makedroppane( element, { multiple: true, dragenter: function() { $(element).html("drop upload").css({ 'backgroundcolor': "#e0e0e0", 'border': "1px solid #000" }); }, dragleave: function() { $(element).html("drop files here").css({ 'backgroundcolor': "#f6f6f6", 'border': "1px dashed #666" }); }, onsuccess: function(blobs) { $(element).text(json.stringify(blobs)); }, onerror: function(type, message) { $(element).text('('+type+') &#

How to create Firefox Extension to send active tab URL to its Native, similar to chrome native messaging and install it through msi -

i have developed c# win form application , chrome extension native messaging (another c# console app) fetch user's active tab url. have developed msi setup in wix write under registry (hklm/software/wow6432node/google/chrome/extensions , hklm\software\wow6432node\google\chrome\nativemessaginghosts) programmatically , tested installation of chrome extension running setup on different windows 7 machines. publishing extension on chrome web store , shall install extension on several client computers. i want accomplish same mozilla firefox. newbie in field , going through firefox developers guides ( xpcom , js-ctypes etc.) , getting little confused multiple links. it of great if can guide me towards exact solution. please note that, 1) have install extension programmatically through same msi package contains own c# app , chrome extension native app , 2) client machines windows version (xp (optional), 7, 8, server anything). edit: according noitidart's answer, have made

vb.net - Binding Navigator Navigation Mixed -

i have sdf database setup. problem comes when click movenext button. when keep moving through records goes in order: 23, 24, 25, 32 , 26, 27, 28, 29, 30, 31, 33, 34... , on. supposed 25, 26, 27, 28, 29, 30, 31, 32.. , on right? these numbers auto generated record id incremented every new record when view records in datagridview order good. ideas how can resolve this? update sorry late reply. have been trying create alternative route record navigation goes in order of id number. have created variable cur_navid current records id saved. every time next or previous buttons pressed next record in order displayed. thousands of record method tends bit vague. anyways heres main codes here code for: new record private sub newrecord() if not isediting = true enable_edit() id += 1 me.bindingnavigatoraddnewitem.performclick() cust_nametextbox.clear() contacttextbox.clear() remtextbox.clear() gradetextbox.clear()

MongoDb unable to insert documents using Java Driver in sharded env -

when try connect mongo db sharded @ key "state" via jdbc, , insert document, says missing shardkey my shards (2 no, part of individual replica sets) , config servers (1 no, part of replica set)are , running, , can insert document using mongos terminal, cant insert documents using java driver. mongodb version 2.6.5. package dao; import util.instancefactory; import com.mongodb.db; import com.mongodb.mongoclient; import org.apache.log4j.logger; public class mongoconnector { private static mongoconnector mongoconnectorinstance; private db dbconnection; public static db getconnection(string dbname) { mongoconnector.mongoconnectorinstance = instancefactory.instantiateassingleton(mongoconnector.class); if (mongoconnector.mongoconnectorinstance.dbconnection == null) { synchronized (mongoconnector.mongoconnectorinstance) { if (mongoconnector.mongoconnectorinstance.dbconnection == null) { mongoconnector.mongoconnectorinstance.dbconnection = mong

android - Is this way of fetching data from sqlite correct? -

i using query fetch data sqlite 1 condition working not 2 @ same time. i getting notification no such column exist. string lquery = "select sum(totalcalorie) ltotal fooditem name = ('" + fname + "') , foodtype = 'lunch'"; you might having null values on places checking while calling.. go through code again queries seems write.

Grails[Groovy],How to get list of all methods a class has with out those inherited? -

i using collect methods class has: grailsapplication.getmaincontext().getbean("classname").metaclass.methods*.name but returns methods including inherited ones , how can filter methods owned class ? this give list of method names filtered include methods belonging declaring class( someclass in example): someclass sc = new someclass() list<string> declaringclassonlymethods = sc.metaclass.methods.findall { metamethod method -> if(method.declaringclass.name == sc.class.name) { method.name } }

mysql - Update data in database using SQL -

i have 1 table in database. field of table describe below. id | name | qualification 1 | abc | phd 2 | xyz | mba 3 | ads | mba now problem related update qualification record. suppose if update record of qualification, should append new value existing value. for example, going update record of id=1. update "qualification" mca should add mca existing record phd , separated comma. output looks below. id | name | qualification 1 | abc | phd,mca 2 | xyz | mba 3 | ads | mba when "qualification" null update should not add comma before mca. thats bad database design never store data comma separated string, make things messy in future. you should think of normalizing table student table should like - id primary key auto_incremented - name - other columns related student then table student_qualification - id primary key auto_incremented - id_student ( id student table) - qualification so each student can add many qualificat

Saving data from a drop down list in CodeIgniter -

i created menu page has drop down menu list of menus database , has textbox enter new menus. the problem i'm having can't seem figure out how save dropdown. example have menu called "about us" in drop down list , want create new menu called "team", , "team" child of "about us" so in table have this id | parent | title ------------------------ 1 | null | 2 | 1 | team menu controller function get_data_from_post() { $data['title'] = $this->input->post('title', true); $data['parent'] = $this->input->post('parent', true); if(!isset($data)){ $data = ''; } return $data; } function get_data_from_db($update_id) { $query = $this->get_where($update_id); foreach($query->result() $row){ $data['title'] = $row->title; $data['parent'] = $row->parent; } return $data; } function create(

javascript - Use zone.js to detect current execution context from anywhere? -

Image
with zone.js possible determine current execution context anywhere ? ie., if zone-bound function calls function calls settimeout(myfn) can determine current execution context within myfn() ? if so, please provide simple example of how so. every time fork() zone , accessing zone object within zone 's context return forked zone . the following experiment demonstrates behavior: var b = function() { console.log('-->',zone) }; var = function() { settimeout(b,5); }; zone.fork().run(function() { zone.x = 'hi'; a(); }); settimeout(function() { console.log('==>', zone); }, 1); settimeout(function() { console.log('==>', zone); }, 10); here's happens when paste console:

play video from android internal storage -

i'm trying play video files stored in android internal memory through intent. files exist there when try play them through intent, give me error "media file not supported" or "can't play video" depending on device. couldn't find i'm wrong. here code file mydir = activity.getdir("videos", context.mode_private); file filewithinmydir = new file(mydir, filename); string videoresource = filewithinmydir.getpath(); uri intenturi = uri.parse(videoresource); intent intent = new intent(); intent.setaction(intent.action_view); intent.setflags(intent.flag_activity_new_task); intent.setdataandtype(intenturi, "video/mp4"); startactivity(intent); i don't know i'm wrong , should do. appreciated. thank :) thank friends participation, efforts appreciated. i'v found solution of problem. there need set file read true before playing it. filewithinmydir.setreadable(true, false); now here complete code of intent play mp

javascript - Click link and Insert text from hidden field into input field, more than 1 time and replace the text in the input field -

click link , insert text hidden field input field, more 1 time , replace text in input field. now code can insert text when input field empty, want replace text if click "testname" button anyone can me? doesn't matter if javascript/jquery <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <script type="text/javascript"> function setsearch(val, search) { $('input[id ^="searchform"]').each(function (index) { var s = "searchform" + search; if ($(this).attr("id") == s) { $(this).attr("value", val); return false; } }); } </script> <a href="javascript:setsearch ( $('#name').attr('value'), 'name' );"> testname </a> <input id="name" name="name" type="hidden" value="testname" /> name <input name="name" type="text" i

html - How can I right-align the css tabs' navigation buttons? -

the link below live demo , codes. how can move tab buttons right? fiddle .tabs { width: 100%; overflow: auto } .tabs li.tab { float: none; display: inline; } .tabs input[type="radio"] { display: none; } .tabs .tab>label { padding: 8px; border-radius: 5px 5px 0 0; border: 1px solid #ddd; cursor: pointer; top: 0; z-index: 3; background-color: #eee; } .tabs .tab-content { z-index: 2; display: none; float: left; padding: 1em; left: 0; border: 1px solid #ddd; margin-top: 8px; min-width: 90%; } .tabs [id^="tab"]:checked + label { background-color: #fff; border-bottom: 1px solid #fff; } .tabs [id^="tab"]:checked ~ [id^="tab-content"] { display: block; } apply text-align: right ul element. .tabs > ul { text-align: right; } .tabs li.tab { text-align: left; /* normalizing */ float: none; display: inline; } working fidd

How to bind events in jquery plugin without overriding existing methods for same events -

here custom plugin $.fn.custom = function() { create: {//some code}, close: {//some code}, open: {//some code}, onclick: {//base on click event handler} } now when use plugin as someele.custom({ onclick:{//how write separate definition here} }).custom('open')

validation - How to start validating php form only after I clicked submit -

i new php , web development. trying simple validation of text field. want display red remark beside text field after submit button clicked. however problem here is: php codes validates input field moment page loaded. how validate after user clicked submit button? <form method="post" action="<?php echo htmlspecialchars($_server["php_self"]);?>"> name <input type='text' name='name' /><br> email <input type='text' name='email' /><br> age<input type='text' name='age' /><br> <input type='submit' name='done' /><br><br> </form> <?php if(empty($post['name'])) echo '<font color="red">please enter name.</font>'; if(empty($post['email'])) echo '<font color="red">please enter email.</font>';

php - Laravel Mail::send how to pass data to mail View -

how can pass data controller customized mail view ? here's controller 's send mail method : $data = array($user->pidm, $user->password); mail::send('emails.auth.registration', $data , function($message){ $message->to(input::get('email'), 'itsfromme') ->subject('thisismysucject'); here's emails.auth.registration view <p>you can login our system using login code , password :</p> <p><b>your login code :</b></p> <!-- want put $data value here !--> <p><b>your password :</b></p> <!--i want put $password value here !--> <p><b>click here login :</b>&nbsp;www.mydomain.com/login</p> thanks in advance. send data this. $data = [ 'data' => $user->pidm, 'password' => $user->password ]; you can access directly $data , $password in email blade

ios - NSUrl from NSString returns null -

i want parse location of documents directory nsurl nsstring have. when console nslog(stringurl) i get: "/var/mobile/applications/2b35d06d-6e4a-40f2-833e-28463a946834/library/application support/myappdirectory" output. but when do nsurl* url = [nsurl urlwithstring:stringurl]; and nslog(url) (null) output. what doing wrong here? from apple documentation "an nsurl object initialized urlstring. if url string malformed or nil, returns nil." stringurl isn't correct formed url. reference: https://developer.apple.com/library/mac/documentation/cocoa/reference/foundation/classes/nsurl_class/reference/reference.html#//apple_ref/occ/clm/nsurl/urlwithstring : what want use is: fileurlwithpath: isdirectory: instead. nsurl *url = [nsurl fileurlwithstring:[stringurl stringbyaddingpercentescapesusingencoding:nsutf8stringencoding] isdirectory:yes]; nslog(@"%@", url);

json - Decode base64 image into BLOB with PL/SQL -

i'm using script below in order fetch json file mongodb, parse , insert oracle table. the script works fine in sense inserts values correctly oracle table. includes value photo image of base64 formate , larger 32kb. the column photo in table appery_photos of type clob while column decodedphoto of type blob. the problem lies in line bloboriginal := base64decode1(photo); used decode clob blob. function base64decode1 has been replaced several functions (i.e. decode_base64 , base64decodeclobasblob_plsql , base64decode , from_base64 & json_ext.decode ). the result same of them. is, resultant blob object cannot openned image in of images editors (i'm using oracle sql developer download it). i checked clob, , not find newlines \n , nor find spaces (only + signs found). furthermore, inserted clob value base64-image-converter , displays image correctly. in addition, tried encode resultant blob in base64 in order further validate (using opposite functions provid

orm - JDBI like layer for cassandra -

i developing module having cassandra backend. searching jdbi sort of library cassandra. cassandra java driver primary option. know if there exists library higher level abstraction on top of cassandra java driver. the latest java driver comes object mapping api. basically, can annotate java class: @table(keyspace = "complex", name = "accounts") public class account { @partitionkey private string email; private string name; @column (name = "addr") @frozen private address address; then can perform typical crud operations this: mapper<account> mapper = new mappingmanager(getsession()).mapper(account.class); phone phone = new phone("home", "707-555-3537"); list<phone> phones = new arraylist<phone>(); phones.add(phone); address address = new address("25800 arnold drive", "sonoma", 95476, phones); account account = new account("john doe", "jd@exam

javascript - Not able to get serialized Array of Kendo UI Form -

i have simple form, have form element 1 input type , button. when click button, trying form data using var fdata = $("#test").serializearray(); however reason, not able values of form. what reason this? jsfiddle demo there several issues. firstly, input has no name attribute, cannot serialized. secondly, create variable called fdata , log fdata - js case sensitive. form being submit in usual method when button clicked means processing prevented after first alert . prevent can change button standard type, instead of submit button: <form id="test" method="post"> <p> <input id="val" name="foo" /> </p> <button class="k-button" id="rset" type="button">submit</button> </form> example fiddle or alternatively can set code run under submit event of form, , use preventdefault stop standard form submission: $("#test&

java - how to change the volume of a clip when it is playing -

ok using example load sound in program public static void playsound(string url,int vol){ try { audioinputstream audioinputstream = audiosystem.getaudioinputstream(soundsengine.class.getresource("/resources/sounds/"+url+".wav")); clip clip = audiosystem.getclip(); clip.open(audioinputstream); floatcontrol gaincontrol = (floatcontrol) clip.getcontrol(floatcontrol.type.master_gain); gaincontrol.setvalue(vol); clip.start(); clip.loop(clip.loop_continuously); } catch(exception ex) { system.out.println("error playing sound."); ex.printstacktrace(); } } } i wandering if there ways change volume without stopping loop?? im not sure have done correctly first time working sounds in java, tried running playsound() again vol integer different ended opening more files, information, using jslider change volume, in advance appreciated

python - How to retrieve a cookie within the header -

i'm setting cookie in python , redirecting page by: print "location: <website>" when set cookie want extension of existing cookie. if cookie s8g6 , go s8g6b% example. i've set cookies using simplecookie , printing out in header right before redirect.

vb.net - teechart lable is not showing -

Image
i using steema.teechart component in our application generate reports. drowing line left rigth , on rigth side have lable text like: e7, b8, ext... per line the problem is: when lines close each other text/line name not showing in repport. in image can see 3 lines. poroblem line name of top line not visible. here example when ok: here code using, any advice appreciated dim mrk styles.points mrk = me.addmark(color.transparent, " ") mrk.marks.visible = false mrk.marks.transparent = true mrk.vertaxis = styles.verticalaxis.both mrk.useaxis = true mrk.add(maxx, csng(drw!afn_x), drw!afn_label.tostring) private function addmark(byval color color, byval oms string) styles.points dim lpt new styles.points chart.series.add(lpt) lpt.showinlegend = false lpt.marks.visible = true lpt.marks.transparent = true lpt.marks.color = color lpt.marks.style = styles.marksstyles.label lpt.marks.text = oms lpt.marks.arrowlength = -8 lpt.mark

java - apache tiles integration with spring mvc -

Image
i new tiles concept.i tried use apache tiles spring. used urlbasedviewresolver render view.the problem it, rendering view multiple times in single page.where mistake ? it sholud display once displays contineously,till server throws exception.below stacktrace info: mapped "{[/hello],methods=[],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public org.springframework.web.servlet.modelandview com.controller.testcontroller.helloworld() nov 27, 2014 3:04:08 pm org.springframework.web.servlet.view.tiles2.tilesconfigurer setdefinitions info: tilesconfigurer: adding definitions [/web-inf/tiles.xml] .15:04:09.408 [http-nio-8080-exec-1] info o.a.t.c.abstracttilesapplicationcontextfactory - initializing tiles2 application context. . . .15:04:09.424 [http-nio-8080-exec-1] info o.a.t.c.abstracttilesapplicationcontextfactory - finished initializing tiles2 application context. .15:04:09.565 [http-nio-8080-exec-1] info org.apache.tiles.access.tilesaccess - publi

rcpp - RInside: can not read R["R.version.string"] as string -

i'm trying read value of r.version.string using operator []. result exception thrown. instead, r.parseeval("r.version.string") ok. below example rinside_sample0.cpp modified showing issue. #include <rinside.h> // embedded r via rinside int main(int argc, char *argv[]) { rinside r(argc, argv); // create embedded r instance try { std::string versionko = r["r.version.string"]; } catch(std::exception& ex) { std::cerr << "exception caught: " << ex.what() << std::endl; } catch(...) { std::cerr << "unknown exception caught" << std::endl; } std::string versionok = r.parseeval("r.version.string"); std::cout << versionok << std::endl; r["txt"] = "hello, world!\n"; // assign char* (string) 'txt' r.parseevalq("cat(txt)"); // eval init string, ignoring r

Using Extraction in SQL Server -

i wrote sql query , sample query below: select value1, value2, value3, ( select cast(amount1 decimal(17,2)) table1 something...) - select cast(amount2 decimal(17,2)) table1 something...) ) 'total purchase' table1 but, getting syntax error @ "-" operator. i tried use "set" statement below declare @value1 decimal(17,2), @value2 decimal(17,2), @result decimal(17,2) set value1 = select cast(amount1 decimal(17,2)) table1 something...); set value2 = select cast(amount2 decimal(17,2)) table1 something...); set result = value1 - value2; but getting syntax error again, what can use instead of "-" operator. thnaks advice,, there lot of things wrong in sql. try this select value1, value2, value3, (select cast(amount1 decimal(17, 2)) table1 something...) - (select cast(amount2 decimal(17, 2))

ios - UIAutoresizingMasks works wrong in iPad ECSlidingViewController -

i have container view ecslidingviewcontroller . every item in container navigationviewcontroller --> uiviewcontroller for example in 1 child view controller have uitableview uicollectionview in 1 static cell. i try implement version ipad supports changing orientation of screen, enabled authoresizing masks fill cell uicollectionview - , had crazy issue - frame of cells - width big. example table view frame {{0, 0}, {1024, 768}} uicollectionview in static cell frame {{0, 0}, {1792, 1301}} . how can solve issue? so, i'm invalidating collectionview layout in willrotatetointerfaceorientation:duration: sizeforitematindexpath: called again. - (cgsize)collectionview:(uicollectionview *)collectionview layout:(uicollectionviewlayout *)collectionviewlayout sizeforitematindexpath:(nsindexpath *)indexpath { return cgsizemake(self.collectionview.frame.size.width, self.collectionview..frame.size.height); } - (void)willrotatetointerfaceorie

c++ - Qt 5.3. QWidget direct painting with OpenGL -

good day. there ways paint qwidget -based window without qpainter . try use raw opengl drawing following code: 1) main function: int main(int argc, char* argv[]) { qapplication app(argc, argv); glwindow* window = new glwindow; window->setminimumsize(200, 200); window->initializeglcontext(); window->show(); return app.exec(); } glwindow inhereted qmainwindow . use glew library in order work opengl . below simplified version of code without error handling , stupid program flow. namespace { glfloat vertices[] = { 0.0f, 0.5f, 0.5f, -0.5f, -0.5f, -0.5f }; const char* vertexshadersource = "in vec2 position;" "void main() {" "gl_position = vec4(position, 0.0, 1.0); }"; const char* fragmentshadersource = "out vec4 outcolor;" "void main() {" "outcolor = vec4(1.0, 0.0, 0.0, 1.0); }"; } glwindow::glwin

Is there a way to log the select query instead of all general queries in mysql? -

i have enabled general log monitor retrieve queries. gave me queries(like insert,update , delete). have run cron job fetch select queries in general log. procedure more following steps. mysql writes general log i running job every 3 hours select query general log , write in file, clear general log. so need select queries want logged instead of queries. there way achieve it? please guide me. in advance.

html - Two Column Layout with heavy technical restrictions -

Image
i have work cms not have access stylesheets. internal css commands in sense of style="width:200px" being filtered cms , hence cannot used, neither. the editor not allow add align="left" images. neither can add manually through source code view. what want achieve: 2 column design - images left, text right (see wireframe). given restrictions above, option see achieving using tables image , text positioning. problem is: (for me not editable) theme has following css attributes img tag: max-width: 100%; height: auto; causing images shrink in safari depending on amount of text in adjacent cells... firefox works fine. does have clue do? i suppose removing max-width: 100%; easiest solution. there solution avoid changes stylesheet (since not have access it)? if have absolutely no other choice old school table layout obsolete attributes disclaimer: in no way endorse tables layouts; meant tabular data. answer purely given purposes of demon

ios - UIBarButtonItem - changing background and removing text -

Image
i'm trying change done button in presentviewcontroller in navbar succesfully able change background using this: [[uinavigationbar appearance] setbackgroundimage:[uiimage imagenamed:@"nav_bg.png"] forbarmetrics:uibarmetricsdefault]; now, when changing done button replacing image, image repeating , done text stays there. using this: uiimage *donebackgroundimage = [[uiimage imagenamed:@"back-home.png"] resizableimagewithcapinsets:uiedgeinsetsmake(0, 0, 0, 0)]; [[uibarbuttonitem appearance] setbackgroundimage:donebackgroundimage forstate:uicontrolstatenormal style:uibarbuttonitemstyledone barmetrics:uibarmetricsdefault]; this looks like: what doing wrong here please? step : 1 create uibutton , assign uibarbuttomitem using initwit

java - Javamail smtp connect & Domino Lotus -

i've developed web application (jsf, spring, jboss 7.0.13) sending mails on smtp using javamail 1.4 , domino lotus 9.0.1 mailing server. what's done : domino lotus configured allow smtp messages. i can send mails using lotus notes (mailing client). i can send mails using simple clients (simple jar files i've developed testing purpose). send method source code : system.out.println(" ******************* start sending email ***********************"); properties props = new properties(); session session = session.getdefaultinstance(props, null); session.setdebug(true); props.put("mail.smtp.host", "192.168.25.5"); props.put("mail.smtp.socketfactory.port","25"); props.put("mail.smtp.port", "25"); session = session.getinstance(props); try { message message; message = new mimemessage(session); message.setfrom(new internetaddress(&q

c# - why do I keep getting a 503 error? -

i have asp.net project hosted locally via iis express. however, want accessible 1 of our clients demonstration, have got work before, after deleting couple of redundant sites applicationhost.config, , subsequently adding details current site, has ceased function, when go ip, e.g xxx.xxx.xxx.xxx:85 comes 503 error. i wondering if me pinpoint problem? applicationhost.config appears fine, though have pasted in below reference. i have tried setting application pool identity network service, , own local account, have set "load user profile" false, no avail. i have disabled windows firewall testing purposes, know that's not part of issue either. any , appreciated! by way, below part of applicationhost.config i've modified, rest not included. <applicationpools> <add name="clr4integratedapppool" managedruntimeversion="v4.0" managedpipelinemode="integrated" clrconfigfile="%iis_user_home%\config\aspnet.co

c# - Ping to multiple IP's using backgroundworker -

i have array multiple ip's in it. i have working method ping ip: public static bool pinghost(string nameoraddress) { if ( nameoraddress == null || nameoraddress == string.empty) { return false; } bool pingable = false; ping pinger = new ping(); try { pingreply reply = pinger.send(nameoraddress); pingable = reply.status == ipstatus.success; } catch (pingexception ex) { return false; } return pingable; } i use backgroundworker (using .net 3.5) start ping. when complete change gui of form. works fine when ping 1 ip. want running ip's , instantly updating form after 1 ip completed. must able see result of first ip while others still pinging. private void backgroundworkerpinghost_dowork(object sender, doworkeventargs e) { hostispingable = pinghost("www.google.be"); }