Tuesday, August 28, 2007

Bad Bad Day


Yesterday including today was a bad day for me. I was coming back home from office. It was about 8pm. I was crossing dhanmondi 27 after shatmasjid road. Suddenly or slowly a rickshaw came and blocked mine. Then as usual wanted money and told me not to shout. They took my mobile but returned the sim on my request. But they took all money in my moneybag except 13 tk and paisas. This was my first experience. I think not the last.

The story is not over yet. I came home and ate and started to dream. And when i woke up in the morning i found my baranda empty which was full of clothes at night. Good morning robbery.

So it was a bad day for me. I don't know what will happen next. Man, Be careful in the streets.

Monday, August 20, 2007


I am bad mostly
they say that some parts are good
but i think that i didn't tell the truth always ,tried
to prove myself good, which actually was not :)


Extroversion:

You have medium extroversion.
You're not the life of the party, but you do show up for the party.
Sometimes you are full of energy and open to new social experiences.
But you also need to hibernate and enjoy your "down time."

Conscientiousness:

You have low conscientiousness.
Impulsive and off the wall, you don't take life too seriously.
Unfortunately, you sometimes end up regretting your snap decisions.
Overall, you tend to lack focus, and it's difficult for you to get important things done.

Agreeableness:

You have high agreeableness.
You are easy to get along with, and you value harmony highly.
Helpful and generous, you are willing to compromise with almost anyone.
You give people the benefit of the doubt and don't mind giving someone a second chance.

Neuroticism:

You have high neuroticism.
It's easy for you to feel shaken, worried, or depressed.
You often worry, and your worries prevent you from living life fully.
You tend to be emotionally reactive and moody. Your either flying very high or feeling very low.

Openness to experience:

Your openness to new experiences is medium.
You are generally broad minded when it come to new things.
But if something crosses a moral line, there's no way you'll approve of it.
You are suspicious of anything too wacky, though you do still consider creativity a virtue.

You can try to here

Sunday, July 22, 2007

First add a data grid view to the form

then go to the code file

on a buttons click event add the following code

U need to add the header named

using System.Data.OleDb;

private void button1_Click(object sender, EventArgs e)
{

OleDbConnection conn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\\test.mdb;Jet OLEDB:Database Password=password");;

String queryString ="select UserID from UserTable where USerID > 2";

OleDbDataAdapter da = new OleDbDataAdapter(queryString, conn);
DataSet ds = new DataSet();
da.Fill(ds, "UserTable");
dataGridView1.DataSource = ds.Tables["UserTable"].DefaultView;

}

that's it. U r done. U can now add your custom query and use the data grid to show your results.

 

Enough for today. :D

Some links

http://www.codeproject.com/csharp/UsingDataGrid.asp

http://www.google.com/search?q=c%23+show+data+in+a+datagrid&btnG=Search&hl=en

http://www.c-sharpcorner.com/UploadFile/mahesh/DataGrid11282005234057PM/DataGrid.aspx

Friday, July 20, 2007

i made the decision let's see is it right or wrong

Saturday, July 7, 2007

First week

I am living at my brother's place for one week, but it seemed that I have left the hall for a long time, time goes slow here, last Friday I came to this place. Bought a freeze today :). All my salary is gone . Let's see what happens next. Am a bit tensed about some decisions. Gotta go

Saturday, June 23, 2007

J2ME Custom Item

Recently i came to know a tremendous thing of J2ME. I worked little on J2ME. I wanted to make a scrollable textbox which can be appended to a form. So i searched then net and came to know a great thing named Custom Item. This is such an item which you build by yourself and you can add this item to a form. This items have their own paint() method. So you can customize it's look and feel too. The limitation is you can only use it in MIDP 2.0 profiled devices. But it's nice to make one of your own :D. I think J2ME polish uses custom items to change the look and feel of their items.

 

This links are just great. You can see if u want to learn Custom Item

http://www.ibm.com/developerworks/wireless/library/wi-developui/

http://developers.sun.com/mobility/midp/ttips/customitem/

http://www.google.com/search?hl=en&q=j2me+custom+item&btnG=Google+Search

http://safari.ciscopress.com/9780321463425/ch10

I was trying to connect to an ms access database using JDBC. Am a bad learner so it took a lot of time for me to finish it. After googling i found some code to work with java and access. Some of the code is shown below

 

import java.sql.*;

 

try {
        System.out.println("Begining conn");
        Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
            String filename = "c:/nsu.mdb";
            String database = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=";
            database+= filename.trim() + ";PWD=test}"; // add on to the end
            // now we can get the connection from the DriverManager
            Connection con = DriverManager.getConnection( database ,"shimul","test"); 
         Statement stmt = con.createStatement();
        System.out.println("Conn done succesfully");
        stmt.execute("select * from t");
        
         ResultSet rs = stmt.getResultSet(); // get any Resultt that came from our query
         if (rs != null)
          while ( rs.next() ){
              System.out.println("Name: " + rs.getString("a") + " ID: "+rs.getString("b"));
          }
          stmt.close();
          con.close();
     }
     catch (Exception err) {
        System.out.println("ERROR: " + err);
     }

 

But i got some error like

java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Record(s) cannot be read; no read permission on 't'.

 

I tried googling but found few result, after a lot of googling i came to know some solutions which was near to this then finally got the solution

 

First open the file in access, give password, then From Tool->Security-> User and Group Permissions -> then select the table and for the admin account give it all kind of access. This will solve your access problems.

 

You can use the above code by changing the statements for insertion deletion update etc. You might have to change the stmt.execute accordingly. Jdbc driver may be required which can be downloaded from sun.java.com . I dont know but mine was already there, new versions of JDK have built in jdbc:odbc support.

Tuesday, June 19, 2007

 this is a sample blog entry from my desktop using the windows live writer. Which helps the users to post blog from PC. You can get the software from here. From here you can post to different blogs. Enjoy :D

Saturday, June 16, 2007

Got a job



Recently got a job, i thought previously that it would be great to get a job, but after getting one i found that it's not that enjoyable. Though getting none is more frustrating than this. But after getting 1 i thought that i just robbed someone else's job, who might need the job more, who is more eligible for the job. I'm not sure about anything. Let's see what happens. One thing i came to know that we have to dream hard, which i can't.


Jaukga pray for me brothers :D

Thursday, April 26, 2007

Prince Of Persia

The prince of persia the greatest game on earth, how can we forget those days when we had no time to sleep no time to dream anything else without the prince, always looking for new ways, new tricks, new combos, new princess(ha ha ha)

We liked that game like hell,many of u tooo

Thursday, March 22, 2007

A journey Ends


Ajke amader BUET life er last din gelo. 2001 e hsc er por 2002 te amader class shuru hoisilo. Er majhe onek kisu hoise, onek din gese, onek bosor gese, onek ghotona hoise, onek durghotona hoise, amader onek friend ke haraisi, abar onek notun notun friend hoise, onek er prem hoise,onek er prem vangse, onek er gpa komse, onek er gpa barse, onek er life ta change hoya gese, onek er shopno shofol hoise, onek er shopno venge gese onek er onek kisu hoise, But amra buet life ta voyanok enjoy kortesilam. Class korar anondo r Exam er voy shob e chilo. Abar PL er moddhe shobai mile porashuna, cinema dekha, adda deya khube mojar silo. Amra bujhtei pari nai je kotogula din choila gese. Din gula je kivabe jay kisui bojha jay na.
Mone hoy je matro koyekdin age buet e dhuklam, Kemne je time ta gelo. Khub e arame silam, Ekhon abar job khujte hobe. Vablei kharap lage, Shob bondhu gula ke koi jabe jani na.
Abar kobe dekha hobe tar nai thik, But i really will miss this life, Everybody of Us will miss this life, this was the amazing stage of our life. We shared out thoughts we shared our loves, we shared our hates, we shared everything , But still a lot of things of us are still hidden, Kotota poth perole bolo pothik chena jay??
Jai hok i will miss everything, Kono shundori ke dekhe tar dike bokar moto cheye thaka, kono shundor couple ke dekhle mone dukkho jaga, kauke tease kora, kono friend ke bash deya abar kokhon o bash khawa, All were life. Shohid minar e boisha thaka, Rat dupur e boxshi bazar e khaite jawa, Full volume e gan saira nacha nachi,Mobile e kono meyer shathe faizlami kora,Abar faizlami korar pore tar premik er hate jhari khawa,Class er fake toilet e biri khawa,Kimba cormochari canteen e khawa, Kimba alam's er shamne cha birir adda,Hall er mathe boshe moner dukkho bola, Kimba kokhona ba out of mind hoye jawa, aro koto kiiiiiii, all were life. Shomoy eto druto jay keno??????

Mon ta khube kharap.Jibon er ekta shundro part shesh hoye gelo, Another journey will now begin, Some of us will become great, amra kokhon o onnoder shamne gorbo kore bolbo dekh eita amar friend silo, Ore ami ekdin ekta mair disilam or ore ami ek cup cha khawaisilam, Kimbar or shathe amar ekta chobi ase, Abar kokhon o mone mone hoyto mon kharap korbo nijeke boro der majhe na pawar dukkhe.

Ashole eigula kono bepar na, Everybody will miss it, Amar lekha ta khub e kharp hoya jaitese, ashole abek thakle lekha koshto,

Tobuo mone porbe, gun gun kore gabo, "COffee house er sei addata aj ar nei, kothay harieo gelo shonali bikel gulo sei".

I love u all my friends. I will miss you. Always and Every time .


Aro onek kisu likhte iccha kortese, ei koy bosor er pura kahini likhte iccha kortese, Thak onek kotha mone thakai valo. Bye, Bondhu valo thakish tora

The poem which left as a comment of this blog tells it all, GURU who was the greatest people of my whole BUET life whom i wish to follow,i feel proud that i met him in BUET.

"Dure Shore Jawa Kono Ek Bondhu k.."

Dekha hobe r?
Hoteo to pare..
Asha rekhe dei buker kotore...

Dekha jodi hoye jai ojuter vire..
Othoba fele asha chena chottore..
Didha vule daak dish hothat sojore..
Daan haate daan Haat-purono adore..
Vashbo dujone mile sritir joaare..

Dekha hobe r?
Hoteo to pare...
Asha rekhe dei buker nibire..

Dekha jodi hoye jai pronoyer ghore..
sosta shopner holde basore..
kingba kolahole-adda-ashore...
vul gulo vule giye hashi ta odhore..
kotha hobe du-jona te mridu-toro shore..

Dekha hobe r?
Hotei to pare...
Asha r hotasha ra buker govire..
Protidin protiraate shohobaash kore..

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