<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">

  <title><![CDATA[Tom Ordonez]]></title>
  <link href="http://tomordonez.com/atom.xml" rel="self"/>
  <link href="http://tomordonez.com/"/>
  <updated>2013-05-18T18:09:32-04:00</updated>
  <id>http://tomordonez.com/</id>
  <author>
    <name><![CDATA[Tom Ordonez]]></name>
    
  </author>
  <generator uri="http://octopress.org/">Octopress</generator>

  
  <entry>
    <title type="html"><![CDATA[The Psychology and Human Behavior on Twitter and Linkedin]]></title>
    <link href="http://tomordonez.com/blog/2013/05/15/the-psychology-and-human-behavior-on-twitter-and-linkedin"/>
    <updated>2013-05-15T07:19:00-04:00</updated>
    <id>http://tomordonez.com/blog/2013/05/15/the-psychology-and-human-behavior-on-twitter-and-linkedin</id>
    <content type="html"><![CDATA[<p>Lately I have been interested on psychology, human behavior and what seems to be the new revolution of big data.</p>

<p><img src="http://tomordonez.com/images/big_data_waldo.jpg" alt="Waldo needs Business Intelligence" /></p>

<p>Big data is simply that. Huge amounts of data. It must be good for something right?</p>

<p>A few years ago I met someone in Chicago that worked for United Airlines and his business card said &#8220;Mathematician&#8221;. He explained to me that his job was to analyze data and create formulas to price tickets.</p>

<p>What are the right indicators and variables and what is the correct formula for pricing tickets?</p>

<p><img src="http://tomordonez.com/images/val_kilmer_algorithm.jpg" alt="Val Kilmer what is the correct formula. Please tell me. Please!!!" /></p>

<p>This relates as well to BI, aka Business Intelligence. What are the right ingredients to put on the recipe to make truck loads of money?</p>

<p>How much more or less of an ingredient should I put?</p>

<p>KPI + Big data + BI takes time. It probably takes 1 or 2 people at a small company or startup to be doing that full time every day. It requires a lot of attention to data (detail).</p>

<p>Let&#8217;s look at Linkedin. I recently saw an article on Gizmodo called <a href="http://gizmodo.com/is-linkedin-the-creepiest-social-network-498946693">Is Linkedin the creepiest social network?</a>. What caught my attention was the feature on Linkedin called &#8220;People you may know&#8221; which I will explain with this example.</p>

<p><img src="http://tomordonez.com/images/people_linkedin.jpg" alt="Linkedin wants to become a dating site" /></p>

<p>I was at the Panther Coffee in Miami last week. I saw Peter Martinez and I tweeted something like this &#8220;At Panther Coffee you spot startup celebs like the guy from the Launch Pad&#8221;.</p>

<p>Then I go to Linkedin and under &#8220;People you may know&#8221; there is Peter Martinez.</p>

<p>Is that creepy?</p>

<p>I don&#8217;t think so.</p>

<p>At a Tedtalk someone explained that we have digital tattoos. Every time that we put something online, it will stay there. We could delete something. But &#8220;we&#8221; all know how things can be undeleted it.</p>

<p>How does Linkedin know what we are tweeting?</p>

<p>The Gizmodo article explains more about it. It is related to interconnected apps, human behavior and business intelligence. If you plugin your twitter account to Linkedin. Then Linkedin knows everything you are tweeting and it uses that information to decipher who you should be connected to.</p>

<p>I did some more tests on Twitter&#8230;</p>

<p>I tweeted from Spotify that I was listening to Metal. Since I connected my twitter account to Linkedin. Now Twitter knows everything I listen to. Spotify knows everything I am tweeting. And Linkedin knows all my music tastes.</p>

<p>After tweeting I was listening to Metal I saw dozens of people started to unfollow me (including everybody from Bendyworks).</p>

<p>I went back to Linkedin and it said to connect to Software Engineers in Latin America.</p>

<p>What does that mean?</p>

<p>Maybe&#8230;Software Engineers in Latin America like Metal.</p>

<p><img src="http://tomordonez.com/images/metallica_colombia.jpg" alt="Believe it or not people in Latin America love Metal" /></p>

<p>Another experiment was to make fun of the weather in Chicago.</p>

<p>People that I know there started to unfollow me again.</p>

<p>Mmm interesting. It&#8217;s not only people that you barely know or have never met offline. But also people that you met offline but are not too close with.</p>

<p>My last experiment was a little bit more hardcore. I met somebody (offline) with a PHd in Engineering doing some research in software development.</p>

<p>He tells me that at his company they got an internship program where they bring people without an engineering degree that went through a 3-month crash course in programming (cough cough) and after 3 months in the company they give them titles of Software Engineers.</p>

<p>He complained to the management that they didn&#8217;t deserve this title.</p>

<p><img src="http://tomordonez.com/images/phd_engineer.jpg" alt="He reminded me of this guy" /></p>

<p>I listened with interest his passion explaining to me how he had to endure 8 years of engineering curriculum and that this new trend of 3-month software developers are now called engineers.</p>

<p>I decided to tweet about it. I tweeted something like &#8220;I disagree that people without an engineering degree should have titles like Software Engineers&#8221;. (By the way&#8230;I don&#8217;t agree)</p>

<p>A couple more dozen people unfollowed me.</p>

<p>Some people even replied and said &#8220;Unfollowing you&#8221;. Please follow me back. This was just a test. Whatevs.</p>

<p><img src="http://tomordonez.com/images/unfollower_analysis.jpg" alt="If someone unfollows you don't make a scene, please don't cry" /></p>

<p>People don&#8217;t like confrontations. They either just call you a Troll or just unfollow you.</p>

<p>A few people did reply. And I explained to them the purpose of that tweet.</p>

<p>I went to Linkedin and the &#8220;People you may know&#8221; showed IT Recruiters and someone from Devbootcamp.</p>

<p>Interesting.</p>

<p>How is Linkedin connecting the dots?</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Parenthood Conversations Part 1]]></title>
    <link href="http://tomordonez.com/blog/2013/05/13/parenthood-conversations-part-1"/>
    <updated>2013-05-13T15:12:00-04:00</updated>
    <id>http://tomordonez.com/blog/2013/05/13/parenthood-conversations-part-1</id>
    <content type="html"><![CDATA[<h3>EXT. DRIVING THE CAR AROUND</h3>

<p>Mom is driving the car around. Kid 1 is undecided of what to annoy her mother with. Instead she decides to select the type of music. Kid 2 tries to fall asleep. Mom turns the radio on and Louis Armstrong sings Hello Dolly.</p>

<p>Kid 1, a 2 and a half years old toddler that likes chalk art and iPhone puzzles.</p>

<p><strong>Kid 1</strong></p>

<p>What is this song called?</p>

<p><strong>Mom</strong></p>

<p>I am not sure</p>

<p><strong>Kid 1</strong></p>

<p>This is jaaaaazzzz. Daddy likes jazz because he speaks Spanish. Daddy speaks Spanish, but mommy doesn&#8217;t speak Spanish, and grandma speaks Spanish too. But not you. You don&#8217;t talk in Spanish.</p>

<h3>INT. IN THE HOUSE FOR NAP TIME</h3>

<p>Mom puts Kid 1 for her afternoon nap. She pretends to sleep for 10 minutes and walks out of the room. Mom, upset, ask her to go back to sleep.</p>

<p><strong>Mom</strong></p>

<p>Please go back to sleep. It&#8217;s nap time.</p>

<p><strong>Kid 1</strong></p>

<p>But I want to be by you because I love you.</p>

<p><strong>Mom</strong></p>

<p>(sigh). Okay, if you don&#8217;t want to sleep, you have to rest in your room for a while and you can read books.</p>

<p><strong>Voice</strong></p>

<p>She looks at the book and says</p>

<p><strong>Kid 1</strong></p>

<p>Can you read this to me? I don&#8217;t know how to read yet. I&#8217;m still small.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Miami Tech AntiGroup of Groups]]></title>
    <link href="http://tomordonez.com/blog/2013/05/06/miami-tech-antigroup-of-groups"/>
    <updated>2013-05-06T23:58:00-04:00</updated>
    <id>http://tomordonez.com/blog/2013/05/06/miami-tech-antigroup-of-groups</id>
    <content type="html"><![CDATA[<p>In response to the article on the Miami Herald The Starting Gate post <a href="http://miamiherald.typepad.com/the-starting-gate/2013/05/group-of-groups-issues-call-for-new-members.html">Group of Groups issues call for new members</a> and you are welcome for the yesfollow traffic.</p>

<p>Ok so after Brad Feld coming to Miami, it seems a lot more people want to get involved in &#8220;the scene&#8221;. The objectives are obvious and fair:</p>

<ul>
<li>Invest in companies</li>
<li>Create jobs</li>
<li>Build a startup</li>
<li>Raise money</li>
<li>Meet people</li>
<li>Go to interesting events</li>
<li>Learn from others</li>
</ul>


<p>Whatever your goal is represent group or individual interests.</p>

<p>Now don&#8217;t come and tell me your are Mr (or Ms?) Philanthropy.</p>

<p>If you are in the Miami tech scene. You have a purpose. What&#8217;s my purpose?</p>

<ul>
<li>Meet people. It&#8217;s hard to meet people in Miami when it&#8217;s so spread out. My other choice is go back to school.</li>
<li>Learn from people. I go to meetups to learn people&#8217;s hobbies and passions.</li>
<li>Teach people. I don&#8217;t ask for anything but I usually help or advice people. If there is anything I know that should help them I pass the knowledge.</li>
<li>Invest in people. If there is an idea, project or startup I find interesting to invest I want to put my money there.</li>
<li>Hire people. If there is somebody that fits any of my projects I would like to hire them.</li>
</ul>


<p>When I heard about the Groups of Groups I thought:</p>

<ul>
<li>Another group that wants to plan the future of Miami. Whatever that is.</li>
<li>I hope is open to anybody to participate</li>
<li>I hope is led by somebody who has poured their heart and soul to the community.</li>
</ul>


<p>What I thought would have been candidates to lead this group:</p>

<ul>
<li>Brian Breslin</li>
<li>Andrej Kostresevic</li>
<li>Boris Hirmas and co</li>
<li>Bryce Kerley</li>
<li>Mike Greenberg</li>
</ul>


<p>When I read the article I was surprised that the group is being led by somebody that I never heard before. It&#8217;s fine I guess. I only been (back) in Miami for less than a year. There must be a lot of people that I still don&#8217;t know.</p>

<p>But then the whole thing seems to be exclusive. To join the Group of Groups you have to send an email to this leader and somehow get accepted.</p>

<p>May I remind you how Barcamp started? And I know for a fact that Barcamps have been organized in Miami.</p>

<p>Barcamp is the archenemy of Foocamp.</p>

<p>And I quote <code>Barcamp is a network of user-generated conference (unconference) focused around technology and the web. Barcamp arose an open-to-the-public alternative to FooCamp, an annual invitation-only participant-driven hosted by Tim O'Reilly</code>.</p>

<p>Ok. So listen to the open source freak.</p>

<p>Not an open source freak.</p>

<p>&#8220;Invitation-only&#8221; should strike you.</p>

<p>Invitation-only? WTF</p>

<p>Is this a fraternity?</p>

<p>Why is Miami trying to do the same?</p>

<p>When you read &#8220;a call for new members&#8221; you would think that anybody can participate. But when you email the &#8220;leader&#8221; and his response is:</p>

<p><code>I am not clear from the information you forwarded if you are representing a group of mebers or your individual interests in the promoting the community. Can you please elaborate</code>.</p>

<p>WTF! dude.</p>

<p>Ok I went to your Linkedin profile too just like you saw mine. You have some patents, have done projects, companies. Yes it seems you have a lot of experience and success. I know some other people like you too, which also belong to the <a href="http://www.hanselman.com/blog/DarkMatterDevelopersTheUnseen99.aspx">Dark Matter Developers Group</a>.</p>

<p>How come you are the leader of all groups in Miami.</p>

<p>Who elected you? Yourself? Probably somebody else that I know and forgot to share the information with the public.</p>

<p>But this sounds like self-elected official. This sounds like Cuba and Venezuela.</p>

<p>This sounds Anti-American.</p>

<p>And for some reason anybody that has a different opinion in Miami, that&#8217;s consider trolling. What about we just call it difference of opinions.</p>

<p>Miami.</p>

<p>Let&#8217;s do it the right way.</p>

<p>Let&#8217;s be a democracy.</p>

<p>Let it be open. Let the people participate.</p>

<p>You are doing it wrong. Now is the time to wake up and do it right!</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Reset a Login Password in Windows]]></title>
    <link href="http://tomordonez.com/blog/2013/05/06/reset-a-login-password-in-windows"/>
    <updated>2013-05-06T11:16:00-04:00</updated>
    <id>http://tomordonez.com/blog/2013/05/06/reset-a-login-password-in-windows</id>
    <content type="html"><![CDATA[<p><a href="http://www.pcworld.com/article/249181/how_to_reset_your_windows_password.html">Source</a></p>

<p>Installing a program that only works on a Windows XP. The only computer with Win XP I have was stored in a box and it&#8217;s kind of old.</p>

<p>At the login screen I had to put a password. I just couldn&#8217;t remember a password from 7 years ago.</p>

<p>I used to have a CD (compact disc. They were used to stored data. It looks like vinyl record but smaller. A vinyl record is &#8230;whatever). Anyways&#8230;I used to have a program that would reset windows passwords. You run it and it asks for a new password. Easy. Cheap.</p>

<p>I googled around and found an even cheaper solution. See source above.</p>

<p>(You need a Windows XP installation CD)</p>

<ol>
<li>Go to the Login screen and note the user name</li>
<li>Insert the CD and restart the computer. Make sure as to boot from the CD.</li>
<li>Select the option to <code>repair</code> Windows.</li>
<li>It will show something like <code>select the Windows installation you want to repair</code>. Then it will show the directory where Windows is installed such as <code>1: C:\Windows</code>. You need to type <code>1</code> or the number that shows up on your screen.</li>
<li>It showed <code>Enter the Administrator password</code>. I just hit <code>Enter</code>. It took me to the command prompt at the directory <code>C:\Windows</code></li>
<li>At the prompt type <code>copy c:\windows\system32\sethc.exe c:\</code> and press Enter. It will say something like <code>1 file copied</code></li>
<li>Type <code>copy c:\windows\system32\cmd.exe c:\windows\system32\sethc.exe</code> and press Enter. It will ask if you want to overwrite. Type <code>Y</code></li>
<li>Type <code>exit</code> to exit command prompt which will reboot. Remove the CD.</li>
<li>At the login screen. Tap <code>Shift</code> 5 times. It will pop up a window with the command prompt.</li>
<li>Type <code>net user username password</code>. Replace username with your user and password with a new password. For example: <code>net user bob password1</code> and hit Enter, of course.</li>
<li>Type <code>exit</code> to exit the prompt and go back to the login screen.</li>
<li>Select the user and type in the new password.</li>
</ol>


<p>For more info on how to remove the previous process. Read the source above.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Programming as a Hobby]]></title>
    <link href="http://tomordonez.com/blog/2013/04/28/programming-as-a-hobby"/>
    <updated>2013-04-28T20:28:00-04:00</updated>
    <id>http://tomordonez.com/blog/2013/04/28/programming-as-a-hobby</id>
    <content type="html"><![CDATA[<p>People have hobbies.</p>

<p>Such as:</p>

<p><img src="http://tomordonez.com/images/camilo_villegas_golf.jpg" alt="I tried Golf but Camilo Villegas was too busy to teach me. Guess where he is from. Apparently most golf fans in the Midwest know who he is and have no clue where he is from" /></p>

<p>And also:</p>

<p><img src="http://tomordonez.com/images/jaco_bass.jpg" alt="I played the bass in Chicago semi-professionally. Played gigs in front of real people. Most bands are weird. Musicians are weird" /></p>

<p>There is also:</p>

<p><img src="http://tomordonez.com/images/aircraft_spotting.jpg" alt="Those that spot airplanes at airports. They have lots of geek expensive gear" /></p>

<p>And:</p>

<p><img src="http://tomordonez.com/images/cat_hobby.jpg" alt="It seems everybody loves cats. Cats don't like me. The Dr says if I get near a car I can die" /></p>

<p>A hobby found me 2 years ago.</p>

<p>It was in that transition after quitting my last band.</p>

<p>The hobby haunts me at night.</p>

<p>It crawls behind my back underneath my skin like a horny squirrel.</p>

<p>I spend every minute I can with my new hobby.</p>

<p>At 6:30am when Kid1 wakes me up and punches me in the belly and says &#8220;It&#8217;s start up&#8221;. Oh, future entrepreneur.</p>

<p>At the Code and Coffee in Miami. Drinking $7 cups of coffee. Damn that shit is expensive. The hobby follows me there too.</p>

<p>During my commute. Listening to the Wideteams and the Ruby Rogues and the Smashing of Robots. The hobby follows me there too.</p>

<p>Oh darn it, even when I take a bathroom brake. The hobby follows me.</p>

<p>Then when I go to meetups. The hobby is there too.</p>

<p>From 9pm to 1am. Darn it. Damn hobby can&#8217;t give me a break.</p>

<p>The hobby is like a giant octopus with 3 tentacles. 1, 0 and infinity.</p>

<p>I am not a full time programmer but every other moment I stop and think that I should be one.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Psychobitch Programming]]></title>
    <link href="http://tomordonez.com/blog/2013/04/25/psychobitch-programming"/>
    <updated>2013-04-25T11:48:00-04:00</updated>
    <id>http://tomordonez.com/blog/2013/04/25/psychobitch-programming</id>
    <content type="html"><![CDATA[<p>What happens when your program crashes. Psychobitch has you covered. It&#8217;s like the Terminator. You can blast him in the face with a shotgun, it stops for a second, and keeps on coming.</p>

<p>Found on twitter through @mfeathers. Film by <a href="http://www.shardingdevnull.com/">GarretT Smith</a></p>

<iframe width="420" height="315" src="http://www.youtube.com/embed/rRbY3TMUcgQ" frameborder="0" allowfullscreen></iframe>


<p>Ryan Dahl, the creator of Node.js is currently under the witness protection program.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Code and Coffee in Miami]]></title>
    <link href="http://tomordonez.com/blog/2013/03/29/code-and-coffee-in-miami"/>
    <updated>2013-03-29T12:36:00-04:00</updated>
    <id>http://tomordonez.com/blog/2013/03/29/code-and-coffee-in-miami</id>
    <content type="html"><![CDATA[<ul>
<li>At Panther Coffee</li>
<li>Every Tuesday 7am-9am</li>
<li>Pair programming, code, coffee</li>
<li>Bring laptop</li>
</ul>


<h3>Read More&#8230;</h3>

<p>&#8220;<a href="http://codeandcoffee.info/">Code &amp; Coffee</a> is an informal get together to write some code in the morning before the real job kicks in.&#8221;</p>

<p>I occasionally went to the one in Chicago and it is a great place to pair up and learn from other developers.</p>

<p>&#8220;If you&#8217;re interested in joining in, just show up. No invited needed, you don&#8217;t need to RSVP, you just need a laptop.&#8221;</p>

<h3>The 3 Rules of Code and Coffee in Miami</h3>

<ul>
<li>You need to do pair programming.</li>
<li>You need to bring a laptop</li>
<li>You need to code</li>
</ul>


<p>Code and Coffee in Miami is not for you if:</p>

<ul>
<li>You want to work on your own thing by yourself</li>
<li>You want to come and read a book by yourself</li>
<li>You want to sit by yourself</li>
</ul>


<p>Code and Coffee in Miami is your opportunity for pair programming and learn from other developers.</p>

<p>We will try to moderate as much as possible to make sure that everybody has a pair. Otherwise just be friendly and ask someone to pair up.</p>

<h3>Where</h3>

<p>Panther Coffee
2390 NW 2nd Ave  Miami, FL 33127</p>

<p><img src="http://tomordonez.com/images/I%20googled%20it%20for%20you%20code%20coffee%20miami.jpg" alt="Here are some Landmarks" /></p>

<h3>When</h3>

<p>Every Tuesday
7am - 9am</p>

<h3>Who</h3>

<p>Any developer, web or mobile, any programming language.</p>

<h3>NOT</h3>

<p>Sales or recruiters unless you commit exclusively to the 3 rules.</p>

<h3>Disclosure</h3>

<ul>
<li>There is no relationship between Code and Coffee and Panther Coffee. We just go and hangout there, drink coffee and code. There is no RSVP. There is no sponsorship or free drinks and food. There might be other coffee humans doing their thing. I assume Panther Coffee expects that you at least buy coffee to hang out there.</li>
<li>Code and Coffee is open to newbie and experienced. If you want to learn some code feel free to ask a coder.</li>
<li>Feel free to come and go as you wish. It starts at 7am and it ends at 9am. But you can hangout there for longer if you want.</li>
<li>Don&#8217;t leave any of your stuff unattended.</li>
<li>If nobody has arrived at 7am. Please stay until 9am. People might be stuck in traffic.</li>
<li>There is no schedule of topics. There is no invited speaker.</li>
<li>It&#8217;s encouraged to pair program, pair learning, pair reading, pair browsing and socialize.</li>
</ul>

]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Sofia Vergara inspires Latin America to Push Forward]]></title>
    <link href="http://tomordonez.com/blog/2013/03/27/sofia-vergara-inspires-latin-america-to-push-forward"/>
    <updated>2013-03-27T08:41:00-04:00</updated>
    <id>http://tomordonez.com/blog/2013/03/27/sofia-vergara-inspires-latin-america-to-push-forward</id>
    <content type="html"><![CDATA[<p>Sofia Vergara is from Colombia.</p>

<p>Colombia is in South America.</p>

<p>Not that America.</p>

<p>The other one.</p>

<p>The one across the pond from Florida.</p>

<p>No. That&#8217;s Cuba.</p>

<p>No Mexico no. Let me clarify. Across the pond from Florida straight line, not west.</p>

<p>Mmm no. That&#8217;s Puerto Rico. You went too east.</p>

<p>Go back west. Straight.</p>

<p>God damn it. This one!</p>

<p><img src="http://tomordonez.com/images/colombia%20map.jpg" alt="Colombia not Columbia. I swear if you spell it wrong I will kick yo ass" /></p>

<p>In that country they speak&#8230;</p>

<p>Not Mexican.</p>

<p>Spanish. aka Español.</p>

<p>If you are on a Mac computer you can get the Ñ by holding the n key until it shows up. Now you can write words like:</p>

<p>Coño.</p>

<p>Ño que barato.</p>

<p><img src="http://tomordonez.com/images/que%20barato.jpg" alt="You know you like it Miami you know it" /></p>

<p>Ño! (This doesn&#8217;t mean No. This is like the Hispanic version of the New Yorker slang &#8216;Forget about it!&#8217; or whatever that is from)</p>

<p>No. In Colombia people don&#8217;t live in shacks made out of sticks. Ño! cmon!</p>

<p><img src="http://tomordonez.com/images/tabogo.jpg" alt="Wow Bogota looks civilized. Kinda like Boston without the snow. Boston and Bogota have the same number of letters? Creepy." /></p>

<p>Medellin has the most beautiful women in the world? That&#8217;s bullshit!</p>

<p><img src="http://tomordonez.com/images/medellin.jpg" alt="Nonsense they all look like this? Impossible" /></p>

<p>Sofia Vergara is from Colombia?</p>

<p>No way!</p>

<p><img src="http://tomordonez.com/images/al%20bundy.jpg" alt="That Kid doesn't look like Bud. Where is Kelly. This ain't that show!" /></p>

<p>Are you telling me that this girl is from Colombia? Sweet Jesus!</p>

<p><img src="http://tomordonez.com/images/sofia.jpg" alt="WTF that's impossible" /></p>

<p>Ok but she is the only one celebrity from Colombia. I mean this is rare.</p>

<p><img src="http://tomordonez.com/images/clown.jpg" alt="The clown from this crappy movie" /></p>

<p>What that dude too? Sneaky mofo!</p>

<p>But that dude is like in a hundred movies. No way!</p>

<p><img src="http://tomordonez.com/images/fat%20cat.jpg" alt="The guy with the fat cats" /></p>

<p>What? The guy with the fat statues too? But they are all over the world. There is no way.</p>

<p><img src="http://tomordonez.com/images/shakira.jpg" alt="Obama, Santos and Shakira doing the movie Red part 2" /></p>

<p>Shakira too? But I thought she was from Arkansas or something. She kinda look like Britney no? No effing way!</p>

<p><img src="http://tomordonez.com/images/schumacher.jpg" alt="This is clearly photoshopped. There is just no way this is real" /></p>

<p>That dude from Nascar? What&#8217;s he doing standing next to Schumacher? He was in the F1? WTF</p>

<p>Thank you for teaching me a lesson. Thank you.</p>

<p>I promise now I will spell it Colombia with an O.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Startup Patterns - You can take orders offline]]></title>
    <link href="http://tomordonez.com/blog/2013/03/24/startup-patterns-you-can-take-orders-offline"/>
    <updated>2013-03-24T08:55:00-04:00</updated>
    <id>http://tomordonez.com/blog/2013/03/24/startup-patterns-you-can-take-orders-offline</id>
    <content type="html"><![CDATA[<p>It is wrong to think you need a web app or mobile app before you launch your startup.</p>

<p>How did startups make money 10 years ago? What about 20 years ago? What about 40 years ago? When there were no Iphones or Androids or App Store or when there was no Internet.</p>

<p><img src="http://tomordonez.com/images/starbucks_1971.jpg" alt="Starbucks started pre-Internet?  WTF That's impossible" /></p>

<p>People still made money, successful businesses and create civilization as we know it.</p>

<p>I remember a class in school called Product Development. We had to build a physical product (not an app). The first thing the professor said was: <code>You are not building something new, you are building an improvement of something that already exists unless of course that you create a ball of fire</code></p>

<p><img src="http://tomordonez.com/images/ball_of_fire.jpg" alt="Can You Build a Ball of Fire? mmm" /></p>

<p>This created a lot of arguments and discussions. A ball of fire? WTF? He spending too much time in the lab?</p>

<p>He was right though.</p>

<p>Every product out there is an improvement of something that already exists.</p>

<p>The Iphone, even though is an innovation, it&#8217;s an improvement for phones.</p>

<p>Every startup is building an improvement over something that was done in a similar or different way.</p>

<p>Let&#8217;s talk about Etsy.</p>

<p><img src="http://tomordonez.com/images/esty_handmade_stuff.jpg" alt="All the handmade stuff you can buy" /></p>

<p>How did they sell all these nice and handmade stuff before Etsy?</p>

<ul>
<li>Mailing lists</li>
<li>Catalogs</li>
<li>Phone orders</li>
<li>Offline groups</li>
<li>Posters</li>
<li>Guerrilla marketing</li>
</ul>


<p>Let&#8217;s talk about Groupon.</p>

<p><img src="http://tomordonez.com/images/superbowl_groupon.jpg" alt="That Superbowl Groupon commercial. I wonder how much $$ they paid her" /></p>

<p>How did anybody sell coupons before Groupon. It&#8217;s a mystery. I don&#8217;t think coupons existed before.</p>

<h3>Startup Pattern: Startups fail because they think they need an App to operate</h3>

<p>Web or mobile app.</p>

<p>Although more startups think they MUST have a mobile app to operate.</p>

<p>Building an app is a big investment. It is expensive to build software. More on the subject <a href="http://www.tomordonez.com/blog/2012/06/19/how-to-build-a-startup-in-3-easy-steps/">here</a> and <a href="http://www.tomordonez.com/blog/2012/06/19/five-reasons-why-you-should-not-waste-time-on-a-number-startup-name/">here</a> and then <a href="http://www.tomordonez.com/blog/2012/06/19/four-ways-to-keep-your-sanity-at-your-number-startup/">here</a> and also <a href="http://www.tomordonez.com/blog/2012/06/19/six-ways-to-startup-your-personal-inbound-marketing-efforts/">here</a> and some more <a href="http://www.tomordonez.com/blog/2012/06/19/three-ways-to-find-out-if-you-hired-the-wrong-people-for-your-startup/">here</a></p>

<p>I went to the Superconf in Miami a few weeks ago. There was a guy there that pitched a business about renting boats.</p>

<p>He said buying a boat was a huge investment and a lot of people that have boats don&#8217;t take them out every weekend. They spend a lot of $ renting space at the marina. Therefore a money drain.</p>

<p>Good problem, good solution. Innovative, improving something that already exists: Renting boats.</p>

<p>I thought of that guy and wondered if his business is open. Someone said that his site has not launched yet.</p>

<p>I wondered.</p>

<p>Why does he need a site to operate?</p>

<ul>
<li>He must have a list of boats available</li>
<li>Who is the owner of the boat</li>
<li>Who is renting the boat</li>
<li>When the boat is available</li>
</ul>


<p>Why doesn&#8217;t he open now and take orders offline?</p>

<p>Does he need a USD$50,000 app to operate?</p>

<p>I don&#8217;t think so.</p>

<p>Does he need full online payment integration on a mobile app?</p>

<p>Nope.</p>

<p>Does he need to write a lot of blog posts and spend on advertisement to get leads.</p>

<p>Nah!</p>

<p><strong>How many startups think they need apps to launch their business?</strong></p>

<p>I think a lot.</p>

<p>This is bad!</p>

<p><img src="http://tomordonez.com/images/jonah_hill_says_no_app.gif" alt="Jonah Hill says no App or he will scream" /></p>

<h3>Startup Pattern: Launching a business with no money aka Bootstrap.</h3>

<p>Say you only have $500 to spend on launching your business and you need to launch in 30 days.</p>

<p>How do you make it happen?</p>

<p>Some people would think this is impossible.</p>

<p>This is how you could do it:</p>

<ul>
<li>Read about Guerrilla marketing</li>
<li>Read about startups and bootstrap</li>
<li>Read about the Stripe card</li>
<li>Read about inbound marketing in Hubspot.</li>
<li>Create a website in 1 hour with Strikingly</li>
<li>Get a domain in DNsimple</li>
<li>Get a Google Docs account</li>
<li>Sign up for Basecamp</li>
<li>Sign up for Trello</li>
<li>Sign up for Mailchimp</li>
<li>Word of mouth</li>
<li>Talk to folks offline</li>
<li>Build a list of all these folks</li>
<li>Get referrals from these folks</li>
<li>Stalk twitter and search for keywords to see what people are talking about on the topic you are building a business about.</li>
<li>If you need a CRM you you could consider the cheapest options of Salesforce</li>
<li>You could use Freshbooks for online invoicing and accounting.</li>
</ul>


<p>Starting to see a trend above?</p>

<p>Most of them are solutions off the shelf that you can buy for cheap or free.</p>

<ul>
<li>Basecamp</li>
<li>Trello</li>
<li>Google Docs</li>
<li>Mailchimp</li>
<li>Salesforce CRM</li>
<li>Freshbooks</li>
<li>DNsimple</li>
<li>Stripe</li>
<li>Strikingly</li>
</ul>


<p>The rest is education. You need to educate yourself:</p>

<ul>
<li>Inbound marketing</li>
<li>Guerrilla marketing</li>
<li>Bootstrapping your startup</li>
</ul>


<p>And do a lot of personal interactions:</p>

<ul>
<li>By phone</li>
<li>Email</li>
<li>Face to face.</li>
</ul>

]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Rake Commands in Octopress on Github]]></title>
    <link href="http://tomordonez.com/blog/2013/03/12/rake-commands-in-octopress-on-github"/>
    <updated>2013-03-12T22:03:00-04:00</updated>
    <id>http://tomordonez.com/blog/2013/03/12/rake-commands-in-octopress-on-github</id>
    <content type="html"><![CDATA[<h3>Setup:</h3>

<ul>
<li>Ruby 1.9.2p320</li>
<li>MAC OS X 10.7.5</li>
<li>iterm2</li>
<li>Textmate</li>
</ul>


<h3>Sources:</h3>

<p><a href="https://github.com/jimweirich/rake">Rake</a>: A make-like build utility for Ruby.</p>

<p><a href="http://www.tomordonez.com/blog/2012/06/04/creating-a-github-blog-using-octopress/">Creating a Github Blog Using Octopress</a></p>

<h3>List of rake commands in Octopress</h3>

<p>Before going on the long version of this article. Here is a list of the rake commands listed in the Octopress Rakefile</p>

<pre><code>rake install
rake generate
rake watch
rake preview
rake new_post
rake new_page
rake isolate
rake integrate
rake clean
rake update_style
rake update_source
rake deploy
rake gen_deploy
rake copydot
rake rsync
rake push
rake setup_github_pages
rake list
</code></pre>

<h3>A little bit of Rake</h3>

<p>Rake was developed by <a href="https://twitter.com/jimweirich">Jim Weirich</a> and it is a Ruby build program similar to Unix <a href="http://en.wikipedia.org/wiki/Make_(software">Make</a>).</p>

<p>To explain this simple. Using <code>Rake</code> you can create scripts with tasks that automate things.</p>

<p>A silly example would be that when you turn your computer on and you run a rake command such as <code>rake startmyday</code> (this is made up) it does:</p>

<ul>
<li>Opens gmail</li>
<li>Opens skype</li>
<li>Opens spotify</li>
<li>Opens iterm</li>
<li>Browses to google and searches for the weather.</li>
</ul>


<p>The Rake docs explain how to use it like this:</p>

<p>Create a Rakefile that contains some &#8216;rules&#8217;. For example:</p>

<pre><code>task :default =&gt; [:test]

task :test to
    ruby "test/unittest.rb"
end
</code></pre>

<p>This means that there are 2 tasks. One task is:</p>

<pre><code>task :default =&gt; [:test]
</code></pre>

<p>The other task is:</p>

<pre><code>task :test do
    ruby "test/unittest.rb"
end
</code></pre>

<p>These tasks do something. Right now it doesn&#8217;t matter what they do in this example. What is important to understand is the structure of each task.</p>

<p>Again, the task could be to open spotify or run a piece of code in some other file.</p>

<h4>Structure of a Rake task</h4>

<p>Let&#8217;s look at this again:</p>

<pre><code>task :test do
    ruby "test/unittest.rb"
end
</code></pre>

<p>If you want to run this task you should do:</p>

<pre><code>rake test
</code></pre>

<p>And it will run this:</p>

<pre><code>ruby "test/unittest.rb"
</code></pre>

<p>It doesn&#8217;t matter what the above runs.</p>

<h3>Octopress Rakefile</h3>

<p>If you are using Octopress blindly, it is a good idea to dig in and ask why.</p>

<ul>
<li>Why do I have all these folders?</li>
<li>What do these files mean?</li>
<li>Why do I have to rake things</li>
</ul>


<p><strong>Using Rake in Octopress</strong></p>

<p>If you are not using Octopress, <a href="http://www.tomordonez.com/blog/2012/06/04/creating-a-github-blog-using-octopress/">now</a> is a good time to try it out.</p>

<p>Octopress uses these Rake commands:</p>

<pre><code>rake generate
rake new_post["Some title for a new post"]
rake new_page["Some title for a new page"]
rake deploy
</code></pre>

<p>Now is the time to wonder what the heck does it do when I <code>rake deploy</code>.</p>

<h4>Rakefile file</h4>

<p>If you navigate to your Octopress installation, it should have a file called <code>Rakefile</code></p>

<p>Inside some of the code looks like this.</p>

<p><strong>Initial setup for Octopress</strong></p>

<pre><code>desc "Initial setup for Octopress: copies the default theme into the path of Jekyll's generator. Rake install defaults to rake install[classic] to install a different theme run rake install[some_theme_name]"
task :install, :theme do |t, args|
  if File.directory?(source_dir) || File.directory?("sass")
    abort("rake aborted!") if ask("A theme is already installed, proceeding will overwrite existing files. Are you sure?", ['y', 'n']) == 'n'
  end
  # copy theme into working Jekyll directories
  theme = args.theme || 'classic'
  puts "## Copying "+theme+" theme into ./#{source_dir} and ./sass"
  mkdir_p source_dir
  cp_r "#{themes_dir}/#{theme}/source/.", source_dir
  mkdir_p "sass"
  cp_r "#{themes_dir}/#{theme}/sass/.", "sass"
  mkdir_p "#{source_dir}/#{posts_dir}"
  mkdir_p public_dir
end
</code></pre>

<p>Looks familiar uh? The same structure with the task, then a word like :something, then a do, then some crazy code and then an end.</p>

<p><strong>Generate jekyll site</strong></p>

<pre><code>task :generate do
  raise "### You haven't set anything up yet. First run `rake install` to set up an Octopress theme." unless File.directory?(source_dir)
  puts "## Generating Tom's Awesomeness"
  system "compass compile --css-dir #{source_dir}/stylesheets"
  system "jekyll"
end
</code></pre>

<p>By the way, I changed the string on the puts. Which means that you could modify the Rakefile as you wish, being careful not to break something. Although not recommended if you fetch new updates from the original Octopress repository into your blog.</p>

<p><strong>Watch the site and regenerate when it changes</strong></p>

<pre><code>task :watch do
  raise "### You haven't set anything up yet. First run `rake install` to set up an Octopress theme." unless File.directory?(source_dir)
  puts "Starting to watch source with Jekyll and Compass."
  system "compass compile --css-dir #{source_dir}/stylesheets" unless File.exist?("#{source_dir}/stylesheets/screen.css")
  jekyllPid = Process.spawn({"OCTOPRESS_ENV"=&gt;"preview"}, "jekyll --auto")
  compassPid = Process.spawn("compass watch")

  trap("INT") {
    [jekyllPid, compassPid].each { |pid| Process.kill(9, pid) rescue Errno::ESRCH }
    exit 0
  }

  [jekyllPid, compassPid].each { |pid| Process.wait(pid) }
end
</code></pre>

<p>I didn&#8217;t know you could do <code>rake watch</code> before looking at the Rakefile.</p>

<p><strong>Preview the site in a web browser</strong></p>

<pre><code>task :preview do
  raise "### You haven't set anything up yet. First run `rake install` to set up an Octopress theme." unless File.directory?(source_dir)
  puts "Starting to watch source with Jekyll and Compass. Starting Rack on port #{server_port}"
  system "compass compile --css-dir #{source_dir}/stylesheets" unless File.exist?("#{source_dir}/stylesheets/screen.css")
  jekyllPid = Process.spawn({"OCTOPRESS_ENV"=&gt;"preview"}, "jekyll --auto")
  compassPid = Process.spawn("compass watch")
  rackupPid = Process.spawn("rackup --port #{server_port}")

  trap("INT") {
    [jekyllPid, compassPid, rackupPid].each { |pid| Process.kill(9, pid) rescue Errno::ESRCH }
    exit 0
  }

  [jekyllPid, compassPid, rackupPid].each { |pid| Process.wait(pid) }
end
</code></pre>

<p><strong>Begin a new post</strong></p>

<pre><code># usage rake new_post[my-new-post] or rake new_post['my new post'] or rake new_post (defaults to "new-post")
desc "Begin a new post in #{source_dir}/#{posts_dir}"
task :new_post, :title do |t, args|
  raise "### You haven't set anything up yet. First run `rake install` to set up an Octopress theme." unless File.directory?(source_dir)
  mkdir_p "#{source_dir}/#{posts_dir}"
  args.with_defaults(:title =&gt; 'new-post')
  title = args.title
  filename = "#{source_dir}/#{posts_dir}/#{Time.now.strftime('%Y-%m-%d')}-#{title.to_url}.#{new_post_ext}"
  if File.exist?(filename)
    abort("rake aborted!") if ask("#{filename} already exists. Do you want to overwrite?", ['y', 'n']) == 'n'
  end
  puts "Creating new post: #{filename}"
  open(filename, 'w') do |post|
    post.puts "---"
    post.puts "layout: post"
    post.puts "title: \"#{title.gsub(/&amp;/,'&amp;amp;')}\""
    post.puts "date: #{Time.now.strftime('%Y-%m-%d %H:%M')}"
    post.puts "comments: true"
    post.puts "categories: "
    post.puts "---"
  end
end
</code></pre>

<p>When I started using Octopress I was confused about using double quotes or single quotes, when creating a new post title. This explains it all.</p>

<pre><code>usage rake new_post[my-new-post] or rake new_post['my new post'] or rake new_post (defaults to "new-post")
</code></pre>

<p>By the way. The Octopress official documents on the website have not been updated since 2011. I am sure the author doesn&#8217;t have time for it. And this is why I am writing this post.</p>

<p><strong>Default deploy task</strong></p>

<pre><code>task :deploy do
  # Check if preview posts exist, which should not be published
  if File.exists?(".preview-mode")
    puts "## Found posts in preview mode, regenerating files ..."
    File.delete(".preview-mode")
    Rake::Task[:generate].execute
  end

  Rake::Task[:copydot].invoke(source_dir, public_dir)
  Rake::Task["#{deploy_default}"].execute
end
</code></pre>

<p>And so on&#8230;</p>

<p>This article doesn&#8217;t explain what each line of code does in the Rakefile, but now you know what this file does and you could modify it however best fits your needs.</p>

<h3>My custom rake file</h3>

<p>This is my process of deploying after creating a new post:</p>

<pre><code>rake generate
git add .
git commit -am "New post about something"
git push origin source
rake deploy
</code></pre>

<p>Why not enclose all this stuff into a rake task.</p>

<p>I added this code at the end of my Rakefile</p>

<pre><code>desc "Generate website, add, commit and deploy"
task :x do
    system "git add ."
    message = "Site updated at #{Time.now.utc}"
    system "git commit -am \"#{message}\""
    Rake::Task[:integrate].execute
    Rake::Task[:generate].execute
    system "git push origin source"
    Rake::Task[:deploy].execute
end
</code></pre>

<p>Now I can add, commit, generate, push and deploy using one command:</p>

<pre><code>rake x
</code></pre>

<p>Ain&#8217;t this awesome?</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Logic Error at Runtime]]></title>
    <link href="http://tomordonez.com/blog/2013/02/19/logic-error-at-runtime"/>
    <updated>2013-02-19T08:54:00-05:00</updated>
    <id>http://tomordonez.com/blog/2013/02/19/logic-error-at-runtime</id>
    <content type="html"><![CDATA[<p>In my previous <a href="http://www.tomordonez.com/blog/2013/02/17/caring-about-compile-time-and-run-time/">post</a> I wrote about Compile time and Run Time.</p>

<p>Compile time can give you syntax errors. It compares your code to the &#8220;grammar&#8221; of the programming language you are using to check that you wrote the syntax correctly. It doesn&#8217;t correct your grammar but it shows you where there is an error in your code.</p>

<p>Run time can give you logic errors and arrays bound checking. Your program can compile but at run time the program might not give you accurate results. The cause of this might be an incorrect or incomplete formula.</p>

<p>Here is another example of a logic error at run time.</p>

<h3>Converting Fahrenheit to Celsius with wrong formula</h3>

<p>The formula to convert Fahrenheit to Celsius is:</p>

<pre><code>C = 5/9 x (F-32)
</code></pre>

<p>If you remember high school math you &#8220;could&#8221; write this formula in these ways:</p>

<pre><code>C = 5 x (F-32)/9
C = 1/9 x (F-32)5
C = (5/9) x (F-32)
</code></pre>

<p>But,</p>

<p>The computer understands numbers in a different way.</p>

<p>The symbol for multiplication is * and not x</p>

<p>Let&#8217;s try that again:</p>

<pre><code>C = 5/9 * (F-32)
</code></pre>

<p>Let&#8217;s see how a program would look like using this formula:</p>

<pre><code>#include &lt;stdio.h&gt;

int main()
{
    int fahrenheit, celsius;

    printf("F   to  C\n");
    scanf("%d", &amp;fahrenheit);

    celsius = 5/9 * fahrenheit-32;

    printf("%d\t \t %d\n",fahrenheit, celsius);

    return 0;
}
</code></pre>

<p>By the way this program is in C.</p>

<p>If you got a MAC you can do this:</p>

<ol>
<li>If you don&#8217;t have Xcode installed. Get a compiler such as gcc from <a href="https://github.com/kennethreitz/osx-gcc-installer/">here</a></li>
<li>Get a text editor such as <a href="http://macromates.com/">textmate</a></li>
<li>Create a file in textmate with a name like fahr2celsius.c</li>
<li>Type the code in the file</li>
<li>From the terminal type: gcc fahr2celsius.c</li>
<li>This will compile the program and create a file called: a.out</li>
<li>If it compiles with no errors type: ./a.out</li>
<li>This will run the program</li>
</ol>


<p>Going back to the previous code.</p>

<p>It will compile with no errors. This happens when you run it:</p>

<p><img src="http://tomordonez.com/images/ftoc_example1.jpg" height="200" width="250" alt="Runtime with F = 0 then C = -32" /></p>

<p>This seems right. But it&#8217;s not. It gives you negative 32 and not 32.</p>

<p>Let&#8217;s try another number. What about F = 40</p>

<p><img src="http://tomordonez.com/images/ftoc_example2.jpg" height="200" width="250" alt="Runtime with F = 40 then C = -32 again? WTF" /></p>

<p>Yep. Something is definitively wrong.</p>

<p><img src="http://tomordonez.com/images/insane%20in%20the%20membrane.jpg" height="200" width="250" alt="Kaboom!" /></p>

<h3>Converting Fahrenheit to Celsius with wrong formula again</h3>

<p>WTF is wrong then?</p>

<p>Let&#8217;s look at the formula in the program again:</p>

<pre><code>celsius = 5/9 * fahrenheit-32;
</code></pre>

<p>Duh!</p>

<p>Missed the parenthesis.</p>

<pre><code>celsius = (5/9) * (fahrenheit-32);
</code></pre>

<p><img src="http://tomordonez.com/images/ftoc_example3.jpg" height="200" width="250" alt="Runtime with F = 40 then C = 0 ? Now starting to piss me off" /></p>

<p>I put that F is 40, gives me C is 0.</p>

<p>WTF!</p>

<h3>Converting Fahrenheit to Celsius with correct formula with integers</h3>

<p>I am doing something wrong.</p>

<p>What could it be. Maybe if I take a break it will come to me.</p>

<p><img src="http://tomordonez.com/images/ftoc_distraction1.jpg" height="200" width="250" alt="ahhh cute!" /></p>

<p>Still thinking&#8230;</p>

<p><img src="http://tomordonez.com/images/ftoc_distraction2.jpg" height="200" width="250" alt="ahhh cute!" /></p>

<p>Got it!</p>

<p>The computer doesn&#8217;t really understand math like the humans.</p>

<p>In my program I am declaring 2 variables as integers:</p>

<pre><code>int fahrenheit, celsius;
</code></pre>

<p>The result of dividing two integers is an integer with no decimals.</p>

<p>Which means that when I do:</p>

<pre><code>5/9
</code></pre>

<p>That is, 5 divided by 9, the result is zero.</p>

<p>Genius.</p>

<p>So when I put F as 40.</p>

<pre><code>celsius = (5/9) * (fahrenheit-32);
celsius = (0) * (fahrenheit-32);
</code></pre>

<p>Anything that I multiply by 5/9 will give me zero.</p>

<p>Which means that I have to rearrange the formula. Maybe like this:</p>

<pre><code>celsius = 5 * (fahrenheit-32)/9;
</code></pre>

<p>So the correct program should be:</p>

<pre><code>#include &lt;stdio.h&gt;

int main()
{
    int fahrenheit, celsius;

    printf("F   to  C\n");
    scanf("%d", &amp;fahrenheit);

    celsius = 5 * (fahrenheit-32)/9;

    printf("%d\t \t %d\n",fahrenheit, celsius);

    return 0;
}
</code></pre>

<p>It compiles.</p>

<p>If I run and type in 40:</p>

<p><img src="http://tomordonez.com/images/ftoc_example4.jpg" height="200" width="250" alt="Runtime with F = 40 then C = 4 OK Now it makes sense but..." /></p>

<p>Yes. It gives 4. Which is the correct result.</p>

<p>Score.</p>

<p><img src="http://tomordonez.com/images/ftoc_score.jpg" height="200" width="250" alt="F2C 1 Hell 0" /></p>

<p>But the result should be 4.44 and not just 4.</p>

<p>Again. We are doing operations with integers so the result should be integers.</p>

<p>The program removes any decimals because we are not declaring any floats.</p>

<h3>Converting Fahrenheit to Celsius with correct formula with floats</h3>

<p>Since you whined about it&#8230;</p>

<p>We would need to put the formula into decimal mode.</p>

<p>We got to do 2 things:</p>

<ol>
<li>Declare the variables as floats</li>
<li>The formula has to have numbers with decimals</li>
</ol>


<p>The program should be updated to this:</p>

<pre><code>#include &lt;stdio.h&gt;

int main()
{
    float fahrenheit, celsius;

    printf("F   to  C\n");
    scanf("%f", &amp;fahrenheit);

    celsius = 5.0 * (fahrenheit-32)/9.0;

    printf("%f\t \t %f\n",fahrenheit, celsius);

    return 0;
}
</code></pre>

<p>If I compile it and put 40 it shows:</p>

<p><img src="http://tomordonez.com/images/ftoc_example5.jpg" height="200" width="250" alt="Runtime with F = 40 then C = 4.44 Life is awesome" /></p>

<p>To make it prettier we could update the formula to this:</p>

<pre><code>celsius = (5.0/9.0) * (fahrenheit-32);
</code></pre>

<p>Since the division of two floats will give a float.</p>

<p>And we score.</p>

<p><img src="http://tomordonez.com/images/ftoc_distraction3.jpg" height="200" width="250" alt="F2C 2 Hell 0" /></p>

<h3>Moral of the story</h3>

<p>Compilation is not the end. Run time is.</p>

<p>Compilation can hide logic errors.</p>

<p>Run time gives you the truth.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Caring About Compile Time and Run Time]]></title>
    <link href="http://tomordonez.com/blog/2013/02/17/caring-about-compile-time-and-run-time"/>
    <updated>2013-02-17T15:56:00-05:00</updated>
    <id>http://tomordonez.com/blog/2013/02/17/caring-about-compile-time-and-run-time</id>
    <content type="html"><![CDATA[<p>If you are here probably you went to Wikipedia and you flipped out.</p>

<p>If you are learning to code. You gotta read this.</p>

<p>Sources:
<a href="http://en.wikipedia.org/wiki/Program_lifecycle_phase">Program Lifecycle Phase on Wikipedia</a>
<a href="http://en.wikipedia.org/wiki/Compile_time">Compile time on wikipedia</a>
<a href="http://en.wikipedia.org/wiki/Compiler">What is a compiler on wikipedia</a>
<a href="http://en.wikipedia.org/wiki/Syntax_analysis">Syntax Analysis on wikipedia</a></p>

<h3>Program Lifecyle Phase</h3>

<p>A software program has phases. It starts when you write the code for the program and it ends when the program runs.</p>

<p>Let&#8217;s say that you are the inventor of Excel. You start by writing the code that Excel is built on. And you end by running Excel to use it to enter data to create charts and reports.</p>

<p>These are some of the phases:</p>

<h4>Edit time</h4>

<p>The phase when you first write the code (or source code). You can write it on a text editor or an IDE.</p>

<h4>Compile time</h4>

<p>The edited code is compiled into machine code by the compiler. A compiler is a program that transforms the source code to machine code. Machine code means 1s and 0s.</p>

<p>The final result of the compilation is a file that can be executed.</p>

<p>For instance when you buy Excel it comes with a .exe file that you can use to install the program.</p>

<h4>Run time</h4>

<p>It is the time when you see the behavior of the program that is executed.</p>

<p>For example. After you install Excel and you run the program to create charts.</p>

<h3>What is a Compiler</h3>

<p>A program that transforms source code to machine code.</p>

<p>A compiler is used to translate source code from a <strong>high-level programming language</strong> to a lower level.</p>

<p>The heck this means?</p>

<h4>What is a high-level programming language</h4>

<p>&#8220;It is a programming language with strong abstraction from the details of the computer&#8221;</p>

<p>A high-level language uses &#8220;natural language&#8221; elements, making the development process easier.</p>

<p>If you speak English, a high-level language is like trying to learn Spanish and a lower level language is like to trying to learn Latin.</p>

<p><strong>Abstractions</strong></p>

<p>A high level of abstraction is like driving a car. You know how to operate a car and know some basic mechanics, like changing a tire. But you don&#8217;t really care how the engine works.</p>

<p>High level is driving the car. Low level is knowing the amount of Joules of energy required to move the car by one mile.</p>

<p>This concept of abstraction can be hardcore to understand.</p>

<p>High level languages deal with variables, arrays, objects, arithmetic expressions, etc. Low level languages deal with memory addresses.</p>

<h4>Types of high-level programming languages</h4>

<p><strong>Interpreted</strong></p>

<p>The program is read and executed with no compilation stage. An &#8220;interpreter&#8221; program reads each line of code and converts it to machine code.</p>

<p><strong>Compiled</strong></p>

<p>The program is compiled into machine code before running.</p>

<p><strong>Translated</strong></p>

<p>The program is translated to a lower level language and compiled by such language</p>

<h4>Structure of a compiler</h4>

<p><strong>The front end</strong></p>

<p>It checks if your program has the correct programming syntax. Errors are reported. It checks if the types of data are used correctly.</p>

<p>For instance you tried to divide the string &#8220;I am Homer Simpson&#8221; by 2. You won&#8217;t get half a Simpson. So the front end of the compiler will give an error of &#8220;Go to hell&#8221; if you try to do such thing.</p>

<p><strong>The middle end</strong></p>

<p>It optimizes the code. It removes useless code and other crazy things you did to the program.</p>

<p><strong>The back end</strong></p>

<p>Translates the output of the middle end into machine code.</p>

<h3>Syntax analysis during Compile Time</h3>

<p>Also known as &#8220;parsing&#8221;, analyzes your code according to the rules of the programming language grammar.</p>

<p>It would be if you write an article in Spanish and someone checks your grammar. It won&#8217;t correct it but it will tell you if you have errors.</p>

<h3>Code generation during Compile Time</h3>

<p>We are talking &#8220;back end&#8221; here when your almighty all-nighter code is converted into machine code.</p>

<p>If you dare to read stuff like &#8220;Instruction selection is typically carried out by doing a recursive postorder traversal on the abstract syntax tree&#8221; I leave it up to you and endless all-nighters.</p>

<h3>RUN TIME</h3>

<p>Ok so you wrote some code.</p>

<p>You compile it.</p>

<p>It checks for grammar, data type, etc.</p>

<p>Spits some errors.</p>

<p>You debug it.</p>

<p>Compile again.</p>

<p>It &#8220;passes&#8221;.</p>

<p>Now you want to run the program.</p>

<p>&#8220;Run time is the time when the program is running&#8221;. Duh! Wikipedia can be kind of stupid sometimes.</p>

<p>Run time errors are detected when the program is running.</p>

<p>For instance, logic errors and array bounds checking.</p>

<h4>Logic errors</h4>

<p>A logic error is different than a syntax error. Syntax errors are caught during compile time. Logic errors are usually caught at run time.</p>

<p>&#8220;The existence of logic errors is the production of wrong solutions&#8221;</p>

<p><strong>Causes:</strong></p>

<p>Wrong or incorrect formula, errors in algorithms or even the wrong algorithm.</p>

<p><strong>Example from Wikipedia:</strong></p>

<pre><code>int average (int a, int b)
{
    return a + b / 2;
}
</code></pre>

<p>The previous code compiles without errors but at run time it doesn&#8217;t produce the correct answer.</p>

<p>It does this: divide b by 2 and add the result to a.</p>

<p>The correct formula should be:</p>

<pre><code>return (a + b) / 2;
</code></pre>

<h4>Array bounds checking</h4>

<p>&#8220;Relevant to a variable used as an index into an array to ensure its value lies within the bounds of the array&#8221;</p>

<p>Here is an example:</p>

<pre><code>#include &lt;stdio.h&gt;
#define ARRAY_LENGTH 140

char tweet[ARRAY_LENGTH];
int i, c;

for (i = 0; i &lt; 140 &amp;&amp; (c = getchar()) != EOF ; ++i)
{
    tweet[i] = c;
}
</code></pre>

<p>i is the variable used as an index into an array.</p>

<p>ARRAY_LENGTH of 140 is the bound of the array.</p>

<p>The index i lies with the bounds of the ARRAY_LENGTH.</p>

<p>Inside the loop i goes from 0 to 139, going through 140 iterations.</p>

<p>If I were to put:</p>

<pre><code>for (i = 0; i &lt;= 140 &amp;&amp; (c = getchar()) != EOF; ++i)
</code></pre>

<p>i would go from 0 to 140, going through 141 iterations. Therefore going out of bounds.</p>

<p>An error would be trying to get the character inside tweet[141], when the array only goes up to 140.</p>

<h4>Exception handling for run time errors</h4>

<p>It is a structured way to to catch unexpected situations, predictable errors and unusual results without going crazy checking every line of your code.</p>

<p>Exceptions are anomalies.</p>

<p>Handling means: to resolve.</p>

<p>Therefore.</p>

<p>To resolve anomalies.</p>

<p>This topic can go dense and hardcore <a href="http://en.wikipedia.org/wiki/Exception_handling">here</a></p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Having Your First Kid is Like a Linux Computer]]></title>
    <link href="http://tomordonez.com/blog/2013/02/16/having-your-first-kid-is-like-a-linux-computer"/>
    <updated>2013-02-16T12:59:00-05:00</updated>
    <id>http://tomordonez.com/blog/2013/02/16/having-your-first-kid-is-like-a-linux-computer</id>
    <content type="html"><![CDATA[<p>Life pre-kids is like being an eternal Windows user.</p>

<p><img src="http://tomordonez.com/images/blue%20screen.jpg" height="300" width="350" alt="When you get this screen you wish you had a chainsaw" /></p>

<p>You get the usual blue screen of death, adware, trojans but you are used to things that work how they expect to work.</p>

<p>You can install pretty much any program and they all work.</p>

<p>Word and Excel work.</p>

<p>Chrome and Firefox work.</p>

<p>You still wish Internet Explorer should go to hell.</p>

<p>Skype works.</p>

<p>You hate how Norton popsup to everything but you know you need it.</p>

<p>Life is normal.</p>

<h3>Then you have your 1st Kid</h3>

<p>Having your first kid is like getting your first Linux computer.</p>

<p>You were Windows and suddenly bam! Linux.</p>

<p><img src="http://tomordonez.com/images/linux%20loves%20your%20first%20kid.jpg" height="300" width="350" alt="Linux loves you ahhhh" /></p>

<p>You turn Linux on and it looks kinda the same as Windows.</p>

<p>But then you want to install Office.</p>

<p>It doesn&#8217;t work.</p>

<p>You gotta install Open Office.</p>

<p>But you got no fucking clue how to install things in Linux.</p>

<p>You google it and it tells you about typing stuff in that black window you know as the DOS.</p>

<p>You spend days and you finally realize you need to go to the Synaptic. WTF is that?</p>

<p>A couple of more days pass by and hey! you finally install Open Office.</p>

<p>But Excel doesn&#8217;t work.</p>

<p><img src="http://tomordonez.com/images/linux%20you%20being%20dr%20evil.jpg" height="300" width="350" alt="Linux why you hate me whyyyyy" /></p>

<p>Not as you are used to in Windows.</p>

<p>The damn thing is so cluttered and you don&#8217;t know where to change the page layout.</p>

<p>Ok so you stop messing with Open Office.</p>

<p>You want to install Skype now.</p>

<p>Darn it. They don&#8217;t have an installer just like in Windows?</p>

<p>OK found one but they don&#8217;t hear my voice.</p>

<p>My sound card is not compatible? WTF</p>

<p>OK. Maybe I can use Spotify.</p>

<p>No installer for Spotify? WTF</p>

<p>Oh is in beta. WTF is beta?</p>

<p><img src="http://tomordonez.com/images/beta.jpg" height="300" width="350" alt="Beta comes from betamax, where else? duh!" /></p>

<p>Oh the installer has not been tested yet. I should try it.</p>

<p>It doesn&#8217;t work.</p>

<p>There is a blog post about typing stuff in the terminal. So that&#8217;s what the black DOS window is called.</p>

<p>I don&#8217;t get these commands. This shit still doesn&#8217;t work.</p>

<p>Gave up on Spotify.</p>

<p>Oh there are things free and they are called &#8216;Open Source&#8217;. Let me try this.</p>

<p>The sound is horrible. WTF</p>

<p>There is no Itunes?</p>

<p>Oh there is something like Itunes?</p>

<p>It doesn&#8217;t sound the same. It sounds like if the music was coming from a soda can.</p>

<p>I don&#8217;t get viruses on this thing? awesome</p>

<p>I can browse the internet and watch youtubes.</p>

<p>Shit! Youtube doesn&#8217;t work.</p>

<p>It says I gotta install something and I need to use the terminal. Fuuuuuuc.</p>

<h3>Just like your 1st kid.</h3>

<p>What is a diaper?</p>

<p>How do I change a diaper?</p>

<p><img src="http://tomordonez.com/images/sleeping%20like%20a%20diaper.jpg" height="300" width="350" alt="If you got kids you never sleep this good" /></p>

<p>I have to clean that?</p>

<p>Shit smells like shhh&#8230;</p>

<p>My hands are full of poop. FUUuuuc.</p>

<p>Why is she crying? I fed her.</p>

<p>Not the diaper.</p>

<p>Not sleepy.</p>

<p>Not hungry.</p>

<p>WTF!</p>

<h3>Then you have your 2nd kid.</h3>

<p>And it feels like buying a MAC.</p>

<p>You know how to use the terminal.</p>

<p>You even know some code too.</p>

<p>Everything <strong>seems</strong> easier</p>

<p>Life is awesome.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[How to Visit Chicago Like a Hispanic Living in Chicago]]></title>
    <link href="http://tomordonez.com/blog/2013/02/05/how-to-visit-chicago-like-a-hispanic-living-in-chicago"/>
    <updated>2013-02-05T22:38:00-05:00</updated>
    <id>http://tomordonez.com/blog/2013/02/05/how-to-visit-chicago-like-a-hispanic-living-in-chicago</id>
    <content type="html"><![CDATA[<p>(Note. As every post I write, it comes from the heart so expect a lot of profane language, explicit content and honesty.)</p>

<p>Since moving out of Chicago, I am asked about 5 times a week for advice about tech and startups in Chicago: what to do, who to meet, what to build, how to survive winters and how to cope with people that has never heard of your Latin American country.</p>

<!-- read more -->


<h3>Winter</h3>

<p>Winter goes from November to April. I dare to say that the months of November and December are livable. Cause of the holidays. Everything is Xmas like with the tree and shit. Everybody is in such a good mood.</p>

<p>Then comes January. Fuck January!</p>

<p>Then comes February. Fuck February too!</p>

<p>Then comes March. Fuck you March!</p>

<p><img src="http://tomordonez.com/images/that%20ben%20affleck%20scene.jpg" height="200" width="250" alt="That Ben Affleck scene where he says Fuck You" /></p>

<p>Then comes April. Fucking snow in April too? What the fuck!</p>

<h4>Snow is beautiful</h4>

<p><img src="http://tomordonez.com/images/car%20buried%20in%20snow.jpg" height="300" width="350" alt="Where is my fucking car???" /></p>

<p>The first time I saw snow I picked up a snow fight with a 5 year old and he won. I spent 3 hours outside in the snow. Best day of my life. I learned what &#8216;shoveling your car&#8217; meant. It was such a great work out.</p>

<p>The 2nd time it snowed I made snow angels, like in the movies. It was awesome. I also had hot cocoa and made my first snowman. With the carrot and shit. Although I don&#8217;t remember getting my scarf back.</p>

<p>I shoveled my car once more. Pretty good workout.</p>

<p>3rd time it snowed. I really had to use my car. It was 5F. The gloves I was using were not exactly water proof and I also slipped on ice and almost break my foot.</p>

<p>Snowing still awesome though. All fluffy white. Like the marshmallow man in the ghostbusters movie.</p>

<p>4th time it snowed. It must have been like 2F. By the way F stands for Fucking Cold. It was 2 Fucking Cold. There was ice under my car and I couldn&#8217;t drive off the giant block of ice that my car was sitting on. Somebody passed by and said I needed to put salt.</p>

<p>Salt?</p>

<p>What the fuck!</p>

<p>I thought he was fucking with me, cause he saw me all hispanic looking.</p>

<p>I googled it. And it says that salt helps ice melt faster. Pinche gringo tenia razon.</p>

<p>I went to find some salt in the kitchen.</p>

<p>I got the box of salt I use for cooking mi carne asada.</p>

<p>That shit didn&#8217;t work!</p>

<p>Some other gringo walked by and he laughed his ass off.</p>

<p>I told him he was a &#8216;gringo grande y jueputa&#8217; but he didn&#8217;t speak Spanish. Good cause he was some giant Irish mofo.</p>

<p>The handyman saw me struggling. He was from Mexico and gave me a bag of salt. I am talking about a big ass bag of salt that weighs like 50 pounds. And the grains of salt are big like marbles. Never seen that in my life.</p>

<p>He tells me about how to survive in the winter. Guy was like a Mexican MacGyver.</p>

<p>He also got me a decent shovel and a windshield scraper. Man that guy was such a good hispanic!</p>

<p>Then came the sludge. The black ice. The snow boots. The long underwear. Wearing all the clothes you own. And then came&#8230;</p>

<h4>DIBS</h4>

<p>Fuck you DIBS. Fuck you.</p>

<p>For those of you that don&#8217;t know DIBS. Is this:</p>

<p><img src="http://tomordonez.com/images/chicago%20dibs.jpg" height="300" width="350" alt="Fuck you Dibs" /></p>

<p>When you thought that we were civilized cause we know how to use computers and walk with 2 legs. It all came down to DIBS.</p>

<p>The picture above looks like a neighborhood block meeting. But is not.</p>

<p>After you break your back shoveling the snow off your car. What better way but to claim your spot with old furniture.</p>

<p>People that don&#8217;t own cars bitch about it. They say &#8216;it must be all those hispanics bringing their culture here&#8217;. But is not only hispanics. It&#8217;s the east europeans, the irish, the italians, the germans y los pinches gringos tambien. Cabrones. Somos todos pues!</p>

<p>After you break your back. It ONLY makes sense to save your spot. Even though it is the public street and you don&#8217;t really own it. You have to claim it.</p>

<p>If you don&#8217;t you are an asshole and everybody will think you are one.</p>

<h3>Spring</h3>

<p>All the flowers start to bloom, everything is so pretty. And suddenly smells like spunk.</p>

<p>Yeah it seems that whoever planted the trees in Chicago back in the 1800s thought it would be funny to plant a tree that when the flower blooms, it smells like spunk. (Defined in Wikipedia as &#8220;a colloquialism for seminal fluid&#8221;. Not kidding. Look it up!)</p>

<p><img src="http://tomordonez.com/images/tree%20allergy.jpg" height="300" width="350" alt="Fucking tree that smells like" /></p>

<p>Those bastards smell so fucking bad. And when the flower decides to spread their seed all over the midwest the flow all around the air and gets in your nose, ears, mouth, it clogs your car, it makes you sick and you sneeze every fucking minute.</p>

<h3>Spring to Summer to Fall</h3>

<p>Then the pink smelly flowers are gone. And it gets warm and it is heaven. And people are nice again. And friendly. And they even care to know about the Latin American country you are from. And you go out a lot! And you meet hundreds of people. And they all like you because you are hispanic and exotic and they like your accent, specially the female kind.</p>

<h3>Hispanics</h3>

<p>If you are in Chicago and you are hispanic, by default you are Mexican.</p>

<p>If you are in Chicago and you are hispanic, by default you eat tacos.</p>

<p>You gotta make a great effort if you are from another latin american country. Unless they went to college. A lot of americans that live in Chicago and that went to college are very fucking smart.</p>

<h3>Hispanic Tech</h3>

<p>In five years I lived in Chicago I only met a few hispanic people related to tech or startups.</p>

<p>Why?</p>

<p>No fucking clue.</p>

<p>But I felt like a Plutonian. Not a Martian. I was one already being hispanic. But I was a Plutonian cause I was hanging out with the tech and startups.</p>

<p>I became the micrority.</p>

<p>As an hispanic when you meet another hispanic outside of Latin America you usually fraternize. You got things in common. You know how bad it felt when Colombia won 5 to 0 against Argentina in the late 90s. You all know about Cerati, Los Fabulosos, Cafe tacuba, Mana, Los prisioneros. Tu cafe con leche. Tu empanada. Tu tamal. Tu cultura. Tu gente.</p>

<p>And I assumed that all hispanics in Chicago were nice.</p>

<p>I categorized hispanics in Chicago as</p>

<ul>
<li>Born and raised in the US</li>
<li>Immigrants that moved after high school</li>
</ul>


<p>Big difference here. Born and raised in the US living in Chicago. Were not what I expected. Son muy agringados. And the reality is that they never lived what an immigrant from Latin America lived. The traffic jams and crazy shit of the magic reality.</p>

<p>While hispanic immigrants were fucking awesome people. Cause we had so many things in common.</p>

<h4>Hispanic immigrants in tech</h4>

<p>As a hispanic immigrant these are the hispanics you got to meet. They are the ones that &#8220;echan pa lante&#8221; and &#8220;con toda&#8221; and naturally believe on the &#8220;si se puede&#8221;</p>

<h3>Chicago tech</h3>

<p>The usual places to hang out such as all those fucking meetups. All those hackathons and tech events. But the ones that are the most valuable are:</p>

<ul>
<li>Code and Coffee Tuesdays from 7am-9am</li>
<li>Hackathons</li>
<li>Startup weekends</li>
<li>Beer networking</li>
</ul>


<p>You find the most valuable connections communicating closely with a small batch of people. Hackathons and events like startup weekends are great cause you work hardcore with a team and you get to know each other well.</p>

<p>There are also meetups. But you build the better relationships if those meetups have a &#8216;let&#8217;s get a beer after&#8217;</p>

<p>You can build great relationships over beer.</p>

<h3>Conclusion</h3>

<p>Chicago is a great place for tech. Even when it feels like the north pole. I met some of the smartest and nicest people.</p>

<p>But the winter is indescribable. You gotta to experience it to really understand what is like.</p>

<p>I am proud of the Mexicans. They are some of the toughest mothefuckers I know and I am proud of them.</p>

<p>If you are not Mexican you will not last more than 5 years there.</p>

<p>This post was inspired by <a href="http://go-go-go.org/2013/02/04/how-to-visit-chicago-like-a-chicagoan/">this one</a> written by Ed who I met once and found his post randomly on twitter. Life&#8217;s a trip, &#8216;que no!&#8217;</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[What is a Code Janitor - Winston Wolf]]></title>
    <link href="http://tomordonez.com/blog/2013/01/28/what-is-a-code-janitor-winston-wolf"/>
    <updated>2013-01-28T08:31:00-05:00</updated>
    <id>http://tomordonez.com/blog/2013/01/28/what-is-a-code-janitor-winston-wolf</id>
    <content type="html"><![CDATA[<p>These are developers:</p>

<p><img src="http://tomordonez.com/images/dirty%20developers.jpg" height="300" width="350" alt="Dirty Developers" /></p>

<p>This is a code janitor:</p>

<p><img src="http://tomordonez.com/images/code%20janitor.jpg" height="300" width="350" alt="The template of a code janitor" /></p>

<p>Code Janitors clean your fucking mess.</p>

<!-- read more -->


<p>They clean this:</p>

<p><img src="http://tomordonez.com/images/dirty%20code.jpg" height="300" width="350" alt="dirty code" /></p>

<p>To this:</p>

<p><img src="http://tomordonez.com/images/clean%20code.jpg" height="300" width="350" alt="clean code" /></p>

<p>Code Janitors are essential because:</p>

<ul>
<li>The follow good practices</li>
<li>They don&#8217;t BS you</li>
<li>They convert a frog into a prince</li>
<li>They tell you your code looks like a shit</li>
<li>They clean code</li>
<li>They do testing frameworks</li>
</ul>


<p>Code janitors sit down with you and tell you the truth. They tell you how fucked up things are. They fix things. They are the Winston Wolves.</p>

<p><img src="http://tomordonez.com/images/no%20bs.jpg" height="300" width="350" alt="No BS with Winston Wolf" /></p>

<p>The first Code Janitor that comes to my head:</p>

<p><img src="http://tomordonez.com/images/evan%20light.jpg" height="300" width="350" alt="Evan Light cleans your code" /></p>

<p>Hire him!</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Git remote add github not origin]]></title>
    <link href="http://tomordonez.com/blog/2013/01/27/git-remote-add-github-not-origin"/>
    <updated>2013-01-27T19:38:00-05:00</updated>
    <id>http://tomordonez.com/blog/2013/01/27/git-remote-add-github-not-origin</id>
    <content type="html"><![CDATA[<p>Today someone asked me to explain what this meant:</p>

<pre><code>git remote add origin git@github.com:username/some_app.git
</code></pre>

<p>He kept banging his head for hours trying to understand what origin meant. The origin of what?</p>

<!-- read more -->


<p>This is not the first time I hear this.</p>

<p>He tells me he has been running this command for a couple of months without really understanding what it meant.</p>

<p>Here is a quick answer, before I go into the real subject of this post.</p>

<p><img src="http://tomordonez.com/images/giz%20remote.jpg" height="300" width="350" alt="git remote add gizmo" /></p>

<h3>Git remotes</h3>

<p>If you are here I assume you are learning Rails.</p>

<p>Look at the following line</p>

<pre><code>git remote add origin git@github.com:username/some_app.git
</code></pre>

<p>You are telling Git to add a connection to the remote repository <code>some_app.git</code>. The nickname of this connection is called <code>origin</code>.</p>

<p><strong>The nickname</strong></p>

<p>Yes, <code>origin</code> is a nickname.</p>

<p>I don&#8217;t really use this nickname. I would use:</p>

<pre><code>git remote add github git@github.com:username/some_app.git
</code></pre>

<p>If the remote repository is on github.</p>

<p>Does it have to be <code>github</code>?</p>

<p>Nope. As I said it is just a nickname.</p>

<p>You can call it:</p>

<ul>
<li>Godzilla</li>
<li>Mothra</li>
<li>Slimey</li>
<li>Gizmo</li>
</ul>


<p>You can call it whatever you want.</p>

<pre><code>git remote add gizmo git@github.com:username/some_app.git
git remote add mothra git@github.com:username/some_app.git
git remote add origin git@github.com:username/some_app.git
git remote add icanhascheezburger git@github.com:username/some_app.git
</code></pre>

<p>Be careful though. If you are sharing the repository with somebody else. He must think you:</p>

<ul>
<li>Lost it</li>
<li>Are not funny</li>
<li>Are unstable</li>
<li>Are going trough a mid-life crisis.</li>
</ul>


<p>You have to name it as whatever you think is easier for you and your team.</p>

<h3>New developers</h3>

<p>In this new wave of startuping everybody is looking for a CTO. After a couple of months of rejections and trial and errors, they realize that is not easy.</p>

<p>Then they outsource their idea to another country that has cheaper labor and they get screwed up.</p>

<p>Then they might decide to learn programming, aka learning to code. They sign up to all these online coding schools, watch a bunch of screencasts and become&#8230;</p>

<h3>Copy/Paste developers</h3>

<p>Never hire copy/paste developers.</p>

<p><img src="http://tomordonez.com/images/copy%20paste%20devs%20are%20laughable.jpg" height="300" width="350" alt="copy paste developers are laughable" /></p>

<p>They are easy to spot. But if you don&#8217;t know any programming they can get away with it.</p>

<p>Copy/paste developers take code from websites or other open source projects and paste them into their software without fully understanding what such code does.</p>

<p>They also use shortcuts.</p>

<p>If they use a framework such as rails. They scaffold the heck out of their apps.</p>

<p>&#8220;Scaffolding&#8221; in Ruby on Rails is a way for demonstrating functionality of web applications, but it should never be used for real.</p>

<p>If you know some Rails, you can tell when they do that and they act as if they didn&#8217;t commit a crime.</p>

<p><strong>Why do new developers become copy/paste developers?</strong></p>

<h3>Lack of mentorship</h3>

<p>Mentorship.</p>

<p>Maybe more like Mastership.</p>

<p><img src="http://tomordonez.com/images/mastership.jpg" height="300" width="350" alt="I can Has Mastership" /></p>

<p>This is similar to a Big Brother.</p>

<p>Maybe more like an advisor.</p>

<p>Not everybody is (should be) a mentor, just like not everybody is a good teacher.</p>

<p>And I emphasize. Not everybody should be a mentor.</p>

<p>Mentors means teaching, advising, guiding, listening, learning, pushing.</p>

<h4>Mentors need to slap you</h4>

<p>I don&#8217;t mean it literally&#8230;although maybe they should.</p>

<p>Mentors should have life experience, personally and professionally.</p>

<p>An ideal mentor should have not only technical but also business experience.</p>

<p>Mentors should slap you when you are doing things wrong. When you are wasting your time on things you should not be doing. When you start to get bad habits.</p>

<h4>Mentors need to kick your ass</h4>

<p><img src="http://tomordonez.com/images/mentors%20need%20to%20kick.jpg" height="300" width="350" alt="Mentors need to kick yo ass" /></p>

<p>When you already developed bad habits.</p>

<p>When you are stubborn.</p>

<p>When you don&#8217;t listen.</p>

<p>When your cup seems full.</p>

<h4>Mentors should be advisors</h4>

<p>Or career counselors.</p>

<p>They should be able to teach you. Not everybody is a teacher. Some people can be great at something but they are horrible teachers and they don&#8217;t even know it.</p>

<p>They should be good listeners and be patient to explain in different ways a problem.</p>

<p>Mentors should learn from you.</p>

<p>Nobody knows everything. Even mentors don&#8217;t know everything. They should be able to say &#8220;I really don&#8217;t have a clue about that&#8221;. But should be willing to figure it out.</p>

<p>Mentors should guide you. They should be able to give you a plan and you should expect to adapt if the plan changes.</p>

<h3>Kicking the bad habits</h3>

<p>It is hard to kick bad habits.</p>

<p>It is as hard as asking somebody to quit smoking.</p>

<p><img src="http://tomordonez.com/images/smoking%20developer.jpg" height="300" width="350" alt="Kick the Habit!" /></p>

<p>Bad habits has direct and indirect effects on the world.</p>

<p>Bad habits cause an airline ticketing system to <a href="http://www.smh.com.au/travel/travel-news/thousands-caught-in-system-crash-20121110-294k3.html">crash</a></p>

<p>You know how much money is lost when an airplane is not flying? about USD$20,000 an hour.</p>

<p>A 3 hour outage at an airport can cost millions of dollars.</p>

<p>Bad habits, just as smoking can fuck things up really really bad.</p>

<h3>Stop this abuse</h3>

<p>If you think you are copy/pasting code. Stop!</p>

<p>You should know what you are typing.</p>

<p>Stop your ignorance.</p>

<p>Bridges are not built using shortcuts.</p>

<p>Stop and learn.</p>

<p>Then use your knowledge to build things in the right way.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Android is Fender Squier Iphone is MusicMan StingRay]]></title>
    <link href="http://tomordonez.com/blog/2013/01/22/android-is-fender-squier-iphone-is-musicman-stingray"/>
    <updated>2013-01-22T21:54:00-05:00</updated>
    <id>http://tomordonez.com/blog/2013/01/22/android-is-fender-squier-iphone-is-musicman-stingray</id>
    <content type="html"><![CDATA[<p>From Iphone to Android to Iphone.</p>

<p>I used to be an Android for 2 years.</p>

<p>Returned from the dark side to be an Iphone 5.</p>

<p>From Fender Squier to Musicman.</p>

<p>I used to play Squier then I moved to MusicMan. Never going back.</p>

<p>I am talking about the basses.</p>

<!-- read more -->


<p><strong>This is a Fender Squier</strong></p>

<p><img src="http://tomordonez.com/images/squier.jpg" height="300" width="350" alt="This is a Fender Squier" /></p>

<p><strong>This is a MusicMan StingRay</strong></p>

<p><img src="http://tomordonez.com/images/musicman.jpg" height="300" width="350" alt="This is a MusicMan StingRay" /></p>

<p>If you don&#8217;t play a bass, they look similar to you. If you don&#8217;t know about laptops you wouldn&#8217;t know the difference between a Dell and a MAC. Or between an Android and an Iphone.</p>

<p>The difference is that the market price of a Fender Squier is $150 <a href="http://www.amazon.com/Squier-Fender-Bronco-Bass-Black/dp/B0002F75P6/ref=sr_1_2?ie=UTF8&amp;qid=1358909920&amp;sr=8-2&amp;keywords=fender+squier+bass">see in amazon</a> while the MusicMan StingRay goes for $1500 <a href="http://www.amazon.com/Music-Man-Stingray-Double-Humbucker/dp/B001SASYVI/ref=sr_1_7?ie=UTF8&amp;qid=1358909978&amp;sr=8-7&amp;keywords=musicman+bass">in amazon</a></p>

<p>What a price difference uh?</p>

<p>From $150 to $1500.</p>

<h3>The Fender Squier bass</h3>

<p>I quote from Wikipedia&#8230;</p>

<p>&#8220;In the late 1970s and early 1980s Fender was facing competition from lower priced Japanese made guitars. The higher priced Fender guitars were made in America and could not compete with the lower prices of Japanese made Fender copies&#8221;</p>

<p>I should emphasize the word <strong>copies</strong>.</p>

<p>The Fender Squier bass is a lower priced bass. They are at the bottom of the bass range. It is made of subpar components.</p>

<p>It is not a bad bass.</p>

<p>If you are a beginner. You should get this one.</p>

<p>But I wouldn&#8217;t use this bass on a live concert. It&#8217;s good enough to play at home.</p>

<p>Fender also produces Fender basses, not of the Squier brand, which are high-quality made professional basses on the medium and high ranges (say $600 to $5000)</p>

<p><a href="http://en.wikipedia.org/wiki/Fender_bass">Read more on Wikipedia</a></p>

<h3>The MusicMan StingRay</h3>

<p>Talking about startups.</p>

<p>And I quote from Wikipedia&#8230;</p>

<p>&#8220;In 1971, Fender employees Forrest White and Tom Walker, unhappy with the way CBS was managing the company, left their positions with Fender to start their own venture. The company began producing a hybrid tube-solid state amplifier co-designed by Tom Walker and Leo Fender, who was participating as a silent partner to the firm due to a &#8220;no compete&#8221; clause in the sales contract Fender had signed when he sold his original company to CBS in 1965. After the clause expired in 1975, he was made president of MusicMan, Inc., and by 1976 his consulting firm CLF Research had begun producing instruments bearing the MusicMan name.&#8221;</p>

<p>The MusicMan is everything that Fender couldn&#8217;t be back in the day.</p>

<p>The MusicMan StingRay appeared in 1976 and was highly innovative.</p>

<p>This baby is played by intermediate and professional players. Play it at small bar concerts and at a stadium concert. The combination and high-quality of its materials makes it the &#8220;dream bass&#8221;.</p>

<p>These are folks that play this bass. They might look familiar.</p>

<p><img src="http://tomordonez.com/images/randy%20jackson.jpg" height="300" width="350" alt="This mofo" /></p>

<p><img src="http://tomordonez.com/images/john_deacon.jpg" height="300" width="350" alt="The dentist" /></p>

<p><img src="http://tomordonez.com/images/tim.jpg" height="300" width="350" alt="This mad mofo" /></p>

<p><img src="http://tomordonez.com/images/cliff_williams.jpg" height="300" width="350" alt="This other dude" /></p>

<h3>The Android</h3>

<p>My 2 year experience with the android was not pleasant.</p>

<p>The son of a gun crashes every so often, it is motherfuggin slow at capturing pictures, it drops calls.</p>

<p>To restart it, you need to remove the battery.</p>

<p>The only way to remove the lid on the back of the phone is by dropping the phone onto the floor.</p>

<p>Yep, read correctly. Dropping the phone.</p>

<p>Suddenly today, the phone stopped charging the battery.</p>

<p>Maybe cause I dropped it too many times. But that was the only way to &#8220;un-crash&#8221; my phone.</p>

<p>I never really understood the swiping of the words, it would never spell the correct word.</p>

<p>I never ever used the green button that has a &#8220;g&#8221;.</p>

<p>It uses all the battery when trying to find cell signal.</p>

<p><strong>The Android is the Fender Squier of phones</strong></p>

<h3>The Iphone</h3>

<p>The Iphone makes sense. It is well designed. It is simple. Not overloaded with features. It is ultra fast at taking pictures. It doesn&#8217;t drop calls. It doesn&#8217;t crash. At least not 3 times per week. Siri is not great but I assume they will make it better.</p>

<p><strong>The Iphone is the MusicMan StingRay of phones</strong></p>

<h3>Open Letter to Android</h3>

<p>Constructive criticism trolling of the android in 3..2..1</p>

<p>Put your fucking shit together!</p>

<p>That was harsh I know. But I cannot express in any other way. I cannot really say &#8220;you are good enough&#8221;</p>

<p>I cannot say &#8220;May I politely say, that even though you have some failures, you can improve some features to create a better User experience.&#8221;?</p>

<p>No!</p>

<p>Why should I adorn my true opinions with falsity.</p>

<p>The real problem of Android is that there are too many phones out there.</p>

<p>If there would be only 1 (or 2 at most) Android phones, Android would be an awesome experience.</p>

<p>With fewer phones, Android could regulate the software better and make the hardware maker comply with the specifications and quality control of the software.</p>

<p>But the reality is different.</p>

<p>Too many phone manufacturers customizing the software however they want it. There is not a standard.</p>

<p>The same as manufacturing cheap copies of Fender basses. There are dozens of Fender clones out there that don&#8217;t care about the user experience or quality.</p>

<p>No more Android for me. Not for now.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Introducing My Imaginary Friend Hal]]></title>
    <link href="http://tomordonez.com/blog/2013/01/12/introducing-my-imaginary-friend-hal"/>
    <updated>2013-01-12T22:19:00-05:00</updated>
    <id>http://tomordonez.com/blog/2013/01/12/introducing-my-imaginary-friend-hal</id>
    <content type="html"><![CDATA[<p>Let me introduce to my imaginary friend Hal.</p>

<p><img src="http://tomordonez.com/images/hal.jpg" height="300" width="350" alt="My friend Hal" /></p>

<p>Pushing the boundaries of learning.</p>

<p>I decided to create an imaginary friend.</p>

<h3>I invoke Hal when:</h3>

<ul>
<li>Driving alone (commutes)</li>
<li>Taking a shower and getting dressed</li>
<li>Walking alone (when applicable)</li>
<li>Any situation when I am alone</li>
</ul>


<!-- read more -->


<p>I mentioned this to someone and she&#8230;</p>

<p><img src="http://tomordonez.com/images/insane%20in%20the%20membrane.jpg" height="300" width="350" alt="Flipped out" /></p>

<h3>Why do invoke Hal for?</h3>

<p>Instead of wasting my time day dreaming I decided to spend my time thinking about code.</p>

<p>I ask Hal how I should approach a coding problem. I argue with him over the logic of the program and we pair program writing the code in our heads.</p>

<p>So far I have seen good results.</p>

<p>Learning has improved tenfold.</p>

<p>If you see me talking to myself out loud in a language that doesn&#8217;t sound like English or Spanish. I am talking code to Hal.</p>

<p><img src="http://tomordonez.com/images/tomordonez_4.gif" height="300" width="350" alt="This mofo is Hal" /></p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[About Learning to Code and Coding Schools]]></title>
    <link href="http://tomordonez.com/blog/2013/01/07/about-learning-to-code-and-coding-schools"/>
    <updated>2013-01-07T18:58:00-05:00</updated>
    <id>http://tomordonez.com/blog/2013/01/07/about-learning-to-code-and-coding-schools</id>
    <content type="html"><![CDATA[<p><img src="http://tomordonez.com/images/homer%20pc.jpg" height="300" width="350" alt="Code like Homer" /></p>

<h3>If you are studying Computer Science:</h3>

<p>You don&#8217;t need to attend a coding school. You are already learning the foundations of programming that allows you to sync your brain into development mode. You have the analytical skills to write great code. During your senior year you should try and learn something they don&#8217;t usually teach, like Ruby on Rails, Python on Django or Objective C. Stick to one of these and kick ass. You should go to local meetups about tech and participate furiously.</p>

<!-- read more -->


<h3>If you are not studying CS or didn&#8217;t study that:</h3>

<p>It is hard. But like everything in life, nothing is easy.</p>

<p>Let&#8217;s see why it is hard.</p>

<p>Do you understand this?</p>

<pre><code>コ ー ド を 学 ぶ
</code></pre>

<p>Yeah, I didn&#8217;t think so.</p>

<p>What about this?</p>

<pre><code>Que onda güey, me chinga tu madre
</code></pre>

<p>Looks familiar, right? But you have no clue what it says.</p>

<h3>Learning to code is like learning Japanese</h3>

<p><img src="http://tomordonez.com/images/homer%20japanese.jpg" height="300" width="350" alt="Japanese" /></p>

<p>Yes, this</p>

<pre><code>    コ ー ド を 学 ぶ
</code></pre>

<p>is Japanese.</p>

<p>I don&#8217;t know Japanese. I cannot even read it. To me this looks like a square, a line, an upside Y and just bizarre figures. But they mean something.</p>

<p>Is it possible to learn Japanese in 3 months?</p>

<h3>Learning to code is like learning Spanish</h3>

<p>Learning to code is more like learning Spanish. At least you can read it and try to make some sense out of it.</p>

<p>Is it possible to learn native Spanish in 3 months?</p>

<p>Not sure.</p>

<p>Is it possible to learn native Spanish in 6 months?</p>

<p>Maybe. If the following applies:</p>

<ul>
<li>You live in a Spanish speaking country for 6 months and your only way of communication is Spanish</li>
</ul>


<p>If this doesn&#8217;t apply to you, you might be able to be a proficient non-native Spanish speaker if:</p>

<ul>
<li>Your wife/husband or girlfriend/boyfriend who lives with you is a native Spanish speaker.</li>
</ul>


<p>How long would it take to be a proficient Spanish speaker in this scenario?</p>

<h3>Creating a way of living to learn to code</h3>

<p>To speed up your learning process to learn to code, you gotta create a way of code living.</p>

<p>Similar to moving to a Spanish speaking country.</p>

<p>Think of moving to a Code speaking country, where you can only communicate in code.</p>

<p>How do you recreate such environment?</p>

<h3>Type code > delete code > review</h3>

<p>If you are just starting I recommend getting a book called the K&amp;R C book (make sure is the ANSI C version) which teaches you how to program in C.</p>

<p>Reading the book will not be enough. You got to type things down. You got to get a computer and set it up for coding.</p>

<p>Set aside 3-hour sessions on reading about the foundations of programming. You should be typing code during this session. Don&#8217;t rush through example programs. Instead&#8230;</p>

<p>Delete code!</p>

<p>(True story inspired on the life of Corey Haines&#8230;in theaters soon)</p>

<p>Ya heard me.</p>

<p>This is a good practice and it goes like this:</p>

<ol>
<li>Read the code example and type each word (never copy paste, don&#8217;t be an asshole!)</li>
<li>Understand each line, even if you spend an hour on each line. Make sure you understand every single letter.</li>
<li>Delete all the code you wrote.</li>
<li>Take a 10 min break.</li>
<li>Read the code and type it again.</li>
<li>Delete the code.</li>
<li>Take a 10 min brake.</li>
<li>Type in the code from memory, don&#8217;t look at the book. Try to write it exactly as it was. Take all the time you want. Get up, walk around, think of the code, try to type the same. Then go back to the book and see what errors you made.</li>
<li>Delete the code.</li>
<li>Type in the code from memory again and repeat the process of type code > delete code > review until you get it right without cheating.</li>
</ol>


<h4>Make it your own program</h4>

<p>When you can write the code example by memory, repeat the same process of type code > delete code > review; using your own variables and changing little things here and there but keeping the functionality of the example.</p>

<h4>Code for breakfast, lunch, dinner and every empty time</h4>

<p>You get up in the morning.</p>

<ul>
<li>Spell the same code example out loud on your way to the shower.</li>
<li>Do the same while showering and getting dressed</li>
<li>Do the same while having breakfast</li>
<li>During your commute (if you have one) make up an imaginary friend and discuss with him/her what the problem is (code example), what the approach is to solve it and what the code means, as if you were to explain your imaginary friend who missed the same imaginary class you just took. Write the code in your head.</li>
<li>Repeat the same process for lunch</li>
<li>Repeat the same process on the commute back home</li>
<li>At home repeat the process of type > delete > review</li>
</ul>


<p>Keep on doing the same code example for 2 to 3 days unless you are ready to move to the next code example.</p>

<h3>Your brain needs to work out</h3>

<p><img src="http://tomordonez.com/images/brain.jpg" height="300" width="350" alt="Open your head" /></p>

<p>Think of preparing for a marathon. You gotta train your body and muscles to withstand all that impact.</p>

<p>Your brain also needs to work out. It needs to get used to code.</p>

<p>A day, a few days or a few weeks that you miss going to the gym to train affects your ability to improve your performance.</p>

<p>The same happens with the code. If you stop doing it, you are going to have to do the same example you did before and repeat the whole process of type > delete > review.</p>

<p>Your brain needs a heavier workout if you are not learning to code full time. Or you didn&#8217;t move to Code country.</p>

<h3>On Coding Schools</h3>

<p>This is a matter of another post. There are myths about coding schools. Education as we know it is changing.</p>

<p>Online and offline coding schools are producing copy/paste developers that are flooding the workforce with low-quality work.</p>

<p>Only those that invest on the learning process of the student and provide placement will have the upper hand.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[The Importance of Bitwise Operators]]></title>
    <link href="http://tomordonez.com/blog/2013/01/02/the-importance-of-bitwise-operators"/>
    <updated>2013-01-02T22:15:00-05:00</updated>
    <id>http://tomordonez.com/blog/2013/01/02/the-importance-of-bitwise-operators</id>
    <content type="html"><![CDATA[<h3>Setup:</h3>

<ul>
<li>Xcode 4.3.2</li>
<li>MAC OS X 10.7.3</li>
<li>iterm2</li>
<li>Textmate</li>
</ul>


<h3>Source:</h3>

<p><a href="http://www.cprogramming.com/tutorial/bitwise_operators.html">Bitwise Operators in C and C++: A Tutorial</a></p>

<p>The C Programming Language 2nd ed. Section 2.9 Bitwise Operators.</p>

<h3>Do we need to care about bit operations?</h3>

<p>Alex Allain (source above) mentions this:</p>

<pre><code>Generally, as a programmer you don't need to concern yourself about operations at the bit level...But there are times when you'd like to be able to go to the level of an individual bit.
</code></pre>

<p>I had the urge to write this&#8230;</p>

<!-- read more -->


<h3>The relationship with 1s and 0s and the computer</h3>

<p>Remember that the computer understands 1s and 0s.</p>

<p>1 means on. 0 means off. Just as every other power button on any electronic equipment. Yes, that one that has a vertical line and a circle.</p>

<p>At the component level&#8230;</p>

<p>If you open a computer, inside it has electronic boards, the boards are made out of electronic components. A component is that little black rectangle with legs aka integrated circuit (IC) in Spanish some people call them &#8220;cucarachita&#8221; (little cockroach).</p>

<p>Another component could be a diode. A diode is like a mechanical valve that allows to run fluid in only one direction. In this case a diode allows to run current only in one direction.</p>

<p>To make the diode run current I have to give him a 1. If I don&#8217;t want him to run current I have to give him a 0.</p>

<p>The case goes obviously very complex and you gotta study engineering to get into all the details and actually care about it. You can also go to Radioshack and ask for a DIY electronic kit with tutorial</p>

<h3>What is a byte</h3>

<p>Simply a byte has 8 bits.</p>

<p>&#8220;A byte was the number of bits used to encode a single character of text in a computer&#8221; <a href="http://en.wikipedia.org/wiki/Byte">source</a></p>

<p>The 8 bits standard uses a power of two allowing values from 0 to 255. The heck this means? Keep on reading.</p>

<p>A power of two (if you remember high school math) is a number of the form 2<sup>n</sup> (two to the power of n)</p>

<ul>
<li>2<sup>0</sup> = 1</li>
<li>2<sup>1</sup> = 2</li>
<li>2<sup>2</sup> = 4 and so on&#8230;</li>
</ul>


<p>2 is the base of the binary numeral system.</p>

<h3>What is a bit</h3>

<p>A bit can have the value of 1 or 0. These two values can also be interpreted as logical (true/false or yes/no)</p>

<p>More info on <a href="http://en.wikipedia.org/wiki/Bit">wikipedia</a></p>

<h3>Truth Tables</h3>

<p>Bitwise operators follow the truth tables. If you don&#8217;t remember algebra, here is a <a href="http://en.wikipedia.org/wiki/Truth_table">reminder</a></p>

<p>&#8220;A truth table is a mathematical table used in logic&#8221;</p>

<p>In the following tables T means True and F means False. Just shut up and eat!</p>

<h4>Table of NOT</h4>

<pre><code>A   NOT A
T     F
F     T
</code></pre>

<h4>Table of AND</h4>

<pre><code>A   B   A AND B
T   T      T
T   F      F
F   T      F
F   F      F
</code></pre>

<h4>Table of OR</h4>

<pre><code>A   B   A OR B
T   T      T
T   F      T
F   T      T
F   F      F
</code></pre>

<h4>Table of XOR</h4>

<pre><code>A   B   A XOR B
T   T      F
T   F      T
F   T      T
F   F      F
</code></pre>

<h3>Bitwise operators</h3>

<pre><code>&amp; bitwise AND
| bitwise inclusive OR
^ bitwise exclusive OR (XOR)
&lt;&lt; left shift
&gt;&gt; right shift
~ one's complement
</code></pre>

<h3>Some examples of bitwise operations</h3>

<p>&#8220;The byte is the lowest level at which we can access data; there&#8217;s no &#8220;bit&#8221; type, and we can&#8217;t ask for an individual bit&#8230;every bitwise operator will be applied to, at a minimum, an entire byte at a time&#8221; - <a href="http://www.cprogramming.com/tutorial/bitwise_operators.html">source</a></p>

<p>Using AND</p>

<pre><code>01001000 &amp;
10111000 =
--------
00001000
</code></pre>

<p>Equivalent to 72 &amp; 184 = 8</p>

<p>You just flipped out right?</p>

<p>True = 1
False = 0</p>

<p>Now go to the AND table above:</p>

<ul>
<li>1 &amp; 1 = 1</li>
<li>1 &amp; 0 = 0</li>
<li>0 &amp; 1 = 0</li>
<li>0 &amp; 0 = 0</li>
</ul>


<p>If you do that for this, from right to left, you will get it.</p>

<pre><code>01001000 &amp;
10111000 =
--------
00001000
</code></pre>

<h4>Converting binary to decimal</h4>

<p>Think if the binary number as an array that starts at zero from right to left. Look at this figure:</p>

<p><img src="http://tomordonez.com/images/binary%20to%20decimal.jpg" height="300" width="350" alt="Binary to decimal" /></p>

<p>The previous binary operation is equivalent to</p>

<pre><code> 72 &amp;
184 =
---
 8
</code></pre>

<p>Remember we are not doing the regular addition, we are doing the logical operation AND.</p>

<h3>Left and Right shift bitwise operations</h3>

<p>With the left shift operator, you move the bits a number of places to the left.</p>

<pre><code>[variable] &lt;&lt; [number of places]
</code></pre>

<p>Pretend that at the following function you are passing as number 8, which in binary is 00001000, and as number of places 2.</p>

<pre><code>int left_shift (int number, int number_of_places)
{
    return number &lt;&lt; number_of_places;
}
</code></pre>

<p>In binary the result would be 00100000, which is the number 32.</p>

<p>The operation is equivalent to</p>

<pre><code>result = number * 2^number_of_places
result = 8 * 2^2
result = 8 * 4
result = 32
</code></pre>

<p>&#8220;&#8230;using the left and right shift operators will result in significantly faster code than calculating and then multiplying by a power of two&#8221;</p>

<h3>The Bitwise complement ~</h3>

<p>The bitwise complement ~ (tilde) flips all the bits. If you have a 1, it will be a 0 and vice versa.</p>

<h3>Application of bitwise operation: Exclusive-or encryption</h3>

<p><a href="http://www.cprogramming.com/tutorial/xor.html">Source</a></p>

<p>The author of this article says that using Exclusive-or aka XOR is almost unbreakable.</p>

<p>XOR is a binary operator, since it takes 2 arguments. It will return True only if one of the arguments is true.</p>

<p>If you only know the result there no way to know the values of the arguments. But if you know A or B and you have the result, you know the value of the other argument.</p>

<pre><code>If A is T and the result is T, you know B is F
If A is T and the result is F, you know B is T
</code></pre>

<p>The principle of XOR encryption is that if you have the encrypted string (A) and the encryption key(B) you will always decrypt correctly (A XOR B).</p>

<p>C uses the character ^ for bit-level XOR.</p>

<h3>Application of bitwise operation: Data compression</h3>

<p>If you want to compress aka zip a file, in plain words it means, to reduce the size of the file, to make something big smaller.</p>

<p>If you need to encode a file to be compressed or need to decode a compressed file you need bitwise operations.</p>
]]></content>
  </entry>
  
</feed>
