Category Archives: Featured Posts

Resources for Learning Ruby & Ruby on Rails

Over the past couple of months, I’ve been “hitting the books” pretty hard when it comes to Ruby and Ruby on Rails. Here are a number of resources which I have found to be useful and would recommend to other Ruby newcomers:

Tutorials/Guides and Documentation:

http://ruby.learncodethehardway.org/book/

http://ruby.railstutorial.org/

http://www.codeschool.com/

http://www.troubleshooters.com/codecorn/ruby/

http://guides.rubyonrails.org/index.html

https://github.com/styleguide/ruby

http://api.rubyonrails.org/

http://apidock.com/

http://ruby-doc.org/

http://rubydoc.info

Screencasts, etc:

http://railscasts.com/

http://asciicasts.com

http://ruby5.envylabs.com

Good programs to code with:

RubyMine
http://www.jetbrains.com/ruby/

Sublime Text 2
http://www.sublimetext.com/2

Github Tools:

Tower (mac)
http://www.git-tower.com/

Console Tools:

iTerm 2 (mac):
http://www.iterm2.com/

I highly recommend zsh (used in conjunction with prezto) for your shell
https://github.com/robbyrussell/oh-my-zsh
http://railscasts.com/episodes/308-oh-my-zsh
https://github.com/sorin-ionescu/prezto

A Card “Force” Using Unintuitive Mathematical Odds

“A card force is one of any number of methods used in close-up magic to apparently offer a subject a free or random choice of card, when in fact the magician knows in advance exactly which card will be chosen. This can then be revealed later in the trick.”

Premise: We have a set of three cards, all of which are known to us. We attempt to force a specific card on the unsuspecting participant by instructing them to randomly point at one of three cards, which are all laying face down. Theoretically, they have a one in three chance of picking the correct card randomly. If they point at the desired card, we immediately instruct them to flip it, effectively “forcing” the card on them in one try. If this works on the first try, the trick will be especially impressive. However, if it doesn’t work on the first try, we still have a fall-back method:

If they point at one of the other cards, instead of telling them to flip the card, we pretend that they’re playing a game of elimination and we simply remove the card, instructing them to point again. If they point at the next incorrect card, we instruct them to remove it, leaving one final card: the correct one.

Potential downside: If they point at the desired card on the second step, then the “force” fails,
because when we remove it, the end card will actually be the incorrect one.

Cards used: Ace of Hearts (the desired card), Queen of Clubs, and 8 of Spades

Approximate Results After 2000 Simulations:
Times ended on Ace of Hearts: 1322 (0.661)
Times ended on Queen of Clubs: 339 (0.1695)
Times ended on 8 of Spades: 339 (0.1695)

Click here to run the simulations yourself using javascript

Explanation:
Odds of picking the right card during the first step: 1/3. If incorrect card is chosen on first step, we pretend it’s an elimination game and remove the card, leaving only two cards, the desired card, and the incorrect card. At this point, you might think there is an even 50/50 chance they will choose the correct card, but in reality, the odds of them choosing and eliminating the desired card are still 1/3 because it hasn’t been touched. The odds of them choosing and eliminating the second incorrect card, however, have increased to 2/3. This is unintuitive, but the simulation shows it to be true.

Verdict:
Because of the fact that we know which cards are which, we can effectively double our seemingly low 33% odds all the way to 66% simply by using this card force method.

The only unsolved problem is, how do you handle a dead end where someone chooses the wrong card, and then the right card on the second step?

Photoshop Fun – Fake Album Cover

My co-worker, Kent Downer, was showing me some of his facebook photos and one of them jumped out at me. The second I saw it, I just knew I had to photoshop it for fun. Here’s the before and after result:

Photo – Before
(click on photo to see large version):

Kent and Dan on the beach


Photo -After
(click on photo to see large version):

"The Lost Boys" - Album Cover

For a synopsis of the elements used, click here.

Hot Air Balloon Ride

This past Saturday, I went on a hot air balloon ride! We went over a mile high, and it was awesome!

My business partner, Chris Tingom, came along (he rode in the other balloon) and he took a video of the experience, and a few photos. I took a video as well, but he beat me to the punch in getting something up online, so I’m just going to show you his stuff for now. At some point, I’ll eventually get mine all edited and up online for viewing, but that could be a while.

Balloon Ride

Balloon Ride

Balloon Ride

Litmus Test for Door to Door Sales

If I ever get down on my luck, I’m totally going to start a business selling “No Soliciting” signs from door to door.

The way I see it, it’s practically a guaranteed sale…

“Sorry, we’re not interested in whatever you’re selling! In fact, we hate door to door sales people!”

“Well in that case, you’ll love this sign!”

The best part about it is that if they don’t buy the sign, you can just come back every week until they do. After all, they don’t have a sign saying you can’t!

Time Travel

My opinion/theory is that time is linear and takes place at a constant rate. You can not stop time. You can not move back or forward in it. All you have is here and now, which moves along at an unchangeable pace. The only thing that we are able to change is our perception of time. For example, if you put your consciousness on “pause” and go to sleep for 8 hours, when you wake up you have effectively moved your perception of time ahead by those 8 hours. You have not “time-travelled”, however, because time exists outside of your perception. This is evidenced by the fact that many other events continued to take place at their normal pace even while you were asleep.

The biggest thing that gets people all excited about the idea of time travel is Einstein’s theory of relativity, which basically states that, well, everything’s relative.

For example, there’s no way to measure how fast the earth is moving through space because that depends entirely on your viewpoint. If you are standing on earth, it seems like it’s at a stand-still. But if you’re standing on an asteroid that is zipping along at 1,000 miles a second past the earth, then the earth looks like it’s moving really fast.

People have taken the concept of relativaty where it applies to movement and they have mistakenly tried to apply it to time. The reason why they do this is because humans identify and measure the process of time according to the movement of things (i.e. movement of hands on clock, movement of planets and stars, etc…). Technically, if all movement ceased to exist, there would be no way to measure time, so it would appear to have come to a stand-still. However, time would still be moving along at it’s normal rate, even though nobody would be able to measure it. You can’t change time by moving things any more than you can go back in time by moving the hands on your clock.

Here’s another thing that confuses people about time travel, making them think it’s possible: The speed of light.

Light travels at 186,282 miles per second, and the distance it travels in a year is called a “light year”, or 5,878,625,373,184 miles.

The most distant galaxies that our human instruments can detect are at least 10 billion light years away. Some people would say that the fact that we can see this light is evidence that the universe is at least 10 billion years old, because the light had to take that long to get here. Others say that God just flicked a switch and made the all the light from those distant stars just “instantly” travel the distance to earth when He created it.

There’s no way to know for sure, but we at least know this: Light generally takes a long time to travel over long distances.

We also know that humans see using light. Light bounces off of things and hits the back of your eyes, where the resulting signals are interpreted by your brain.

Now here’s the interesting bit. Look up into the sky. If you were to see a star that was exactly one “light year” in distance from the earth, you would effectively be seeing *into the past*. The light hitting your eyes has been travelling that distance for an entire year and is just now reaching you.

When scientists look at a star 10 light years away and they watch it explode, that is an explosion that actually took place 10 years ago! Crazy, huh?

Let’s say we figured out how to travel faster than light, and we flew 100 light years in distance from earth. Then, using an amazingly powerful telescope, if we were to focus in on earth, we would be seeing light that was 100 years old. If you zoomed in a little closer, you might even see people walking around in 1906 clothing, doing whatever people did in 1906.

Does this mean you “travelled back in time”? No! All you did was change your perception of it! It would basically be like rewinding a video-tape to see previous footage. Can you interact with the footage? Nope. It’s just light.

On that same note, you should be able to understand why you can’t “move forward” into time. You can’t change your perception to something that hasn’t taken place! The best you could do would be move close enough to the object in question so that you could see it in the now, instead of merely distant light from the past.

Hopefully now you understand what all the fuss was over time travel and einstein’s theory of relativity, and the speed of light. You should also be able to make sense of all the time travel nonsense that Hollywood puts out. Or at least I hope so…

Boot up Windows before you even log in

If you don’t use any Windows XP login security, then you can skip this article. Otherwise, if you are like many Windows XP users who have to enter a password every time their computer sluggishly boots up, then read this!

Ok. Here’s the scenario:

You have to wait 2 minutes while your computer turns on. You have to sit in front of your computer during this whole time because once it finally gets to the login screen, you have to type in the password. The computer then crunches numbers for another 2 minutes while it loads a wide variety of programs (MSN messenger, your Norton Antivirus, your Microsoft Office shortcut bar, etc…). Finally, after like 5 minutes, you have access to your desktop.

How would you like your computer to load all those programs *before* you ever have to enter your password? You could press the button to power up your system and go get a cup of coffee. Five minutes later, you come to your desk and type in your password. BAM! Instantly dropped to the desktop! Your programs are already running and all systems are a go!

Here’s how to do it:

  1. Download Microsoft’s free TweakUI tool and install it.
  2. Click your Start button, go to your Programs menu, and select Tweak UI from the “Powertoys for Windows XP” folder.
  3. In the TweakUI window, double-click the “Logon” item in the left-hand column to expand it.
  4. Click on the “Autologon” item underneath the “Logon” section.
  5. Check the box that says “Log on automatically at system startup”
  6. Click the “Set Password” button and enter in your windows login password
  7. Click OK and close Tweak UI.
  8. Download this .reg file and run it. When it asks you if you want to merge it with your registry, choose “Yes”.NOTE: If you feel queasy about merging a reg file with your registry, you can also add it by hand. Go to Start > Run and type in “regedit” and press OK. Browse to [HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionRun] and create a new String Value. Name it “Lock Computer on Startup“, and set the value to “rundll32.exe user32.dll, LockWorkStation

Presto! You’re done!

Now, when you boot up your computer, it will automatically log you in to your desktop and start up your programs. However, it will still secure your system, requiring you to enter your password to access it.