Entries RSS Comments RSS

Scratch Rules

May 14th, 2010

Scratch is an awesome visual programming environment written in Squeak Smalltalk. It was designed by the lifelong kindergarten branch of the MIT media lab for the purpose of inspiring kids of all ages. Absent of the barrier of syntax, you can create fun animations and games by dragging and dropping ‘code blocks’ to form ’scripts.’ Scratch supports serious programming concepts: you can learn about operators, control statements, events, threads… all within the context of a cute and easy to use environment.

One of the best features of Scratch is its introduction to social coding and its amazing social networking twist: go home Facebook. You can easily share your projects online at the Scratch website. Sharing your projects allows others to ‘like’, ‘comment’, ‘download’, and even ‘remix’ your application (social coding ftw!). Best of all, if someone wants to check out your project and he or she don’t have Scratch installed, the project will run on the Scratch website in a java applet without the need to download anything! Yeah, that’s right. I made a snowman math fact game for practicing addition facts, and my not-super-computer-savvy-but-has-java-installed mom played it! :) Gotta love it.

This is an awesome video of Harvard professor David Malan teaching CS50 with Scratch as an initial introduction to key programming concepts: loops, iterators, booleans, events, and threads. I’m excited to go through the whole course, but particularly loved the first two class sessions using Scratch!

http://academicearth.org/lectures/introduction-to-programming-and-scratch

I’m doing a lightning talk tonight on Scratch. I have basically taken a hiatus from “real programming” and am just hacking on baby games. You should try it. :)

update: http://www.ustream.tv/recorded/6923784 <- my lightning talk on Scratch. I gave this talk at an event I helped plan and organize at Coworking Rochester -- cosponsored by Coworking Rochester and Interlock Rochester.

One year ago today – Learning to Embrace the Tech Community

April 4th, 2010

This post is inspired by Sarah Allen’s blog post: “one year of sf ruby”

One year ago today, I also had a very pivotal experience. I attended my first technical conference– an unconference, a barcamp — at the Rochester Institute of Technology. (http://barcamproc.org) I had just moved to Rochester, NY from San Diego, CA with my husband, Alan. Up until that point, I had only ever seen HTML and CSS (sparingly.) I was familiar with HTML and in-line styles. And I knew how to use things like myspace and facebook. My background was exclusively education and English (literature and writing.) I was interested in programming, but I felt a severe barrier to entry: I thought it was too technical for me.

At my first barcamp, also my first technical conference/unconference experience ever, I was intimidated. My heart raced when I had to introduce myself. I claimed I was going to help Alan do a talk on his server-side Javascript framework that I had no clue about, but I really did nothing. I didn’t give a talk. I felt guilty, given the nature of a barcamp and the expectation that all attendees speak on something, but I also felt I had nothing to contribute.

That day, despite my intimidation, I was inspired by the things I saw. I attended an excellent talk on Haskell during which the presenter admitted he had very little experience with the language. Still, I was intrigued by the syntax and grammar, and I felt an inclination towards programming that I had never felt. I love natural language, grammars, and syntax in general. I have always been fascinated by English and the field of linguistics. I was no less fascinated by Haskell than I am with Basque (an incredibly interesting language isolate.) I saw another talk on the OLPC/XO by an awesome woman, Karlie Robinson, who detailed the effort and reached out to the tech community to engage their skills towards a cause for education. I could relate. I even brought myself to go up to her after the talk and give her my e-mail address, given my experience in education, thinking maybe I could help. For the first time, I thought, maybe there is something worthwhile that I can contribute to the tech community.

I started programming one year ago today, because I was inspired by the technical talks I saw that day, and because I realized I am not any different than any other extraordinary geek.

About six months ago today, I got involved in a movement in Rochester to form a hackerspace. Within three months, we had a space and a place to call our own. I have learned about basic circuitry, soldering, programming, and even some basic networking concepts thanks to Interlock, Rochester’s first hackerspace. I love Interlock, and I can barely imagine my life without a hackerspace anymore. Exchanging ideas, learning new concepts, and thinking beyond my normal realm of every day thought has made me a stronger person. I was not born to be a hacker, a coder, an electrical engineer: but I know I CAN be one. Nothing is stopping me from learning new things. The only barriers we have are the ones we create for ourselves.

I have never been to school for anything technical. I am pretty sure I never will. I will continue attending technical conferences, participating in hackerspace activities, and searching each day for new or refactored technology that makes me think outside of my normal train of thought. I feel challenged, excited, and motivated by learning new things, as most people do (whether they realize it or not.) I embrace this challenge as a way to grow as a person, a developer, and a great mind. I am happy to say my mind is no longer limited by the barriers I perceived one year ago today.

I gave a talk on learning programming today at BarcampRoc 2010. I had a very small audience, but I enjoyed discussing Ruby and entry level programming with them. I am passionate about the best way to teach programming as an art rather than simply a tool. I have learned so much in the past year, and I am only limited by my own interests. I no longer feel limited by what I don’t know. Because I know I can learn. I didn’t know this small, and seemingly obvious bit of knowledge, one year ago today.

Today, I know.

Ruby, Javascript, and HTML/CSS (and Sinatra)

March 24th, 2010

I’ve mentioned before that I’m a bit of a Sinatra (http://sinatrarb.com) fan. Recently, at the Interlock hackerspace, I’ve been learning javascript from a friend/mentor. We’ve talked about the best ways to teach programming, and decided a fun way to start would be with javascript games. I really enjoy javascript so far. We started off using a text editor (gedit) and browser (firefox) to develop a simple tic tac toe game. This was a good way to start. As soon as I went home for the night, I (switched to vim, initialized a git repo), moved the app over to Sinatra, and deployed with Heroku. My restructuring took about 5 minutes, deployment took 5 seconds. Here is what I did.

Restructuring the Application

Initially, I had a directory which included a .js, .html, and .css file. To restructure my app for Sinatra, I changed my ~/projects/tictactoe directory to look like this:

|– config.ru
|– public
| |– css
| | `– style.css
| `– js
| |– tictactoe.js
|– tictactoe.rb
`– views
`– layout.erb

Breaking down Sinatra

config.ru – I mentioned earlier that I deployed with Heroku (more on that in another post, but basically Heroku is a very simple, git-driven way to deploy rack applications– and you can use it for free). The config.ru file tells Heroku that this is a rack application. The contents of the file? Simple. “Sinatra::Application” That’s all I need.
public – Your javascript and your CSS live here. Have as many as you want, and you simply link to your javascript and your css is your .erb files in your views directory, just as you would in the index.html of a site. Nothing fancy there.
views – choose the templating language of your choice, and use it here. I use erb because I’m most familiar with it, but haml is exceedingly popular as well. Anything in layout.erb will show up on *every* page. Since my tic-tac-toe application is only one page, I only need one layout. I’ll talk about what happens if you have more pages in the next section.**
tictactoe.rb – this is where the magic happens. Right now, this is all this file contains:

require 'rubygems'
require 'sinatra'

get '/' do
erb :layout
end

require tells my app the dependencies it needs and loads them for me. get ‘/tiktaktoh’ gets that route for me. do initiates the block that I’m about to pass which contains erb :layout, meaning my layout.erb file will be my ‘view’ for this route. And, end closes my block. I have routed my application to the index page of my url. Check it.

Why the heck did I do *THAT*?

First, I can easily expand this. I can make jsgames.heroku.com and have ‘/tiktaktoh’ route to my tiktaktoh layout, which would reference my stylesheet and my javascript for tiktaktoh. I can also make ‘/bingo’ do the same thing. I can easily create a separate bingo.js and bingo.erb file to create that project completely separate. This is perfect for learning and keeping my code organized. All of this is easily handled through Sinatra’s routing capabilities in one easy file — maybe I’d call it games.rb instead of tiktaktoh.rb, and it might look like this:

require 'rubygems'
require 'sinatra'

get '/tiktaktoh' do
erb :tiktaktoh
end

get '/bingo' do
erb :bingo
end

jsgames.heroku.com/tiktaktoh would go to my tic-tac-toe app, and so on.

**I mentioned earlier that I will still have a layout.erb that will be my default layout, but I will only keep things I want on *all pages* there (like header tags) and then I will insert the ruby (erb) code <%=yield%> in layout.erb wherever I want the layout specific to each game to show up (bingo.erb or tiktaktoh.erb). If my bingo.erb and tiktaktoh.erb layouts are drastically different, I might limit my layout.erb file to header tags. Then, I would simply insert <%=yield%> between my opening and closing html tags. My bingo.erb and tiktaktoh.erb would then include all of the formatting necessary to make my games look pretty.

And second, after I set this up, I deployed with heroku in a quick and easy step, but that’s for another blog post.

Conclusion

I now have a well-organized, expandable, git-supervised and deployable project directory. And although it might seem like overkill for starters, I love how easy it is to develop locally and then deploy with a single command for free, and we can start with ajax requests whenever we want, when we get there. :)

You can follow my slow and steady progress at http://github.com/ashumz/tiktaktoh My thoughts are to turn this experience into a nice tutorial on beginning javascript for (new) rubyists.

Currently Computing:
Me: HELLO AWESOME! What’s your name?
Awesome: Bowline, a ruby/js GUI framework

Finding Ada – on Hacker News

March 24th, 2010

If there is one thing I have learned from my short time poking my head in at science and technology, it’s that women are everywhere doing awesome things– we just don’t always hear about them unless we listen. For that reason, I believe more women should make their voices heard. That being said, it’s really awesome when women are noticed without having to yell, and when they get the same media coverage afforded to males in the field about equally awesome projects they are doing. I found out about a really neat project by Chloe Fan through Hacker News.

Chloe says, ” I created a simple version of Super Mario Bros using an 8×8 LED matrix (one color), an Arduino Nano, two buttons for the input (forward and jump), and a piezo sensor hooked to a separate Arduino for the theme song.” After researching more about Chloe Fan, she seems to be a very passionate woman in tech. She says on her website, “I am primarily interested in how engagement with technology in public spaces can increase environmental and behavior awareness, and encourage positive behavior changes. I am also interested in emotional and social interfaces, and assistive social robots.” I can barely attempt to paraphrase that, so I figured a direct quote would be best. But Chloe: Hack on! You’re doing something right.

(Note: I’m subsequently inspired by the possibilities of my Arduino nano that I just received in the mail today. How appropriate!)

SaaS Fail: Profit over Value

February 8th, 2010

One of my jobs involves inputting attendance records and notes for students who participate in Supplemental Education Services in a large California school district. The service the district has employed to handle all of the pertinent student data completely sucks. Don’t believe me? Go to http://www.cayen.net/index.asp. Immediately you might notice that their outgoing links just point back to their own website. Oh, but their website is *receiving a makeover.” See http://www.cayen.net for an equally laughable experience.

Are they serious?! “The leading provider in program management software for SES and after-school programs…” *Cries*

The silly “program management software” they’ve thrown together to manage all sensitive student data, student testing, attendance, etc, is just so incredibly difficult to use. I am mostly only able to use the site appropriately when I use IE 8. Even then, some input features on the site only work with Firefox. It’s incredibly annoying and unbelievably buggy. And, they charge SES providers money to use support hours. They get away with this by offering a “free training” session in the summer. Then, you’re expected to know exactly how the system works. I have absolutely no problem navigating the system, but I have many support *issues* — such as: this critical piece of data will not save unless I re-open another window and double click and cross my fingers.

My main question here is how people get away with pulling the wool over an entire school district’s eyes? There is a serious problem with the ability to sell software as a service to customers who just don’t understand the value of good software. Knowing how the site *should* work, I have an endless number of complaints. However, if I just thought the error was my own fault, I might actually be stupid enough to pay for support hours, or even hate on my own skills/user inability. I think it’s a shame that anyone can get away with making users feel like it’s their own inexperience with a piece of software that is causing them problems. And then to make money off it when it’s the software’s fault, unbeknownst to the user… that’s just criminal.

Right now, this entire system is down because the database server appears to have crashed or is improperly configured. Whatever. The system has been down for the last three hours. I’m not even sure who to contact because their contact info is unavailable. My contacts at the district continually let me know that everything I need to know about how to use the website is ON THE WEBSITE in the *HELP* section. (They have no idea what’s going on themselves.) Conveniently, the help section can’t be accessed when the site keeps spitting out “Microsoft OLE DB” errors.

Just because you are paying for a piece of software doesn’t mean it’s worth anything.

I am annoyed. End rant.


Easy Sinatra Project

January 30th, 2010

I lovelovelove Sinatra. (SinatraRB.com) I created a very simple app (the fortune cookie generator I mentioned in an earlier post) to play with styling/views, get and post requests, and the very bare bones workings of Sinatra. I absolutely love how pure and simple it is. The structuring is a bit confusing at first, but the Sinatra Peepcode video helped me a lot on this: http://peepcode.com/products/sinatra

In the Peepcode video, they make a Sinatra app in one file, and then break it down from there into separate files. It’s good to see how everything CAN fit in one file. This is how I learned CSS, actually– by putting my styles in with the rest of my website. Once I realized you put the CSS in a separate file, I had a mini epiphany: sometimes it’s best to put things together before you take them apart. Then you can truly appreciate the fragmentation of a given application and truly understand the purpose of breaking things up for simplicity’s sake. Seeing this helped me understand a lot about Sinatra, and even shed some light for me on why Rails is the way it is, as well.

So, dundundun: I made this: http://fortunefinder.heroku.com

Don’t judge my poor styling and wacky coloration. ;) This really was just a silly little experiment to play with the basic features of Sinatra. Now that I understand the basics, I’m moving on to another project confidently. I’ll still probably tweak this one a little, too. Just for fun.

You can check out the code on github at http://github.com/ashumz/fortunefinder Nothing special, but might help a Sinatra newbie get a feel for the basic set up of a simple app.


Defining Useful Methods in Ruby: Adding a rand method to the Array Class

January 26th, 2010

The ‘rand’ method in Ruby is a method of the Kernel class that generate a random float between 0 and 1 (and thus will always round down to 0 when converting to an int.) Being a new Ruby developer, I decided to make an array and try to pull a random element like so:

@name=%w[bob, judy, don, john]
@get_random_name = @name[rand]

But this will always return ‘bob’, the 0th element of the array.

Instead, to pull a random element from an array (of any length), you need:

@get_random_name= @name[rand(@name.length)]

But that’s icky and unRubyish, and Ruby really SHOULD have a rand method for the Array class, shouldn’t it? So let’s make one, because we can! :)

class Array
def rand
self[super(self.length)]
end
end

@name.rand will now return a random element from the array. Awesome.

A Quick Snack Hack

January 25th, 2010

I’m always running behind schedule because I got too absorbed in project x or y and forgot to keep track of the time. I have two jobs I have to actually go to (and one I do from home), so I’m crunched for time on days where all three jobs collide. Still, I manage to find time to get absorbed in a crochet project or oblivious to everything because I’m working on some code. Then, I look at the time, and I have 5 minutes to shower, eat, and dress myself in a somewhat appropriate manner for the workplace. Sometimes I work 10 hour shifts between the two jobs, and I need to make sure the vitals are covered before walking out the door in a hurry: apply deodorant, brush teeth, eat.

The most important of those three vital components of the pre-workday is my personally favorite verb in the English language: eat.

Like most people, if I eat a lot of shitty food, I gain a lot of weight. I’m not much (or enough) of a health nut; on the contrary, I usually just grab what’s already prepared (even if it’s just a piece or two of bread) and run out the door. I’m pretty good about putting together balanced meals for dinner in a jiffy, but I am not as much of a breakfast/lunch person, due to the fact that I’m always in a hurry before going to work. And I don’t see that changing any time soon.

Today I am in a little less of a hurry (so far), so I decided to take a minute, breathe, and make a good decision about the food I am going to run on for the next 5 or 6 hours of the day.

One of my personal favorite things to eat before running out the door is tuna. It’s packed with protein, and virtually carb-less. I hate to put it between two pieces of bread and glutenize it, but sometimes that’s just the most convenient thing to do. Enter red peppers: another favorite snack when in a hurry. I eat them as if they were apples (after cutting out the center) and nomnom them to death. Today, I realized I had both of these ingredients (because when don’t I? I love tuna and red peppers and they are a staple on my grocery list), so I whipped this up:

Ingredients:

1 Red Pepper

1 Can of chunk light or solid white tuna

Light ranch dressing to taste

Directions:

Cut the stem end of the red pepper and scoop out the inside seeds.

Drain tuna. Empty contents of can of tuna into the open end of the red pepper.

Drizzle Ranch dressing on top of tuna or pour dressing onto plate for dipping.

Eat red pepper as if it were a wrap, dipping into ranch dressing or other sauce as desired.

YES! It was amazing. And there are so many variations one could take on this simple recipe. If you don’t like tuna, you could stuff the pepper with lunch meat, lettuce, and cheese as well. I am adequately full, feel great, and am ready to take on the workday. And… writing this blog post will probably result in my being late for work (but at least I ate already.)

Interlock – The Rochester, NY Hackerspace

January 23rd, 2010

Lately I’ve been spending a lot of free time at Interlock, the hackerspace a bunch of us in Rochester have been working hard to get up and running. We’re about to move into our permanent space next month, and currently we’re in a temporary space until that point comes. We should be transferring to the new space on or before February 5th.

One thing I’m really excited about is an event called “First Friday” (firstfridayrochester.org) that happens on the first Friday (imagine that) of every month here in the city of Rochester, NY. First Friday is an event to promote the exposure of all of the awesome art that is happening in Rochester. From what I understand, it is an effort to maintain sustainability, promote the value of, and encourage collaboration amongst art venues and artists within the city. A large part of the mission is also to establish ties between university students and the wealth of art within the city. As soon as we heard about this event, we knew Interlock would be a regular part of it.

Interlock’s vision and goals are very much in line with the ideas of sustaining art and culture within Rochester and promoting collaboration between makers of all kinds. Many of our members are students and it’s certainly worthwhile to encourage them to make Rochester their home by providing limitless technical and artistic opportunities with the comfort of an open, socially collaborative environment outside of the university grounds. To accomplish this goal, a bus (or two or three? not sure on the details) takes people from universities to galleries within the downtown. The bus stops at the building that we’re located in, which is packed with many artsy organizations — 1115 East Main St. Exciting!

Organizations can register officially for the event for a small fee, or they can informally open their doors and welcome people with snacks, drinks, and a display of their art/projects. Last first Friday was pretty dead being that it was New Years day, but the previous first Friday in December at our building was booming. We had just moved in that night into our temporary space, so we didn’t have an event. This upcoming first Friday, on February 5th, we plan on having our doors to our new space open, with some projects and/or demos to show off to the public. We are in the basement of our building so signage will be key in trafficking people downstairs to check out our space. If we even get 3 people to come down, it will be a success. Next month, we will plan even bigger, given that we will be settled in and ready for a larger event. In general, I’m pretty excited that we’re positioned to become a significant part of First Friday festivities each month, and I’m anxious to see people’s reactions to Interlock’s dynamic and culture.

Currently computing: A simple ‘fortune cookie’ Sinatra app. More on that next time. :)

Judging books by covers: Learning a programming language

January 16th, 2010

Today I ditched a work meeting to go grocery shopping, and then ditched the grocery shopping idea to go to Barnes & Noble and browse the programming section.

So far, I have read the Apress Beginning Ruby book and some of The Pragmatic Programmer book on Ruby.

I spent two hours looking at different approaches to teaching different levels of different languages. Lately I have taken an interest in software developed for the purpose of teaching basic concepts and implementations of computer programming. It was incredibly interesting to see the vast number of approaches to conveying the basics and also the intricacies of languages like Javascript, PHP, Ruby, and Python. I even found some colorful illustrated books attempting to teach C and C++! From those particular titles, though, I came to the hasty conclusion that colored illustrations and comic sans’y fonts don’t necessarily make it easier to grasp concepts. In fact, sometimes such a flowery approach can even distract from the concepts being taught. For me (and arguably most new learners), the delivery of the author and the clarity of examples and structure make or break the author’s approach. (I did buy one of the said ‘flowery’ books and will review once I am finished.)

For a compromised solution of visuals and thorough structure/delivery, I found Peachpit Press has a line of books called “Visual Quickstart Guide”’s. I can deal with the slightly presumptious title of the series, only because such a line of books exists that claims you can learn a language in 10-24 hours (depending on the thickness of the book and the complexity of the subject, I guess.) Compared to that claim, visual quickstart didn’t irk me too much. In the Visual Quickstart Guide series, there is a strong visual component, though I’m unsure as to how well these visualizations aid the teaching of the subject matter. I did buy one of these books as well– on Javascript and Ajax. I will review my experience with this book at some point, too.

The Head Start O’Reilly books looked really interesting in their approach, as well. These books utilize comic sansy fonts and waste a lot of space with illustrations, but cover a lot of ground from beginner to intermediate throughout the course of the text. Throughout the books, readers are prompted to solve problems (on lines meant for text! write your code in pencil!) and to think critically about a given problem or prospective solution. I was deciding between their book on Programming (actually an intro to Python that also covers basic programming concepts) and Hello World! Computer Programming for Kids and Other Beginners (which also uses Python the same way.) In the end, the latter was roughly $20 cheaper, so it won. I was also attracted to the fact that it was geared towards kids, but not explicity limited to kids by welcoming beginners as its readers as well. The Head Start books do not explicitly state that they are for kids or beginners in their title, but it is clearly implied when reading the book description and flipping through the illustrated pages and goofy fonts. In fact, the two books covered basically the same items (and utilized similar tools for their tutorials even.) After I am finished with Hello World! perhaps I will invest in a Head Start book for another subject. I’d be interested to know if anyone has read any of those books to learn a language, and how it went.

On an entirely unrelated note, first Linux workshop at Interlock was a success! I need to go home now though. I will regail my blog with my readings and childish Python adventures soon.