<?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>JonLim.ca &#187; Technology</title>
	<atom:link href="http://www.jonlim.ca/category/technology/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jonlim.ca</link>
	<description></description>
	<lastBuildDate>Tue, 31 Jan 2012 02:54:23 +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>Translation of the Letter Rogers Sent Me</title>
		<link>http://www.jonlim.ca/2012/01/translation-of-the-letter-rogers-sent-me/</link>
		<comments>http://www.jonlim.ca/2012/01/translation-of-the-letter-rogers-sent-me/#comments</comments>
		<pubDate>Thu, 26 Jan 2012 00:18:37 +0000</pubDate>
		<dc:creator>Jon Lim</dc:creator>
				<category><![CDATA[Canada]]></category>
		<category><![CDATA[Telecom]]></category>
		<category><![CDATA[Fail]]></category>
		<category><![CDATA[real talk]]></category>
		<category><![CDATA[Rogers]]></category>
		<category><![CDATA[translation]]></category>

		<guid isPermaLink="false">http://www.jonlim.ca/?p=1608</guid>
		<description><![CDATA[Received a letter from Rogers today, announcing yet another price increase for internet and cable TV. They started off with marketing garbage about how awesome they&#8217;ve made my service (but actually mean nothing) and threw this in there: However, over the past year, there has been an increase in the cost of providing you with [...]]]></description>
			<content:encoded><![CDATA[<p>Received a letter from Rogers today, announcing yet another price increase for internet and cable TV. They started off with marketing garbage about how awesome they&#8217;ve made my service (but actually mean nothing) and threw this in there:</p>
<blockquote><p>However, over the past year, there has been an increase in the cost of providing you with our services as we continue to expand and upgrade our network and launch enhancements to serve you better. We have taken steps to minimize the impact that these increased costs will have on you. Remember, if you choose to subscribe to more than one service, you may be eligible for a discount.</p></blockquote>
<p>I&#8217;ve gone ahead and translated it into <strong>Real Talk™</strong>:</p>
<blockquote><p>In the past year, the greed of our executives and shareholders has increased while our services have stagnated. We like to pretend that we&#8217;re doing you a favour by only increasing it by a little bit, but in reality, we don&#8217;t give a damn. However, if you decide to throw more money at us, we&#8217;d be happy to shave off another dollar! We&#8217;ll get it back at the next price increase anyway.</p></blockquote>
<p>Thanks Rogers, for being the corporate parasite of Canada.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonlim.ca/2012/01/translation-of-the-letter-rogers-sent-me/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Don&#8217;t Mess with Gabe</title>
		<link>http://www.jonlim.ca/2011/12/dont-mess-with-gabe/</link>
		<comments>http://www.jonlim.ca/2011/12/dont-mess-with-gabe/#comments</comments>
		<pubDate>Wed, 28 Dec 2011 16:06:01 +0000</pubDate>
		<dc:creator>Jon Lim</dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[Video Games]]></category>
		<category><![CDATA[Gabe]]></category>
		<category><![CDATA[Ocean Marketing]]></category>
		<category><![CDATA[Penny Arcade]]></category>

		<guid isPermaLink="false">http://www.jonlim.ca/?p=1560</guid>
		<description><![CDATA[Image: Penny Arcade &#8211; &#8220;Real Talk&#8221; Gabe from Penny Arcade about Ocean Marketing: ‎I have a real problem with bullies. I spent my childhood moving from school to school and I got made fun of everyplace I landed. I feel like Paul is a bully and maybe that’s why I have no sympathy here. [...] [...]]]></description>
			<content:encoded><![CDATA[<p><img alt="" src="http://art.penny-arcade.com/photos/i-G4Zgvkg/0/L/i-G4Zgvkg-XL.jpg" title="Don&#039;t Mess with Gabe" class="alignnone" width="800" height="401" /></p>
<div class="imagecredit"><em><strong>Image:</strong> <a href="http://penny-arcade.com/resources/real-talk.html" target="_blank">Penny Arcade &#8211; &#8220;Real Talk&#8221;</a></em></div>
<p><a href="http://penny-arcade.com/resources/an-update1.html" target="_blank">Gabe from Penny Arcade</a> about Ocean Marketing:</p>
<blockquote><p>‎I have a real problem with bullies. I spent my childhood moving from school to school and I got made fun of everyplace I landed. I feel like Paul is a bully and maybe that’s why I have no sympathy here. [...] I will personally burn everything I’ve made to the fucking ground if I think I can catch them in the flames.</p></blockquote>
<p>Gabe just became one of my favourite people. More so. Seriously, don&#8217;t mess with Gabe, or any other Gabe for that matter.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonlim.ca/2011/12/dont-mess-with-gabe/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Goofy Pictures and Reddit</title>
		<link>http://www.jonlim.ca/2011/12/goofy-pictures-and-reddit/</link>
		<comments>http://www.jonlim.ca/2011/12/goofy-pictures-and-reddit/#comments</comments>
		<pubDate>Wed, 07 Dec 2011 03:56:27 +0000</pubDate>
		<dc:creator>Jon Lim</dc:creator>
				<category><![CDATA[Social Media]]></category>
		<category><![CDATA[Television]]></category>
		<category><![CDATA[Family Guy]]></category>
		<category><![CDATA[Ollie Williams]]></category>
		<category><![CDATA[The Working Group]]></category>
		<category><![CDATA[weather]]></category>

		<guid isPermaLink="false">http://www.jonlim.ca/?p=1510</guid>
		<description><![CDATA[During lunch today, I stood up at my desk and looked across from me and I said &#8220;Hey Brian, you know what I want to do? Draw Ollie Williams on one of the windows and have him tell us the weather for the day.&#8221; Brian laughed. Brian always laughs at me. But he said I [...]]]></description>
			<content:encoded><![CDATA[<p>During lunch today, I stood up at my desk and looked across from me and I said &#8220;Hey <a href="http://twitter.com/bgilham" target="_blank">Brian</a>, you know what I want to do? Draw <a href="http://www.youtube.com/watch?v=FQ_aaHPK2ow" target="_blank">Ollie Williams</a> on one of the windows and have him tell us the weather for the day.&#8221; Brian laughed.</p>
<p>Brian always laughs at me.</p>
<p>But he said I should do it, and I was on my way. About 10 minutes later, I had a decent drawing of Ollie Williams up on the window, telling us it was cloudy.</p>
<p><img src="http://www.jonlim.ca/wp-content/uploads/2011/12/PNsbl.jpg" alt="" title="Ollie Williams at The Working Group Office" width="800" class="alignnone size-full wp-image-1511" /></p>
<p>Not bad eh?</p>
<p>Well, I went on to <a href="http://www.reddit.com/r/funny/comments/n2r4n/i_gave_my_office_our_very_own_weather_widget/" target="_blank">post it on Reddit</a> thinking a few people might chuckle and potentially giving me an upvote. Boy, was I ever wrong.</p>
<p><img src="http://www.jonlim.ca/wp-content/uploads/2011/12/Ollie.png" alt="" title="Ollie&#039;s Stats on Reddit" width="800" height="100" class="alignnone size-full wp-image-1515" /></p>
<p>The image above starts with the final count of the Reddit post as of this writing, and it climbed as high as 20th on the front page of r/funny (that I observed). The imgur stats are staggering: <strong>9 hours up, 141,110 views, and 57.6GB of bandwidth!</strong></p>
<p>I&#8217;m glad to have you in our office, Ollie, you&#8217;ve certainly made my day a lot more interesting!</p>
<p><strong>UPDATE (12/7/2011):</strong> Final stats are amazing. 729 upvotes on Reddit, 198,146 views and 81.12GB of bandwidth on imgur. Madness!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonlim.ca/2011/12/goofy-pictures-and-reddit/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Secrets of Grindea</title>
		<link>http://www.jonlim.ca/2011/11/secrets-of-grindea/</link>
		<comments>http://www.jonlim.ca/2011/11/secrets-of-grindea/#comments</comments>
		<pubDate>Sun, 13 Nov 2011 18:48:41 +0000</pubDate>
		<dc:creator>Jon Lim</dc:creator>
				<category><![CDATA[Video Games]]></category>
		<category><![CDATA[Action RPG]]></category>
		<category><![CDATA[Pixel Ferrets]]></category>
		<category><![CDATA[RPG]]></category>
		<category><![CDATA[Secrets of Grindea]]></category>

		<guid isPermaLink="false">http://www.jonlim.ca/?p=1442</guid>
		<description><![CDATA[I found this gameplay video of an up-and-coming action RPG called Secrets of Grindea from Pixel Ferrets, showcasing their 4-player co-op. It reminded me of Secret of Mana in terms of art style and gameplay, so I was immediately interested. I can&#8217;t wait to give this a play with my friends.]]></description>
			<content:encoded><![CDATA[<p>I found this gameplay video of an up-and-coming action RPG called <a href="http://www.secretsofgrindea.com/" target="_blank">Secrets of Grindea</a> from <a href="http://twitter.com/pixelferrets" target="_blank">Pixel Ferrets</a>, showcasing their 4-player co-op. It reminded me of Secret of Mana in terms of art style and gameplay, so I was immediately interested.</p>
<p>I can&#8217;t wait to give this a play with my friends.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonlim.ca/2011/11/secrets-of-grindea/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating an Image with Dynamic Text in PHP</title>
		<link>http://www.jonlim.ca/2011/11/creating-an-image-with-dynamic-text-in-php/</link>
		<comments>http://www.jonlim.ca/2011/11/creating-an-image-with-dynamic-text-in-php/#comments</comments>
		<pubDate>Sun, 13 Nov 2011 16:13:59 +0000</pubDate>
		<dc:creator>Jon Lim</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[dynamic image]]></category>
		<category><![CDATA[GD]]></category>
		<category><![CDATA[image function]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.jonlim.ca/?p=1410</guid>
		<description><![CDATA[As Christmas approaches, many of my friends have begun their countdowns to that wonderful holiday at the end of the year. One of my friends started her countdown back in August, when she opened up her calendar and had to count the number of days until Christmas and continuously keep track of what day it [...]]]></description>
			<content:encoded><![CDATA[<p>As Christmas approaches, many of my friends have begun their countdowns to that wonderful holiday at the end of the year.</p>
<p>One of my friends started her countdown back in August, when she opened up her calendar and had to count the number of days until Christmas and continuously keep track of what day it was and where her count was. I told her that I could spend the 5 minutes to help her out using the power of the internets, and that&#8217;s how <a href="http://www.jonlim.ca/christmas/" target="_blank">my Christmas page</a> was born.</p>
<p>Today, I spent a bit more time spicing up the page. It now has a Calvin &#038; Hobbes image that has a bunch of static text, but will update the number of days dynamically.</p>
<p><img src="http://www.jonlim.ca/wp-content/uploads/2011/11/Christmas-is-Coming.png" alt="" title="Christmas is Coming" width="440" height="421" class="alignnone size-full wp-image-1421" /></p>
<p>To preface: I had no idea how to do this, and found out that PHP has a rather sizeable <a href="http://www.php.net/manual/en/ref.image.php" target="_blank">GD and Image Function library</a>. I used this example to start:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
&nbsp;
<span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Content-type: image/png&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$string</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'text'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$im</span>     <span style="color: #339933;">=</span> <span style="color: #990000;">imagecreatefrompng</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;images/button1.png&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$orange</span> <span style="color: #339933;">=</span> <span style="color: #990000;">imagecolorallocate</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$im</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">220</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">210</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">60</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$px</span>     <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">imagesx</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$im</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">-</span> <span style="color:#800080;">7.5</span> <span style="color: #339933;">*</span> <span style="color: #990000;">strlen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$string</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">/</span> <span style="color: #cc66cc;">2</span><span style="color: #339933;">;</span>
<span style="color: #990000;">imagestring</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$im</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">3</span><span style="color: #339933;">,</span> <span style="color: #000088;">$px</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">9</span><span style="color: #339933;">,</span> <span style="color: #000088;">$string</span><span style="color: #339933;">,</span> <span style="color: #000088;">$orange</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">imagepng</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$im</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">imagedestroy</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$im</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>Unfortunately, you can only use some LATIN2 font with <a href="http://www.php.net/manual/en/function.imagestring.php" target="_blank">imagestring()</a>, and did it fit the style of the Calvin &#038; Hobbes comic I was using, but it was a good start.</p>
<p>In order to load your own font and dictate its size, we can use <a href="http://www.php.net/manual/en/function.imagettftext.php" target="_blank">imagettftext()</a>. I had to include the Comic Sans (Don&#8217;t hurt me!) font file in the same folder as the PHP file.</p>
<p>Here is the complete code for my dynamic Christmas image:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #666666; font-style: italic;">// Filename: christmas-image.php</span>
&nbsp;
<span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Content-type: image/png&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$string</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'days'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$im</span>     <span style="color: #339933;">=</span> <span style="color: #990000;">imagecreatefrompng</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;calvin_resolutions.png&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$black</span> <span style="color: #339933;">=</span> <span style="color: #990000;">imagecolorallocate</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$im</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$font</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'comicsans.ttf'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$initialX</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'153'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$initialY</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'35'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$increaseY</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'23'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$fontSize</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'16'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$fontRotation</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'0'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$firstline</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'What do you mean'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$secondline</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'there are '</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$string</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">' days until'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$thirdline</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'Christmas?! What am'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$fourthline</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'I supposed to do until'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$fifthline</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'then? WAIT?! I am'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$sixthline</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'not a patient man!'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//imagestring($im, $font, $px, 20, $string, $black);</span>
<span style="color: #990000;">imagettftext</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$im</span><span style="color: #339933;">,</span> <span style="color: #000088;">$fontSize</span><span style="color: #339933;">,</span> <span style="color: #000088;">$fontRotation</span><span style="color: #339933;">,</span> <span style="color: #000088;">$initialX</span><span style="color: #339933;">,</span> <span style="color: #000088;">$initialY</span><span style="color: #339933;">,</span> <span style="color: #000088;">$black</span><span style="color: #339933;">,</span> <span style="color: #000088;">$font</span><span style="color: #339933;">,</span> <span style="color: #000088;">$firstline</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">imagettftext</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$im</span><span style="color: #339933;">,</span> <span style="color: #000088;">$fontSize</span><span style="color: #339933;">,</span> <span style="color: #000088;">$fontRotation</span><span style="color: #339933;">,</span> <span style="color: #000088;">$initialX</span><span style="color: #339933;">,</span> <span style="color: #000088;">$initialY</span><span style="color: #339933;">+</span><span style="color: #000088;">$increaseY</span><span style="color: #339933;">,</span> <span style="color: #000088;">$black</span><span style="color: #339933;">,</span> <span style="color: #000088;">$font</span><span style="color: #339933;">,</span> <span style="color: #000088;">$secondline</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">imagettftext</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$im</span><span style="color: #339933;">,</span> <span style="color: #000088;">$fontSize</span><span style="color: #339933;">,</span> <span style="color: #000088;">$fontRotation</span><span style="color: #339933;">,</span> <span style="color: #000088;">$initialX</span><span style="color: #339933;">,</span> <span style="color: #000088;">$initialY</span><span style="color: #339933;">+</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$increaseY</span><span style="color: #339933;">*</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$black</span><span style="color: #339933;">,</span> <span style="color: #000088;">$font</span><span style="color: #339933;">,</span> <span style="color: #000088;">$thirdline</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">imagettftext</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$im</span><span style="color: #339933;">,</span> <span style="color: #000088;">$fontSize</span><span style="color: #339933;">,</span> <span style="color: #000088;">$fontRotation</span><span style="color: #339933;">,</span> <span style="color: #000088;">$initialX</span><span style="color: #339933;">,</span> <span style="color: #000088;">$initialY</span><span style="color: #339933;">+</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$increaseY</span><span style="color: #339933;">*</span><span style="color: #cc66cc;">3</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$black</span><span style="color: #339933;">,</span> <span style="color: #000088;">$font</span><span style="color: #339933;">,</span> <span style="color: #000088;">$fourthline</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">imagettftext</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$im</span><span style="color: #339933;">,</span> <span style="color: #000088;">$fontSize</span><span style="color: #339933;">,</span> <span style="color: #000088;">$fontRotation</span><span style="color: #339933;">,</span> <span style="color: #000088;">$initialX</span><span style="color: #339933;">,</span> <span style="color: #000088;">$initialY</span><span style="color: #339933;">+</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$increaseY</span><span style="color: #339933;">*</span><span style="color: #cc66cc;">4</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$black</span><span style="color: #339933;">,</span> <span style="color: #000088;">$font</span><span style="color: #339933;">,</span> <span style="color: #000088;">$fifthline</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">imagettftext</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$im</span><span style="color: #339933;">,</span> <span style="color: #000088;">$fontSize</span><span style="color: #339933;">,</span> <span style="color: #000088;">$fontRotation</span><span style="color: #339933;">,</span> <span style="color: #000088;">$initialX</span><span style="color: #339933;">,</span> <span style="color: #000088;">$initialY</span><span style="color: #339933;">+</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$increaseY</span><span style="color: #339933;">*</span><span style="color: #cc66cc;">5</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$black</span><span style="color: #339933;">,</span> <span style="color: #000088;">$font</span><span style="color: #339933;">,</span> <span style="color: #000088;">$sixthline</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">imagepng</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$im</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">imagedestroy</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$im</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>The positioning of the text is specific to the Calvin &#038; Hobbes image I used, and I made it easier on myself by creating a variable for the X and Y positions as well as the amount I wanted to push the next lines down.</p>
<p>All you have to do now is refer to the PHP file and pass the variables through the URL.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">&lt;img src=&quot;christmas-image.php?days=<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$remainingDays</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;</pre></div></div>

<p>The PHP file will create a PNG that has the updated text. That was pretty simple, no?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonlim.ca/2011/11/creating-an-image-with-dynamic-text-in-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Games I&#8217;m Playing!</title>
		<link>http://www.jonlim.ca/2011/09/games-im-playing/</link>
		<comments>http://www.jonlim.ca/2011/09/games-im-playing/#comments</comments>
		<pubDate>Sat, 24 Sep 2011 17:54:53 +0000</pubDate>
		<dc:creator>Jon Lim</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Video Games]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[Games]]></category>

		<guid isPermaLink="false">http://www.jonlim.ca/?p=1333</guid>
		<description><![CDATA[One of those things that I get asked semi-often: What games are you playing? I don&#8217;t have all that much time for video games, but I do set aside from some time for gaming because it&#8217;s a fantastic outlet for me during really stressful times. That said, check out my new Games I&#8217;m Playing page [...]]]></description>
			<content:encoded><![CDATA[<p>One of those things that I get asked semi-often: What games are you playing?</p>
<p>I don&#8217;t have all that much time for video games, but I do set aside from some time for gaming because it&#8217;s a fantastic outlet for me during really stressful times.</p>
<p>That said, check out my new <a href="http://www.jonlim.ca/games-im-playing/" target="_blank">Games I&#8217;m Playing</a> page to take a look at what I am playing!</p>
<p><img src="http://www.jonlim.ca/wp-content/uploads/2011/09/Screen-shot-2011-09-24-at-1.53.29-PM.png" alt="" title="Games I&#039;m Playing" width="550" height="395" class="alignnone size-full wp-image-1334" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonlim.ca/2011/09/games-im-playing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quit Hijacking My Typos, Rogers.</title>
		<link>http://www.jonlim.ca/2011/09/quit-hijacking-my-typos-rogers/</link>
		<comments>http://www.jonlim.ca/2011/09/quit-hijacking-my-typos-rogers/#comments</comments>
		<pubDate>Fri, 09 Sep 2011 00:59:07 +0000</pubDate>
		<dc:creator>Jon Lim</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Telecom]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[hijacking]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[OpenDNS]]></category>
		<category><![CDATA[Rogers]]></category>
		<category><![CDATA[typos]]></category>

		<guid isPermaLink="false">http://www.jonlim.ca/?p=1304</guid>
		<description><![CDATA[My fingers are fat and stubby, and they can be a little stupid at times. I&#8217;m okay with that. I have learned to love them. However, while surfing at home, my fat fingers occasionally will enter an incorrect or incomplete typo and take me to an error page. It usually looks like this: Upon seeing [...]]]></description>
			<content:encoded><![CDATA[<p>My fingers are fat and stubby, and they can be a little stupid at times. I&#8217;m okay with that. I have learned to love them.</p>
<p>However, while surfing at home, my fat fingers occasionally will enter an incorrect or incomplete typo and take me to an error page. It usually looks like this:</p>
<p><img src="http://www.jonlim.ca/wp-content/uploads/2011/09/Screen-shot-2011-09-08-at-8.47.26-PM1.png" alt="" title="Rogers Hijacks the Internet" width="650" class="alignnone size-full wp-image-1307" /></p>
<p>Upon seeing this page, an electronic signal is sent, via your Rogers connection, to the brain of one of their executives. He wakes up from his slumber (their executives are in perpetual slumber, due to being so encumbered from all the money they pilfer) and emits an audible &#8220;Yippee!&#8221;</p>
<p>Our cute and cuddly little executive then falls back asleep, dreaming of his next pillage and plunder scheme. (&#8220;Hey, let&#8217;s make a bank!&#8221;)</p>
<p>If you don&#8217;t want to disturb that executive&#8217;s peaceful slumber, feel free to jump onto alternative DNS providers such as <a href="https://store.opendns.com/setup/computer/" target="_blank">OpenDNS</a> and <a href="http://code.google.com/speed/public-dns/" target="_blank">Google</a>. (Thanks <a href="http://twitter.com/jasontsang/statuses/111963054140432384" target="_blank">Jason</a>, <a href="http://twitter.com/jkozuch/statuses/111963116677496832" target="_blank">Justin</a>, and <a href="http://twitter.com/mmhd/statuses/111963305840619520" target="_blank">Moeed</a>!)</p>
<p>Happy surfing!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonlim.ca/2011/09/quit-hijacking-my-typos-rogers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rogers Customer Support Hotline: An Exercise in Frustration</title>
		<link>http://www.jonlim.ca/2011/08/rogers-customer-support-hotline-an-exercise-in-frustration/</link>
		<comments>http://www.jonlim.ca/2011/08/rogers-customer-support-hotline-an-exercise-in-frustration/#comments</comments>
		<pubDate>Tue, 30 Aug 2011 01:41:49 +0000</pubDate>
		<dc:creator>Jon Lim</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Telecom]]></category>
		<category><![CDATA[customer support]]></category>
		<category><![CDATA[Fail]]></category>
		<category><![CDATA[Rogers]]></category>

		<guid isPermaLink="false">http://www.jonlim.ca/?p=1301</guid>
		<description><![CDATA[Enough said.]]></description>
			<content:encoded><![CDATA[<p><img src="http://i.imgur.com/FBD1d.png"></p>
<p>Enough said.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonlim.ca/2011/08/rogers-customer-support-hotline-an-exercise-in-frustration/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Google Docs Spreadsheets: Using COUNT with Multiple Conditions</title>
		<link>http://www.jonlim.ca/2011/08/google-docs-spreadsheets-using-count-with-multiple-conditions/</link>
		<comments>http://www.jonlim.ca/2011/08/google-docs-spreadsheets-using-count-with-multiple-conditions/#comments</comments>
		<pubDate>Sat, 27 Aug 2011 21:03:46 +0000</pubDate>
		<dc:creator>Jon Lim</dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Excel]]></category>
		<category><![CDATA[Formula]]></category>
		<category><![CDATA[Google Docs]]></category>
		<category><![CDATA[Spreadsheet]]></category>

		<guid isPermaLink="false">http://www.jonlim.ca/?p=1292</guid>
		<description><![CDATA[This past week, I spent a good amount of time analyzing our current customers with PostageApp and figuring out some of the metrics that we use to determine the health of Postage. Of course, there&#8217;s only one tool for the job: a spreadsheet. Being somewhat familiar with Microsoft Excel, I figured this would be a [...]]]></description>
			<content:encoded><![CDATA[<p>This past week, I spent a good amount of time analyzing our current customers with <a href="http://postageapp.com/" target="_blank">PostageApp</a> and figuring out some of the metrics that we use to determine the health of Postage. Of course, there&#8217;s only one tool for the job: a spreadsheet.</p>
<p>Being somewhat familiar with Microsoft Excel, I figured this would be a piece of cake to do on Google Docs Spreadsheets, considering I won&#8217;t be doing anything ridiculous. I&#8217;d just have to record all of our data and use a bunch of math to figure out some numbers.</p>
<p>Then I hit a snag: I couldn&#8217;t count the number of rows if I had more than one condition.</p>
<p>I was using the <strong>COUNTIF</strong> function to count the number of rows given a specific value inside a column, but it would fail if I tried to do more than one at a time.</p>
<p>I searched for solutions and found <a href="http://www.google.com/search?sourceid=chrome&#038;ie=UTF-8&#038;q=excel+countif+multiple+criteria" target="_blank">quite a few</a>, but many that did not work, especially with Google Docs Spreadsheets. Finally, I stumbled onto a solution: using <strong>COUNT</strong> with <strong>FILTER</strong>!</p>
<h2>What?</h2>
<p>Here&#8217;s an example, multiple column data sheet that has some string information along with numeric information:</p>
<p><img src="http://www.jonlim.ca/wp-content/uploads/2011/08/herpderpsheet.png" alt="" title="Google Document Example" width="401" height="121" class="alignnone size-full wp-image-1293" /></p>
<p>Let&#8217;s say I wanted to get a count of how many rows there were with <em>&#8217;223&#8242;</em> under the <em>&#8216;Derp Column&#8217;</em> and <em>&#8216;Herp&#8217;</em> under the <em>&#8216;Herp Again&#8217;</em> column. (Don&#8217;t ask, I&#8217;ve been on <a href="http://www.reddit.com/r/fffffffuuuuuuuuuuuu/" target="_blank">Reddit</a> far too much.) This is the formula you would use to get that count:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="" style="font-family:monospace;">=COUNT<span class="br0">&#40;</span>FILTER<span class="br0">&#40;</span>B:B ; B:B=<span style="">223</span> ; C:C=&quot;Herp&quot;<span class="br0">&#41;</span><span class="br0">&#41;</span></pre></td></tr></table></div>

<p>The important part here is the <strong>FILTER</strong> function. The first parameter (<em><strong>B:B</strong>)</em>) is the row or column which you are trying to sort through (should be the one you are applying at least one condition on), which in our case is column B (<em>&#8216;Derp Column&#8217;</em>), and any other parameters (as separated by the semi-colon) are conditions which you are applying to filter the row.</p>
<p>The result should be, of course, 1.</p>
<p>You can be pretty flexible when applying conditions. For example, you can also use this to figure out how many rows have a number greater than 100 in <em>&#8216;Derp Column&#8217;</em>:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="" style="font-family:monospace;">=COUNT<span class="br0">&#40;</span>FILTER<span class="br0">&#40;</span>B:B ; B:B&gt;=<span style="">100</span><span class="br0">&#41;</span><span class="br0">&#41;</span></pre></td></tr></table></div>

<p>This is a really neat way to quickly sort and count through data programmatically, and I hope it can be useful to those of you who are using Google Docs Spreadsheets to do calculations like I am!</p>
<p>Cheers.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonlim.ca/2011/08/google-docs-spreadsheets-using-count-with-multiple-conditions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Away for the Weekend</title>
		<link>http://www.jonlim.ca/2011/07/away-for-the-weekend/</link>
		<comments>http://www.jonlim.ca/2011/07/away-for-the-weekend/#comments</comments>
		<pubDate>Fri, 08 Jul 2011 04:32:17 +0000</pubDate>
		<dc:creator>Jon Lim</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Life]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Canon T2i]]></category>
		<category><![CDATA[electronics]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Kindle]]></category>
		<category><![CDATA[weekend getaway]]></category>

		<guid isPermaLink="false">http://www.jonlim.ca/?p=1264</guid>
		<description><![CDATA[Tomorrow morning, my friends and I depart for a weekend getaway to a cottage for the weekend. I am excited and I cannot wait to eat, drink, and be merry with fantastic company. I am trying to minimize the amount of electronics I bring along (since I always seem to bring the entire store) and [...]]]></description>
			<content:encoded><![CDATA[<p>Tomorrow morning, my friends and I depart for a weekend getaway to a cottage for the weekend. I am excited and I cannot wait to eat, drink, and be merry with fantastic company.</p>
<p>I am trying to minimize the amount of electronics I bring along (since I always seem to bring the entire store) and I am only bringing the following:</p>
<ol>
<li><strong>My iPhone:</strong> Not so much for making calls or tweets, but just to be able to stay in contact if necessary and to play all of the music that I have downloaded in preparation.</li>
<li><strong>My Kindle:</strong> I am going to spend a lot of time sitting around and relaxing with a cool drink during the day, and what better way to relax than to read my many books?</li>
<li><strong>My SLR:</strong> I&#8217;m going north to beautiful scenery over a lake with friends. Do I really need to say more?</li>
</ol>
<p>So it&#8217;s still a lot more than most people ever bring along, but I&#8217;m a digital native, sue me.</p>
<p>Have a great weekend, folks!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonlim.ca/2011/07/away-for-the-weekend/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

