Friday, February 24, 2012

SQL server performance tuning - Avoid In statement

I fixed a slow nested query by replacing an IN statement with a join with a temp table. I believe this trick really works when the inner query is

Before:
Select From Table1
Where FKID IN (Select ID From Table2 Where...)



After:
Declare @Temp TABLE(ID int)
Insert Into @Temp
Select ID From Table2 Where...


Select *
From Table1 Inner Join @Temp tmp
On Table1.FKID = tmp.ID

Monday, October 24, 2011

Dwolla

I was really excited when I found out about Dwolla payment service. It offers not only a PayPal like payment gateway for websites, but also a very creative payment option for "offline" merchants in physical stores. The fees are really low compared to any other payment service and the idea that you pay absolutely nothing when you transfer money back and forth from your bank account is just great. Dwolla Spots application on the web or your mobile phone shows you information about nearby merchants.

On the downside, the service works only inside the US. This is something I hope I see changed in the near future. Dwolla does not support credit card payment from and to your online account. That's the whole idea behind Dwolla: skip the "plastic" to reduce costs. You have to transfer funds directly from your bank account.

In general I think Dwolla is great for small to medium businesses. They will be able to save a lot of transaction fees they pay to other payment services. I think it's also ideal to consider using Dwolla for a site accepting donations.

Saturday, September 17, 2011

Surely You're Joking, Mr. Feynman!

I bought this book from Amazon.com for $9.9 a couple of months ago. I'm reading it
slowly since then and it's a really funny book. That guy was really crazy, he tells you stories about working with Einstein in project Manhattan and then how he learnt to flirt with girls in night clubs after making it till college as a shy guy.

A couple of stories gave me the impression he's a bit tough on the emotional side, but that didn't  make it any less amusing. I also got the feeling that life back then (40's to 60's) was a lot easier than today. He seemed to have a lot of time to work, play, get married a few times and write down about all that.

I'm not trying to spoil your reading so I'm not gonna say anymore. Surely, I will look for other books for Mr. Feynman in the future.

Sunday, June 12, 2011

LEGO

I haven't played with Lego for years now, and back then I was too young to play with LEGO Technic. Last week, I suddenly couldn't resist buying this one (and it was cheap enough). It has two models included: a Jeep and a "buggy". Second options naturally appeal to me, so I picked the buggy. Building it was completed in like 2 hours, I thought it will be bigger and take more time but not bad for my come back.

And here's the buggy:

  

Wednesday, June 08, 2011

In Hartford Connecticut

I've been in Hartford, CT for a week now, and the first storm blew tonight. Not really a strong one, nothing we don't see back in Egypt. I'm just not used to rain in the summer. Today was also the hottest day this week with temperature reaching 35c.

Update Sep 17th: I wrote this post too soon and never had time to update it. Of course, since then I've seen a lot of weather I never saw before, not to mention hurricane Irene.