Tuesday, March 8, 2011

Screencasts on Engine Yard

Engine Yard asked if my screencasts could be added to their listing. I said 'yes'!
It's great to know that the screencasts I made several years ago can still help others learning Ruby today!

Saturday, December 11, 2010

Introduction to Erlang

This is my second talk related to Erlang. Both have been introductory and well received. I hope you enjoy my slide presentation. I also did a chat demo using real-time updates using Comet.
Presented at Silicon Valley Web Builders meetup

Introduction to Erlang Presentation
Chat Demo code

Erlang web framework used: Nitrogen

Thursday, September 30, 2010

Wednesday, September 22, 2010

RubyLearning Guest blog post is up!

I wrote a guest blog post for RubyLearning and they posted it on their blog. Please go check it out: http://rubylearning.com/blog/2010/09/23/incorporating-web-apis-to-spark-computer-programming-exercises/
The blog post is intended for Ruby newbies. I hope people find it valuable as they learn a great programming language.

Monday, May 3, 2010

Setting up Sinatra and DataMapper on Windows

I use a MacBook Pro for work and pleasure on a day-to-day basis. Recently, I was asked to teach web students at a local high school. These students know html/graphics/flash/etc. The advanced students were ready for some server-side programming and database integration. I wanted the students to be able to get up and going quickly (for motivation reasons) and to create useful apps (using a database). I felt Sinatra to be a great fit for this. I created a Sinatra app for my uncle and his business. It was a joy to work with it and I was able to deploy quickly using Heroku.
My experience of using Sinatra on my Mac was straightforward. Like most things using Ruby and Mac: it just worked. However, I found out the students at the high school use MS Windows. Fortunately, I have a Windows XP virtual machine running in VMWare so I could prepare that way. I used to teach computer science and web development at Spokane Community College and am aware of teaching Ruby in a Windows lab environment. Things can get tricky at times - and preparing a Sinatra app on Windows XP was a little tricky.
Here I am to quickly document what I can about setting up Sinatra on a Windows environment.

  1. Grab the installer and install Ruby: http://rubyinstaller.org/
  2. Install Sinatra from the Command Prompt:
    1. c:> gem install sinatra
  3. Install sqlite3
    1. Go to http://www.sqlite.org/download.html and download the Precompiled Binaries for Windows:
      1. sqlite-3.x.y.z.zip
      2. sqlitedll-3.x.y.z.zip
    2. Unzip and look for these files. Copy them into the Ruby bin directory path c:\ruby\bin
      1. sqlite3.exe
      2. sqlite3.dll
      3. sqlite3.def
    3. Install sqlite3-ruby gem
      1. c:> gem install sqlite3-ruby
  4. Install DataMapper
    1. c:> gem install dm-core
    2. c:> gem install do_sqlite3
  5. Code Reloading:
    1. Sinatra by default does not reload your code while you are editing and saving. Thus you have to restart sinatra server after changes = annoying!
    2. On the Mac I quickly found shotgun for my code reloading needs. However shotgun does not work on Windows. :(
    3. I then found out another gem that does code reloading on Windows: sinatra-reloader whew!
      1. c:> gem install sinatra-reloader
  6. Sinatra starter code:
    1. Put the code snippet (see below) into a file and save as: sinatra_starter.rb
    2. From command prompt, start the sinatra server:
      1. c:> ruby sinatra_starter.rb

I hope this helps get some of you started with Sinatra development on Windows. Please refer to these resources to further your Sinatra knowledge:

Saturday, October 31, 2009

Attributes Sort on Github and Gemcutter

For fun and to try out Gemcutter I turned AttributesSort into a gem and put it up on Gemcutter. I used Jeweler to do all the hard work for me. it was super easy! You can view source code and specs on Github.

Sunday, October 25, 2009

Flexible Sort turns into Attributes Sort

I was looking at my old blog posts and saw this one (Flexible Sort) from about a year and a half ago. I thought I'd tweak it a bit and see if I could make it more useful.
Below is what you see I've come up with. I've made the calling code off of array instead of a static method on the class type. I like it better. If anyone sees improvements they want to do with it then feel free to fork the gist on github. :) I'll probably throw some tests on this bad boy, gemify it, and throw it up on gemcutter eventually.

Thursday, October 22, 2009

Boy Scout Rule

So I was happily coding the other day and ran across some code new to me. Mind you we used to have something like 8 developers on our team over the last couple of years and now we have 3. So naturally there are parts of the codebase I have not seen before. Anyway, the code looked like this:

I saw the todos commented above each method and thought I could tidy these up a bit. It wouldn't take long. So here is what I ended up with:

It took me five minutes and was a nice confidence booster to keep me going on my regular task at hand. So the lesson for the day is follow the "boy scout rule" which is nicely described here by Uncle Bob Martin: http://www.informit.com/articles/article.aspx?p=1235624&seqNum=6

Monday, October 19, 2009

Code Kata: Simple Content Tag

In this video I test drive code to build a simple content tag class. This was presented at Spokane/CDA Ruby User Group on Oct 7th, 2009. Enjoy!
Code for the video is on Github: http://github.com/kblake/Code-Kata-Exercise

Tools used:

Click on link below to view screen-cast in High Definition.

Code Kata: Simple Content Tag from Karmen Blake on Vimeo.

Wednesday, October 14, 2009

Tools of the Trade

  • Macbook Pro: 17", 2 intel @ 2.4 GHz, 4GB RAM
  • Secondary display: 26" Visio Computer Display
  • Wireless Logitech LX8 Mouse
  • Wireless Apple Keyboard
  • Philips Noise canceling headphones

Friday, September 4, 2009

Improving Traditional Software Development Education

I read Corey Haines post about his idea for software development school. I thought I'd jot down some of my experiences while I taught software development.

I taught community college computer science and web development for 7 years. In the summers I worked as a contractor to gain 'real-world' experience. This allowed me to teach what I learned over the summers in the classroom. Towards the last couple of years of teaching I worked at nights while I was teaching because I enjoyed it so much.

To me I saw a lot of teachers take the easy road: picking canned curriculum that laid out non-practical material, have a work study student grade for them, etc. while they go home early. This was frustrating to watch and be around!! I picked industry books (PragProg, Addison-Wesley, etc.) and used them for reference while I created custom curriculum every quarter because of technology changes. I did not picked canned textbooks. They drove me nuts being out of date and out of touch with modern software engineering (most still push Waterfall, ugh). I kept a class blog where I would post my notes, source code from lecture, and screencasts. Even the public could have access to my curriculum (and they did).

I worked my tail off late into the afternoons and evenings every day to prepare the best and most up to date lecture I could give. I was also the lead instructor/advisor for the Software Development Program I taught in. We had an internship class setup at the end of the degree but it was not enough. Our intention was to get our students hooked up with a local business they could work with. A few of them worked out but most of them seemed to fall short of what I wanted out of it for my students. Many companies, where I'm from anyway, do not believe in agile practices or open source. I taught Java, PHP, Ruby, and Rails. It was tough to find a match between my students' skill set and the the technologies companies were using. A lot of companies stick to what works and typically are using technologies that are not as new as what my students were learning. A lot of times I had to resort to creating my own projects for students to actually apply what they've learned to a pseudo-real project.

For teachers in traditional environments it is hard not to get sucked into the status quo. I basically rebelled and did a few things to keep my degree top notch:
  • use industry books (not textbooks)
  • moonlight on the side and keep your skills fresh
  • create curriculum and make it public (blog, github, etc.)
  • keep updating curriculum, challenge administrators to let you do this. For example, I added an Agile class that allowed me to teach TDD, using version control, and Extreme Programming. That class was fun to teach! :)
  • create screencasts = students love to learn that way!!!
  • don't let administration use you to do administrative work (meetings, meetings, meetings...). say 'no' often and keep at making your curriculum awesome
I've been out of teaching for almost 3 years now. I miss it at times especially investing into students lives and giving them a foundation to be continual learners and researchers. I am enjoying working full time doing Rails. Some things I do to continue to help new developers is by investing my time into Rails Tutor and making my self available as a Rails Mentor which both I think stemmed from the great collaborative work being done at Rails Bridge. I hope some of this helps. I like the idea of apprenticeships or whatever avenue works to invest into future developers.