<?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>MangoOrange™ &#187; Web Programming</title>
	<atom:link href="http://www.mangoorange.com/category/web-programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mangoorange.com</link>
	<description>Web Hosting Reviews &#38; Mac WordPress Theme</description>
	<lastBuildDate>Wed, 25 Jan 2012 18:31:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Installing Python MySQLdb 1.2.2 on Mac OS X</title>
		<link>http://www.mangoorange.com/2008/08/01/installing-python-mysqldb-122-on-mac-os-x/</link>
		<comments>http://www.mangoorange.com/2008/08/01/installing-python-mysqldb-122-on-mac-os-x/#comments</comments>
		<pubDate>Fri, 01 Aug 2008 16:59:37 +0000</pubDate>
		<dc:creator>mangoorange</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Web Programming]]></category>
		<category><![CDATA[1.2.2]]></category>
		<category><![CDATA[mac osx]]></category>
		<category><![CDATA[mysqldb]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.mangoorange.com/?p=182</guid>
		<description><![CDATA[I started working on Python start of the year and I learned a lot while I'm doing my internship in my current company, MooWee Inc. So it's logical for me to try to pick up Django as the web framework. One of the hurdle I met and everyone else met is trying to install MySQL [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright" style="float: right;" src="http://farm2.static.flickr.com/1319/1129819772_77804dda7f.jpg" alt="Python" width="253" height="85" />I started working on <a title="Python" href="http://www.python.org" target="_blank">Python</a> start of the year and I learned a lot while I'm doing my internship in my current company, <a title="Moowee, Inc" href="http://moowee.tv/" target="_blank">MooWee Inc</a>. So it's logical for me to try to pick up <a title="Django Project" href="http://djangoproject.org" target="_blank">Django</a> as the web framework.</p>
<p>One of the hurdle I met and everyone else met is trying to install <a title="MySQL" href="http://www.mysql.org" target="_blank">MySQL</a> adapter for Python. Being the most popular database used, it is crucial to have it work rather than circumventing around the problem by using alternative database such as <a title="SQLite" href="http://www.sqlite.org" target="_blank">SQLite</a> or <a title="PostgreSQL" href="http://www.postgresql.org/" target="_blank">PostgreSQL</a>.</p>
<p>After a few hours of searching, I found a few references that somewhat not entirely complete. I did some cross referencing and found two brings me to the entire solutions, which I'm about to show below.</p>
<p><span id="more-182"></span></p>
<p><span style="text-decoration: underline;"><strong>Step 0:<br />
</strong></span>Before I start, I assumed that you have <a title="MySQL" href="http://mysql.org" target="_blank">MySQL</a> and <a title="Python" href="http://www.python.org" target="_blank">Python</a> installed on the mac.</p>
<p><span style="text-decoration: underline;"><strong>Step 1:</strong></span><br />
Download the latest <a title="MySQL for Python" href="http://sourceforge.net/project/showfiles.php?group_id=22307" target="_blank">MySQL for Python</a> adapter from SourceForge.</p>
<p><span style="text-decoration: underline;"><strong>Step 2:</strong></span><br />
Extract your downloaded package by typing</p>
<p><code>$ tar xzvf MySQL-python-1.2.2.tar.gz</code></p>
<p><strong><span style="text-decoration: underline;">Step 3:<br />
</span></strong>Inside the folder, clean the package by typing</p>
<p><code>$ sudo python setup.py clean</code></p>
<p><span style="text-decoration: underline;"><strong>Step 4:</strong></span><br />
In the same folder, edit _mysql.c using your favourite text-editor</p>
<p>4a. Remove the following lines (37-39):</p>
<p><code>#ifndef uint<br />
#define uint unsigned int<br />
#endif</code></p>
<p>4b. Change the following:</p>
<p><code>uint port = MYSQL_PORT;<br />
uint client_flag = 0;</code></p>
<p>to</p>
<p><code>unsigned int port = MYSQL_PORT;<br />
unsigned int client_flag = 0;</code></p>
<p><span style="text-decoration: underline;"><strong>Step 5:</strong></span><br />
Create a symbolic link under lib to point to a sub-directory called mysql. This is where it looks for during compilation.</p>
<p><code>$ sudo ln -s /usr/local/mysql/lib /usr/local/mysql/lib/mysql</code></p>
<p><span style="text-decoration: underline;"><strong>Step 6:</strong></span><br />
Edit the setup_posix.py and change the following</p>
<p><code>mysql_config.path = "mysql_config"</code></p>
<p>to</p>
<p><code>mysql_config.path = "/usr/local/mysql/bin/mysql_config"</code></p>
<p><span style="text-decoration: underline;"><strong>Step 7:</strong></span><br />
In the same directory, rebuild your package (ignore the warnings that comes with it)</p>
<p><code>$ sudo python setup.py build</code></p>
<p><span style="text-decoration: underline;"><strong>Step 8:</strong></span><br />
Install the package and you are done.</p>
<p><code>$ sudo python setup.py install</code></p>
<p><span style="text-decoration: underline;"><strong>Step 9:</strong></span><br />
Test if it's working. It works if you can import MySQLdb.</p>
<p><code>$ python<br />
&gt;&gt;&gt; import MySQLdb</code></p>
<p>Voila.</p>
<p><span style="text-decoration: underline;"><strong>References:</strong></span><br />
<a title="n.code" href="http://dotnet.org.za/ncode/archive/2007/01/31/setting-up-mysql-for-python-mysqldb-on-mac-os-x-2.aspx" target="_blank">n.code</a><br />
<a title="Red Elephant" href="http://www.keningle.com/?p=11" target="_blank">RedElephant</a><br />
<a title="Django users Google Groups" href="http://groups.google.com/group/django-users/browse_thread/thread/b3e125adaf6e8356" target="_blank">Django users Google Groups</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.mangoorange.com/2008/08/01/installing-python-mysqldb-122-on-mac-os-x/feed/</wfw:commentRss>
		<slash:comments>26</slash:comments>
		</item>
		<item>
		<title>$_REQUEST, what a joke!</title>
		<link>http://www.mangoorange.com/2007/08/24/_request-what-a-joke/</link>
		<comments>http://www.mangoorange.com/2007/08/24/_request-what-a-joke/#comments</comments>
		<pubDate>Fri, 24 Aug 2007 12:24:21 +0000</pubDate>
		<dc:creator>mangoorange</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Programming]]></category>

		<guid isPermaLink="false">http://www.mangoorange.com/2007/08/24/_request-what-a-joke/</guid>
		<description><![CDATA[I can't believed it that I've been using extract($_GET) and extract($_POST) where I could just type in extract($_REQUEST). Feel so silly now. Nevertheless, it was cool to learn that it exist. Never to late to learn. More information can be found here (that's where I found what it means): http://www.w3schools.com/php/php_get.asp]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.php.net/images/logos/php-med-trans-light.gif" title="PHP" alt="PHP" align="right" height="51" width="95" />I can't believed it that I've been using <strong>extract($_GET)</strong> and <strong>extract($_POST)</strong> where I could just type in <strong>extract($_REQUEST)</strong>. Feel so silly now. Nevertheless, it was cool to learn that it exist. Never to late to learn. <img src='http://www.mangoorange.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>More information can be found here (that's where I found what it means):<br />
<a href="http://www.w3schools.com/php/php_get.asp" title="W3Schools PHP" target="_blank"> http://www.w3schools.com/php/php_get.asp</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.mangoorange.com/2007/08/24/_request-what-a-joke/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>How to teach web programming?</title>
		<link>http://www.mangoorange.com/2007/06/13/how-to-teach-web-programming/</link>
		<comments>http://www.mangoorange.com/2007/06/13/how-to-teach-web-programming/#comments</comments>
		<pubDate>Wed, 13 Jun 2007 02:33:57 +0000</pubDate>
		<dc:creator>mangoorange</dc:creator>
				<category><![CDATA[Journal]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[Web Programming]]></category>

		<guid isPermaLink="false">http://www.mangoorange.com/2007/06/13/how-to-teach-web-programming/</guid>
		<description><![CDATA[I always wanted to give back to the society and lately, I told myself, "Why not teach the students on how to design and program a website?" In Singapore, not many have the web programming and design skills and I personally finds it very useful. Coincidentally, when I was back at home, my sisters wanted me to teach them how to do it. [...]]]></description>
			<content:encoded><![CDATA[<p><img align="left" src="http://www.mangoorange.com/wp-content/uploads/2007/06/how-to-teach.png" alt="How to teach web programming" style="border: medium none" title="How to teach web programming" />I always wanted to give back to the society and lately, I told myself, "Why not teach the students on how to design and program a website?" In Singapore, not many have the web programming and design skills and I personally finds it very useful. Coincidentally, when I was back at home, my sisters wanted me to teach them how to do it. So I took this opportunity to try my teaching method.</p>
<p>Surprisingly, it's much harder than I thought. There are so many things involved around this "Web" subject ranging from the <strong>technicality of web server technologies, web standards, HTML, PHP, MySQL, CSS, Javascript</strong>, etc. And most of them correlated. <strong>Chicken and Egg problem</strong>.</p>
<p>I began to wonder, should I take at a high level approach or a low level approach? A high level approach would to be give them a well-finish site, like <a target="_blank" href="http://www.wordpress.org/" title="Wordpress">WordPress</a>, and start exploring parts by parts when they want to make changes to the website, wherelse a low level one will be explain bits and pieces and relate it to them.</p>
<p>What do all of you think? Do you all have any experience in learning or teaching?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mangoorange.com/2007/06/13/how-to-teach-web-programming/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

