South Sound .NET Users Group + AWS, Visual Studio, Toolkits, and Explosions!

If you live in or around the south sound region near Olympia, would like to hear about the AWS Toolkit and SDK for Visual Studio, come and check out the South Sound .NET Users Group on at Olympia Center, 222 Columbia NW, Olympia, Washington.  The meeting will be on January 12th at 7:00pm.

Slides & Links to Code are already available!

Overview:During this presentation I will provide an overview of what is needed to get started using Visual Studio 2010 with the AWS Toolkit & SDK. We’ll also cover the basic design ideas behind the do’s and don’ts of cloud architecture and development. There will be some hands on coding (if you’d like to bring a laptop to follow along) and we will deploy code (pending a wireless/cat5 connection) into AWS Cloud Services & get EC2 instances up and running live!

PaaS Help! Know any PaaS Providers?

I’ve been diligent and started a search of Platform as a Service Providers, so far my list includes:

  • EngineYard
  • Heroku
  • AWS Beanstalk
  • Windows Azure
  • AppFog
  • Tier3
  • CloudFoundry
  • OpenShift
  • IBM PaaS
  • Google App Engine
  • CloudBees

Who else is there? Help me out in creating a list of every possible offering we can find!  Cheers! Please leave a comment or three below with any I’ve missed.  Thanks!

Reality Distortion Field : 17 Companies’ Sitrep

I’m sitting on the bus this morning. As happens almost every day of the week. I’m flipping pages, sort of, it’s an eBook on my Kindle App. I’m reading about Steve Jobs taking over the Macintosh Program at Apple. How things started to fall into place for Apple, for the Macintosh, and how Jobs saw what could be a pushed for it. Everybody else; Microsoft, Xerox, Canon, and practically every single other company was missing it. Xerox Parc had it right in front of them, the GUI, Mouse, Object Oriented Language, and about every single thing we assume for computer use and development today but wasn’t doing anything with it. They were all missing it, except Jobs. The eccentric, crazed, reality distortion field generating Jobs pushed forward and found those that agreed, this was absolutely the future. Today’s computers owe so much to Jobs efforts to pull these people together, to what he saw as the future, and our modern computing world will forever be indebted to Steve Jobs.

Howard Hues had done this 50 years earlier. He simply stated, “nobody wants to fly on a plane at 10k feet and get shaken to pieces, planes need to fly at 30,000 feet or more where the air is smooth!” He then went about working to get a plane built that could do this! The Government was in his way, the industry was fighting him, everybody said this wasn’t the way to go. Nobody could build a plane that would do that right now! It’s absurd. He did it, and bought every single one of them he could putting the airline (TWA) in hock at the same time! But it paid off, and his airline had the nicest planes, best flight in the world, easily. Today’s airlines are all modeled after this ideal, our modern travel owes a huge debt to what Howard Hughes pushed forward.

The competition, the fighting pushed the envelope, but in both cases a visionary could see the future. To them it was plain as an image on a clear sunny day. To them, the future didn’t need to be tomorrow, it was ready right now. The future just needed dragged kicking and screaming directly into today! They did this, they pulled people together who could make these changes, and they with their teams yanked the future right into humanity’s grasp.

Utility Computing / Cloud Computing

With those thoughts flying around at Warp 10 in my mind, everywhere, at every moment it seemed to occur to me. We’re merely putting the motherboards and cassette tape drives together right now in cloud computing. We have no Macintosh of cloud computing, we have no clear direction, there has to be something bigger, much bigger. At this point we’re merely making small steps, slight little strides toward the future. What we need to do is create the future and pull it directly into now!

There could be more though. Some of these things are being put together by individuals at various companies, oriented toward the platform level. There is, somewhere, a growing movement toward that next big shift in the way things are done. The gap between big architectures, big ideas, and launching these things is decreasing by the day – literally!

With these big ideas and big architectures and all the small steps and small pieces the industry is moving in the right direction. We’ve experienced shifts over the years and some more are definitely coming up very soon!

The Playing Field : Sitrep

With these thoughts racing around I felt compelled to look at where the industry stands right now. These are in no particular order, they all provide some type of building blocks for the next big thing, all in some aspect of the industry.

Amazon Web Services : This one should not need explaining. They’re probably the most utilized, nearly the most advanced, robust, price conscious utility storage, compute, and services provider in existence today. They continue to defeat the innovator’s dilemma over and over again, this company, and the departments in the company are hungry, very hungry and they fight the fight to stay in the lead.

Cloudability : This company is about keeping utility/cloud computing costs in check, and knowing where and when you’re pushing the pricing limits among all the various building blocks. There has been more than a few issues with billing, and people blowing through budgets by inadvertently leaving on their 1000 node EC2 instances and Cloudability helps devops keep these types of things under control stopping overages cold!

New Relic : The key to this offering is monitoring of everything, everywhere, all the time. New Relic offers absolutely beautiful charting and information displays around services, compute, storage, and a zillion other metrics among Ruby, PHP, Python, .NET, and about everything else available.

Puppet Labs : Imagine operations, IT, and systems administration all rolled into a single bad ass company’s product efforts. Imagine ways to automate and monitor ritualized machines, get them deployed, all with elegant and extremely powerful tools. Imagine that power now, you’ll know what Puppet Labs provides.

Opscode : The cloud needs management, hard core powerful management. Opscode and their respective chef product does just that. The influence of chef has gone so far as to influence Amazon Web Services (and others) to design their systems automation in a way as to enable chef usage. The devops community around Opscode is growing, the inroads to systems agility they’re making is getting to a point as to even be considered a disruptive market force!

Joyent : The birthplace of node.js, do I need to add more? Well, ok, I will. Joyent has a host of amazing devs, and amazing ops goals. The advances coming out of  Joyent aren’t always associated back to the company (maybe they should be) but rest assured there is some heavy duty research and dev going on over there. Things to check out would be their SmartDataCenter and of course the JoyentCloud.

MongoHQ : Mongo HQ is one of the distributed cloud hosting provider for Mongo DB. Mongo HQ  is also a supported provider in several of the other PaaS Providers such as Heroku and AppHarbor.

MongoLabs : Mongo Labs, another distributed cloud hosting provider for Mongo DB. Mongo Labs is also a supported provider in several of the other PaaS Providers such as Heroku and AppHarbor.

Nodester : Nodester is a hosting solution for node.js applications beautifully distributed in a horizontal way.

Nodejitsu : One of the leading node.js hosting providers and a very active participant in the community in and around New York.

AppFog : AppFog is a Platform as a Service (PaaS Provider) that is working on providing a cloud based horizontally distributed platform for creating applications with a wide variety of frameworks and languages. Some of those include .NET, Ruby on Rails, Java, and many others.

PhpFog: This is the PHP root of the PaaS Provider AppFog. They have a good history and an absolutely spectacular architecture for PHP Applications with a screaming simple and fast deployment model to cloud/utility based systems. They have a really great product.

Heroku : Deploy Ruby, Node.js, Clojure, Java, Python, and Scala. Probably the leader in PaaS based deployment right now. Got git, get Heroku, get push heroku master is about all the gettin’ for your application to be running there.

EngineYard : Think Ruby, Ruby on Rails, Rubinius, or any other aspect of Ruby and you’ll probably arrive at EngineYard in short order. The teams at EngineYard are heavily active in the cloud & Ruby scene. They are easily one of the leaders in PaaS based git workflow deployment in the Ruby & Ruby on Rails Community. They also, however, support tons of other technologies so don’t think they’re limited to just Ruby & Rails.

AppHarbor : The .NET Framework, often thought to be left completely out in the cold when it comes to serious cloud computing git based agile work flows, finally got included with AppHarbor! With the release of AppHarbor the trifecta of IaaS and a solid PaaS offering were finally available for the .NET stack.

Windows Azure : Windows Azure is Microsoft’s official cloud service, which supports a host of capabilities centered around a mostly PaaS based service. Windows Azure has however spread into SaaS and IaaS also. Some of the frameworks and tools they support include Ruby on Rails, Java, PHP, .NET (of course), node.js, Hadoop and others.

CloudFoundry : Cloud Foundry is an open source PaaS Solution that serves to link up various back end and front end architectures. Currently it is supported by a host of companies including VMWare, AppFog, and others.

Putting the Pieces Together

That’s where we stand in the industry today. We have all the pieces and they need fit together to create something great, something awesome, something truly remarkable. I fully intend to create part of the future, will I see you there? I’d hope so!

Why Clean Code Seriously Matters!

The first example is some working code, that determines if a date value is a weekend day and returns true or false based on that.

bool firstSecondNulls = false;
var dayOfWeek = (DateTime) zeros.ElementAtOrDefault(i).BalanceDate;
if (dayOfWeek.DayOfWeek == DayOfWeek.Sunday || dayOfWeek.DayOfWeek == DayOfWeek.Saturday)
    firstSecondNulls = true;
return firstSecondNulls;

This second example also provides the same result, except in a more readable, cleaner, and more efficient way. Matter of fact, I’d say in some circumstances it is exponentially more efficient! Do you see why?

var dayOfWeek = (DateTime) zeros.ElementAtOrDefault(i).BalanceDate;
return dayOfWeek.DayOfWeek == DayOfWeek.Sunday || dayOfWeek.DayOfWeek == DayOfWeek.Saturday;

This is an insanely simple example. But just imagine some of the nightmarish methods and functions, with hundreds of lines of code. Keep in mind, that those nightmares are minimal compared to the Enterprise Scale 1000+ plus line methods! Yes, those exist and they are beyond nightmares but holocausts of thought and design!

So the next time you think “meh, I’ll refactor it later.” just take that extra minute or two and do it now! The pay off, you know full well when you think about it, is massive in the end. Cheers!

Steaming Up The Engine for The Rails

I’ve been digging through and playing with the Rails Framework now for about 4 months with intent (I guess I’ve read about it, learned about, but not played with it for well over 4 years). I’ve gained a pretty good familiarity with the parts of the framework. Below, I’ve laid out some of the key things that I’ve done over and over just to become familiar with the commands, organization, and other elements within the framework. These also, in this specific order, is what I’ve found works best for getting a Ruby on Rails Application Project kick started (on a *nix based machine, the rvm commands will however not work on Windows, you’ll need to find a respective replacement).

$ mkdir steaming_up_the_engine
$ cd steaming_up_the_engine
$ rvm --rvmrc --create 1.9.2@steaming_up_the_engine
$ cd ..
$ cd steaming_up_the_engine
$ cd ..
$ rails new steaming_up_the_engine -T
$ open .
$ cd steaming_up_the_engine
$ git init
$ mate .gitignore

…edit and save the .gitignore file with whatever additions you may need or want…

$ git -A
$ git commit -m 'first commit.'
$ rm public/index.html
$ rails generate rspec:install

…edit your Gemfile(See below Gemfile for contents)…

$ rails generate controller home index contact about
$ git rm -r spec/views
$ git rm -r spec/helpers
$ mate config/routes.rb

…edit the routes.rb so there is the index page handling the root page…

Gemfile (Located in ~/projectRoot/Gemfile)

source 'http://rubygems.org’

gem 'rails'
gem 'sqlite3'

group :development do
  gem 'rspec-rails'
end

group :test do
  gem 'rspec-rails'
  gem 'webrat'
end

group :assets do
  gem 'sass-rails',   '~> 3.1.4'
  gem 'coffee-rails', '~> 3.1.1'
  gem 'uglifier', '>= 1.0.3'
end

gem 'jquery-rails'

route.rb file.

SteamingUpTheEngine::Application.routes.draw do
  get "home/index"
  get "home/about"
  get "home/contact"
  root :to => 'home#index'
end

mkdir creates a new directory called steaming_up_the_engine.

cd steaming_up_the_engine moves the active working directory of the terminal/bash to steaming_up_the_engine (i.e. cd stands for change directory).

rvm is the rvm application command, –rvmrc is the feature being created, –create is the command to issue on the feature.  1.9.2 is the version of Ruby that will be used for the project and the name after the @ is the name of the project itself. For more information about the rvmrc script check out my previous entry or the rvm site on rvmrc.

The action to cd .. moves out of the directory and then cd steaming_up_the_engine moves back in to initiate the script that the rvm command created for us. After that, the working directory is moved back outside of the application folder.

rails is simply the rails framework application command, new tells the application to create a new rails application based on the framework, and -T is a switch to prevent any tests from being generated.

open . actually opens the Finder to view the just created project in the working directory. The screenshot below is the Finder with the newly created rails app.

Finder showing the newly created Rails Application in a column display.

Finder showing the newly created Rails Application in a column display.

Again move back into the application working directory.

git init initializes a local git repository for the project.

mate .gitignore opens up the .gitignore file that was created by the rails command for editing.  mate is the command for the TextMate Application. If you don’t have TextMate, then you would have to change mate to a command that relates to whatever you use to edit your code files. Check out my previous blog entry for a sample .gitignore file.

git -A adds all new files for commit to the local git repository.

git commit -m ‘first commit’ actually commits the new project to the git repository.

rm public/index.html removes the default static page that displays if the application is run at this point. I never need it, but it does come in handy sometimes if you’re troubleshooting if a server runs and just want to deploy something to verify you’re doing it right (such as to EngineYard or Heroku).

rspec can be setup and configured to run in your Rails project with the rails command rails generate rspec:install. If the rspec gem isn’t already in your project, remember to gem install rspec or add it to the gemfile and run bundle install.

The first of these commands that actually starts building the site is the rails generator command. rails generate controller Pages home contact creates the pages, controllers, and routes for the pages. Because the rspec has been configured for the project, when rails generates the controller and pages tests will be created in the spec directory.

After the creation of those pages remove the unnecessary test files in helpers and views under spec. git rm -r spec/views and git rm -r spec/helpers will get rid of these files.

Now you’re ready to really get started actually building something in those pages. Enjoy!