<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"><channel><atom:link rel="hub" href="http://tumblr.superfeedr.com/" xmlns:atom="http://www.w3.org/2005/Atom"/><description>is the stuff that comes after the first 140 or so  characters. I am the creative lead at Flipswap, and a fun haver in West Michigan.

Twitter Updates



var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));

try {
var pageTracker = _gat._getTracker("UA-9642424-1");
pageTracker._trackPageview();
} catch(err) {}</description><title>I am Drew Yeaton</title><generator>Tumblr (3.0; @drewyeaton)</generator><link>http://drewyeaton.com/</link><item><title>House off the grid – a graphic I made for a project I’m...</title><description>&lt;img src="http://27.media.tumblr.com/tumblr_l1n7m9vPJG1qzciabo1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;&lt;strong&gt;House off the grid &lt;/strong&gt;– a graphic I made for a project I’m working on.&lt;/p&gt;</description><link>http://drewyeaton.com/post/558528933</link><guid>http://drewyeaton.com/post/558528933</guid><pubDate>Thu, 29 Apr 2010 10:44:00 -0400</pubDate></item><item><title>Beautiful Buttons with Sass Math</title><description>&lt;p&gt;Just recently I attended a Ruby User Group meeting where &lt;a href="http://twitter.com/Tavon"&gt;John Hwong&lt;/a&gt; of &lt;a href="http://mutuallyhuman.com/"&gt;Mutually Human&lt;/a&gt; gave an excellent overview of “Unobtrusive CSS”. He made the case for using tools like Compass and Sass to build CSS stylesheets cleaner, quicker, and with less fuss. &lt;a href="http://compass-style.org/"&gt;Compass&lt;/a&gt; is a framework built on &lt;a href="http://sass-lang.com/"&gt;Sass&lt;/a&gt; that allows for quick CSS authoring using sass-ified CSS Frameworks available through the use of mixins. This in itself is slick. But, you soon realize this is only the start.&lt;/p&gt;
&lt;p&gt;I’ve always been a stickler for detail and concision—in my code and in my design work. CSS presents a problem for me because of necessary IE hacks, cross-browser workarounds, and the general massiveness of a typical CSS document. With Compass/Sass I can eliminate all of these problems by tucking complexity into a mixin and invoking it from my primary Sass document.&lt;/p&gt;
&lt;p&gt;The first problem I wanted to solve was creating beautiful cross-browser CSS buttons with size flexibility and a seamless workflow. This is what I want (ignore the crazy colors):&lt;/p&gt;
&lt;p&gt;&lt;img src="http://media.tumblr.com/tumblr_l0o8tfnjAq1qzb0gv.png"/&gt;&lt;/p&gt;
&lt;p&gt;I had the code from an earlier project (the original CSS was borrowed mostly from work done by the &lt;a href="http://www.filamentgroup.com/lab/update_styling_the_button_element_with_css_sliding_doors_now_with_image_spr/"&gt;Filament Group as shown here&lt;/a&gt;), which looked something like this:&lt;/p&gt;
&lt;blockquote&gt;.sign-up form button.medium { padding: 0 12px 0 0; font-size: 1.2em; text-align: center; background: transparent url(‘../images/grey_36_button.png?1270778569’) no-repeat right -140px; }&lt;/blockquote&gt;
&lt;blockquote&gt;.sign-up form button.medium span { padding: 9px 0 0 12px; height: 27px; background: transparent url(‘../images/grey_36_button.png?1270778569’) no-repeat left top; color: #444444; text-shadow: #dddddd 0px 1px 0px; font-weight: bold; }&lt;/blockquote&gt;
&lt;blockquote&gt;.sign-up form button.medium:hover { background-position: right -210px; }&lt;/blockquote&gt;
&lt;blockquote&gt;.sign-up form button.medium:hover span, .sign-up form button.medium.hover span { background-position: 0 -70px;}&lt;/blockquote&gt;
&lt;p&gt;In terms of CSS, these few lines aren’t too bad. However, I like to layout my sites to a grid, and I have standard font size that I’d like to use. So, for every different button size and style I’d have to figure out the proper padding, margin, and font size using a rubric in my head.&lt;/p&gt;
&lt;p&gt;With Sass I used a little math to do all of this for me. I feed the mixin call the vertical height (in pixels) of my button and Sass spits out the CSS for the perfectly proportioned button. This is all well and good. &lt;em&gt;However, &lt;/em&gt;I like to keep my font size definitions in em units (for &lt;a href="http://www.w3.org/WAI/GL/css2em.htm"&gt;these reasons&lt;/a&gt; among others). Since I’ve made my em unit equal to 12 pixels, I know what I’m working with. This presents a problem because we need to take the button height, which is in pixel units, and determine some appropriate font size, which is in em units. It obviously doesn’t work to do something like:&lt;/p&gt;
&lt;blockquote&gt;!font_size = (!pixel_height / 45px - .4px) * 1em + .8em&lt;/blockquote&gt;
&lt;p&gt;This is because it doesn’t make sense to multiply a physical unit by a relative one. But, we &lt;em&gt;can&lt;/em&gt; make one of the terms of this equation unit agnostic using this little trick:&lt;/p&gt;
&lt;blockquote&gt;!font_size = ((!pixel_height / 45px - .4px) / 1px) * 1em + .8em&lt;/blockquote&gt;
&lt;p&gt;I assume this works because the quotient of the interior term is no longer in any unit. Consider for example, that 10 dogs divided by 2 dogs is 5, not &lt;em&gt;5 dogs&lt;/em&gt;. Basically, the trick is to divide by a value in units that you are converting &lt;em&gt;from&lt;/em&gt;. &lt;/p&gt;
&lt;p&gt;Here is the full listing for my fancy buttons:&lt;/p&gt;
&lt;script src="http://gist.github.com/362199.js"&gt;&lt;/script&gt;&lt;p&gt;Now, with this set up, I can make a button sprite that looks something like this:&lt;/p&gt;
&lt;p&gt;&lt;img src="http://media.tumblr.com/tumblr_l0oa3eEoNW1qzb0gv.png"/&gt;&lt;/p&gt;
&lt;p&gt;And invoke my beautiful button mixin with a single line like so:&lt;/p&gt;
&lt;blockquote&gt;+fancy-button-base&lt;br/&gt;button.large&lt;br/&gt;  +fancy-button-scaled(“grey_45_button.png”, 45px)&lt;/blockquote&gt;

&lt;p&gt;Feel free to use this code in part or in whole. Be sure to let me know if you make something neat. Enjoy!&lt;/p&gt;</description><link>http://drewyeaton.com/post/511108336</link><guid>http://drewyeaton.com/post/511108336</guid><pubDate>Sat, 10 Apr 2010 14:10:07 -0400</pubDate></item><item><title>Python Gowalla API Client</title><description>&lt;p&gt;To commemorate the first version of my Python Gowalla API Client, I’ve created a mock item for it. I plan to make a small intro/how-to page for it, but now I’ll just tease it with this banner.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://github.com/sentineldesign/python-gowalla"&gt;&lt;img src="http://media.tumblr.com/tumblr_ky8545ciZF1qzb0gv.png"/&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;If you haven’t already, check out the client here:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://github.com/sentineldesign/python-gowalla"&gt;http://github.com/sentineldesign/python-gowalla&lt;/a&gt;&lt;/p&gt;</description><link>http://drewyeaton.com/post/404108623</link><guid>http://drewyeaton.com/post/404108623</guid><pubDate>Sun, 21 Feb 2010 22:46:15 -0500</pubDate></item><item><title>Box Model Study</title><description>&lt;p&gt;After looking at a the instruction manual for a Lego set, I got an idea for representing the peculiarities of the standard and Internet Explorer 6 box models. These will be used in a  CSS “anti-framework” I’m developing. More on that soon, but for now, here are my box model diagrams.&lt;/p&gt;
&lt;p&gt;The layers represent the stacking order of each element (something other diagrams come close at representing, but aren’t nearly as detailed at portraying).&lt;/p&gt;
&lt;p&gt;Standard box model:&lt;/p&gt;
&lt;p&gt;&lt;img src="http://media.tumblr.com/tumblr_ky83jk5oXa1qzb0gv.png"/&gt;&lt;/p&gt;
&lt;p&gt;Internet Explorer 6 box model:&lt;/p&gt;
&lt;p&gt;&lt;img src="http://media.tumblr.com/tumblr_ky83kbllS21qzb0gv.png"/&gt;&lt;/p&gt;

&lt;p&gt;If you would like to use these, be sure to attribute Drew Yeaton (drewyeaton.com) wherever they appear.&lt;/p&gt;</description><link>http://drewyeaton.com/post/404042936</link><guid>http://drewyeaton.com/post/404042936</guid><pubDate>Sun, 21 Feb 2010 22:13:12 -0500</pubDate></item><item><title>Gowalla API out!</title><description>&lt;p&gt;Last week I noticed that the Gowalla site expose some API GET calls that were yet to be announced. So, on the weekend I made a wrapper for these calls in Python and packaged the code up in order to release it on Github.&lt;/p&gt;
&lt;p&gt;So, now that the Gowalla API is &lt;a href="http://gowalla.com/api/explorer#/"&gt;officially out&lt;/a&gt;, I believe I have the first public Python client. :) Check it out here:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://github.com/sentineldesign/python-gowalla"&gt;&lt;a href="http://github.com/sentineldesign/python-gowalla"&gt;http://github.com/sentineldesign/python-gowalla&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;</description><link>http://drewyeaton.com/post/380441746</link><guid>http://drewyeaton.com/post/380441746</guid><pubDate>Tue, 09 Feb 2010 15:30:21 -0500</pubDate></item><item><title>Updated CodeIgniter DB2 driver</title><description>&lt;p&gt;If you fall into the extremely unlikely event where you both need to access DB2 with CodeIgniter and have run into a situation where the latest database driver doesn’t work, I’ve got the fix for you. This may be because you are setting the charset or you require a different port than 664 (50000 being the port used by many for DB2).&lt;/p&gt;
&lt;p&gt;Hence, I have updated the driver to heal all that ails.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://codeigniter.com/wiki/DB2_Database_Driver/"&gt;http://codeigniter.com/wiki/DB2_Database_Driver/&lt;/a&gt;&lt;/p&gt;</description><link>http://drewyeaton.com/post/379101880</link><guid>http://drewyeaton.com/post/379101880</guid><pubDate>Mon, 08 Feb 2010 21:05:00 -0500</pubDate></item><item><title>Why isn't Blueprint (or any other CSS framework) a good idea?</title><description>&lt;p&gt;Let me start by saying I really love the idea of saving time when I design and develop a site—I use all kinds of time savers. Any well thought out system that results in cleaner, more maintainable, simpler code is definitely a good thing. Thusly, I’ve used CSS frameworks in the past to save time building layouts and creating grid-based, standards-compliant websites. So, why isn’t Blueprint (or any other CSS framework) a good idea?&lt;/p&gt;
&lt;p&gt;To answer this question, you must acknowledge that CSS is not a language that can be properly generalized with a conceptual structure. This is the reason why Jeffrey Zeldman writes the words &lt;i&gt;CSS framework&lt;/i&gt; as &lt;i&gt;CSS “framework”&lt;/i&gt;—that is, these things are not really frameworks in any sense of the word. They are (or attemtp to be) a one-size-fits-all stylesheet. Given this, the reason why these “frameworks” are bad is not about the frameworks themselves, it’s about the pattern they force you into.&lt;/p&gt;
&lt;p&gt;What do I mean—ok, take for example a site I launched for Flipswap a few month back. The total time for designing, developing, copywriting, and launching the site was a little over two weeks. We cut out some best practices like IA and an exhaustive comping stage, but also took liberties with the development of the site. To quickly set type and control measure on a wide page, you normally split large chunks of copy into columns, add a sidebar for meta data, and all the usual stuff that makes a page with a lot of copy easy to digest. However, given our short timeline, I setup Blueprint and did my layout with div’s and classes &lt;i&gt;while&lt;/i&gt; marking up the copy. This was a very simple and quick process and we got out some reasonably attractive pages on time. The key here was that I was saving time by doing design/layout &lt;i&gt;while&lt;/i&gt; I was writing the markup. I was mixing my content layer (HTML markup) and presentation layer (CSS).&lt;/p&gt;
&lt;p&gt;What I had done was paint myself into a veritable corner. That is, I had ignored the good natured sensible me that would markup the copy with semantically sounding classes and ids in favor of a me that was essentially creating a table layout. &lt;i&gt;This is the pattern that Blueprint and other CSS frameworks force you into.&lt;/i&gt; When it comes time to redesign or reuse pages for a future site, I will have to redo everything over again. That’s not so much a timesaver as it is a pain in the ass. For the sake of clarity, here’s some example HTML to illustrate my point:&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Valid, standards-compliant Blueprint framework-based layout&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;&lt;div class=”span-20”&gt;     &lt;div class=”column span-10”&gt;         &lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipisicing elit.&lt;/p&gt;     &lt;/div&gt;     &lt;div class=”column span-10 last”&gt;         &lt;p&gt;Iqui officia deserunt mollit anim id est laborum.&lt;/p&gt;     &lt;/div&gt; &lt;/div&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Valid, standards-compliant table-based layout&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;&lt;table width=”200”&gt; &lt;tr&gt;     &lt;td width=”100”&gt;         &lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipisicing elit.&lt;/p&gt;     &lt;/td&gt;     &lt;td width=”100”&gt;         &lt;p&gt;Iqui officia deserunt mollit anim id est laborum.&lt;/p&gt;     &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt;&lt;/p&gt;
&lt;p&gt;Honestly, what’s the difference between these two things? Both have no content/presentation separation and no semantic markup. When you design with a CSS “framework” you may as well design with tables. Welcome to 1997, how does it feel?&lt;/p&gt;
&lt;p&gt;So, what could a CSS framework be good for? It’s good for the one scenario where you are using a CMS and you have no control over your CSS, you can handcraft your non-semantic HTML by hand, and you never-ever plan to redesign or repurpose your content in an altered form. And that’s it.&lt;/p&gt;</description><link>http://drewyeaton.com/post/307574750</link><guid>http://drewyeaton.com/post/307574750</guid><pubDate>Wed, 30 Dec 2009 02:07:00 -0500</pubDate></item><item><title>SDG + Typekit</title><description>&lt;p&gt;Last night I did some regiggering to the &lt;a href="http://sentineldesign.net/"&gt;Sentinel Design Group&lt;/a&gt; site in order to do a bigger redesign quicker and easier in the next few days. Part of that process was upgrading to &lt;a href="http://nanoc.stoneship.org/"&gt;Nanoc 3&lt;/a&gt;, a Ruby-based CMS that generates flat HTML. It’s a pretty simple concept—one that you wouldn’t think is all that helpful—but it really speeds up development.&lt;/p&gt;
&lt;p&gt;The interesting part, though, is that I finally added some &lt;a href="http://typekit.com/"&gt;Typekit&lt;/a&gt; flavor to my copy. I’m a sucker for well-designed, subdued style type, and Typekit finally added a bunch of this from the FontFont type foundry.&lt;/p&gt;
&lt;p&gt;For the headings I’m using FF Meta Small Caps Web Pro and for the body copy I chose FF Meta Serif Web Pro.&lt;/p&gt;
&lt;p&gt;&lt;i&gt;&lt;b&gt;Before:&lt;/b&gt;&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="http://media.tumblr.com/tumblr_kug4v3kf1U1qzb0gv.png"/&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;&lt;i&gt;After:&lt;/i&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://sentineldesign.net/"&gt;&lt;img src="http://media.tumblr.com/tumblr_kug4vniQlF1qzb0gv.png"/&gt;&lt;/a&gt;&lt;/p&gt;</description><link>http://drewyeaton.com/post/277710124</link><guid>http://drewyeaton.com/post/277710124</guid><pubDate>Thu, 10 Dec 2009 12:07:00 -0500</pubDate></item><item><title>The Angry Crowd Strikes Again</title><description>&lt;p&gt;While I was checking out this slick email marketing site &lt;a href="http://www.mailchimp.com/"&gt;Mail Chimp&lt;/a&gt;, I noticed something rather peculiar—the crowd behind the chimp looked uncannily similar to something I’d produced a few years back. I thought for sure they had somehow dug into my discarded pile of Flipswap comps and gleaned a piece of my work. But, alas, it turns out even though there is a likeness, no wrongs have been committed.&lt;/p&gt;
&lt;p&gt;I’m kidding of course. But, check it out for yourself. Here’s an unused development comp from April 7, 2007. &lt;i&gt;(Avert your eyes from the hideous Arial Rounded MT Bold, it was the company’s standard type at the time.)&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="http://media.tumblr.com/tumblr_kueuycwdjg1qzb0gv.png"/&gt;&lt;/p&gt;
&lt;p&gt;Now, here’s a very similar angry crowd almost two years later:&lt;/p&gt;
&lt;p&gt;&lt;img src="http://media.tumblr.com/tumblr_kuev05qRld1qzb0gv.png"/&gt;&lt;/p&gt;
&lt;p&gt;And the crowd sans-chimp:&lt;/p&gt;
&lt;p&gt;&lt;img src="http://media.tumblr.com/tumblr_kuev2cEPWA1qzb0gv.png"/&gt;&lt;/p&gt;
&lt;p&gt;By the way Mail Chimp, if you want to pay me back for the artwork that you didn’t steal, I’d totally love to get my hands on that $240 plan for the sweet price of free. Wha’dya say?&lt;/p&gt;</description><link>http://drewyeaton.com/post/276770314</link><guid>http://drewyeaton.com/post/276770314</guid><pubDate>Wed, 09 Dec 2009 19:39:00 -0500</pubDate></item><item><title>MuseoWatch 2009</title><description>&lt;p&gt;Whenever I recognize a font that I’ve used before, I immediately develop an irrevocable hatred for it. The latest recipient of this maddening dislike is &lt;a href="http://www.josbuivenga.demon.nl/museo.html"&gt;exljbris Font Foundry&lt;/a&gt;’s Museo, an organically-seriffed typeface that I used in the last revision of the Flipswap site. A specimen:&lt;/p&gt;
&lt;p&gt;&lt;img src="http://media.tumblr.com/tumblr_ku9oul0VoD1qzb0gv.gif"/&gt;&lt;/p&gt;
&lt;p&gt;See, here’s how I used it:&lt;/p&gt;
&lt;p&gt;&lt;img src="http://media.tumblr.com/tumblr_ku9on0KqY01qzb0gv.png"/&gt;&lt;/p&gt;
&lt;p&gt;The problem came when I saw these two sites last week. These two services look very interesting, but why must they ruin this font for me. I mean, for the love of god, it was free &lt;i&gt;and&lt;/i&gt; good. Exhibits A &amp; B here:&lt;/p&gt;
&lt;p&gt;&lt;img src="http://media.tumblr.com/tumblr_ku9ovnV9Fm1qzb0gv.png"/&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="http://media.tumblr.com/tumblr_ku9ow1ffKs1qzb0gv.png"/&gt;&lt;/p&gt;
&lt;p&gt;By the way, if one of you guys from &lt;a href="http://simplegeo.com/"&gt;SimpleGeo&lt;/a&gt; could pass me some love in the form of a Beta account, I’ll consider it payment for the beta apps I helped test for CrashCorp. He he he.&lt;/p&gt;</description><link>http://drewyeaton.com/post/272801091</link><guid>http://drewyeaton.com/post/272801091</guid><pubDate>Mon, 07 Dec 2009 00:36:00 -0500</pubDate></item><item><title>WordPress Title Trickery</title><description>&lt;p&gt;Here is a bit of the code we’re using on a new site redesign. We needed a custom, more descriptive title on certain pages.&lt;/p&gt;
&lt;p&gt;It grabs a title from a custom field if you set one, or just gets the page title if you don’t. Also, since WP doesn’t display the page’s title if you’re on the homepage, we’ll grab custom text from the site’s description (which we don’t use for anything else).&lt;/p&gt;
&lt;pre&gt;&lt;title&gt;
&lt;?php 
	$sep = ’ | ‘;
	$site = get_bloginfo(‘name’);
	
	if(!$title = get_post_meta($post-&gt;ID, ‘title’, TRUE)) {&lt;br/&gt;		// we need this because page title&lt;br/&gt;		// isn’t shown when on homepage
		if(is_front_page() || is_home())
			$title = get_bloginfo(‘description’);
		else
			$title = wp_title(”, FALSE, ‘right’);
	}

	echo($title.$sep.$site);
?&gt;
&lt;/title&gt;&lt;/pre&gt;
&lt;p&gt;
&lt;script type="text/javascript"&gt;&lt;/script&gt;&lt;/p&gt;</description><link>http://drewyeaton.com/post/265415113</link><guid>http://drewyeaton.com/post/265415113</guid><pubDate>Tue, 01 Dec 2009 18:16:00 -0500</pubDate></item><item><title>
Ok people, this is what happens when you don’t have HIG (human interface guidelines) for your...</title><description>&lt;p&gt;&lt;img height="48" width="48" src="http://code.google.com/android/adc/images/whatthedoodle.png" align="right"/&gt;&lt;/p&gt;
&lt;p&gt;Ok people, this is what happens when you don’t have HIG (human interface guidelines) for your platform. These &lt;a href="http://code.google.com/android/adc/gallery_winners.html"&gt;Android Developer Challenge&lt;/a&gt; entries represent a core sample of the &lt;i&gt;best&lt;/i&gt; applications Android has to offer.&lt;/p&gt;
&lt;p&gt;Based on the icons alone, it is clear what kind of junkiness you can expect in app they represent. This kind of stuff is endemic in the open source community.&lt;/p&gt;
&lt;p&gt;&lt;img height="48" width="48" src="http://code.google.com/android/adc/images/wordpuzzle.png"/&gt;&lt;img height="48" width="48" src="http://code.google.com/android/adc/images/celeste.png"/&gt;&lt;img height="48" width="48" src="http://code.google.com/android/adc/images/speedforge3d.png"/&gt;&lt;img height="48" width="48" src="http://code.google.com/android/adc/images/hoccer.png"/&gt;&lt;img height="48" width="48" src="http://code.google.com/android/adc/images/caltonhillgpscaddy.png"/&gt;&lt;/p&gt;
&lt;p&gt;Do any of these scream “quality” to you?&lt;/p&gt;</description><link>http://drewyeaton.com/post/265107464</link><guid>http://drewyeaton.com/post/265107464</guid><pubDate>Tue, 01 Dec 2009 12:58:09 -0500</pubDate></item><item><title>Python: List Comprehension, Closures &amp; Lambda</title><description>&lt;p&gt;The best part of learning is being able to share your knowledge is a way that’s autodidactic &amp; condescending. So, here’s a little (possibly obvious) nugget I came up with for using list comprehension, closures &amp; lambda.&lt;/p&gt;
&lt;p&gt;My problem: &lt;i&gt;How do I take a list of n-dimensional coordinates, and make a list of just one of the coordinates?&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;You could do it like this with list comprehension:&lt;/p&gt;
&lt;p&gt;&lt;code&gt; lst = [ [0, 1],[1, 3],[2, -1],[3, 4],[4, 7] ]&lt;br/&gt;print [y for x, y in lst] # prints [1, 3, -1, 4, 7]&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;But that’s lame and we have that ugly thing for every coord we need. How about using a closure to make it more general, like this:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;# here we're making a function that makes a function&lt;br/&gt;# using 'i' as a way to "customize it". this is a closure.&lt;br/&gt;def get_coord_factory(i):&lt;br/&gt; def get_coord(lst):&lt;br/&gt; return [coords[i] for coords in lst]&lt;br/&gt; return get_coord&lt;br/&gt;&lt;br/&gt;# make a customized function that only returns &lt;br/&gt;# the x coordinate. we would make one of these for&lt;br/&gt;# y and z too and reuse them. &lt;br/&gt;get_x_coord = get_coord_factory(0) &lt;br/&gt;print get_x_coord(lst) # prints [0, 1, 2, 3, 4]&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;But wait, in our closure we have a one line function with no statements and one expression. &lt;i&gt;Sounds like a lambda function to me. &lt;/i&gt;Let’s rewrite that factory to use a lambda:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;def get_coord_factory(i):&lt;br/&gt; return lambda lst: [coords[i] for coords in lst]&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Ok, so there you have it, we’ve combined these three nifty features into something that’s useful and entertaining. Here’s the full listing:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;lst = [ [0, 1],[1, 3],[2, -1],[3, 4],[4, 7] ]&lt;br/&gt;&lt;br/&gt;def get_coord_factory(i):&lt;br/&gt; return lambda lst: [coords[i] for coords in lst]&lt;br/&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;get_x_coord = get_coord_factory(0)&lt;br/&gt;print get_x_coord(lst) # prints [0, 1, 2, 3, 4]&lt;/code&gt;&lt;/p&gt;</description><link>http://drewyeaton.com/post/258413442</link><guid>http://drewyeaton.com/post/258413442</guid><pubDate>Thu, 26 Nov 2009 12:02:00 -0500</pubDate></item><item><title>More on Push</title><description>&lt;p&gt;I just came across &lt;a href="http://prowl.weks.net/"&gt;this little iPhone app&lt;/a&gt; that displays Growl notifications on your phone that originate from your computer’s Growl-compliant app. It’s called Prowl, and it’s exactly what I had in mind when I wrote &lt;a href="http://drewyeaton.com/post/128542438/think-about-push-in-a-different-way"&gt;my little piece&lt;/a&gt; on iPhone Push notification two weeks ago.&lt;/p&gt;
&lt;p&gt;Had Apple chosen to allow 3rd party background apps in favor of its notification service, this kind of thing would’ve been a near impossibility—not for the technical piece that lives on the iPhone, but the huge amount of potential bandwidth and complex infrastructure from the building a service from scratch. Furthermore, it would be &lt;i&gt;Apple&lt;/i&gt; with the device that has a &lt;a href="http://arstechnica.com/gadgets/news/2009/07/taking-flight-why-the-iphone-still-beats-pre-for-air-travel.ars"&gt;battery capacity problem&lt;/a&gt;. That’s not really the point though.&lt;/p&gt;</description><link>http://drewyeaton.com/post/137752040</link><guid>http://drewyeaton.com/post/137752040</guid><pubDate>Wed, 08 Jul 2009 10:12:00 -0400</pubDate><category>iphone</category></item><item><title>Poor Man's Guide: Deployment with Git (and GitHub)</title><description>&lt;p&gt;&lt;img height="103" width="189" src="http://farm3.static.flickr.com/2520/3692322741_d6393fc985.jpg?v=0" align="right" vspace="15" hspace="15"/&gt;Git is one of those things that when you learn it, you start looking for reasons to use it. I would describe it as frictionless version control. Although the king of nerdy, abrasive verbosity, Linus Torvalds &lt;a href="http://www.youtube.com/watch?v=4XpnKHJAok8"&gt;explains it as really just a filesystem&lt;/a&gt;—it’s the way that you use it, through its minimal, command-line interface that makes Git so efficient.&lt;/p&gt;
&lt;p&gt;The technical stuff I’m not great at, so use the &lt;a href="http://git-scm.com/download"&gt;these guides&lt;/a&gt; for installation. Also, check out this &lt;a href="http://spheredev.org/wiki/Git_for_the_lazy"&gt;radical guide for getting started&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;So, I use Git for all my personal projects and a few things at Flipswap. But, occasionally I have a need to deploy my work to a live server. I have a &lt;a href="http://github.com/"&gt;GitHub&lt;/a&gt; account so my hosted repository needs are taken care of, but I have yet to see a simple script that outlines how you’d actually do a deployment with Git. In hindsight, that’s probably because it’s so easy. Take a gander.&lt;/p&gt;
&lt;p&gt;I have a shell script in a directory outside of my httpdocs directory called “private”. The script pulls in any updates from the repo hosted on GitHub into my “site” directory (which is below the “private” directory). Then copies everything sans hidden files (including the actual git files) to my “httpdocs” directory. The script looks like this:&lt;/p&gt;
&lt;blockquote&gt;echo “Updating…”&lt;br/&gt;cd site&lt;br/&gt;git pull&lt;br/&gt;echo “Copying…”&lt;br/&gt;rm -rf ../../httpdocs/*&lt;br/&gt;cp -rf * ../../httpdocs/&lt;br/&gt;# do any permission changes here…&lt;br/&gt;# chmod 777 ../../httpdocs/system/cache&lt;br/&gt;echo “Done.”&lt;/blockquote&gt;</description><link>http://drewyeaton.com/post/137083044</link><guid>http://drewyeaton.com/post/137083044</guid><pubDate>Tue, 07 Jul 2009 10:00:00 -0400</pubDate><category>programming</category><category>poor man's guide</category><category>git</category></item><item><title>Poor Man's Guide: Twitter Integration</title><description>&lt;p&gt;I was just researching quick ways to integrate a one of my latest Flipswap projects with Twitter when I ran across this obvious, yet non-obvious thing. You can construct a URL that pre-populates the update field with any text you like. It works like this (click it for full affect/effect):&lt;/p&gt;
&lt;blockquote&gt;&lt;a href="http://twitter.com/home?status=Yeatblog+rocks+my+face+off."&gt;&lt;a href="http://twitter.com/home?status=Yeatblog+rocks+my+face+off."&gt;http://twitter.com/home?status=Yeatblog+rocks+my+face+off.&lt;/a&gt;&lt;/a&gt;&lt;/blockquote&gt;
&lt;p&gt;The craziest thing about this “discovery” is that a &lt;a href="http://www.google.com/search?q=post+to+twitter"&gt;search on Google for “post to twitter”&lt;/a&gt; yields exactly what you need to know in the results.&lt;/p&gt;</description><link>http://drewyeaton.com/post/136461810</link><guid>http://drewyeaton.com/post/136461810</guid><pubDate>Mon, 06 Jul 2009 11:13:00 -0400</pubDate><category>poor man's guide</category><category>web</category><category>twitter</category><category>programming</category></item><item><title>Autocross Wrap-up</title><description>&lt;p&gt;Autocrossed today with Maggie in tow. We had a lot of fun and met some cool people. I’m left with some disappointment though—seems like this time I didn’t get a chance to learn something. Ninety-six cars ran today which only gave time for four 50s runs through the course. That’s one or two laps to “learn” the course and a few to try to get competitive time. The standaround-to-driving time ratio is about 75-1. That is, wait around and “work” for 5 hours and drive for about 4 minutes.&lt;/p&gt;
&lt;p&gt;&lt;img height="375" width="500" src="http://farm4.static.flickr.com/3617/3692231035_7b62947770_o.jpg"/&gt;&lt;/p&gt;
&lt;p&gt;Anyway, had a great time and talked up Flipswap. It was a success (especially since I didn’t have the slowest time of the day this time.) Leaving you with some shots courtesy of Adam and his scooter wielding wife. Great people.&lt;/p&gt;
&lt;p&gt;&lt;img height="375" width="500" src="http://farm4.static.flickr.com/3631/3692231041_a66a28fb71_o.jpg"/&gt;&lt;/p&gt;
&lt;p&gt;&lt;img height="375" width="500" src="http://farm4.static.flickr.com/3642/3692231047_38ecdb995e_o.jpg"/&gt;&lt;/p&gt;
&lt;p&gt;Much thanks to &lt;a href="http://www.flipswap.com/"&gt;Flipswap&lt;/a&gt; for paying for my entry, numbers, and livery. No more car talk for a while. Who knows what will happen this week.&lt;/p&gt;</description><link>http://drewyeaton.com/post/136182720</link><guid>http://drewyeaton.com/post/136182720</guid><pubDate>Sun, 05 Jul 2009 23:48:00 -0400</pubDate></item><item><title>These Jeans Died for Our Freedom</title><description>&lt;p&gt;&lt;img height="549" width="500" src="http://farm3.static.flickr.com/2617/3678087193_689c8c9bcf_o.jpg"/&gt;&lt;/p&gt;
&lt;p&gt;Checkout even more &lt;a href="http://awkwardfamilyphotos.com/"&gt;radical family photos&lt;/a&gt;. Happy 4th of July internet.&lt;/p&gt;</description><link>http://drewyeaton.com/post/135131394</link><guid>http://drewyeaton.com/post/135131394</guid><pubDate>Sat, 04 Jul 2009 00:01:14 -0400</pubDate></item><item><title>Last Sunday I mentioned this unbelievable cross-country trip by...</title><description>&lt;object width="400" height="336"&gt;&lt;param name="movie" value="http://www.youtube.com/v/2pImIwAQcrI&amp;rel=0&amp;egm=0&amp;showinfo=0&amp;fs=1"&gt;&lt;/param&gt;&lt;param name="wmode" value="transparent"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/2pImIwAQcrI&amp;rel=0&amp;egm=0&amp;showinfo=0&amp;fs=1" type="application/x-shockwave-flash" width="400" height="336" allowFullScreen="true" wmode="transparent"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;Last Sunday I mentioned this unbelievable cross-country trip by Team Polizei completed in 32 hours, 7 minutes. This clip is what I imagine the entire trip was like—white knuckle driving punctuated by chatter about police officers.&lt;/p&gt;
&lt;p&gt;According to &lt;a href="http://www23.wolframalpha.com/input/?i=distance+between+new+york%2C+ny+to+los+angeles%2C+ca"&gt;Wolfram|Alpha&lt;/a&gt;, they were traveling an &lt;i&gt;average&lt;/i&gt; of 0.1 times the &lt;i&gt;speed of sound &lt;/i&gt;(or 76.65 miles per hour).&lt;/p&gt;</description><link>http://drewyeaton.com/post/134795255</link><guid>http://drewyeaton.com/post/134795255</guid><pubDate>Fri, 03 Jul 2009 10:38:00 -0400</pubDate></item><item><title>Tale of the Tape</title><description>&lt;p&gt;Regarding my upcoming autocross event at GVSU in a newly sponsored BMW, I thought it would be interesting to compare technical stats from my first autocross at WMAA.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Event&lt;/b&gt;&lt;br/&gt;&lt;i&gt; Then:&lt;/i&gt; WMAA Autocross, May 17th, 2009&lt;br/&gt;&lt;i&gt;Now:&lt;/i&gt; GVSU Autocross, July 5th, 2009&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Vehicle&lt;/b&gt;&lt;br/&gt;&lt;i&gt;Then:&lt;/i&gt; 1985 BMW 318i (E30)&lt;br/&gt;&lt;i&gt;Now:&lt;/i&gt; 2002 BMW 330ci (E46)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Classification&lt;/b&gt;&lt;br/&gt;&lt;i&gt;Then:&lt;/i&gt; HS (H Stock)&lt;br/&gt;&lt;i&gt;Now:&lt;/i&gt; DSP (D Street Prepared)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Vehicle Horspower &amp; Torque&lt;/b&gt;&lt;br/&gt;&lt;i&gt;Then:&lt;/i&gt; 101/103&lt;br/&gt;&lt;i&gt;Now:&lt;/i&gt; 225/215&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Vehicle Weight&lt;/b&gt;&lt;br/&gt;&lt;i&gt;Then:&lt;/i&gt; 2395 lbs.&lt;br/&gt;&lt;i&gt;Now:&lt;/i&gt; 3318 lbs.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Vehicle Acceleration 0-100 km/h&lt;/b&gt;&lt;br/&gt;&lt;i&gt;Then:&lt;/i&gt; 11.4 s&lt;br/&gt;&lt;i&gt;Now:&lt;/i&gt; 6.3 s&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Driver&lt;/b&gt;&lt;br/&gt;&lt;i&gt;Then:&lt;/i&gt; Drew Yeaton&lt;br/&gt;&lt;i&gt;Now:&lt;/i&gt; Drew Yeaton&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Experience&lt;/b&gt;&lt;br/&gt;&lt;i&gt;Then:&lt;/i&gt; None&lt;br/&gt;&lt;i&gt;Now:&lt;/i&gt; Some&lt;/p&gt;</description><link>http://drewyeaton.com/post/134187494</link><guid>http://drewyeaton.com/post/134187494</guid><pubDate>Thu, 02 Jul 2009 11:09:00 -0400</pubDate><category>BMW</category><category>autocross</category><category>racing</category></item></channel></rss>
