Monday, February 25, 2008

Windows Mobile Development: Tips 'n' Tricks

[Been meaning to post this a long time back but finally got to it, so here's an initial dump]
  • Sometimes changing a registry key manually via CE Remote Tools doesn't seem to persist, especially noticeable if you soft reset right after changing a registry value. This is a known behavior due to disk buffering/writing optimizations and clarified in this blog post. If you write a registry key programmatically and you want to be absolutely certain its written out to disk, you can either use native RegFlushKey() call or, in .Net CF, the Flush() method of RegistryKey class (Note that RegistryState does not offer a flush mechanism). Use this flushing sparingly and after a group of registry writing activities rather than after each call.
  • Smartphone/PocketPC Detection:
    • This article highlights the deprecated features in Windows Mobile 6. Note that it mentions SPI_GETPLATFORMTYPE has been deprecated to be replaced by SPI_GETPROJECTNAME . That's important, as that is usually used to do intelligent behavior to handle Smartphone / PocketPC in the same code. Interestingly, even on WM6, SPI_GETPLATFORMTYPE still seems to work. So it is yet to get phased out in the early WM6 AKUs I guess.
    • Another way is, if you use same code but shared in separate projects for PocketPC/Smartphone via Visual Studio you get two pre-defined constants 'PocketPC' or 'Smartphone'. You can use these via '#if' directives.
      • In case you are wondering how to add a source file as a link in Visual Studio [From MSDN]: "To add a source file as a link, right-click on a project in Solution Explorer, and then click Add Existing Item. In the Add Existing Item dialog box, select the file that you want to add. Instead of clicking the Add button, click the arrow to the right of it (as shown in the following figure), and then click Add As Link.".
  • Doing processing in form Load call: If you have a form Load event handler where you wish to do processing after the form has loaded but wish to display form first while you process information Do a DoEverts() call after this.Show(). The form gets rendered first while you do further processsing in the Load call.
private void Form1_Load(object sender, EventArgs e)
{
this.Show();
Application.DoEvents();
DoStuff();
}
  • Use SHGetSpecialFolderLocation to get the standard folders path on PocketPC/Smartphone: Not only is it safe in internationalization, but also you skip some systemic differences. For example, if you want to programmatically create a shortcut (via SHCreateShortcutEx) to your application to show in the the Programs folder then on Smartphone the folder is "\Windows\Windows\Start Menu\ " or on PocketPC it is "\Windows\Start Menu\Programs".
  • Connectivity Detection in WM6
    • Some very interesting properties can be found in the SystemState class in Microsoft.WindowsMobile.Status namespace (and dll).
    • Some interesting properties are
      • Number of network connections: SystemState.ConnectionsNetworkCount
      • Get the phone GPRS coverage : SystemState.PhoneGprsCoverage
      • SystemState.PhoneBlockedSim
      • SystemState.PhoneInvalidSim
      • SystemState.PhoneNoService
      • SystemState.PhoneNoSim
      • SystemState.PhoneRadioOff
      • SystemState.PhoneRadioPresent
  • Assembly Strong Naming, Type Loading and Plugins
    • Trying to load types dynamically using the AssemblyQualifiedName, say via Type.GetType() (format: [assembly], [version], [Culture], PublicKeyToken=)
    • The assembly has to be strong named to load a type by version. If its not strong named, then the version you specify is ignored, and the type would get loaded from an assembly irrespective of version.
    • Also, the assembly name is the name of assembly during the creation (i.e. during strong naming process). I.e. if you rename the assembly, and try to use the new name to load a Type from it, it will not work. GetType looks into the assembly metadata to get the original name of assembly.
    • If attempting to use this in say a dynamic plug-in manger/plug-in model you may come across InvalidCastException problem since the interface/shared elements are being used from the specific plug-in. To load different types in different plugins/assemblies, but which use the same interface, you can move the interface into its own little project so that the interface type is referenced by the plugins and the plugin manager/loader. Here is a nice post about the plugin model: http://www.yoda.arachsys.com/csharp/plugin.html
  • Wireless data connections such as WiFi on device get turned off when device is connected to computer via Activesync:
    • If you wish to have it enabled while device is connected to computer via ActiveSync it automatically turns off the Wireless connections. If you wish to enable this goto ActiveSync properties and check the last option.

Sunday, February 17, 2008

[i]Phone or not?

I'm going to skip the already discussed iPhone pros and cons like lack of 3G, GPS etc. I'm looking at it the way it is and what it is:

Pros:
  • Beautiful screen
  • Beautiful clean design - typical Apple
  • Crisp clean font
  • Multi-touch zooming and simple flicking of objects (pics, album art, text etc.)
  • Web Browser (first usable web browser on a phone in my opinion)
  • Love the proximity sensor that turns off the screen while talking (Cannot count the number of times my 'ear' would dial a number or click an application while I'm talking!)
Cons:
  • Packaging is great, but Apple could atleast include a basic sleeve or a transparent film for the screen or something. As it stands now, one pretty much has to buy an iPhone cover right away or risk scratching it. Something like the 5G iPod sleeve would be nice.
  • When dialing the number it would be nice to have the SmartDial features like in Windows Mobile (and other phones probably). Scrolling contacts is not always the easiest to find a contact. One always knows the name or number you want to call. SmartDial not only helps quick searching the contacts, but also inherently validates a number from the contacts list if you are typing by the number and not name. It also helps, if you partially remember a number you had dialed earlier and this smart lookup helps to narrow down the number you vaguely remember.
  • When typing in the search box (google/youtube) the automatic dictionary match shows below the text box and as soon as you hit 'Search' it picks the dictionary word instead of the one I typed! (usually one has to press a key like 'space bar' or something to pick the suggested work. The only way around this is, to type in the word, then tap/click on the text box again to dismiss the dictionary lookup and then hit 'Go'. Lame. [This one is very irritating and some other friends also mentioned this]
  • Copy-Paste: I actually came across the need quite a few times for example trying to send a phone number of one of my contacts via text message to a friend.
  • No disk mount. While there are solutions around this -- is this too much to ask for when someone wants to use those GBs on the phone to transfer/carry personal stuff.
  • Simple thing like wanting to drop a certain image from my mac to the iPhone (to set it as wallpaper) is sooo hard. Only way (in the auto sync mode) to get the picture on iPhone is is to sync an album containing that pic. Ridiculous!
  • Bluetooth/WiFi file transfers not allowed: Fine go ahead and block music file transfer an stuff. Atleast allow receiving other types of files (pics?).
  • As beautiful the UI is, its pretty ugly in its proprietary and complex underlying storage. It very difficult to understand the file structure and mappings. (Granted this is a beef for only geeks). Maybe it does it for optimizations, speed, security whatever..., but basically its not easy to get in->copy stuff into->view it (Oh wait, am I expecting a PC?). In this respect, I agree with Linus.
  • Battery life is OK ... but this applies to all my wireless devices. (Please someone, do something great here or make every furniture and fixture have mandatory a USB port :) )
Overall, its a solid device and most of the quibbles can be fixed easily. And best part is that Apple has entered a very fast moving and fierce market, it is going to have to respond quickly to get to the top. And seems they are listening these days ...

Monday, February 11, 2008

Indian Movies++

Indian movies that go beyond the usual song+dance routines.
[By no means complete ... just the ones I enjoyed]

Luck by Chance (2009)

Oye Lucky! Lucky Oye! (2008)

A Wednesday (2008)

Rock On!! (2008)

Sarkar Raj (2008)

Johnny Gaddar (2007)

Manorama: Six Feet Under (2007)

Cheeni Kum (2007)

Guru (2007)

Namesake (2007)

Khosla Ka Ghosla (2006)

Omkara (2006)

Rang De Basanti (2006)

Sarkar (2005)

Iqbal (2005)

My Wife's Murder (2005)

Swades (2004)

D (2005)

Lakshya (2004)

Teen Deewarein (2003)

Company (2002)

Bend It Like Beckham (2002)

Monsoon Wedding (2001)

Dil Chahata Hai (2001)

Lagaan (2001)

Sardar (1993)

Gandhi (1982)


Sunday, February 10, 2008

Mint.com

I've been following Mint since it got the mention as the TechCrunch40 award winner. No one can argue that the idea of a unified view of personal finances is utopia. Mint promises this.
However ...
  • Biggest concern I had with Mint (and its pretty obvious), is what happens to my bank/credit card/investment account data on mint's servers if they are compromised. Can they get and use the information? Can anyone access my financial accounts I have setup with mint, outside of Mint?
  • Also, Mint didn't have the feature to add brokerage accounts, that would leave out a an important share of finances.
  • There are various other similar offerings -- Quicken, MS Money and Wasabe to name a few, but reading online, Mint seems to be the favorite of many.
Then I [re]read some more information on the web:
That's it ... I gave in. And in 10 minutes I was setup.

Pros:
  • Easy and quick setup.
  • Safe based on the information I found on web (above).
  • As expected from use of all the AJAX stuff.
  • Love that cool pie chart of 'Spending Trends' with categories such as food & dining, utilities, healthcare etc. Then you can click into any of the categories (food & dining) and see sub allocation e.g. groceries, restaurants, coffee shops etc. Now you know how much you really spend at Starbucks! (OK, maybe this might stop some from signing up).
  • The 'Ways to Save' feature is pretty neat. It suggests that I'll save a couple hundred by getting the Comcast Triple-play rather than what I have now. I think this advertisement is most targeted and useful form I have seen on the web. And given the information Mint can extract, it can get really valuable (but I hope not intrusive).
  • The search in Transactions has auto complete which is pretty handy.
  • Free (I must say I've begun to expect this and assuming they are making money via Ads :)).
Cons:
  • They don't do much with brokerage account information. But then, it was just added like a few days ago, so I expect they will add more features for using that information. I don't know if they get details of stock/mutual fund holding. They can potentially build a really nice unified view for asset allocation, ticker prices, news -- they can go crazy with that stuff.
  • I have not been able to add my First Tech Credit Union account (bank and visa card). Others have reported the problems and I think Mint is already working on that.
  • There could be an error margin since categorization is store-based: if you walk into Bartell Drugs and buy light bulbs, it would count it as healthcare. If it was by the itemized bill, it would be even cooler, but its problem for another day. It pretty well as is.
Give it shot ...

Thursday, January 04, 2007

Australia Trip Report (5/5)

Planning/Research Websites/Books
www.tripadvisor.com (forums, trip reviews)
www.frommers.com (e.g. Sydney: Goto Destinations-> Australia-> Sydney-> Attractions. The star rating is great helper in deciding.)
Frommer's Australia 2006 - Good
Lonely Planet Australia - Good
Frodor's Australia 2006 - OK. (Went to a highly rated club as per the book, only to realize that it had folded 3 years ago!)

Airline Booking
Quantas AirPass (+reasonable $$$ | +Web Itinerary Creator)

Hotel booking
http://hotelclub.net/
http://www.wotif.com/

  • Sydney - Sheraton on the Park [5/5 | +Location | +Rooms | -$$$]
  • Port Douglas - The Archipelago [4/5 | +$| +Location | +-Rooms]
  • Uluru(Ayer's Rock) - Outback Pionner Lodge [3.5/5 | +$(relatively) | +-Room]
Tours/Trips
Sydney
  • The Rocks Tour (5/5)
  • Bridge Climb (5/5)
  • Sydney Aquarium (4/5)
  • Manly (by Ferry) (5/5)
  • Blue Mountains
    • Three Sisters (3/5 -Overrated)
    • Jenolan Caves (5/5 +Oldest caves | +Tour | -Distance from Sydney)
Port DouglasUluru (Ayer's Rock)Melbourne
  • 12 Apostles (5/5 +The route | -3hr drive from Melbun)
  • Philip Island Penguin Parade (4/5 +Penguins | -No Photography)
  • Ian Potter Center: NGVA (4/5)
  • Melbourne Museum (4/5)
  • Federation Sq (5/5 +Contemporary | +Location | +Museums/Galleries)
Restaurants
Sydney
Tetsuya's | 5/5 food | 5/5 service | $$$$$ | Australia finest | Amongst world's top
Conservatory@Sheraton | 4/5 food | 4/5 service | $$$
Zaaffran | 4/5 food | 3/5 service | $$$$
Aria's | 3.5/5 food | 4/5 service | $$$$$
Zinc@Manly Beach | 2/5 food | 2/5 service | $$$
Sailor's Thai | 5/5 food |5/5 service | $$$$

Port Douglas
Corner Pub | 1/5 food | N/A service | $$
On the Inlet | 4/5 food | 5/5 service | $$$$
Two Fish | 3/5 food | 4/5 service | $$$
Zinc@Port Douglas | 5/5 food | 4/5 service | $$$$

Uluru (Ayers Rock)
Sounds of Silence | 5/5 food | 5/5 service | $$$$$ | Dinner in the Desert
Geckos Cafe | 3.5/5 food | 4/5 service | $$$
Outback Pioneer | 3/5 food | 3/5 service | $$$

Melbourne
Cookies | 4/5 food | 4/5 service | $$$
Andrews Cafe@ Apollo Bay | 3/5 food | 3/5 service | $$
New Delhi Restaurant | 2/5 food | N/A service | $$
Domain Chandon | 2/5 food |4/5 service | $$$$
Sheni's Curry | 5/5 food | 4/5 service | $
Tramcar Restaurant | 3.5/5 food | 5/5 service | $$$$
Meccabah | 5/5 food | 5/5 service | $$$
Teppenyaki | 5/5 food | 5/5 service | $$$$
Thaila Thai | 3.5/5 food | 3/5 service| $$
Saganaki | 3.5/5 food | 3/5 service | $$$

Gear
Nikon D50 Body (5/5)
Got it at beachcamera.com. I got this superb camera in the remains of my budget after getting the lens below. Yes, that's right, I got the camera because of the lens. Earlier, I had given in to one of those D50 Nikon Kits at Costco, it was a good deal, but I grew out of the kit lenses quickly.

Nikon 18-200mm VR (5/5 | +Zoom | +Image Stabilization | +Optics | -Price | -Availability)
Got very lucky to get it from the guys at beachcamera.com. This lens is so crazy in demand, its out of stock in the physical, and the online world. And for a reason too -- this is most versatile, fast and brilliant lens I've ever used. (Disclaimer: I haven't used a lot of lenses :). But the pictures can speak for it.

Joby GorillaPod SLR
Got it in the local REI store. (4/5 | +flexible | +light | +strong | -big lenses might tip a bit)

Crumpler Sinking Barge Backpack [Laptop + SLR] (5/5 | +Strong | +Looks | +Versatile | +Comfortable | +Easy Camera Access | -Room for basic camera gear)
With all this photo gear and my laptop, the wires etc, I need a good bag to carry all of it. After much searching it came down to two backpacks: Tamrac Adventure 9 and the Crumpler Sinking Barge. I settled for the Crumpler for reasons give above. But, I wanted to see the bag, in person, to try it on etc. I looked around and the only place carring it was Glazer's Camera (Seattle). After trying it on in store, I loved it, it was as expected. But they didn't have the right color, so I ordered one from B&H.

Sample Pictures
Sydney











Uluru (Ayers Rock)

Port Douglas









Melbourne

Monday, September 18, 2006

Replacing a 12" PowerBook Hard Drive

Of late, my hard drive was noticeably slow indicating it was nearing its end. Some simple signs that told me its going to give up on me were:
  • Application startup time slowed down quite a bit (the icon bounced a lot longer that usual :)
  • Spotlight searching/response was getting slow.
  • Slow in general when doing any new activities (i.e. when accessing something not in RAM).
The moment this started, I bought myself an external hard drive (I've been meaning to for a while; backing up over the network was too slow for me) and started backing, cloning [bootable] actually, using Carbon Copy Cloner.

And then, one fine day, the powerbook would not startup. It hung at the basic loading screen, I could tell by that repetitive disk seeking sound that its dead!

Here are the steps I followed to replace my hard drive AND start-off with the new one as if nothing happening i.e. not installing the apps again, no re-configuring etc.
  1. Bought a new one (HITACHI Travelstar 7K100 (HTS721010G9AT00) 100GB 7200 RPM) at newegg.
  2. Using Carbon Copy Cloner I kept bootable clone of existing drive onto my external hard drive (Maxtor OneTouch III) that I had got from costco. Notes: Before you decide to replace the hard drive its a good idea to test your bootable clone by actually booting into it (At OSX startup keep 'Option' pressed..)
  3. The actual hard drive replacements instructions I followed this guide at www.ifixit.com. Notes:
    • Make sure you have the #0 Philips Screwdriver and the T6 Trox Screwdriver. I didn't have this initially, and since another one worked I started using it until I was unable to remove a screw and almost chipped off a screw head. I drove down and bought this kit from the local Radioshack and everything was a breeze after that.
    • I would also layout the screws on a clean paper/surface in the exact order and layout as you remove them. It helps a LOT when putting it all back together.
    • Overall, the taking apart took much longer than putting it back. Probably because I was trying to be ultra careful + the trip to Radioshack :).
  4. Now having the hard drive installed, and put the machine back together, plug in that firewire external hard drive and boot up the machine holding down the 'Option' key. Select the external hard drive to boot into.
  5. Open up disk utility and format/create a partition naming it what ever you want. (I just kept it to the very default 'Macintosh HD')
  6. Open up 'Carbon Copy Cloner', and now clone backwards - from the ext hard drive to the new drive. (make sure to mark it as 'bootable').
  7. Restart the machine.
  8. [If you had backed up fairly recently] You would find yourself right at home!

Sunday, May 21, 2006

BillMonk.com: Pretty cool service

So its Sunday evening, and I am doing one of those typical chores of settling all accounts between friends for the shared lunches/dinners/events. Few problems -- all the numbers are scattered across in emails, IMs etc., and over a period of time since I am not a regular. So, now, I have to find that trace, recollect who was at which dinner/lunch/event and again notify everyone. The process repeats itself. Its a pain ...

I knew what kind of a system I wanted -- flux between social networking and money management. A distributed, yet personal and without divulging my credit card and stuff. So, I googled around and discovered
this article at techcrunch.com talking about billmonk.com ... bingo! Just what I was looking for.

I've hardly used this service and already love it. So do my friends whom I added via the service.

Some highlights:
-Clean, Simple and Fast UI
-Friends can edit the common event with their share and it will manages the math
-Nice view of the history of payment with each friend.
-Email notification (of course) / SMS
-Has a "Library" to manage CDs, Books etc lent to friends.
-Able to export the current status as a csv file.

BillMonk is quite spiffy and if you are in similar shoes you will love it!

-Shree

P.S: I won't bat an eye if it gets acquired by PayPal or the likes.