Archive for February, 2010

27
Feb

crossing road

Taken @ phuket

VN:F [1.9.7_1111]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.7_1111]
Rating: 0 (from 0 votes)
20
Feb

Shutdown/restart windows in remote desktop

I noticed that some of the computer which I remote desktop to, could not be shutdown or restart. Instead of the normal shutdown or logoff, you will see a log off and disconnect button.

I googled out and the easiest way to restart/shutdown such computer via remote desktop is to bring out the user menu and shutdown/restart from there.

To do it, you simply press Ctrl + Alt + End key. Cheers.

VN:F [1.9.7_1111]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.7_1111]
Rating: 0 (from 0 votes)
20
Feb

Printing out active threads in java

Here’s the code snippets to display the number of running threads in your java program.

It’s good to use it to track your resources.

int activeCount = Thread.activeCount();
System.out.println("total active = " + activeCount);
Thread[] threads = new Thread[activeCount];
Thread.enumerate(threads);

System.out.println("before");
for (int j=0; j<threads.length; j++) {
 System.out.println(threads[j].toString());
}

//run your classes
Benny benny = new Benny();

activeCount = Thread.activeCount();
System.out.println("total active = " + activeCount);

threads = new Thread[activeCount];
System.out.println("after");
Thread.enumerate(threads);
for (int i=0; i<threads.length; i++) {
 System.out.println(threads[i].toString());
}
VN:F [1.9.7_1111]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.7_1111]
Rating: 0 (from 0 votes)



Search Website

www.lingeriesg.com

www.lingeriesg.com

Sponsored Ads

Sponsored Links

www.asiadolly.com

www.asiadolly.com

About Me

Me

Hello, Im Benny Chong. This blog is a proof that I have too much spare time to burn. 

I will be writing topics mainly on web design, application development, photography and other rubbish. Cheers