brandontreb.com Tips And Resources For Software Consultants

Code Monkey Music Video

Watching this video makes me appreciate the fact that I work from home.



Hacking Redbox – How To Get Free DVDs

Red Box, Video Rental Automat, found in a Wal-…

Image via Wikipedia

I was at Wally-World the other day getting a movie from RedBox with my wife when I noticed some guy enter in a code into the machine. The code was BREAKROOM. After watching him for a moment, I realized this code entitled him a free DVD rental.

Now, RedBox is pretty stinking cheap ($1.50/night), but if you’re an avid movie watcher, this really adds up.

So, I did some searching on the Google machine and sure enough, there are new RedBox codes that go into circulation every day. Each one giving you a free DVD.

The site that offers the RedBox codes is http://www.insideredbox.com/redbox-codes/

Users submit the codes and update the site with the last time they were used. That way, you always know which codes are currently working.

You simply need to enter the coupon code from the main screen or just before checkout at your local Redbox kiosk. When you do, you will receive a one-day free rental. Any additional days you keep the movie will be charged at the usual $1.50/day.

Update: @diemer on Twitter pointed out to me that inside Redbox also has an iPhone app. The link for the app is http://itunes.apple.com/us/app/inside-redbox-pro/id306217360?mt=8

I may actually cancel my Netflix account now…

Reblog this post [with Zemanta]

Great List Of Algorithm Programming Tutorials

Recently TopCoder.com posted a list of algorithm tutorials from some of their “top coders”.

The tutorials are very comprehensive and pretty much sum my undergraduate computer science degree up in one page :) This page is a great resource for anyone that does any amount of coding…

Some of the tutorials include:

  • Greedy algorithms
  • Various sort and search techniques
  • Data structures
  • Graph theory

Here is the link to the Top Coder Tutorials:

http://www.topcoder.com/tc?d1=tutorials&d2=alg_index&module=Static

Reblog this post [with Zemanta]

XCode Shortcut

When in XCode on a MacBook Pro, doing a 3-finger swipe up will switch between the .h and .m files.

⌘-option-up will do the same thing

Productivity++

Reblog this post [with Zemanta]

Programming Tip Of The Day #2 – Difference Between i++ and ++i

To some, this should seem a bit obvious and if I am insulting your intelligence by discussing it, I am sorry. But, one of the main reasons I want to discuss this topic is, I was asked this question in a job interview for Lockheed Martin.

What is the difference between i++ and ++i?

The answer is actually quite simple.

i++ first evaluates the value of i and then increments it

++i increments the value of i and then evaluates it

Here is a brief example to demonstrate what I mean.

// Example: i++ 
$i = 5;
echo "The value of i is " . $i++ ;
// Output "The value of i is 5"
// i = 6
 
// Example: ++i 
$i = 5;
echo "The value of i is " . ++$i;
// Output "The value of i is 6"
// i = 6

So, now if you are ever asked about this in an interview, you will have a response.

Happy programming!