Thursday, December 31, 2009

I got tethering on my iPhone

Awesome!!

I am in india and using Airtel!!

Tethering @ Rs. 499 per month.


- Posted using BlogPress from my iPhone

Wednesday, December 30, 2009

Reason for outage

Just want to let the readers know that the outage was created during a system upgrade.

We use Microsoft Velocity as our in-memory cache, it was failing because the host server was down.

Took many days to fix, and even I missed using the portal the whole time. I am trying to transition to a state where we have no more outages eventually....

If you have any request for new features, let me know.

- Posted using BlogPress from my iPhone

Working with iPhone 3g in India


I recently got a new iPhone 3g from my warranty and currently in india for vacation. I am sure there are others out there in the same condition who want to use the iPhone 3g with an Indian carrier. I the phone unlocked and Then using Airtel prepaid with it.

To get it unlocked, ensure you have a wifi network to access, keep the AT&T sim card inside the phone and then run the Blackra1n utility from mac or windows.

After it is done and rebooted, install cydia and the unlock utility from inside the blackra1n iPhone app. Thus needs wifi and will unlock the phone for use with Airtel.

I tried pwnage + mac but had issues and errors in that unlock process. Ensure you have a phone backup before you do this. Airtel 2g definitely faster and more reliable than US At&T, but MTNL has 3g here, so I might move to that later. Vodafone does not have extensive coverage here, hence, I went with Airtel which had coverage even in remote areas.

Airtel 2g does not work by default, but requires you to sign up for that Rs. 500, one month GPRS plan. Not a bad deal.

- Posted using BlogPress from my iPhone

Today American Website Up

Right now the web site is up and running fine. No more changes or outages for a long time...

Sunday, December 20, 2009

Bloody windows 7

What is the point of having a lousy operating system when it can't even copy files from one drive to the other?

- Posted using BlogPress from my iPhone

Saturday, December 19, 2009

Consistent performance & stability

I am happy to announce that the today American website has consistent great performance and stability as of today.

Further hardware updates are coming tomorrow to make it an even more fast website. There are still some improvements we can make to the technical aspects ofthe site to keep it performant with more users. We will continue to maintain the momentum of new development in the future....


- Posted using BlogPress from my iPhone







Saturday, December 5, 2009

Use the iPhone app

The today American mobile site goes to the AppStore if you try to browse to it from the iPhone safari browser.

This is necessary as the site is optimized for the app now, and it gives me a 99 cent incentive for continuing development on the site.

It is very cheap, I really hope people will use the app. I have noticed that battery and iPhone performance is better when you view a site through an app rather than through safari.

- Posted using BlogPress from my iPhone

Thursday, December 3, 2009

Tech news approved in app store

Our iPhone app has finally been approved in the app store. I will post the link to it soon...


- Posted using BlogPress from my iPhone

Bing maps vs Google maps

In my last job I was asked to evaluate both mapping technologies and decide which one is better for an enterprise application. I evaluated both and the conclusion was that bing maps is more stable, and better for an enterprise application.

At that time bing maps was cheaper than google's. Today it is the more expensive one, but my conclusions were validated when we went ahead with google maps only to get memory leak issues in our code. Google fixed this issue, after several weeks of haggling, but now we have a performance issue...

I am happy I was validated, what is flashy is not necessarily the best choice for the enterprise which demands software with better quality, stability and which has been built using better processes.

Whatever google's advantages are, Microsoft beats them in the enterprise game.


- Posted using BlogPress from my iPhone

Wednesday, December 2, 2009

Create new instance of generic instance

T myObject = new T();

Set default value to generic object:

T myObject = default(T);


- Posted using BlogPress from my iPhone

Friday, November 27, 2009

Today American gets faster...

I have implemented stuff burning midnight oil which makes today American much more faster now.


- Posted using BlogPress from my iPhone

Thursday, November 26, 2009

Today american logout

People have been trying to logout, so I have updated the desktop site to support logout. After you login just press the icon of the person in the top right corner to logout.

You cannot explicitly "logout" from the mobile site though because mobile phones are personal and not shared. To be able to logout just clear the safari cache in the iPhone settings and you should be logged out after half an hour or so.

Comment and let me know if you need more features. I am still waiting for the app to come through the app store.


- Posted using BlogPress from my iPhone

Thursday, November 19, 2009

Today American up & running again.

Service is restored.


- Posted using BlogPress from my iPhone

Extremely sorry for persistent outage

I am still trying to figure out the problem.


- Posted using BlogPress from my iPhone

Data center down

For some weird reason the data center is down. I expect this to be fixed by evening.


- Posted using BlogPress from my iPhone

Monday, November 16, 2009

Fixed website issue

Finally found an easy way to blog updates about the site. The web site which has had many issues so far has been fixed.

Still working on bringing this to the app store...


- Posted using BlogPress from my iPhone

Friday, October 23, 2009

Tuesday, October 13, 2009

Weird SQL Server 2008 Timeout error gets fixed with today's Windows Update

I have been struggling to fix a weird time out error for my sql server
2008. This has been an issue for a few months now.

I am happy to say, today's windows update has fixed the issue.

Friday, September 18, 2009

Connecting a MACBOOK to a large monitor and turning off it's screen.

To do this, simple connect a keyboard to the macbook, connect it to
the display and then shut the lid of the macbook - works really well..

Saturday, September 12, 2009

posted an update to todayamerican

Would you believe it??

Today american mobile news portal is more popular than Google News!!

Adobe AIR is better than MS Silverlight

For all the hype around Silverlight, the simple truth is that AIR
works better. I have tried Silverlight and AIR on Windows and Mac. AIR
works better than Silverlight. Silverlight works as if something is
dragging its performance down. It could be windows, but it does not
matter, because AIR seems to work better.

Saturday, September 5, 2009

weird sql server deadlock error

"Transaction (Process ID 58) was deadlocked on lock resources with
another process and has been chosen as the deadlock victim. Rerun the
transaction"

If you get this error, it could be solved by ensuring that the where
conditions in query you are firing have indexes in the database table.

Thursday, September 3, 2009

get ipv4 address using windows ping command

It has been frustrating to me that I always get the ipv6 address when
I do a ping. To get the ipv4 address simply type in: ping -4
<host_name> Similarily, use -6 to get an ipv6 ip address.

Tuesday, September 1, 2009

sql server is acting up nowadays

I am not sure whether this is a bug or something else altogether. SQL
Server behaves weirdly, losing connections for no reason... I wonder
whether this is normal, or I am thinking that this is abnormal because
I never faced this issue the past 4 years using Oracle.

The last I used SQL server for a high transaction database (SQL Server
2000), it did hold up well. Now 2008 is screwing my life and making it
miserable.

tivo is good

While I am waiting for comcast to setup my home, I can watch recorded
programs on my tivo.

easiest way to remove sim card from the iphone

You may not always find something very small to plunge into the iphone
to open it. The easiest way is to use the small metal point of the
cable wire (which you use to watch tv). It fits perfectly within the
sim card slot and is long enough to pop it open.

Saturday, August 29, 2009

My opinion about "Is Jungle se mujhe bachao"

After watching the serial for the past few weeks, I have to respect
Aman for the dignity with which he carried himself. And, I absolutely
agree with his opinions regarding the people at the camp. About Marc,
I think with his behavior at the camp, he has proven to be a guy
without a backbone.

Definitely the Aman guy has got his morals right.

Chetan is just a follower and not a leader.

Akash is an animal not deserving of any respect.

The truth is always the truth and is inviolate.

Friday, August 28, 2009

snow leopard purrs softly...

Yes...

Now I see my mac is much quieter, much faster...

You can notice the difference in Mail and Safari

working on snow leopard now

Am not noticing much difference except that everything is faster!!!

My experiments with RAID0

As any developer would know, compiling a huge visual studio solution
takes a long time. Actually even a midsize solution compile is very
time consuming, so over the past few years, I have been trying various
experiments to see what really makes a difference:

1) Compiling on a server does not make very big difference.
2) CPU does not matter much
3) The most expensive RAM does not make a dent (even loads of it)
4) RAID5 does not make much difference
5) 10K RPM HDD does make as difference as does 15K RPM HDD

One sure fire way though is RAID 0 = inexpensive RAID card + 7200RPM
regular HDD makes a huge difference!!!

Windows 7 & vista a file copy which was done @ 2mbps max is done in
18mbps on raid 0 with 2 disks. Increase the disks and the speed
increases rapidly.....

Visual studio compiles like a Mae person!!! - amazing...

Wednesday, August 19, 2009

RAID0 on database server?

I don't think it is that bad an idea to have RAID0 on all servers if
you are a startup and have limited resources. As long as you are not
really mission critical and there are backups, you will enjoy superb
performance even with low RPM drives like 7200RPM.

After seeing the mind blowing performance, I am sold out on RAID
forever. Even for my desktops!

Tuesday, August 18, 2009

The advantage of doing RAID

I am astounded by the amazing performance I am getting with 3 7200 RPM HDD's configured as RAID0. It is quite amazing the speed even though the HDD's are not "super fast" by today's stds.

I got a 160gb hdd from frys for $50 making this a value proposition. It also helped that nvidia hardware RAID was embedded in my motherboard and windows natively supports it.

I have to now seriously consider this for future desktops (with backup though).

Monday, August 17, 2009

all sites up now

All sites are up running superfast on RAID0.

Today American site down for a few hours

After we changed the old server which had hardware issues, we used a
newer server. This one was good but had software issues.

We are fixing this right now and implementing hardware RAID as in
RAID0 - this should significantly improve performance.

You are affecte now, but there will be so much speed improvement that
I have to say it will be worth it. Now, finally we will have 3
dedicated servers - one each for database, app & web servers.
Interestingly, the most utilized will be the web and db servers.

You don't need equally sized hard disks for RAID0

Someone told me, I needed it, but it is not necessary. I just did it with different hard disks & it works fine.

Saturday, August 15, 2009

Sites are back online

We replaced the web server & things should be fine now.

Web server down

The server has an outage today. All today American websites are hence affected by this outage.

Thursday, August 13, 2009

Wednesday, August 12, 2009

Even the mac restarts for update

So I wonder why it is a big deal that windows restarts for updates. it is interesting though that windows now copies the way the mac restarts and updates itself.

SQL server 2008 install has issues with windows 7 RTM

Interestingly I am forced to conclude after using SQL server express
2008 on different operating systems that SQL server 2008 is a hassle
to install and get running on any OS.

2005 express seems to be better and without the bloat issues.

Concurrency & LINQ to SQL

We have had a lot of concurrency issues with today American and the
Linq context object. Right now the latest fix I have done is to lock
the context object while doing any db operation.

Seems to work for now...

I will post if there are further issues and find any new fix.

I have to use linq as it is faster for development and so far, though
it has been a pain to understand and learn, I think I am finally
getting a taste of how effectively to use it.

I want to use it for it's caching abilities which is why I like to
share a context object across threads. It is a shame that only one
operation can be done by it at any point of time..

Tuesday, August 11, 2009

Unable to run asp.net with sql server session state?

This is important if you have limited RAM on your web server because it is old:
 
aspnet_regsql.exe -ssadd -sstype c -S .\sqlexpress -d aspnetdb -E
 
Remove the -S .\sqlexpress option if it is a regular database. I needed to do this because the server was old. Usually people do it because they want another server to handle the session state.

Timeout error?

I am seeing this error increase when more people are simultaneously
accessing the site. For now, reload the page, I am looking into
various ways to resolve this.

Friday, August 7, 2009

Bestbuy & Magellan suck!

Magellan support is rude - as everyone knows, Bestbuy refuses to take in for warranty coverage a GPS which I brought through their website and picked up at the store.

Will never buy anything from Best Buy anymore - especially the store in Santa Rosa.

Hate Magellan, their 4370 gps is the slowest, worst piece of crap ever manufactured. Sent it for repair, got a small Tom Tom instead. Seems better than Magellan for now..

Updated my Win 7 RC to RTM

I updated my win 7 rc to rtm yesterday. Have to say it rocks! - very stable and better than vista or rc.

There are issues installing office 2007 or vs 2008 which get resolved either by lowering UAC to the minimum or running the setup as administrator. If neither works and the install fails win 7 will ask whether you want to install with recommended settings. Do that and eveything is fine.

Carbonite has issues opening up my backed up folders. I am not sure whether this is a win 7 compatibility issue or not.

Thursday, August 6, 2009

The best size for an apple tablet

I have been thinking about this a lot and feel that something the size of an audio cd, but thin as an iPhone 3gs would be just the right size for it.

Finally all performance issues resolved

We have been struggling with some performance issues since the data
center move. All issues are resolved at this point and the site is as
speedy as ever.

Dear today American user, I too join the ranks of people who acces the
site from an Internet connection (rather than my old gigabit LAN).

So, our user experiences should be similar now...

Monday, August 3, 2009

asp.net = steaming pile of horse dung

This is my opinion after trying to make the website run with session
state in sql server 2008 and windows 2008 server

Found 100 issues, and lot of unhappy people chasing unwanted problems
trying to get this simple thing to work.

It used to work before, now it has become horse dung

Instead of spending money duplicating other company's business plan,
MS should focus on getting the basic stuff working correctly.

Saturday, August 1, 2009

An Interesting Discovery

I have done a lot of multi-threaded programming, but learnt a basic thing today... What is executed on a timer method runs blocking the main thread. So, if you want it to be multi-threaded, create a thread within it...

What this means is that if you have explicit code within a timer event handler, then when that executes, it blocks the main thread if anything is running on it. So, to get the best performance, do not write code directly within the timer event handler - create a new thread and have it do the work.

The best way to create threads without too much hassle is to use ThreadPool.QueueUserWorkItem()

iphone 2G jailbreak with OS 3.0.1

This is not clearly indicated anywhere.

It is easy - update with itunes as normal, the phone will come up as
locked.

Download redsn0w from the iphone dev team

Give it the OS 3.0 ".ipsw" file from the place where itunes keeps it.

Give it the boot-loader files which you can find easily from previous
jailbreaks.

Follow the instructions after reboot, the phone will come out unlocked.

You can restore from a backup after that.

all our websites are up after the data center move!!

It took 2 hours yesterday to get everything up & running...

The internet connection there is faster, so everything must be very
fast.

the easiest way to put the iphone into the recovery mode

http://www.theiphoneblog.com/2009/01/29/iphone-101-put-iphone-recovery-mode/

Thursday, July 30, 2009

Convention over Configuration

I have done this over the years without realizing it has a name!!

I had this philosophy that by default the application works on
developer machine just by getting the latest version of the code.

Only in deployment it needs configuration.

CoC just means that you don't have to configure if you follow the
default convention which the application is built for.

Nice to know this has a name!!

why not to use website project in vs2008/2005

In some cases, there is no choice, because of the huge number of files
in the web project, but one problem with the website project is the
amount of time taken to build it...

Too painful and long...

Wednesday, July 29, 2009

Improve wifi performance and get faster Internet speed on many devices

I have a wired linksys router at home for desktops and a separate
belkin wireless N router for all other devices.

If there are many wifi networks in the area, switch on protected mode
to improve performance and make it pass through so that the wifi
router only acts as a pass through and leaves routing and DNS
functions to the wired router.

Netgear does not have an easy way to do this, though belkin has. This
router works very well.

Friday, July 24, 2009

There are so many tech jobs out there... Where are the Americans?

They say that h1b holders take away American jobs. Take a look at the job sites and you see so many jobs all of which are exclusively for American citizens or green card holders.

They remain open for months. So, where are the American citizens whose jobs h1b guys have taken away?

Why are they not filling up these positions?

It is a lose - lose proposition. The truth is nobody is able to fill up these jobs....

Monday, July 20, 2009

RadGrid get_masterTableView() method returns null?

I faced the problem, the resolution is to put an empty function within
the OnCommand client side event declaration.

This is why I like Infragistics better - no weird suprises which are
not documented.

Friday, July 17, 2009

Got laid off today....

The recession finally caught up with me!!

Unfortunately, this means ads on the todayamerican website!!

Sunday, July 12, 2009

VMWare Fusion is Beautiful...

I really appreciate the fact that it works very, very well.

Very, very fast. My XP VM is so fast, I cannot believe I am using a VM!

My mac just has a 2.0 GHz processor...

Saturday, July 11, 2009

iPhone 3GS does make some difference

I was at the apple store today to upgrade my MacBook to 4GB RAM, I felt that better than to upgrade the HDD and install windows using bootcamp. It is too difficult to restart the machine just to use windows. With extra RAM and vmware fusion which works very well & fast, I can think about a HDD upgrade when I really run out of space...

The Mac works even more fluid with the extra RAM. Anyways, I digress...

I checked out the 3GS at the store and surprisingly found it did not even have any indication of being 3GS from looking anywhere in the shell.

Checked out the compass, nothing gr8

What I really liked though was the extreme fluidity of the entire software. Too smooth, too agile, too good.
Makes you really wonder whether you should get it.

The "pain" points using the iPhone are the slight lags everywhere which you think are inevitable. It is extremely nice to see a UI which is so fluid & fast. It does not seem slow at any area.

I did play video also which gave the same feeling. I really think we should wait for the next year. If it's gets faster than even this, it will be amazing. I have many email accounts. It will be great to get all the speed I can get.

The best windows OS

I have used almost all windows OS's from Windows 95, 98, 2000, XP Pro,
XP Pro x64, Win Vista & Win 7

My favorite OS is Win 95. I really liked it, every OS which came after
that was not as good untill XP Pro SP2, and now SP3.

Win Vista may seem OK if you use it for a long time, but after
installing Win 7 RC, I realized that Vista is the Beta OS, and not Win
7.

Summarizing, Win XP is the best OS which MS has ever made. It is sad
that they stopped working on it, when it clearly is a very stable OS
without flashy stuff which makes it crashy.

Try using office 2007 in vista or win 7, it sucks. It works best in
Win XP - surprising!!

I don't know how long it will take win 7 to be like win XP - as in
stable and usable and fast.

vmware fusion is better than parallels

I needed to install windows on my macbook for presentations & demos. I
have used parallels before and did not like it as it is slow and a bit
confusing. I used vmware fusion in my previous job, and so I decided
to install it on my macbook. I like it better because it is simple
without too many features, works well and is fast.

It is definitely more usable.

Thursday, July 9, 2009

Is web objects like Howard Roark?

It is sad that it got overtaken by late comers like .net & asp even
thoughit was much ahead of time. It seems to have been among the very
first web development programs, killed first by pricing, and later got
too late. Unfortunately MS dominates the OS world, and they have got
too boring with time. Used to be a PC until I got tired of slow &
crashing machines.

Tuesday, July 7, 2009

The Gunnar Optics Computer Specs Work!!

I got one with my prescription, and I am using it right now. Definitely, there is some difference using this specs which I have not found with any other glasses. I am going to test this a lot in the coming days.

Thursday, June 25, 2009

How Todayamerican works

Google redirects to my blog, so I thought I would briefly explain how
the site works. The domain name is the same, you type in todayamerican.com
, you go to the mobile site on the iphone and you go to the desktop
site if you are on a computer. This redirection happens automatically.

I have changed the old home page on the desktop & put the new one in,
because I get more people relevant to tech news on the site. I am able
to serve better content to these users, so I changed this.

The idea is very simple - no ads for now, I have seen hit counts go
down when ads are added. I use the site myself & would hate to see
ads. You press the forward arrow to move forward.

If you login, then I make sure you rarely see content you have already
read. I know there was the duplication issue because some tech blogs
duplicate someone else's stories. I have reduced duplication from the
enty side. I tried to reduce duplication from the reader's end, but
because those queries are weird it takes a long time to execute. I am
working on a better fix as we speak. If the solution loads the server
then the site will be slow, so I have to have a fix which minimizes
the database load by not doing long running queries.

It is complicated & technical, but you must get it now - I am working
on it. I want my reader to be the best!!

Monday, June 22, 2009

Opera Unite & The Fountainhead

I have been hearing a lot about Opera Unite. First there was the hype,
and now there is the slamming. Many people are slamming it so
viciously in their blogs, with so much profanity and rage that it
reminds me of Ayn Rand's book "The Fountainhead", where Howard Roark
builds something amazing, but everyone blasts him in the reviews.

It is not clear why all these guys are enraged so much about unite. Is
it because they can't come up with anything like it?

One guy who has added comments is the co-founder of Milo.com. The idea
seems to be that if you cannot come up with an idea worth half a cent,
lambast the guy who does!

I don't hate Unite, I am a bit sad and a bit happy about it.

Tuesday, June 16, 2009

Opera Unity = Sparrkle

It's a bit sad, but inevitable I guess. Opera unity seems to have
taken the business plan of sparrkle.com & implemented it word by word.

It is sad, I could not get funding for this in the bay area, and
someone else has come out with exactly the same thing. They have the
money & the man power I guess.

Sunday, June 14, 2009

Tuesday, June 2, 2009

Signficant Performance Update to HP XW4400 Workstation!

Just download and install the latest BIOS update from www.hp.com. This significantly improves the performance of the computer.

Monday, June 1, 2009

RadTreeView control is null in Javascript

If you have a RadTreeView control in a page, and in the footer javascript, you try to get it by "$find", it might return null. This is because it did not get time to initialize the tree object.

So, within a setTimeout, call another function after 200ms, and then inside that function, if the object is null, try calling "$find" again.

This worked for me.

Monday, May 25, 2009

My domains are on holiday for the long weekend.

Todayamerican.com & sparrkle.com will be up & running again sometime
late evening tomorrow.

We are on vacation now. Tahoe is amazing. Went on the Gondola, would
love to come back in the winter.

More observations for Mac

Unlike public perception, software is cheaper for the Mac. Even OSX is
not sold splintered into different versions like windows.

Office 2008 is far more cheaper than office 2007 for the PC.

I get better overall program performance on OSX rather than windows.
That said, I personally like the default OSX mail client better than
MS Entourage.

Seems that MS ventured into OOP programming after that was popularized
by Steve Jobs & Web objects which powers iTunes.

I think if Apple follows the current path of the iPhone and improve
OSX similar to that, nobody will buy windows again. But, that is a
while away and also means Apple will gave to provide an easier
migration path from PC's to the Mac, by combining the best of both
worlds.

These are simple stuff like keyboard shortcuts, window maximization &
minimization etc. Apple has to swallow the bitter pill like they did
with MS Exchange. If they do so, and deliberately attempt to be more
popular, then they can definitely beat the PC at it's own game.

This is what the iPhone has taught me.

Sunday, May 24, 2009

How to buy a unibody Mac for the lowest price...

I got my MacBook air a few months ago and since then I have been
looking for a MacBook online.

I need a MacBook because my office has MacBook adapters in all
conference rooms and no wifi. So even though the air is gr8, it is
difficult carrying around a lot of adapters.

Why not a pro? - because before choosing my air, I went to bestbuy and
weighed every PC & Mac notebook. The pro is too heavy for me. The
Macbook is heavy too, but manageable, I think.

I looked at craigslist for a month. 90% of mac listings are fake, the
few real sellers expect the poor suckers (buyers) to shell out more
than $700 cash for notebooks which are more than 2 years old!!!

Electronics fail over time. Buying something that old for that high a
price is not acceptable for me. The apple store is too expensive,
gainsaver is nice but the systems are too barebone and they are used
too. No 30 day warranty for me.

Ultimately, I have brought a new MacBook for eBay, saving several
hundreds over the price, no tax and most importantly a $95 cashback
from live search!!!

So for around a thousand bucks, a new notebook which costs more than
$1200 everywhere else. I still get the warranty, I still get a new
notebook - not refurbished, used or open box.

I think it is a gr8 deal.

Happy B'day to myself!!

Friday, May 22, 2009

Windows 7 definitely better than Vista

I did not believe when I heard first. But windows 7 is definitely
better than vista in everyway. After using 7 for a week, it seems like
Vista is the alpha software.

No more hangs, crashes and even videos play without 100% CPU usage.
The video card on which I spent a fortune is actually doing it's job
and producing crystal clear video on my 45 inch LCD.

Monday, May 18, 2009

Installed Windows 7 build 7100 RC

I have been using vista sp1 for sometime now. As my PC started
behaving weirdly for the past few days, I installed/ upgraded to
windows 7 yesterday. So far, so good. The machine is much faster now.

Wednesday, May 13, 2009

Another problem in Infragistics UltraWebGrid 2007 Vol 2 + Hot Fixes

If you have a templated column in this kind of grid, you cannot create columns for the grid only on page not postback, because the grid does not instantiate your custom template column (using ITemplate) on postback.

The only way to fix this is to create the columns afresh on every page load on the server.

This is when you create columns for the grid in C#

Why my Infragistics Grid was not firing the paging event and not binding properly.

I use a base class for all the infragistics grids in my project so that if anything changes tomorrow, I can change it from one place. The problem was happening because I was doing the following within initialize data source of my code, which is really conditional, and should not be turned on for grids which do not need this functionality:

            base.Browser = Infragistics.WebUI.UltraWebGrid.BrowserLevel.Xml;
            base.DisplayLayout.LoadOnDemand = Infragistics.WebUI.UltraWebGrid.LoadOnDemand.Xml;
            base.DisplayLayout.ViewType = Infragistics.WebUI.UltraWebGrid.ViewType.Flat;

Monday, May 11, 2009

How to access a JS method inside a frame

This is not straightforward as you cannot access these methods directly from the parent window.

.contentWindow.();

Monday, May 4, 2009

My new iPhone website

After getting frustrated with news reader crashes and seeing no
updates in the available iPhone news apps, I have gone ahead and
created an iPhone specific tech news website.

Just open safari in your iPhone browser and point to: www.todayamerican.com

The site will look good only on the iPhone. You will not need to zoom
in to read.

If you do the one click registration & login, I keep track of read
articles automatically. You never need to see already read news ever
again.

The site will see more features soon. Expect outages during evenings @
PST.

Thursday, April 30, 2009

How to add a control to the header of a UltraWebGrid Infragistics control

I found this link:

http://devquirks.com/SelectAllGridColumn.php

But note that the click event does not get fired on the server.

Office 2007 horribly slow?

Because of the search integration within it, I know for a fact that
office 2007 makes your PC very slow. I also know that when you have
many emails in your personal folders, outlook 2007 is the slowest app
on the planet.

Announcing a solution! - day before yesterday Microsoft released a
slew of updates including office 2007 SP2, SQL server 2008 sp1,
sharepoint sp2, etc.

This resolves all performance issues with all these software. The
major improvements are in the performance of office 2007, IE 8 &
sharepoint.

Sharepoint was a crawler till now. It became a corvette after the
update.

Wednesday, April 29, 2009

One feature no .NET OR/M tool provides

Here's an interesting tidbit. There is one thing my OR/M tool can do which no other OR/M tool in the world can do - mine is the only one which lets you create entity, criteria and interface classes for a complex stored procedure which contains insert statements, temp tables, etc but still returns a resultset.

Every other OR/M tool analyzes the stored proc and says it is an action stored proc. I don't analyze the stored procs automatically, I let the user enter the parameters, run the query and then depending on the resultset, I generate the criteria, entity and interface classes.

So, it beats LLBLGenPro, LINQ to SQL and Entity Framework. None of them support these stored proecedures!!!

It is a shame guys!!

Response to: Stored Procedures Vs Dynamic Queries

 
I have a difference of opinion here, because I have also built an ORM mapper/ code generator before. My opinion is that, the whole area of dynamic queries being faster and better than stored procedures only makes sense in the context of having stored procedures for specific tables. Which means, when we have a tool which directly operates against tables then it makes sense to have stored procedures vs dynamic queries, and there dynamic queries can be recommended because we are only talking in the context of a single table.
 
So a C# developer can write the query in C# and have a better dynamic query than the code calling a generic stored procedure because it is generic.
 
However, in big, real world applications, nobody works in the context of a single table all the time. Mostly, what we retrieve spans multiple tables and complex queries. What we insert may also span multiple tables. So, it becomes more difficult for a C# developer to write a complex query like that in C# and still have it as optimized.
 
Because of this, in such situations, stored procedures will actually work better, faster, and have lesser chances of error because it is written by a database guy, and it is easier to write complex queries in SQL (notwithstanding the newer advancements in LINQ).
 
So, I think every ORM tool must fully support stored procedure code generation, and stored procedures are fully valid in these cases.

Monday, April 27, 2009

How to handle multiple windows with different states in a web application

I know a lot of people have written a lot of ways in which to do it. But, I have a way which I think works when you actually consider that a new window is a "GET" on the server. Most of the implementations floating around are for "POST". The really difficult problem to crack is that, there is no way for the server to know whether the "GET" which is being processed is a page refresh request OR a File >> New Window Request. There are two ways of doing this, depending upon which kind of application you are:

The Easy Way

The easy way is only possible when your application opens in a full window mode (business application), and you do not show anything like the address bar (even if it is shown, this has to be read only), and you do not show any browser buttons OR right clicks.

This is simple:

1. Every time a window is opened, have a window identifier in the query string.
2. Use this identifier on the server as a part of the key while storing anything in any shared storage for the user (like session or cache).
3. This ensures that for different windows, the server stores the information with different keys.

This works very, very well. Users like to use the cool "New Window" icon to open a new window. 

The Difficult Way

I went through a struggle to get this going because, in a regular browser application, the user can hit the browser buttons and also, change the query string. So, there is no apparent way to handle all these events and ensure that we get a unique window key when the user presses, Page >> New Window, because there is no way to detect whether the user did that from the client.

This is how I finally did it:

1. Used a base class to do all the processing.
2. Uses logic similar to method 1 (first section) for window identifiers.
3. What I did was ensure that before every user request from the client, an AJAX call is made to the server to update a variable.
4. It is possible to detect page refreshes done by the user through any mechanism using the below:

        window.onbeforeunload = function()
    {
        if((window.event.clientX<0) || (window.event.clientY<0))
        {
            HandlePageRefreshButtonClick(); >> Make Ajax call inside this function, and then in callback event.ReturnValue = true so that refresh will happen
        }
        else 
        {
            HandleRightClickPageRefreshClick();
        }
    }

5. So, page refresh is covered, for any actions from your page, you can do the AJAX call to update the server FLAG before doing the actual GET request.
6. Any request which goes to the server which does not have the FLAG set will thus be the "NEW WINDOW OPEN" request. This can be handled, and you can redirect the user to the same url but with a new window identifier.
7. Clear the FLAG at the end of every page load, so that it is set only before a new request comes from the server.
8. This means, before you redirect also, you need to set the FLAG in the session. An easy way is to handle all redirect methods through a static method in your class rather than the ASP.NET Response object.
9. Ensure that all links in all pages call a JS method, and this method makes the AJAX call before you open a new window or go to another page. This can again be abstracted into a generic JS class.
10. On the server, to see whether you need to redirect with a new window identifier:
         a. Ignore for login page.
         b. Ignore is page is posted back.
         c. If FLAG is null, user did not request the window explicitly - so handle this case.

11. If a user modifies the window key manually, then handle that case by again generating a new window identifier on the server and redirecting to the same page with the new identifier.
12. You can handle Ctrl + N also, and ensure before page refresh to make AJAX call.
13. Remember to use ALL session variables WITH the window identifier as the key, otherwise, the session will leak to the other windows open.
14. If you encrypt the query string, remember you will not find it easy to send new values through query strings anymore. Remember to allow for url decode and encode after encryption and before decryption.
15. Even the script manager used to have the web service reference on every page can be injected into every page from the base page

The method is kind of complex, but it does work for 2 GETs. I have tested thoroughly.

Saturday, April 25, 2009

Why Modern Education might lead to the demise of civilization

I was thinking about the way in which modern education is taught in schools today. And I realize that the way in which we ram down theorems and rules actually harms the ability of children to innovate. The problem is that instead of discovering how stuff is done, they are taught in an hour what might have taken someone years to find out in an earlier age.

What is the problem with this?
- There is so much indoctrination that we get trapped within the boundaries of what we have been taught or what we have read. How can we think out of the box, when our mental model itself is made of the box?

I mean that, if a person has not done a PHD, he might be able to find out a better solution than a PHD simply because he is not thinking confined to the boundaries of what he has learnt. He may be wrong most of the time, but there is a 1% chance he might come up with the next theory of relativity.

Maybe Einstein was not intelligent – he was very poor in school, maybe he learned so less that, in the process of thinking based on his own thought model, he was able to come up with something different. Maybe no-one else has come up with something as big as the theory of relativity because they have learned too much?

I have seen toppers in class unable to think straight when confronted with a problem – because they are very good at learning what someone else had figured out, but never learned how to figure out something on their own. So, I say, the more we learn, the more we bind ourselves in mental shackles.

Why has India never come up with an Einstein or a Thomas Alva Edison?
Because there is too much indoctrination, too much mugging up, too much stuffing the brain with stuff other people struggled to understand over the years and came up with thinking from scratch.

We tend to forget that education, like software should be tailored to the human brain, and not the other way around.

If a student fails in class, maybe it is not the failure of the student. Maybe it is the failure of the education system which is not able to get through to the most advanced computer ever designed – the human brain.

Maybe the student who fails is the best suited to come up with the brilliant innovation 10 years later, and the topper is destined to be struggling trying to resolve a problem nobody wants to solve. An interesting way to look at it is that, when a software crashes a computer, we do not blame the computer – we blame the software. If education is “software”, and the computer is the very different, unique, special human brain – why is the brain said to have failed?

If we understand this, maybe we won’t collapse like the older civilizations have in the past...

Thursday, April 23, 2009

The problem with Microsoft

Somewhere down the way, Microsoft lost its soul. I now see it as a “has been” company where they copy whatever is cool out there and then announce new projects which they drop like hot balls after sometime. It is really pathetic what they have become. The only thing I like about Microsoft Software is their Visual Studio suite, but as everyone knows even though coding is easier, the end product is not.

Windows applications are slow, and WPF is a farce. Even silver light which is based on it is pathetic. I really wish MS had spent the time developing Script# into a real platform than wasting time on WPF. It would have been lovely to finally have an object oriented way to write client script for browsers. I love the fact that script# compiled to JavaScript. It is a really awesome idea which has been ignored by Microsoft because of vested interests, rather than technology.

I say this time and again and I will re-iterate once more, the failure of Microsoft to develop a proper phone OS with so much time on their hands, and the way Apple came up with the iPhone OS, and how MS shamelessly tries to emulate it now, so many years later.

C’mon... Apple has to show every other lousy phone OS maker that it makes sense to have a phone where its firmware can be updated for new releases and patches. This is not high science – it is purely what happens when technologists run a company to make better software compared to a bunch of business people trying to figure out how to crawl their way around by spending less and utilizing existing resources rather than coming up with a better solution which fits the problem.

The solution should fit the problem and not the other way around.

Software was made for humans, and not the other way around.....

Tuesday, April 21, 2009

To add features or not?

It is very interesting for me when I look at it today - the way Apple
does new stuff versus the competition. Everyone else tries to stuff
too many features into too less and nothing works well.

I think Apple had the audacity to pare things down to the minimum and
the strength of character to determine which features mattered the
most in the beginning.

The interesting part however is that, by adding new features later in
the game, and often after the open source community, they gave the
users time to learn & understand the new stuff while giving themselves
time to do stuff properly & get a stable product in the bargain.

Why the mac netbook will be a hit

The Mac netbook will be a hit because OSX works 5X faster and more
stable than Windows on the same hardware. With the Air, Apple already
has some experience building a fast experience into a restricted
space. It goes without saying that the end user experience will be
great because of this.

Just take the iPhone as an example of one of the fastest hardware-
software combo's available as a phone. I have tried the rest, most of
it sucks bad.

Monday, April 20, 2009

So many companies closing shop...

It is a dismal time to be in America now. Especially, in silicon
valley, these companies are closing left and right. People are being
fired.

Friday, April 17, 2009

How to buy a good Mac

I have heard many people complaining of problems after buying a Mac, or anything from Apple for that matter. But, I have never had any issue with any Apple product except an iPod I brought a long time ago. I have managed to have a fault free experience so far because I always wait a year or more for the product to stabilize and for the prices to go down.

This has gone pretty well so far. I waited almost 2 years before buying my first iPhone - it never had any issues. Then, I got the second iPhone (3G) one year later - works perfectly. MY latest acquisition is a MacBook Air with the SSD hard disk. I got it for less than half the price and it works beautifully so far!!

So - whatever they tell you - it is better to wait for the problems in the product to get resolved.

Thursday, April 16, 2009

And the mac wins!

I found other areas where the Mac won hands down over a better
configured PC:

1. Better utilizes CPU and gives much better performance over similar
or higher configured PC's.

2. File transfer over a wifi network 10X faster than much, much faster
PC.

3. Video playback much faster, lesser crashes than much better
configured PC.

I am surprised that when you consider a program which can be installed
on a PC & a Mac, the Mac runs it better and faster even on lesser
hardware.

We a comparing a 2.4 GHz, 4GB RAM laptop with a 1.6 GHz, 2 GB RAM air.
I am wondering whether this is because the PC development tools are
too much backwards compatible that it is dragging it back.

You must have read my previous posts on www.todayamerican.com on how
Vista bests XP in some ways?

Well I think the very advantage of a PC - that it has more programs is
it's undoing, because definitely it has quantity, but not much quality
(in comparison).

I have tried out various Windows flavors on different hardware, the
only one I have liked is windows 2008 server. Vista is not adequately
performant even on very expensive machines ($4000+).

I think the next step for any long term windows user is a mac -
because of it's speed, performance & stability.

Tuesday, April 14, 2009

MSMQ a bad choice for enterprise applications

I have learnt the hard way - MSMQ is a really bad choice for an enterprise messaging solution. MQ Series is a better option.

Linq should not be used at this time for database access, if too is not production quality at this time.

WCF is fine now - after .net 3.5 sp1.

WPF sucks big time - wait for atleast one year before going ahead. If you don't believe me true the times reader app from nytimes.

I hate recruiters who want developers who are good in the front-end, middle tier & the database. They end up getting people who can do all 3, but not very good in any of them.

Sunday, April 12, 2009

Search across all your machines & Download files - seamlessly & securely

I would like to take a few minutes of your time today to introduce what I have been working on since March 2008. I call my site: www.sparrkle.com and it resolves one of the problems I have had for a long time.

Like any other geek, I have many computers at home and office, and there have been times when I know that something which I need is on one of these machines. Till today, there has been no way for a person to securely search across all her/ his machines and download files - from any of her/ his other computers.

So, I have built sparrkle.com which lets you download what is effectively one year of my life. It uses windows desktop search, sql server express and a variety of windows services on your machine to let you search all your computers. Once you see the search results - simply by clicking on the file name, you can download your file from any computer which has sparrkle installed on it. No need to worry about firewalls, complex configurations, nada - nothing. Just click to download.

It is completely seamless, and very, very performant. I have spent months testing it for stability, installation and performance. I hardly noticed it when I was using it from a $400 laptop from Walmart, with a 1.6GHz AMD processor.

It is very secure, your information is transmitted using encryption and if some machines are offline, when they come online sparrkle will automatically query those machines and retrieve the search results. By default, you don't have to open any incoming ports on your firewall.

Basically, all you really need is just the windows install and that is it! - You can register after installing the software. The only pre-requisite for sparrkle is windows desktop search on pre Vista machines.

If you are interested in this solution, I would really be thankful, if you atleast visit my site so that I can know how many people would like to see a software like this.

True love...

True love is a weird thing,
It never happens in a flash,
Or at the first glance

You spend years alone,
Loneliness becomes your best friend,
You see happy couples all around,
You wonder when you will find the one

She is definitely out there somewhere,
Maybe she is right beside you now,
She is the one who has always been by your side

Amazing!

The father of fiber optics is Narinder Singh Kapany, who is a punjabi
sikh!!

Without this man, there would be no Internet today...

Saturday, April 11, 2009

.Net Secrets

Don't use static methods for writing middle tier methods.

You will need to call the GC explicitly if you are writing a .Net 1.1
application.

If you use .net remoting, every class you want to truly run remotely
has to be included in the remoting client & server config files.

The biggest reason to migrate to .Net 3.5 is for using LINQ, but not
for database access.

As of this time silverlight or WPF is not robust enough for a
production application.

Windows 2008 Server does significantly improve your app speed.

Yahoo iPhone App - Nice!

I have to say that Yahoo has done a gr8 job in their app for the
iPhone. The NY Times app used to be the only other option, but once it
started crashing, it has been pretty much unusable.

I went through the crazy objective C language a few days back and feel
"no wonder!!". When are these guys going to make things better?

Apple should implement a higher level popular language like C# or Java
so that more developers can learn iPhone programming easily and build
stable applications.

The kind of features you find in Objective C maybe powerful &
flexible, but the syntax is like a crazy, mad beast!!

Friday, April 10, 2009

The Software Development Lifecycle

It is an interesting question to think about - which is better? - the complete adherence to processes or the complete lack of one. My opinion is that the answer lies somewhere in between and both extremities are not effective. Some people can do very well without any processes while others need step by step instructions on how to move forward.

Too much adherence to processes can only be done in companies with unlimited money & time to kill. Take the example of the recent case of a person leaving Google because of weeklong meetings on which of the 48 shades of blue to choose.

In startup companies on the other hand, because of the lack of time, people usually follow no processes leading to disaster. In today's world where there is a lack of time, it is essential to me able to come to market quickly otherwise you lose your advantage. See the case of Microsoft and Vista. It took more time & had a lousy reception even after it arrived.

Wednesday, April 8, 2009

How apple can beat microsoft

I think one way for Apple to quickly increase their user base would be
to sell OSX as software which can be installedon any PC. I can
virtually guarantee that most iPhone users with PC's will consider
buying it.

Also I see the OSX as being a very good replacement for the computer
connected to the TV in my living room.

It can give very good performance - this I have noticed since getting
my mac. Only problem is, now I think all laptops are obscenely heavy!!

Tuesday, April 7, 2009

There's a book which is Life. And a writer who's God.: White Weird Thoughts

http://nambradth.blogspot.com/2009/04/white-wierd-thoughts.html

I liked the above story.

Apple released new iTunes 8.1 Update!

I just found this out. Try running apple update on your windows/ mac. It improves performance supposedly.

By the by, I just installed office 2008 for mac. It is pretty interesting I would say!

Getting to know my new Mac

Nowadays I am getting to know my new mac better. I got office 2008 from macmall.com, but was pleasantly surprised to see that the mac could open word documents even without anything installed on it.

I like the default email client. I think it works on IMAP way better than any windows client including outlook express or even ms outlook itself. In fact it is my observation that ms office 2007 significantly slows down a computer.

I am not sure what the reason for this is. Why is the mac more performant than a better configured PC?

On the other hand, I do have some peeves like no right click button on the air (what were they thinking?) and the difficulty to get a window to go full screen (maybe there is an easier way than dragging the mouse).

Windows does not have anything like spaces & my biggest complaint with it is that it has not changed much since windows 95 in a fundamental manner. They should do something so that for different classes of users they can provide drastically different stuff.

Windows is boring...

Monday, April 6, 2009

Welcome to my blog!

I have permanently moved my blog here now. Mainly because it is easier to publish and quicker to post stuff here. This is the default blog for my website: www.todayamerican.com - be sure to take a look when you get the chance.

The latest news is that I have a new website now @ www.sparrkle.com - check out my application which connects with windows desktop search and lets you search all your machines from anywhere.

I was a pc, became a mac now. I got a really sweet deal from the apple store - the air is an awesome machine primarily because it is not slow and it is sooooo portable. When I went to Best Buy to try the laptops, I looked at many brands, but I loved the air even more than the gorgeous 15 inch macbook pro because it is really light and I love the edge of the air - which is so thin, my wrist does not hurt while typing. It helps too that the keyboard has a backlight, and speed is not an issue because I have the air with the 64GB SSD option.

I have been a PC for so long. What I like about the Mac is that it is simple, fast and does not have the loads of junk which comes on a windows machine. I just wish it were slightly cheaper so that more people could discover it. However, I do think the Mac is better for geeks than for common normal users because it is more technical than the PC. I wish Windows could come in such a version with everything pared down to the minimum.

Expect to see some iPhone apps soon.