<?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>Lloyd Leung &#187; Programming</title>
	<atom:link href="http://www.lloydleung.com/category/technology/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.lloydleung.com</link>
	<description>Thoughts, ramblings, projects.</description>
	<lastBuildDate>Sat, 12 Jun 2010 21:01:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Debugging a segfault in PHP</title>
		<link>http://www.lloydleung.com/2010/04/01/debugging-a-segfault-in-php/</link>
		<comments>http://www.lloydleung.com/2010/04/01/debugging-a-segfault-in-php/#comments</comments>
		<pubDate>Thu, 01 Apr 2010 21:29:23 +0000</pubDate>
		<dc:creator>Lloyd Leung</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.lloydleung.com/?p=236</guid>
		<description><![CDATA[debugging segfaults is not fun. My low key technique: place a printf(&#8220;made it here: %s, %s+ %s\n&#8221;, __METHOD__, __LINE__, __FILE__); everywhere&#8230; put &#8220;DIE(&#8216;something&#8217;);&#8221; to figure out the exact line that fails.  If dies, good.  move it further down.  If it segfaults, move the die statement up.  Until you&#8217;ve found the exact line that fails. Figure [...]]]></description>
			<content:encoded><![CDATA[<p>debugging segfaults is not fun.</p>
<p>My low key technique:</p>
<ol>
<li>place a printf(&#8220;made it here: %s, %s+ %s\n&#8221;, __METHOD__, __LINE__, __FILE__);  everywhere&#8230;</li>
<li>put &#8220;DIE(&#8216;something&#8217;);&#8221; to figure out the exact line that fails.  If dies, good.  move it further down.  If it segfaults, move the die statement up.  Until you&#8217;ve found the exact line that fails.</li>
<li>Figure out why it&#8217;s segfaulting&#8230;  uh&#8230; good luck with that.  Google, and look at the changelog in PHP to see if it&#8217;s been fixed.</li>
</ol>
<p>An easier option, if I were the one controlling the box &#8212; Update to the latest PHP.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lloydleung.com/2010/04/01/debugging-a-segfault-in-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>little project ideas</title>
		<link>http://www.lloydleung.com/2010/03/01/little-project-ideas/</link>
		<comments>http://www.lloydleung.com/2010/03/01/little-project-ideas/#comments</comments>
		<pubDate>Mon, 01 Mar 2010 16:54:59 +0000</pubDate>
		<dc:creator>Lloyd Leung</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[project ideas]]></category>

		<guid isPermaLink="false">http://www.lloydleung.com/?p=233</guid>
		<description><![CDATA[Just found a need to access my home server&#8230; however, it&#8217;s powered down&#8230; how can I overcome this problem in the future.  To answer my own question&#8230;  I should go lookup how to send a wake-on-lan command to the box. As well as know what my IP is&#8230; project ideas: 1.) Current IP notifier &#8211; send [...]]]></description>
			<content:encoded><![CDATA[<p>Just found a need to access my home server&#8230; however, it&#8217;s powered down&#8230; how can I overcome this problem in the future.  To answer my own question&#8230;  I should go lookup how to send a wake-on-lan command to the box.  As well as know what my IP is&#8230;</p>
<p>project ideas:</p>
<p>1.) Current IP notifier &#8211; send to my webserver, what my home server IP is.  (Dynamic).  I could use a dynamic dns service&#8230;  this maybe interesting to learn how to do this, if I have my own VPS&#8230; have the home-server, notify the web-server to update the DNS setting.  So I would have something like:  homelan.lloydleung.com or whatever.</p>
<p>2.) wake on lan commands.<br />
3.) vpn to the network instead&#8230; with a combo on 1.  This way, everything is encrypted&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lloydleung.com/2010/03/01/little-project-ideas/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My current extension list for firefox 3.0.1</title>
		<link>http://www.lloydleung.com/2008/09/17/my-current-extension-list-for-firefox-301/</link>
		<comments>http://www.lloydleung.com/2008/09/17/my-current-extension-list-for-firefox-301/#comments</comments>
		<pubDate>Wed, 17 Sep 2008 22:16:18 +0000</pubDate>
		<dc:creator>Lloyd Leung</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.lloydleung.com/?p=160</guid>
		<description><![CDATA[Adblock Filterset.G Updater 0.3.1.3 Synchronizes Adblock with Filterset.G Adblock Plus 0.7.5.5 Ads were yesterday! Better Gmail 2 0.6.1 Enhances Gmail with a compilation of user scripts and styles. All scripts copyright their original authors. Click on the script homepage in the Help tab for more information. Canadian English Dictionary 1.1.1 Canadian English (en-CA) spellchecking dictionary [...]]]></description>
			<content:encoded><![CDATA[<ul>
<li><a href="http://www.pierceive.com/">Adblock Filterset.G Updater 0.3.1.3</a><br />
	Synchronizes Adblock with Filterset.G
</li>
<li><a href="http://adblockplus.org/">Adblock Plus 0.7.5.5</a><br />
	Ads were yesterday!
</li>
<li><a href="http://ginatrapani.org/workshop/firefox/bettergmail2/">Better Gmail 2 0.6.1</a><br />
	Enhances Gmail with a compilation of user scripts and styles.   All scripts copyright their original authors. Click on the script homepage in the Help tab for more information.
</li>
<li><a href="http://www2.cs.uregina.ca/~schmpaul/firefox/">Canadian English Dictionary 1.1.1</a><br />
	Canadian English (en-CA) spellchecking dictionary
</li>
<li><a href="http://delicious.com">Delicious Bookmarks 2.0.104</a><br />
	Access your bookmarks wherever you go and keep them organized no matter how many you have.
</li>
<li><a href="http://downloadstatusbar.mozdev.org/">Download Statusbar 0.9.6.3</a><br />
	View and manage downloads from a tidy statusbar
</li>
<li><a href="http://www.getfirebug.com/">Firebug 1.2.1</a><br />
	Web Development Evolved.
</li>
<li><a href="http://gears.google.com/">Google Gears 0.4.15.0</a><br />
	These are the gears that power the tubes! <img src='http://www.lloydleung.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />
</li>
<li><a href="http://www.greasespot.net/">Greasemonkey 0.8.20080609.0</a><br />
	A User Script Manager for Firefox
</li>
<li><a href="http://userstyles.org/stylish/">Stylish 0.5.7</a><br />
	Customise the look of websites and of the user interface.
</li>
<li><a href="http://tmp.garyr.net">Tab Mix Plus 0.3.7pre.080721</a><br />
	Tab browsing with an added boost.
</li>
<li><a href="http://trac.arantius.com/wiki/Extensions/TinyMenu">Tiny Menu 1.4.9</a><br />
	Replace the standard menu bar with a tiny menu popup.
</li>
<li><a href="http://chrispederick.com/work/web-developer/">Web Developer 1.1.6</a><br />
	Adds a menu and a toolbar with various web developer tools.
</li>
<li><a href="http://developer.yahoo.com/yslow">YSlow 0.9.5b2</a><br />
	Make your pages faster with Yahoo!&#8217;s performance lint tool.
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.lloydleung.com/2008/09/17/my-current-extension-list-for-firefox-301/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ajax form submits problem</title>
		<link>http://www.lloydleung.com/2007/05/08/ajax-form-submits-problem/</link>
		<comments>http://www.lloydleung.com/2007/05/08/ajax-form-submits-problem/#comments</comments>
		<pubDate>Wed, 09 May 2007 01:27:00 +0000</pubDate>
		<dc:creator>Lloyd Leung</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.lloydleung.com/2007/05/08/ajax-form-submits-problem/</guid>
		<description><![CDATA[yesterday was a few hours of frustration. Make sure your your &#60;form&#62; tag is within the same &#60;td&#62; cell element.Â  Otherwise it&#8217;s not XML compliant. You can have the form outside the &#60;table&#62; &#8212; but not between it, and a &#60;td&#62; element.]]></description>
			<content:encoded><![CDATA[<p>yesterday was a few hours of frustration.</p>
<p>Make sure your your &lt;form&gt; tag is within the same &lt;td&gt; cell element.Â  Otherwise it&#8217;s not XML compliant.</p>
<p>You can have the form outside the &lt;table&gt; &#8212; but not between it, and a &lt;td&gt; element.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lloydleung.com/2007/05/08/ajax-form-submits-problem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Gallery is fixed.</title>
		<link>http://www.lloydleung.com/2007/01/23/gallery-is-fixed/</link>
		<comments>http://www.lloydleung.com/2007/01/23/gallery-is-fixed/#comments</comments>
		<pubDate>Tue, 23 Jan 2007 05:54:17 +0000</pubDate>
		<dc:creator>Lloyd Leung</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.lloydleung.com/2007/01/23/gallery-is-fixed/</guid>
		<description><![CDATA[My old gallery is fixed now&#8230; debating on writing a new gallery, or make a plugin for wordpress to have a gallery. How the plugin would work&#8230; 1.) Create a keyword, to enable the gallery. 2.) grab uploaded files, that are images via mime type, and display them. 3.) display the images via lightbox2, or [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.lloydleung.com/gallery3">My old gallery is fixed now&#8230;</a></p>
<p>debating on writing a new gallery, or make a plugin for wordpress to have a gallery.</p>
<p>How the plugin would work&#8230;<br />
1.) Create a keyword, to enable the gallery.<br />
2.) grab uploaded files, that are images via mime type, and display them.<br />
3.) display the images via lightbox2, or something else that&#8217;d be suitable.<br />
4.) Get titles, and descriptions for files</p>
<p>Pretty handy utility, not much else needed.  All the hard parts are already handled by WP.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lloydleung.com/2007/01/23/gallery-is-fixed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu + Mysql setup</title>
		<link>http://www.lloydleung.com/2007/01/04/ubuntu-mysql-setup/</link>
		<comments>http://www.lloydleung.com/2007/01/04/ubuntu-mysql-setup/#comments</comments>
		<pubDate>Fri, 05 Jan 2007 00:44:31 +0000</pubDate>
		<dc:creator>Lloyd Leung</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.lloydleung.com/2007/01/04/ubuntu-mysql-setup/</guid>
		<description><![CDATA[Wow, that was so painless. Original Post Use your favourite means to install mysql, probably apache, php, phpmysqladmin as well&#8230; sudo /etc/init.d/mysql start mysqladmin -u root password myPassword where myPassword is your actual password. to test mysql -u root -p enjoy]]></description>
			<content:encoded><![CDATA[<p>Wow, that was so painless.</p>
<p><a href="http://ubuntuforums.org/showpost.php?s=3b915fd2adfe3c0b9205ab8eb9417ae6&#038;p=73448&#038;postcount=7">Original Post</a></p>
<p>Use your favourite means to install mysql, probably apache, php, phpmysqladmin as well&#8230;</p>
<p><code><br />
sudo /etc/init.d/mysql start<br />
mysqladmin -u root password myPassword<br />
</code><br />
where myPassword is your actual password.</p>
<p>to test<br />
<code>mysql -u root -p</code></p>
<p>enjoy</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lloydleung.com/2007/01/04/ubuntu-mysql-setup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PEAR::DB_DataObject_FormBuilder howto</title>
		<link>http://www.lloydleung.com/2006/02/18/peardb_dataobject_formbuilder/</link>
		<comments>http://www.lloydleung.com/2006/02/18/peardb_dataobject_formbuilder/#comments</comments>
		<pubDate>Sun, 19 Feb 2006 02:32:02 +0000</pubDate>
		<dc:creator>Lloyd Leung</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.lloydleung.com/?p=110</guid>
		<description><![CDATA[Wow, I refactored my calendar web app and used PEAR::DB_DataObject_FormBuilder to make the backend. One thing I have to admit, the documentation for certain PEAR applications lacks dearly. Just like all OSS packages. It&#8217;s just the nature of things. The personal support I recieved from irc://efnet.org/pear was great. After a little guidance, the members in [...]]]></description>
			<content:encoded><![CDATA[<p>Wow, I refactored my calendar web app and used PEAR::DB_DataObject_FormBuilder to make the backend.</p>
<p>One thing I have to admit, the documentation for certain PEAR applications lacks dearly.  Just like all OSS packages.  It&#8217;s just the nature of things.</p>
<p>The personal support I recieved from irc://efnet.org/pear was great.  After a little guidance, the members in that chat channel were able to help me out.  After my refactoring, I decided to write a basic howto.<span id="more-110"></span></p>
<p>A 3 teir design paradigm:</p>
<ul>
<li>DATA</li>
<li>LOGIC</li>
<li>GUI</li>
</ul>
<p>This is a little howto on how to use the autoschema generator, I posted this to a <a href="http://pear.reversefold.com/dokuwiki/doku.php?id=pear:formbuilder:userdocs">wiki as well</a>.<br />
====Assumptions====<br />
- you have pear, DB_DataObject_FormBuilder, and all dependancies instaled.<br />
- You know how to setup the DSN.  [have link point to DSN setup]<br />
- You have a database setup.</p>
<p>====Getting started====<br />
- config/db_dataobject.ini<br />
<code>[DB_DataObject]<br />
database = mysql://user:password@localhost/dbName<br />
schema_location = E:/HTTPRoot/Calendar/config/<br />
class_location = E:/HTTPRoot/Calendar<br />
extends = DB_DataObject<br />
extends_location = DB/DataObject.php<br />
require_prefix  = DataObjects/<br />
class_prefix = DataObjects_</code></p>
<p>where <code>database = mysql://user:password@localhost/dbName</code><br />
user = username</p>
<p>password = password</p>
<p>localhost = the host/ip of your database</p>
<p>dbName = the name of the database</p>
<p>- run -><br />
<code>php.exe regenerate_dabaobject_info.php</code><br />
or any other method of running</p>
<p><code>php.exe DB/DataObject/createTables.php db_databoject.ini</code><br />
I would recommend have db_dataobject.ini placed somewhere outside of the reach of your webserver deamon.<br />
- &#8230;<br />
- Profit!</p>
<p>====Using Foreign Keys in downdown menus===<br />
pseudo schema<br />
<code>tbl_Categories<br />
categories_id;<br />
title;</code></p>
<p>tbl_Books<br />
books_id;<br />
title;<br />
categories_id;<br />
make a .links.ini file, that accompanies your &#8220;dbName.ini&#8221; that got generated from above.</p>
<p>inside dbName.link.ini file add:<br />
<code><br />
[tbl_Books]<br />
categories_id : tbl_Categories:categories_id;<br />
</code></p>
<p>inside your generated tbl_Books.php file<br />
add the line to your class<br />
<code><br />
var $fb_linkDisplayFields = array('title', 'categories_id');<br />
</code></p>
<p>inside your generated tbl_Categories.php file<br />
add the line to your class<br />
<code><br />
var $fb_linkDisplayFields = array('title');<br />
</code></p>
<p>inside your db_dataobject.ini<br />
add the line<br />
<code><br />
linkDisplayLevel = 2<br />
</code><br />
You have to set linkDisplayLevel greater than 1.  <em>Read the docs for further information</em></p>
<p>Summary:<br />
1.) Setup the DSN<br />
2.) Run the autoschema generator script<br />
3.) Add some minor FK setup<br />
4.) Done. <img src='http://www.lloydleung.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.lloydleung.com/2006/02/18/peardb_dataobject_formbuilder/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Blowfish</title>
		<link>http://www.lloydleung.com/2006/02/01/blowfish-2/</link>
		<comments>http://www.lloydleung.com/2006/02/01/blowfish-2/#comments</comments>
		<pubDate>Thu, 02 Feb 2006 01:12:52 +0000</pubDate>
		<dc:creator>Lloyd Leung</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.lloydleung.com/?p=97</guid>
		<description><![CDATA[Blowfish encryption system, a usage method.]]></description>
			<content:encoded><![CDATA[<p>Do that whole login password setup.  Encrypt everything text&#8230; I&#8217;ll try and figure out a way to encrypt pictures as well, but there&#8217;s really no point in doing that either.  Images will be product images&#8230; I just don&#8217;t want the data will be useful at all.  The page will be all managled anyways.</p>
<p>blowfish&#8230; the saviour.<span id="more-97"></span></p>
<p>Do the whole password login algo I thought of earlier&#8230; I should probably research that better.</p>
<p>So we know the following after we login:</p>
<p>$password<br />
$date [from server, from original login]<br />
hash($password + $date)</p>
<p>we could use the $blowfish->key($password);</p>
<p>$blowfish->decrypt whatever comes in afterwards.</p>
<p>on the server each server page will be:</p>
<p>echo $blowfish->crypt($bodytext);</p>
<p>Now the problem&#8230; how does the $blowfish->key($password) stay persistant on the client side??<br />
Hmm&#8230; I think AJAX will actually be persistant.  That&#8217;s not a bad situation what so ever.  Server traffic intensive, and high overhead.  But whatever.  The trade off isn&#8217;t so bad.</p>
<p>JS on the clientside to decrypt blowfish&#8230;</p>
<p>PHP->sessions will allow for the persistance of decrypt methods.</p>
<p>Problem&#8230; how does one transmit the password in the first place?  Hmmmmm&#8230; that&#8217;s an issue to me.  Like when the account was created.  That&#8217;s gotta be an issue which I gotta figure out.  Cause changing passwords would be an issue as well.</p>
<p>[update]<br />
I GOT IT!!!!!!!!!!!!!!!!</p>
<p>Setup login creation.<br />
Ask for login, email.<br />
email a random password to the client.<br />
Client will then have to set a new password afterwards&#8230; but the random password will be used for the blowfish->key.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lloydleung.com/2006/02/01/blowfish-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>flash dynamic preloader</title>
		<link>http://www.lloydleung.com/2005/09/18/flash-dynamic-preloader/</link>
		<comments>http://www.lloydleung.com/2005/09/18/flash-dynamic-preloader/#comments</comments>
		<pubDate>Sun, 18 Sep 2005 11:26:09 +0000</pubDate>
		<dc:creator>Lloyd Leung</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.lloydleung.com/?p=67</guid>
		<description><![CDATA[Flash has a nice tendency to not load stuff properly. This is because I&#8217;m so used to linear processing, as opposed to parallel taskes to be done at the same time. With this in mind, flash causes start/finish issues. Flash will try to use an object that hasn&#8217;t been completely loaded yet. So checks all [...]]]></description>
			<content:encoded><![CDATA[<p>Flash has a nice tendency to not load stuff properly.  This is because I&#8217;m so used to linear processing, as opposed to parallel taskes to be done at the same time.</p>
<p>With this in mind, flash causes start/finish issues.  Flash will try to use an object that hasn&#8217;t been completely loaded yet.  So checks all these checks have to be put in place.</p>
<p>The alternative to checks, is to preload that objects.  Which, if you know nothing about actionscript is a little daughting.</p>
<p>I&#8217;m in the middle of writing a modular preloader for dynamic content in actionscript 2.  At least the dynamic content&#8217;s size can be calculated.</p>
<p>This really shouldn&#8217;t be that hard, except the fact that I don&#8217;t know the scruture of actionscript.  Perhaps this will be the new thing I&#8217;m going to learn&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lloydleung.com/2005/09/18/flash-dynamic-preloader/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>New pet project, simple group schedular</title>
		<link>http://www.lloydleung.com/2005/08/09/new-pet-project-simple-group-schedular/</link>
		<comments>http://www.lloydleung.com/2005/08/09/new-pet-project-simple-group-schedular/#comments</comments>
		<pubDate>Wed, 10 Aug 2005 04:29:40 +0000</pubDate>
		<dc:creator>Lloyd Leung</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.lloydleung.com/?p=61</guid>
		<description><![CDATA[Simple group scheduler]]></description>
			<content:encoded><![CDATA[<p>- Allow user to login/register.</p>
<p>- Select what days they are free to do this project.</p>
<p>- Colate Dates which are good.<br />
- Different shades from Red to Green, where the more green something is, more people can show.</p>
<p>User: <code>ID / Login / Password / email / IM contact</code></p>
<p>Event: <code>ID / Description /Map / Date Start / Date Finish / Notes</code> (Unique rows)</p>
<p>Event_User: <code>Event.ID / User.ID</code> (Unique rows)</p>
<p>Attendence: <code>User.ID / Attending_bool / Note</code></p>
<p>Populate Calender:<br />
Given: Event.ID<br />
Select * from attendence, Event_User where Event.ID = $EventID</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lloydleung.com/2005/08/09/new-pet-project-simple-group-schedular/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
