Take care of laptop power charger adapters

Many notebook power adapters are made with cheap components these days. You may have noticed. Here is how to make them last longer

1) Do not bend the cables as they can break easily these days. I have taped cables to the charger body to prevent them waggling around too much. If you carry your adapter round in a laptop bag then give it lots of room and place it in your back carefully – as if it were made of glass.
2) Try not to let the adapter get too hot. Processor running full tilt and battery half charged will heat the charger up too much.
3) So, check charger does not get too hot and handle it VERY carefully.

These tips will give you extra time with your very fragile power adapter. All the best with it. 🙂

Note: Looking forward to much needed advances in power adapter design. I suppose its not sexy enough 😦

Java Thread wait and notify for Right Handed Thinkers

This code may be enough for you, but I will add a few words at the end. (note: if you use this code replace the WordPress ” with real ones)

*********************************
package com.multiple.threads;

public class Controller
{
public static void main(String[]args) throws InterruptedException
{
WorkingClass b1 =new WorkingClass();
Thread b = new Thread(b1);
b.start();
synchronized(b)
{
System.out.println(“1 Just about to call wait()” + b.getName());
b.wait();
System.out.println(“2 Just got notified”);}
System.out.println(“3 Ended here”);}}

class WorkingClass implements Runnable
{
public void run(){ synchronized (this){
System.out.println(“4 Starting a 4 sec sleep, nighty night.”);
try{ Thread.sleep(4000); }catch(Exception e){}
System.out.println(“5 Finished sleeping and calling notification”);
notify();
}}}
**********************************
output is:
1 Just about to call wait() Thread-0
4 Starting delay
5 Finished sleeping and calling notification
2 Just got notified
3 ended here

So, you have to synchronize your thread object and run() to get locks. Then the thread stops at the wait() stage and does nothing until notify() – after the task is finished. At which point it goes to the last stage in the program and finishes. – The task here is a 4 second sleep, but it could be getting data online.
Try it in your terminal window – it works.