Monday, February 26, 2007

Boi Mela


Every year in February month, bangladesh er bangla academy te ekushe boi mela hoy. Onek onek boi pawa jay. Sara bosor dhoira writer ra lekhe r boi mela te prokash kore. Onek onek vir hoy. Onek onek boi kena becha hoy. Pray shobai boi melay jay. Even picchi polapain beshi jay . :D .. Amio jai, eibar jawa hoy nai . Boi melar link ta na dile kemon hoy, tai banglaacademy er address

Sunday, February 25, 2007

In c++ u can generate random numbers by calling rand() function which is built in stdlib.h . But if u use this function without setting any seed then it gives the same random value whenever u run the code again. To solve this u can give a seed to generate random number. The best seed can be the time. A seed is set up by srand(somevalue) function. So use time u have to include time.h. Now u initialize the seed in main and use rand() fucntions else where. Now u will get different random value in different time.
A sample code can be

#include < stdio.h >
#include < math.h >
#include < stdlib.h >
#include < time.h >


void printSomeRand()
{
for(int i=0;i<10;i++)
{
printf("%d \n",rand());///use rand to generate a random number
}
}

void main()
{
srand((unsigned) time(NULL)); ///give a seed, dont give seed whenever u call rand
printSomeRand();

}

Monday, February 12, 2007

My Picasa Album

Friday, January 26, 2007

My web SIte

I am building a website for my own in google pages. Not a website still. My friend said i shouldn't not use something made by google for my own web page. What ever i'm continuing. u can take a look here.

Sunday, January 14, 2007

Here is a code which will guide u through this.

The bad thing is the file is not still posted :D


import java.io.File;
import javax.swing.*;
import java.io.*;



public class dir
{
FileWriter fr;
dir()
{
try
{
fr=new FileWriter("c:/outputDir.txt");
}
catch (Exception ex)
{

}


}
public static void main(String args[])
{

dir d=new dir();

d.getDirectoryStructure();
//showFileTree("a");
/*FileDescriptor fd=new FileDescriptor();
String location="a";
File f=new File(location);
String[] s=f.list();

File[] ff=f.listFiles();

for(int j=0;j
{
System.out.println (ff[j].getName());
}
for(int i=0;i
System.out.println (s[i]+"Directory: "+new File(location+"/"+s[i]).isDirectory()+"\n");*/

}

void getDirectoryStructure()
{
String str=JOptionPane.showInputDialog("Enter the directory of which u want to get info");


File f=new File(str);

if(f.exists())
{
showFileTree(str);
}
else
{
try
{
this.fr.write("File does not exist");
//this.fr.close();
}
catch (Exception ex) {
}

}
try
{
this.fr.close();
}
catch (Exception ex) {
}
}


int printTab=0;
int count=0;
void showFileTree(String directory)
{

File f=new File(directory);

File[] allFiles=f.listFiles();

for(int i=0;i
{

for(int j=0;j
{
try
{
fr.write("\t");
}
catch (Exception ex) {
}

System.out.print("\t");
}
try
{
String temp=allFiles[i].getName();
temp=temp.substring(0,temp.indexOf("."));
count++;
fr.write("insert into pinyin values("+count+",'"+temp+"');\n");
}
catch (Exception ex) {
}

//System.out.print("Name: "+allFiles[i].getName()+" +length: "+allFiles[i].length()+ "\n");
if(allFiles[i].isDirectory())
{
printTab++;
showFileTree(allFiles[i].getPath());
}


}
printTab--;
}
}

Saturday, January 6, 2007

Eid is shesh

Eid onek din hoilo shesh. Kurbanir eid beshi ekta valo na. Rozar eid ta

Friday, December 22, 2006

Another post

I am posting again. Nothing important is happening down here. I have bought a phone Motorola W220. It cost me 5550/= tk only. It's a good looking phone but it has no java support but it can access wap sites.