<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Lim Guo Hong &#187; tutorial</title>
	<atom:link href="http://www.limguohong.com/tag/tutorial/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.limguohong.com</link>
	<description>Technology Enthusiast</description>
	<lastBuildDate>Fri, 11 Nov 2011 03:11:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>BingMapsDirectionsTask &#8211; Getting driving / walking directions</title>
		<link>http://www.limguohong.com/2011/10/bingmapsdirectionstask-getting-driving-walking-directions/</link>
		<comments>http://www.limguohong.com/2011/10/bingmapsdirectionstask-getting-driving-walking-directions/#comments</comments>
		<pubDate>Sun, 30 Oct 2011 10:41:04 +0000</pubDate>
		<dc:creator>Guo Hong</dc:creator>
				<category><![CDATA[microsoft]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[windows phone 7]]></category>
		<category><![CDATA[bing]]></category>
		<category><![CDATA[bingmapdirectiontasks]]></category>
		<category><![CDATA[direction]]></category>
		<category><![CDATA[free]]></category>
		<category><![CDATA[map]]></category>
		<category><![CDATA[source code]]></category>

		<guid isPermaLink="false">http://www.limguohong.com/?p=790</guid>
		<description><![CDATA[I was revisiting my old projects and reflecting on how I could improve on those products. I didn&#8217;t realised that there are so much we can do with the new Windows Phone APIs! I was looking at the MSDN&#8217;s Microsoft.Phone.Tasks Namespace and found out that there is a Bing Maps Direction Task Class now! The [...]]]></description>
			<content:encoded><![CDATA[<p>I was revisiting my old projects and reflecting on how I could improve on those products. I didn&#8217;t realised that there are so much we can do with the new Windows Phone APIs! I was looking at the MSDN&#8217;s <a title="Microsoft.Phone.Tasks" href="http://msdn.microsoft.com/en-us/library/ff428753(v=VS.92).aspx" target="_blank">Microsoft.Phone.Tasks</a> Namespace and found out that there is a <a href="http://msdn.microsoft.com/en-us/library/microsoft.phone.tasks.bingmapsdirectionstask(v=VS.92).aspx">Bing Maps Direction Task Class</a> now!</p>
<p>The first thing I thought of was the Green App project which I did during <a title="Top 12 in codeXtremeApps 2010" href="http://www.limguohong.com/2010/07/top-12-in-codextremeapps-2010/" target="_blank">codeXtremeApps 2010</a> Its a Windows Phone 7 project where we direct our users to the nearest recyling bin around Singapore for them to recyle their waste product. There are more functions which I will not elaborate on here. I will be updating my project/portfolio page soon! I was playing with the Bing Maps Direction Task API just this afternoon. Thought it will be useful to post a tutorial on how to use it. <img src='http://www.limguohong.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Should you face with any problems, feel free to contact me via the Contact Me form or email me at guohong@limguohong.com</p>
<p>Step 1 : Adding using Microsoft.Phone.Tasks and using System.Device.Location into references.</p>
<p><a href="http://www.limguohong.com/wp-content/uploads/2011/10/bmdt1.png"><img class="size-large wp-image-795" title="Bing Maps Directions Task 1 - Adding Reference" src="http://www.limguohong.com/wp-content/uploads/2011/10/bmdt1-1024x442.png" alt="Bing Maps Directions Task 1 - Adding Reference" width="620" height="267" /></a></p>
<p><a href="http://www.limguohong.com/wp-content/uploads/2011/10/bmdt2.png"><img class="size-full wp-image-791" title="Bing Maps Directions Task 2 - Adding namespace" src="http://www.limguohong.com/wp-content/uploads/2011/10/bmdt2.png" alt="Bing Maps Directions Task 2 - Adding namespace" width="481" height="406" /></a></p>
<p>Step 2 :  Adding the Microsoft.Phone.Tasks and System.Device.Location into the project</p>
<p><a href="http://www.limguohong.com/wp-content/uploads/2011/10/bmdt3.png"><img class="size-full wp-image-792" title="Bing Maps Directions Task 3 - Adding namespace" src="http://www.limguohong.com/wp-content/uploads/2011/10/bmdt3.png" alt="Bing Maps Directions Task 3 - Adding namespace" width="502" height="308" /></a></p>
<p>Step 3 : Initialize a <strong>BingMapsDirectionsTask </strong>and create a start and end <strong>LabeledMapLocation</strong> . Note that start is optional. Should you not provide start location, the API will use the current location by default.</p>
<p>At the end of it, .Show() it and it will show the map.</p>
<blockquote><p>BingMapsDirectionsTask Direction = new BingMapsDirectionsTask();</p>
<p>LabeledMapLocation start = new LabeledMapLocation(&#8220;Hougang Ave 4 919 Singapore , Singapore&#8221;, null);<br />
LabeledMapLocation end = new LabeledMapLocation(&#8220;Paya Lebar Air Base, Singapore&#8221;, null);</p>
<p>Direction.Start = start;<br />
Direction.End = end;</p>
<p>Direction.Show();</p></blockquote>
<p>You can download a usage demostration of the class here. Source code included.</p>
<p><strong>Please note that this is written for WP7.1</strong></p>
<div id="attachment_797" class="wp-caption alignleft" style="width: 174px"><a href="http://www.limguohong.com/wp-content/uploads/2011/10/cap1.png"><img class="size-medium wp-image-797" title="Bing Map Direction Task Demo Source Code Screenshot" src="http://www.limguohong.com/wp-content/uploads/2011/10/cap1-164x300.png" alt="Bing Map Direction Task Demo Source Code Screenshot" width="164" height="300" /></a><p class="wp-caption-text">Bing Map Direction Task Demo Source Code Screenshot</p></div>
<p><iframe style="padding: 0px; width: 98px; height: 115px; background-color: #fcfcfc;" title="Preview" src="https://skydrive.live.com/embedicon.aspx/Blog/Code%20Guide/Windows%20Phone%207/BingMapsDirectionsTaskDemo.zip?cid=29f099c37b76ca59&amp;sc=documents" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" width="320" height="240"></iframe></p>
<p>P.S: These 2 classes caught my attention, when I have some spare time, I will look into if I will be able to use it in my Slime Sweeper 2! <a href="http://msdn.microsoft.com/en-us/library/microsoft.phone.tasks.sharelinktask(v=VS.92).aspx">ShareLinkTask class</a> and <a href="http://msdn.microsoft.com/en-us/library/microsoft.phone.tasks.sharestatustask(v=VS.92).aspx">Share Status Task Class</a>!</p>
<p>If you have any questions, feel free to contact me via the contact form, comment or email me at guohong@limguohong.com</p>
<p>Do check out the <a href="http://www.limguohong.com/tutorials/">tutorial page</a> too!</p>
<div class='wpfblike' style='height: 60px;'><iframe src='http://www.facebook.com/plugins/like.php?href=http://www.limguohong.com/2011/10/bingmapsdirectionstask-getting-driving-walking-directions/&amp;layout=default&amp;show_faces=true&amp;width=400&amp;action=like&amp;colorscheme=light&amp;send=false' scrolling='no' frameborder='0' allowTransparency='true' style='border:none; overflow:hidden; width:400px;'></iframe></div>]]></content:encoded>
			<wfw:commentRss>http://www.limguohong.com/2011/10/bingmapsdirectionstask-getting-driving-walking-directions/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Microsoft Excel 2010 &#8211; Protecting selected cells</title>
		<link>http://www.limguohong.com/2011/04/microsoft-excel-2010-protecting-selected-cells/</link>
		<comments>http://www.limguohong.com/2011/04/microsoft-excel-2010-protecting-selected-cells/#comments</comments>
		<pubDate>Sat, 30 Apr 2011 08:35:21 +0000</pubDate>
		<dc:creator>Guo Hong</dc:creator>
				<category><![CDATA[microsoft]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[excel 2010]]></category>
		<category><![CDATA[help]]></category>
		<category><![CDATA[microsoft excel]]></category>
		<category><![CDATA[microsoft excel 2010]]></category>
		<category><![CDATA[microsoft office]]></category>
		<category><![CDATA[Protecting selected cells]]></category>

		<guid isPermaLink="false">http://www.limguohong.com/?p=565</guid>
		<description><![CDATA[I was at Yishun Town Secondary School the other day to assist on the Gerald, Microsoft School Technology Innovation Center Manager, presentation on a hands on session for Microsoft Office techology. We were posed some questions, I realised that it is useful to post some of them in a form of guide here so it [...]]]></description>
			<content:encoded><![CDATA[<p>I was at Yishun Town Secondary School the other day to assist on the Gerald, Microsoft School Technology Innovation Center Manager, presentation on a hands on session for Microsoft Office techology.</p>
<p>We were posed some questions, I realised that it is useful to post some of them in a form of guide here so it will help teachers. How do we protect some cells and not allow editing on them while allowing some others to be edited. It will be useful when ICT HODs or teachers want to do up an excel document with the formulas and wish to send to his/her team to use but they do not want them to mess it up.</p>
<p><a href="http://www.limguohong.com/wp-content/uploads/2011/04/excel-protection-01.png"><img class="alignnone size-large wp-image-550" title="excel-protection-01" src="http://www.limguohong.com/wp-content/uploads/2011/04/excel-protection-01-1024x640.png" alt="" width="600" height="375" /></a><br />
1. First, lets open up Microsoft Excel 2010.</p>
<p><a href="http://www.limguohong.com/wp-content/uploads/2011/04/excel-protection-02.png"><img class="alignnone size-large wp-image-551" title="excel-protection-02" src="http://www.limguohong.com/wp-content/uploads/2011/04/excel-protection-02-1024x640.png" alt="" width="600" height="375" /></a><br />
2. In this example, we will add first and second column and show the result in the third column.<br />
Select A3, go to Formulas tab &gt; AutoSum &gt; Sum</p>
<p><a href="http://www.limguohong.com/wp-content/uploads/2011/04/excel-protection-03.png"><img class="alignnone size-large wp-image-552" title="excel-protection-03" src="http://www.limguohong.com/wp-content/uploads/2011/04/excel-protection-03-1024x640.png" alt="" width="600" height="375" /></a><br />
3. Select A1 and A2 for your data range.</p>
<p><a href="http://www.limguohong.com/wp-content/uploads/2011/04/excel-protection-04.png"><img class="alignnone size-large wp-image-553" title="excel-protection-04" src="http://www.limguohong.com/wp-content/uploads/2011/04/excel-protection-04-1024x640.png" alt="" width="600" height="375" /></a><br />
4. On the bottom right of the cell, you will see a enlarged black dot, click on it and drag it all the way down to 20th row. ( In this example, we will just make use of 20 rows for the calculation. )</p>
<p><a href="http://www.limguohong.com/wp-content/uploads/2011/04/excel-protection-05.png"><img class="alignnone size-large wp-image-554" title="excel-protection-05" src="http://www.limguohong.com/wp-content/uploads/2011/04/excel-protection-05-1024x640.png" alt="" width="600" height="375" /></a><br />
5. You will see something like this.</p>
<p><a href="http://www.limguohong.com/wp-content/uploads/2011/04/excel-protection-06.png"><img class="alignnone size-large wp-image-555" title="excel-protection-06" src="http://www.limguohong.com/wp-content/uploads/2011/04/excel-protection-06-1024x640.png" alt="" width="600" height="375" /></a><br />
6. Right click on the 20 cells and go to Format Cells</p>
<p><a href="http://www.limguohong.com/wp-content/uploads/2011/04/excel-protection-07.png"><img class="alignnone size-large wp-image-556" title="excel-protection-07" src="http://www.limguohong.com/wp-content/uploads/2011/04/excel-protection-07-1024x640.png" alt="" width="600" height="375" /></a><br />
7. Go to Protection and make sure <em>Locked </em>is ticked. This means these cells are not allowed to be edited.</p>
<p><a href="http://www.limguohong.com/wp-content/uploads/2011/04/excel-protection-08.png"><img class="alignnone size-large wp-image-557" title="excel-protection-08" src="http://www.limguohong.com/wp-content/uploads/2011/04/excel-protection-08-1024x640.png" alt="" width="600" height="375" /></a><br />
8. Now Select A1 to B20</p>
<p><a href="http://www.limguohong.com/wp-content/uploads/2011/04/excel-protection-09.png"><img class="alignnone size-large wp-image-558" title="excel-protection-09" src="http://www.limguohong.com/wp-content/uploads/2011/04/excel-protection-09-1024x640.png" alt="" width="600" height="375" /></a><br />
9. Right click on the selected cells and go to Format Cells</p>
<p><a href="http://www.limguohong.com/wp-content/uploads/2011/04/excel-protection-10.png"><img class="alignnone size-large wp-image-559" title="excel-protection-10" src="http://www.limguohong.com/wp-content/uploads/2011/04/excel-protection-10-1024x640.png" alt="" width="600" height="375" /></a><br />
10. Go to the Protection Tab and untick <em>Locked</em> ( This means these cells can be edited )</p>
<p><a href="http://www.limguohong.com/wp-content/uploads/2011/04/excel-protection-11.png"><img class="alignnone size-large wp-image-560" title="excel-protection-11" src="http://www.limguohong.com/wp-content/uploads/2011/04/excel-protection-11-1024x640.png" alt="" width="600" height="375" /></a><br />
11. You might want to color the cells so that your end user will know that these cells can be edited by going to Home tab &gt; Cell Styles &gt; choose Input.</p>
<p><a href="http://www.limguohong.com/wp-content/uploads/2011/04/excel-protection-12.png"><img class="alignnone size-large wp-image-561" title="excel-protection-12" src="http://www.limguohong.com/wp-content/uploads/2011/04/excel-protection-12-1024x640.png" alt="" width="600" height="375" /></a><br />
12. Go to Review tab &gt; Protect Sheet</p>
<p><a href="http://www.limguohong.com/wp-content/uploads/2011/04/excel-protection-13.png"><img class="alignnone size-large wp-image-562" title="excel-protection-13" src="http://www.limguohong.com/wp-content/uploads/2011/04/excel-protection-13-1024x640.png" alt="" width="600" height="375" /></a><br />
13. Input a password into the dialog box which appears. Please remember the password as you require that to unlock.</p>
<p><a href="http://www.limguohong.com/wp-content/uploads/2011/04/excel-protection-14.png"><img class="alignnone size-large wp-image-563" title="excel-protection-14" src="http://www.limguohong.com/wp-content/uploads/2011/04/excel-protection-14-1024x640.png" alt="" width="600" height="375" /></a><br />
14. Another dialog box will appear to confirm the password, input the same password in again.</p>
<p><a href="http://www.limguohong.com/wp-content/uploads/2011/04/excel-protection-15.png"><img class="alignnone size-large wp-image-564" title="excel-protection-15" src="http://www.limguohong.com/wp-content/uploads/2011/04/excel-protection-15-1024x640.png" alt="" width="600" height="375" /></a><br />
15. Try inputing values in A1-B20 and you will realised that you can do it but you cant do it when you try on other cells.</p>
<p>This concludes the tutorial on how do you protect selected cells in Microsoft Excel 2010. I have attached the sample document which you can download and have a look.</p>
<p><a href="http://cid-29f099c37b76ca59.office.live.com/self.aspx/Blog/Office%20Demo/Protecting%5E_Selected%5E_Cells.xlsx">http://cid-29f099c37b76ca59.office.live.com/self.aspx/Blog/Office%20Demo/Protecting%5E_Selected%5E_Cells.xlsx</a></p>
<p>Should you have any question, please feel free to contact me at guohong@limguohong.com</p>
<div class='wpfblike' style='height: 60px;'><iframe src='http://www.facebook.com/plugins/like.php?href=http://www.limguohong.com/2011/04/microsoft-excel-2010-protecting-selected-cells/&amp;layout=default&amp;show_faces=true&amp;width=400&amp;action=like&amp;colorscheme=light&amp;send=false' scrolling='no' frameborder='0' allowTransparency='true' style='border:none; overflow:hidden; width:400px;'></iframe></div>]]></content:encoded>
			<wfw:commentRss>http://www.limguohong.com/2011/04/microsoft-excel-2010-protecting-selected-cells/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Connecting to SQL Azure with PHP</title>
		<link>http://www.limguohong.com/2011/02/connecting-to-sql-azure-with-php/</link>
		<comments>http://www.limguohong.com/2011/02/connecting-to-sql-azure-with-php/#comments</comments>
		<pubDate>Thu, 03 Feb 2011 05:11:32 +0000</pubDate>
		<dc:creator>Guo Hong</dc:creator>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[SQL Azure]]></category>
		<category><![CDATA[azure]]></category>
		<category><![CDATA[guide]]></category>
		<category><![CDATA[odbc]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[sample]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.limguohong.com/?p=474</guid>
		<description><![CDATA[To start, I would like to first say that although many PHP developers usually recommend MySQL as the accompanying database for PHP, it is not difficult to interface PHP with other databases such as SQL Azure, Microsoft’s cloud-based relational database offering. PHP connects with SQL Azure in a similar manner as how it does with [...]]]></description>
			<content:encoded><![CDATA[<p>To start, I would like to first say that although many PHP developers usually recommend MySQL as the accompanying database for PHP, it is <strong>not difficult</strong> to interface PHP with other databases such as SQL Azure, Microsoft’s cloud-based relational database offering.</p>
<p>PHP connects with SQL Azure in a similar manner as how it does with Microsoft SQL Server, ie through an interface known as the Open Database Connectivity (ODBC), which is actually the standard software interface for accessing databases. Each platform and database has its own implementation following the ODBC standard but for this tutorial, I’ll focus on PHP.</p>
<p>There are a few ways to connect your php site to MS SQL but the 2 main approaches are as shown in Figure 1.0.</p>
<p>1. Using the “php_mssql.dll” php extension requiring MS SQL Client Tools installed (Figure 1.0, right column).<br />
2. Using the “sqlsrv” driver (“<a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=80e44913-24b4-4113-8807-caae6cf2ca05">Microsoft Drivers for PHP for SQL Server</a>”) requiring MS SQL Native Client installed (Figure 1.0, left column)</p>
<p style="text-align: center;"><a href="http://www.limguohong.com/wp-content/uploads/2011/02/1.0.jpg"><img class="alignnone size-full wp-image-475" title="1.0" src="http://www.limguohong.com/wp-content/uploads/2011/02/1.0.jpg" alt="" width="461" height="494" /></a><br />
Figure 1.0</p>
<p>I will be using the 2nd approach for this tutorial because it supports both PHP 5.2 and 5.3, unlike the 1st which is not available for PHP 5.3.<br />
 <br />
<span style="text-decoration: underline;"><strong>Microsoft Drivers for PHP for SQL Server</strong></span><br />
As of 1 February 2011, the latest version of the driver is version 2.0.1 (30 November 2010).<br />
You can grab it from <a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=80e44913-24b4-4113-8807-caae6cf2ca05 ">http://www.microsoft.com/downloads/en/details.aspx?FamilyID=80e44913-24b4-4113-8807-caae6cf2ca05</a><br />
Once you have installed the drivers, you should see the following in the installation directory:</p>
<p style="text-align: center;"><a href="http://www.limguohong.com/wp-content/uploads/2011/02/2.0.png"><img class="size-full wp-image-476 aligncenter" title="2.0" src="http://www.limguohong.com/wp-content/uploads/2011/02/2.0.png" alt="" width="197" height="321" /></a><br />
Figure 2.0</p>
<p>We will be using the “php_sqlsrv_53_nts_vc9.dll” library for this tutorial.<br />
• “php_sqlsrv” &#8211;&gt; Driver name<br />
• “53” &#8211;&gt; PHP 5.3<br />
• “nts” &#8211;&gt; Non-thread safe (The PHP FastCGI Handler of IIS handles thread-safe operations for PHP, use the non-thread safe version to reduce performance issues)<br />
• “vc9” &#8211;&gt; Library compiled using VS 2008, use vc6 (VS 6) if PHP is running on Apache<br />
Configure PHP<br />
1. Copy “php_sqlsrv_53_nts_vc9.dll” into the “ext” folder of your php installation directory.<br />
2. Edit the php.ini to include the library</p>
<p style="text-align: center;"><a href="http://www.limguohong.com/wp-content/uploads/2011/02/3.0.png"><img class="alignnone size-full wp-image-477" title="3.0" src="http://www.limguohong.com/wp-content/uploads/2011/02/3.0.png" alt="" width="351" height="33" /></a><br />
Figure 3.0</p>
<p> <br />
<span style="text-decoration: underline;"><strong>Microsoft SQL Server 2008 R2 Native Client</strong></span><br />
In order for the PHP for SQL Server Drivers to work, the necessary SQL Server ODBC drivers must be installed on the web server.<br />
The version of the ODBC driver needed for SQL Azure comes with the SQL Server 2008 R2 Native Client.<br />
You can grab it from <a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=ceb4346f-657f-4d28-83f5-aae0c5c83d52">http://www.microsoft.com/downloads/en/details.aspx?FamilyID=ceb4346f-657f-4d28-83f5-aae0c5c83d52</a></p>
<p><span style="text-decoration: underline;"><strong>PHP Syntax</strong></span><br />
After all the preparation and configuration, here comes the actual thing -&gt; Coding!<br />
This tutorial showcases how to do simple CRUD (Create, Retrieve, Update, Delete) commands.<br />
1. Connect to Database:</p>
<blockquote><p>$serverName = &#8220;servername.database.windows.net&#8221;;<br />
$connInfo = array(&#8220;UID&#8221;=&gt;&#8221;username@servername&#8221;,<br />
&#8220;PWD&#8221;=&gt;&#8221;password&#8221;,<br />
&#8220;Database&#8221;=&gt;&#8221;databasename&#8221;);<br />
$conn = sqlsrv_connect($serverName, $connInfo);</p>
</blockquote>
<p>2. Insert data to Database (taking data from a html form text field):</p>
<blockquote><p>$comment = $_POST["txtComment"];<br />
$comm = &#8220;INSERT INTO commentsqlazure (commentContent) VALUES (?)&#8221;;<br />
$stmt = sqlsrv_prepare($conn, $comm, array(&amp;$comment));<br />
$result = sqlsrv_execute($stmt);</p>
</blockquote>
<p>3. Update data in Database:</p>
<blockquote><p>$Id = $_POST["txtUpdateId"];<br />
$comment = $_POST["txtUpdateComment"];<br />
$comm = &#8220;UPDATE commentsqlazure SET commentContent = ? WHERE id = ?&#8221;;<br />
$stmt = sqlsrv_prepare($conn, $comm, array(&amp;$comment, &amp;$Id));<br />
$result = sqlsrv_execute($stmt);</p>
</blockquote>
<p>4. Remove data from Database:</p>
<blockquote><p>$Id = $_POST["txtRemoveId"];<br />
$comm = &#8220;DELETE FROM commentsqlazure WHERE id = ?&#8221;;<br />
$stmt = sqlsrv_prepare($conn, $comm, array(&amp;$Id));<br />
$result = sqlsrv_execute($stmt);</p>
</blockquote>
<p>5. Retrieve data from Database:</p>
<blockquote><p>$comm = &#8220;SELECT id, commentContent FROM commentsqlazure&#8221;;<br />
$stmt = sqlsrv_query($conn, $comm);<br />
while($row = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_ASSOC))<br />
{<br />
echo $row["id"].&#8221; &#8220;.$row["commentContent"].&#8221;<br />
&#8220;;<br />
}</p>
</blockquote>
<p>6. Close connection and release resources:</p>
<blockquote><p>sqlsrv_free_stmt($stmt);<br />
sqlsrv_close($conn);</p>
</blockquote>
<p>You can download the project file from here.<br />
<a href="http://cid-29f099c37b76ca59.office.live.com/browse.aspx/Blog/Code%20Guide/SQL%20Azure?uc=1">http://cid-29f099c37b76ca59.office.live.com/browse.aspx/Blog/Code%20Guide/SQL%20Azure?uc=1</a></p>
<p>Please take note that you have to change the Server Name, Username, Password at the connection string to make this work. You should run the following script to the table first.<br />
<a href="http://cid-29f099c37b76ca59.office.live.com/self.aspx/Blog/Code%20Guide/SQL%20Azure/SQLAzureConnection.sql">http://cid-29f099c37b76ca59.office.live.com/self.aspx/Blog/Code%20Guide/SQL%20Azure/SQLAzureConnection.sql</a></p>
<p>Credit to Luke Ng.</p>
<div class='wpfblike' style='height: 60px;'><iframe src='http://www.facebook.com/plugins/like.php?href=http://www.limguohong.com/2011/02/connecting-to-sql-azure-with-php/&amp;layout=default&amp;show_faces=true&amp;width=400&amp;action=like&amp;colorscheme=light&amp;send=false' scrolling='no' frameborder='0' allowTransparency='true' style='border:none; overflow:hidden; width:400px;'></iframe></div>]]></content:encoded>
			<wfw:commentRss>http://www.limguohong.com/2011/02/connecting-to-sql-azure-with-php/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Creating your first game on Popfly</title>
		<link>http://www.limguohong.com/2008/10/creating-your-first-game-on-popfly/</link>
		<comments>http://www.limguohong.com/2008/10/creating-your-first-game-on-popfly/#comments</comments>
		<pubDate>Wed, 22 Oct 2008 17:15:50 +0000</pubDate>
		<dc:creator>Guo Hong</dc:creator>
				<category><![CDATA[microsoft]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[game]]></category>
		<category><![CDATA[help]]></category>
		<category><![CDATA[popfly]]></category>
		<category><![CDATA[popfly game]]></category>

		<guid isPermaLink="false">http://www.limguohong.com/?p=229</guid>
		<description><![CDATA[Microsoft Popfly (internally codenamed Springfield) is a website that allows users to create web pages, program snippets, and mashups using the Microsoft Silverlight rich internet applications runtime and the set of online tools provided. Popfly is currently in Beta stage of development. It requires users to log in with their Windows Live ID, and provide [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>Microsoft Popfly (internally codenamed Springfield) is a website that allows users to create web pages, program snippets, and mashups using the Microsoft Silverlight rich internet applications runtime and the set of online tools provided. Popfly is currently in Beta stage of development. It requires users to log in with their Windows Live ID, and provide additional information about themselves when logging in for the first time to use Popfly.</p></blockquote>
<p><em>Quoted from <a href="http://en.wikipedia.org/wiki/Microsoft_Popfly">http://en.wikipedia.org/wiki/Microsoft_Popfly<br />
</a><br />
</em></p>
<p><a href="http://www.popfly.com">http://www.popfly.com</a> | I will be giving a tutorial on how to create a game on popfly. I personally think making a game on popfly all boils down to 3 simple general steps.</p>
<p>1. Ideas<br />
2. Creating the game<br />
3. Tweak the game to make it better</p>
<p>I will be teaching mainly the second stage, the creation of the game. I will pull in some simple functions which most people will be using when they are creating a game on popfly. Without further ado, we will start the fun!</p>
<p><span id="more-229"></span></p>
<hr />
<p>Preface:<br />
This will be a very simple game, there will have a few different-colour apples ( red, green and purple ). Players are supposed to push the apple into the respective colored boxes to gain points.</p>
<p>Creating of the games:<br />
1. Go to <a href="http://www.popfly.com">http://www.popfly.com</a><br />
<img src="http://www.limguohong.com/tutorial/popfly/game1/1.png" alt="" /></p>
<p>2. Choose &#8220;Create a Game&#8221;<br />
<img src="http://www.limguohong.com/tutorial/popfly/game1/2.png" alt="" /></p>
<p>3. Lets create a game from scratch ( Author note: You can actually start with a template next time and see how it actually works. It will be pretty useful for your learning. )<br />
<img src="http://www.limguohong.com/tutorial/popfly/game1/3.png" alt="" /></p>
<p>4.  On the top left hand concer, make sure Actors is chosen.<br />
Actors are what &#8220;figures&#8221; you will be using in your game.<br />
<img src="http://www.limguohong.com/tutorial/popfly/game1/4.png" alt="" /></p>
<p>5. Using that search bar, lets search for 1 &#8220;dog&#8221;, 2 &#8220;apples&#8221; and 2 &#8220;bricks&#8221; of the same colour as the apples.<br />
<img src="http://www.limguohong.com/tutorial/popfly/game1/5.png" alt="" width="70%" /><br />
<img src="http://www.limguohong.com/tutorial/popfly/game1/6.png" alt="" /></p>
<p><em>Basicially you have added all the &#8220;actors&#8221; needed to have to start this game but a game will be meaningless if the figure just stand there and do nothing. Lets edit the behaviour of the different actor.</em></p>
<p>6. Click on the dog on the selected actor panel.<br />
<img src="http://www.limguohong.com/tutorial/popfly/game1/7.png" alt="" /></p>
<p>7. Lets edit the behaviour, click on the behaviours button on th left.<br />
<img src="http://www.limguohong.com/tutorial/popfly/game1/8.png" alt="" width="70%" /></p>
<p>8. Popfly is cool enough to actually add some common shortcuts and which one of them we will be using it. Choose it on the top right.<br />
<img src="http://www.limguohong.com/tutorial/popfly/game1/9.png" alt="" width="70%" /></p>
<p>You should see something like this.<br />
<img src="http://www.limguohong.com/tutorial/popfly/game1/10.png" alt="" width="70%" /></p>
<p>9. You can actually play with other features that popfly offer and change how the actor ( dog ) works.<br />
<img src="http://www.limguohong.com/tutorial/popfly/game1/11.png" alt="" width="70%" /></p>
<p>10. Lets do the same for the apple.<br />
<img src="http://www.limguohong.com/tutorial/popfly/game1/12.png" alt="" /></p>
<p>11. Do the follow setting<br />
<img src="http://www.limguohong.com/tutorial/popfly/game1/13.png" alt="" width="70%" /></p>
<p><img src="http://www.limguohong.com/tutorial/popfly/game1/14.png" alt="" /></p>
<p><img src="http://www.limguohong.com/tutorial/popfly/game1/15.png" alt="" width="70%" /></p>
<p><img src="http://www.limguohong.com/tutorial/popfly/game1/16.png" alt="" /></p>
<p>12. Do the same for the green apple.</p>
<p>We have completed all the actors setting. Lets move to the scene setting.<br />
<img src="http://www.limguohong.com/tutorial/popfly/game1/17.png" alt="" /></p>
<p>13. Arrange the items to be something like the follow.<br />
<img src="http://www.limguohong.com/tutorial/popfly/game1/18.png" alt="" /></p>
<p>14. Click on Behaviors &gt; Property &gt; Events &gt; Collision<br />
<img src="http://www.limguohong.com/tutorial/popfly/game1/14.png" alt="" /></p>
<p>15. Click on Behaviors &gt; Property &gt; Events &gt; Score<br />
<img src="http://www.limguohong.com/tutorial/popfly/game1/19.png" alt="" /></p>
<p>Do it for both the green and red apple.</p>
<p>16. Click on Behaviors &gt; Scene &gt; Event<br />
<img src="http://www.limguohong.com/tutorial/popfly/game1/20.png" alt="" /></p>
<p>17. Click on Behaviors &gt; Scene &gt; Scene (Won)</p>
<p><strong>Thinking points:</strong></p>
<ol>
<li>Changing the scene ( Intro, Main, Won, Lost, How to Play )</li>
<li>Adding other scenes</li>
<li>Make a shooting game</li>
<li>Try other features on Popfly</li>
</ol>
<hr />
This is a very simple tutorial on how to create your first game on popfly. I am quite a &#8220;newbie&#8221; in creating tutorial but I hope it helps, I will keep on editting and updating it whenever i find that it is not good. You can actually find more information under <a href="http://www.limguohong.com/tutorials">http://www.limguohong.com/tutorials</a></p>
<div class='wpfblike' style='height: 60px;'><iframe src='http://www.facebook.com/plugins/like.php?href=http://www.limguohong.com/2008/10/creating-your-first-game-on-popfly/&amp;layout=default&amp;show_faces=true&amp;width=400&amp;action=like&amp;colorscheme=light&amp;send=false' scrolling='no' frameborder='0' allowTransparency='true' style='border:none; overflow:hidden; width:400px;'></iframe></div>]]></content:encoded>
			<wfw:commentRss>http://www.limguohong.com/2008/10/creating-your-first-game-on-popfly/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What I will be doing next?</title>
		<link>http://www.limguohong.com/2008/10/what-i-will-be-doing-next/</link>
		<comments>http://www.limguohong.com/2008/10/what-i-will-be-doing-next/#comments</comments>
		<pubDate>Thu, 02 Oct 2008 19:14:51 +0000</pubDate>
		<dc:creator>Guo Hong</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[mangakey]]></category>
		<category><![CDATA[references]]></category>
		<category><![CDATA[to-do-list]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.limguohong.com/?p=220</guid>
		<description><![CDATA[Seems like its about 90% done. I am looking to do a full HTML or CSS reference and tutorial website once I am done with my current website and promotion. I have a few domains to use. To do list: -Upgrade my blog&#8217;s script -C# boot camp #2 / #3 ( Its lying in my [...]]]></description>
			<content:encoded><![CDATA[<p>Seems like its about 90% done.</p>
<p>I am looking to do a full HTML or CSS reference and tutorial website once I am done with my current website and promotion.</p>
<p>I have a few domains to use.</p>
<p>To do list:<br />
-Upgrade my blog&#8217;s script<br />
-C# boot camp #2 / #3 ( Its lying in my admin panel for very long already. )<br />
-Disclaimer and About Me page.<br />
-Clear up unused domains in my cPanel<br />
-Clear up unused MySQL in my cPanel</p>
<div class='wpfblike' style='height: 60px;'><iframe src='http://www.facebook.com/plugins/like.php?href=http://www.limguohong.com/2008/10/what-i-will-be-doing-next/&amp;layout=default&amp;show_faces=true&amp;width=400&amp;action=like&amp;colorscheme=light&amp;send=false' scrolling='no' frameborder='0' allowTransparency='true' style='border:none; overflow:hidden; width:400px;'></iframe></div>]]></content:encoded>
			<wfw:commentRss>http://www.limguohong.com/2008/10/what-i-will-be-doing-next/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

