Search Results For : code

Quick note on Web.config file

A quick note on Web.config file in the ASP.NET project. It is worth noting that the file is a XML File (read this for more info – )

One issue that hindered my process earlier was that the content in the value has special character it in, particularly, one of my SQL server’s password has a special character in it.

I would have to go and replace them accordingly. For instance, my password is <Password1& (note that < and ” is inclusive), i would have to change it to

You can refer to the list here –

Code snippets for downloading images and displaying images from Android Internal storage

Reference to

Saving of images into internal storage

FileOutputStream fos = openFileOutput(FILENAME, Context.MODE_PRIVATE);

Displaying of images from internal storage

FileInputStream in = openFileInput(FILENAME);
Bitmap image = BitmapFactory.decodeStream(in);

Delete data from database automatically at regular interval

Recently I attended a session where a few developers would discuss about the website they have done. One of the developers approached me and asked me if there is a way that you could delete data from MySQL database once a week / at regular interval. I thought this short tutorial will be useful for one who wish to do so on the LAMP stack.

Step 1: We will come up with the php file that will do the delete function, from MySQL database and upload it.

$link = mysql_connect(‘localhost’, ‘mysql_user’, ‘mysql_password’);

if (!$link) {
die(‘Could not connect: ‘ . mysql_error());


mysql_query(“DELETE FROM mytable WHERE WHERE dateInserted > ‘2012-9-9′”);

In my sample code above, i did, “DELETE FROM mytable WHERE WHERE dateInserted > ‘2012-9-9′”. It depends on what you want to do, you can always change the conditions on why it should be deleted. I have also saved it as DeleteData.php


Step 2: Since I have cPanel, i used cPanel and go into Cron Jobs








Step 3: I will setup the cron job to run at once a week.(Of course you can set otherwise)







Note that for Command, you have to specify where the file lies, after you upload.

You can download the mentioned, DeleteData.php here.

Delete records from mysql automatically

Hope this is helpful for those who are finding a quick tutorial on how this can done. If you have any questions, please feel free to email, use the contact us form or alternatively you can comment. 🙂

I will post a tutrial on how we can do this on WISA stack.

Visual Basic reverse For Loop

Something quickie post here. Since I am not from a vb background, this took me a little more than 3 mins to figure this out. Thought will be good to post this.

For i = 10 to 0 step -1

This is the the C# version of the loop.

for(int i=10; i<0; i--){ STATEMENT; }

Thanks to :