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:
1,11,111,2,21,3
which is not desired, it should be:
1,2,3,11,21,111

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.

Advertisements
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. No..no..no..dont 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
[http://www.businessinsider.com/my-nightmare-interviews-with-google-2009-11]

This gives some typical question you would have heard about googles question:
15 Google Interview Questions That Will Make You Feel Stupid (GOOG)[http://www.businessinsider.com/15-google-interview-questions-that-will-make-you-feel-stupid-2009-11]

Here is the real and good list of googles interview quesion:
140 Google Interview Questions[http://blog.seattleinterviewcoach.com/2009/02/140-google-interview-questions.html]

Here is set of another 15 questions, with answers 🙂
Answers to 15 More Google Interview Questions That Will Make You Feel Stupid[http://gizmodo.com/5405852/answers-to-15-more-google-interview-questions-that-will-make-you-feel-stupid]

One more sad sotry 😦
Google Interview
[http://ifdefined.com/blog/post/Google-interview.aspx]

 

A though with lot of comments..

Just a thought !!![http://weblogs.asp.net/jasonsalas/archive/2005/09/04/424378.aspx]

A full story with lot of nice pics.
My Interview With Google
[http://www.nomachetejuggling.com/2006/12/30/my-interview-with-google/]

Another failure story but worth reading…
My interview experience with Google
[http://www.philosophicalgeek.com/2007/08/12/my-interview-experience-with-google/]

Some thing from The Register
Tales from the Google interview room
[http://www.theregister.co.uk/2007/01/05/google_interview_tales/]

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
[http://www.catonmat.net/blog/my-job-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
myGridView.DataSource=dataTable;
//bind data from a data source to the GridView control
myGridView.DataBind();

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:

http://www-01.ibm.com/support/docview.wss?rs=984&uid=swg21132484
http://www.cmcrossroads.com/forums?func=view&catid=31&id=69343

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.

 

References:

http://social.msdn.microsoft.com/Forums/en-US/netfxbcl/thread/006cbbac-101a-40ea-ae16-d59a7a2da8b1

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