Faster approach to identifying duplicates in a Ruby array
Not mine, this one. Came from bshow here
a = [1,1,5,5,2,3,99,54,54,3,7,54,54,3,19]
a.inject({}) {|h,v| h[v]=h[v].to_i+1; h}.reject{|k,v| v==1}.keys.inspect # => [1, 3, 5, 54]
Ruby Fnord Generator - Part Two
In Part 1, I took you through the beginnings of the Fnord generator up to the point we could create Fnords using random words and optional parts of speech. This gave us a class Fnord which contained the following functions.
require "fnord_words.rb" #Arrays of NOUNS, ADJECTIVES, PLACES etc.
class Fnord
def self.true?(chance) (chance==0 or rand(chance)<1) end
def self.build(string_array,chance=0) true?(chance) ? string_array[rand(string_array.length)] : "" end
def self.in_place(chance=0) true?(chance) ? "in #{build(PLACES)}" : "" end
def self.adjective(chance=0) build(ADJECTIVES, chance) end
def self.name(chance=0) build(NAMES, chance) end
def self.place(chance=0) build(PLACES, chance) end
def self.preposition(chance=0) build(PREPOSITIONS, chance) end
def self.action(chance=0) build(ACTIONS, chance) end
def self.pronoun(chance=0) build(PRONOUNS, chance) end
def self.intro(chance=0) build(INTROS, chance) end
def self.noun(chance=0) build(NOUNS, chance) end
end
I moved the word lists into their own file “fnord_words.rb”. Since these are separately generated and updated by SJ Games, it made sense to have them as separate files. I thought of writing a quick Perl->Ruby conversion to allow for the files to be dropped in, but since manually updating requires making only small changes to the file, I decided to leave this as an exercise for a later date.
I was using the normal
msg=case rand(14) #Return generated Fnord as a string
when 0: "The #{adjective(2)} #{noun} #{in_place(5)} is #{adjective}."
when 1: "#{name} #{action} the #{adjective} #{noun} and the #{adjective} #{noun}."
when 2: "The #{noun} from #{place} will go to #{place}."
when 3: "#{name} must take the #{adjective} #{noun} from #{place}."
when 4: "#{place} is #{adjective} and the #{noun} is #{adjective}."
.
.
.
when 13: "A #{noun} from #{place} #{action} the #{adjective(2)} #{adjective(5)} #{noun}."
end
and I figured I could move all of the data including the SENTENCES into a template to make it even easier to update. This required two things to happen.
- All of the parts of speech required are embedded in the string.
- The parts of speech can only be evaluated at runtime when the method is called.
We’d already achieved the first, and in order to have the second all that was needed was to move the SENTENCE strings into single quotes, such as
'#{intro(5)} the #{adjective(2)} #{adjective(2)} #{noun} #{action} the #{adjective(2)} #{adjective(2)} #{noun} #{in_place(2)}.'
In order to execute this later, you use the eval function to perform substitutions. Ignore normalize for now, it’s only to remove extra spaces and fixup capitalization.
def self.sentence(chance=0)
normalize(eval('"'+build(SENTENCES,chance)+'"'))
end
private
def self.normalize(msg)
while msg.include?(" ")
msg.gsub!(/ /," ")
end
msg.gsub!(/^ /,"")
msg.gsub!(/ ./,".")
msg.gsub!(/[s^]([aA])s([aeiouhy])/,' 1n 2')
msg[0]=msg[0,1].upcase
while msg[/([^A-Z][.!?:])s+([a-z])/]
msg[/([^A-Z][.!?:])s+([a-z])/]="#{$1} #{$2.upcase}"
end
msg
end
and voila. Sentences can be constructed by calling
print Fnord.sentence
We are still missing the word lists. You can grab the latest updated Perl version from SJ Games, or, if you are feeling really lazy, download my updated Ruby code from my website and grab my personalized Rubyised word lists from here. They aren’t strictly the Fnords word list, so you may prefer the SJ Games ones, but they are in the correct format.
If you’ve gone down the Perl wordlist route, you won’t have found the SENTENCES array, which you need for my code to work. You can either modify my oroginal code, or use the expanded versions below.
#Note. Parts of speech are coded in the main application and MUST NOT be expanded here. Hence only ' rather then " can be used.
SENTENCES=[
'#{intro(5)} #{name} #{action} #{name} and #{pronoun} #{adjective(2)} #{adjective(2)} #{noun}.',
'#{intro(5)} #{name} #{action} the #{adjective(2)} #{adjective(2)} #{noun} and the #{adjective(2)} #{adjective(2)} #{noun} #{in_place(2)}.',
'#{intro(5)} #{name} #{action} the #{adjective(2)} #{adjective(2)} #{noun} of #{place}.',
'#{intro(5)} #{name} #{preposition} #{place} and #{action} the #{adjective(2)} #{adjective(2)} #{noun}.',
'#{intro(5)} #{name} #{preposition} #{place} for the #{adjective(2)} #{adjective} #{noun}.',
'#{intro(5)} #{name} is the #{adjective(2)} #{adjective(2)} #{noun}; #{name} #{preposition} #{place}.',
'#{intro(5)} #{name} must take the #{adjective(2)} #{adjective(2)} #{noun} from #{place}.',
'#{intro(5)} #{name} takes #{pronoun} #{adjective(2)} #{adjective(2)} #{noun} and #{preposition} #{place}.',
'#{intro(5)} #{place} is #{adjective} and the #{noun} is #{adjective}.',
'#{intro(5)} a #{adjective(2)} #{adjective(2)} #{noun} from #{place} #{action} the #{adjective(2)} #{adjective(2)} #{noun}.',
'#{intro(5)} the #{adjective(2)} #{adjective(2)} #{noun} #{action} the #{adjective(2)} #{adjective(2)} #{noun} #{in_place(2)}.',
'#{intro(5)} the #{adjective(2)} #{adjective(2)} #{noun} #{in_place(2)} is #{adjective}.',
'#{intro(5)} the #{adjective(2)} #{adjective(2)} #{noun} from #{place} will go to #{place}.',
'#{intro(5)} you must meet #{name} at #{place} and get the #{adjective(2)} #{adjective(2)} #{noun}.'
]
Enjoy
Ruby Fnord Generator - Part One
I recently came across the Steve Jackson Games Fnords program and thought that there should be a really cool and easy way to generate this type of sentence using Ruby. The basic priciple is that you take arrays of NOUNS, PLACES, VERBS, and other parts of speech and generate syntacically correct nonsensical sentences. A little bit like a truncated form of madlibs.
Ruby embedded code in strings was something that I’d played around with, and I thought that it should be relatively easy to base sentence construction using methods embedded in the strings. So basically
"#{name} is a #{adjective} #{noun}."
could be run through the generator and create “Mac is a brown dog”, “Sigmund Freud is a coherent lightbulb”, type of sentences. Fairly basic stuff with NAME, ADJECTIVE and NOUN being arrays of appropriate words and the method, for example, of self.name being defined as
def self.name NAME[rand(NAME.length)] end
If you’ve taken a look at the other Fnords programs at SJ Games (or even my early one which is now downloadable from there), you will have noticed that the sentences themselves have a random chance of having some parts of speech included. It was this random element that first attracted me to solving the problem using Ruby.
Most code on the site uses logic of the following form.
msg="The" # The
if rand(2) == 0 # adjective - (50% chance)
msg+=adjecive
end
msg+=noun # noun
if rand(5) == 0 # in place - (20% chance)
msg+="in #{place}"
end
msg+="is #{adjective}." # is adjective.
That wasn’t DRY enough for me, and too much code when a little would do the same thing. Moving the (rand()) into the actual function that defined the part of speech and making the return from the call optional would do almost the same thing. Worst case I would have to fix up spaces at the end. (I actually decided to do space fixup as a final pass, since it meant I could just type the sentences spaced normally, which makes it easier to maintain.)
Ok so with the method for noun now as
def self.noun(chance=0)
if (rand(chance)<1) then
NOUN[rand(NOUN.length)]
else
""
end
end
The way the Ruby rand works, passing it 0 gives a random number between 0 and 1 and passing a positive integer greater than 0 generates a random integer, so with this code rand(0)<1 is always true, so the next iteration changed this to
if (chance==0 or rand(chance)<1)
Finally to DRY it up even more, I removed the randomness into two separate methods and switched to the “? :” form of “if then”.
def self.true?(chance)
(chance==0 or rand(chance)<1)
end
def self.build(string_array,chance=0)
true?(chance) ? string_array[rand(string_array.length)] : ""
end
which meant that my noun method could now simplify again to
def self.noun(chance=0)
build(NOUNS, chance)
end
One special case was required to allow for “in place” as optional rather than just “place”.
def self.in_place(chance=0)
true?(chance) ? "in #{build(PLACES)}" : ""
end
Now I could create strings using my desired form.
msg="The #{adjective(2)} #{noun} #{in_place(5)} is #{adjective}."
Part 2 will examine how to take this and create the fully functional fnords program.
Fast extraction of duplicate array items into a new array
Whilst creating a natural language parser, one of the things I was presented with was multiple merged dictionaries, which needed some processing. I was asked to supply a list of duplicated words back, and after trawling the web finding slow code, I decided that going the fast, but inefficient (in terms of space) was the way to go.
The object is to return an array of just those elements that are duplicated in as little time as possible, from a 50,000 word list. One sort and one lookup per element was what I came up with
array=["long","array","with","lots","and","lots","and","lots","of","array","duplicates","long","and","array"]
arr2=array.sort
arr3=[]
arr4=[]
arr2.each { |a| (arr3[-1]==a) ? (arr4[-1]!=a) ? arr4 << a : "" : arr3 << a }
arr3 => [”and”,”array”,”duplicates”,”long”,”lots”,”of”,”with”]
arr4 => [”and”,”array”,”long”,”lots”]
If you are sure that there are fewer duplicates in the returned array of just duplicated elements, you can remove the arr4 checks at the expense of a final .uniq! pass. i.e.
array=["long","array","with","lots","and","lots","and","lots","of","array","duplicates","long","and","array"]
arr2=array.sort
arr3=[]
arr4=[]
arr2.each { |a| (arr3[-1]==a) ? arr4 << a : arr3 << a }
arr4.uniq!
arr3 => [”and”,”array”,”duplicates”,”long”,”lots”,”of”,”with”]
arr4 => [”and”,”array”,”long”,”lots”]
Looks Quiet. Isn’t.
Maintaining 4 separate blogs (2 project specific and intraneted, rather than external), doesn’t take any more time than 1, but it means that less gets added to this one than might otherwise be the case. However, one thing I can share is the work that’s been going on under the covers to get some Ajax code working on Blogger. (Yet another blog). This all came about when I had looked at some code and thought. Hmm. That would be so much easier to create, maintain and extend in Ruby.
I didn’t want the full blown features of Rails, but since I was experimenting with cutting down the code needed for yet another project, I thought that this would give me a good quick way of injecting Ajax code into a 3rd party site.
One of the rules of Ajax, is that you can’t go outside the domain for the call. So where an XMLHttpRequest.open(’GET’,'http://random.external.site.com/CGI_program’), would throw an error, you can do this by performing the call from an page on http://random.external.site.com.
For example, the header on Nofnords is an Ajaxified update from fnord.pqmf.com (a subdomain of this site), which has been embedded using an iframe which uses http://fnord.pqmf.com/fnord.html as the jumping off point. What this means is that the XMLHttpRequest comes from the same domain as the iframe’d page. Since this is a separate request, there is still a separate between the domains, so data isn’t accessible between the two pieces of content directly, but with some CSS, the appearance is (almost) seamless, and allows for some “personalized” customisation that would otherwise be difficult to achieve.
Displaying a subset of items from an association
As of this post I have two classes joined by have_and_belongs_to_many (habtm), and I figured that I’d like to be able to click on an entry in one and have a subset index of the other appear. Not an uncommon task and used by tags and blogs everywhere. Rather than search for a snippet, I thought I’d give it a go myself first.What I came up with surprised me with it’s simplicity and may not be the most expedient manner, but seems to be a neat and easy extension of the index method.
The obvious way was to add an entry to the list of actions which can be applied to a tag item. A simple addition of a “Show Users” link pointing to the Users controller and passing a tag_id parameter was the starting point for this.
Opening up app/views/tags/index.rhtml, we can add a user_path with :tag_id=>tag as the parameter. This will translate to http://localhost:3000/users?tag_id=x.
<h1>Listing tags</h1>
<table>
<tr>
<th>Name</th>
</tr>
<% for tag in @tags %>
<tr>
<td><%=h tag.name %></td>
<td><%= link_to 'Users', user_path(:tag_id=>tag) %></td>
<td><%= link_to 'Show', tag_path(tag) %></td>
<td><%= link_to 'Edit', edit_tag_path(tag) %></td>
<td><%= link_to 'Destroy', tag_path(tag), :confirm => 'Are you sure?', :method => :delete %></td>
</tr>
<% end %>
</table>
<br />
<%= link_to 'New tag', new_tag_path %>
This will then allow the following in the index view of the users controller.
# GET /users
# GET /users.xml
def index
@tag=Tag.find(params[:tag_id]) if params[:tag_id]
@users = @tag.users || throw rescue User.find(:all)
respond_to do |format|
format.html # index.rhtml
format.xml { render : xml => @users.to_xml }
end
end
Note the unusual throw rescue construct. Since @tag.users would throw an exception, as well as having a nil possibility, this is the dryest form of getting the original User.find(:all) executed on error. I mainly wanted to see if this would work, and it does! I’m really starting to like what you can do with Ruby.
RESTful Rails with Associations explored
I’ve recently switched to EdgeRails for Rails 1.2 RC1, and decided to try out the resource_scaffold to create RESTful classes. There’s not that much documentation on this so far, so I thought I’d combine using these with creating habtm associations. What follows is a walkthrough of the initial creation of a has_and_belongs_to_many association and the changes required to get it to do what I want within the scaffold_resource RESTful framework.
First of all, some MVC creation. I like the fact that tests are now generated by the scaffold_resource, but be warned that if you modify your migrations, you also need to change the test/fixtures/*.yml files to reflect the changes. Otherwise, your unit tests will start to error. We’re going to be using the extension to scaffold_resource and generate a string “name” for both tables, which will also generate the fixture unit test for that column.
cd blog
script/generate scaffold_resource user name:string
script/generate scaffold_resource tag name:string
script/generate migration create_tags_users
class CreateTagsUsers < ActiveRecord::Migration
def self.up
create_table :tags_users, :id=>false do |t|
t.column :tag_id, :integer
t.column :user_id, :integer
end
end
def self.down
drop_table :tags_users
end
end
Don’t forget the :id=>false (unless you know what you are doing, that is).
Next, modify the models to point to each other. app/models/tag.rb and app/models/user.rb become:
class Tag < ActiveRecord::Base
has_and_belongs_to_many :users
end
and
class User < ActiveRecord::Base
has_and_belongs_to_many :tags
end
At this point, I like to run the migrate and the tests which were created by the scaffold_resource.
Ok. For app/views/users the following become the new views
index.rhtml
<h1>Listing users</h1>
<table>
<tr>
<th>Name</th>
<th>Tags</th>
</tr>
<% for user in @users %>
<tr>
<td><%=h user.name %></td>
<td>
<% for tag in user.tags %>
<%= tag.name %><br />
<% end %>
</td>
<td><%= link_to 'Show', user_path(user) %></td>
<td><%= link_to 'Edit', edit_user_path(user) %></td>
<td><%= link_to 'Destroy', user_path(user), :confirm => 'Are you sure?', :method => :delete %></td>
</tr>
<% end %>
</table>
<br />
<%= link_to 'New user', new_user_path %>
new.rhtml
<h1>New user</h1>
<%= error_messages_for :user %>
<% form_for(:user, :url => users_path) do |f| %>
<p>
<b>Name</b><br />
<%= f.text_field :name %>
</p>
<p>
<b>Tags</b><br />
<% for tag in @tags %>
<br />
<input type="checkbox"
id="<%=tag.id%>"
name="tag_ids[]"
value="<%=tag.id%>"
>
<%=tag.name%>
<% end %>
</p>
<p>
<%= submit_tag "Create" %>
</p>
<% end %>
<%= link_to 'Back', users_path %>
show.rhtml
<p>
<b>Name:</b>
<%=h @user.name %>
</p>
<p>
<b>Tags:</b>
<% for tag in @user.tags %>
<%= tag.name %><br />
<% end %>
</p>
<%= link_to 'Edit', edit_user_path(@user) %> |
<%= link_to 'Back', users_path %>
and finally, edit.rhtml
<h1>Editing user</h1>
<%= error_messages_for :user %>
<% form_for(:user, :url => user_path(@user), :html => { :method => :put }) do |f| %>
<p>
<b>Name</b><br />
<%= f.text_field :name %>
</p>
<p>
<b>Tags</b><br />
<% for tag in @tags %>
<br />
<input type="checkbox"
id="<%=tag.id%>"
name="tag_ids[]"
value="<%=tag.id%>"
<%if @user.tags.include? tag%>checked="checked"<%end%>
>
<%=tag.name%>
<% end %>
</p>
<p>
<%= submit_tag "Update" %>
</p>
<% end %>
<%= link_to 'Show', user_path(@user) %> |
<%= link_to 'Back', users_path %>
So not that much different to the CRUD scaffolding. I’m going to experiment more with this, and also with the through :class approach of handling associations, which I believe looks to have some strong advantages (not the least of which being that it gives you a join class rather than a join table).
A Weekend on Rails - Day Two
Last time, I built a standard scaffolded Rails application with a modified database, controller (admin) controlling a model named programme. The next step is to add a view and import mechanism. The standard scaffold mechanism uses a list.rhtml as the entry point, so we will create one of these to override the scaffold, and display a list of the current programmes, along with the import button.
<h1>Listing programmes</h1>
<table>
<tr>
<% for column in Programme.content_columns %>
<th><%= column.human_name %></th>
<% end %>
</tr>
<% for programme in @programmes %>
<tr>
<% for column in Programme.content_columns %>
<td><%=h programme.send(column.name) %></td>
<% end %>
</tr>
<% end %>
</table>
<%= link_to ‘Previous page’, { :page => @programme_pages.current.previous } if @programme_pages.current.previous %>
<%= link_to ‘Next page’, { :page => @programme_pages.current.next } if @programme_pages.current.next %><br />
<%= link_to ‘Import XML’, :action => ‘load_xml’ %>
and add a new “load_xml.rhtml” template
<h1>Load XML<h1>
<%= form_tag({ :action=> ‘import_xml’}, {multipart => true }) %>
<%= file_field :document, :file %>
<%= submit_tag ‘Import’ %>
<%= end_form_tag ‘Import’ %>
<%= link_to ‘Back’, :action => ‘list’ %>
Ok.So much for the easy part. We need to add an entry to the controllerfor the ‘import_xml’ action that has just been declared. This will haveaccess to the embedded file uploaded using the file_field :document,:file instruction.
The decision to make the database table columns have exactly the same namesas the XML attributes allows for the following code to populate thedatabase. So the final app/controller/admin_controller.rb looks like:
class AdminController << ApplicationControllerscaffold :programme
def import_xml
require ‘rexml/document’
file=params[:document][:file]
doc=REXML::Document.new(file.read)
doc.root.each_element(’//programme’) do |p|
if not Programme.find(:first, :conditions => [ “name=?”, p.attibutes[:name] ]) then
@programme=Programme.new
@programme.update_attributes(p.attributes)
end
end
redirect_to :action => ‘list’
end
end
Ok. That’s it for now. I’ve scratched the rails surface and learnt something new. More discoveries soon.
A Weekend on Rails - Day One
Since I’ve been laid up and not supposedto be working, Ruby on Rails seemed like an interesting, low-impact thing to do. I’m a complete n00b when it comes to Ruby, so it was pretty much a jump in at the deep-end for me. I’d like to think that I was swimming with Ruby rather than sinking within a matter of hours,and I’d recoded a file autostore/autorename utility in a couple of days.
I picked up the basics of array handling, regular expression manipulation, and some of the syntax of Ruby learnt, I still hadn’t quite made the leap of faith into the “Convention rather than Configuration” paradigm, so I figured it was time to get more deeply immersed in the full Ruby/Rails methodologies by building a Rails based utility.
I like to do something useful when trying out something new. Not production ready coding, but enought to move a personal project ahead and I was writing a TV programme recording prioritisation module for my next stage refinement of the PVR project.
Requirements for this were to have an input which contains the Programme name, a single aka (if appropriate), imdb and tv.com id number, and a recording priority. At this top level, I didn’t care about episodes, season information or anything else. Next extension was going to be for Genres, but I didn’t want to worry about that yet.
I already have XML files which contain the information, and I’d decided to use SQLite V3 as the database, so the Rails task I set myself was to convert the XML to the database.
As I have complete control over the XML file, I didn’t require any validation. If there was a problem, I could trash the database, correct the source file and run again.
The form of the xml file was:
<programmes>
<programme priority=”3″ name=”Time Gentlemen Please”>
<programme priority=”4″ name=”Time Trumpet”>
<programme priority=”1″ name=”Torchwood”>
<programme priority=”1″ name=”Torchwood Declassified”>
</programmes>
with possible additional attributes of aka, imdb_com, tv_com which contain other programme names, and the imdb.com and tv.com ids for the programme.
I’d read a number of Rails articles about moving image files into the database, and decided that I would do this as an import file from a webform.
Since this is my first Rails program, I’ve decided to post it here so I can point and snigger at it later. Feel free to do the same. Assumption is that all of the build prerequisites have already been installed, and I can skip straight to code generation and development work.
First step is to create the rails application framework for this, which goes by the name of BorgTest. Since I’m using SQLite3, I have a slightly modified commandline for the creation.
Checking inside the config/database.yml shows that the correct database is being used
# SQLite version 3.x
# gem install sqlite3-ruby
development:
adapter: sqlite3
database: db/development.sqlite3
# Warning: The database defined as ‘test’ will be erased and
# re-generated from your development database when you run ‘rake’.
# Do not set this db to the same as development or production.
test:
adapter: sqlite3
database: db/test.sqlite3
production:
adapter: sqlite3
database: db/production.sqlite3
Next thing to do is generate a model and controller for the database and associated views.
script/generate model programme admin
Since I already know the exact format of the XML file, I’m going to create a database table with exactly the same columns as the names of the XML attributes.
db/migrate/001_create_programmes.rb
class CreateProgrammes < ActiveRecord::Migration
def self.up
create_table :programmes do |t|
t.column :name, :string
t.column :aka, :string, :default => “”
t.column :priority, :integer, :default => 0
t.column :tv_com, :string, :default => “”
t.column :imdb_com, :string, :default => “”
end
end
def self.down
drop_table :programmes
end
end
Save the above file and run
to create the initial table. Add the scaffold :programme to the app/controllers/admin_controller.rb file
class AdminController << ApplicationController
scaffold :programme
end
Fire up script/server and point the webrowser to http://localhost:3000/admin and check that it is working.
Ok. Initial build completed and I had the basic scaffolded CRUD application. Next post will cover the addition of the controller and model to actually upload the file and perform the import.
PVR Progress
I’ve decided that MythTV is still too bitty for the average user to set up and keep running. This is a shame, since it is obvious that a lot of time and effort has gone into building it, designing the plugin architecture etc.. I’m going to persevere with MythTV for the live home system for now, but I’ve decided to build an alternative - “The Borg Box”.
Mplayer and Xine are easy to use and have good LIRC support (remote controls are desirable in the McKibbin household), so this will start as a manager and wrapper for those rather than trying to implement all of their functionality. Weather I use occasionally, but doesn’t warrant the effort I would spend on it for a first pass, so I’ve decided to implement something similar to MythVideo first. As most code I write is cross platform, and development takes place equally on my Mac notebook and my office Debian machine, it was pot luck to see where I was going to start on this.
Mac notebook won, since I was waiting for a MythTV listings update, and wanted to be near the backend. Since I use MPlayer on the Mac, I decided to see how difficult it would be to pick up a file from the MythVideo database and play it.
MythTV stores all of its configuration data in a MySQL database called mythconverg. I picked up the username/password combination from ~/.mythtv/mysql.txt; logged in and started to examine the data. The MythTV box has been running for some time now and I’ve managed to accumulate a number of AVI files. Native Myth storage is in an MPG ring buffer, and conversion to XVID AVI’s is pretty well documented elsewhere, but if there are enough comments, I’ll produce more detail on how to do this.
All of the MythVideo converted files are referenced in the videometadata table, and you can pick up the path of the video episode from “filename”. All NFS mounted paths are the same across all of my computers, so I could run the file directly using the “open” command on the Mac. All that was really required was to set up access permissions to allow any computer on my network to access the database. A quick re-compile on a Debian machine, with the “xine -pqhf -n” instruction replacing “open” and it was running in Debian under X.
So I now have a program that will pick a random file from the MythTV database and play it on either Max or Debbie. Good enough for one night. I’m looking at making the final “Borg Box” commercial, once I have full integration.
Not that I would ship it on a Pentium II, but The Eden + Hauppauge combination works well, and Debian machines built on this platform may become my chosen distribution.