This blog has moved to devblog.riesd.com

Wednesday, August 22, 2012

Books That Blew My Mind

Recently Angela Harms asked on twitter for book suggestions.  It turned out that all of my best suggestions were books she had already read.  It made me wonder if the reason I identify so closely with her presentations is because our thinking has been shaped by some of the same realizations.

This got me thinking about how some books have really affected my life.  So I decided to write down this list of books that blew my mind.  I'm also including a short list of which ideas really impacted me from each book since I am curious to know if other people were impacted by the same ideas.

Also I am on the lookout for a new book to blow my mind again so suggestions are welcome.

The Moon is a Harsh Mistress ~Robert A. Heinlein
My Dad told my older brother he would give him $25 to read this book.  I read it and never got paid.
Key Concepts:



Speaker for the Dead ~Orson Scott Card
Ender's Game was a great book.  Fun to read and has a few powerful messages, but the next book in the series is the one that really changed how I saw other people.
Key Concepts:

  • If I lived someone else's life I would probably make the same mistakes they do
  • If I get to really know someone I will love them


Stranger in a Strange Land ~Robert A. Heinlein
Definitely one of my all-time favorite books.  I think I have read it 6 times now.  The skeptical view of common moral concepts and attempt to rationalize human interaction made me step-back from my own beliefs and actions and try to justify my own personality.  I found lots of things worth changing.
Key Concepts:

  • You are absolutely accountable for your own life and potential ("Thou art God")
  • Basically everything Jubal Harshaw says
  • Love should never be used to hurt someone
  • The greatest happiness is finding a water brother


Extreme Programming Explained ~Kent Beck
This was actually a pick from Angela Harms on the Ruby Rogues.  After reading the first 3 chapters I brought up the book in a meeting and convinced by boss to buy a copy.  Shortly thereafter it blew his mind and he started pushing for doing Test-Driven-Development at work.  Hallelujah!
Key Concepts:

  • The best way to be a happy developer is to be effective
  • The key to being effective is good communication with the business
  • I should be justifying all of my own development habits to myself so I can figure out which ones make sense and which are just habits


Book of Mormon
So this might be obvious given my religion, but it did have a few key impacts on my thinking.  It is also the only other book on this list that I have read at least 6 times.
Key Concepts:

  • The book is either a giant farse, or inspired by God.  Go figure out which for yourself.
  • Religion is worth thinking about and I need to figure out what I believe.


Doctrine & Covenants
Another religious text? The things I have learned from the Doctrine and Covenants are really different from what I learned from the Book of Mormon.  In fact I probably would have left the church around age 20 if I hadn't bothered to learn from the Doctrine and Covenants because it takes a lot of the core concepts from the Book of Mormon and explains the back story so they actually make sense.
Key Concepts:

  • God did not create me entirely.
    • This is sort of a corollary to "You are absolutely accountable for your own life". If God made all of me, then I can just claim manufacturer's defect when I screw up.  Actually God is someone fundamentally similar to me who wants to help me become better.
  • The key attribute of Jesus Christ is love.  Fundamentally he loves other people more than himself.
  • The primary purpose for this life is for me to choose what I want without immediate feedback.  This way I can learn what I really want.
  • What I really want is to love other people the way Christ does.
  • Commandments are not a checklist to get into heaven.  They are suggestions for becoming a better person. Suggestions made by someone who loves me and knows what they are talking about. Heaven is about becoming the kind of person who loves other people more than myself.
  • The reason we have marriage and family is because loving other people at a distance is much easier than loving them for a long time at close proximity.  Being totally committed to someone for all eternity is really hard, but very awesome.

Sunday, April 22, 2012

project euler

I have been playing on projecteuler.net recently and I have to reccomend it as an awesome way to play with code.  If you ever feel envious of Dijkstra and the other "mathematician programmers" who wrote proofs and theorems while they programmed, this is a good place to dive into the math side of programming.

Sometimes I will rush through several problems in a row and just brute-force the solutions, but other times I get interested in a particular problem or stuck on a particular problem and I will end up spending a couple of hours reading wikipedia articles about various algorithms and mathematical proofs to help me solve a problem.

So if you love math head over to projecteuler.net.  If you hate math and love programming, this is a good place to start.

Friday, April 13, 2012

Learning to Program

I have been trying really hard to stay focused on my robotics project, but I think I am going to have to take a detour for a little while.  I keep trying to tell people that learning to program is fun and that it isn't hard, but when they ask me where to start and I tell them about html+javscript or using rvm to install ruby it actually starts to sound pretty hard.

So I have been thinking about the best way to learn to program.  The answer of course is to find a project that is fun and start working on it.  So I thought of this idea of a free AI service.

Imagine you can go to a website and click one big button to get started.  In your browser you can write some simple procedural ruby to make a move in a game of tic-tac-toe.  Then you can hit a run button and see your code play against some AI provided by the website.  There could be some guides to making your AI incrementally smarter and eventually you could write the client locally on your machine and have it connect directly the server to play.

The things I love about this idea are:

  • One beautiful language (Ruby of course)
  • Low barrier to entry
    • Play a game and watch it rendered in a single browser window
    • Incrementally add complexity to your AI
  • Interactive
    • Something more interesting than "hello, world" in a console
    • Competive drive to win
  • Plenty of games that can be implemented pretty easily
    • Tic-tac-toe
    • Connect 4
    • Checkers
  • Potentially more difficult games that can be used as code katas or koans (http://codekata.pragprog.com/ -  http://rubykoans.com/)
    • realtime racing game
    • tanks wars type game

Things I'm not sure about:

  • Can I even run ruby code in a browser?
  • Can I safely push in back to the server and execute it there? (tryruby.org)
  • Use websockets to allow the code in the browser to play the game?
  • Use eventmachine to handle the hosting of the game and writing the site-provided AI?
  • Competitions where players or teams can log into a game and compete?

So what do you think? Is this feasible? It certainly sounds like fine and something that I could use with a group of highschoolers to get kids excited about programming.  What challenges am I not thinking about yet?

Friday, March 30, 2012

Ruby Rogues

Have you ever watched a http://www.confreaks.com/ presentation that just blew your mind?  Something like Code Blindness or How Github uses Github to build Github (language warning)?

I love that feeling of realizing, "why haven't I tried that before?"  That sense of learning something new is my favorite thing about the ruby community.  In the spirit of that sense of awesome learning I highly suggest Ruby Rogues.

This podcast has several of my favorite rubyists that I follow and it even has some fellow Utahns that I hadn't known about before.  In addition to that they have guests on the show like Jim Weirich and Kent Beck.  Can you say, "scream like a nerdy fan-girl!"

I started by listening to their most recent podcasts and quickly went back to start at the beginning and get caught up on the backlog of podcast episodes.  They have a great mix of common themes with differing opinions that leave me feeling like, "why haven't I ever done that before?"

If you love programming, you will love the podcast.  Go Ruby Rogues!

Saturday, March 24, 2012

IOIO Controls a Servo

I'm turning into a posting maniac.  I'm just getting excited about how close I am to getting a household robot pet.  This afternoon I modified the HelloIOIO sample application to include a slider bar that controls an RC servo.  I follow a similar approach to http://trandi.wordpress.com/2011/07/03/android-ioio-rc-servo-or-esc/.

Here is a quick video.

Connecting the IOIO

Now that my phone is sending video back to my laptop I am ready to start trying to send commands from my phone to the ioio board.  Luckily the IOIO comes with a besic test app to make sure that your board is working correctly before you start your own experiments.
Here is the basic process:
1) Solder some headers to the pinouts you plan to use.  I just need pinouts for the power, the 5V reference supply and 2 pins that can supply a 5V PWM signal. Not all of the IOIO pins can provide a 5V signal ( https://github.com/ytai/ioio/wiki/Digital-IO )
Imag0159
2) Find a DC power source between 5-15V.  A 3 cell lipo that I had hanging around worked fine for me.  I'm actually using the balance charging plug because those pins just happen to be the right size for my breadboard prototyping wires.
Imag0157
3) Connect the power source to your IOIO vin and GND headers and you should see the power light come on.
Imag0158
4) Download the softare package for your IOIO (https://github.com/ytai/ioio/wiki/Downloads)
5) Install the HelloIOIO.apk file onto your device and start the application.
Install-ioio-apk
6) With your IOIO powered, connect the USB cable to your phone.
7) Now you should be able to hit the on/off button and see the status light on your IOIO turn on and off.
Hello-ioio
SUCCESS!!  Your phone is talking to hardware!  Now it is time to start hacking some servo commands together so we can drive an RC car.

Thursday, March 22, 2012

Step 1 - connect the phone to the robot

So the first step of my project is to make sure I can use my android phone to control my robot.  Since the last post I have decided to scrap the idea of using a Roomba (my Roomba was dropped and damaged).  So my platform of choice for the immediate future will be my E-Revo VXL by Traxxas.

Photo courtesy of Traxxas

In order to get the hardware signals out of my phone and to the ESC/servos of my car I will be using a IOIO.

Photo courtesy of Sparkfun Electronics

And in the spirit of not re-inventing the wheel I will be trying to use the source code from the Cellbots team.  Don't you love opensource software?  They currently don't have any official support for the IOIO, but out of the box their android code does support a browser-based remote control tool and sending images from the camera back to the controlling client.

A cursory glance at their codebase (I wish they were using Github because I love forking and pull requests) looks like they are making some assumptions about using Bluetooth for connecting to the robot, but I should be able to hack together a control class for my IOIO and at least get to the point where I can send some commands from my laptop/browser to the phone and passed onto my IOIO.  From that point it is just a matter of generating the PWM signals that my RC servos/ESC are expecting.

Tonight I got as far as getting the cellbots app on my phone and streamed images back to my laptop and sent some controls back and forth.  The IOIO just arrived in the mail this afternoon so I haven't had a chance to hook that up yet.

Sunday, March 18, 2012

Welcome

So after spending (wasting) lots of time thinking about various ways I could keep track of my various technical hobbies I decided to just use the simplest good tool for the job.  This blog will basically just be a place for me to write down the things that I am working on in the following areas:

  • Robotics
  • Programming
  • RC Aircraft (planes and helis)
I'll backfill some recent content so that blog isn't empty, but mostly I'll be focusing on upcoming projects.  The next big project on the list is taking an online computer vision course (http://www.vision-class.org/) which is slated to start this month.  I'll be taking the class along with my programming buddy Duane and I'll have a project to go with it.

Roomba! I have played with roombas before and rescued one from the D.I. for $10 which is how I got hooked.  For a long time I have thought about using my android phone to act as the brains and sensors for my roomba so I could get it to accomplish more complicated tasks like:
  • Hunt for a tennisball
  • Welcome guests at the door
  • Wander around my office and deliver audio messages (trolling people most likely)
So with the computer vision class coming up I finally ordered a IOIO (http://www.sparkfun.com/products/10748)  which I have been thinking about doing for a while so I am just going to buy it and go get my broken roomba out of storage and hook them together.  Pictures/videos to come soon.