Thursday, July 03, 2008

SysWoW64

Here is something that recently helped me fix a issue.

For a 64 bit Operating System, Microsoft offers a set of 32 bit executables in the WoW(Windows on Windows) directory of the system.

To setup DSN for 32-bit application you must use:
%WINDIR%\SysWOW64\odbcad32.exe

and for 64-bit application you must use:
%WINDIR%\System32\odbcad32.exe

So, to run a 32 bit application, we would need to modify the env PATH variable and put SysWOW64 before system32.

Roughly the steps would be
1. Start %windir%\SysWoW64\cmd.exe
2. set PATH=%systemroot%\SysWOW64;%PATH%
3. Run the application.
4. After application has completed, reset PATH variable if required.


Hope this was helpful.
Or, if the application can't be run from a shell then you could modify the PATH variable directly from System Properties > Advanced Tab > Environmental Variable > System variable.
Edit the PATH variable accordingly and reboot the system for the changes to take effect.

Tuesday, August 14, 2007

Greatest Programming Tip



Source: http://blogs.techrepublic.com.com/geekend/?p=817

Tuesday, November 28, 2006

Sitting Posture

"A 135-degree body-thigh sitting posture was demonstrated to be the best biomechanical sitting position, as opposed to a 90-degree posture, which most people consider normal,"


Source: Aching Back? Sitting Up Straight Could Be The Culprit

Does my office chair supports that ?

Friday, November 24, 2006

New Mouse

Now here is something to relax your wrist. Hope to see these in market soon in affordable price.




Source

Thursday, November 23, 2006

Domain Name Appraisal

Hey today I just checked the worth of my domain at LeapFish.com and here are the surprising results:

Domain Name Appraised: sawansoft.com
Combined Domain Name Appraisal Value Score: 103

Top Level Domain Name Score: 10
Unwanted Characters Score: 10
Length Score: 3
Archive.org Score: 20
Google Search Results: 407
Yahoo Search Results: 97
MSN Search Results: 14
Search Engine Score: 1


Estimated Domain Name Value: $2,163.00





Domain Name Appraised: smsmasti.tk Combined Domain Name Appraisal Value Score: 89

Top Level Domain Name Score: 1
Unwanted Characters Score: 10
Length Score: 4
Archive.org Score: 11
Google Search Results: 22
Yahoo Search Results: 0
MSN Search Results: 4
Search Engine Score: 1

Estimated Domain Name Value: $1,068.00

Wednesday, November 01, 2006

Project Nightmares

How good it feels sometimes to say NO to a client's irritating requests.

When the Client is non techy, he thinks without specifying the complete requirements, the software p4erson will figure it all out. I had taken a project on Student Court which initially started as just a database entry project. Later the Client started adding Business Logic to it. After continous changes and feature addition for 3 months, I think that is the worst code I might have ever written.

Even after telling him many times, he never gives all the requirements all-together.

Wednesday, October 04, 2006

Existing Techrepublic Blog

Well, Techrepublic is about to close all the member blogs. So here is all what I had earlier posted there. Maybe sometime later I'll post more technical articles here.


April 30, 2006
Displaying Records in Random Order using ASP


One of my client had a requirement of displaying a list of Products in a Random Order. He had around 50 products which he wanted to display on the same page but the products should appear in random order each time the page is refreshed.


Here is the code which I used, to do the work

<%
Dim rs
Dim ctr
Dim cnnstr
Dim cnn
cnnstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("products.mdb") & ";"
set cnn = Server.CreateObject ("ADODB.Connection")
cnn.Open cnnstr

set rs=Server.Createobject("Adodb.Recordset")
rs.open "SELECT * FROM Products",cnn,1,1
ctr=rs.RecordCount


Dim a1
ReDim a1(ctr)

Do Until ctr = 0
Randomize
rnd_no = Int(Rnd*rs.RecordCount) +1
ctr=ctr-1
if rnd_no>rs.RecordCount then rnd_no=1
rs.MoveFirst
rs.move rnd_no
if a1(rnd_no)=1 then
while a1(rnd_no)=1
rnd_no=rnd_no+1
if not rs.eof then rs.MoveNext
if rnd_no>rs.RecordCount then
rnd_no=1
rs.MoveFirst
end if
wend
end if
if not rs.eof and not rs.bof then
a1(rnd_no)=1

%>

// Display the recordset Here.


<%
end if
loop
rs.Close()
Set rs = Nothing
cnn.close
%>

This code works like a charm for around 50 records. Didnt tested it for more.

Now in this code I am using a array 'a1' to mark the recordset which has been displayed. This is required since sometimes the Random funtion calculation gives the same number back, so the same record may get printed more than once. This was undesirable. So by using this array and marking each record after printing ensures that each record is printed once only.

Do tell me your reviews on this code.



April 27, 2006
Changing Page across Frames through ASP


During the development of ApplyTeacher.com, I had a requirement to change the webpage in a different Frame. (After successful Login, the menu in top frame needs to be refreshed so as to change Login to Logoff). Also the login page needs to be redirected to the user page.

The following code did the trick

response.write(vbCrLf & "< script >" & vbCrLf)
response.write("parent.frames[''].location.href='';" & vbCrLf)
response.write("< / script >" & vbCrLf)

P.S. Remove the extra spaces in script tag.

Replace the with actual frame name and with actual page url.

This helped me to change the webpage in another frame and for the current frame (through which the user logged in), I simple used used response.redirect to send the user to his account page.

This script works fine in Internet Explorer 6 and Firefox 1.5 but it should work on all browsers.




April 25, 2006
SQL Lesson Learnt - Reserved Keywords



I ran into a petty trouble with SQL today which took me almost 3 hours to solve.


I was working on a Web Application for a client. Everything was going fine, except for two pages that were misbehaving in the SQL Query. (I am using MS Access 2003 as a test database)


Query was pretty straighforward:

* select * from language
* select * from tutor where language like 'English'


The ASP page gave me the message "Undefined error.". I kept scraching my head for nothing. At last I solved the issue by renaming the table name to "laguagetbl" and field name to "languagefld". That was the trick which solved the "Undefined error". I wish if there was some user friendly error message.

It took me so much time find out that "language" was a reserved keyword.

My Advise is be careful while keeping the table names and field names in your database. You never know when trouble is waiting.



Freelancing - Working Online and Making Money


Being a Graduate student, I had keen interest in development work. I always wanted to get involved in various types of projects. And it is always nice if you can make some money out of the projects you do.

Then I came across two such websites through which I could get what I was looking for.

* RentACoder
* Scriptlance


These websites provides opportunities to developers worldwide to get their hands on various types of projects that are of interest to them. Well that’s not as easy as it seems. To get a project you need to make a bid (Yes, make a Bid). The buyer reviews the bid by various people, sees their portfolios before accepting the bid. Now how to get a good rating at such a site? Well, you can get a rating directly from the buyer only after completing a project. A buyer may rate you from 1-10 (10 being best) after he accepts the complete project.



But about payment, which is an important factor that drives people there. These sites provides us with various option such as a Wire Transfer, Direct cheque, Paypal Transfer, etc. (Check the respective sites for details). Personally I prefer Paypal, since it is fast and easy. After receiving the payment using Paypal, I can do online shopping also. (Now that’s cool). Most of the sites accept payment through Paypal.


What is the guaranty that I will receive the payment from my Buyer? Well sometimes a dispute may occur, whether a buyer may refuse to accept the deliverables or the coder may be unable to complete the work on time. In such cases, RentACoder has an arbitration mechanism in which the arbitrator looks into the details of the project and the deliverables and makes a decision. And the person who looses the arbitration gets a bad rating. So, it is generally advisable that people use Escrow as payment option so that money is safe for both – the buyer and developer.



All this seems easy, but now I’ll say about the most difficult part. How to get your bid accepted? Plenty of people bidding for a project with different amount and time duration. Well, it depends on your current rating, your existing work, bidding amount and of course LUCK.


What does these websites get by providing this facility? Registration is generally free for the developers (I don’t have any buyer account). Well they deduct a percent of the bidding amount to keep themselves going on.

These days there are many different sites coming up with similar idea. A simple search leads to – www.elance.com, www.getafreelancer.com, www.getacoder.com, www.indianlance.com, etc

Happy Bidding !!!

(P.S. - I might be wrong, but thats just my opinion. This is my first blog post, will post soon more on current research areas - Grid Computing)