Saturday, December 26, 2009

Setting up my HTC Hero

Just got my hands on a brand new HTC hero as a gift.
Previous phone was N86 8MP (loved the camera ... but hey ... its always fun to try something new ;) )

Anyways. Here is a description of how I did the migration :

  • Synced my N86 with outlook using nokia pc suite. 
  • Installed HTC Sync for HTC HERO. 
  • Synced HTC hero with outlook. Now all I miss are the Notes (appointments / anniversaries / contacts are done ;) ). (I think I remember the ability to copy notes as text from the nokia phone.... but since I gave mine away ... I had to go the way of outlook as mentioned below)
  • Installed AKNote on the HTC Hero. 
  • Wrote a small script for outlook to export the notes as a text files: 
Sub exportNotesAsText()
   myfolder = "D:\COPY\PHONE\NOTES\" 'setup the folder path. Must end with backslash
   Set myNote = Application.GetNamespace("MAPI").GetDefaultFolder(olFolderNotes)
   For ibi = 1 To myNote.Items.Count
       myNote.Items(ibi).SaveAs myfolder & myNote.Items(ibi).Subject & ".txt", 0
   Next
End Sub


All set.

Monday, December 14, 2009

SQL Server Transaction Logs taking up too much space

Transactions LOGs are used by SQL server to give transactional integerity. If you have set your DB Recovery Model to "Full" every data change query will be logged in  the Transaction log. If your transaction logs are getting too large (e.g you are retrieving large data-sets / day and deleting data-sets for old dates )  it is suggested that either you get more harddisk space OR:
  • Change the DB Recovery model (right click db in ssms -> select properties -> select options page) to "Simple"
  • Set Autoshrink to True. 
  • Organize your backup model accordingly.


In case you do not want to do that there is a quick solution (DBNAME is your database name):

USE DBNAME
GO
DBCC SHRINKFILE(DBNAME_log, 1)
BACKUP LOG DBNAME WITH TRUNCATE_ONLY
DBCC SHRINKFILE(DBNAME_log, 1)



But note that it can come back to bite you because:
  • you need to do a backup from the beginning after this. Previous backups are invalidated. Which means the backup model you have in place for Full Recovery model is invalidated.
  • It does not solve the underlying problem why the transaction log became this big in the first place.It will happen again.

Best of Luck! 

Check if a point is inside a polygon

Found this today:
http://alienryderflex.com/polygon/

This will be infinitely useful for my mapping applications. I will write code based on this for GDI+ sometime when I have more spare time.  Just wanted to bookmark / share it till then.

Thursday, December 10, 2009

GPS library for .NET

An amazing find. If you ever wanted to access a GPS device via .NET this is all you will ever need:
http://gps3.codeplex.com/

Enjoy!

Wednesday, December 9, 2009

Connecting to a solaris machine using XManager

I believe Xmanager to be the best XWindows remote desktop solution available as of now.
 
Here's how I connect to my solaris machines:
 
  • Start Xbrowser
  • Click on New toolbar icon - > New session wizard
  • Select Xstart and click next
  • Type in your host IP and select telnet as your protocol (if that is what you are using …. Which is generally the case from intranet applications)
  • Type in your username and password
  • Select 4 Xterm (Solaris). This will export your display to the terminal and start an xterm session. (cool stuff)
  • Click next and click finish.
 
 
Now you can even export this connection to your desktop.
 
Enjoy!