Entries RSS Comments RSS

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.

Redefining the “+” method in Ruby

January 15th, 2010

This is still one of my favorite things to do on a rainy day:

class Fixnum
  def + (x)
    self - x
  end
end

1 + 1
=> 0

Don’t forget to redefine the + sign for floats as well! 1.3 + 2.1 would still equal 3.4, unless you do the same thing for class Float. :)

Conclusion

January 3rd, 2010

Squeak does not work on my netbook. If it doesn’t work on my netbook, I can’t use it. I’m going to try to install it on a computer at Interlock in the near future. We’ll see. Etoys/squeak worked on Alan’s Mac. But that’s Alan’s Mac, and not my netbook. :(

’til next time, smalltalk.

Edit: I got a hold of an XO at Interlock and played for some time with Etoys. I also got it working on my netbook shortly after, but it’s faster on the XO. Haha. A revised conclusion soon to follow…

smalltalk is cute, squeak is cuter, etoys is cutest

December 30th, 2009

Hypothesis:
http://smalltalk.org/ – cute
http://squeak.org/ – cuter
http://www.squeakland.org/ – cutest

I just finished crocheting my 8th item for December (a multi-colored netbook cover/purse) and am now switching back to computing mode. (Now that all the Christmas presents are finished, and I’ve made something spunky for myself.) I played with etoys a little before Christmas with Alan. I am pretty excited about all of this. It looks like a lot of fun to explore. After spending the next few days diving in, I’ll post an update on my learnings. :)

A Dollar a Day?

November 16th, 2009

I’ve recently become involved in a local movement to get a hackerspace started in Rochester, NY. We’ll see what happens. I may start blogging here and there about the effort, but for now, on to the next thing.

I definitely get distracted easily. I found a webcast of this dude who was making a twitter clone in rails. I KNOW I just blogged about how amazing Sinatra is for using Ruby, but I also am thoroughly engaged by using tons of gems and do-it-for-you rails accessories to make a quick and dirty web app. I know I need to stop thinking and start doing. The hackerspace organization has gotten in the ‘way’ to an extent, but I’m definitely thinking as I procrastinate about what to start on next. I should be involved in the project by the end of the week. If I’m not, I’m going to seriously reprimand myself for my procrastination. Honestly, I won’t get anywhere that way.

One thing I have worked on lately is my plethora of adsense sites. They are really more like internet litter, but I try to post interesting content and resourceful information to the web. I never do it without the idea of making money from it (with the exception of this site and my facebook account). I’m being honest.

So, one idea I have thought of recently is the very unoriginal concept of “a dollar per day.” If you can make a dollar per day via adsense with any combination of sites, or preferably a single site, you can make $365/year minimum. A domain costs $8/year. If you made a simple, informative sites on a niche market, you could make $300 in an hour. Yes, it’s not immediate. But, the upkeep of many of my sites which bring in a total of about $10/week right now, is less than 3 hours/year. Now, no one can predict what’s going to happen, what the idea of the ’semantic web’ will bring, how google will change its algorithms, what the future of seo (whitehat or blackhat) may be… But when I think about how much money I’m bringing in for how much work I’m doing, I can’t help but think, there is a place for every piece of internet litter.

Ok, so if I stop and think about this, and try to play the devil’s advocate with myself, I’d have to say: if you made a dollar a day for throwing trash out the window, think how much dirtier our streets would be. BUT you could also be that much richer for every piece of trash you threw, and you could spend that money doing good things, too! I don’t think of it as throwing out trash though, and not only just so I can sleep at night. My trash has SOME purpose and SOME resource, or it would never get any traffic (with my approach).

So it’s more like I’m throwing out fortune cookies. My sites are for gullible people in need of entertainment or too inexperienced to recognize that there are better resources with which you could spend your time contemplating your end goal.

*Sigh* I feel like a bad person when I write this out. :P

Lifehacker Quote

November 12th, 2009

“Good coders are a special breed of persistent problem-solvers who are addicted to the small victories that come along a long path of trial and error.”

-From a Lifehacker post by Gina Trapani, ‘Programmer 101: Teach yourself how to code’

Sinatra: The answer to my Ruby GUI problem

November 9th, 2009

Ruby and GUI’s have been on the forefront of my brain lately because I’ve been playing around with fun ways to program with Ruby. I am honestly bored of command line programs, and for good reason: the command line isn’t pretty enough for me. Since I’ve had problems installing Shoes and Hackety Hack on my version of Ubuntu, I asked one of my friends who uses Ruby frequently if there were other GUI options. There are options, but he referred to them as a bit of a mess to implement and pointed out that javascript and the web make for better uses of, what I would call, “fun Ruby.” Better yet, when you program for the web, everyone can use your program without worrying about what platform they are on.

So, I gave this a little thought. I started getting jealous and even a little frustrated at Python programmers and their connectedness with GUI’s and their pride in Python’s support for GUI’s. Apparently, Ruby has similar support, but it’s not nearly as widely embraced amongst Rubyists as it is in the Python community. (True? False? opinions?) Admittedly, I think I should have just learned visual basic and got my GUI fix 10 years ago. (I don’t particularly want to learn Python, and there are issues with it’s syntax that have turned me off pretty heavily.)

So, I have decided that the best course of action, given my new fixation on Sinatra, is to begin a jquery/javascript and Ruby project. Although I’ve been making websites for about 10 years, they have generally been informative, usually static, very low level applications of HTML, CSS, and bits and pieces of PHP. I have used javascript for fun little menus now and again, but honestly I’m a total copy/paster when it comes to js. I started recently on some javascript tutorials, but was then quickly reprimanded: SKIP TO JQUERY, says everyone. Unless you really wanna become a pro in javascript, it sounds like jquery is a nice shortcut to the overwhelming syntax (especially coming from Ruby!) and implementations of javascript. I can’t quite figure out a consistency of why and how something does what in javascript. But, if I can figure out what I want the code to do, I’m pretty sure I can figure out how to use jquery to get the job done. We’ll see.

I am going to begin working on a blog that is purely in javascript, using jquery, and also uses Sinatra. I’m going to use sqlite for the DB. Did I mention I have very little experience with DB’s, too? :) Okay, this project, honestly, seems a little over my head to me right now. But once complete, I think I will have experience with all of these pieces I need to make a pretty, fun, and useful application. Something every programmer craves– right?! :)

Updates to follow. Thanks to Julio for helping me come up with the idea on how to practice messing with all of the components I’m craving: Ruby, Sinatra, Javascript/Jquery, Sqlite, ERB, CSS… wee! This brings up another point about how multilingual and implementation exposure at the early stages of learning a programming language can be so incredibly integral to understanding how to best utilize a programming language like Ruby… but that’s for another post! Cheers!

Ruby on Rails or Sinatra?

November 7th, 2009

My updates have been a little scarce, but I’ve been programming– I promise. :P

I recently have been working on a site, discountcampusbooks.com (psst, buy your books there!) with my husband, alan.dipert.org. The book search is written in Ruby and uses the incredibly cute Ruby framework, Sinatra. I absolutely LOVE Sinatra, and I think for me it is a viable alternative to Rails. I’ve had pretty mixed feelings on ROR lately. I know I am a bit too opinionated for my skill level, but I really have something to say about the differences and advantages of both Rails and Sinatra.

I should say this first, because I feel like it:

For someone like me, who is just learning their first programming language, new to object orientation, and incredibly naive about the power or lack thereof of a given language, I feel blessed to have picked Ruby as my first language to learn. As I have learned Ruby, I’ve also learned the shortcomings of other languages. I am lucky enough to have a multilingual husband who keeps books like toilet paper in our bathroom, so at any given point I can pick up a little reading material and learn a little Clojure (yeah!!) or C (not so much). I’ve explored Python and Haskell pretty thoroughly as well as a few other common programming languages. I can’t argue against any of these languages too much. Why would I? Mostly, as I learn more about other languages, I just feel luckier to have picked Ruby as my devirginizing language. :P I also know it is important to explore the value of other languages. In fact, I know I sometimes need other languages to make the best use of Ruby. There is so much to say about all of this. End interjection (for now.)

The biggest issue for me, as I mentioned earlier, is the fact that ROR is the largest use/implementation of Ruby and the easiest for which you can find tutorials, screencasts, support groups, chatrooms, etc etc. Overwhelmed by ROR, I started using a “joke” (literally) framework my friend wrote to get my Ruby programs off the command line and on the web. After dealing with the shortcomings of his babyframework (again, it was written as a “joke” and was actually put together as a way to use Ruby as if it were PHP), I started branching out on my own. It became clear to me that, though you can use Ruby in a similar way to PHP using ERB, it’s not necessarily the best way. I had been working on a dungeon text adventure in Ruby and I was trying to figure out how to make it work via the web using ERB. I was, for the most part, successful. My tech support was limited, but I started to see the parallels of his framework and Sinatra after checking out Sinatra earlier in the week. Enter Sinatra. Things like Rack ran on both the joke framework and Sinatra. I could even use shotgun to run a webserver on my computer. WHOA. All of these things were exposed to me in small doses, and then adding Sinatra to the mix just blew my mind further. Ruby is fuckin’ cool. Noted. And I continued to compute.

When my husband asked me to help with the book search, I was pretty excited. I was so excited to see an actual implementation of a Sinatra-based web app. There was so much Ruby involved!! :) During my first experience with rails, I was hardly able to figure out where I should even put my Ruby. :) Weeks earlier, I had spent time creating a ’sample blog’ in rails, and figuring out the MVC framework. In rails, so much of the work is done for you. A large part of the process is accepting MVC framework, also seen in zend and django in PHP and python, respectively. You don’t need to be a Ruby expert to do Rails. (But you can be, and you will be better for your knowledge, that’s for sure. I have never doubted that.) Likewise, I truly believe you could suck at Rails and excel at Ruby. In fact, you’d probably prefer and have already used Sinatra if this is the case. They are not mutually inclusive. One of my favorite things about Ruby is the power and extensiveness of the language. Frameworks as light as Sinatra give creative freedom and your exposure to Ruby and the web can be vast or minimal– you can most likely get something to work for you. If you want something big, you’ll have to build it yourself. On the other hand, larger frameworks provide you an out of the box, large-scale solution that subsequently requires more knowledge and familiarity of the framework before you can customize it creatively.

Sinatra allows you a very simple, lightweight framework that requires you build off your own knowledge rather than, as my friend Julio would put it, David’s skills. Honestly, if you know the scope of your site will be huge, you know your DB infrastructure, and you’ve been through all of this before, Rails is probably your answer. From what I hear, you’ll love it, and it’s worth learning the MVC framework aspects that may be, at first, completely fuckin’ confusing (for me, it’s slowly coming along after using Sinatra more). However, if you’re like me, and you wanna start from small potatoes and build it yourself (yeah!!), use Sinatra. I feel like I may be making my way towards Rails, but I may also never get there. I enjoy the freedom of Sinatra, and I’m not building any gigantic web applications for the time being. Sinatra just rules if you love Ruby, but Rails seems to big and Ruby command line programs aren’t GUI enough. The web is an excellent agnostic platform for development. So embrace it. I have noticed many programmers are reluctant to do so for various reasons, but Sinatra has opened my eyes to the fact that you can write painless, creative Ruby apps with a little hassle and a lot of fun.

Cheers :)


Ruby Scope Confusion

September 18th, 2009

I ran into some confusion when messing around with a sample program I created that creates new instances of a class Car and names the car. I wanted to store my list of “funnynames” in an array and have my naming method grab a random name from the array via my “name” method which would be “initialized” (using the initialize method) upon creation of each new instance of the Car class. Blahblahblah. So my problem: class variables work for me, but instance variables don’t! I couldn’t find much on instance variables, because everything seemed to start talking about instance methods once they mentioned instance variables. It seemed like everyone was reluctant to point out that INSTANCE VARIABLES ARE INVISIBLE!?!?! outside of the class. You can’t access them outside of the class unless you use an accessor method (easiest) or other method.  If I’m wrong here, someone correct me. But to my knowledge, that’s how it works. However, if you store the data you’d like to access in a class variable, it works! Unfortunately. Since it’s so easy, but a bad idea, from what I hear.  Inheritance happens. Right? :)

And to think… these three ways to do the same thing in Ruby (minus side effects in the future if I were to use the class variable) aren’t even the only ways to do this.

It’s interesting for me that I discovered this basically on my own when developing a simple practice program. Wee! :)

class Car
  def name
    @funnynames=%w[bob judy mabel wiener]
    puts "Your car's name is #{@funnynames[rand(4)]}!"
  end
end

#defining array within method 

class Car
  @@funnynames=%w[bob judy mabel wiener]
  def name
    puts "Your car's name is #{@@funnynames[rand(4)]}!"
  end
end

#array as a class variable (thus I'm able to access it)

class Car
  @funnynames=%w[bob judy mabel wiener]
  class << self  #makes the accessor method relevant to the class rather than a single instance
  attr_accessor :funnynames
  def name
    puts "Your car's name is #{Car.funnynames[rand(4)]}!"
  end
end

# Voila! More on this later as I continue to learn the in's and out's

Currently Computing: Revisiting my text analyzer with the use of ARGV[] to analyze files via the command line rather than hardcoding in the file to access within the program. SO cool! Then back to more OO sample programs. Rails will happen. I’m just busy nerding out on Ruby itself for the time being. :)