Archive for March, 2009

Uncool am I?

Tuesday, March 31st, 2009

I was, as a nonflickr user up until 5 minutes ago , apparently uncool — tragically even. A situation I have just fixed.

Honestly though, I think I had an account before, years ago and just didn’t get into it that much. But looking again makes me realize how many cool pictures I have that I could have shared with the internets by now. For example, those I seeded my account with.

I would like to think that I am pretty hip to the social networky awesomeness that is the modern social network, but lately I find my self spending more time on simpler mediums.

Part of the reason why I got a flickr account is because I have tried to put images on my own site, like Brendan talks about and I have experienced the pain of trying to build my own or use others gallery software. It would be easier to let someone else maintain that stuff while I can focus on making and uploading the pics.

The other thing I like about the modern flickr, which I noticed adding the pictures, was how easy uploading new content has become. Compared to other services, like deviantART, which I have an account on(dead, mostly), it requires the least effort and thought on the users part.

That I think is part of why more sites will move to using technologies like OpenID and OAuth, even though implementing them can be annoying sometimes(just use a library, or middleware). They are better for the consumer of the sites services. Less passwords to remember, more control over your information are awesome things.

Oh and if you were wondering, the shoes are still awesome.

Real Food

Monday, March 30th, 2009

Don’t take the silence of the yams as a sign that they have nothing valuable to say about health.

“Hara Hachi Bu”: eat until you are 80 percent full.

“Eat food. Not too much. Mostly plants.”

Crazy Shoes Day 3

Monday, March 30th, 2009

My VFF(Vibram FiveFingers for those not in the know) feel even more like my feet. I am still not entirely use to them though–I still get the giggles thinking ‘I am barefoot AND yet I am wearing shoes’ every so often.

It rained today. I successfully tested the shoes in wet conditions, as well as mall conditions. Champaign has this really big mall that has sucked the life out of the smaller, more centrally located one in Urbana(not surprisingly). It was a good test wet asphalt followed by corporate tile and occasional carpet.

I talked with a shoes salesman who was unable to have and yet envious of my shoes. Apparently, his big toe is not the longest by a good margin. This I have read can be a problem. Luckily for me I didn’t have that one.


Flashback:

At first, the VFF, or crazy shoes as Sara calls them, felt a little loose and I was afraid that I might need a size smaller. But since adjusting the strapes, they have been awesome.


Back:

So, the VFF are snug. And Comfortable. I guess I could be called a satisfied customer.

Vibram FiveFingers Day 1

Friday, March 27th, 2009

It is spring, and as I promised my self, I bought me some spiffy new shoes.
New Shoes
So far so good. They stick to my feet pretty awesomely. So much so, I sometimes feels like I am walking around barefoot. It feels strange, wandering around a supermarket feeling barefoot.

That, and I was a bit of a spectacle at work. Which was part of the point of getting them, apart from feeling like I am not wearing shoes.

Relaxing VFF

Mountain West Ruby Conf Day 2

Monday, March 16th, 2009

After yesterday, I have a lot of grokking to do. And, some projects to start.

The talks, like the day before were great. And having the opportunity to talk with so many people about what they do with ruby was enlightening.

I wanted to write up my thoughts about yesterday, but they haven’t really congealed yet.

Short summary:

  • Ruby is awesome.(of course)
  • I need to be more aware of my metaworkflow
  • Rhodes looks really slick.
  • Adhearsion would be fun to build something with(eg a podcast engine)
  • Destroy is a funny word to users(rails)
  • Of the bicycle gears of software development,cucumber is the outmost one
  • Suite.add(test) if test.value > test.cost
  • be extremely pedantic when you first start trying to use a new methodology–even if it sucks(in the ‘man, why all this typing’ sort of suckage you know makes you want to be lazy).
  • don’t confuse concise with terse.
  • maybe I should try to make a theramin sim with the wiimote
  • energy not time is the most precious resource

Mountain West Ruby Conf Day 1

Saturday, March 14th, 2009

Like last year, I am again suffering from mac envy. But, oddly it is easier to deal with now that I could, hypothetically, buy one. On the other hand, I think that the number of PCs(mostly Linux mind you) is higher than last year.

I still want a web capable phone though.

James Edward Gray II started things off wonderfully talking about how reading code helps you to understand it better and write better code yourself that fits in the community. He tied it into Little Big Planet by showing how he developed a Tower’s of Hanoi level. It has its own developer community who borrow ideas from each other and its own style and idioms.

It was great to see someone who I had seen posting on comp.lang.ruby when I first began following it in person.

Restclient looks pretty awesome as a way to interact with services. It is a microframework for consuming webservices, sort of like an inverse sinatra.

James Edward Gray II recommended it as interesting reading. He also suggested looking at BJ and Terminator.

Or, you could just pick a gem and gem unpack it. But, it probably would be better to start with something less complex than rails.

Rack Middleware was the next talk. \m/

Essentially, the goal of rack middleware is to make webapps more composeable. Rather than mixing in open-id oauth and session management inside your app, you use smaller middleware apps and selectively apply them to different url spaces.

map '/private/awesomeness' do
  use OpenID
  run AwesomenessApp
end

You can also set internal headers inside special namespaces that allow middleware further down the stack to access messages set for them in a secure manner like for instance, whether the current session is authenticated.

One neat idea: do you need to have a proper web app at the end of the middleware stack? Not really.

Yehuda Katz made me think more about what Rails 3 will look like with its merby goodness. It is being reworked to be a set of rack middleware so different components will be more pluggable. For instance, right now, using datamapper with rails is alittle painful. standardizing the expecteds will make this much easier.

Puppet looks pretty freakin awesome.

I would care more about rubyCocoa if I had a mac.

TenaciousG is a super cool name for a graph(DAG et al not pictures) library.

Jeremy McAnally’s talk on DSLs was slick.

Silly Simple Twitter Search App with Javascript

Friday, March 13th, 2009

I’ve been meaning to spend some time playing with twitter’s API. So, I decided to build a really simple js app on top of the search api.

Essentially, I want to show a list of statuses from a search, say ‘baroquebobcat’ and do it in the least amount of effort possible.

There are more complicated ways to do it, but I wanted to see how easy it was.

First, I thought I would do what the API docs suggest and poke around with curl.

Since all I want is to do a search, like you would using a browser, why not try that, only with json, for extra awesomeness.

$ curl 'http://search.twitter.com/search.json?q=baroquebobcat'

Running that gets me a long string of json:

{"results":[{"text":"Talkin' 'bout sandwiches", ...

Breaking that down with structurally looks like

{
  "results": [
    { "text":"Talkin' 'bout sandwiches",
      "to_user_id":null,
      "from_user":"baroquebobcat",
      "id":1307603293,
      "from_user_id":125785,
      "iso_language_code":"en",
      "source":"web<\/a>",
      "profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/79555083\/face02_normal.jpg",
      "created_at":"Tue, 10 Mar 2009 22:04:12 +0000"
    },
    ...
  ],
  "since_id":0,
  "max_id":1307851898,
  "refresh_url":"?since_id=1307851898&q=baroquebobcat",
  "results_per_page":15,
  "next_page":"?page=2&max_id=1307851898&q=baroquebobcat",
  "completed_in":0.033281,
  "page":1,
  "query":"baroquebobcat"
}

Results contains the statuses that match the search, the other 1st level attributes are metadata about the search.

For my silly simple js app, all I really need is a subset of this vertiable bevy of infos.

I am not even going to bother with the search metadata and am going to throw away most of the statuses data too.

For now, I only care about the text, and the user who tweeted it.

{
  "results": [
    { "text":"Talkin' 'bout sandwiches",
      "from_user":"baroquebobcat"
    },
    ...
  ]
}

So, I have this list and a url to get stuff. How does that go into the javascript?

we need a callback. Because of all that cross site scripting etc stuff, you can’t do ajax requests for data like this
(well you can as long as you proxy it through your host somehow like
this guy ).
So, the way to get all this stuff so it can be executable is to add a callback parameter to the request. It wraps the json with a function call so you can use it in a script tag.

$ curl 'http://search.twitter.com/search.json?q=baroquebobcat&callback=awesome'
awesome({"results":[{"text":"Talkin' 'bout sandwiches", ...})

so in html file can do

and awesome will be executed with the response from the search.


cut to the chase

So, we need a callback.

because we lack imagination, lets call it twitter_callback.


  Super Silly Twitter App
  
  
  
  
  

Pretty cool, huh?

What that does is define a call back that just writes each status in the search with the user’s name: their tweet on each line.

Actually, that is a bit boring.

All we have is the list, and it’s not very portable but it demonstrates how it works.

You could make it more robust by using a javascript function to insert the script tag, thereby allowing you to dynamically set the query.

There are problems with using js to do all the work here. It can be slower and it also can be a security risk–if you don’t trust twitter.

Laters.

Mountain West Ruby Conf Day -1

Friday, March 13th, 2009

I am here in Salt Lake City. Chilling at the library because it is a beautiful building and neatly downtown. In the auditorium I can see they have the projector working.

Behavior Driven Behavior Driven Development

Wednesday, March 4th, 2009

Like all true CS aficionados I have a thing for recursively applying layers of abstractions on top of themselves. Makes for interesting stories.

I have been using much more javascript than I ever thought I would. And, I like it for the most part. But, there is this niggly feeling in the back of my head because I’ve been doing so without a snuggly net of tests. Or even specs.

I looked at jsunit, jsspec and Screw.Unit. But, I didn’t really like the way they worked. So, in the usual way of things. I started on my own.

The first thing I didn’t like about the frameworks when I started looking at them was that they tried to avoid adding things to Object.prototype. Which makes it more difficult to do rspec style expectations like(ruby not js)

"foo".should include('oo')

because should is not available to “foo”

mostly, they get around this by using wrapper functions.

expect("foo").to(include("oo")

and

value_of("foo").should(include("oo"))

when what I want is

"foo".should("include","oo")

It is silly, I know but I got use to rspec and I want my javascript specs to be as free of line noise. Hanging stuff off of Object.prototype is the easy way to do this, but it can break things. Mostly for (… in … ) loops. Arguably, you shouldn’t use those for much anyway. They are dangerous in some circumstances. That’s mostly an opinion thing, though.

The other problem I had was finding coherent documentation. All of the js testing frameworks have fairly good documentation, but I had some trouble figuring out what was the most current practice. Some jsspec looks a lot like what I am looking to do. But now I have started, and it is an interesting project.

The project I am using it for is a gomoku game, maybe backed up by sinatra at some point, but for now it is just js.

I am planning on posting some code later, right now it doesn’t even have setup hooks.

Mountain West Ruby Conference

Wednesday, March 4th, 2009

I am going to Salt Lake next week to participate in an awesome conference. And yes this post is just a blatant excuse to post the attending badge.


I'm attending MountainWest RubyConf 2009!