<?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>PHail [dot net] Blog - Design, Programming, and other things.</title>
	<atom:link href="http://phail.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://phail.net</link>
	<description>A creative and sometimes technical blog about Design and Programming as well as other things.</description>
	<lastBuildDate>Thu, 10 Feb 2011 02:12:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.5</generator>
		<item>
		<title>Pausing CSS3 Animations with JavaScript</title>
		<link>http://phail.net/2011/02/09/pausing-css3-animations-with-javascript/</link>
		<comments>http://phail.net/2011/02/09/pausing-css3-animations-with-javascript/#comments</comments>
		<pubDate>Thu, 10 Feb 2011 02:11:25 +0000</pubDate>
		<dc:creator>Mike Wojo</dc:creator>
				<category><![CDATA[Codes & Scripts]]></category>
		<category><![CDATA[animation]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[webkit]]></category>

		<guid isPermaLink="false">http://phail.net/?p=71</guid>
		<description><![CDATA[(Please note, that since this is about CSS3 animations, this will only work on browsers that support CSS3. At the moment, the two best are Safari and Google Chrome.) CSS3 animations are fun. They run well, look really nice, and can be hardware accelerated on devices. While they can&#8217;t yet accomplish things totally on par [...]]]></description>
			<content:encoded><![CDATA[<p>(Please note, that since this is about CSS3 animations, <strong>this will only work on browsers that support CSS3</strong>. At the moment, the two best are Safari and Google Chrome.)</p>
<p>CSS3 animations are fun. They run well, look really nice, and can be hardware accelerated on devices. While they can&#8217;t yet accomplish things totally on par with Flash (yet), they are still very functional and worth looking into.</p>
<p>Now before I start, <a href="http://phail.net/demo/move.html" target="_blank"><u>here&#8217;s the working version of the page we&#8217;re workin on in this article</u></a>.</p>
<p>So let&#8217;s say you have a lovely CSS3 animation, like below:</p>
<div class="codecolorer-container css default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="css codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #a1a100;">@-webkit-keyframes MoveRight {</span><br />
&nbsp; <span style="color: #933;">0%</span> <span style="color: #00AA00;">&#123;</span> -webkit-transform<span style="color: #00AA00;">:</span> translateX<span style="color: #00AA00;">&#40;</span><span style="color: #933;">0px</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span><br />
&nbsp; <span style="color: #933;">100%</span> <span style="color: #00AA00;">&#123;</span> -webkit-transform<span style="color: #00AA00;">:</span> translateX<span style="color: #00AA00;">&#40;</span><span style="color: #933;">500px</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span><br />
<span style="color: #00AA00;">&#125;</span><br />
<br />
<span style="color: #6666ff;">.moveRightAnimation</span> <span style="color: #00AA00;">&#123;</span><br />
&nbsp; &nbsp; -webkit-animation-name<span style="color: #00AA00;">:</span> MoveRight<span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; -webkit-animation-<span style="color: #000000; font-weight: bold;">direction</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">normal</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; -webkit-animation-timing-function<span style="color: #00AA00;">:</span> linear<span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; -webkit-animation-iteration-count<span style="color: #00AA00;">:</span> infinite<span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; -webkit-animation-duration<span style="color: #00AA00;">:</span> 5s<span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span><span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span></div></div>
<p>The above CSS code will make whatever you give the class of <strong>.moveLeftAnimation</strong> move to the right, at a constant speed (linear), during a time of 5 seconds. This will repeat forever.</p>
<p>Now, let&#8217;s say you&#8217;re tired of that moving thing, and you want it to stop. Not only do you want it to stop, but you want to stop it on the fly. That&#8217;s where JavaScript comes in.</p>
<p>Let&#8217;s make this nifty JS function:</p>
<div class="codecolorer-container javascript default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #003366; font-weight: bold;">function</span> toggleAnimation<span style="color: #009900;">&#40;</span>what<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">// 'what' is the ID of the element that has the animation class applied to it</span><br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>what <span style="color: #339933;">!=</span> <span style="color: #003366; font-weight: bold;">null</span> <span style="color: #339933;">&amp;&amp;</span> document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span>what<span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> elem <span style="color: #339933;">=</span> document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span>what<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>elem.<span style="color: #660066;">style</span>.<span style="color: #660066;">webkitAnimationPlayState</span> <span style="color: #339933;">==</span> <span style="color: #3366CC;">'paused'</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; elem.<span style="color: #660066;">style</span>.<span style="color: #660066;">webkitAnimationPlayState</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'running'</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">else</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; elem.<span style="color: #660066;">style</span>.<span style="color: #660066;">webkitAnimationPlayState</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'paused'</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
<p>Beautiful! </p>
<p>There&#8217;s only two states to a CSS3 animation: <strong>running</strong>, and <strong>paused</strong>. Easy peasy, right?</p>
<p>For the simple way of integrating it in the page, we can put some inline JavaScript on a link to toggle the animation, like so:</p>
<div class="codecolorer-container html4strict default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #808080; font-style: italic;">&lt;!-- Replace &quot;myAnimatedElementIdHere&quot; with the name of your animated element ;) --&gt;</span><br />
<span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;javascript:toggleAnimation('myAnimatedElementIdHere');&quot;</span>&gt;</span>Toggle Animation<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;</span></div></div>
<p>And there you have it.</p>
<p>Now for the whole thing:</p>
<div class="codecolorer-container html4strict default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt; !DOCTYPE html PUBLIC <span style="color: #ff0000;">&quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot;</span> <span style="color: #ff0000;">&quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;</span>&gt;</span><br />
<span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/html.html"><span style="color: #000000; font-weight: bold;">html</span></a> xmlns<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://www.w3.org/1999/xhtml&quot;</span>&gt;</span><br />
<span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/head.html"><span style="color: #000000; font-weight: bold;">head</span></a>&gt;</span><br />
<span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/meta.html"><span style="color: #000000; font-weight: bold;">meta</span></a> <span style="color: #000066;">http-equiv</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Content-Type&quot;</span> <span style="color: #000066;">content</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/html; charset=utf-8&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span><br />
<span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/title.html"><span style="color: #000000; font-weight: bold;">title</span></a>&gt;</span>I Love CSS<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/title.html"><span style="color: #000000; font-weight: bold;">title</span></a>&gt;</span><br />
<span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/style.html"><span style="color: #000000; font-weight: bold;">style</span></a> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span>&gt;</span><br />
&nbsp; &nbsp; @-webkit-keyframes MoveRight {<br />
&nbsp; &nbsp; &nbsp; 0% { -webkit-transform: translateX(0px); }<br />
&nbsp; &nbsp; &nbsp; 100% { -webkit-transform: translateX(500px); }<br />
&nbsp; &nbsp; }<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; .moveRightAnimation {<br />
&nbsp; &nbsp; &nbsp; &nbsp; -webkit-animation-name: MoveRight;<br />
&nbsp; &nbsp; &nbsp; &nbsp; -webkit-animation-direction: normal;<br />
&nbsp; &nbsp; &nbsp; &nbsp; -webkit-animation-timing-function: linear;<br />
&nbsp; &nbsp; &nbsp; &nbsp; -webkit-animation-iteration-count: infinite;<br />
&nbsp; &nbsp; &nbsp; &nbsp; -webkit-animation-duration: 5s;<br />
&nbsp; &nbsp; &nbsp; &nbsp; position:absolute;<br />
&nbsp; &nbsp; }<br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/style.html"><span style="color: #000000; font-weight: bold;">style</span></a>&gt;</span><br />
<br />
<span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">script</span></a> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;</span><br />
&nbsp; &nbsp; function toggleAnimation(what) { // 'what' is the ID of the element that has the animation class applied to it<br />
&nbsp; &nbsp; &nbsp; &nbsp; if(what != null <span style="color: #ddbb00;">&amp;&amp; document.getElementById(what) != null) {</span><br />
<span style="color: #ddbb00;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var elem = document.getElementById(what);</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(elem.style.webkitAnimationPlayState == 'paused')<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; elem.style.webkitAnimationPlayState = 'running';<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; elem.style.webkitAnimationPlayState = 'paused';<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; }<br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">script</span></a>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/head.html"><span style="color: #000000; font-weight: bold;">head</span></a>&gt;</span><br />
<br />
<span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/body.html"><span style="color: #000000; font-weight: bold;">body</span></a>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;iLikeToMoveIt&quot;</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;moveRightAnimation&quot;</span>&gt;</span>I Like to Move It Move It...<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">p</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;javascript:toggleAnimation('iLikeToMoveIt');&quot;</span>&gt;</span>Toggle Animation<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">p</span></a>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/body.html"><span style="color: #000000; font-weight: bold;">body</span></a>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/html.html"><span style="color: #000000; font-weight: bold;">html</span></a>&gt;</span></div></div>
<p>Hot.</p>
]]></content:encoded>
			<wfw:commentRss>http://phail.net/2011/02/09/pausing-css3-animations-with-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Waiting for Water to Boil</title>
		<link>http://phail.net/2010/11/23/waiting-for-water-to-boil/</link>
		<comments>http://phail.net/2010/11/23/waiting-for-water-to-boil/#comments</comments>
		<pubDate>Tue, 23 Nov 2010 22:54:40 +0000</pubDate>
		<dc:creator>Mike Wojo</dc:creator>
				<category><![CDATA[Ramblings]]></category>

		<guid isPermaLink="false">http://phail.net/?p=66</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone" title="Boil" src="http://i106.photobucket.com/albums/m256/aeronux/boil.jpg" alt="" width="432" height="388" /></p>
]]></content:encoded>
			<wfw:commentRss>http://phail.net/2010/11/23/waiting-for-water-to-boil/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pogo Sketch and the iPad</title>
		<link>http://phail.net/2010/05/21/pogo-sketch-and-the-ipad/</link>
		<comments>http://phail.net/2010/05/21/pogo-sketch-and-the-ipad/#comments</comments>
		<pubDate>Sat, 22 May 2010 04:17:31 +0000</pubDate>
		<dc:creator>Mike Wojo</dc:creator>
				<category><![CDATA[Reviews]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[draw]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[pen]]></category>
		<category><![CDATA[Pogo Sketch]]></category>
		<category><![CDATA[tool]]></category>

		<guid isPermaLink="false">http://phail.net/?p=42</guid>
		<description><![CDATA[Since before I bought my iPad a short time ago, I decided to do a little research to see what was out there in terms of a pen, or stylus that could be used with it. For a big touch screen like that, I thought surely it would function well as a tablet or a [...]]]></description>
			<content:encoded><![CDATA[<p>Since before I bought my iPad a short time ago, I decided to do a little research to see what was out there in terms of a pen, or stylus that could be used with it.</p>
<p>For a big touch screen like that, I thought surely it would function well as a tablet or a note taking tool, and it does. However, there&#8217;s only so much detail you can get using your finger on the iPad.</p>
<p>Thus, I purchased my <strong><a href="http://tenonedesign.com/sketch.php" target="_blank">Pogo Sketch</a></strong>. Am I&#8217;m very happy with it.</p>
<p><a href="http://phail.net/wp-content/uploads/2010/05/pogo1.jpg"><img class="alignnone size-medium wp-image-44" title="Pogo Sketch" src="http://phail.net/wp-content/uploads/2010/05/pogo1-300x225.jpg" alt="" width="300" height="225" /></a></p>
<p><strong>Pros:</strong></p>
<p><strong> </strong></p>
<ul>
<li><span style="font-weight: normal;">Light and solid feeling</span></li>
<li><span style="font-weight: normal;">Nice aluminum design</span></li>
<li><span style="font-weight: normal;">Clips onto pockets, etc.</span></li>
<li><span style="font-weight: normal;">Has a hole on end of clip which could be useful for attaching a string, maybe to put around your neck for quick access to the pen.</span></li>
</ul>
<p><strong>Cons:</strong></p>
<ul>
<li>Wide, non-precise tip.<br />
<em>However, I later found out the reason for this is because of a somewhat large touch area on Apple products is required to prevent accidental input.</em></li>
<li>Pocket clip seems a little flimsy, may break easily.</li>
<li>A little pricey. (About $15)</li>
</ul>
<p>After weighing the pros against the cons I&#8217;ve determined of the product, I hardly think the cons are anything major.</p>
<p>Writing with your finger can start to wear on you, not to mention your finger won&#8217;t always glide on the screen so easily and you&#8217;ll get that annoying &#8220;traction&#8221;. This stylus makes it feel almost as good as the old pen and paper, and even though it doesn&#8217;t seem like the wide tip can be very precise, it&#8217;s actually pretty easy to find the sweet spot.</p>
<p>For what it does, it does it all very nicely. I believe it&#8217;s the perfect companion to the iPad, especially when you want to take notes or draw anything with any bit of efficiency.</p>
<p>You can get your own Pogo Sketch <a href="http://tenonedesign.com/sketch.php">right here</a> from TenOneDesign. (Wow, look! An advertisement!)</p>
<p>Now for some photos. ;D</p>
<div id="attachment_49" class="wp-caption alignnone" style="width: 310px"><a href="http://phail.net/wp-content/uploads/2010/05/Mobile-Photo-May-22-2010-12-02-14-AM.jpg"><img class="size-medium wp-image-49" title="Sketchbook Pro with Pogo Stylus" src="http://phail.net/wp-content/uploads/2010/05/Mobile-Photo-May-22-2010-12-02-14-AM-300x225.jpg" alt="" width="300" height="225" /></a><p class="wp-caption-text">Sketchbook Pro with Pogo Stylus(ignore my terrible art skills)</p></div>
<div id="attachment_50" class="wp-caption alignnone" style="width: 310px"><a href="http://phail.net/wp-content/uploads/2010/05/Mobile-Photo-May-22-2010-12-02-24-AM.jpg"><img class="size-medium wp-image-50" title="Penultimate with Pogo Sketch" src="http://phail.net/wp-content/uploads/2010/05/Mobile-Photo-May-22-2010-12-02-24-AM-300x225.jpg" alt="" width="300" height="225" /></a><p class="wp-caption-text">Penultimate with Pogo Sketch(I&#39;m gonna have to use this at work! I love how I can just email these after writing them.)</p></div>
]]></content:encoded>
			<wfw:commentRss>http://phail.net/2010/05/21/pogo-sketch-and-the-ipad/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iPad: Why I got one and why I Love it.</title>
		<link>http://phail.net/2010/05/04/ipad-why-i-got-one-and-why-i-love-it/</link>
		<comments>http://phail.net/2010/05/04/ipad-why-i-got-one-and-why-i-love-it/#comments</comments>
		<pubDate>Wed, 05 May 2010 00:48:43 +0000</pubDate>
		<dc:creator>Mike Wojo</dc:creator>
				<category><![CDATA[Reviews]]></category>
		<category><![CDATA[iPad]]></category>

		<guid isPermaLink="false">http://phail.net/?p=41</guid>
		<description><![CDATA[I want to begin this post by saying how I first felt about the iPad. When it was first revealed, in all it&#8217;s slim, shiny glory, I was definitely impressed by the design. However, I, like many others, was very underwhelmed by what I thought it could do. I mean, after all, isn&#8217;t it just [...]]]></description>
			<content:encoded><![CDATA[<p>I want to begin this post by saying how I first felt about the iPad. When it was first revealed, in all it&#8217;s slim, shiny glory, I was definitely impressed by the design. However, I, like many others, was very <em>underwhelmed</em> by what I thought it could do.</p>
<p>I mean, after all, isn&#8217;t it just a glorified iPhone?</p>
<p><a href="http://s106.photobucket.com/albums/m256/aeronux/?action=view&#038;current=7f8bde5c.jpg" target="_blank"><img src="http://i106.photobucket.com/albums/m256/aeronux/7f8bde5c.jpg" border="0" width="450" alt="Photobucket Pictures, Images and Photos" /></a></p>
<p>It seemed like it did just what the pocket sized iPhone or iPod touch does. But with a bigger screen. And no camera.</p>
<p>However, as I began to investigate more, I realized- it&#8217;s a very different animal after all.</p>
<p>Where I believe the real potential of the iPad lies is in it&#8217;s apps, and how they utilize the lovely large sized iPad screen. As a web developer, I was instantly impressed when I saw the Gusto app, which is kind of like Coda or Dreamweaver, but slimmed down and put on the iPad for mobile development. After I bought my iPad, I greatly enjoyed bringing my new toy to a coffee shop with a friend and tinkering with my websites. No more lugging my laptop around to do the same simple work on the go.</p>
<p>Of course I have lots of other development apps I can ogle about, like Sketchbook Pro which let&#8217;s me draw out my ideas and zip it over to an artist by email or send to a client for approval or adobe ideas which has similar functionality. But instead I want to also touch on the entertainment factor of the iPad.</p>
<p>I. Love. The ABC and Netflix apps.</p>
<p>There&#8217;s few things I enjoy more than relaxing and watching movies and TV shows, and with these apps I can do that ANYWHERE with an Internet connection. I&#8217;ve already enjoyed watching things while lying in bed and sitting on the couch. Plus, with my Bluetooth headphones, there are no wires to fumble with. I only wish that other networks, like NBC and FOX would jump on the bandwagon.</p>
<p>My final point in my mediocre review is the portability factor of the device. The iPad is one of the few devices I can honestly consider highly portable. The battery life on this thing is crazy. I feel like I rarely need to charge it at all. Even watching movies, I get amazing battery life (10-12 hours on a single charge). This means when I take it somewhere, like a coffee shop, there&#8217;s no need to bring any cables or worry if there&#8217;s an outlet by my table or chair.</p>
<p>The thing also doesn&#8217;t seem to generate much heat at all, if any. I can&#8217;t say I enjoy when my laptop nearly sets my lap on fire, and my iPad stays cool no matter what I&#8217;m doing with it. Plus it&#8217;s very light and seemingly sturdy.</p>
<p>Overall, the iPad is exceeding my expectations and definitely meeting my needs. I can&#8217;t say it will be the same case for everyone, but for what I do everyday, this is the perfect in between machine.</p>
<p>And&#8230; I&#8217;ll probably regret saying this, but I don&#8217;t miss flash on my iPad. </p>
]]></content:encoded>
			<wfw:commentRss>http://phail.net/2010/05/04/ipad-why-i-got-one-and-why-i-love-it/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Soon to be in China!</title>
		<link>http://phail.net/2008/10/12/soon-to-be-in-china/</link>
		<comments>http://phail.net/2008/10/12/soon-to-be-in-china/#comments</comments>
		<pubDate>Sun, 12 Oct 2008 05:12:27 +0000</pubDate>
		<dc:creator>Mike Wojo</dc:creator>
				<category><![CDATA[Ramblings]]></category>
		<category><![CDATA[travel]]></category>

		<guid isPermaLink="false">http://phail.net/2008/10/12/soon-to-be-in-china/</guid>
		<description><![CDATA[Since I&#8217;m leaving on Monday for China, I thought I would try out posting to my blog from my iPod touch! So here it is.]]></description>
			<content:encoded><![CDATA[<p>Since I&#8217;m leaving on Monday for China, I thought I would try out posting to my blog from my iPod touch!  </p>
<p>So here it is.</p>
]]></content:encoded>
			<wfw:commentRss>http://phail.net/2008/10/12/soon-to-be-in-china/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>It&#8217;s Official &#8212; I&#8217;m With MediaTemple!</title>
		<link>http://phail.net/2008/05/08/its-official-im-with-mediatemple/</link>
		<comments>http://phail.net/2008/05/08/its-official-im-with-mediatemple/#comments</comments>
		<pubDate>Fri, 09 May 2008 03:31:52 +0000</pubDate>
		<dc:creator>Mike Wojo</dc:creator>
				<category><![CDATA[Ramblings]]></category>
		<category><![CDATA[host]]></category>
		<category><![CDATA[MediaTemple]]></category>
		<category><![CDATA[new]]></category>

		<guid isPermaLink="false">http://phail.net/?p=25</guid>
		<description><![CDATA[Hurray, I finally purchased my very own Grid-Server with MediaTemple. I had heard very good things, so I decided I should check out what all the buzz was about.     So far, I&#8217;m very happy, it&#8217;s fast, I love the control panel, and the move was relatively easy. Looking forward to some great hosting.]]></description>
			<content:encoded><![CDATA[<p>Hurray, I finally purchased my very own Grid-Server with MediaTemple.  I had heard very good things, so I decided I should check out what all the buzz was about.</p>
<p> </p>
<p><a href="http://www.mediatemple.net/go/order/?refdom=litespark.com" target="_blank"><img class="alignnone size-medium wp-image-26" title="mediatemple" src="http://phail.net/wp-content/uploads/2008/05/mediatemple-300x34.gif" alt="" width="300" height="34" /></a></p>
<p> </p>
<p>So far, I&#8217;m very happy, it&#8217;s fast, I love the control panel, and the move was relatively easy. Looking forward to some great hosting. <img src='http://phail.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://phail.net/2008/05/08/its-official-im-with-mediatemple/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Dang, Nexon is Intense!</title>
		<link>http://phail.net/2008/05/05/dang-nexon-is-intense/</link>
		<comments>http://phail.net/2008/05/05/dang-nexon-is-intense/#comments</comments>
		<pubDate>Tue, 06 May 2008 00:41:04 +0000</pubDate>
		<dc:creator>Mike Wojo</dc:creator>
				<category><![CDATA[Ramblings]]></category>
		<category><![CDATA[2d]]></category>
		<category><![CDATA[convention]]></category>
		<category><![CDATA[games]]></category>
		<category><![CDATA[Maple]]></category>
		<category><![CDATA[MapleStory]]></category>
		<category><![CDATA[mmorpg]]></category>
		<category><![CDATA[Nexon]]></category>
		<category><![CDATA[NX]]></category>
		<category><![CDATA[Story]]></category>

		<guid isPermaLink="false">http://phail.net/2008/05/05/dang-nexon-is-intense/</guid>
		<description><![CDATA[.flickr-photo { border: solid 2px #000000; } .flickr-yourcomment { } .flickr-frame { text-align: left; padding: 3px; } .flickr-caption { font-size: 0.8em; margin-top: 0px; }   07-11-08 Korea 07, originally uploaded by goodalefampics. Wow, ever since the start of their 2D Side-Scrolling MMORPG (Massively Multiplayer Online Role Playing Game) MapleStory, developed by Wizet, I&#8217;ve been interested [...]]]></description>
			<content:encoded><![CDATA[<style type='text/css'>.flickr-photo { border: solid 2px #000000; } .flickr-yourcomment { } .flickr-frame { text-align: left; padding: 3px; } .flickr-caption { font-size: 0.8em; margin-top: 0px; }</style>
<div class="flickr-frame"><a title="photo sharing" href="http://www.flickr.com/photos/12556474@N03/1943633962/"><img class="flickr-photo" src="http://farm3.static.flickr.com/2146/1943633962_f9c46a96f2.jpg" alt="" /></a> </p>
<p><span class="flickr-caption"><a href="http://www.flickr.com/photos/12556474@N03/1943633962/">07-11-08 Korea 07</a>, originally uploaded by <a href="http://www.flickr.com/people/12556474@N03/">goodalefampics</a>.</span></p>
</div>
<p class="flickr-yourcomment">Wow, ever since the start of their 2D Side-Scrolling MMORPG (Massively Multiplayer Online Role Playing Game) <a href="http://maplestory.nexon.net">MapleStory</a>, developed by Wizet, I&#8217;ve been interested in this company from South Korea.  They seem to just continuously pump out great websites, great games, and the obviously top of the line setups for conventions!</p>
<p>They have a North American division, and it started as NX Games and changed later to Nexon America.  Their flagship product was MapleStory, and to my knowledge it is still their biggest and most popular game, at least in America.</p>
<p>Wouldn&#8217;t it be cool to work for this company? <img src='http://phail.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://phail.net/2008/05/05/dang-nexon-is-intense/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>(mostly) Painless Illustration</title>
		<link>http://phail.net/2008/05/05/mostly-painless-illustration/</link>
		<comments>http://phail.net/2008/05/05/mostly-painless-illustration/#comments</comments>
		<pubDate>Mon, 05 May 2008 18:00:08 +0000</pubDate>
		<dc:creator>Mike Wojo</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[adobe]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[art]]></category>
		<category><![CDATA[color]]></category>
		<category><![CDATA[draw]]></category>
		<category><![CDATA[illustration]]></category>
		<category><![CDATA[illustrator]]></category>
		<category><![CDATA[iMac]]></category>
		<category><![CDATA[mostly]]></category>
		<category><![CDATA[painless]]></category>
		<category><![CDATA[pen]]></category>
		<category><![CDATA[scan]]></category>
		<category><![CDATA[tool]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[vector]]></category>

		<guid isPermaLink="false">http://phail.net/?p=16</guid>
		<description><![CDATA[&#8230;using Adobe Illustrator. Lately I&#8217;ve gotten into making simple illustrations for sites (like this one!).  I know that to most, my art isn&#8217;t amazing, but it works and it can be used to make a creative, cleanly designed website. This is kind of a mini-tutorial, and isn&#8217;t terribly detailed, but shows the basics of how I [...]]]></description>
			<content:encoded><![CDATA[<p>&#8230;using <strong>Adobe Illustrator.</strong></p>
<p>Lately I&#8217;ve gotten into making simple illustrations for sites (like this one!).  I know that to most, my art isn&#8217;t <em>amazing</em>, but it works and it can be used to make a creative, cleanly designed website.</p>
<p>This is kind of a <strong>mini-tutorial</strong>, and isn&#8217;t terribly detailed, but shows the basics of how I make my humble art.</p>
<p> <strong>    1. Draw it on paper!</strong></p>
<p>Here&#8217;s a little sample I sketched before:</p>
<p><a href="http://phail.net/wp-content/uploads/2008/05/mr_illus_1.jpg"><img class="alignnone size-medium wp-image-17" title="mr_illus_1" src="http://phail.net/wp-content/uploads/2008/05/mr_illus_1-300x225.jpg" alt="" width="300" height="225" /></a></p>
<p>This is the easiest part for me.  I am not that great of an artist, but it&#8217;s definitely easier to draw something on paper compared to trying to draw with a tablet or mouse.  Whatever you&#8217;re drawing, whether it be a logo or a potato, paper lets you be messy.  <strong>Go ahead, scribble or sketch, it&#8217;ll be refined later!</strong></p>
<p><strong>     2. Scan it or take a picture of it with a digital camera.</strong></p>
<p>(Below is a Canon PowerShot SD1000; Just an example of a nice Digital Camera.)</p>
<p><a href="http://phail.net/wp-content/uploads/2008/05/canon_powershot_sd1000.jpg"><img class="alignnone size-medium wp-image-18" title="canon_powershot_sd1000" src="http://phail.net/wp-content/uploads/2008/05/canon_powershot_sd1000.jpg" alt="" width="177" height="150" /></a></p>
<p> Instead of a digital camera, I use the iSight camera on my Apple iMac.  It&#8217;s conveniant (built in) and simple.  Just hold up the paper and snap a pic.  However, a camera or scanner will do just fine.</p>
<p>     <strong>3. Open up Illustrator and drag your scanned/captured image onto the canvas in a new layer.</strong></p>
<p>A new layer should be used so you can adjust opacity and see what you&#8217;re going to draw over it more clearly.</p>
<p>     <strong>4. <em>Pen Tool!</em></strong></p>
<p>Using the pen tool, trace over the outlines of the things you drew on paper (make sure to keep your pen tool created lines in a new layer over the original drawing!).  Also try to connect/close your pen tool shapes so you can fill them with colors or patterns after you&#8217;re done tracing.</p>
<p>     <strong>5. Color it!</strong></p>
<p>If you&#8217;ve closed/connected the shapes you drew with the pen tool, just fill everything with color you think would look good.  Adjust the order of your shapes in the layer if needed.  Be free and creative! <img src='http://phail.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>     <strong>6.</strong> <strong>Look at your finished product.</strong></p>
<p><a href="http://phail.net/wp-content/uploads/2008/05/mr_illus_sample.png"><img class="alignnone size-medium wp-image-19" title="mr_illus_sample" src="http://phail.net/wp-content/uploads/2008/05/mr_illus_sample-300x140.png" alt="" width="300" height="140" /></a></p>
<p>Does it look good? Is it how you like it?  If not, go back and fix or add some things.  Be creative with it.  Have fun.</p>
<p>And that&#8217;s it.  Yes, I know, this tutorial isn&#8217;t much better than the quality of my art, but I hope to help others learning to do Illustration like me. Good luck!  (By the way, I can probably attach pictures of using the pen tool and Illustrator, so let me know if that would be helpful to do.)</p>
]]></content:encoded>
			<wfw:commentRss>http://phail.net/2008/05/05/mostly-painless-illustration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Class Practice: Creating a Simple Pet Script</title>
		<link>http://phail.net/2008/04/21/php-class-practice-creating-a-simple-pet-script/</link>
		<comments>http://phail.net/2008/04/21/php-class-practice-creating-a-simple-pet-script/#comments</comments>
		<pubDate>Mon, 21 Apr 2008 18:12:13 +0000</pubDate>
		<dc:creator>Mike Wojo</dc:creator>
				<category><![CDATA[Codes & Scripts]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[pet]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://phail.net/?p=14</guid>
		<description><![CDATA[For the vast majority of the time I&#8217;ve been programming I haven&#8217;t used Classes in my code. They are relatively new to me. Because of this, I decided to practice writing classes since I realized how useful they are. Here&#8217;s something I made when I was learning. What We&#8217;re Making Today: We&#8217;re going to be [...]]]></description>
			<content:encoded><![CDATA[<p>For the vast majority of the time I&#8217;ve been programming I haven&#8217;t used Classes in my code. They are relatively new to me. Because of this, I decided to practice writing classes since I realized how useful they are. Here&#8217;s something I made when I was learning.</p>
<p><strong>What We&#8217;re Making Today:</strong><br />
We&#8217;re going to be making a small script comprised of a class, called <strong>Pet</strong>, with variables and functions inside of it to perform actions. Also keep in mind that this is <em>extremely</em> simple and most likely cannot be used for anything outside of practice without heavy modification.</p>
<p><strong>Let&#8217;s Begin, Shall We?</strong></p>
<ol>
<li>Create a new file. Let&#8217;s call it <strong>pet.php</strong>.</li>
<li>Open up the file and prepare for editing! (I use Dreamweaver for most code editing, but you can use plenty of other programs like the built in TextEdit (Mac) and NotePad (Windows).</li>
<li>Always remember to save it as a PHP file! Saving it accidentally as .txt or .rtf will make it not work at all.</li>
</ol>
<p><strong>Now for some code.</strong></p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;">//Some class practice.</span><br />
<span style="color: #000000; font-weight: bold;">class</span> Pet<br />
<span style="color: #009900;">&#123;</span></div></div>
<p>We&#8217;ve now started the file and recognized it&#8217;s a PHP document. Then we initiated the class &#8220;Pet&#8221;.</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">var</span> <span style="color: #000088;">$name</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">var</span> <span style="color: #000088;">$age</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">var</span> <span style="color: #000088;">$fullness</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">50</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">var</span> <span style="color: #000088;">$health</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">70</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000088;">$dead</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span></div></div>
<p>We&#8217;ve now created the variables name, age, fullness, and health for the class to use, and a public variable &#8216;dead&#8217;.</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> SetName<span style="color: #009900;">&#40;</span><span style="color: #000088;">$txt</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#123;</span><br />
<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">name</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$txt</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;p&gt;You have named your pet &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$txt</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;.&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Fullness: &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">fullness</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot; Health: &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">health</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot; Age: &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">age</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
<p>Now we have a <strong>public function</strong> (A function that can be used outside of just inside the class code) called SetName. By calling the function with a string parameter, you assign that string to the class variable $name. It also echoes some text telling you about the pet.</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> GetName<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#123;</span><br />
<span style="color: #b1b100;">return</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">name</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
<p>Since the variables we set earlier in the class (like $name) are <b>not public</b>, we can only access them through the inside code.  So, using this simple function called GetName(), we can retrieve the contents of the $name variable for that object.</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> Feed<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#123;</span><br />
<span style="color: #666666; font-style: italic;">//Increase pet's fullness by a random amount between 5 and 10.</span><br />
<span style="color: #000088;">$fulladd</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/rand"><span style="color: #990000;">rand</span></a><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">5</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">10</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">fullness</span> <span style="color: #339933;">+=</span> <span style="color: #000088;">$fulladd</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;/p&gt;&lt;p&gt;You have fed &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">name</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot; some food. Fullness increased by <span style="color: #006699; font-weight: bold;">$fulladd</span>.&lt;/p&gt;&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
<p>Every pet needs to be fed, right?  Well, since I said this is simple, we are just picking a number between 5 and 10 to add to it&#8217;s Fullness total.</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">function</span> PassTime<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#123;</span><br />
<span style="color: #666666; font-style: italic;">//Simulate some sort of reality I suppose..</span><br />
<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">fullness</span> <span style="color: #339933;">-=</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">fullness</span><span style="color: #339933;">*</span><span style="color:#800080;">.10</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">+</span><span style="color: #cc66cc;">5</span><span style="color: #339933;">;</span><br />
<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">health</span> <span style="color: #339933;">-=</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">health</span><span style="color: #339933;">*</span><span style="color: #009900;">&#40;</span><a href="http://www.php.net/rand"><span style="color: #990000;">rand</span></a><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">10</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">25</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">/</span><span style="color: #cc66cc;">100</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><br />
<span style="color: #666666; font-style: italic;">//Make sure stats are whole numbers</span><br />
<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">fullness</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/ceil"><span style="color: #990000;">ceil</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">fullness</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">health</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/ceil"><span style="color: #990000;">ceil</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">health</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #666666; font-style: italic;">//Increase age by a day? (Not really logical, but oh well.)</span><br />
<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">age</span> <span style="color: #339933;">+=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;p style='color:#999999;'&gt;&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Some time has passed.&lt;br /&gt;&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Fullness: &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">fullness</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot; Health: &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">health</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot; Age: &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">age</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;/p&gt;&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
<p>Alrighty, this is a fun one.  We&#8217;re pretty much giving a little illustion that there&#8217;s time with our little pet.  We&#8217;re decreasing it&#8217;s fullness by 10% plus 5 (so it <i>can</i> die eventually), decreasing it&#8217;s hunger by a random percentage between 10% and 25% plus 2 (same reason as fullness), and using the php function <b>ceil</b> to round the numbers up so they are whole numbers.  We&#8217;re then increasing age by one count (a day perhaps?), making the text color gray, and echo&#8217;ing out what happened to the screen.</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> Killed<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#123;</span><br />
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">fullness</span> <span style="color: #339933;">&lt;</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span> <span style="color: #339933;">||</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">health</span> <span style="color: #339933;">&lt;</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#123;</span><br />
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;p style='color:red;'&gt;Your pet, &lt;b&gt;&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">name</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&lt;/b&gt;, is now in pet heaven.&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">dead</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
<p>This function checks to see if the pet has died due to hunger and health failure.  Once it&#8217;s fullness or health reach 0 or lower, the pet &#8220;goes to a better place&#8221;. <img src='http://phail.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />   Notice that it&#8217;s variable $dead is set true.  This will be used for exiting the loop later on.</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&#125;</span></div></div>
<p>Close up our class and we&#8217;re ready for the main part: The Loop!</p>
<p>We&#8217;re going to be using a loop to simulate a created pet&#8217;s life.  This loop will keep going as long as the pet is alive, and stop when it dies.</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;">//Demonstrate the Pet class!</span><br />
<span style="color: #000088;">$Fluffy</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Pet<span style="color: #339933;">;</span><br />
<span style="color: #000088;">$Fluffy</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">SetName</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Fluffy The Sheep&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></div>
<p>We&#8217;ve created our pet and set his name to &#8220;Fluffy The Sheep&#8221;.</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$Fluffy</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">dead</span> <span style="color: #339933;">==</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#123;</span><br />
<br />
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><a href="http://www.php.net/rand"><span style="color: #990000;">rand</span></a><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</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: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#123;</span><br />
<span style="color: #000088;">$Fluffy</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Feed</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #000088;">$Fluffy</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">PassTime</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #000088;">$Fluffy</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Killed</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Is our poor pet deceased?</span><br />
<span style="color: #009900;">&#125;</span></div></div>
<p>The final part is the loop.  Like I said before, the loop keeps going as long as the pet is alive.  Once it is dead (determined by the Killed() function), it&#8217;s state changes and the loop exits.</p>
<p>And there you have it! Try running the program and see your little pet in action. Feel free to also customize the experience (name it!).  I hope you were able to learn something new out of this. <img src='http://phail.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />   Happy coding!</p>
<p>(By the way, using these settings my pet lived to be around 12-14 age.)</p>
]]></content:encoded>
			<wfw:commentRss>http://phail.net/2008/04/21/php-class-practice-creating-a-simple-pet-script/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>My Little 1337 (leet) Speak Generator</title>
		<link>http://phail.net/2008/04/15/my-little-1337-leet-speak-generator/</link>
		<comments>http://phail.net/2008/04/15/my-little-1337-leet-speak-generator/#comments</comments>
		<pubDate>Tue, 15 Apr 2008 18:24:06 +0000</pubDate>
		<dc:creator>Mike Wojo</dc:creator>
				<category><![CDATA[Codes & Scripts]]></category>
		<category><![CDATA[1337]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[leet]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://phail.net/?p=9</guid>
		<description><![CDATA[For fun in class the other day, I wrote a little &#8220;1337&#8243; speak generator.  It&#8217;s written in PHP, and it consists of just one small script page.  (It has also come to my attention that there are various degrees of 1337, so I would consider my translation to be somewhat advanced.  1337 translation help from [...]]]></description>
			<content:encoded><![CDATA[<p>For fun in class the other day, I wrote a little &#8220;1337&#8243; speak generator.  It&#8217;s written in PHP, and it consists of just one small script page.  (It has also come to my attention that there are various degrees of 1337, so I would consider my translation to be somewhat advanced.  1337 translation help from Wikipedia.)</p>
<p>Try it <a title="1337!!!11" href="http://phail.net/i-s/1337.php" target="_blank">here</a>.</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;">/* Leet (1337) Speak generator! */</span><br />
<span style="color: #666666; font-style: italic;">/* Takes ordinary words and turns them to computer geek gibberish. */</span><br />
<br />
<span style="color: #666666; font-style: italic;">//Lets be able to use all those Post variables easily.</span><br />
<a href="http://www.php.net/extract"><span style="color: #990000;">extract</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #666666; font-style: italic;">//Convert the text?</span><br />
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><a href="http://www.php.net/empty"><span style="color: #990000;">empty</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$to_convert</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$old</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$to_convert</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Keep old text</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$find</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'a'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'b'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'c'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'d'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'e'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'f'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'g'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'h'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'i'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'j'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'k'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'l'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'m'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'n'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'o'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'p'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'q'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'r'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'s'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'t'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'u'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'v'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'w'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'x'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'y'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'z'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$repl</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'4'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'8'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;&amp;copy;&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'[)'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'3'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'|='</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'6'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'#'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'1'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'_|'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'|&lt; '</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'1'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'|v|'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'N'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'0'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'|*'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'Q'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'R'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'5'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'7'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'(_)'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'V'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'VV'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'&gt;&lt; '</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'Y'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'2'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$to_convert</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/str_replace"><span style="color: #990000;">str_replace</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$find</span><span style="color: #339933;">,</span><span style="color: #000088;">$repl</span><span style="color: #339933;">,</span><a href="http://www.php.net/strtolower"><span style="color: #990000;">strtolower</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$to_convert</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;p&gt;&lt;b&gt;&quot;</span><span style="color: #339933;">.</span><a href="http://www.php.net/nl2br"><span style="color: #990000;">nl2br</span></a><span style="color: #009900;">&#40;</span><a href="http://www.php.net/stripslashes"><span style="color: #990000;">stripslashes</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$to_convert</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&lt;/b&gt;&lt;br /&gt;(&quot;</span><span style="color: #339933;">.</span><a href="http://www.php.net/nl2br"><span style="color: #990000;">nl2br</span></a><span style="color: #009900;">&#40;</span><a href="http://www.php.net/stripslashes"><span style="color: #990000;">stripslashes</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$old</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;)&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #666666; font-style: italic;">//No text to convert, must be the Main Page.</span><br />
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;form action='<span style="color: #006699; font-weight: bold;">$PHP_SELF</span>' method='post'&gt;&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Text to be converted:&lt;br /&gt;&lt;textarea id='to_convert' name='to_convert' rows='20' cols='35'&gt;&lt;/textarea&gt;&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;br /&gt;&lt;input type='submit' value='1337 speak!'/&gt;&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;/form&gt;&quot;</span><span style="color: #339933;">;</span></div></div>
]]></content:encoded>
			<wfw:commentRss>http://phail.net/2008/04/15/my-little-1337-leet-speak-generator/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

