Thursday, March 28, 2013

The end of Berkeley the beginning of Javascript

I'm finally talking about something other than 'RTanque'! I love 'RTanque' and I get to learn more about Ruby when I play around with the tank bots, but enough of 'RTanque' for now.

 The edX Berkeley 169.2x SaaS course is almost over, I can't believe it, 1 more quiz and 1 more homework assignment, and it's over, it officially ends March 31st. The edX course is now having us starting to work with Javascript, so I've decided to try out 'FightCode' the tank battling game that uses Javascript, I figure that will be a fun way to learn more about Javascript.

 I think Javascript makes you more valuable to any team, wether or not you like it, if you're talking to a browser than you are going to need it. I think If I was a coding super hero,  I'd pick Javascript as my super power :)

 It's been a really busy week of shoeing horses, it gets so busy this time of year, I love making more money but I 've gotten a little frustrated the past 2 days because I've only gotten to study for 2 hours per day.

 I need to finish my assignment for the pet rescue site tonight, then tomorrow finish lecture videos for Berkeley's 169.2x final which is about 5-6 hours of videos, basically 2 weeks in 1. Homework and then a quiz due before Sunday at midnight, then they're are a ton of things I'd like to work on of my own.

 I love being swamped with stuff to do coding wise, because I feel like no matter what I do I am going to be learning, in the same token, I don't want to fail and not get everything done. Oh why do I have to go work to make money?! I wish I could just stay home and code :) Okay enough sobbing, now to get to work on the pet rescue site.- Josh

Tuesday, March 26, 2013

'RTanque' Part 3: Basic Targeting


This guide covers how to make a simple targeting tank bot with 'RTanque'.

 (1) Making a basic 'RTanque' tank bot.


Now that you all have seen how to build a basic tank in part 1, and how to clone multiple bots in part 2, we are now going to show you how to make a simple bot that knows how to target other tanks.


 
class BasicBot < RTanque::Bot::Brain
 Getting Started With 'RTanque' Part:1 of 4

class BasicBot < RTanque::Bot::Brain
  NAME = 'basic_bot'
  include RTanque::Bot::BrainHelper
  def tick!
    ## main logic goes here
    # use self.sensors to detect things
    # use self.command to control tank
    # self.arena contains the dimensions of the arena
    self.make_circles
    self.command.fire(0.25)
  end
  def make_circles
  command.speed = MAX_BOT_SPEED # takes a value between -5 to 5 
  command.heading = sensors.heading + 0.01
  end
end  

(2) Now we add the targeting code to the BasicBot.

class BasicTargetingBot < RTanque::Bot::Brain
  NAME = 'basic_targeting_bot'
  include RTanque::Bot::BrainHelper

  TURRET_FIRE_RANGE = RTanque::Heading::ONE_DEGREE * 1.5

# This is a constant, we don't want it to change,
# we use this constant in pointing_at_target? method,
#to make sure our tank's barrel is pointing at the target.

  def tick!
    ## main logic goes here
    # use self.sensors to detect things
    # use self.command to control tank
    # self.arena contains the dimensions of the arena

    self.make_circles
    if we_have_target
      target = we_have_target
      track_target(target)
      aim_at_target(target)
      fire_at_target(target)
    else
      self.scan_with_radar
    end
     
 # self.command.fire(0.25) replaced fire_at_target
  end

  def make_circles
    command.speed = 5 #MAX_BOT_SPEED # takes a value between -5 to 5 
    command.heading = sensors.heading +  MAX_BOT_ROTATION # or you can do something like 0.01 instead of MAX_BOT_ROTATION
  end

  def we_have_target
    self.nearest_target
  end

  def nearest_target
    self.sensors.radar.min { |a,b| a.distance <=> b.distance }
  end

  def track_target(target)
    self.command.radar_heading = target.heading
  end

  def aim_at_target(target)
    self.command.turret_heading = target.heading
  end
  def fire_at_target(target)
    if self.pointing_at_target?(target)
      command.fire(MAX_FIRE_POWER)
    end
  end

  def pointing_at_target?(target)
    (target.heading.delta(sensors.turret_heading)).abs < TURRET_FIRE_RANGE 
  end

  def scan_with_radar
    self.command.radar_heading = self.sensors.radar_heading + MAX_RADAR_ROTATION
  end
end
  
 This is an basic, easy guide to making an 'RTanque' a targeting tank bot. Next up part 4: "Making an "invincible" 'RTanque' tank bot.

 This is Part 3 of a 4 part series on 'RTanque' tank bot making. Cody Kemp @codesterkemp and myself Joshua Kemp @joshuakemp1 will be joint authors during this series.

Monday, March 25, 2013

Michael Hartl's Rails Tutorial and my 1.5 hour Rspec test!!!

My assignment for the side project pet rescue website is a little bit difficult for me, although I would never admit it out loud, so I decided to quickly do the Michael Hartl Rails tutorial again, I've done it before and my brother Cody wants some help tweaking it a little and making it into a different application, so why not help Cody out and for another reason.

In the tutorial if I remember correctly there is a section that deals with the modeling I need to do for the pet rescue website. I figure "Heck, final week of Berkeley edX 169.2x a quiz and homework all do by March 31st, a little work on the side project, why not quickly whip through a 60 hour tutorial in like 5 minutes right?"

As I'm working through the Michael Hartl Rails Tutorial I'm tweaking the names to the tests, and stuff, no bigs, I've done this before, I'll be done in no time flat, till I mess up the final rspec test. Anyway long story short, my quick easy fix, took me 1.5 hours to fix. Yes it was VERY simple. YES I should have figured it out in 5 minutes. NO I didn't so, in honor of that annoying rspec test I included today a screen shot of the test finally passing.



Oh that felt so good to finally get the rspec test to pass, you know the feeling if you've ever started randomly sobbing in Paneras for no apparent reason. If you don't know the feeling, keep coding and you will. - Josh

Sunday, March 24, 2013

Junior Developer RoR in 6 months or 182 days!

I changed my Twitter profile recently, but not my goal. My original goal was to become a Junior Ruby on Rails developer in 6 months, and at the time I just said "Hey my birthday is around 6 months away, heck let's make it April 7th, my birthday."

 Well as time is running out, I want my FULL 6 months, (26 weeks) so I'm changing my 6 month date from my birthday April 7th to April 23rd 2013 which is exactly 6 months from the date I started October 23rd 2012. 182 days, 6 months or 500+ hours.

I'm hoping to leave a guideline or bench mark for others who come after me who want a rough idea on how to get from point A to point B as a self taught programmer, to becoming hired as a Junior RoR Developer.

 This is the end of week 22 of my learning journey, and I didn't do as well this week, because we went to Baltimore's Inner Harbor for my wife's birthday for a few days and I was strictly forbidden to do anything computer related :)

 I only put in 17 hours this week versus my typical 21. My grand total hours of study after 154 days is: 442.50 hours, leaving me 28 days left till my 6 months is up. I should have around 535 hours of studying by then if everything stays on track.

 When I hit 6 months of studying (April 23rd) I think I'm going to add another page on to my blog with a list of books and tutorials I've completed, that way others can see exactly what I've studied and also as a sort of online "Here's what I know", not 100% sure yet.

 I still want to do a Hackathon this year, I also think I will give a "Lightning talk" at possibly Arlington Ruby Meetup on how to use 'RTanque' we'll see, I'm not too hot at public speaking, but hey gotta' start somewhere :) Code, code, code :) - Josh

Tuesday, March 19, 2013

Beginner's guide to 'RTanque' Part:1


This guide covers how to make a very basic tank bot with 'RTanque'.

 (1) Making a basic 'RTanque' tank bot.

First and foremost go to https://github.com/awilliams/RTanque and clone the repo or, Adam has a Quick Start to get you started, which works well and is quick to set up.
The code below is how to make a basic 'RTanque' tank bot, that basically does 3 things:
(1) Shoots,
(2) Adjustable speed,
(3) Circles,will not get stuck against walls.
self.command.fire(0.25) can be adjusted from 0.25 to 5 to change your rate of fire, with the small the number the less frequent, but more damaging and high velocity shot or just set it to MAX_FIRE_POWER to make sure your bot only fires the hardest punching shot.
command.speed = can be adjusted with a number like -5 or 5, or just set it to  MAX_BOT_SPEED to make sure your bot is giving you all she's got.
command.heading = sensor.heading + 0.01 . if you decrease the 0.01 you will decrease the tightness of the circle.
 
class BasicBot < RTanque::Bot::Brain
 Getting Started With 'RTanque' Part:1 of 4

class BasicBot < RTanque::Bot::Brain
  NAME = 'basic_bot'
  include RTanque::Bot::BrainHelper
  def tick!
    ## main logic goes here
    # use self.sensors to detect things
    # use self.command to control tank
    # self.arena contains the dimensions of the arena
    self.make_circles
    self.command.fire(0.25)
  end
  def make_circles
  command.speed = MAX_BOT_SPEED # takes a value between -5 to 5 
  command.heading = sensors.heading + 0.01
  end
end  
This is an extremely basic, easy guide to making an 'RTanque' tank bot, however as the series goes along the final tank bot we'll be showing you how to make will be a force to be reckoned with. The tank is fittingly called "invincible". This is Part 1 of a 4 part series on 'RTanque' tank bot making. Cody Kemp @codesterkemp and myself Joshua Kemp @joshuakemp1 will be joint authors during this series.

Monday, March 18, 2013

'RTanque' Massacre!

I could feel my nose starting to run, it was cold outside, the sky overcast.  I was looking for my fellow tank driver +Jason Wieringa . We had been fighting as a team with 6 other tanks with code knowing to never shoot at our own bots, we were invinciable or so we thought, no single tank could stop our united 8 tank bot fighting force.

 At 12:15p.m. we crested a hill and looked over a valley below, there a single lone bot sat by its self, just roatating and shooting aimlessly. Easy kill! We raced down the mountain side to take out the lone bot called "Lobotomizer", it sat like a lone duck, +Jason Wieringa  taking "Lobotomizer's" flank with 4 tanks, while I headed straight at "Lobotomizer".

Just as we pulled to within firing range, our tanks started having alzheimer like symptoms, they started to forget how to fire, how to drive, where to head, and even who the enemy was, +Jason Wieringa  's tanks did the same, it was as if something evil had erased our tank's code memories.

"Lobotomizer" suddenly perked up and headed toward my tanks with an evil look of triumph, he had lured us in close, to erase our memory and now was coming to finish us off. Oh I wish I had a way to regenerate our system's main "Tick" method, without it we could never think or move again!

I will spare you the bloody gorey details of the slaughter of my battalion's tanks, after the battle I found +Jason in the strewn wreckage of bot bodies and twisted metal and code bits, he and I would survive to fight again another day, when we could take on the evil Dr. Bock +David Bock and his devilishly simple but oh so effect "Lobotimizer" bot.

Even as I write this, in the room next to me in a secret underground bunker, the mad coder +Cody Kemp has found a possible way to regenerate a new "Tick" method. Evil will never triumph, while good coders exist!

I'll keep you posted :) Josh

Wednesday, March 13, 2013

Tank Making and If Else Statements

I'm a noob Rubyist so take any of my rules and advice with that in mind. However with that said, last Sunday +David Bock showed +Jason Wieringa and myself how to use a 'Return' and a hash {} to take 52 lines of 'If Else' statements down to about 2 lines of code.

I was blown away because that's exactly what I do when I don't know what to do, I write lots of 'If Else' statements. I was so glad to learn when in doubt try using 'Return' and a hash {}.

I'm sure there are many more ways to code and not use 'If Else' statements, but for me this is now stuck in my brain as a way to try and get around long lines of repetitive code.

I spent 3 hours today working on 'RTanque' trying to figure out how to make the tanks work and do what I want. It's been harder than I thought it would be, but very fun all the same. Two things I learned about myself while working on making little tank bots today: (1) I need to really understand classes better and how to easily use them without guessing. (2) I am SOOO gonna' lose Sunday at our 'Tank Battle' if I don't do something drastic.

Desperate times call for desperate measures, so I tweeted a really good Rubyist on Twitter who shall be nameless for help, and called an emergency 'RTanque' war room meeting for Thursday with +Cody Kemp+Jason Wieringa ,  +Colin MacDonald, and Matthew Gallagher. I will be working all day on horses Thursday then from 7pm-1am, it's study/battle time!

I would love to see a beginner's guide to 'RTanque', or maybe I'll end up doing one as I get better. I need to work on the pet rescue website tonight, and maybe some homework. Although homework may have to wait to Friday or Saturday we''ll see. This week is going well, 10 hours of study so far and  more tonight. - Josh

Matthew Gallagher

Tuesday, March 12, 2013

400.5 hours of learning RoR in 20 weeks!!!

"Houston, we have lift off!" I can't believe I've finally hit 400 hours and going strong, it went by really fast! My original goal was to study 500 hours by my birthday on April 7th, I can still meet that goal if for the next 4 weeks I study 25 hours per week, I'm going to try and make that happen!

+Jason Wieringa  showed me a really cool thing http://awilliams.github.com/RTanque/ it's basically using Ruby code to have tank wars with other developers. This Sunday it's +Jason Wieringa , +David Bock , +Joshua Kemp to battle it out in WW3, bet your money on me! I'm going find a way to be truly invincible with my tank, and knock out those other 2 tank noobs :)

So much to do, so much to learn and yet we all have the same amount of time! I have a list of 20 - 30 ideas of stuff I wanna' do or make in regards to Ruby on Rails, but just to name a couple that I absolutely must do before this year is out:

1)  Do a Hackathon preferably a 4 person team.

2)  Make my database scheduling app.

3)  Give at least 1 lightning talk at a Ruby Meetup

I will absolutely not be content with this year until I've done at least those three, but I have a ton more, but one thing at a time.

I also have some new thoughts to think on in the near future as the second part of edX Berkeley SasS 169.2x winds down on March 31st. I will be having about 10 - 12 hours of free time that I would have otherwise used to study my homework and watch lecture videos. I could work on some open source project, work with my brother Cody on an idea he has, or do some of my own things, or other stuff we'll see.

I'm also thinking of asking Ruby Motion to be a sponsor for our 4 person Hackathon team, in exchange  everyone on the team would write 1 - 2 blog posts on things we liked about using Ruby Motion. That would save us the $200 software fee per person, which frankly as all of us are training/ intern/or junior level developers we are kinda' on the broke side of life right now :)

 We could also wear Ruby Motion t-shirts at the Hackathon for even more exposure for them, and I would be willing to put a Ruby Motion sticker on my laptop, and then when we of course win, we would mention Ruby Motion as the ultimate nice sponsor, helping out new developers :)

First to find an event, then a team :) I'm thinking of +Cody Kemp , +Jason Wieringa+Christopher Sigg , and myself. Since we are all somewhere along the path of beginner - junior developer. I would ask +David Bock but then that would be just cheating for our team.I haven't asked these guys yet but, I'm thinking we'd make a well balanced decent team.

 Please let me know if anyone out there knows of a Hackathon coming up in the D.C. area, although I wouldn't rule out driving to N.Y. either if it was a cool Hackathon, and I could convince the rest of the team to drive up as well :) - Josh


Monday, March 11, 2013

Why turning down new clients is great!

The title may seem odd to you, but that's exactly what I am doing. I currently shoe horses as my full time job, which is fine as it pays the bills for me and my family.

My busiest time of year is from March - October when people start showing their horses again. Starting in March I always start getting calls to take on new clients and start getting super busy, I've already turned down 3 since March 1st.

This is the time to make more money and pick up new work. This year however  I've decided not to take on any new clients, in fact I've let 6 horses go in the last month, and the reason is simple. Right now I'm putting in 21 hours per week studying and learning Ruby on Rails and loving all the progress I am making.

Who wouldn't love to make more money right? But more important than that I want to be a full time Junior Rails developer and I don't want to get caught up in making more money and slowing down my progress. I want to keep my 21 hours per week of study (I'd love more) even as we start to move into my busy season.

I say all that to hold myself accountable and to hopefully encourage others who our learning to not get discouraged by a little temporary short term pain for long term gain. I think if you work on being good at something versus how much money you can make, you will never be broke, in my shoeing practice that way of thinking has never failed me yet.

I absolutely love learning to code and am beginning to think like a programmer. I find myself day dreaming while driving from barn to barn thinking of how to solve something, an idea or a crazy product idea.

I feel like I'm about to experience a whole different way of life than my current one. Like I'm strapping in to a roller coaster that's about to take off, soon I'll start climbing the hill and hear the 'click clack' as it gets steeper, then a rush of adrenaline as everything accelerates!

Right now It's imperative to my future to not get too busy I need as much time to study as possible....my goal is closer, I can see the roller coaster, all I have to do is strap myself in. - Josh

Saturday, March 9, 2013

Why you need to get Dale Stephens book!

You need to buy "Hacking Your Education"

Now, I'm not selling this book, or making any money from it. I have never recommended a book before on my blog, but I absolutely 100% think people need to read this!
Chapter 3 and 4 are worth the price of the book alone!

If you don't like the author's outside the box thinking then you won't like mine either. With my learning Ruby On Rails journey, I feel like I am following similar steps of non traditional learning.

I do some classroom studying like Berkeley edX but I value my Mentorship and pair programming practical real world experience more.

I value hands on real world knowledge over academic theories. In 5 years I want to be in the top 10% of Ruby On Rails developers in the world. Crazy? Maybe, but who wants a small goal?

To borrow James Cameron's quote: " If you set your goals ridiculously high and it's a failure, you will fail above everyone else's success."

Josh

Thursday, March 7, 2013

Finally found some good Cucumber tutorials.

By the way, I forgot to mention I got my grade back for Berkeley 169.1x which was  85%, so I feel pretty good about that. I'm working through errors and homework today, thankfully not working do to the snow.

When learning Cucumber for the first time, you 'll be faced with extremely outdated tutorials from 2009-2010, which will not work and will fail. Thankfully I've found a remedy to this problem.

I recommend these 2 tutorials, One by my brother Cody who shows you how to get Ryan Bates' episode #155 Cucumber to work with updated  proper commands, you can find it here: http://www.codesterkemp.blogspot.com/2013/02/railscast-155-cucumber-tutorial.html

The second tutorial is also really good, between the two you should get a basic understanding of how Cucumber works. Here's the second tutorial: http://kconnolly.us/posts/17

In the future I know my brother is working on updating the second part of Ryan Bates cucumber tutorial, and when he does, I'll post the link. - Josh

Wednesday, March 6, 2013

4 things that will never change with development.

I love this quote:

"The creation of good software demands a significantly higher standard of accuracy than those other things do, and it requires a longer attention span than other intellectual tasks." Donald Knuth, Keynote address to 11th World Computer Congress, 1989

It seems to me 4 things in programming will virtually never change: (1) Some sort of Database probably SQL. (2) Html, which is still very similar to how it was years ago. (3) Some form of CSS. and finally (4) Javascript. It seems like if you only knew Html, CSS, and Javascript really well, you could always be valuable to an employer and be gainfully employed regardless of other changes like cloud based and such.

Currently I do not know these technologies well, so I can't give this advice from personal experience, however from all the Meetups and programming things I've attended, these 4 things always seem to be non negotiable skills to being a good web developer regardless of your back end language choice.

I am SOOO happy for the ton of snow we are getting here in Northern Va, I probably won't have to work till Friday, due to the problems of getting to clients barns and working on their horses.

I've been using my virtual Linux machine working through my Sass Engineering book, and I'm getting an error when running ' spec -c -fn spec/controllers/movies_controller_spec.rb'. I'm not sure how much time I should spend working on this error, because it isn't one of my homework assignments, it's just an example is my Saas book, however it is learning and I would like to fix it. We'll see :)

Anyway hope all is well with every one's learning journey, and if you did get bad weather , it gives you a chance to study. - Josh




Tuesday, March 5, 2013

Error installing rmagick gem!!

I'm having issues getting the 'rmagick' gem to install properly, it keeps complaining about missing headers. Software development really is about solving problems, I'm beginning to see that more and more these days :)

I've been googling away trying to uninstall and reinstall stuff, I'll let you know when I get it all sorted out. After I resolve this error it's on to edX Berkeley homework. I'm hoping we get snowed in really heavy tonight and tomorrow so I don't have to work, then I can really devote myself to some serious studying!

+David Bock helped me install 'Brew' and 'Xcode' on Sunday which was cool to finally do that.  Also sounds like I may need to download some additional things to help everything work together, I'm using Lion 10.7 OSX. I'll let you know how it goes. - Josh

Sunday, March 3, 2013

End of week 19 = 380 hours of studying RoR!!!

End of week 19 of my learning Ruby on Rails journey. I'm very happy with 380 hours of studying so far, I apologize for my lack of blogging this week. I promise to do better this coming week,  my goal is a minimum of three posts per week.

Awesome time working on the pet rescue site with +David Bock  and +Jason Wieringa today, learned a ton. I feel like sitting down for 3-5 hours with a mentor pair programming is worth 9-15 hours of studying on your own! I can't tell you all the cool things I've been learning about Rails and making a website just in general!

On a different front, I currently shoe horses for a living. I've been shoeing horses for over  7 years on my own and in that time I've developed several hundred horses that I take care of on a consistent basis.

 I was thinking how cool it would be to make a database with Rails that stored all my clients and horses information. Not exactly sure how I would do it, I would love to have it as an app on my phone I could just click on and search. I was talking to Jason about it today and he had a good idea of maybe hosting the database as a website online and than just accessing it through my phone. I think I may slowly start working on the idea as a useful side project when I get some free time.

380 hours, When I started keep track on Oct. 23rd it felt like I would never reach 500 or 1,000 hours, but now with 380 study hours 500 seems so close and 1,000 within reach. I'm Feeling totally encouraged with this whole learning Ruby on Rails journey, things are clicking and making more and more sense at a faster pace. I think my brain is slowly beginning to think in patterns and picking out similar patterns quicker.-Josh

Berkeley 169.2x Quiz 1

Finished Quiz 1 of Berkeley edX 169.2x  got 1 question wrong, not too bad. I'm caught up on everything right now so I'm just gonna work on writing Ruby code. I feel like I haven't actually written hardly any Ruby code in the last month because I've been using Rails, Testing, Cucumber and stuff like that.

I feel like I'm becoming a better "developer" but a lousy "coder" meaning I don't know a language well at all yet. I want to really be a good coder, not just be an assembler of Ruby Gems, not that there is anything wrong with that. I just want to really know Ruby and how to make things, not just copy and paste other people's code.

Pair programming for 3.5 hours today with Cody, going to make some small Ruby programs, I'll put them on Github today or tomorrow so you can see.

Last Tuesday I went to Arlington's Ruby Meetup, had a great time learned a lot of stuff. Great lightning talk by @ChristopherSigg on design principles really enjoyed it.