Search Here

Custom Search

Wednesday, September 12, 2007

Printing webpages from browsers

Every browser supports displaying print preview and printing of webpages. Different browsers follow different strategy. You can print the content of the whole webpage from Mozilla Firefox and IE 7.0 but from IE 6.0/5.5 you sometimes can not. When you see the print preview of a page from IE 7.0 and Firefox and you click zoom in or out then the content of the page is zoomed,not the page. So you can fit the whole content in a page. For example suppose when you see the print preview of a webpage it shows your webpage is of 7 pages(paper). If you zoom in then the page count will increase and if you zoom out then it will decrease. So you can print any webpage as your choice.

But in IE 6.0 the page content is not zoomed rather the page is zoomed. So you will see that in the right side of the page your page content is truncated and you have no way to print it from the browser. There is one simple way to print it. Just copy the content of the whole webpage in MS Word and then print it. The content is truncated when you use frames or tables in your webpage.

visit:

http://support.microsoft.com/kb/260642/en-us?spid=2073&sid=72

Do you wanna see your SSC/HSC result?

If you wanna see your SSC/HSC result in the web just visit the following link.

http://site.educationboard.gov.bd/results_db/index.php

Just enter your passing year,board and roll then you will get the result.

Sunday, August 19, 2007

How solving ACM problems is helpful to develop quality software

Developing quality software is a big challenge for a software company. A software will be more quality-full if it has less bugs and high performance. But reducing bugs and improving performance is more challenging than developing the software. Here I will try to explain how solving ACM problems can be related to developing software.


When we take part in a programming contest we are given some problems to solve as part of the contest. Suppose we have decided to solve problem 'A' of the problem set. At first we go through the problem description very carefully. This is like understanding of the spec of a software. Then we think deeply and try to find out the algorithm to solve the problem which is like determining and planning the strategy to develop the software. After finding an algorithm to solve the problem we just code it and see whether the given sample input output of the problem is satisfied by our program. This is like developing the software and testing whether our desired output is achieved form the software.But we get upset when we submit the solution to the judge of the contest and get the result like "Wrong Answer" or "Time Limit Exceeded" or "Runtime Error" etc.

But what's wrong with our program?? We got the sample output absolutely correct after feeding the sample input to our program. Is there anything wrong with our code? Hmmm this is like getting bugs of the software. So, we should think deeply now whats wrong with our code. Then after several
modifications and submissions of the code we get the msg "Aceepted" from the judge. It means our code is 100% bugfree :)

Actually to get a program accepted we have to think very deeply and vastly in a realtime contest. While participating in a contest I saw many times that only for a single testcase my program did not get acceptance. Usually this is called special case in the problem solvers community. In a word we can say that who solves ACM problems have to think in a vast view about a problem and this fact helps him in a real-life software development. While developing a software if a programmer thinks in a very clever way about the requirements and different types of bugs may occur or any kind of security issues of the software then the software will be more bugless. And to improve performance of a software the underlying algorithm should be improved and most of the ACM problem solvers are conscious about improving performance of their algorithm which can be related to improving performance of a software.

Actually solving problems improve the vastness of thinking of a programmer. It gives a new dimension to his programming skill.

So far I have seen giant companies like Microsoft,Google hire ACM world finalists most of the time even before the completion of their graduation. But why? Because they know to develop a quality software of innovative idea ACM programmers are the best choice.

But there is a little bit problem with most of the ACM programmers. Throughout their student life they only learn C/C++ or at best Java and I observed they feel very less interest about professional software development. They only like to solve problems. If you ask them whats your favorite language they will reply you "C/C++". But if we grab these programmers and train them with professional software development tools and tactics then definitely we can build better software.

Generating Excel using POI in Java

May be you know excel files can be generated from Java by using an API POI.
( to know about POI visit http://poi.apache.org/ )

When I was using POI to generate excel file I saw a little problem after opening the generated excel file. Suppose I have to display the following text in a cell.

User name: John
Title : Programmer

You see there is a line break between the two lines. That means you have to write “\n” in the code. But when I opened the generated excel I found the two lines were displayed in a single line and there is a garbage box like [] in place of the new line.

But I expected two lines . So what the mistake I did? Can you guess?

Oh shit! I didn’t set the WrapText property of the cellStyle of the Cell.

So, keep in mind to write this

style.setWrapText(true);
(if the name of the cellStyle of the cell is ’style’.) if your text contains multiple lines.

One more point I observed this problem in MS Office , not in Linux’s Open Office. :-)

Friday, August 17, 2007

An interesting bug of DataGrid of .NET

When I was working at Uniqa S&S Ltd. I got a very interesting bug of .NET datagrid.
Suppose you have bound a Dataview to a Datagrid, then what do u expect?
You expect that the changes that you make to ur DataView will be reflected to the DataGrid immediately. But sometimes it doesn't and it will really make u tensed. But how?? Ok, let me expalin.
To bind a DataView to a DataGrid you just write the following lines of code.
DataGrid dg;
DataView dv;
.................
................
dg.DataSource = dv;
But sometimes when insert rows in the DataView or make any changes you don't see the reflection in the DataGrid. But when this scenario occurs?
I observed this happens when you bind more than a ComboBox or a DateTimePicker with any column of the DataView's Table.
But I found a solution of this disgusting problem.
Just write following lines after making change to the DataView.
dg.DataSource = null;
dg.DataSource = dv
Then you will see the reflection immediately.

But this is a funny solution. Because the DataSource of the dg was dv from the very beginning and still it is. But to get the reflection you have to change the datasource of the dg and again assign to ur dv. Null is a better choice here.

And the interesting fact is that MS hasn't solve this bug yet in .NET2.0
DataGridView of .NET2.0 has still the same problem.
(Note: I observed this phenomena in desktop development and I am not sure about Web)

Monday, August 6, 2007

Autocomplete mode of ComboBox in .NET2.0

Today I wanna discuss about a new feature of .NET2.0 that was not in .NET1.1
Many times we need the users of a software to give the facility of auto completion and prompting of text when writing.
In .NET2.0 ComboBox and TextBox has the facility.
Just set the Autocomplete property to any of the following
{Suggest,Append,SuggestAndAppend}
And the Autocomplete DataSource to any one of the following
{ListItem,CustomDataSource,.......}

Then you will see the effect after running the application.
But there is not a facility that Microsoft did not provide. There is no option to provide the Font of the ListItems that is prompted when autocomplete is in action. But this is really very important. Hope MS will provide this facility in the next updates.

Sunday, June 10, 2007

At last I have completed my Graduation!

Today our result of B.S.C. Engineering final exam has been published and I have got my result few minutes ago. Wao! I have passed successfully.
Its a wonderful feeling. From now I am a Graduate, an Engineer!
Today my dream has come true. At first I gave the news to my mom who always prays for me from the core of her heart and then to my father who is my mentor, my guru. I think I have come to this position today cause of my mother's blessings and my father's teaching.
No more today....I am very excited now....and will write very soon.....

Saturday, June 9, 2007

Therap Family Dinner

Today (8-Jun-07) I attended the Therap Family Dinner at Spectra Convention Centre in Gulshan.
It was a dinner from Therap(BD) for the family member of Therap's employee. Our CEO Mr. Richard Robin gave his speech and presented what actually Therap do and what we do in Therap.
We have some wonderful moments there. Masum vai,Sajjad vai,Mozammel vai,Sajjadul Hakim vai and many others from us expressed their feelings about Therap and what we do in Therap. Above 200 people among us and our family members were present there. After all the presentations we had an excellent dinner :-).

Thursday, June 7, 2007

Creation of my first blog site

Today I have created my first blog site.
May be its too late to create one.
I should have created it before.
But I was too busy with my study and job that I could not do it.
Now I am only job holder.
No academic pressure, no classtests and no exams!
I feel very exciting now.
I hope I can post frequently.
Coming soon with new postings........

Sowkot Osman
07-Jun-2007