<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><atom:link rel="hub" href="http://tumblr.superfeedr.com/" xmlns:atom="http://www.w3.org/2005/Atom"/><description>CTO at Twitpic and Heello. I like ridiculous situations, insane sports, skiing, hang gliding, NoSQL, and sports cars.</description><title>Steve Corona's Blog</title><generator>Tumblr (3.0; @stevecorona)</generator><link>http://stevecorona.com/</link><item><title>How I trained for a half-marathon in 34 days</title><description>&lt;p&gt;July 10 2010. I had no idea that in exactly 34 days, I’d find myself in the middle of the wilderness, pounding 13.1 miles of pavement to finish my first half-marathon. And it all started with a phone call from Justin-&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;“Hey Steve, Want to go for a run? I need to get my ass in shape”.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It wasn’t my first time running, but I wasn’t in incredible shape either- I’d been running on-and-off for about 6 years. High school cross country for all 4 years of glory, on and off during college, but never as more than a 3-miler-middle-of-the-pack kind of guy. Actually, middle-of-the-pack was probably a compliment for me. I never though I’d see what the end of mile 6 looked like, let alone mile 13.&lt;/p&gt;

&lt;p&gt;Justin was an virgin runner and in decent shape for a 26 year old- probably better shape than me, anyways. We started off doing 3 miles, 4 or 5 times a week. There was no plan, besides a 4:45pm text- “loop in 15?”- the loop referring to a 3 mile circuit around RIT, the college that we’d both gone to.&lt;/p&gt;

&lt;p&gt;It was exhausting. Two amateur runners logging 15 miles a week, far above what we should have been doing at the time. It was obvious by just looking at my feet- I was wearing &lt;a href="http://www.vibramfivefingers.com/products/Five-Fingers-Sprint-Womens.htm"&gt;Vibram Sprint’s&lt;/a&gt; and had a never-ending minefield of blisters. One would heal, another would sprout. It hurt to walk. To move. I pushed through the pain with extra socks and duck tape. This was not your mother’s couch-to-5k.&lt;/p&gt;

&lt;h3&gt;Cross training and hangovers&lt;/h3&gt;

&lt;p&gt;We’d cross-train by cycling on days that we were too exhausted to run. Except we didn’t know it was called cross-training. We had these crappy stainless-steel mountain bikes from Wal-Mart that weighed what had to be 50 pounds- but we’d go out on 2AM summer bike rides down the erie canal with headlamps on, logging in 20 to 30 miles at a clip.&lt;/p&gt;

&lt;p&gt;You’d think the hungover mornings would be the days we were least likely to run, but the opposite actually happened. Hangovers were the perfect catalyst for putting in extra miles- I guess subconsciously we were trying to outrun the damage we’d done the night before. And boy was there damage to undo- nightly post-run hydration always happened at the bar.&lt;/p&gt;

&lt;p&gt;In two weeks, we were pounding out 6 miles. In another two weeks, 9 miles almost everyday. Two amateurs, logging 45 miles per week. The body is an amazing machine- it can make incredible changes, restructuring itself in an incredibly short amount of time. I think I lost about 20 pounds during these 4 weeks, but it didn’t matter- all I cared about was the running, and I wasn’t doing it for the weight loss. It was pure, and everything else was gravy.&lt;/p&gt;

&lt;h3&gt;Methodical Meditation&lt;/h3&gt;

&lt;p&gt;Since we were running on a 3 mile loop, it was an all-or-nothing deal- you ran in increments of 3 whether you wanted to or not. Once you hit mile 4, there was no turning back. The bump from 3 to 6 was probably the hardest- after mile 5 you’re counting every step until you can stop moving your body. Going from 6 to 9 wasn’t nearly as difficult. It just sort of happened one day- we were getting close to the second time around our beloved loop and shared a mutual nod. We kept going without saying a word.&lt;/p&gt;

&lt;p&gt;The running was methodical and meditating. We ran steady 9 minute miles, from day 1 on. This pace was never deviated from- it was our “granny gear”- the fastest we could go without burning out putting in those kind of miles. When you dedicated 2 hours a night to running, everything else seems to fade out and lose focus- running becomes all you think about at work and it’s all you talk about. Soon, we began doubling up on running and cycling- 9 miles of pavement pounding followed by 20 miles spinning pedals.&lt;/p&gt;

&lt;p&gt;I was hooked. And everyone thought we were crazy. But what’s crazy about doing something obsessively when you love it?&lt;/p&gt;

&lt;p&gt;Even though we could kill 9 miles, a full 13.1 still seemed outragous. We needed a big realization and we found it in the form of mid-run snacks- some dried pineapple or mango slices at mile 6 could change your entire day. It was eye opening and put 13.1 in our sights.&lt;/p&gt;

&lt;h3&gt;Judgement Day&lt;/h3&gt;

&lt;p&gt;On August 22, 2010 I made a ridiculous decision that I would try a half-marathon the next day. My journal entry reads-&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;“This weekend was a mess, ate like garbage. Thinking about running a half marathon tomorrow, I must be insane”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It was a cool summer evening, probably around 6pm when I headed out on the Lehigh Valley Trail on a mission to return back to my car a half-marathoner. I was wearing a camel bak loaded with 2L of gatoraid, a handful of goos, and a headlamp. The trail was 15 miles of flat, converted railroad track through a stretch of woods, so I could run straight out and straight back.&lt;/p&gt;

&lt;p&gt;I made it out to the halfway point without too much trouble. Was I actually doing this? Scarfed down some energy gels and headed back in the opposite direction. At around mile 8 the sun began to set- now it was a race to make it back to my car before it got dark. At mile 10, the sun faded and darkness joined me for the rest of the run. I slapped on my headlamp without skipping a beat and carried on.&lt;/p&gt;

&lt;p&gt;If you’ve never run with a headlamp on, boy is it interesting. You really can’t see well- either you aim it at your feet and can only make out about 2 feet ahead or you aim it into the distance- trading good visibility for having no idea what the hell is directly in front of you.&lt;/p&gt;

&lt;p&gt;I ran the last 3, miserable, miles with the headlamp strapped to my forehead, rubbing uncomfortably against my temples. I counted every step. I wanted to stop, I wanted it to be over, but there was no choice- if I wanted to get back to my car, I had to push through and dig. And, 2 hours and 24 minutes after starting, I made it back to my Corolla with a new notch on my belt.&lt;/p&gt;

&lt;p&gt;I called Justin-&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Dude, you’re an idiot. It’s pitch black, you didn’t tell anyone you were going into the woods to run 13 miles and didn’t bring your phone? And asshole, you didn’t invite me?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;We ran one together 6 days later.&lt;/p&gt;

&lt;h3&gt;Diet&lt;/h3&gt;

&lt;p&gt;I was on a Vegan kick during these 34 days (and for a month or two after). Don’t ask me why.. there was a girl.. whatever. I’m mentioning it because I was a bad vegan and pretty much subsided on nothing but bananas, kidney beans and dark chocolate almond milk. I blame the garbage truck load of carbs I was eating on pushing me through the training. Beer was (is?) also an essential daily vitamin in my life.&lt;/p&gt;

&lt;h3&gt;Notes and Gotchas&lt;/h3&gt;

&lt;p&gt;Going from virgin to half marathoner like this is stupid and insane. I’m not a doctor or personal trainer, and I’m lucky that I didn’t blow out my knees, destroy my shins, or get my kidney’s stolen in the woods. Don’t copy me!&lt;/p&gt;

&lt;p&gt;I ran my first marathon exactly 1 year after my first half, August 23, 2011. It sucked. I’m training for another one this spring.&lt;/p&gt;

&lt;p&gt;Mid-run snacks should be simple carbs. We were really inspired by &lt;a href="http://www.ultramarathonman.com/web/"&gt;Ultramarathon Man Dean Karnazes&lt;/a&gt; and tried to eat &lt;a href="http://media.tumblr.com/tumblr_lye8p21eVH1r2cqbr.jpg"&gt;greasy slices of pizza&lt;/a&gt; in the middle of 16 mile run. This did not end gracefully.&lt;/p&gt;</description><link>http://stevecorona.com/post/16511841380</link><guid>http://stevecorona.com/post/16511841380</guid><pubDate>Thu, 26 Jan 2012 01:33:00 -0500</pubDate></item><item><title>SOPA is bad, mkay? Stop American Censorship.</title><description>&lt;a href="http://americancensorship.org/"&gt;SOPA is bad, mkay? Stop American Censorship.&lt;/a&gt;</description><link>http://stevecorona.com/post/16102760904</link><guid>http://stevecorona.com/post/16102760904</guid><pubDate>Thu, 19 Jan 2012 00:00:00 -0500</pubDate></item><item><title>Resolutions are crash dieting for goals</title><description>&lt;p&gt;Ever go to the gym during the first week of January? It’s &lt;em&gt;packed&lt;/em&gt;; but go back 2 weeks later it’s a ghost town again. Okay, not everyone fails at their resolutions, but some quick googling says that 80% of &lt;em&gt;resolutionistas&lt;/em&gt; give up on their big, life changing resolution by January 20th.&lt;/p&gt;

&lt;p&gt;Now, I know you shouldn’t believe everything that you read on the internet, but I’m inclined the believe that stat. Resolutions are like a joke that you play on yourself every year. “This year will be different! I’ll lose that 20 pounds”&lt;/p&gt;

&lt;p&gt;&lt;img src="http://media.tumblr.com/tumblr_lx3eciZjuy1r2cqbr.png" alt=""/&gt;&lt;/p&gt;

&lt;h3&gt;Don’t make resolutions&lt;/h3&gt;

&lt;p&gt;I haven’t made a New Years Resolution in 4 years- instead, I’ve created a more realistic “yearly goal” system that I think works quite well.&lt;/p&gt;

&lt;h3&gt;It all starts with a self-evaluation&lt;/h3&gt;

&lt;p&gt;Ever year, about a week before Jan 1st, I sit down and write up a self-evaluation of the past year. I create three headings in &lt;a href="http://evernote.com/"&gt;Evernote&lt;/a&gt;- &lt;strong&gt;“Good”&lt;/strong&gt;, &lt;strong&gt;“Bad”&lt;/strong&gt;, and &lt;strong&gt;“Has to Change”&lt;/strong&gt;. These are extremely powerful for both identifying areas of your life that need improvement and for reviewing during years to come. I have 4 years worth of these and it’s incredible to occasional revisit them and concretely see how much I’ve changed course.&lt;/p&gt;

&lt;p&gt;Under the &lt;strong&gt;Good&lt;/strong&gt; section, I write a brief summary of any major positive events that have happened in the past year. “Major” is at your discretion- anything major to &lt;em&gt;you&lt;/em&gt; belongs in this list- it can be something as obvious as moving across the country or something as insignificant as discovering a new type of music (both of those made my list this year). It’s completely up to you.&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;Bad&lt;/strong&gt; section is for writing any big negative things that happened in your life this year. It doesn’t necessary have to be things that you want to change, or even things that you can control changing- write them down regardless.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Has to Change&lt;/strong&gt; is the most important section. Here is where you list anything and everything in your life that you’re not happy with, would like to improve on, or would like to start doing. This will help form the basis of your goals, which I’ll talk about next.&lt;/p&gt;

&lt;h3&gt;Make goals, not resolutions&lt;/h3&gt;

&lt;p&gt;For me, the next part is the most important- I take my goals and work them into the overly cliche &lt;a href="http://en.wikipedia.org/wiki/SMART_criteria"&gt;SMART goals&lt;/a&gt;. Basically, what I want is to turn each “has to change” into a goal  that can reasonably be quantified and measured on a daily basis. A stranger should be able to look at them and answer yes or no about whether you’ve made progress them today. “Start running” is a bad goal. “Build up to running to 30 miles a month” is a good one.&lt;/p&gt;

&lt;p&gt;Next, I break out a sheet of paper and create label for each month. For each goal I have, I come up with a “sub-goal” that can be accomplished in that month. The sub-goals should build on each-other and gradually lead to accomplishing the main goal that you set out on. For example, in January my goal might be to “Run 2 miles, 3 days per week”. In February, “Run 10 miles per week”. So on, and so forth. It’s simple, but it works.&lt;/p&gt;

&lt;p&gt;Essentially, you accomplish your stretch goals by using a Divide and Conquer strategy- you start small and eventually build up to getting what you want. It’s worth saying that the sub-goals can build on each other in other ways than simply increasing intensity as in my running example. As long as the sub-goals make progress to your end goal they can be anything- even if they are seemingly unrelated at first.&lt;/p&gt;</description><link>http://stevecorona.com/post/15105436057</link><guid>http://stevecorona.com/post/15105436057</guid><pubDate>Sat, 31 Dec 2011 19:31:00 -0500</pubDate><category>goals</category><category>resolutions</category><category>productivity</category></item><item><title>Why modern programmers hate PHP</title><description>&lt;p&gt;I’ve been grudgingly using PHP for the last 9 years and in that time I’ve read &lt;em&gt;countless&lt;/em&gt; criticisms and rants about the language. I’ve heard it all- inconsistent parameters, global function cesspool, poor OO support, lack of modern features (and the list goes on). You name it, I’ve heard it, thought it, and sworn at it.&lt;/p&gt;

&lt;p&gt;Everyone loves to hate PHP- and rightfully so, it’s without a doubt an unorganized and poorly designed language- but I think there’s one point which all of the PHP critics are missing.&lt;/p&gt;

&lt;h3&gt;It’s not the language, it’s the tools&lt;/h3&gt;

&lt;p&gt;Raise your hand if you used node.js. That’s great- node is a really cool (and popular) technology. But Javascript is similarly as inelegant as PHP (although, not quite as bad). Why don’t node (and javascript) see as much hate? I’d argue it’s because even though Javascript isn’t the prettiest fish in the sea, it still has a decent set of tools- including a reasonable package manager. But even if PHP did have nice tools (it doesn’t), there isn’t really a great way to share them.&lt;/p&gt;

&lt;h3&gt;But, what about PEAR?&lt;/h3&gt;

&lt;p&gt;PEAR is a fundamentally poor platform for sharing PHP packages. If anything, it’s a place for poorly written code to die. How many packages on PEAR have been published and not maintained? How many are written in using the antiquated PHP4 syntax? The answer is alot. But why is it so bad?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Packages need to be proposed, approved and voted in by committee&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You can’t create something cool and instantly make it available like you can with gem or npm. A skilled programmer isn’t going to waste 5 hours of his time pitching an open-source library to a committee that may or may not turn it down. We have better things to do with our time.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Competing packages are not allowed in PEAR&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Know that rotting PEAR package that’s been sitting untouched for 5 years? Guess what, you can’t submit a similar package. Innovation is fueled by tackling problems in new and interesting ways- build a car, not a faster horse. Oh and no frameworks too.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Packages need to adhere to the &lt;a href="http://pear.php.net/manual/en/standards.php" title="PEAR Coding Standards"&gt;PEAR coding standards&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;And boy are they nitpicky. Don’t even bother if you close your comments the wrong way- your code, which you spent hours refactoring to meet PEAR’s naming and design patterns, will be held back until it meets &lt;em&gt;all&lt;/em&gt; of PEAR’s style guidelines. &lt;strong&gt;Hope you don’t use tabbed indentation, ‘cause that’s not allowed either.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;You need to use their SVN repository&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;npm and gem are pretty much version control and code host agnostic. With PEAR, you &lt;em&gt;have&lt;/em&gt; to use their SVN repository with equally terrible doc viewer and bug tracker. These would have been poor tools in the 90s. In 2012, it’s just embarrassing.&lt;/p&gt;

&lt;h3&gt;Don’t PEAR Channels fix all of that?&lt;/h3&gt;

&lt;p&gt;In the most cut-and-dry sense, they do- you can even use GitHub Pages to publish the XML clusterfuck that makes up a PEAR channel. But it’s fragile and a huge pain in the ass for the package maintainer. Getting new packages means hunting down the correct channels and cross-channel dependencies are a nightmare.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Gem and npm are magical because the path of least resistance is to share your code with the world.&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;So, what’s the solution?&lt;/h3&gt;

&lt;p&gt;PEAR has a new project called &lt;a href="http://pear2.php.net/"&gt;PEAR2/Pyrus&lt;/a&gt; with absolutely no documentation. From what I can tell, it’s the same boat as PEAR but with a prettier face.&lt;/p&gt;

&lt;p&gt;I’ve just heard about a new project called &lt;a href="http://getcomposer.org/"&gt;Composer&lt;/a&gt; (with companion site &lt;a href="http://packagist.org/"&gt;Packagist&lt;/a&gt;) that is a really great start to tackling this problem. The question is- can something like Composer compete when its biggest competitor is backed by the language itself?&lt;/p&gt;</description><link>http://stevecorona.com/post/15009341388</link><guid>http://stevecorona.com/post/15009341388</guid><pubDate>Thu, 29 Dec 2011 23:45:00 -0500</pubDate><category>php</category><category>programming</category></item><item><title>How to use CQL with PHPCassa</title><description>&lt;p&gt;The latest version of &lt;a href="http://cassandra.apache.org/"&gt;Cassandra&lt;/a&gt;, 0.8, includes a really awesome new feature, CQL. If you’re not already familiar with it, CQL is basically a SQL-like syntax for interacting with data in Cassandra. You can find an in depth overview of the CQL syntax at &lt;a href="http://crlog.info/2011/06/13/cassandra-query-language-cql-v1-0-0-updated"&gt;Courtney Robinson’s Blog&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Anyways, since CQL is so bleeding edge, many Cassandra drivers don’t support it yet. This is kind of a bummer since it’s a huge pain in the ass to interact with the Thrift API directly. Luckily, PHPCassa exposes a method to access the raw cassandra client, so it is possible (although, a little hacky) to use CQL with PHPCassa.&lt;/p&gt;

&lt;p&gt;First of all, you absolutely must use the latest version of &lt;a href="https://github.com/thobbs/phpcassa"&gt;PHPCassa from GitHub&lt;/a&gt;. Older versions don’t have the updated Thrift bindings and will not expose the necessary API calls to make CQL work.&lt;/p&gt;

&lt;script src="https://gist.github.com/1351922.js"&gt;&lt;/script&gt;&lt;p&gt;Awesome, but watch out- there are a couple of “gotchas”. First of all, &lt;code&gt;execute_cql_query&lt;/code&gt; returns a &lt;code&gt;cassandra_CqlResult&lt;/code&gt; object, which contains an array of &lt;code&gt;cassandra_CqlRow&lt;/code&gt; objects. Each &lt;code&gt;cassandra_CqlRow&lt;/code&gt; object has an array of &lt;code&gt;cassandra_Column&lt;/code&gt; objects. It’s pretty verbose and not the most convenient format to work with.&lt;/p&gt;

&lt;p&gt;Also, there is no concept of prepared statements yet, although &lt;a href="https://issues.apache.org/jira/browse/CASSANDRA-2475"&gt;CASSANDRA-2475&lt;/a&gt; will address that. Without prepared statements, you absolutely have to make sure you extensively filter and validate your input data for SQL (or, I guess, CQL) injection.&lt;/p&gt;

&lt;p&gt;Even though it’s a little bit of trouble to get working, the effort is totally worth it to use a game changing new feature like CQL right away.&lt;/p&gt;</description><link>http://stevecorona.com/post/12537214283</link><guid>http://stevecorona.com/post/12537214283</guid><pubDate>Mon, 13 Jun 2011 00:00:00 -0400</pubDate><category>cassandra</category><category>nosql</category><category>php</category><category>cql</category><category>phpcassa</category></item></channel></rss>

