Home | Blog Roll | Link Roll | Colophon/About


Archive for December, 2005

iKitty for your iPod

Thursday, December 29th, 2005

iKiity from speck

Web 2.0: My Web

Friday, December 23rd, 2005

The Marketing and Money people have made “” the newest buzz word of the season with even the Wall Street Journal picking up on it.

Via Darren Barefoot Some Clear Thinking on Web 2.0 we have Dion Hinchcliffe’s Five Reasons Why Web 2.0 Matters, which I would further reduce to :

It’s “My Web”, and is re-writing the rules (again).

Web 2.0 is not , , , ’s, or even Open Source. That’s “How”. It is very hard to define What “Web 2.0″ is, but here’s a description.

Personal Publishing : Not just personal Blogs, but anyone being able to write a comment on sometime posted by Business Week or Washington Post, or reading, and then editing, the , or sharing a link on . Not printing Static information on Dead Trees.

Personal Commerce: Buying and selling on Ebay, Amazon or Itunes. Paying or billing via PayPal. Showing your House on the web. Micro branding, consumer generated reviews, and on line reputation. Not impersonal stores, and authoritative brands.

Personal Entertainment : mp3 music, DVD’s, camera phones, single songs on Itunes or file sharing networks, podcasts, and flikr, Personal Video Recorders (PVR’s) and Tivo. Not pre packaged stories and pre packaged schedules.

Personal Subscription: finding the bits I’m interesting about without the cruf. Aggregators and feeds, , Tagging and trackbacks. Not email Newsletters, or “News at 11″.

It’s available everywhere anytime, and it’s two way, either free or cheap, and no matter now big or small it’s very inter connected, and very very personal. (See Small Pieces Loosely Joined for an early manifesto)

It’s not completely new. It will not (utterly) replace what came before ( be that pre-”Web 2.0″, or pre Internet), is reorganizing and adding a new layer on to all that. And it’s not yet finished being built, by definition it never will be, but its foundations are still incomplete. But the outline is there and it’s so much cheaper, easier, and dynamic then what came before (which must have been “Web 1.0″).

Web Comments for Firefox

Thursday, December 15th, 2005

is a new (versions 1.5 and greater) extension released by , and developed by , which shows you what bloggers around the world are saying about the current url you are viewing, using the indexs of Google’s .

It was inspired by (well known for this work on ), who cames across ( and was inspired by) comments I made in November 2004 on the old FalsePositives blog on blogger : Looking for FireFox / Mozilla extensions for Del.Icio.us and Technorati, about a system to find and display commentaries on the current web page, using the index. I also mentioned some other work done towards this in Illuminating the Web, with GreaseMonkey

Very Well Done Glen! The visual design of the extension is nice. However: the “add comments” allows you to add a post on your Blooger blog onl; and “1 of Many” is too cute, tell me how many, Give me “1 of 7″

Add this to a bunch of other Google releases : a FireFox extention for Safe Browsing, protection agianst phishing or spoofing sites; and the Google Homepage API allows you to create sharable Javascript modules that can personalize the Google Home page. (this will be come more important when finally surfaces.)

Update: Technorati Niall Kennedy makes some good points in Technorati Web Comments for Firefox about how heavy handed Google’s terms of service for this extension is (and I can’t think of any FF extension that had any terms of service before). Yes, I would like to see the a Web Comments for Firefox with full support for the MetaWeblog API, so I could point it at the index of my choice.

Rails 1.0: Party like it’s one oh oh!

Tuesday, December 13th, 2005

Ruby on Rails Release 1.0 is Out of the Box!, with a re-designed web home @ http://www.rubyonrails.org/, and lots of good stuff to discover. Also on the main page is “Who is already on Rails?” highlighting a few real world applications already using Rails and more applications

you mean it hasn’t been 1.0 before?”

Which Muppet am I?

Monday, December 12th, 2005

And I’ve got the hair line to prove it…
Bunson jpeg
You are Dr. Bunson Honeydew.
You love to analyse things and further the cause of
science, even if you do tend to blow things up
more often than not.

HOBBIES:
Scientific inquiry, Looking through microscopes,
Recombining DNA to create decorative art.
QUOTE:
“Now, Beakie, we’ll just flip this switch and
60,000 refreshing volts of electricity will
surge through your body. Ready?”

FAVORITE MUSICAL ARTIST:
John Cougar Melonhead

LAST BOOK READ:
“Quantum Physics: 101 Easy Microwave
Recipes”

NEVER LEAVES HOME WITHOUT:
An atom smasher and plenty of extra atoms.

What Muppet are you?
brought to you by Quizilla

It’s all Scooter Randy’s fault. and Chef Richard Schwartz say’s Bork! Bork! Bork! . Lee lacks the hairline, but otherwise is a fine evil genius crazy scientist

Building a Better Drop Down Selection List for Ruby on Rails

Saturday, December 10th, 2005

In building the View part (using RHTML Templates) of a RoR () application we frequently want to present a controlled set or list of options for the user to select and way to do this is using the html , which is easy enough to do in RoR, either building it with embedded Ruby (ERb) and/or using the select() helper method, and with only a little more effort you can do so using information stored in a database table via your models, of course, using a find() method to get the values. The “Agile Web Development with Rails” AWDR book has some excellent information on doing this (Chapter 17 pages 357 - 359 ).

The collection_select helper adds in some extra sugar automatation dealing with the collection.


<%=
	@items = Item.find(:all, :order => "name")
	collection_select("stuff", "item_id", @items, :id, :name )
%>

However, I find the current ways of doing this lacking in two ways:

  1. The element present to the users to select are based on the values of only one field. What if you what to be more descriptive and present more information?
  2. The use of the selected=”selected” attribute is necessary when you are editing an existing record - easy, but also for new elements there is no way to present a default element, unless the first element is the default. But what if you what to set Manitoba as the default in a list of provinces (M being in the middle), or present a blank choice or a “Please Select a Widget Type” message?

With this goal in mind I set out to build my more user friendly generated Select.


1   <select id="stuff_item_id" name="stuff[item_id]">
2   <% if @stuff.item_id == 0 or  @stuff.item_id == nil -%>
3     	<option value="" selected="selected" >Please Selected An Item</option>
4   <% end -%>
5   <% @items = Item.find(:all, :order => "name")
6 	 @items.each do |item| %>
7   <option value="<%= item.id %>"
8   <% if @stuff.item_id == item.id -%> selected="selected"<% end -%>
9   >
10 <%= item.name %> (<%= item.description %>)
11 </option>
12 <% end %>
13 </select>

which when used (when doing a “new”) I get something like this:

now for some explaining (assuming some knowledge of ruby and rails):
we are updating a stuff table/model with a field called “item_id”, there is also a table/model call item with fields “id”, “name”, and “description”

  • line 1: start the select tag. the name="stuff[item_id]" is important to populate the “item_id” field in “stuff”
  • lines 2-4: checking the value in for the current record of stuff. When a new record is created it is zero, when it has failed validation it is “nil”. In either case this is where the default message (which might just be an emplty string), and value goes. You could also do a different default with validation fails.
  • line 5: gets all the values from the Item model, sorted by name, and stores it in @items.
  • line 6: start looping thru @items, one item at a time.
  • line 7: builds each option tag of the select and sets the value attribute to “item.id”, which is what will be actually stored in “stuff”.
  • line 8: sets the selected attribute if we are editing an existing “stuff” record.
  • line 9: close the front part of the option tag.
  • line 10: build what the user see, lin this case the name and in brackets the description
  • line 11:then close the option tag for this value of item.
  • line 12: close the looping for this item , which was started on line 6.
  • line 13 :close the select tag.

Hopefully this is clear enough to help others. I’m still exploring the documentation and the RoR api doc has a section on ActionView::Helpers::FormOptionsHelper, with some specialized select Helpers.

I did not address the “Manitoba as the default in a list of provinces (M being in the middle)” objection in the above code. To do so you have have to A) know or figure out that “Manitoba” had a value of 6, then B) , my guess at best - or least worst - practice, do a if @stuff.item_id == 0 then @stuff.item_id = 6 to set this default value before the select.

Perhaps I should I will build a re-useable helper “collection_select_with_defaults”? …very very soon.

Amy Ho has some useful advice in A Little Form Help From Your Friends, all about Rail form helpers

I should also note that similar problems and solutions exist in PHP, JSP and ASP.

update: on the RoR wiki there is HowtoUseFormOptionHelpers

March 7, 2006 Update: , Sam Livingston-Gray not only linked here, but wraped it in a user *and* developer friendly helper function in the comments below

yahoo.icio.us! : del.icio.us has joined the Yahoo! family

Friday, December 9th, 2005

Yahoo! has just acquired , the social bookmarking service, as announced on the Yahoo and the Del.icio.us blog’s

What’s the big deal about ? Well you can read What’s so cool about del.icio.us?, and or what I wrote a year ago here Folksonomies In Del.icio.us and Flickr on Slashdot and on slashdot : Folksonomies In Del.icio.us and Flickr,

But the shortest answer is that Del.icio.us, and Flickr.com (also a part of Yahoo!, since last winter), populized the folksonomies (tagging) and the Social and Share web space. This looks like a good thing for Del.icio.us and Yahoo! More stuff tagged on Del.icio.us under the tag: , what else, and

Also the Globe & Mail has a large article on the Un-Google and Yahoo’s search for Net supremacy, and how the Web portal is on a mission to beat Google for surfers’ loyalties and advertising dollars in a battle that could dramatically alter their cyberscape. lots of background and figures to thinks about.

Also John Battelle has scouted out details of the deal , and has a interview with Google CEO Eric Schmidt in this months Business 2.0.

Dear Cthulhu…

Wednesday, December 7th, 2005

Oh Great Cthulhu!

I have been an extremely sedulous devotee this year.

In March, I wore an Elder Sign (-10 points). In September, I exposed [info]autopope to soul-rending horrors (250 points). In July, I rammed a ship into you (sorry Cthulhu!) (-1000 points). In November, I stopped [info]autopope from defiling Lovecraft’s grave (-20 points). When the stars were right, I burnt my copy of the Necronomicon (-75 points). In May, I legally changed my name to Randolph Carter (-40 points).

In short, I have been very bad (-895 points) and deserve to be flayed alive.

Your humble and obedient servant,
falsepositives

Submit your own plea to Cthulhu!

If you have a Live Journal username you can Submit your own plea to Cthulhu!…Via Randy McDonald’s LJ. DC is a parody of another old one : ). Otherwise your are dependent on the mood of fluffcthulhu, which as Autopope knows is hard to judge…and while you’re waiting you can enjoy the UNSPEAKABLE VAULT (Of Doom) comics and weblog, as well as other things , and while wearing your , and while reading Cthulhu Circus!


Close
  • Social Web
  • E-mail
E-mail It