A few Hoptoad UI adjustments

Posted over 2 years back at GIANT ROBOTS SMASHING INTO OTHER GIANT ROBOTS - Home

Since we launched the Hoptoad redesign we’ve been discussing ways to improve usability which has lead to a few changes as well as some new features. Below is an overview of some of these changes:

Error Index hoptoad ui

1. Rails environment indicator: in order to save space we trimmed the environment to the first character which will expand when you hover over it. Additionally we added the environment indicator to the project error view.

2. Nicely truncated error messages: error messages are now longer than before and truncated based on the width of your browser. Go ahead and maximize the window to your 30” monitor and enjoy.

Error show page hoptoad iu

1. Sensible left column: We’ve limited the information on the left to be more global in nature.
2. Error message: We moved the error message to the main column and grouped it with similar information. This allows it to display in a full and unencumbered form.
3. Navigating errors: You can now navigate through similar errors using these handy buttons.
4. Link to GitHub: This button will take you directly to the file in question if it’s available in GitHub.


We’re continuing with improvements throughout the app in order to make daily use of Hoptoad as pleasant as possible. As always, thanks for riding the toad.

regarding-plus-ones

Posted over 2 years back at interblah.net - Home

Regarding +1

There's been a little bit of debate over Twitter and on the LRUG mailing list about the validity of "+/-1" as a response. I'm not a huge fan for a few reasons, and I thought it was worth trying to write them down, for my own clarification more than anything else

  • It's an oversimplification.
  • It doesn't provide any context.
  • It's faddish.
  • It's lazy.

In general, unless I'm asking a clear yes-or-no question, and I've explicitly said that I don't want to entertain discussion, I think I would prefer to not hear from anyone who only responds with '+1'.

Disclaimer

Bear in mind that these are just my cranky opinions, the internet is for the young and I am so old now. So very, very old. So please don't be offended if you disagree, and/or you love +1-ing things left, right and centre. It could well be that I'm wrong.

Except I'm not.

Here's why:

It's an oversimplication

Let's imagine that you and I are good friends. I write you an email one day:

Hey, come round to my place and lets have some dinner.

You respond

+1

Apart from sounding a bit like a weird robot (and we'll get to that later), all I can infer from that is... some sort of positive response. The conversation hasn't really progressed, other than I know that you're happy to come round and eat my food. Beyond that, I don't really know any more about what you think about dinner. To be honest, you're sounding pretty ungrateful, but we're buddies and so I'll forgive you.

It doesn't provide any context

So you're coming round for dinner, and I'm cooking up some delicious Steak Tartare. Or not cooking in this case, because that's raw beef mince with raw egg and a little bit of seasoning. Drooling yet?

In your '+1' response, you basically gave up your opportunity to provide any context about what you might like. You could've told me what sort of food you like, or any ingredients that you've recently become allergic to (you are a bit of a hypochondriac, but we'll save that for a proper intervention, this is just dinner). You could've said something like

Sounds good. I feel like Mexican, what do you think? How about I bring the nachos and some tequila?

But no, all I get is a +5V on pin 1 of the conversation. Do you even have thoughts or feelings? Do you know what it means to cry, but it's something you can never do? YOU ROBOT.

It's faddish

We know each other, and so you know that we both love technology more than life itself. Except, well... I am also a person too. And I like conversation, and language. If all I interested in was sounding like a computer to my computery friends, why would I bother leaving my sweet DSL connection to come round for food? I could just dial up Pizza Hut and say "aaaaaaaaffirmative" when they asked me if I wanted my Meatsplosion Special on their new wrapped-entirely-in-cheese-then-deep-fried base.

But I'm not like that; I'm literate, and I like talking to other people because that's more interesting. If our dinner conversation is going to be along the lines of "Hey, did you like the BSG finale?", «(robot voice) MINUS ONE» then I'm probably not going to invite you back for a while.

Yes, it seems to be all the rage now in our computery circles, and everyone's doing it, but that doesn't mean that it's cool. I'd rather know a bit more about what you're thinking. Hence:

It's lazy

Yep. Twitter and text messages have taught us the value of brevity, but at what price? Now everything seems to be either awesome or MADE. OF. FAIL. and so on, without any kind of context or reasoning.

Your '+1' doesn't tell me anything about why you are in favour of something; it's simply the fewest characters you could type to increase the likelyhood of something happening in a way you just to be positive for yourself. Is it really so much more expensive for you to saying something along the lines of "Sounds good, great suggestion", that you can't take the extra time to do it?

Use your words, my friend. Use your words.

ARGARGAGARAHGRAHGARAHRGHARHFAHARGHarghahrahgrahgrhahahaaaaaaaaaargargarghahrag ahahaharhaghrahgrajraHGEHRGARHGEHRHAERGHAERGHAERGHAEHGRAEIAEIADFSADPSAFPAPERPJO AERJPGAEP EGRAOPAPOERAJUAPIJGAE?IGAHAEHAGERHERIAHPIFIAPWIEFAPWJR(A£F)J(J£$FW@JF(WFJ£F JC(£$JVAJVM£JA£$)(G£GCJ A£GJ ok I'm fine now. Please continue with your emailing and stuff.

Double Shot #497

Posted over 2 years back at A Fresh Cup


Up late deploying stuff last night, so just a couple of quick links this morning.

  • snail – Start of an ambitious attempt to build a plugin to format international mailing addresses.
  • Firebug 1.4.0 – Officially released, and nicer than 1.3. Of course those of us on the bleeding edge have moved to 1.5 alpha builds already.

Agile JavaScript Testing

Posted over 2 years back at Synthesis

A couple weeks ago, I gave a talk at the Open Source Bridge conference in Portland Oregon on Agile JavaScript Testing.

In this presentation, I first gave an overview of Test Driven Development for those front-end JS developers who might not have heard of it yet (!) and then the difference of TDD vs. Behavior Driven Development.

I then walked through some tools:

  • Screw.Unit, a nice BDD framework for JS that is quite similar to RSpec in Ruby land.
  • Blue Ridge, a plugin for rails that integrates Screw-Unit with Rhino and Env.js and some rake tasks to create a command-line driven headless (no-browser == fast) testing workflow.
  • JS Test Driver, a project that mounts one or more browsers as slaves, and a command-line tool which notifies all the listening browsers to run tests and aggregates the results. Very cool!

In the actual presentation I even did some live coding examples of Blue Ridge and JS Test Driver, and they worked perfectly. Here are the slides from the talk:

Agile JavaScript Testing<object style="margin:0px" width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=jspresentation-090625150011-phpapp02&amp;stripped_title=agile-javascript-testing"/><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=jspresentation-090625150011-phpapp02&amp;stripped_title=agile-javascript-testing" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object>
View more presentations from Scott Becker.

Presentation:Multicore Programming in Erlang

Posted over 2 years back at InfoQ Personalized Feed for unregistered user - Register to upgrade!

Ulf Wiger shows typical Erlang programs, patterns that scale well on multicore and patterns that don't, profiling and debugging parallel applications and ensuring correct behaviour with QuickCheck. By Ulf Wiger

Avoiding nested blocks

Posted over 2 years back at hakunin's blog

Today I had to silence some output streams so that messages don’t pollute the STDOUT. I used the silence_stream method built into Rails, described well in this article.

  silence_stream(STDOUT) do
    # ...my code...
  end

Very nice, except I also wanted to filter STDERR output. Not a problem.

  silence_stream(STDOUT, STDERR) do
    # ...my code...
  end

Well, shit. Here I got a “too many arguments” error. So it doesn’t support multiple streams. I guess it wants me to be ugly.

  silence_stream(STDOUT) do
    silence_stream(STDERR) do
      # ...my code...
    end
  end

I personally don’t take kindly this level of suckiness around here. I want example #2 to work. Well, after lighting some candles and praying to the Ruby gods, I came up with a scary implementation. In fact it’s so spooky that it may have the same effect as glancing at the Mexican Starting Frog of Southern Sri Lanka. You may then throw a chair at me on the Jerry Springer show, so I rather not show it to you.

However, after having cleansed my .rb file with some broc flowers and xander roots I came up with a better solution. Recursion is the key. See if you can understand what is happening.

def silence_streams(*streams, &blk)
  silence_stream(streams.pop) do
    if streams.empty?
      yield
    else
      silence_streams(*streams, &blk)
    end
  end
end

This is a basic use of recursion, which is not immediately clear when dealing with nested Ruby blocks. When multiple streams are passed in I’m popping out the last stream and silencing it alone, then calling the same method with the remaining streams. This is happening until only one stream left to silence. The last one gets silenced with the original block passed in, which means that the original block is executed at the deepest nesting level, where all passed streams are silenced. As a result I got this much desired functionality without resorting to eval, yay.

  silence_streams(STDOUT, STDERR) do
    # ...my code...
  end

There we go. This solution can be applied to cases where you’d rather avoid overriding stuff (thus keeping out of method implementation details).

Update: Made recursion more concise thanks to apeiros on #railsbridge.

Avoiding nested blocks

Posted over 2 years back at hakunin's blog

Today I had to silence some output streams so that messages don’t pollute the STDOUT. I used the silence_stream method built into Rails, described well in this article.

  silence_stream(STDOUT) do
    # ...my code...
  end

Very nice, except I also wanted to filter STDERR output. Not a problem.

  silence_stream(STDOUT, STDERR) do
    # ...my code...
  end

Well, shit. Here I got a “too many arguments” error. So it doesn’t support multiple streams. I guess it wants me to be ugly.

  silence_stream(STDOUT) do
    silence_stream(STDERR) do
      # ...my code...
    end
  end

I personally don’t take kindly this level of suckiness around here. I want example #2 to work. Well, after lighting some candles and praying to the Ruby gods, I came up with a scary implementation. In fact it’s so spooky that it may have the same effect as glancing at the Mexican Starting Frog of Southern Sri Lanka. You may then throw a chair at me on the Jerry Springer show, so I rather not show it to you.

However, after having cleansed my .rb file with some broc flowers and xander roots I came up with a better solution. Recursion is the key. See if you can understand what is happening.

def silence_streams(*streams, &blk)
  silence_stream(streams.pop) do
    if streams.empty?
      yield
    else
      silence_streams(*streams, &blk)
    end
  end
end

This is a basic use of recursion, which is not immediately clear when dealing with nested Ruby blocks. When multiple streams are passed in I’m popping out the last stream and silencing it alone, then calling the same method with the remaining streams. This is happening until only one stream left to silence. The last one gets silenced with the original block passed in, which means that the original block is executed at the deepest nesting level, where all passed streams are silenced. As a result I got this much desired functionality without resorting to eval, yay.

  silence_streams(STDOUT, STDERR) do
    # ...my code...
  end

There we go. This solution can be applied to cases where you’d rather avoid overriding stuff (thus keeping out of method implementation details).

Update: Made recursion more concise thanks to apeiros on #railsbridge.

Avoiding nested blocks

Posted over 2 years back at hakunin's blog

Today I had to silence some output streams so that messages don’t pollute the STDOUT. I used the silence_stream method built into Rails, described well in this article.

  silence_stream(STDOUT) do
    # ...my code...
  end

Very nice, except I also wanted to filter STDERR output. Not a problem.

  silence_stream(STDOUT, STDERR) do
    # ...my code...
  end

Well, shit. Here I got a “too many arguments” error. So it doesn’t support multiple streams. I guess it wants me to be ugly.

  silence_stream(STDOUT) do
    silence_stream(STDERR) do
      # ...my code...
    end
  end

I personally don’t take kindly this level of suckiness around here. I want example #2 to work. Well, after lighting some candles and praying to the Ruby gods, I came up with a scary implementation. In fact it’s so spooky that it may have the same effect as glancing at the Mexican Starting Frog of Southern Sri Lanka. You may then throw a chair at me on the Jerry Springer show, so I rather not show it to you.

However, after having cleansed my .rb file with some broc flowers and xander roots I came up with a better solution. Recursion is the key. See if you can understand what is happening.

def silence_streams(*streams, &blk)
  silence_stream(streams.pop) do
    if streams.empty?
      yield
    else
      silence_streams(*streams, &blk)
    end
  end
end

This is a basic use of recursion, which is not immediately clear when dealing with nested Ruby blocks. When multiple streams are passed in I’m popping out the last stream and silencing it alone, then calling the same method with the remaining streams. This is happening until only one stream left to silence. The last one gets silenced with the original block passed in, which means that the original block is executed at the deepest nesting level, where all passed streams are silenced. As a result I got this much desired functionality without resorting to eval, yay.

  silence_streams(STDOUT, STDERR) do
    # ...my code...
  end

There we go. This solution can be applied to cases where you’d rather avoid overriding stuff (thus keeping out of method implementation details).

Update: Made recursion more concise thanks to apeiros on #railsbridge.

Alias: Enhance Your Ruby Console/irb Experience

Posted over 2 years back at Ruby Inside

aliasA couple of weeks ago we featured Gabriel Horner's Hirb framework for formatting irb output. I've recently been playing with another of his projects, Alias, which further enhances the Ruby Console experience (but it conceivably could be used in your Ruby programs too).

It's already possible to set up aliases in your .irbrc file, but this can get confusing and it's easy to run into conflicts. Alias takes a more structured, hash-based approach which (by default) lets you set up aliases for constants, instance methods or class methods. For example:

create_aliases :instance_method, "ActiveRecord::Base"=>{"update_attribute"=>'ua'}

You can store and retrieve your aliases in an easy-to-read YAML configuration file and it's simple to have script/console (or irb) load them automatically from that file on start-up, by adding a small amount of code to your environment.rb (or .irbrc) file.

Extending Alias is fairly straightforward. Just subclass Alias::Creator and implement a few methods for mapping the aliases, checking their validity and generating the Ruby code to be evaluated.

For more details, check out the documentation and Gabriel's recent blog post. You can install the gem from Github with:

sudo gem install cldwalker-alias -s http://gems.github.com

jslab.pngAlso.. Jumpstart Lab is offering workshops teaching Ruby for beginning female programmers (Ruby Jumpstart) on August 1st and 2nd, then beginning Rails (Rails Jumpstart) for everyone on August 15 & 16. Save 10% with code "rubyinside"!

My Apprenticeship - Thursday, July 15, 2004

Posted over 2 years back at Jake Scruggs

This summer I'm revisiting my short apprenticeship at Object Mentor. I'll be posting commentary on all my posts from the summer of 2004 exactly 5 years later to the day.

Thursday 7-15-04

So I downloaded and installed Apache -- which wasn't too much trouble. But MySQL was a different story. When typing in the bizarre list of commands to install it, I made a slight typo which took a little while to track down. But, even worse, I ran into the same problem as before -- MySQL would run but Word Press couldn't find it. After a lot of messing about I finally figured out that Linux had installed MySQL automatically and that was causing conflicts. Which I couldn't figure out how to resolve. Before I installed PHP I decided to look and see if it was on the hard drive. I found the documentation, and when I typed in PHP at the command line something happened. But I couldn't find where the files where installed. If this were windows I would have some idea how to go about looking for things. Add/Remove programs can tell you what's installed. The find function in Linux doesn't seem to work as well as windows. This is all part of the big problem here: I don't know Linux yet and so all my usual tricks do not apply. Thursday ended with Word Press' 'five minute install' as yet to be completed. It'll have to wait 'till Monday because tomorrow I'm heading downtown to get a passport. In theory, you only need a birth certificate and a driver's license to travel to Canada, but I have these visions of my flight taking off as I try to convince some large man that I really am a U.S. citizen. Best to be sure.
Turns out most Linux installs come with Apache, PHP, and MySQL -- this supporting of common developer tools was weird to me coming from Windows where if it's remotely useful it must have a heinous install and cost a lot of money.

Why was I going to Canada? Because that year's XPAU (Extreme Programing Agile Universe (Now just called Agile as in 'Agile 2009' - have I mentioned that I'm speaking at it?)) was in Calgary that year. Object Mentor used to organize XPAU, so it was a pretty big deal for them. And me. I think this might have been the last year Object Mentor was running the show.

Behind the scene: Quiltivate.com a beautiful Flex on Rails website.

Posted over 2 years back at OnRails.org

I met Phil several years ago at Derailed, the (Denver Ruby on Rails user group, and for a long time he was curious about how Flex can be integrated with Rails, about the graphical possibilities that Flex offers, the advantages over plain HTML/CSS/Javascript. Then he told me Kacie, his wife, had an idea about a website. She is passionate about quilts and has an eye for details and excellence. Phil is a geek that loves Rails, Kacie loves quilts, it's like Quilting meets Web 2.0 and quiltivate.com was born. In fact Phil and Kacie hired me to create a Quilt Builder that integrates with Quiltivate.com. Kacie had the vision for the whole concept, a simple to use quilt builder that removes lots of the hassle of calculating how much fabric of what color is needed and allows to play with blocks, shapes and colors. She drew a paper prototype that really highlights the tag line of their site" Innovating Traditional Quilting". Quiltivate.com offer much more than a Quilt Builder, it's a blog and a community centered around the art and craft of quilting. Over the last year I spent a couple of hours here and there, well a little more than that, to transform the paper prototype into a real Flex application. Rather than writing about what the tool does and how it does it, let's have a little look at behind the scene of the Quilt Builder with this video: <object width="400" height="300"><param name="allowfullscreen" value="true"/><param name="allowscriptaccess" value="always"/><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=5619106&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1"/><embed src="http://vimeo.com/moogaloop.swf?clip_id=5619106&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="300"></embed></object>

Behind the scene: Quiltivate.com a beautiful Flex on Rails website. from daniel wanja.

Check out quiltivate.com for a video on how to really use the Quilt Builder and go try it out. As it's fresh out of the gates their may be a little quirks here and there, so please let me know what you find. So thank you Kacie and Phil for getting me on this project, it was really fun! Enjoy, Daniel.

FakeFS

Posted over 2 years back at ones zeros majors and minors

FakeFS is a Ruby library which transparently causes File, Dir, and FileUtils to use an in-memory. faux-filesystem rather than the real filesystem on disk. Why? So you don’t have to deal with mocking libraries, so your tests are faster, and so you don’t need a hard drive to run them.

For example, this:

def test_creates_directory
  FileUtils.expects(:mkdir).with("directory").once
  Library.add "directory"
end

Becomes this:

def test_creates_directory
  Library.add "directory"
  assert File.directory?("directory")
end

I don’t know about you, but the second feels more natural to me. Also it means replacing our mkdir call with a call to mkdir_p won’t break our tests. Because, really, it shouldn’t.

Install it:

$ rip install git://github.com/defunkt/fakefs.git

And start using it in your tests:

require 'fakefs'

There really aren’t any usage examples: just write normal Ruby. If you insist, however, check out some of the Rip test or the FakeFS tests.

Rails Envy Podcast – Episode #087: 07/15/2009

Posted over 2 years back at Rails Envy - Home

Episode 87. We bring you the latest news in the Ruby and Rails world. By we I mean I. The greatly delayed podcast 85 will be out in the next couple of days and features a couple awesome surprise co-hosts.

Subscribe via iTunes – iTunes only link.
Download the podcast ~11:30 mins MP3.
Subscribe to feed via RSS by copying the link to your RSS Reader



Runway is a GTD-style action management web application made by geeks for geeks. Created by the folks at Cogent, try a free demo at http://www.runwayapp.com.

Sponsored by New Relic
NewRelic not only provides rails performance monitoring with RPM, but they also produce Rails Lab, a website dedicated to advice on tuning and optimizing Rails apps.

Show Notes

Rails Envy Podcast - Episode #087: 07/15/2009

Posted over 2 years back at Rails Envy - Home

Episode 87. We bring you the latest news in the Ruby and Rails world. By we I mean I. The greatly delayed podcast 85 will be out in the next couple of days and features a couple awesome surprise co-hosts.

Subscribe via iTunes - iTunes only link.
Download the podcast ~11:30 mins MP3.
Subscribe to feed via RSS by copying the link to your RSS Reader



Runway is a GTD-style action management web application made by geeks for geeks. Created by the folks at Cogent, try a free demo at http://www.runwayapp.com.


Sponsored by New Relic NewRelic not only provides rails performance monitoring with RPM, but they also produce Rails Lab, a website dedicated to advice on tuning and optimizing Rails apps.

Show Notes

Rails Envy Podcast - Episode #087: 07/15/2009

Posted over 2 years back at Rails Envy - Home

Episode 87. We bring you the latest news in the Ruby and Rails world. By we I mean I. The greatly delayed podcast 85 will be out in the next couple of days and features a couple awesome surprise co-hosts.

Subscribe via iTunes - iTunes only link.
Download the podcast ~11:30 mins MP3.
Subscribe to feed via RSS by copying the link to your RSS Reader



Runway is a GTD-style action management web application made by geeks for geeks. Created by the folks at Cogent, try a free demo at http://www.runwayapp.com.


Sponsored by New Relic NewRelic not only provides rails performance monitoring with RPM, but they also produce Rails Lab, a website dedicated to advice on tuning and optimizing Rails apps.

Show Notes