<?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>interfacelab &#187; Uncategorized</title>
	<atom:link href="http://interfacelab.com/category/uncategorized/feed/" rel="self" type="application/rss+xml" />
	<link>http://interfacelab.com</link>
	<description></description>
	<lastBuildDate>Wed, 07 Jul 2010 21:29:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Jonathan Stark is for Suckers</title>
		<link>http://interfacelab.com/jonathan-stark-is-for-suckers/</link>
		<comments>http://interfacelab.com/jonathan-stark-is-for-suckers/#comments</comments>
		<pubDate>Wed, 07 Jul 2010 21:28:14 +0000</pubDate>
		<dc:creator>Jon Gilkison</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://interfacelab.com/?p=113</guid>
		<description><![CDATA[Even though it&#8217;s a slightly old post, it just recently resurfaced on Hacker News and I feel it&#8217;s worthy of a rebuttal. Full disclosure: I have no apps on the App Store, though I intend to push my first one in the coming months.  I do however do a lot of iPhone and iPad development, [...]]]></description>
			<content:encoded><![CDATA[<p>Even though it&#8217;s a slightly old <a href="http://jonathanstark.com/blog/2010/03/09/the-app-store-is-for-suckers/" target="_blank">post</a>, it just recently resurfaced on <a href="http://news.ycombinator.com/item?id=1495081">Hacker News</a> and I feel it&#8217;s worthy of a rebuttal.</p>
<p><em>Full disclosure: I have no apps on the App Store, though I intend to push my first one in the coming months.  I do however do a lot of iPhone and iPad development, mostly for internal use by <a title="Trunk Archive" href="http://trunkarchive.com/" target="_blank">my company</a>.</em></p>
<p>In Jonathan&#8217;s &#8220;brilliant&#8221; <a title="The App Store is for Suckers" href="http://jonathanstark.com/blog/2010/03/09/the-app-store-is-for-suckers/" target="_blank">post</a>, he asks his readers if they really want to give up 30% of their profits, learn Objective-C, endure approval delays and navigate code signing just to put their iPhone/iPad apps on Apple&#8217;s App Store.  He further goes on to say that you should instead develop a mobile web application instead, because it&#8217;ll work on all mobile devices and gets you around the bullet points (the 30%, the Objective-C, etc).</p>
<p>Great advice, if it were complete.  What he leaves out is how exactly you&#8217;d monetize that application, which as we all well know, is the conundrum of Web 2.0.</p>
<p><span id="more-113"></span></p>
<h3>Which is the Bigger Crap Shoot?  App Store or Web?</h3>
<p>I would actually contend that the Web is a bigger crap shoot than the App Store.  While there are a variety of ways to monetize the App Store, doing the same with a mobile web application is a far more involved task.  With the App Store, you can charge up front, you can opt for advertising, subscriptions are another path and &#8211; finally &#8211; you can even do micro-transactions within your app.  For web apps, your best option is advertising, and as big as the mobile market is, it&#8217;s still not at a tipping point where relying on advertising is going to keep you flush with green, specifically at web rates versus mobile app rates.  Upfront fee &#8230; I can&#8217;t even think of one web app that does that, though I imagine someone is working on it.  Subscription based?  That&#8217;s a hard sell unless you are doing pornography &#8211; but even that market is sagging (no pun intended).  Micro-transactions are working for Zynga, but nobody else really.</p>
<p>The App Store makes all of this trivial to implement and part of that 30% you pay to Apple is for all that infrastructure to support it.  Let&#8217;s imagine that you&#8217;ve decided to blaze a trail and charge an upfront fee for the use of your mobile web application.  You&#8217;ve decided to use PayPal as your merchant &#8211; right there you are paying 3-4%.  You&#8217;ve also just narrowed your market &#8211; where everyone with an iPhone and an iPad has an App Store account, not everybody has a PayPal account.  Add on top of that the effort to implement the back and forth with PayPal, the time spent with customer service, the maintenance of it all &#8211; don&#8217;t even get me started on the user experience &#8211; and, well, the 30% makes life pretty convenient.  Even more so if you are doing something subscription based.</p>
<h3>LOL</h3>
<p>He further goes on to state that the App Store is an out-dated business model &#8211; yet he has not spent any part of the post recommending another.  I&#8217;m not sure how $1 Billion in revenue is out-dated.  Apparently, that shit works.  When he has generated $1 Billion of revenue for himself, well shit &#8211; I&#8217;ll be the first to sign up for his classes.  Until then, can the hyperbole until you can offer up an attractive alternative.</p>
<p>PS. He&#8217;s an Android developer if that tells you anything.</p>
]]></content:encoded>
			<wfw:commentRss>http://interfacelab.com/jonathan-stark-is-for-suckers/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Is This Really The Future of Magazines or Why Didn&#8217;t They Just Use HTML 5?</title>
		<link>http://interfacelab.com/is-this-really-the-future-of-magazines-or-why-didnt-they-just-use-html-5/</link>
		<comments>http://interfacelab.com/is-this-really-the-future-of-magazines-or-why-didnt-they-just-use-html-5/#comments</comments>
		<pubDate>Thu, 27 May 2010 17:55:27 +0000</pubDate>
		<dc:creator>Jon Gilkison</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://interfacelab.com/?p=95</guid>
		<description><![CDATA[I just downloaded the Wired iPad application, and like most iPad applications (and most magazines for that matter), I found myself bored with it within the first 20 minutes. I&#8217;m sure the content is engaging, I&#8217;m sure the articles are worth reading &#8211; but I am stumped as to why I would chose this over [...]]]></description>
			<content:encoded><![CDATA[<p>I just downloaded the Wired iPad application, and like most iPad applications (and most magazines for that matter), I found myself bored with it within the first 20 minutes.  I&#8217;m sure the content is engaging, I&#8217;m sure the articles are worth reading &#8211; but I am stumped as to why I would chose this over the physical magazine itself, or their website for that matter.  In fact, for reasons I&#8217;ll get into below, I&#8217;m starting to believe that the physical magazine&#8217;s &#8220;interface&#8221; is vastly superior to it&#8217;s iPad cousin.</p>
<p>However, what strikes me most about the Wired app is how amazingly similar it is to a multimedia CD-ROM from the 1990&#8242;s.   This is not a compliment and actually turns out to be a fairly large problem&#8230;</p>
<p><span id="more-95"></span></p>
<h3>1990&#8242;s Here We Come &#8230; Again</h3>
<p>The only real differentiation between the Wired application and a multimedia CD-ROM is the delivery mechanism: you download it via the App Store versus buying a CD-ROM at the now defunct Egg Head store at your local strip mall.  And I really mean that comparison.  For all of the interactivity that was touted in the Flash prototype, what we&#8217;ve really ended up with is a glorified slide show.  Instead of the &#8220;Next&#8221; and &#8220;Previous&#8221; buttons you might have been used to on those old CD-ROMs of yore, you instead swipe left and right to change pages (well *cough* images of pages).</p>
<p>There are certain interactive elements to the articles, but &#8211; and I apologize to all of the people who put in a lot of back breaking work into this &#8211; they&#8217;re pretty lame.  Tapping on a button-looking element switches out part of the page with another image.  You can drag your finger across certain images to make them sort of animate like a flipbook (and in truth, that&#8217;s what it is &#8211;  a series of PNG or JPEG images).  There are videos you can tap on to view fullscreen.  There are audio clips that you can play.  The interactivity in the Wired application is very 1990&#8242;s.  I am not trying to be insulting either, it&#8217;s simply the truth.  The Wired application has pretty much brought back image rollovers.</p>
<p>And that&#8217;s about the extent of the interactivity.  Which makes me wonder if that should be the extent of it or should we be wanting more?  I don&#8217;t have an answer to that, though my gut feeling is that there is a massive opportunity to reinvent the concept of a magazine &#8211; yet we end up with something akin to what the web was like in the mid to late 90&#8242;s.  This basically boils down to a print designer&#8217;s vision of what the web should be like &#8211; but in this case it&#8217;s a print magazine person&#8217;s vision of what an interactive magazine should be like.</p>
<p>If you can think back that far, and you were doing web development during that time, you will glumly remember the frustration of web development driven by print design, where pages were essentially huge images cut and sliced and then reconstituted back into insane table structures for pixel perfect layouts.  That&#8217;s what we&#8217;ve essentially gotten with the Wired app: a giant step backwards and a complete dismissal of the lessons we learned from that dark period of interaction design and development.</p>
<h3>Holy Shit, That&#8217;s Big</h3>
<p>With the Wired app weighing in at a whopping 500 megabytes &#8211; just 100 shy of a full CD-ROM &#8211; how do they intend to maintain new editions of the magazine?  500 MB is too large for a 3G download (no help from AT&amp;T&#8217;s less than spectacular network performance) and for those with iPad&#8217;s with the smaller storage, each issue will take a significant chunk of space on the device.  With no apparent means for managing which issues you keep on your device, this will become huge issue for a lot of people.  Obviously they will fix this with updates to the application, but I&#8217;m still wondering what they were thinking to begin with.  I&#8217;m hoping there were voices of dissent that pointed out the end product was not worth it&#8217;s weight in megabytes.  A PDF version would have been a tenth of the size, though without the interactivity.  But is the interactivity worth the 500MB price?  I personally don&#8217;t think so.</p>
<p>Why is the magazine so large?  Being the intrepid hacker that I am (*wink*) I mounted my jail broken iPad via AppleTalk and quickly tore into the app itself to see how it was constructed.  Similar to the PopSci+ magazine application, each Wired issue is actually a bunch of XML files that lay out a bunch of images.  And by &#8220;a bunch of images&#8221; I mean 4,109 images weighing in at 397MB.</p>
<p>Each full page is a giant image &#8211; there are actually two images for each page: one for landscape and one for portrait mode.  Yes, I&#8217;m laughing on the inside too.  There is no text or HTML, just one gigantic image. The &#8220;interactive&#8221; pieces where you can slide your finger to animate it are just a series of JPG files.  When you press play on the audio file and see the progress meter animate?  A series of PNG files.</p>
<p>Something is wrong with this picture.  Something wrong and something very lazy and/or desperate.</p>
<h3>Over Architect Much? (or How Desperation Ruins Good Ideas)</h3>
<p>I have no inside knowledge on how the Wired app was produced, so the following is all conjecture on my part.  That said, my guess is that Adobe sold Conde Nast on doing the thing in Flash.  Or if Adobe didn&#8217;t do the selling, some Flash loving technologist at Conde Nast sold them on it.  Either way, since Flash CS5 was going to be able to target the iPhone/iPad, they&#8217;d be able to publish the thing as it had been shown to the press.  But then Steve Jobs came along and threw section 3.1.3 into the iPhone licensing terms and &#8230; well &#8230; Adobe and Conde Nast were pretty much fucked.  So fast forward to this moment in time and the best short term solution they could come up with was some jury rigged XML based layout framework and an epic shit ton of images.</p>
<p>The Wired app isn&#8217;t alone in this weird architectural choice either.  The PopSci+ magazine is based on a very similar architecture.  There are also other magazines that work along the same lines, or simply go the route of PDFs with a customized PDF viewer application.</p>
<p>The problem with these XML + images architectures is that they are essentially reinventing HTML with no added benefit.  When I showed the Wired app to a colleague of mine, someone I consider to be one of the top HTML/Javascript developers in NYC, his assessment was the same: Why the heck didn&#8217;t they use HTML5?  We stepped through each &#8220;page&#8221; of the Wired application, looked at each interactive piece &#8211; but failed to find anything that ruled out the use of HTML and JavaScript.</p>
<p>The argument might be that it needs to be cross platform &#8211; the very thing Adobe and Conde Nast were banking on by going with Flash &#8211; but guess what?  For all of the tablets about to fall on the heads of consumers in the coming years, each one of them uses WebKit.  If anything was built for this type of application, it most certainly is WebKit.  And even for harder interactivity puzzles &#8211; in terms of how do we do X and Y &#8211; one can easily hook into WebKit  to enable that stuff that might otherwise be more difficult to do in straight  HTML + CSS + JavaScript.  I have yet to see anything in any magazine application on the iPad that would really require this though.</p>
<p>So why didn&#8217;t they choose HTML5 and build a custom viewer application around WebKit?  It comes down to either a sense of desperation, a sense of Adobe overselling a bad idea or simply a dumb technology decision.  Possibly all three.  It certainly isn&#8217;t a development challenge and it certainly isn&#8217;t because WebKit isn&#8217;t capable.  I had a thought that perhaps memory management was an issue, but by going with HTML5/WebKit, you wouldn&#8217;t be showing pages and pages of huge images &#8211; you&#8217;d actually be able to build those pages the right way.  And doing it this way, in my professional opinion, the magazine itself would be slashed dramatically in size, as well as acting and reacting in ways familiar to people who&#8217;ve been browsing the web for the last 15+ years.  Furthermore, the cost savings from a production standpoint would be drastically lower as Wired already maintains a staff of web developers.   There wouldn&#8217;t be an impetus for Adobe to create some &#8220;solution&#8221; at Conde Nast&#8217;s expense and a lot of the great interactivity you saw in the YouTube videos of their prototype could very easily come to life.</p>
<p>But as it stands now, the Wired iPad app is even far behind their own website.  That&#8217;s embarrassing.  Did anyone at Conde Nast look at this and wonder why someone would choose to use this over their very own website?  That iPad &#8211; unless you are in a subway &#8211; is constantly connected to the intertubehighway. That fact alone makes one wonder what the point of the whole thing is. Specifically since they&#8217;ve not done any sort of interactivity or visual presentation that I think anyone can say is amazing.  Sure, it&#8217;s a print designers wet dream &#8211; but it really should be a consumer&#8217;s wet dream.  And it most certainly is not that.</p>
<p>So, from a technical perspective, I think what we are looking at is the result of equal parts desperation and ignorance.  Desperation on the part of Adobe to carry forward their relationship with Conde Nast in this new publishing market and ignorance on the part of their development team for ignoring the best solution to their &#8220;No Flash Allowed&#8221; problem: HTML5.</p>
<h3>Is This The Future For Magazine Publishing?</h3>
<p>I hope not.</p>
<p>I actually think it&#8217;s a huge step backwards and I think the wrong people are working on the problem &#8211; just like the wrong people were working on the web problem back in the day.   Sure, we corrected course and we&#8217;re seeing the web done correctly more and more these days &#8211; but can the magazine publishing industry afford to get this wrong for any amount of time?  Once could argue that the internet is quickly making their industry irrelevant.  By the time an article is published in Time, I&#8217;ve read six or seven different takes on the same story on the web well before it hits the newsstands.  I don&#8217;t think that&#8217;s a unique or new insight.  But now you want me to download 500MB a month just so some print designer can have pixel perfect layouts with custom fonts?</p>
<p>Unfortunately, as long as Conde Nast allows Adobe to dupe them into believing Adobe has a solution, it&#8217;s going to fail.  They need to go outside the box to get this right, and all the technology to do it is sitting right there in front of them.  And they&#8217;ve been using it very well &#8230; until now when they&#8217;ve chosen not to even use it all.</p>
<h3><span style="color: #ff0000;">Update</span></h3>
<p>People have been mentioning that you can&#8217;t do application specific fonts with the WebKit browser.  Not sure why.</p>
<p>Here is a simple iPad app that loads up a custom open type font, and then displays an html file in a UIWebView with that custom font:  <a href="http://github.com/jawngee/iPadFontExample" target="_blank">http://github.com/jawngee/iPadFontExample</a></p>
<p>So it can be done.  Enjoy.</p>
]]></content:encoded>
			<wfw:commentRss>http://interfacelab.com/is-this-really-the-future-of-magazines-or-why-didnt-they-just-use-html-5/feed/</wfw:commentRss>
		<slash:comments>285</slash:comments>
		</item>
		<item>
		<title>Blippy Clone in 2 Seconds and 3 Lines of PHP</title>
		<link>http://interfacelab.com/blippy-clone-in-2-seconds-and-4-lines-of-php/</link>
		<comments>http://interfacelab.com/blippy-clone-in-2-seconds-and-4-lines-of-php/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 23:45:08 +0000</pubDate>
		<dc:creator>Jon Gilkison</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://interfacelab.com/?p=87</guid>
		<description><![CDATA[Since LoC wanking seems to be the rage this week, I decided to take a stab at cloning the hottest new thing to hit the internets since twitter: Blippy! Yes, believe it! You can now twitter your soul crushing acts of consumerism to your uninterested friends so that they too can be involved in the [...]]]></description>
			<content:encoded><![CDATA[<p>Since LoC wanking seems to be the rage this week, I decided to take a stab at cloning the hottest new thing to hit the internets since twitter: <a href="http://blippy.com/">Blippy!</a></p>
<p>Yes, believe it!  You can now twitter your soul crushing acts of consumerism to your uninterested friends so that they too can be involved in the banal minutiae of your life!  The IRS is going to love this one.</p>
<pre class="brush: php;">
&lt;?
// what a stupid f'ing idea
?&gt;
</pre>
<p>And there you have it.  All the functionality in way less code.</p>

<span class="slashdigglicious">
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Finterfacelab.com%2Fblippy-clone-in-2-seconds-and-4-lines-of-php%2F&amp;title=Blippy+Clone+in+2+Seconds+and+3+Lines+of+PHP" title="Slashdot It!"><img src="http://slashdot.org/favicon.ico" height="16" width="16" alt="[Slashdot]" /></a>
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Finterfacelab.com%2Fblippy-clone-in-2-seconds-and-4-lines-of-php%2F&amp;title=Blippy+Clone+in+2+Seconds+and+3+Lines+of+PHP" title="Digg This Story"><img src="http://digg.com/favicon.ico" width="16" height="16" alt="[Digg]" /></a>
<a href="http://reddit.com/submit?url=http%3A%2F%2Finterfacelab.com%2Fblippy-clone-in-2-seconds-and-4-lines-of-php%2F&amp;title=Blippy+Clone+in+2+Seconds+and+3+Lines+of+PHP" title="Reddit"><img src="http://reddit.com/favicon.ico" width="16" height="16" alt="[Reddit]" /></a>
<a href="http://del.icio.us/post?url=http%3A%2F%2Finterfacelab.com%2Fblippy-clone-in-2-seconds-and-4-lines-of-php%2F&amp;title=Blippy+Clone+in+2+Seconds+and+3+Lines+of+PHP" title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Finterfacelab.com%2Fblippy-clone-in-2-seconds-and-4-lines-of-php%2F&amp;title=Blippy+Clone+in+2+Seconds+and+3+Lines+of+PHP', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img src="http://del.icio.us/favicon.ico" width="16" height="16" alt="[del.icio.us]" /></a>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Finterfacelab.com%2Fblippy-clone-in-2-seconds-and-4-lines-of-php%2F" title="Share on Facebook"><img src="http://www.facebook.com/favicon.ico" width="16" height="16" alt="[Facebook]" /></a>
<a href="http://technorati.com/faves?add=http%3A%2F%2Finterfacelab.com%2Fblippy-clone-in-2-seconds-and-4-lines-of-php%2F" title="Add to my Technorati Favorites"><img src="http://technorati.com/favicon.ico" width="16" height="16" alt="[Technorati]" /></a>
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Finterfacelab.com%2Fblippy-clone-in-2-seconds-and-4-lines-of-php%2F&amp;title=Blippy+Clone+in+2+Seconds+and+3+Lines+of+PHP" title="Save to Google Bookmarks"><img src="http://www.google.com/favicon.ico" width="16" height="16" alt="[Google]" /></a>
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Finterfacelab.com%2Fblippy-clone-in-2-seconds-and-4-lines-of-php%2F&amp;title=Blippy+Clone+in+2+Seconds+and+3+Lines+of+PHP" title="Stumble it!"><img src="http://www.stumbleupon.com/favicon.ico" width="16" height="16" alt="[StumbleUpon]" /></a>
</span>]]></content:encoded>
			<wfw:commentRss>http://interfacelab.com/blippy-clone-in-2-seconds-and-4-lines-of-php/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>My Mom is Going to Love the iPad</title>
		<link>http://interfacelab.com/my-mom-is-going-to-love-the-ipad/</link>
		<comments>http://interfacelab.com/my-mom-is-going-to-love-the-ipad/#comments</comments>
		<pubDate>Fri, 29 Jan 2010 08:24:18 +0000</pubDate>
		<dc:creator>Jon Gilkison</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://interfacelab.com/?p=83</guid>
		<description><![CDATA[My mom is totally going to love the shit out of this thing.  Off the top of my head: She can read her books in the dark. She can use it in the kitchen to look up recipes and watch cooking videos. She can use the GPS to help my dad drive their RV around [...]]]></description>
			<content:encoded><![CDATA[<p>My mom is totally going to love the shit out of this thing.  Off the top of my head:</p>
<ul>
<li>She can read her books in the dark.</li>
<li>She can use it in the kitchen to look up recipes and watch cooking videos.</li>
<li>She can use the GPS to help my dad drive their RV around the country.</li>
<li>She can be better connected to her iPhone wielding grandchildren.</li>
<li>She can play Words with Friends on a bigger screen.</li>
<li>She can  browse the web on a readable screen.  While in the RV.</li>
<li>Watch all of her NFL games while sitting on the porch.</li>
</ul>
<p>And that&#8217;s just to start.  Later down the road, maybe after revision 2, she&#8217;ll also be able to:</p>
<ul>
<li>Draw her knitting patterns and sync it with her knitting machine via Bonjour over WiFi.</li>
<li>Have video chats with the kids.</li>
<li>Augmented reality tour guides for the new places they travel to.</li>
<li>Telemedical (god forbid) monitoring to save trips to the doctor.</li>
<li>Control surface for manipulating certain controls of the RV.</li>
</ul>
<p>The best part?  I won&#8217;t have to show her how to do those things, not most of them anyway.  So to do 80% of what she uses her laptop for, she can do all of those things without having to lug the thing out, plug it in, hook up the mouse, etc.  She&#8217;ll be able to take the information she is looking for to the place where she needs it to be: the kitchen, the sewing room, the co-pilot&#8217;s seat.</p>
<p>So thinking about my mother using it, and loving it, I started to think how I would use it.  My list is almost equally as long.</p>
<ul>
<li>Control Boxee.</li>
<li>Use it as a control surface for Final Cut or Ableton Live or Traktor via Bluetooth or WiFi.</li>
<li>Home automation.</li>
<li>The ultimate universal remote (extra hardware required)</li>
<li>Pornography</li>
<li>Better in-flight DVD viewing experience</li>
</ul>
<p>There are so many more integration points the iPad can make with day to day living and day to day information needs.  The key aspect of it all is mobility and portability, having the information you need not only when you need it, but <strong>where </strong>you need it.</p>
<p>I understand the let down from the perspective of people who were wishing for a multi-touch Mac Book.  But I think they are thinking about it wrong.  People are thinking about it as if it&#8217;s a computer, but it isn&#8217;t just a computer, it&#8217;s a whole new category of device, a whole new definition of what a computer is.</p>
<p>I also agree with most that the lock down to the App Store is a let down, though you don&#8217;t have to think too hard about it to understand it&#8217;s a necessary evil.  It reduces any potential confusion on how to make the thing do something new.  My Mom and I were playing Words with Friends without me having to walk her through how to install it and get it running.  Now compare that with what it was like to show her how to do something similar on her Windows laptop &#8230; yeah no thanks, I&#8217;ll take the App Store.  Not to mention not having to run that crappy antivirus and anti-spyware junk &#8211; the stuff that sucks the performance out of her laptop and yields endless complaints about how slow everything is.  Perhaps it&#8217;s a false sense of security, but I can live with that.</p>
<p>Some of the complaints about usability and related things are complete nonsense and even defy logic.  I&#8217;m pretty sure Apple did some usability testing on this thing &#8230; but maybe that&#8217;s just wild speculation on my part.</p>
<p>I think Apple is definitely onto something, maybe it&#8217;s not quite there yet, but they&#8217;ve definitely accomplished more than bringing an oversized iPhone to market.  But only time will tell.</p>
<p>And, yes, she does kick my ass in Words with Friends.  She hit me with two 70+ pointers yesterday.</p>

<span class="slashdigglicious">
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Finterfacelab.com%2Fmy-mom-is-going-to-love-the-ipad%2F&amp;title=My+Mom+is+Going+to+Love+the+iPad" title="Slashdot It!"><img src="http://slashdot.org/favicon.ico" height="16" width="16" alt="[Slashdot]" /></a>
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Finterfacelab.com%2Fmy-mom-is-going-to-love-the-ipad%2F&amp;title=My+Mom+is+Going+to+Love+the+iPad" title="Digg This Story"><img src="http://digg.com/favicon.ico" width="16" height="16" alt="[Digg]" /></a>
<a href="http://reddit.com/submit?url=http%3A%2F%2Finterfacelab.com%2Fmy-mom-is-going-to-love-the-ipad%2F&amp;title=My+Mom+is+Going+to+Love+the+iPad" title="Reddit"><img src="http://reddit.com/favicon.ico" width="16" height="16" alt="[Reddit]" /></a>
<a href="http://del.icio.us/post?url=http%3A%2F%2Finterfacelab.com%2Fmy-mom-is-going-to-love-the-ipad%2F&amp;title=My+Mom+is+Going+to+Love+the+iPad" title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Finterfacelab.com%2Fmy-mom-is-going-to-love-the-ipad%2F&amp;title=My+Mom+is+Going+to+Love+the+iPad', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img src="http://del.icio.us/favicon.ico" width="16" height="16" alt="[del.icio.us]" /></a>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Finterfacelab.com%2Fmy-mom-is-going-to-love-the-ipad%2F" title="Share on Facebook"><img src="http://www.facebook.com/favicon.ico" width="16" height="16" alt="[Facebook]" /></a>
<a href="http://technorati.com/faves?add=http%3A%2F%2Finterfacelab.com%2Fmy-mom-is-going-to-love-the-ipad%2F" title="Add to my Technorati Favorites"><img src="http://technorati.com/favicon.ico" width="16" height="16" alt="[Technorati]" /></a>
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Finterfacelab.com%2Fmy-mom-is-going-to-love-the-ipad%2F&amp;title=My+Mom+is+Going+to+Love+the+iPad" title="Save to Google Bookmarks"><img src="http://www.google.com/favicon.ico" width="16" height="16" alt="[Google]" /></a>
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Finterfacelab.com%2Fmy-mom-is-going-to-love-the-ipad%2F&amp;title=My+Mom+is+Going+to+Love+the+iPad" title="Stumble it!"><img src="http://www.stumbleupon.com/favicon.ico" width="16" height="16" alt="[StumbleUpon]" /></a>
</span>]]></content:encoded>
			<wfw:commentRss>http://interfacelab.com/my-mom-is-going-to-love-the-ipad/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Slicehost API Notes for the Non-Rails Posse</title>
		<link>http://interfacelab.com/slicehost-api-notes-for-the-non-rails-posse/</link>
		<comments>http://interfacelab.com/slicehost-api-notes-for-the-non-rails-posse/#comments</comments>
		<pubDate>Sat, 09 May 2009 06:38:23 +0000</pubDate>
		<dc:creator>Jon Gilkison</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://interfacelab.com/?p=66</guid>
		<description><![CDATA[I just want to start out by stating that I, in fact, am a big fan of Slicehost and constantly recommend them to friends setting up anything more serious than blogs. They have a truly great offering and their customer service has only been rivaled, in my experience, by the support team from DataPipe &#8211; [...]]]></description>
			<content:encoded><![CDATA[<p>I just want to start out by stating that I, in fact, am a big fan of <a href="http://slicehost.com" target="_blank">Slicehost</a> and constantly recommend them to friends setting up anything more serious than blogs.  They have a truly great offering and their customer service has only been rivaled, in my experience, by the support team from <a href="http://datapipe.net">DataPipe</a> &#8211; whom I whole heartedly recommend for any colo or managed hosting.</p>
<p>One thing that is truly great about Slicehost is that they offer an awesome API that allows you to do most everything you can do in their management console, but instead through web services.  You can create new slices, reboot them, change and add DNS, as well as rebuild or destroy slices.</p>
<p>The only problem is that the API follows a “standard ActiveResource pattern” that comes straight from the bowels of Rails and is way too convoluted for something this simple.  </p>
<p><span id="more-66"></span></p>
<p>My biggest complaint is that instead of POSTing standard post variables, you POST XML, but none of the data being posted approaches any kind of structural complexity that warrants it’s usage.  It just a layer of crap that doesn’t need to be there.  Every modern language has some sort of HTTP request mechanism that handles all this stuff without some arbitrary object model forced on top of it.</p>
<p>Curiously, there appears to be another way where you can POST regular form data, but the variable names are in the form “resource[field]” which, again, seems completely unnecessary.  I also couldn’t get it to work reliably.</p>
<p>As a point of reference, I was able to implement S3, EC2 and SQS API’s from amazon in just under 6 hours.  It took me two days to figure out the Slicehost API.  The ActiveResource pattern is a failure in my estimation.</p>
<p>The following are my notes on implementing the slicehost API.  Hope you find it useful.</p>
<p>NOTE:  This post doesn’t cover their DNS API as I don’t have a particular need for it.  I will be posting the PHP library I wrote for the Slicehost API to github over the weekend.  Perhaps someone can build on top of that&#8230;</p>
<h3>Authentication</h3>
<p>I actually had a bit of a bitch with this.  The docs and ruby samples specify that you put your API key in the url, like this:</p>
<p><a href="https://APIKEY@api.slicehost.com">https://APIKEY@api.slicehost.com</a></p>
<p>Problem is that I just could not get it to work.  Even the ruby samples in their docs didn’t run without authentication errors.  Copying and pasting the URLs into Safari didn’t work either (simply pasting your API key into the user input when the Basic Authentication popup shows does work though).</p>
<p>So, make sure you always set the USER part of Basic Auth with your API key.  In PHP it looks like this (using PEAR’s HTTP_Request object):</p>
<pre class="precode">$request-&gt;basic_auth(YOUR_API_KEY,’’);</pre>
<p>&nbsp;</p>
<h2>Dealing With Slices</h2>
<p>This is the part that drove me nuts.  I ended up having to debug their ruby examples through Charles, after patching activeresource.rb to support proxies.  And even then, their examples didn’t work due to a typo and another error I couldn’t sort out.</p>
<h3>Listing Slices</h3>
<p>This is easy as pie.  Simply make a GET request to:</p>
<p><a href="https://api.slicehost.com/slices">https://api.slicehost.com/slices.xml</a></p>
<p>You will get back an XML document as a response:</p>
<pre class="precode">
&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;slices type="array"&gt;
	&lt;slice&gt;
		&lt;name&gt;slicename&lt;/name&gt;
		&lt;status&gt;active&lt;/status&gt;
		&lt;addresses type="array"&gt;
			&lt;address&gt;XXX.XXX.XXX.XXX&lt;/address&gt;
			&lt;address&gt;XXX.XXX.XXX.XXX&lt;/address&gt;
		&lt;/addresses&gt;
		&lt;id type="integer"&gt;666&lt;/id&gt;
		&lt;progress type="integer"&gt;100&lt;/progress&gt;
		&lt;bw-out type="float"&gt;0.0&lt;/bw-out&gt;
		&lt;bw-in type="float"&gt;0.0&lt;/bw-in&gt;
		&lt;image-id type="integer"&gt;10&lt;/image-id&gt;
		&lt;ip-address&gt;XXX.XXX.XXX.XXX&lt;/ip-address&gt;
		&lt;flavor-id type="integer"&gt;2&lt;/flavor-id&gt;
	&lt;/slice&gt;
&lt;/slices&gt;
</pre>
<p>The one issue I have with this is that the &lt;address&gt; element doesn’t specify if the address is internal or external.  Right now, you can only make the assumption that the first address is external and the second one is internal.  Not a big deal though.</p>
<p>Also, note the .xml extension.  I believe this is arbitrary, but it would be dope if you could specify .json or .yaml or some other format.  Again, not a big deal.</p>
<h3>Getting Slice Info</h3>
<p>This is equally as simple:</p>
<p><a href="https://api.slicehost.com/slices/666.xml">https://api.slicehost.com/slices/666.xml</a></p>
<p>Where 666 is the ID of the slice you want to get info about.  You get another XML document in return containing a &lt;slice&gt; element as above.</p>
<h3>Creating a Slice From an Image</h3>
<p>This is relatively simple, but there are a couple of steps to it.</p>
<p>First you need a list of the images that Slicehost offers.  Easy enough.  GET request to :</p>
<p><a href="https://api.slicehost.com/images">https://api.slicehost.com/images</a></p>
<p>Will return an XML document that looks like this:</p>
<pre class="precode">
&lt;images type="array"&gt;
	&lt;image&gt;
		&lt;name&gt;CentOS 5.2&lt;/name&gt;
		&lt;id type="integer"&gt;2&lt;/id&gt;
	&lt;/image&gt;
	&lt;image&gt;
		&lt;name&gt;Gentoo 2008.0&lt;/name&gt;
		&lt;id type="integer"&gt;3&lt;/id&gt;
	&lt;/image&gt;
	&lt;image&gt;
		&lt;name&gt;Debian 5.0 (lenny)&lt;/name&gt;
		&lt;id type="integer"&gt;4&lt;/id&gt;
	&lt;/image&gt;
	{ .. and so on .. }
&lt;/images&gt;
</pre>
<p>Once you have this list, you’ll have need to figure out what flavors of slices you can create.  Do this by sending another GET request to:</p>
<p><a href="https://api.slicehost.com/flavors">https://api.slicehost.com/flavors</a></p>
<p>Again, you’ll get another list that looks like this:</p>
<pre class="precode">
&lt;flavors type="array"&gt;
	&lt;flavor&gt;
		&lt;id type="integer"&gt;1&lt;/id&gt;
		&lt;name&gt;256 slice&lt;/name&gt;
		&lt;price type="integer"&gt;2000&lt;/price&gt;
		&lt;ram type="integer"&gt;256&lt;/ram&gt;
	&lt;/flavor&gt;
	&lt;flavor&gt;
		&lt;id type="integer"&gt;2&lt;/id&gt;
		&lt;name&gt;512 slice&lt;/name&gt;
		&lt;price type="integer"&gt;3800&lt;/price&gt;
		&lt;ram type="integer"&gt;512&lt;/ram&gt;
	&lt;/flavor&gt;
	&lt;flavor&gt;
		&lt;id type="integer"&gt;3&lt;/id&gt;
		&lt;name&gt;1GB slice&lt;/name&gt;
		&lt;price type="integer"&gt;7000&lt;/price&gt;
		&lt;ram type="integer"&gt;1024&lt;/ram&gt;
	&lt;/flavor&gt;
	{ ... and so on ... }
&lt;/flavors&gt;
</pre>
<p>So now we know the ID for the image and the ID for flavor of slice.  Let’s keep going!</p>
<p>This next bit took me awhile to get going.  When I tried to go through the method of posting good old post data, I would get back really obscure errors.  So debugging the HTTP traffic of the ruby examples, I unearthed the secret sauce.</p>
<p>To create the slice with the image of your choosing, POST an XML document to:</p>
<p><a href="https://api.slicehost.com/slices/">https://api.slicehost.com/slices/</a></p>
<p>But, make absolutely sure that you have set the “Content-Type” of your request to “text/xml” otherwise it no worky.  Your XML document will look like:</p>
<pre class="precode">
&lt;slice&gt;
	&lt;name&gt;NAME OF YOUR SLICE&lt;/name&gt;
	&lt;flavor-id type="integer"&gt;1&lt;/flavor-id&gt;
	&lt;image-id type="integer"&gt;2&lt;/image-id&gt;
&lt;/slice&gt;
</pre>
<p>The &lt;image-id&gt; must be a valid ID from the list above, of course.    Their API docs have a typo where the sample code to create a slice uses an ID of 1, which doesn’t exist.  A little hair pulling on that one, even though the bug was so obvious.  The same thing goes for the &lt;flavor-id&gt;.</p>
<p>The response you receive will be information about you slice, including the root password.  You only get this root password once, so make sure you take note of it.  The response looks like:</p>
<pre class="precode">
&lt;slice&gt;
	&lt;status&gt;build&lt;/status&gt;
	&lt;name&gt;SLICE NAME&lt;/name&gt;
	&lt;addresses type="array"&gt;
		&lt;address&gt;XXX.XXX.XXX.XXX&lt;/address&gt;
		&lt;address&gt;XXX.XXX.XXX.XXX&lt;/address&gt;
	&lt;/addresses&gt;
	&lt;id type="integer"&gt;666&lt;/id&gt;
	&lt;root-password&gt;ROOT PASSWORD&lt;/root-password&gt;
	&lt;progress type="integer"&gt;0&lt;/progress&gt;
	&lt;bw-out type="float"&gt;0.0&lt;/bw-out&gt;
	&lt;bw-in type="float"&gt;0.0&lt;/bw-in&gt;
	&lt;image-id type="integer"&gt;2&lt;/image-id&gt;
	&lt;ip-address&gt;XXX.XXX.XXX.XXX&lt;/ip-address&gt;
	&lt;flavor-id type="integer"&gt;1&lt;/flavor-id&gt;
&lt;/slice&gt;
</pre>
<p>And that’s it, you’ve created your slice!</p>
<h3>Creating a Slice From a Backup</h3>
<p>This is nearly the same as creating from an image, but this time we’ll need a list of available backups.  Backups are things you create through the Slicehost management interface.  What I like to do is build a base system and then take a snapshot.  With that snapshot I can create new slices based on it.</p>
<p>To grab a list of backups, send a GET request to:</p>
<p><a href="https://api.slicehost.com/backups">https://api.slicehost.com/backups</a></p>
<p>You will receive a list (if you have any backups):</p>
<pre class="precode">
&lt;backups type="array"&gt;
	&lt;backup&gt;
		&lt;id&gt;3-666&lt;/id&gt;
		&lt;slice_id&gt;666&lt;/slice_id&gt;
		&lt;name&gt;daily&lt;/name&gt;
		&lt;date&gt;Sat May 09 04:15:05 UTC 2009&lt;/date&gt;
	&lt;/backup&gt;
	&lt;backup&gt;
		&lt;id&gt;3-667&lt;/id&gt;
		&lt;slice_id&gt;666&lt;/slice_id&gt;
		&lt;name&gt;webserver_snapshot&lt;/name&gt;
		&lt;date&gt;Sat May 09 04:15:05 UTC 2009&lt;/date&gt;
	&lt;/backup&gt;
&lt;/backups&gt;
</pre>
<p>And, then, in the XML document you POST:</p>
<pre class="precode">
&lt;slice&gt;
	&lt;name&gt;NAME OF YOUR SLICE&lt;/name&gt;
	&lt;flavor-id type="integer"&gt;1&lt;/flavor-id&gt;
	&lt;backup-id type="integer"&gt;3-666&lt;/backup-id&gt;
&lt;/slice&gt;
</pre>
<p>Everything else is the same as creating a slice from an image.</p>
<h3>Updating a Slice</h3>
<p>The only thing you can update with your slice is it’s name.  This is accomplished by PUTing an XML document to:</p>
<p><a href="https://api.slicehost.com/slices">https://api.slicehost.com/slices</a></p>
<p>The XML doc looks like:</p>
<pre class="precode">
&lt;slice&gt;
	&lt;id type="integer"&gt;666&lt;/id&gt;
	&lt;name&gt;NAME OF YOUR SLICE&lt;/name&gt;
&lt;/slice&gt;
</pre>
<p>All you need is the ID of the slice and it’s new name.  The response will be an XML document with a &lt;slice&gt; node.</p>
<h3>Deleting a Slice</h3>
<p>Delete a slice by sending an XML document using the DELETE HTTP verb:</p>
<pre class="precode">
&lt;slice&gt;
	&lt;id type="integer"&gt;666&lt;/id&gt;
&lt;/slice&gt;
</pre>
<p>NOTE: You will have to have this option enabled in the API settings on your account.  You can edit those settings at:  <a href="https://manage.slicehost.com/api/">https://manage.slicehost.com/api/</a></p>
<h3>Rebooting Your Slices</h3>
<p>To reboot your slice with a hard reset, send a PUT request to:</p>
<p><a href="https://api.slicehost.com/slices/666/hard_reboot.xml">https://api.slicehost.com/slices/YOUR SLICE ID/hard_reboot.xml</a></p>
<p>To do a soft reboot, a PUT request to:</p>
<p><a href="https://api.slicehost.com/slices/666/reboot.xml">https://api.slicehost.com/slices/YOUR SLICE ID/reboot.xml</a></p>
<h3>Rebuilding Your Slices</h3>
<p>To rebuild your slice, you’ll need to use an image ID or a backup ID.  Once you’ve picked one, send a PUT request to:</p>
<p><a href="https://api.slicehost.com/slices/666/rebuild.xml?image_id=X">https://api.slicehost.com/slices/YOUR SLICE ID/rebuild.xml?image_id=X</a></p>
<p>or:</p>
<p><a href="https://api.slicehost.com/slices/666/rebuild.xml?backup_id=X">https://api.slicehost.com/slices/YOUR SLICE ID/rebuild.xml?backup_id=X</a></p>
<h2>Conclusion</h2>
<p>So that’s all I know.  As you can see the API is pretty simple, but not as simple as it could be, nor are the documents even remotely near as useful as they should be.  But, it’s awesome they have this API in the first place so I’ll stop bitching now!</p>
<p>Again, thanks to Slicehost for making awesome.  The world sure does need it.</p>
]]></content:encoded>
			<wfw:commentRss>http://interfacelab.com/slicehost-api-notes-for-the-non-rails-posse/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Wordle</title>
		<link>http://interfacelab.com/wordle/</link>
		<comments>http://interfacelab.com/wordle/#comments</comments>
		<pubDate>Mon, 23 Jun 2008 17:31:19 +0000</pubDate>
		<dc:creator>Jon Gilkison</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://interfacelab.com/?p=26</guid>
		<description><![CDATA[Found this awesome toy today.]]></description>
			<content:encoded><![CDATA[<p>Found this awesome toy today.</p>
<p><a title="Wordle: Awesome" href="http://wordle.net/gallery/wrdl/13019/Awesome"><img style="padding:4px;border:1px solid #ddd" src="http://wordle.net/thumb/wrdl/13019/Awesome" alt="" /></a></p>

<span class="slashdigglicious">
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Finterfacelab.com%2Fwordle%2F&amp;title=Wordle" title="Slashdot It!"><img src="http://slashdot.org/favicon.ico" height="16" width="16" alt="[Slashdot]" /></a>
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Finterfacelab.com%2Fwordle%2F&amp;title=Wordle" title="Digg This Story"><img src="http://digg.com/favicon.ico" width="16" height="16" alt="[Digg]" /></a>
<a href="http://reddit.com/submit?url=http%3A%2F%2Finterfacelab.com%2Fwordle%2F&amp;title=Wordle" title="Reddit"><img src="http://reddit.com/favicon.ico" width="16" height="16" alt="[Reddit]" /></a>
<a href="http://del.icio.us/post?url=http%3A%2F%2Finterfacelab.com%2Fwordle%2F&amp;title=Wordle" title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Finterfacelab.com%2Fwordle%2F&amp;title=Wordle', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img src="http://del.icio.us/favicon.ico" width="16" height="16" alt="[del.icio.us]" /></a>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Finterfacelab.com%2Fwordle%2F" title="Share on Facebook"><img src="http://www.facebook.com/favicon.ico" width="16" height="16" alt="[Facebook]" /></a>
<a href="http://technorati.com/faves?add=http%3A%2F%2Finterfacelab.com%2Fwordle%2F" title="Add to my Technorati Favorites"><img src="http://technorati.com/favicon.ico" width="16" height="16" alt="[Technorati]" /></a>
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Finterfacelab.com%2Fwordle%2F&amp;title=Wordle" title="Save to Google Bookmarks"><img src="http://www.google.com/favicon.ico" width="16" height="16" alt="[Google]" /></a>
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Finterfacelab.com%2Fwordle%2F&amp;title=Wordle" title="Stumble it!"><img src="http://www.stumbleupon.com/favicon.ico" width="16" height="16" alt="[StumbleUpon]" /></a>
</span>]]></content:encoded>
			<wfw:commentRss>http://interfacelab.com/wordle/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Variables in CSS via PHP</title>
		<link>http://interfacelab.com/variables-in-css-via-php/</link>
		<comments>http://interfacelab.com/variables-in-css-via-php/#comments</comments>
		<pubDate>Wed, 18 Jun 2008 03:19:10 +0000</pubDate>
		<dc:creator>Jon Gilkison</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://interfacelab.com/?p=22</guid>
		<description><![CDATA[UPDATED: Added support for expressions with variables so that you can add, multiply, divide, etc. variables when using them in the CSS. See below for more info. Back in April of 2008, I came across a proposal by Daniel Glazman and David Hyatt for using variables in CSS stylesheets.  I thought the proposal was absolutely [...]]]></description>
			<content:encoded><![CDATA[<p><strong>UPDATED:</strong> Added support for expressions with variables so that you can add, multiply, divide, etc. variables when using them in the CSS.  See below for more info.</p>
<p>Back in April of 2008, I came across a <a href="http://disruptive-innovations.com/zoo/cssvariables/">proposal</a> by Daniel Glazman and David Hyatt for using variables in CSS stylesheets.  I thought the proposal was absolutely brilliant, filling a much needed void for sites using complicated stylesheets across a variety of different pages.  Another part of their proposal was being able to include/import other stylesheets.  I don&#8217;t know anyone that couldn&#8217;t find this useful.</p>
<p>I put together a quick class for implementing most of their proposal using PHP.  Nothing fancy going on here, most of it is some simple regexes.</p>
<p><a href="http://interfacelab.com/code/css_compiler.zip">Download the code here</a>.</p>
<p><span id="more-22"></span></p>
<p><strong>Using the CSS Compiler</strong></p>
<p>Let&#8217;s first talk about how to setup your CSS stylesheets to use variables and imports.</p>
<p><strong>Important:</strong> Any stylesheet that uses variables or includes stylesheets that use variables <strong>must</strong> end with the extension &#8216;<strong>.cssp</strong>&#8216;.</p>
<p>To declare variables, you place them within an @variables at-rule like so:</p>
<pre class="brush: css;">

@variables
{
    titleFont:bold 18px &quot;Verdana, Arial&quot;;
    titleBG: #FF0000;
}
</pre>
<p>To use the variables:</p>
<pre class="brush: css;">

div.title { font: var(titleFont); background: var(titleBG); }
</pre>
<p>Couldn&#8217;t get much simpler.</p>
<p><strong>Importing CSS and Variables</strong></p>
<p>You can also import/include css and variables from an external stylesheet using @import:</p>
<pre class="brush: css;">

@import &quot;vars.cssp&quot;;

div.title { font: var(defaultFont); };
</pre>
<p>Alternately:</p>
<pre class="brush: css;">

@import url(&quot;vars.cssp&quot;);

div.title { font: var(defaultFont); };
</pre>
<p><strong>Evaluating Expressions</strong></p>
<p>You can also perform math operations with measurement units.  For instance, you could do something like:</p>
<pre class="brush: css;">
@variables {
    lc_width: 240px;
    rc_width: 180px;
    all_padding: 20px;
}

#some_div {
    width: eval((lc_width+rc_width)-(all_padding*2));
    padding: eval(all_padding/2);
}
</pre>
<p>You can only do this with px/em/% measurement units and the units must match.  For instance you can&#8217;t add a variable that is 2em with another that is 120px.  Doing so will throw an exception.  Also, if you use a variable reference that doesn&#8217;t exist, it will also throw an Exception.</p>
<p><strong>Using in HTML Pages</strong></p>
<p>To use these stylesheets, you&#8217;re going to have to write a little PHP, but not too much:</p>
<pre class="brush: php;">

&lt;?
    // include the compiler
    include 'css_compiler.php';

    // set the compile environment variable
    // otherwise it will spit out a static file
    // in a production environment comment this out:
    define('COMPILE_CSS',true);
?&gt;
&lt;html&gt;
    &lt;head&gt;
        &lt;? style(dirname(__FILE__),'testing'); ?&gt;
    &lt;/head&gt;
    &lt;body&gt;
        &lt;div class=&quot;nice&quot;&gt;Hello World&lt;/div&gt;
    &lt;/body&gt;
&lt;/html&gt;
</pre>
<p>At the top of this file, we&#8217;re including the css compiler and then defining a global variable <strong>COMPILE_CSS</strong>.  <strong>COMPILE_CSS</strong> tells the compiler to do the compilation and save the resulting .css files.  You will not want to do this in a production environment, so comment out the define when deploying to the masses.</p>
<p>In the head tags, the style() function is a helper function that compiles the css.  The first argument is the full path to where the css is.  The second argument is the css file to use without it&#8217;s extension.  Note: if your css files have a relative path of /css/whatever.css on your webserver, the relative path should be part of the second argument and not the first.</p>
<p>For example, let&#8217;s say our PHP application is located at /var/www/.  Our css files are located at /var/www/css/.  Our style function is going to look like:</p>
<pre class="brush: php;">

style('/var/www/','/css/testing');
</pre>
<p>Our actual usage of this code at <a href="http://massify.com/">massify</a> is way different.  I&#8217;ve added the style() function so that people reading this blog can use it, but you should definitely do your own legwork to blend it into whatever framework you are using.  This should be enough to get started however.</p>
<p>Also, make sure that your css directory is writable by your webserver or the whole thing won&#8217;t work at all.</p>
<p>Leave a comment or <a href="mailto:jon.gilkison@gmail.com">drop me a line</a> if you find this useful/find bugs/have suggestions.</p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://interfacelab.com/variables-in-css-via-php/feed/</wfw:commentRss>
		<slash:comments>31</slash:comments>
		</item>
		<item>
		<title>Metadata/Attributes in PHP</title>
		<link>http://interfacelab.com/metadataattributes-in-php/</link>
		<comments>http://interfacelab.com/metadataattributes-in-php/#comments</comments>
		<pubDate>Mon, 16 Jun 2008 07:56:09 +0000</pubDate>
		<dc:creator>Jon Gilkison</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://interfacelab.com/metadataattributes-in-php/</guid>
		<description><![CDATA[There&#8217;s a ton of stuff I miss from C#, having moved to PHP. Did I say a ton? I meant a megaton. One of the things I miss the most (besides the sanity) are attributes (annotations for Java peeps). To be able to ascribe metadata to class, method and property definitions opens up a whole [...]]]></description>
			<content:encoded><![CDATA[<p>There&#8217;s a ton of stuff I miss from C#, having moved to PHP. Did I say a ton? I meant a megaton.</p>
<p>One of the things I miss the most (besides the sanity) are attributes (<a href="http://en.wikipedia.org/wiki/Java_annotations" target="_blank">annotations</a> for Java peeps). To be able to ascribe metadata to class, method and property definitions opens up a whole new world of introspection which enables you to do some pretty wicked hacks.</p>
<p>In this post, I present a PHP class that allows you to do metadata/attribute programming with PHP.  You can download the class <a href="http://interfacelab.com/code/attribute.zip">here</a>.  But before we dig in, we must understand what attributes are and how they are useful&#8230;</p>
<p><span id="more-21"></span></p>
<p><strong>Introduction to Attributes</strong></p>
<p>For those that don&#8217;t know about attribute based programming, let me quote an excerpt from <a href="http://www.ondotnet.com/pub/a/dotnet/excerpt/prog_csharp_ch18/index.html" target="_blank">OnDotnet</a>:</p>
<blockquote><p>Attributes are a mechanism for adding metadata, such as compiler instructions and other data about your data, methods, and classes, to the program itself. Attributes are inserted into the metadata and are visible through ILDasm and other metadata-reading tools.</p>
<p>Reflection is the process by which a program can read its own metadata. A program is said to reflect on itself, extracting metadata from its assembly and using that metadata either to inform the user or to modify its own behavior.</p></blockquote>
<p>One of the last things I wrote in C# before switching over was a simplistic REST-esque framework for web services for C#. I used attributes on classes to mark which ones were exposed to the outside world and then used attributes on the methods to specify such things as the URI, description, etc. This allowed the services to be discoverable versus declared and to be self documenting. For example:</p>
<p>namespace SimpleWebService {<br />
    [RestService(baseURI='/simple/',Name='Simple', Description='Simple service', Persistent=false)]<br />
    class Service<br />
    {<br />
        [RestMethod(URI='something',Name='Do Something',Description='Does something.')]<br />
        public void DoSomething()<br />
        {<br />
            // &#8230;<br />
        }<br />
    }<br />
}</p>
<p>In the above example, the attributes are declared in the brackets.  On our <strong>Service</strong> class, we give the service a name, define it&#8217;s base URI, give it a description and declare if the service is persistant between requests (meaning that the class is only instantiated once, or is instantiated every time).  On the <strong>DoSomething</strong> method it&#8217;s a similar deal: we declare the URI endpoint for the method, the name of the method and it&#8217;s description.</p>
<p>By going to <strong><em>http://example.com/simple/something</em></strong> would eventually invoke the <strong>DoSomething</strong> method on our <strong>Service</strong> class.  The beautiful thing here is that my classes needn&#8217;t implement any interfaces or descend from any parent classes to be exposed as a web service.  I could drop the attributes on the class, recompile and they would then be instantly available.  When the application loaded, it scanned all of the classes in the loaded assemblies, did some reflection on them and created a cache of exposed services.  An <a href="http://www.developerfusion.co.uk/show/4643/" target="_blank">HTTPHandler</a> would dispatch the incoming requests to the corresponding service, map any POST/GET or URI fragments to the parameters of the method being called and then returned the results of the method call as serialized XML.</p>
<p>Nice and easy.</p>
<p><strong>Attributes and PHP</strong></p>
<p>PHP has no built-in mechanism for declaring attributes, but it does have a primitive retrospection capability.  For any class or function in PHP, there are a set of functions that you can call that will provide information about the class.  For instance, with methods, you can get it&#8217;s parameters and any associated block of comments:</p>
<pre class="brush: php;">
class DumbClass
{
    /**
     * Comment block
     */
    public function thing($parameter,$another)
    {
        return false;
    }
}

$method=new ReflectionMethod('DumbClass','thing');
echo $method-&gt;getDocComment();
</pre>
<p>In the above example, we create an instance of the ReflectionMethod class and echo the comment block.  If we run this script, the output would look like:</p>
<pre class="brush: php;">
    /**
     * Comment block
     */
</pre>
<p>Now if we put 2 and 2 together, you&#8217;ll see that we could use the comment block to insert our class metadata.  Now all we need &#8230;</p>
<p><strong>Introducting AttributeReader</strong></p>
<p>The AttributeReader class is a simple class that extracts <a href="http://devzone.zend.com/article/2585-Using-YAML-With-PHP-and-PECL">YAML</a> from the comment block on a class, it&#8217;s methods or properties.  You can download the class <a href="http://interfacelab.com/code/attribute.zip">here</a>.  Note:  You must have the pecl syck package installed, details are <a href="http://pecl.php.net/package/syck">here</a>.</p>
<p>Since we have access to the comment block, it&#8217;s the most obvious place to express our metadata.  Obviously, the 100% correct solution would be to patch PHP to support attributes out of the box, but that&#8217;s a much bigger effort that would require some serious coding.  The performance of this method is fast enough for most use cases.</p>
<p>So how do we use this?  At <a href="http://massify.com">massify</a>, we use metadata for our ORM layer.  All of our models have metadata attached to them that define what database table to use, the column name, etc.  Here&#8217;s an example:</p>
<pre class="brush: php;">
/**
 * Sample model
 *
 * [[
 * table: sample.item
 * database: default
 * read_only: false
 * ]]
 *
 */
class Item extends Model
{
    //@ fields

    /**
     * [[
     * label: Title
     * type: string
     * length: 32
     * description: Title of the item
     * validate:
     *   required: true
     *   length: 8-32
     *   unique: true
     * ]]
     */
    public $title;

    /**
     * [[
     * label: URI
     * type: string
     * length: 32
     * description: URI of the item
     * validate:
     *   required: true
     *   length: 4-32
     *   unique: true
     *   format: alpha_numeric
     * ]]
     */
    public $uri;

    /**
     * [[
     * label: Description
     * type: text
     * description: Description of the item
     * ]]
     */
    public $description;

    //@ end fields
}
</pre>
<p>In the above example, our metadata is nestled between double brackets [[]].  Inside the double brackets is YAML expressing the metadata.  The cool thing here is that we can nest attributes of the metadata.  Let&#8217;s look at what we&#8217;ve done:</p>
<p>On the declaration for the Item class, we&#8217;ve described metadata that tells us which database table this model represents, which database it resides in and if it&#8217;s read_only (a view, in database parlance).  On the properties of the model, the metadata describes the label to use for forms, what the database type is (simplified), the length (for string types), a description and a list of validators.  For instance, on the $uri property, we&#8217;ve declared validators that make sure the property has a value before saving (required), is of a specified length (4-32 characters), is unique in the database (unique) and matches a specific format (alpha_numeric).</p>
<p>Since the class extends from Model, the model knows to use the metadata to build the correct SQL statements for insert, updates, etc.  It also knows how to validate itself when saved to the database, returning the correct errors to the user if any of the validations fail.  Finally, we are able to automatically build forms to edit the models by using the metadata as a guide when constructing the form in code.</p>
<p>All of this is completely possible to do without using metadata, but would require a lot of redundant code with a predetermined set of use cases.  Metadata frees us from this because we can write use cases that work with a known quantity, rather than the other way around.</p>
<p><strong>Using the AttributeReader</strong></p>
<p>Using the class is straight forward.  Here&#8217;s an example.  Let&#8217;s assume we have the Item model from the previous example loaded and want to extract metadata for it and it&#8217;s URI property:</p>
<pre class="brush: php;">
$item=new Item();

$class=AttributeReader::ClassAttributes($item);

echo $class-&gt;database;
echo $class-&gt;table;

$method=AttributeReader::PropertyAttributes($item,'uri');

echo $method-&gt;label;
if ($method-&gt;validate-&gt;required)
    echo &quot;Required field&quot;;
else
    echo &quot;Not required.&quot;;
</pre>
<p>It&#8217;s that simple.</p>
<p><strong>Caveats</strong></p>
<p>Make sure you are familiar with the rules of YAML.</p>
<p>Performance is acceptable, but always make sure you measure performance for yourself.  We use a caching strategy via APC at <a href="http://massify.com">massify</a> for caching model metadata.  This requires that you restart apache if your models change (you can disable APC on your development/staging to get around this).  With the APC caching strategy, it&#8217;s super fast.  Find out what works best for you.</p>
<p>I hope people find this useful, I think it opens a whole new world for serious PHP development.  Feel free to drop me an <a href="mailto:jon.gilkison@gmail.com">email</a> if you have questions or successes.</p>
]]></content:encoded>
			<wfw:commentRss>http://interfacelab.com/metadataattributes-in-php/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Flying Solo</title>
		<link>http://interfacelab.com/quintuple-up/</link>
		<comments>http://interfacelab.com/quintuple-up/#comments</comments>
		<pubDate>Tue, 10 Jun 2008 08:13:57 +0000</pubDate>
		<dc:creator>Jon Gilkison</dc:creator>
				<category><![CDATA[Poker]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://interfacelab.com/?p=20</guid>
		<description><![CDATA[Dave had to head back to San Francisco, leaving me to fend for myself. I was initially hesitant, playing with a buddy is really the best way to go. You can protect each other in multi-way action, you can do some sick post game analysis and just sounding ideas on betting, constructing table image and what not always push the game to that next level.

Like a true degenerate, he tried to change his flight so we could cram in another 2/5 session, but the airlines weren't having it and he had to be back to San Fran at a time that made it unfeasible. There is a blurry line between a degenerate and a great player, and I think had he pushed the flight we'd have landed on the wrong side of that line.

I wish he had been there to see some of the sickness though.]]></description>
			<content:encoded><![CDATA[<p>Dave had to head back to San Francisco, leaving me to fend for myself.  I was initially hesitant, playing with a buddy is really the best way to go.  You can protect each other in multi-way action, you can do some sick post game analysis and just sounding ideas on betting, constructing table image and what not always push the game to that next level.</p>
<p><span id="more-20"></span></p>
<p>Like a true degenerate, he tried to change his flight so we could cram in another 2/5 session, but the airlines weren&#8217;t having it and he had to be back to San Fran at a time that made it unfeasible.  There is a blurry line between a degenerate and a great player, and I think had he pushed the flight we&#8217;d have landed on the wrong side of that line.</p>
<p>I wish he had been there to see some of the sickness though.</p>
<p><strong>Settling in By Myself</strong></p>
<p>Honestly, I wasn&#8217;t feeling up to another session of poker.  Dave and I had stumbled into an early morning game that same day and Dave had run a bad session while I landed up $800.  Truth be told we were both exhausted and off our games, but I honestly believe our half-game is two steps ahead of most people&#8217;s best games.  I know that sounds egotistical, and it is, but ego is an essential ingredient when playing poker.  If you can spike up your ego and have faith that you are a great player, that comes across the table in a confidence level that instantly sets up a favorable table image.  It carries through in your bluffs and your body language in general, making it that much harder for people to put you on hands and hesitant to call your pot spiking raises.</p>
<p>So I took some time to have a meal, write some notes on the early morning degenerate session and plan out a few scenarios for the next session.  I decided during dinner that I was going to hold off on the bluffing and practice a more trapping game using some betting strategy that Dave and I had talked about while waiting for his flight.  I also committed myself to an 8 hour session and I think this is important to highlight.  Telling yourself that you are going to play 8 hours or 10 hours frees you from the novice mistake of thinking you need to be involved in every monster pot or you have to play semi-strong hands when the correct play is to fold.  When you fold QJ, KJ, A10 or some other flopping/drawing hand, I always look at my watch and tell myself I have plenty more time for a more perfect setup.  When you rush you make mistakes.  Slow, deliberate play wins in the long run, so give yourself time and be lenient with yourself in making solid folds when things feel fishy.</p>
<p>I head to the 2/5 game at MGM and land on a table of monster stacks.  I was slightly intimidated until a little voice in my head told me &#8220;Those stacks belong to you.&#8221;</p>
<p>It&#8217;s all my brain had to do throw me into the game.  I did my standard start off of fold, watch and listen.  I think this is critical to my play.  I need to understand the table before I can start moving on it.  Additionally, by playing tight, or not at all, the pro&#8217;s will pick up that you are studying the action and throw a little respect your way when you do start showing up in some pots.</p>
<p><strong>Sick Ducks</strong></p>
<p>My first action pot had me with 22 in the small blind.  I have about $400 and some change, $100 over my $300 buy-in.  Button raises 35 bucks and I instantly put him on AK.</p>
<p>2/5 is real predictable in this way.</p>
<p>Any large pre-flop raise is almost certainly AA, AK, AQ or big pocket pair.  Unfortunately for the raiser, I had him down as a super weak stack and knew it was coin flip going into the flop so I call without hesitation.  Calling speed is critical, I&#8217;ve found.  When small blind calls without hesitation, weaker players start the sweat, specifically if he doesn&#8217;t have a made hand.  I personally feel that AK is a crap hand post-flop so calling here is a no brainer.  For 2/5 the best you can hope for is 2 pair or trips, but the flop rarely goes that way with AK.  Since I&#8217;m only 35 in with a made hand that he can&#8217;t put me on, it&#8217;s no sweat to fold to a flop favorable to his AK.</p>
<p>Flop falls down 2-4-J.  Mister AK has me on J-10 or JQ which is as perfect as perfect can be.  First to act, I spike the pot for $100 which I knew he would call with his two overs and two cards to come.  To my chagrin, he pushes all in which I call instantly since he&#8217;s drawing dead.  Two pair can&#8217;t save him.  Two running kings or aces gives me a full house.  If his AK is suited, he&#8217;ll need runner runner to catch a flush which I&#8217;ll gladly play off as a reward for letting me trap him in a sick hand.</p>
<p>I insta-call and make a mind fuck play of proudly flipping my 2&#8242;s and declaring his &#8220;AK suited&#8221; dead before he even shows.  I&#8217;ll eat my crow if the turn and river go his way.</p>
<p>But it doesn&#8217;t.  Another 4 comes on the turn, giving me a boat and his hand is dead as dead can be.</p>
<p>Double up puts me at $800 and I&#8217;m right in my comfort zone with my chip stack to start making moves.  My little show when I flip has broadcasted to the rest of the table that I have cahones the size of boulders which I take advantage of later to steal some pots with a few semi-bluffs.</p>
<p><strong>Mind Fuck Part Deux</strong></p>
<p>This was a picture perfect psychology play.</p>
<p>I&#8217;m dealt AA in 4th position.  I limp in for $5, which I honestly feel is the best play in early position holding AA because so many people have yet to act and I want a read on hands before I spike it.  3 callers and a bunch of folds follow.  The guy in the small blind raises 35 bucks.  Hello AJ!</p>
<p>Action comes back to me, with button calling Mister AJ&#8217;s raise.  I do a fairly obvious re-checking of my hand, sprinkling the top with some feigned running of the math, so that Mister AJ puts me on QQ or KK.  Dude on the button is of no concern to me.  He&#8217;s calling with small pair or 9-10 hoping to hit a flop.  I re-raise $100 on top, honestly hoping to take it down right here, but knowing that Mister AJ is likely to call because he&#8217;s a total fish.</p>
<p>He hems and haws but finally calls.  He acts like he can&#8217;t put me on a hand, but I know he has me on QQ or KK.  Someone holding AA would have spiked from 4th seat and not had to re-check their cards or spend some time thinking about his raise.  I know that post-flop I&#8217;m going to play a very dirty trick and I think I would only allow myself to do this once per session because it&#8217;s such a filthy move.</p>
<p>Before I tell you what I did, I want to tell you why I did it.  There is a chance I have misread, but misreading with AA in the pocket is acceptable.  If he has KK or QQ, then he has me on AJ or AQ.  To illicit a call if he does have KK or QQ, I&#8217;m going to have to induce him into doing it.  Honestly, I don&#8217;t really think this guy can put me on any hand at all, he just doesn&#8217;t seem that good of a player.  If he&#8217;s holding KK or QQ, hell even AQ/AJ/AK, he&#8217;s going to replay some move he saw on television and walk right into my trap.</p>
<p>The flop comes down junk.  There is a pause right after the dealer flips the flop and I jump in declaring &#8220;All In&#8221; acting out of position.</p>
<p>Told you this was a filthy dirty move.</p>
<p>A savvy player might see my trap right there, but I&#8217;ve consciously broadcasted to the guy that I&#8217;m very eager to play my KK or QQ with this kind of flop by declaring my intentions out of turn.  Since he was suppose to be first to act, the dealer tells me to cool my jets and turns to the guy to have him act.  The guy checks to me and I instantly redeclare my All In.  Thanks for helping me with my play Mr. Dealer!</p>
<p>Before I tell you what happened, I want to point out that I&#8217;m perfectly happy at this point to take the pot down if Mister AJ folds to my All In.  David is big on maximizing value for a hand, which is awesome playing, but I put a little less importance on it because too many times you can get caught in some weird crossfire that junks your winning hand when you could have walked off with the pot on post-flop action.  Here is where setting an amount of time for play is important because you can thrive on picking up $100-$200 pots here and there to slowly build up your stack.  Patience pays in spades.</p>
<p>At first, I think the guy is going to fold.  I have around $900 in front of me, with about $300 in the pot.  He has around $700 in front of him (most of which he picked up on a bullshit gutshot draw that got him a lot of heat from the table for sucking out).  He calls, flipping over AQ so my read was pretty damn close.  A solid player would have folded, and I honestly think this guy would have folded too had I not acted so dirty.  By coming out as an eager beaver and/or a bully, he wants to &#8220;teach me a lesson&#8221; or pull out a &#8220;Degree All-In Moment&#8221;.  Wrong move.</p>
<p>Needless to say the rest of the board came out junk and I took it down.  You wouldn&#8217;t believe the incredulous table banter that exploded from the solid players as I raked in chips.  One guy that I had been paying a shitload of respect to calls me out for limping in 4th position with pocket AA&#8217;s telling me what a dumb move that was.  If there is one thing that can easily drop me on tilt, it&#8217;s when a respected player does post play analysis on the way I&#8217;ve played.  As I&#8217;m raking in the reds, I turn to the guy and say:</p>
<p>&#8220;Dude, this table is so soft it&#8217;s like butter.  The guy over here (pointing to the guy whom I had just busted) is going to call with any sizable pocket pair and his raise told me he was on AJ/KK/QQ.  I limp and the flop comes down as the perfect trap.  I&#8217;m not afraid of getting my aces cracked at all.  I can throw that shit away all day and not cry about it.  And, shit, it&#8217;s not like I didn&#8217;t broadcast what I had with my re-raise and my all-in.  It&#8217;s his fault he let me put him in that trap.  Furthermore, how the hell is anyone going to put me on a hand for the next hour?  I respect your plays man, but after this not even you are going to be able to put me on a hand and trust me I&#8217;m going to play that to the tilt.&#8221;</p>
<p>I know I gave up way too much information here, but I did it on purpose.  I wanted the table to know that I played that hand hard and it wasn&#8217;t random luck.  I wanted them to know that I was observing and had people&#8217;s plays pegged.  While it gave me the asshole image at the table, it also gives me the semi-pro/pro image and that&#8217;s going to have people back off when I start pulling out my semi-bluffs and bluffs.</p>
<p><strong>Cracking Rocks</strong></p>
<p>The guy in seat 9 I had played in a couple of other sessions and knew him to be a bit of an ATM machine.  Definitely not good at reading other players, but I will give him credit for otherwise being a very tight player willing to grind it out until he hits a good hand.</p>
<p>I&#8217;m in the small blind with pocket 6&#8242;s.  I raise 35 hoping for a single caller and everyone folds except for The Rock.  He calls and I&#8217;m assuming AJ/AQ.  Did I mention 2/5 was predicatable in this way?</p>
<p>The flop comes down perfect.  A-J-6, rags.  I check to him and he raises 50.  I smooth call and the turn comes junk so I know I&#8217;m good.  I&#8217;ll pay JJ off, but I don&#8217;t put The Rock on JJ with his call on my pre-flop raise.  I lead out with $75 and he insta-calls and I have to put him on AJ because he&#8217;s going to protect his set of jacks with a re-raise or an All-In which I can&#8217;t call.  He could be laying a trap with AA, but he&#8217;s not that good and at this point he&#8217;s afraid of me, but &#8211; like the other dude &#8211; wants to snap a piece off the bully.</p>
<p>River comes more junk, the only possible hands in play are set over set, but I have him on 2 pair.  I check to him and he bets $75 which I promptly reraise to $200.  Pow, right in the kisser.</p>
<p>He runs the math and realizes that he&#8217;s priced into the pot.  I&#8217;m hoping for an all-in move, but he simply calls the $200 and I flip the set.  He shows AJ and storms from the table.  There is deathly silence as I pull in the pot and stack it up.  When he returns to the table, obviously steaming at his bad play, I can overhear him and another guy running post-play analysis.  The end result is that he should have pushed me on the turn with an all-in raise which I would have had to fold because he&#8217;d be representing JJ and his set would have been larger.  His mistake was putting me on AK, but honestly I don&#8217;t expect that anyone could have put me on sixes with an out of position raise like that.</p>
<p><strong>Rack Em Up</strong></p>
<p>This is probably the best move I made during that session.  I racked up my chips when I had quintupled up.  I could have stayed and grinded longer, but the math showed me I was making $300 an hour for 5 hours of play.  I had just lost about $150 in a bluff gone bad, so I made the right choice to close that session out.  I know I had planned to play for 8 hours, but it struck me as a better idea to rack up, take a break for a few hours and write about the session so that I could make notes on my plays.  I&#8217;ll be heading back for another session soon with the assumption that I&#8217;ll play for another 10 hours.</p>
<p>After the degenerate analysis with David, I&#8217;ve decided I have a strict single $300-$400 buy-in policy for 2/5.  If I lose that buy-in I leave the table and take a walk/nap/meal.  It hasn&#8217;t happened yet, but the biggest mistake I&#8217;ve seen repeatedly is people buying and rebuying over and over.  When your tilted, and you will be when you lose your buy-in, just walk away from the goddamn table.  It&#8217;ll be there when you get back.  Do something to knock out the bad energy and once you feel the power again, go hit the session and show it who&#8217;s boss.</p>
<p><a href="http://flickr.com/photos/misterfingers/2567367482/in/photostream/"><img src="http://farm4.static.flickr.com/3011/2567367482_12904b54e4.jpg" alt="" width="500" height="375" /></a></p>
<p><strong>Racked Up</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://interfacelab.com/quintuple-up/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>14 Hours Non-Stop</title>
		<link>http://interfacelab.com/14-hours-non-stop/</link>
		<comments>http://interfacelab.com/14-hours-non-stop/#comments</comments>
		<pubDate>Sat, 07 Jun 2008 22:53:33 +0000</pubDate>
		<dc:creator>Jon Gilkison</dc:creator>
				<category><![CDATA[Poker]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://interfacelab.com/?p=17</guid>
		<description><![CDATA[I just ended a 14 hour poker marathon that has taught me more about playing my game than the last two years combined. The Back Story I&#8217;ve been in Vegas for four days now. The first day I had a good run, ending up 600 overall in about 4-5 hours of play. I was playing [...]]]></description>
			<content:encoded><![CDATA[<p>I just ended a 14 hour poker marathon that has taught me more about playing my game than the last two years combined.</p>
<p><span id="more-17"></span></p>
<p><strong>The Back Story</strong></p>
<p>I&#8217;ve been in Vegas for four days now.  The first day I had a good run, ending up 600 overall in about 4-5 hours of play. I was playing just OK, no moments really stand out in my memory.  I ran conservative, only making a few bluffs.  I did crack a few loudmouths with some bullshit draws, but only a couple of times.</p>
<p>The next two days were depressing.  I was getting a run of paint with low kickers.  Even limping, flops landed miles away from where I needed them to be.  Lapses in patience and discipline found me involved in hands that I had no business being involved in.  I had a poor table image, so making moves got me caught more often than not.  And once you are down like that, it&#8217;s hard to rebound, so the second day of my bad run was even more depressing.</p>
<p><strong>Hours 1-2</strong></p>
<p>2pm rolls around and I decide to drop into the 1/2 game to waste some time while I wait for my friend David to get in from San Francisco.  Bought in for 200 and was having the same run as the day before.  J4, K5, Q7, A4 and a bunch of other junk in-between.  My poor table image continued and I couldn&#8217;t push anyone off with semi-bluffs.</p>
<p>I get a text message that Dave has arrived and realize I&#8217;m stuck for 180, leaving 20 in my pocket.  I excused myself from the table and met up with Dave, showing him our room.  After he settles in, we head back down to the poker room.  Dave jumps on the 2/5 table and I head back to the 1/2.</p>
<p><strong>Hour 3</strong></p>
<p>I got put on a table with a bunch of youngish looking guys and am able to strike up a few conversations with the people to my left which does two things:  it helps me start to build up my table image and gets me joking with the rest of the table.</p>
<p>I didn&#8217;t realize it then, but would later figure out, that almost 2/3rds of my game is talking down the table and using my gruff charm to place myself favorably in people&#8217;s heads.  Not only is that important for the psychology, it does two specific things: it let&#8217;s me get a better vibe on the people I&#8217;m playing with and it makes people feel bad when they bust me on my draws or out kick me on the river.  Taking a few hits and being congenial about it has people feeling sorry for me in the back of their minds, which is a huge opening to exploit as they&#8217;ll tend to let you slide with some bullshit calls as you chase down some miserable draws.</p>
<p>I nailed a few sizable pots, putting my chip stack up into a zone I am comfortable playing.  I&#8217;m good at the deep stack, even better when I have a favorable table image.  A few other tricks include talking up playing in NYC clubs which puts an exaggerated image of my skill into the heads of the home gamers and gives me cred with the lifers.  Once you have them charmed, you drop the resume and you get respect because they like you and they are afraid of whatever skills you might have learned playing in smoky underground clubs in NYC.</p>
<p><strong>Hours 4-5</strong></p>
<p>It&#8217;s up and down at this point, but my stack never drops below 200 and at this point I&#8217;ve gotten over being protective of my stack.  You know that saying, &#8220;If you love it, give it away?&#8221;  It applies here.  Part of my problem of the last two days was that I wasn&#8217;t willing to lose my stack and so I was playing in a guarded fashion when the correct play is to disregard the money and just put it in when it needs putting in.</p>
<p><strong>Hours 6-7</strong></p>
<p>I love gut shot draws.  They are an incredibly dangerous hand to play in a more serious 2-5 game, but in 1-2 &#8211; once you&#8217;ve become ok with giving away your chips &#8211; they are deadly instruments.  Because betting tends to side on the conservative, except for when somebody is broadcasting big hands with retarded raises, you usually are able to limp or smooth call to 4th street where you either hit or you don&#8217;t hit. But when you hit, you hit big.  People might whine about your suck out, but then you remind them that they let you suck out.  We musn&#8217;t forget that passive aggression is an incredibly useful tool at the table.  If done right, they don&#8217;t even realize you are passively putting them on tilt and pushing them to play more recklessly to try to strike back at you.</p>
<p>I hit a massive gut shot around hour 7 that doubles me up because none of the knuckleheads I&#8217;m playing with even saw the straight on the board, and they&#8217;re not good enough to put me on a backdoor hand.  When I flip the nuts and take the pot, I get some incredulous feedback from the guy I busted, but I also get some respect and claps on the back from the others I&#8217;ve endeared myself to.  Both of these types of feedback are important for my image.  My &#8220;friends&#8221; are not likely to call me down, giving me room to semi-bluff or straight out bluff them.  My new &#8220;enemy&#8221; &#8211; the guy who wants his chips back from me &#8211; is now trying to play some shitty hands to catch me in the same situation.</p>
<p>But, my read on the table is so good at this point that I can see them coming from a mile away and though they are trying to mix up their play, they don&#8217;t realize that they are sticking to some standard betting that practically gives away what they&#8217;re holding and I&#8217;m able to duck and dodge.</p>
<p><strong>Hour 8</strong></p>
<p>J8 in the pocket, I limp in and the flop lands 9-Q-3.  Now J8 is normally a dangerous hand.  If the flop came down 9-10-3, I&#8217;d be facing QJ and could get myself royally screwed when the K or 8 hits.  But with 9-Q-3, I&#8217;m waiting on a 10 and nobody sees that straight potential on the board.  And why should they?  How do you put someone on J8 when they bet the flop?  You can&#8217;t really, at best you are putting them on top pair top kicker.  When people check to me, of course I raise the action up to get people off the field &#8211; I&#8217;m not banking on hitting my 10, but know that if I do, fireworks are going to go off.</p>
<p>A raise is thrown in by an aggressive player which I instantly call because I know he&#8217;s maybe got top pair with a solid kicker, maybe even 2 pair.  Either way, I don&#8217;t really give aggressive players, specifically in a 1-2 game, much credit for being anything other than dumb brutes.  So I smooth call his 20 and low and behold, the turn completes my straight with a 10.</p>
<p>Mister two pairs make a big bet, but I have him trapped and I re-raise all in.  Of course, I get called, and double up my stack to around 550.</p>
<p>Again, we can&#8217;t discount the post win accolades and applying some manipulation of people to get them on your side.  &#8220;Sorry for that suck out, had a feeling&#8221;  You say things like these to ease the tilt, but you are actually kind of rubbing it in to make it worse.  Mister two pairs definitely slows down at this point, which gives the weaker players chances to fatten up the pot for you.  At the same time, the trap is laid because Mister Two Pairs is going to come at you sometime clutching to AQ like a life preserver even though you&#8217;ve flopped trip 9&#8242;s and boat up on the river.</p>
<p>The rest of the hour I see minimal action because I&#8217;ve put the brakes on myself.  I&#8217;m seeing 2 dollar flops but avoiding big pre-flop raises.  You would think that letting people bully you out of pots would increase their own sense of self-esteem, but what it actually does is slowly amp up their drive to get some of your stack back into their own.  This is a classic trap, but you aren&#8217;t dealing with super experienced players on a 1/2 table, so you can really put this to good work if you pay attention.</p>
<p>Did I mention that I love gutshots?</p>
<p><strong>Hour 9</strong></p>
<p>My stack is at 600, so I&#8217;m seeing a ton of flops.  I&#8217;m also running the table and have made sure everyone knows my name and evenly spread the joke cracking around to everyone.  You have to have the full table involved in the psychology to really make that advantage work, so you spread the jokes around and the poker jock talk and get everyone feeding into you.</p>
<p>This is why I love my parents.  I think I am uniquely qualified to play mind games with people because I moved around so much as a kid that I&#8217;ve learned how to chameleon my own personality to be attractive to others.  You had to if you wanted to make friends in whatever new school you found yourself in that year.  The poker table is no different.  The one thing I learned in this marathon session is that if you don&#8217;t run the table, request a table change until you land a table where you can run it.</p>
<p>With 600 in front of me, I&#8217;m calling a lot because my chip stack isn&#8217;t important to me, but it sure is important to everyone else.  They either want to fight you for a chunk of it, or they are afraid of it.  It&#8217;s easy to discern who is who in this situation, so you fold to the aggressors and lead the juvies into fattening the pot for you.  Never ever ever try to fight someone else with chips.  Never try to get revenge on a bad beat or on some loud mouth at the table who is playing an obvious game of &#8220;who can I put on tilt with my inane poker table banter&#8221;.  Those people will fuck themselves in the long run without you having to sacrifice chips to help them along.</p>
<p>Case in point and another gutshot victory:  An older gentleman come in to my left at the table with about 100 bucks.  He&#8217;s obviously a lifer &#8211; in NYC we call them degenerates &#8211; so I&#8217;ve got my eye on him but not too concerned because the problem with lifers is that they know the walk and they know the talk but they are long haul losers who clutch to standard strategy and expect everyone else to be doing the same.  It&#8217;s a 1/2 table dudes.  You&#8217;ve got some podunk from Kansas on his bachelor party who plays nickel and dime home games.  You&#8217;ve got jocks that maybe make it to the indian casino&#8217;s a couple of times a month.  You might have 1 guy who is serious and is at the table for the same reason as you, so you watch out for him, but everyone else is only a suck out danger, they are never going to out play you unless you let them.  You need to get a handle on who the calling stations are, the river chasers and only tangle with them when you&#8217;re made in the shade because you can&#8217;t shake them off hands.  I love watching people shake their heads after they get sucked out on by Mister Bachelor Party because they should know these monkeys are &#8220;gambling&#8221; just like they were &#8220;gambling&#8221; at the craps table an hour before.  These people are seeking the adrenaline of hitting big and have no idea what kind of mistakes they are making.  Stay away unless you have a made hand, let them fuck themselves and wait for the right time to take their chips from them.</p>
<p>Anyways, back to the gutshot.  I had 4-6 diamonds in the pocket.  I love suited gappers because people rarely will put you on them.  Everyone limps in, so I tag along.  Flop lands with 7d-8d-3s.  Two diamonds on the board for a flush and straight flush.  I need a diamond or five to complete or runner-runner 9-10.  The older gentleman grumbles and throws in 20 at a 12 dollar pot.  I call.  I base this call on two things: my love of gutshots and the fact that the guy has expressed some mentally unstable characteristics.  He&#8217;s also let me know that he&#8217;s been living in Vegas for 17 years and knows it all about Vegas.  The information here is that he&#8217;s a lifer.  He plays a lot, sure, but he loses even more.  His bet is broadcasting a nut flush draw or overpair and I can&#8217;t help to call with my own flush draw, straight flush draw and straight draw.  Even though I&#8217;m a 4 outter for the straight, I&#8217;ve got 9 outs to the flush.  I know, I know.  It&#8217;s a low flush I&#8217;m hitting for, but again this is why I love gutshots.  Also, 20 dollars from my stack of 600 is 3.3% of my stack.  I&#8217;ll call 3% of my stack for a big hit.</p>
<p>The turn comes down a 2.  Mister Lifer throws in 35, I call without hesitation.  Grumbling from the old man.  Boom, on the river comes the 5 of diamonds and I&#8217;ve hit my straight flush.  I&#8217;m really hoping he pushes here with an ace high flush, but he checks because he doesn&#8217;t have it.  I bet anyways, knowing he won&#8217;t call, BUT HE DOES.  I show the straight flush and am now pushing a stack a little over 700.</p>
<p>He is pissed.  A bunch of &#8220;How can you call with that&#8221; followed by a volley of made up statistics about hitting my outs.  I make a mistake here of letting his loser talk get under my skin so I hold up my hand to his face and tell him: &#8220;I won you lost.  Stop being a dick about it.&#8221;</p>
<p>He storms away from the table and I get a warning from the dealer not to do that again.  The nice side effect here is that I&#8217;ve beaten the asshole with an impossible hand and now everyone is even more warmed up to me because of that and because I was able to put him in his place with a little verbal kick in the pants.</p>
<p>He only plays a few more hands before switching tables.  I think because he realizes I&#8217;m running this shit and once in awhile I&#8217;ll say some passive aggressive shit to antagonize his tilt.  In the few pots we play, he never calls me down.</p>
<p><strong>Hours 10-12</strong></p>
<p>I&#8217;m coasting here and hitting pots like crazy, mostly because I&#8217;m able to push people out, but I&#8217;m also getting a good run of cards and an even better run of flops.  Also, at this point, the game is so crystal clear to me that I almost feel psychic.  I&#8217;ve played a few hundred hands at this point, so I know what I&#8217;m seeing.  I&#8217;m running purely on instinct now, I&#8217;ve got everyone at the table sorted out and classified and making calls where I need to and folding where I need to.</p>
<p>The main lesson I gleamed during these two hours is to integrate any newcomers to the table and get them to start feeding you information as soon as possible.  What are they doing in Vegas?  Where are they from?  Where do they play back home?  What do they do?  Try to find some common thing that you can discuss with them and get them talking because that is such a primary source of food for instinct play.</p>
<p>My father used to take me to shopping malls and we&#8217;d play a game of watching people and then making up back stories for them.  I do this all the time on the subway or when I&#8217;m out in public, it&#8217;s almost second nature for me to do so.  I think this has honed my ability to not only read people, but have some fairly keen accuracy in guessing personality types.  If I can leech some actual information out of them that matches with my supposition of what they are about, then I know I can read them and guess their plays.  Nothing is set in stone, however, so I give myself some leeway for being incorrect.  But after 10 hours of play, I&#8217;m getting really good at it and am able to make calls and play pots without having to run any math.  I&#8217;m totally playing off personalities at this point.</p>
<p>My stack is at 800 which seems to be a ceiling I can&#8217;t get around.  I&#8217;m aiming to make 1000, so I catch myself getting a little frustrated and having to remind myself that I&#8217;m in front of the curve and to just hang loose.</p>
<p><strong>Hour 13</strong></p>
<p>I&#8217;m putting my chips into a rack to call it a night, I&#8217;m suppose to be playing in the World Series the next day so it&#8217;s obviously time for bed.  My friend Dave is now slumming it at the 1/2 table with me and we&#8217;re able to play off each other to make some pots.</p>
<p>A kid from San Francisco sits down next to me with 200 in chips.  I get dealt 6-8 offsuit and raise it up 12 just to fuck around.  He calls.  The flop is 7-9-2.  He bets 25, I call.  Turn comes 10, I&#8217;ve hit my straight and he totally can&#8217;t see it.  He&#8217;s got 10&#8242;s maybe, I&#8217;m not sure because this is the first hand we&#8217;ve been in.  On the river comes a king and he makes a thirty dollar bet.  I push all in assuming he won&#8217;t call, but he does!  I show him the straight and he&#8217;s very good about it, but you can tell he&#8217;s upset.  I apologize, yadda, yadda.  Kid dips into the wallet for 200 more.</p>
<p>Next hand I&#8217;m dealt 99 in the pocket.  I raise 12 again, he calls.  Flop comes down K-10-9.  I&#8217;ve hit trips, I put him on two pair.  He makes a big bet, I call, turn is junk.  I check to him and he bets.  Again I call because I&#8217;m square with the trips to his two pair.  Turn comes with another 10, fetching me a full house.  I bet the rest of his stack and the kid calls.  I show the boat and he shows me his trip 10&#8242;s.</p>
<p>I have to thank him because now I&#8217;m up 1100 for the night.  I bid everyone farewell and call it a night.</p>
<p><strong>Conclusion</strong></p>
<p>My take away from this marathon:</p>
<ul>
<li>Stop worrying about your stack.  You have to spend money to make money.</li>
<li>Run the table, throw the personality out there and try to get people to rally for you.  I hate saying this, but people are sheep.  Give them a little leadership and use that to your advantage.</li>
<li>In 1/2 at a casino, your run of cards is secondary to how you manipulate the people at your table.  These people are not sophisticated players, take advantage of that.</li>
<li>Calling on instinct is better than calling on math on a 1/2 table full of amateurs.  Massage that table until you&#8217;re instincts are proven and once you can trust it, go with it.</li>
<li>People&#8217;s back stories almost always dictate the way they play.  Chat them up and find out what they are about.  Find commonalities to get them to rally behind you.  Take smoke breaks with other smokers to talk about other players at the table.</li>
</ul>
<p>I totally missed out playing in the World Series today, but I&#8217;m sort of glad because tournaments are a total grind and I&#8217;d much rather reapply what I learned last night to another marathon session today.</p>
]]></content:encoded>
			<wfw:commentRss>http://interfacelab.com/14-hours-non-stop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
