Thursday, October 22, 2009

Tips for the beginners in web development on forms

When it comes to web front end development it seems to a hassle. Many hate... (Including me ;)) coz u have to spend a lot of time in making a small thing happen..
I think it might be coz that we are not knowing the proper fundamentals..

But there are quite a very few tutorials that help you to learn about it...

Fortunately I found a pretty good article on web forms which explains about the best practices to be used. You can find the article here..

hope you will enjoy :)



Saturday, May 23, 2009

GO green with blackle



During these days of the hot topic that is prevailing in the IT industry is that the ‘Go Green ‘ . Where it the initiatives are made to reduce the environmental hazardous those are caused by the IT industry.

One of the main issue under this is that the power consumption. And the studies have been resulted that searching (simple Goggling) is eating a larger amount of energy and that people use it very often. So to reduce the power consumption for this searching a Google powered search engine is created with all black background. That is what “Blackle” is.

This  work same as the Google but the different here is that the background is in black in order to reduce the power consumption in the monitors since it need less power to light up the screen.


If u are really a great environment lover just try 2 shit to ‘Blackle’ from ‘Google’. But both are the same product but under different name ;)

Thursday, May 14, 2009

Notebook vs netbook

Thought now the topic of net book seems bit of an old topic to be spoken about this is a really a good topic to be discussed about. I found a cool vedion on this in youtube. really a good one 

Thursday, October 30, 2008

implementing Dining philosophers problem

it s just an example algorithm that can be use to avoid statvation as well as deadlock....
 

----------------------------------
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package diningphilosopy;

/**
 *
 * @author FARHATH
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        
        Chopstick chpk[] = new Chopstick[5];
        Philosophers phil[] = new Philosophers[5];
        Thread[] threads = new Thread[5];
        for(int i =0 ; i<5;>
            chpk[i]= new Chopstick(i);
        }
        for(int i=0; i<5;>
            if(i== 4){
                phil[i] = new Philosophers(i, chpk[0], chpk[i]);
            }
            else{
            phil[i] = new Philosophers(i, chpk[i+1], chpk[i]);
            }
            
        }
        for(int i =0 ; i<5;>
            threads[i] = new Thread(phil[i]);
            threads[i].start();
           
        }
    }

}
----------------------------

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package diningphilosopy;

import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author FARHATH
 */
public class Philosophers implements Runnable {

    private int PhilId;
    private Chopstick left,  right;

    public Philosophers(int id, Chopstick left, Chopstick right) {
        this.PhilId = id;
        this.left = left;
        this.right = right;
    }

    public int getPhilId() {
        return PhilId;
    }

    public void setPhilId(int PhilId) {
        this.PhilId = PhilId;
    }

    public Chopstick getLeft() {
        return left;
    }

    public void setLeft(Chopstick left) {
        this.left = left;
    }

    public Chopstick getRight() {
        return right;
    }

    public void setRight(Chopstick right) {
        this.right = right;
    }

    public void run() {
        for (int i = 0; i <>
            try {
                Thread.sleep(1);
                boolean hasTakenUp = false;
                boolean hasAte = false;
                int attempt = 1;
                Thread.sleep(10);
                do {
                    
                    synchronized (right) {
                        synchronized (left) {
                            if (!right.isIsUp() && !left.isIsUp()) {
                                right.pickUp();
                                left.pickUp();
                                hasTakenUp = true;
                                System.out.println("Philosoper " + PhilId + " got the sticks in his " + attempt + " attempt "  );
                            }
                        }
                    }
                    
                    if (hasTakenUp) {
                        eat();
                        hasAte = true;
                    }
                    else{
                        System.out.println("Oophs ! philosopher "+ PhilId+ "didn't get the chance to eat in his "+ attempt+ " attempt  " );
                    }
                    
                    Thread.sleep(10);
                    attempt++;
                }while(!hasAte);
            } catch (InterruptedException ex) {
                Logger.getLogger(Philosophers.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
    }

    public void eat() {
        try {
            Thread.sleep(10);
            System.out.println("----The philosopher " + PhilId + " is eating now------");
            right.keepDown();
            Thread.sleep(10);
            left.keepDown();
            Thread.sleep(10);
            System.out.println("The philosopher " + PhilId + " is back to thinking now");
            Thread.sleep(10);
        } catch (InterruptedException ex) {
            Logger.getLogger(Philosophers.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
}
------------------

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package diningphilosopy;

/**
 *
 * @author FARHATH
 */
public class Chopstick {
private int stickId;
private boolean isUp;

    public Chopstick(int id){
        this.stickId = id; 
    }
    public int getStickId() {
        return stickId;
    }

    public void setStickId(int stickId) {
        this.stickId = stickId;
    }

    public boolean isIsUp() {
        return isUp;
    }

    public void setIsUp(boolean isUp) {
        this.isUp = isUp;
    }
    public boolean pickUp(){
       System.out.println("The chopstick  "+ stickId + " is picked up");
        isUp = true;
        return true;
    }
    public void keepDown(){
       System.out.println("The chopstick  "+ stickId + " is kept down back");
        isUp = false;
    }
}
-------------

Monday, March 10, 2008

Photos of Babies Deformed at Birth as aResult of Depleted Uranium

America always talk about peace.. and say that they are peace makers in the world. And say that the Muslims are the terrorist.
And the fight to maintain the peace in the world
Here are some of the great peace milestones that America laid in the heart of the innocent people.
And who is there to speak against it......
Is it a war against TRRORISM or war against PEACE

www.mindfully.org/Nucs/2003/DU-Baby2003.htm

Monday, March 3, 2008

Websphere

when i heard about websphere i was confused a lot about what does it really mean. any how found out some fact about it which i like to share with you.

Websphere is a brand name of IBM which consist of a family of products. But in common Websphere Application Server (WAS) (- it is an application server) is simply ment by websphere.
It consist of 3 components:
1. Foundation tools

2. Business Portal

3.Business integration

If u really like to learn about it ....
http://books.google.lk/books?hl=en&id=H4Ilf0ZiJZ0C&dq=java+programming+on+ibm+websphere&printsec=frontcover&source=web&ots=b5RRDfMbS7&sig=9IIEmEdoIrC7SmeurDC-hXYZ4Hk#PPA39,M1

Because just now I'm also refering to it :D