Using Windows Explorer as a FTP client

0

Recently I have been talking to Kiat Siang on some of the things we are doing and he questioned me on how we could use “Windows Explorer” to access the FTP. Interesting he is not the first to ask me that question. Though its easy but often overlooked. Made this quick guide on how one can do so.

 

Step 1 : Open up File Explorer and click on the address bar.

 

 

 

 

 

Step 2: Type in the ftp address, remember to prefix it with the ftp protocol.

 

 

 

 

 

 

Step 3: After it went in, right click on the content area and select Login As…

 

 

 

 

 

 

 

 

 

 

Step 4 : Login dialog will appear, type in your ftp username and ftp password

Delete data from database automatically at regular interval

0

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_select_db(‘mydb’);

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 guohong@limguohong.com, use the contact us form or alternatively you can comment. :)

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

Windows Phone 7 – Textbox On Focus Color

0

Was browsing around Stackoverflow and saw a question that someone asked, (WP7DEV) Textbox background changes when typing

Thought it will be useful for someone who needs it.

Explaination:
By default, a textbox on Windows Phone 7 will look at the one you see in the screenshot on the left, below, but when you were to focus on it, it will turn into slightly white-ish, as seen on the right.

Some of the scenarios for your development do not allow that and requires them to be the same. Written this quick guide in case someone needs it.

1. Attach a GotFocus event handler to the textbox you want to have the effect on.
2. Add this code in the method.

textBox2.Background = (SolidColorBrush)Resources["PhoneTextBoxBrush"];
textBox2.BorderBrush = (SolidColorBrush)Resources["PhoneTextBoxBrush"];

*Please remember to change textBox2 to the correct id of the textbox that you want the effect on.

For those of you who are curious where I get the Resources from, you can view a list of the available resources here : http://msdn.microsoft.com/en-us/library/windowsphone/develop/ff769552(v=vs.92).aspx#BKMK_BrushResources

You can download the solution here too:
https://skydrive.live.com/redir?resid=29F099C37B76CA59!2793&authkey=!ACBRpIRyDopM5Lo

生於憂患 死於安樂 : 天降大任於斯人也,必先苦其心志,勞其筋骨

0

舜發於畎畝之中,傅說舉於版築之閒,
膠鬲舉於魚鹽之中,管夷吾舉於士,
孫叔敖舉於海,百里奚舉於市。

故天將降大任於斯人也,必先苦其心志,勞其筋骨,
餓其體膚,空乏其身,行拂亂其所為,所以動心忍性,曾益其所不能。
人恆過,然後能改;困於心,衡於慮,而後作;徵於色,發於聲,而後喻。
入則無法家拂士,出則無敵國外患者,國恆亡。
然後知生於憂患而死於安樂也。

8 Amazing Coming Soon Page

0

Recently i am reading some articles on Coming Soon Page which lead me to find out what are some of the advantages of coming soon page.

Website designers these days take advantage of the coming soon page to allow interaction with their visitors. Nowadays, coming soon page usually include features such as company name, logo, countdown timer and even their social media links!

You can find a collection of 8 coming soon pages which i came across and have bookmarked them. Hope that it can serve as a inspiration for you! In no particular order…

1. http://storyzer.com/
storyzer.com

 

 

 

 

 

 

 

 

 

 

2. Novalistic.com
Novalistic.com

 

 

 

 

 

 

 

 

3. http://fivesecondprojects.com/
http://fivesecondprojects.com

 

 

 

 

 

 

 

 

 

 

 

4. http://pepsay.com/
http://pepsay.com/

 

 

 

 

 

 

5. http://www.statnip.com/
http://www.statnip.com/

 

 

 

 

 

 

 

 

6. http://www.upstatedesign.org/
http://www.upstatedesign.org/

 

 

 

 

 

 

 

 

 

7. http://chkchkboom.com/
http://chkchkboom.com/

 

 

 

 

 

8. http://www.mobithought.com/
http://www.mobithought.com

 

 

 

 

 

 

 

If you do have any nice-looking coming soon page which you want to share with me and my viewers, please feel free to email me at guohong@limguohong.com or leave a comment!

Summary of the tutorials posted on my site

0

Recently I have a few enquries asking me to send them a summary of the tutorials that i have done up and posted on my site.

Just in case any of you are finding that. You can find it here.
Tutorials

or you can click on the “Tutorials” tab on the navigation bar.

SugarDe-Rush : Congratulation to your advancement to grand finals

0

Heard this awesome news that the group which i helped have advanced to the grand finals! They are the only group from the Secondary 2 which made it, representing their category in the grand finals.

Have blogged earlier on SugarDe-Rush : Reducing the sugar intake (Project by students from HCI) that the aim of it is to raise awareness, educate the young and cultivate good habits. They came up with resource package which consists of workshops to Ai Tong Primary School, Information Card, Brochure, Windows Phone 7 Mobile Application.

All the best to you guys during your selection on Tuesday!

Thank you for the day and the treat too!

SugarDe-Rush : Reducing the sugar intake (Project by students from HCI)

0

For the past 4 months, I have the fortune to be working with 4 brillant students, Glen Mun, Joseph Zhao, Sean Tay, Yong Zhi, from Hwa Chong Institution. They are working on a project called Sugar De-Rush. The aim of it is to raise awareness, educate the young and cultivate good habits. They came up with resource package which consists of workshops to Ai Tong Primary School, Information Card, Brochure, Windows Phone 7 Mobile Application.

 

 

 

 

 

 

 

I am glad that I have the chance to work with this group of young, determined and energetic guys on this project on their website and Windows Phone 7 mobile application and providing some inputs/feedback to their project along the way.

Their finals is on this Friday. All the best to you guys!

Some pictures of them working/playing.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

An extract from the website:
“We are a group of students from Hwa Chong Institution who are doing a project called Sugar De-Rush. The problem of high sugar intake among Singaporeans is a pertinent one. Research conducted shows that children consume more sugar than recommended. Project Sugar De-rush aims to raise awareness of the dangers of high sugar intake and educate children aged 9 to 12 years old to monitor their eating habits. We hope to cultivate a good habit in them when they are young so as to prevent them from suffering from diseases in the future. This alarming problem needs to be addressed and our project is a resource package to help raise awareness of the dangers of high sugar intake.”

Below is the interview they had with Dr. Kelvin Tan, Vice-President of Diebetic Society on why sugar is bad.

All the best to SugarDe-Rush!

Using Toggle Control to disable/enable idle detection – Windows Phone 7

0

Saw a question on Dream Build Launch on how can one use toggle control to disable / enable idle detection and from there, enable/disable it idle detection accordingly.

I believe he needed it in his setting page. Did up a quick demo.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Resources
1. I used the toggle control from the silverlight toolkit for Windows Phone on codeplex (Can be found here : http://silverlight.codeplex.com/releases/view/75888) for the toggle control.

2. Do read this msdn article for

Things I did
1. Added the toggle controls in the toolkit into Visual Studio (if you have yet to do so)
2. Pull in the toggle controls and attached the checked event handler onto the control.
3. Add the following code (I included the method signature here).

private void toggleSwitch1_Checked(object sender, RoutedEventArgs e)
{

if (toggleSwitch1.IsChecked == true)
PhoneApplicationService.Current.ApplicationIdleDetectionMode = IdleDetectionMode.Disabled;
else
PhoneApplicationService.Current.ApplicationIdleDetectionMode = IdleDetectionMode.Enabled;
}

You can download the demo file here : https://skydrive.live.com/redir?resid=29F099C37B76CA59!2752&authkey=!AOBimFuXpsh6oog

Go to Top