Sorting a number field in MySQL: Making order by work for number fields in mysql

When using Order By field having number doesnt work some time. Actually it tries to sort the fields considering them as string, so numbers 11,2,1,111,21,3 will be sorted like:
which is not desired, it should be:

To order the values as they should be, simply use the SQL ABS function.

to get this desired result use query like:

SELECT * FROM ‘myTable’ WHERE b=’abc’ ORDER BY ABS(price) ASC

here price is number field.

Published in: on November 18, 2009 at 11:36 am  Leave a Comment  
Tags: ,

Google Interview Questions: Interview by google…Do you need job in google?

Since lot of people do it, i also wanted to do this. misunderstand me
i am not talking about applying for a job at google, but i am going to write a post on it, i will try to add links to other pages from here, which will give an experiance about how it is to get interviewed by google ;).
If you know any other page where they have discussed about it please let me know throw comments. Also if you had any such experiance please let me know.

So here is various links to such pages:

Following link gives an idead about how to not get in google :). I think she did some mistake, yep she was nervous but quesioned asked was not so tough i guess…
My Nightmare Interviews With Google

This gives some typical question you would have heard about googles question:
15 Google Interview Questions That Will Make You Feel Stupid (GOOG)[]

Here is the real and good list of googles interview quesion:
140 Google Interview Questions[]

Here is set of another 15 questions, with answers 🙂
Answers to 15 More Google Interview Questions That Will Make You Feel Stupid[]

One more sad sotry 😦
Google Interview


A though with lot of comments..

Just a thought !!![]

A full story with lot of nice pics.
My Interview With Google

Another failure story but worth reading…
My interview experience with Google

Some thing from The Register
Tales from the Google interview room

Here is expriance of Peteris Krumins’ from his blog. Its really good. If you want to go for software engineer position it may help you.
Peteris Krumins’ Interview at Google

How To display table in GridView: Dynamically filling data in GridView from DataTable in ASP .Net

I had a datatable and i needed to show in a GridView in my ASP .Net page. Following is the code which help me to do so.

//get table to be shown in grid view;
DataTable dataTable = GetRequiredTable();
//assing table to the DataSource property of GridView
//bind data from a data source to the GridView control

Here GetRequiredTable() is a user(example) function which return a table to display in to gridview.
You can also use DataSet in place of DataTable.

Published in: on November 17, 2009 at 10:27 am  Leave a Comment  
Tags: , ,

not able to delete eclipsed item (files) in clear case: sudden crash of system made file corrupt

I was working on clear case dynamic view and suddenly my system got crashed. after that i was not able to open the file on which i was working. It was looking like eclipsed item on clear case explorer.

I was also not able to delete this file. But finally i got the solution to delete the file.

Here is one thing i want to say before trying my way just try to delete the eclipsed file using following links:

if you tried every thing still not able to delete. then here is the way to do it:
(this will not recover your work, if you forgot to check in.)
1. check in every file (except eclipsed one as you will not be able to do so.)
1. delete view shortcut.
2. reconfigure it.

if its still not working then:
1. create new view with same config spec
2. create shortcut for it.

Above described method should be used at last after you have tried every thing else.

Published in: on November 16, 2009 at 7:09 pm  Leave a Comment  
Tags: , , ,

DCOM Error : Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 80070005.

When we tried to use word automation from .Net in ASP .Net application earlier it was working but then it stopped working in some of the machine giving error
“Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 80070005.”.
We had DCOM setting in place, IIS setting was also ok. Then I got following solution:

  • I changed the AppID Registry key under HKEY_CLASSES_ROOT\AppID\WINWORD.EXE from old entry to {00020906-0000-0000-C000-000000000046}.

(for some it will work after this, but if still its not working go for second.)

  • 2. Also changed the DCOM setting.
    • a. Open the Component Service Console.(Either by running command: dcomcnfg OR by opening it from Control Panel->Administrative Tool -> Component Services)
    • b. Now Select ‘Microsoft Word Document’, Under Component Services->Computers->My Computer -> DCOM Config.
    • c. Do Right click and select Properties.
      it will open Microsoft Word Document Properties dialog.
    • d. In Microsoft Word Document Properties dialog, select Identity tab.
    • e. In Identity tab, if ‘The launching user.’, in our case third option was selected, so we selected 2nd option.

This may solve out problem, hope it would be helpful for you also. If you need to say something please feel free to speak through comments.



Published in: on November 3, 2009 at 4:17 pm  Comments (7)  
Tags: , , , , , , ,