Posts

SQLite on iPhone

It seems that many of the internal stores on the iPhone are actually SQLite databases. The database that stores your text messages are located in /private/var/mobile/Library/SMS/sms.db and can be manipulated with any SQLite client. Similarly, Voicemail database is located at /private/var/mobile/Library/Voicemail/voicemail.db. That same folder also contains all your voicemail audio files, so you can back them up too, if you want.

Using powershell to batch rename some files

Now that powershell comes pre-installed on all copies of Win7, we can use it to perform day-to-day tasks. Here is the first tip: to batch rename a bunch of files, such that the first 3 characters are deleted from the filename, issue the command: dir | foreach -process {mv $_.Name $_.Name.Substring(3)} Update: I will be updating this post with more snippets as I come across them 1. Here is how to create a graphics object in powershell, and draw a bunch of lines on it. $bmp = new-object System.Drawing.Bitmap(264, 264) $graphics = [System.Drawing.Graphics]::FromImage($bmp) for($i=1; $i -lt 9; $i+=1) { $graphics.DrawLine($pen, 33*$i, 0, 33*$i, 264); } 2. Here is how to set the current directory so that .NET objects know it [Environment]::CurrentDirectory = $pwd 3. Here is how to download a file $c = new-object System.Net.WebClient $c.DownloadFile( url, filename ) 4. Concatenate a bunch of files together cat misc*.txt | Out-File allmisc.txt -Encoding ASCII or cat misc1...

Dark background for VS 2010

Image
Now that Visual Studio 2010 is out, you obviously need a dark background for it. The problem with other dark backgrounds out there is that they change too much - for me, if comments aren't green the universe pretty much collapses. So here is a 9KB settings file which will simply change the background of your text editor to black, keeping keywords blue and comments green. Certain other elements' colors were changed to match. Enjoy, and leave a comment if you found it useful. OnlyFonts_2010.vssettings

Compiler restrictions are no match for natural oversight

You'd think that with the restrictions in Java / C# that the only things you can put in an 'if' block be bool's, you'd avoid all kinds of single equals sign vs double equal sign errors, but look at what I ran into today: bool IsGood = false; bool IsSupposedToBeGood = false; if (IsGood = IsSupposedToBeGood && otherConditions) {     // do something assuming IsGood is IsSupposedToBeGood } Sigh.. if the quantities you are checking equality for are bools, you're out of luck. I guess I can't let my guard down in C# / Java either, now.

My last post from kgp

Well... this is kinda it. Four years of partying is nearly over. It seems weirdly normal, like it is not even real that I am probably never going to come back to kgp in my capacity as a student. kgp gave me so many things I will never forget. The main problem is most of these thoughts are buried so deep in emotion that they can't be expressed here. So, 20-year-older-me: don't be disappointed that you can't use this page to reminisce about your alma mater - you couldn't have done it anyway. I'll never forget you - not the sunlit days, nor the moonlit nights.

How to make Vista style icons

Image
Normally I don't blog just to link to another page, but this tutorial on Creating a Vista Style button template is just so compelling, that I gave in. Here is a sample of what you can make. I am still working on a rounded highlight. (I used Photoshop CS3, by the way)

Keyboard shortcuts

I accidentally found a new keyboard shortcut for Windows Explorer on Windows Vista today. ALT+CTRL+TAB. It opens a persistent 'switch application' panel, that doesn't go away till you choose an icon and press space, enter or click on it. Talking of application switching keyboard shortcuts, it ALT+TAB does not work for you because of it algorithm of choosing the most recent window first, you can always use ALT+ESC to cycle through all open windows. ALT+ESC will not automatically restore minimised windows till you hit SPACE or ENTER.