Testing your jquery mobile website in Chrome (Ripple mobile emulator)

If you are developing a Jquery mobile website, Chrome or Firefox serve as a great tool to debug your code and let you play withe the DOM and Javascript on the fly. However, you can never get a real feel of how the site will look/run on a mobile device.

If you are on a Mac, you can obviously use XCode’s IOS simulator which is simply awesome. On Windows you can download Visual Studio Express edition for mobile development and that ships a Windows phone emulator. 

But there is another solution which is best of both worlds. Enter Ripple (download link), a Chrome extension which nice emulates a mobile device. I am in love with it because not only does it let me see how my website will look on a mobile device but it gives me the awesome development power provided by Chrome and its debugging tools. In summary here are the benefits of Ripple

  • View your site in a variety of mobile devices Android, IOS, Windows Phone, Palm etc
  • Use Chrome’s uber powerful tools to do your development
  • Fake GPS/location services. Ripple even lets you simulate as if you are driving around!
  • Test your site on landscape/portrait orientation
  • Simulate accelerometer events.

My personal thanks to the developers of Ripple !

Image

 

Advertisements

OSX Lion and Windows 7 on the same box (Vmware, Parallels and Bootcamp compared)

I only have Macs in my house. I just kept throwing the Windows machines as they started to die off without replacing them (Yes, all the HPs and Dells are in the trash now). Although, I do lot of IOS and Ruby on Rails programming which is perfect with OSX Lion, but I only do that as a hobby. At the end of the day I have to remember that my 16 years of expertise as a Microsoft developer is what pays the bills :). 

I have tried all 3 options of running Windows on OSX. i.e Parallels Desktop, VMWare and Bootcamp.

Parallels and VMWare seem like the ideal solution at first because you don’t have to reboot your laptop into windows. You click the VMWare or Parallels icon and it fires up the Windows machine in a virtual environment. Sounds great right ? In my experience, it sounds great only in theory. Both solution do work without any problems, but performance is a different ballgame altogether. Running Visual Studio 2010 on the VMs is a pure torture. It is so slow that it is almost unusable. (I have a Macbook Pro, OSX Lion, Core i7 2Ghz with 4 GM ram and I allocated 1.5 – 2GB ram to the VM)

So, I ended up just firing bootcamp and tried to install Windows on the second partition. It did have its challenges but nothing that I couldn’t overcome. Here is what I ran into:

  1. Low disk space – OSX reported I have 350GB free, but Bootcamp kept complaining that I don’t have sufficient space. Weird right? Well, no matter how much Apple makes you believe that OSX doesn’t get fragmented, it actual does. The easiest way to defragment is to backup your machine using Time Machine, format your machine completely (i.e boot with OSX Lion DVD and use disk utility to format your partitions) and restore from Time Machine backup. This is the easiest and free way to defragment your HDD. Once you do this, Bootcamp will be a happy camper and will let you proceed.
  2. Made a mistake of allocating less space to Win 7 – I allocated 50 GB to windows 7 and thought I can install Visual Studio 2010 on it without any issues and it did work great! But then the greedy developer I am, I wanted to install Visual Studio 2012 RC on it too. And that is where I ran out of space. The solution – Reboot into OSX and use disk utility to reduce OSX partition size. Then reboot back into Windows 7 and download this free tool called Minitool Partition Wizard. Fire up the tool, click the Bootcamp partition and then choose extend merge. This will let you extend the partition and use the space you freed up using Disk Utility. (Disk Management built into Win7 will not work)

After all was done, I am loving Bootcamp/Windows 7. It is blazing fast for obvious reasons. Obviously, a virtual VM solution just cannot compare to an OS running on real hardware. I know you are still thinking “But I would hate to reboot my computer every time into Windows!!!!!”. Well, if you fire up the VMware or Parallels VM from a suspended state, you will end up wasting the same amount of time that you would physically booting into Windows 7 too. And when you want to get back to OSX, Lion will be waiting for you with its “remember open programs” feature that I have come to love. 

Backing up and fail-safing your ADAM / LDS instance

This could potentially be very long post, but I am going to stick to the high-level objectives only. Leave a comment if you want more details and I will reply to you.

OBJECTIVE: Your users are stored in an ADAM database and your ASP.net website sits on top of this utilizing the ASP.Net membership framework to interface with ADAM to authenticate users. You want to make sure that you are covered in case of any disaster scenarios (like disk corruption, ADAM server blowing up, and manually unintended corruption by your system admins)

PROBLEM: If you notice carefully, we are talking two different things here.

  • Hardware failures – i.e Poof!!!! and your ADAM instance just disappears. Panic your website is down!!!
  • Manual data corruption – So, if your sysadmin does something foolish and say he updates all users with the same last name using a vbs script or something. This is more insidious because your website is not down, ADAM is not down but your user data is corrupt.

SOLUTION: So although we have two distinct ways of getting into trouble, the end result is the same and the solutions are also the same. But first let us talk about what is required at the minimum to recover from a failure scenario.

ADAM Replication – Fortunately, for us, ADAM (or LDS) comes out of the box with support for replication. What this means, is once your main ADAM instance is up and running you can install multiple ADAM instances on other servers as “replicated instances” and all these servers magically know how to talk to each other and keep their data in sync with each other.

Plus, it gives you the flexibility of turning on “two way” replication. i.e you change data on the replicated instance and the main ADAM server reflects these changes. You have the option of staggered replication. i.e the replicated instances will receive deltas from the main server only after XX minutes or hours. Any light bulbs yet on how you will use this to recover from bad things happening?

Windows Backups – I know, I know. Nobody uses Windows Backup and Restore. But this is the perfect place to use it. You simply setup a backup job which backs up your ADAM directory to a file server. We have done it where I work and this gives us nightly backups for every day going back to last 60 days. Also, ADAM has a lock on the files on disk, but Windows Backup used Volume Shadow Copy which takes care backing up files even if they are locked by a process. We use the append option, so backups are not overwritten every night, but are appended (Keep an eye on that backup file though…it can grow pretty fast !!!)

So, now that we know the proper way to protect us from bad things. Here is how you will apply it to various situations:

  1. Hardware failures – If your main ADAM server blows up, you could simply point your website to the replicated instance since it has the latest and greatest data.
  2. Data Corruption by SysAdmin – So, if your sysadmin writes a script which updates every one’s SSN to 000-00-0000 for example, you could either restore the ADAM data from last night’s backup (believe me it is amazing simple to overwrite ADAM data from backup and get up and running in no time). Or, if you had staggered replication setup (i.e replicated instances receive change deltas only after 1 hour and your sysadmin reports the data corruption to you in time, you can shutdown the main ADAM instance and point your website to the replicated instances because they still have good data.

Bottom-line, you can use replicated instances for instantly recovering from the failure scenario, while you are busy building the main instance from the backups. If you have two way replication setup then when you bring the main instance online, the replicated instances will send their deltas back to the main instance (so for example 100 users signed up before you could restore the main instance from backups), these 100 users are only in the replicated instance now. But the moment you bring back the main ADAM instance up, replication will send these users back to the main instance and you will be in sync.

SOLVED: iexplore.exe – The directory name is invalid

I love the “run as” option in Windows and I use it all the time to test my websites especially if they need Windows Auth (NTLM) or with desktop software which uses your windows creds.

Recently, I started facing this error whenever I try the “run as” option and it got me frustrated enough to find a solution for it. Here is the dreaded message that you get when doing “run as”

Image

Finally found the solution :

To resolve this problem follow these steps:

  1. Click Start, point to All Programs, and then point to Accessories.
  2. Right-click Command Prompt or Notepad, and then click Properties. (I know you are trying to solve IE issues but you have to change properties of notepad or command prompt..weird right?)
  3. In the Start in box, change the value from %HOMEDRIVE%%HOMEPATH% to a system-wide value such as %WINDIR%.
  4. Click OK.

That is it! you are done. Leave a comment if it doesn’t work for you,

Sprint Mogul with the leaked EVDO Rev A and unlocked GPS ROM update

UPDATE : HTC Has finally released the official promised ROM update on Monday, March 10th 2008. Get it here : http://www.htc.com/us/FAQ_Detail.aspx?p_id=75&act=sd

I recently bought a new Sprint Mogul. I am loving the device so far. Yeah, I know it is not very sleek and is a tad bit thicker than what I had hoped for, but the phone is a neat piece of machinery. Has a nice dual core CPU, and as far as I know it is the only Windows Mobile phone so far which has a Qualcom 400 mhz processor, rather than the regular Intel XScale or samsung or any of those older and much slower processors. The phone is such a pleasure to use, no time lags in menus or applications opening up. Sprint’s EVDO network is unbelievably fast and internet surfing rocks on this phone. I was easily getting speeds upto 400 kbps!! which is awesome!

So, how can it be “awesomer than this”…Well, greed has no limits..right? The more you get the more you want. You all must have heard that SPRINT has been promising since last year that they will come out with an official ROM update which will unlock the hidden GPS in the phone and will also upgrade the phone to the new EVDO Rev A. But it is already March 2008, and no news of the ROM yet. So, I went to good old Google and started hunting for any interesting ROMs out there. I found out that apparently the ROM update that SPRINT and HTC are preparing has already been leaked out in its BETA and is widely available on the internet. Found several sites, which had a link to the ROM and the required utilities to apply this update to your phone.

And I decided to take the plunge on my 1 day old phone. Of course, I was impatient in reading the instructions and I bricked the phone initially. For several hours I was stuck at the infamous tri-color bootloader screen. But then I figure out that I needed to CID unlock the phone first (CID unlocking will allow the phone to accept any new ROM images, otherwise it just rejects the images). So, i found a utility (titan_exitbl.exe) which kicked my phone out of the tri-color screen, then I CID unlocked it (Hard-SPL-240-MFG.exe)
and applied the ROM update(RUU_TITAN_SPRINT_WWE_3[1].16.651.0_435009_RS3_27_00_SPCS_NV124).

PS: The reason why I have mentioned the cryptic EXE names above for the utilities is that you can simply google for those keywords and you will find several places and articles where you can download and read about them.

Folks, below is what I have now….

The boot up after applying the ROM update. You can easily see that it says “TEST ROM, NOT FOR SALE”

Using Google Maps on the phone with the in-built GPS. Nice !

Using http://www.dslreports.com to test the internet speed. Can you believe, I am getting North of 950K/Sec now! Unfreakinbelievable!