ASP.NET date picker

Add the following jquery and jquery ui scripts

<a href="http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js">http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js</a>
<a href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js">http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js</a>

and the jquery css

<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="Stylesheet" type="text/css" />

Lets say you have a text box for which you want to set it as date picker

<asp:TextBox ID="txtDate" runat="server"></asp:TextBox>

Use the below code to initialize the date picker.

        $(function () {
            $("[id$=txtDate]").datepicker({ dateFormat: 'dd/mm/yy' });
        });

You need to select the format according to your requirement or you won’t be able to see the date.

Transfering database from android app to desktop and vice versa

There are times when you want to look at the values stored in your apps database or want to add quickly some values into your apps database.

To do so you need to set the permission on the database file to read or write as per the situtaion

To transfer the database from the android app to desktop make sure your adb is connected through a usb or a wireless connection.

Then get into the shell using adb shell

adb shell
run-as package_name
chmod 0644 /data/data/package_name/databases/database.db
Ctrl + c
adb pull&nbsp;/data/data/package_name/databases/database.db d:\

Once you copy the database from the phone you can use any Sqllite client og your choice to edit the database. Once done you can upload it back to the phone.

To upload the database you need to set write permissions.

adb shell
run-as package_name
chmod 0644 /data/data/package_name/databases/database.db
Ctrl + c
adb push d:\database.db  /data/data/package_name/databases/database.db 

Connecting adb wirelessly.

While developing android apps and running them on your phone with an USB wire can sometimes become frustrating.

You can run your app without using an USB cable simply follow these steps.

First connect your device with an USB cable and enter the following command.

$ adb usb
restarting in USB mode

Then restart it in the tcp mode

$ adb tcpip 5555
restarting in TCP mode port: 5555

Now kill the adb server
$ adb kill-server

Safely remove the phone, find your phones ip address and type your IP address

$ adb connect 192.168.1.2
connected to 192.168.1.2:5555

Just replace 192.168.1.2 with your IP address and you are all set!

Disposable email address for dealing with spam.

What is disposable email?

Well as the name suggests you can dispose off the email address and create a new one on a few clicks.

Why do I need one?

Hmm, its up to you. You could simply create a different email address to share with all those spammers. The advantage here is you can get emails from your disposable emails delivered directly to your inbox and dispose the email address if you feel that you are getting a lot of spam emails and then create another disposable email address.
Continue reading