The Automated Store – Chart

In previous posts, I wrote about the creation of an automated store machine in the 1900′s. In the chart below, I have jumped ahead to when the actual machine is first installed. I think this chart can help people get an overview of certain concepts by seeing them in physical form.  I created the rough sketch below with a pencil, but when I get better drawing software I will be able to create a digital version, which will be updated with color and more.

The Web Framework from a Century Ago

Machine Overview
While initially the main purpose of the machine was so the store owner could track inventory, many new features were added. This picture focuses on customers who which to view the inventory/catalog information themselves.
The customers enter their information by punching holes into a “HTTP” card they are viewing. This card then goes into the Router which cuts it up and sends it to the appropriate controller. For example, if a user asked to views product #43, the router will pass “43″ to the Product Controller’s viewing arm.
The controller will then send this information to the Active Record Player, which will send back the relevant data, as seen in the previous post. In this case, it would send back a copy of product card #43. The controller’s Action View will then take over and combine the data with the relevant templates to create a page. This will involve cutting up the data-card and inserting the information into the correct location on the “view product” catalog page. The page will then be combined with some general headers and some styling layers from the assets box, and then the whole thing will be pressed into a single page and sent back to the customer.

The Automated Store – Accessing Data

This is part two in a series about a mad engineer and the machine-framework he created in the early 1900′s. Any resemblance to modern frameworks, living or dead, is purely coincidental. 

In the first post of this series, the store owner, Jim Blackford, outlined the basic requirement he would need for Version 1 of the Automated Store Machine. We’ll quickly review his requirements:

Blackford: Well, I want to keep track of my inventory. So I guess it should let me create inventory records and store them well. The I should be able to access them at any time to read them, update them, or delete them. And it should keep track of how much inventory I have, and let me modify that when I get a new delivery or sell an item.

Dr. Hanson: Crud, that’s a lot of work. But me and my assistant can get started on building that machine. We’ll keep you posted on our progress…

Part II - In The Hanson Basement.
Dr. Hanson discusses his plans with his assistant, Dave Kemp. 

Dave: What up doc?

Hanson: We have a new project. I met with Mr. Blackford, and he needs a machine to track his inventory.

Dave: An inventory machine? How will that help you achieve world domination?

Hanson: This machine will not just be focused on tracking inventory. For Mr. Blackford’s own sake, we will need to make it extendible so we can add new components to help with his store. But my plan for this machine is greater than that. Once we complete this machine, we will look at the principles of its design and use them to build other machines for all sorts of purposes. Ba-Ha-Ha!

David: How will you do that?

Hanson: We will need to work out the details. But we will use solid engineering patterns that will then be able to used when building other machines. After all, what is the purpose of any calculating tabulating machine? It needs to store and retrieve data in an easy fashion, and perform simple operations on the data. Once we have the right design worked out, everyone will want our machine! They will no longer need to have their own Personal Hodgepodge of Pasta built from scratch, they will be able to start out with solid architecture.

Construction Begins – Accessing data (rough version)

rails-toon-1

The Automated Store – The Plan

This is a the first post in a story about a mad engineer and the machine-framework he created in the early 1900′s. Any resemblance to modern frameworks, living or dead, is purely coincidental. 

Dr. Victor Hanson was a brilliant mathematician and engineer, though a tad crazy. He had invented a machine that could perform various calculations, but it had not sold well, and anyways he wanted to create something more ambitious. He decided to take out an ad in a newspaper to see if anyone needed his services:

newspaper-ad

Jim Blackford had been running his store without too much problems for some time, but he was getting a bit bored dealing with the same tasks every day.  He wished he had some way to automate some of these processes. One day, when reading the paper, he noted an interesting ad…

A week later, in a restaurant in New York:

Blackford: Dr. Hanson, I presume?

Hanson: Yes, nice to meet you. I can now tell you about my automated machine services. I built machines that can calculate and tabulate numbers, but I’m thinking of branching out into other areas. What kind of machine do you need?

Blackford: I’m tired of dealing with the same manual tasks while running my store. It would be nice if a machine could just take over various operations for me. Though I’m not sure how that would be possible considering our pre-digital age and all.

Hanson: Nothing to worry about, I cans create analogue machines.  Now what specific requirements do you need in your machine?

Blackford: Well it would be nice if I could receive some automated help  to keep track of all inventory, process transactions, display brochures to customers, and maybe hand them products from higher shelves too.

Hanson: Wo, not so fast! Let’s focus on the most essential features you need first and later we can iterate on that. What is the most basic important thing you are looking for when shopping for automated store-running machines?

Blackford: I guess some way to keep track of all my inventory.

Hanson: OK, so let’s focus on that. What exactly do you want the machine to do?

Blackford: Well, I want to keep track of my inventory. So I guess it should let me create inventory records and store them well. The I should be able to access them at any time to read them, update them, or delete them. And it should keep track of how much inventory I have, and let me modify that when I get a new delivery or sell an item.

Hanson: Crud, that’s a lot of work. But me and my assistant can get started on building that machine. We’ll keep you posted on our progress…

Stay tuned for the next post where Dr. Hanson builds a first version of his machine. You can follow me on Twitter or RSS

A Map of Resources for Learning Ruby

My previous chart of resources to learn programming was well-received, but some people suggested additional resources. I decided I would try a new format to display more resources for learning programming. It is a map of different resources, which are ordered from left to right based on experience. You can choose a resource from each vertical, and then move to the right as you gain experience. A sample path is shown in the image. It would be interesting to see how these kind of charts can be improved to quickly display relevant information about each item. Click on the image below get a clickable image map, an SVG should be coming soon.

Map of ruby resources

Mathematica, Bing vs Google, Web Hosts

Mathematica
Mathematica 9
just came out and it has a bunch of new features, such as a suggestions bar which helps you perform various actions after you enter a query, and support for units, like “centimeters and gigabytes”. I think math education should make much greater use of computers, and Mathematica is the most powerful tool to do so. In addition, it has many beginner-friendly features, such as the ones above or the ability to enter input in English if you don’t know the Mathematica syntax for something. Perhaps math education should be based on figuring out how to turn real-world problems into a format Mathemtica can understand.

Mathematica Suggestion Bar

Bing vs. Google 
A while ago Google changed their shopping search from being free like their regular search to paid-only inclusion, like PriceGrabber and Nextag.  Microsoft just launched a campaign against Google, calling them Scroogle. It attacks Google for not stating more prominently that the results are paid, and that they even partially base their sorting by how much much a merchant pays.

I don’t know if it’s such a big deal. Google Shopping used to be filled with all sorts of low-quality sites, and now it’s much easier for them to keep it high-quality. However, they have lost Amazon from their results, which makes a pretty big difference. Also, it would be better for the user to not factor in pay when you initially display an item. They don’t seem to do that though for a general search, and for a more specific one, you can always sort by price, which wasn’t useful when they had low-quality results.

Web Hosts
I made a couple of small changes to the Web Host chart, including adding another free static web host. More of those services should be coming out soon with the announcement of Google Drive support for web publishing. To keep on top of updates and add additional details, I created a Webpage version of my web host guide. This should be the one-page stop for people to find the right web host.

The Zappable Guide to Finding a Web Host

I decided to update the Zappable Guide to Finding a Web Host. This guide is intended for a newbie who is would like to find out about different hosting options, though I think others can find helpful stuff here too. Most people just Google for information and get results based on SEO instead of what’s most helpful. While Google’s results have improved, you still won’t get a helpful review of the many different options possible. In the chart, I try to explore many different free options, and a couple of paid options too. (Note: I made some of the links into affiliate ones.)

The basic categories I explore are Static Hosting, Cloud Hosting, Cpanel hosting and regular dynamic hosting. I provide recommendations for in each category that I think are good and reliable. This chart should help people quickly find a good web host choice. If you want some more background info and specific details, see finding a web host. The chart is embedded below and a PDF is available here.

Updates:
I created a webpage version of this chart, which will be able to contain more info and be updated more frequently. For example, see the Dreamhost coupons.

Chart for Learning a Programming Language

The previous chart helped beginners pick a language, this one shows them what resources to use to learn it. It’s better to spend time doing things than to passively read or watch content, so I selected interactive websites, books and courses. Start by going through an online tutorial, and then either read through some of a book or watch an online course. Personally I think a book is better than a video since they’re more concise and easier to reference, but most videos below are short and to the point. The chart is based on these posts: Picking a LanguageGeneral TipsJava and PythonWeb: HTML Javascript and PHPLearning Ruby and Rails

Free Resources For Learning a Programming Language

Java Python Ruby Javascript
Good For Kids / Game Programming Greenfoot Invent Your Own Computer Games  Hackety-Hack, Games: Ruby4Kids CodeAvengers
Interactive Tutorial – Codecademy? No, You can try Programr Yes Yes, there’s also
TryRuby
Yes
More Practice and Help CodingBat Problems Visualize Python executing
(also CodingBat)
RubyMonk*
(1st part is free)
Use Firebug or Developer Tools.
(See Waterbear for visual coding)
Good Free Book for Teaching Programming How to Think Like a Computer Scientist How to Think Like a Computer Scientist Learn to Program
Humble Little Ruby Book
Eloquent Javascript
Interactive Video Course Intro to CompSci -
Programming methodology
(Warning: full Stanford course)
Udacity – Intro to CompSci – Building a Search Engine CodeSchool’s RubyBits* .AppendTo Javascript 101
Advanced Book Effective Java* Dive Into Python 3 Pickaxe Guide* JavaScript: The Definitive Guide*
More Training / Bootcamps See Local / Online colleges See online courses or corporate PythonTraining Most Bootcamps are for Ruby on Rails Catalyst.
For kids: CodeHS.com
* Not free. Update: added affiliate code to Amazon links.

Learning Ruby and Rails

Note: This post on Ruby and Rails is the final one in a series on Learning How to Program. Previous posts were: Picking a Language, General Tips, Java and Python, and Web: HTML, Javascript, PHP

Say you don’t want to edit old PHP scripts, but instead want to create your own new web application. A good choice would be Ruby on Rails, the ‘cool’ framework for creating websites. It contains various tools and elements that are common to most web applications so you do not need to re-create them from scratch in your own website.   For example, most web apps have forms that take user data and place them in a database. Ruby on Rails lets you create such forms quickly and securely. Rails is written in Ruby, so to code with Rails, you will need to know some Ruby. While you don’t actually have to spend that much time coding with Ruby before starting Rails, I think it makes more sense for a beginner to get comfortable with programming basics before taking on a complex web framework.

Ruby
As always, it’s good to jump right in with an interactive tutorial, which there is no lack of in Ruby. You can spend a few minutes on TryRuby and then look at Codecademy or go through slightly more advanced material on RubyMonk, which has 1 free course and additional courses for $10/month. If you like videos, you can pay $25/month and get access to CodeSchool’s courses, including RubyBits.

You should have a book also though. Learn to Program is geared at teaching programming concepts to beginners, and they aso have a more recent paid edition. The Humble Little Ruby Book is good for learning Ruby, though if you prefer more attitude and random cartoons, there’s the famous Why’s Poigant Guide to Ruby. If you have more experience and really want to get experienced at Ruby, there’s the Pickaxe Guide.

If you want to download something to teach kids Ruby, there’s Hackety-Hack, and if they’re just interested in games, there’s Ruby4Kids.

Ruby on Rails
After learning the basics of programming and Ruby, you can start learning Rails, which also has interactive tutorials. CodeLearn recently launched to let people learn Rails by trying out things from within their browser. If you like learning by watching zombie videos, check out CodeScool’s famous RailsForZombies. You can then signup to CodeSchool and get access to the sequel.

The ‘official’ free text to learn Rails is the Ruby on Rails Tutorial, which goes through all the details on how you would create a Twitter-clone, from getting things installed to version control, from “rails-flavored” ruby to nice CSS styles, and of course, all the fundamentals of Ruby on Rails.
The book places a strong strong emphasis on writing test code, which is code that tests out your main code to ensure it does what you want it to. It follows the TDD and BDD processes, which means you write the tests before you write your actual program’s code. Sometimes you will spend more time writing the tests than actually writing the rails code, but this way you will know your software always works. You can always skips some of the test-parts if you feel its too much.
The issue with a step-by-step tutorial book is that you need to make sure you think about how to do things, and not just copy what the book says. It might be helpful to try to figure out what to do before looking at the code in the book, though that won’t always be possible.

If you have a little experience, you might like Agile Web Development with Rails, which goes through how to create a shopping-cart application in part 1, and contains a rails reference in part 2. To learn how to do specific things, you can watch the screencasts on Railscasts. There’s also the official Rails Guides, which cover various aspects of Rails.

Of course, to actually learn Rails or programming well, you need to work on your own projects. As mentioned, you should find someone to help you work through a project. If you have a couple months, you could consider signing up at one of the Rails bootcamps that sprung up recently. Devbootcamp pioneered the bootcamp approach in SF, AppAcademy  claims they’ll only charge you if you get a job, Starter League is well-established in Chicago and Flatiron School recently started in NY. They charge $8k – 12k, but many give partial refunds if you take a job with one of the companies they’re connected with.

With all these resources, it’s easy to try out programing and then pursue it further if you like it.