-
Wow, fzf looks great.
-
I swear, just go and read this right now; it might look like it's about games, but really, it's about space, and memory, and Memory Palaces, and wrapped around a retrospective of a marvellous game, and a little bit about how games make us who we are, in ways their creators might never have imagined.
-
"We already know the decapitated Statue of Liberty in Deus Ex can tell a story; perhaps I want to know if a building can tell me a poem.
In that vein, "Butte, Montana. 1973" is a game where you dig around in a box of dirt."
This is marvellous; thoughtful, interesting, perhaps not entirely successful, but the trick of the rain at the end is a very, very nice touch.
-
"At this moment of awards-giving and back-patting, however, we can all agree to love movies again, for a little while, because we're living within a mirage that exists for only about six or eight weeks around the end of each year. Right now, we can argue that any system that allows David Fincher to plumb the invention of Facebook and the Coen brothers to visit the old West, that lets us spend the holidays gorging on new work by Darren Aronofsky and David O. Russell, has got to mean that American filmmaking is in reasonably good health. But the truth is that we'll be back to summer—which seems to come sooner every year—in a heartbeat. And it's hard to hold out much hope when you hear the words that one studio executive, who could have been speaking for all her kin, is ready to chisel onto Hollywood's tombstone: "We don't tell stories anymore."" This is good, and sad.
-
"If you’re like us, your knowledge is spread across several places: Gmail, Google Docs, Basecamp, and more. Redwood makes it easy to search across these sources, right from your desktop." Clever.
-
"MOBY is a spout cover that brightens up the bath while keeping baby’s head safe from bumps." As swissmiss pointed out: adorable.
-
"One of board gaming's most prolific and revered designers, Reiner Knizia, is actively searching for iPhone devs to help bring his games to the iPhone, says industry site boardgamenews." Oooooooooh. That is all.
-
Rails plugin for intelligently searching within your application. Not a bad idea; will probably end up using this at some point.
-
"I would love to see more games that use Flower as a model, not in the copycat sense of being "flying games" or "games where you're the wind," but in the high-level approach that the production implies. Smaller, shorter, higher-fidelity, more focused, more sensate experiences that are affordable, accessible, and digestible. The primary obstacle to one designing a game with these principles in mind seem to be finding an engaging core sensation that fits the constraints. I can't wait to see the results that this challenge brings." Some sensible, and lucid, thoughts on Flower from Steve.
-
Jones has now seen "The President's Analyst" which is, by anyone's standards, a remarkable movie. Especially the bit in the cornfield. And the ending. Anyhow, he's screengrabbed loads of it on Flickr because it's just beautiful.
-
"…the Wii’s software stack is designed with little to no future proofing. There are basically zero provisions for any future updates; even obvious things like new storage devices or game patches. What’s worse is that this will affect the compatibility mode of any future Wii successor." Interesting analysis of what's going on inside a Wii, even if the architecture is a little limited.
-
"I smile. I didn't fool him in the slightest. But it doesn't matter. I didn't fall. Wax on the arm." Lovely.
-
"It's just 4 names, on a t-shirt. Buy it now because you know whats coming and by then, it'll be too late. Good luck." Want, so bad. And the kerning's not a million miles out.
-
"MagiCal is a FREE menu-based clock and calendar. It features a huge range of configuration options for how the time and date are displayed, and can operate either in conjunction with, or as a replacement for the built in system menu clock." Quite pretty, and makes a nice companion for FuzzyClock.
-
"The microprinter is an experiment in physical activity streams and notification, using a repurposed receipt printer connected to the web. I use it for things like reminders, notifications, and my day at-a-glance, but anything that can be injected from the web and suits text only, short format messaging, will work." Tom writes up his printer in more detail.
-
"We’ve recently switched a number of projects to ThinkingSphinx here at Hashrocket. These projects were originally using SOLR or UltraSphinx. Today, we’ll explore the differences between UltraSphinx and ThinkingSphinx and why we chose to switch." Detailed explanation of the advantages of ThinkingSphinx over UltraSphinx or other alternatives.
-
"Last night I laser-etched the top of my Eee PC with the complete level maps of Super Mario Land ( on the Game Boy)." Just beautiful. (Thanks, Offworld!)
-
"Compared to a standard web (un)conference where everyone knows their space, expertise and opinions, here lots (most?) of us were exploring stuff outside of our day job and business-as-usual. It was passionate and interesting and I felt completely out of my depth, which was was great. So in 2009, less of the comfort zone stuff please, and more like this." I can get behind that.
-
"Morph was sometimes supposed to copy Hart's own artistic work, but not perfectly. In this way nervous children were reassured that even their endearing hero Morph could get it wrong, which made them determined to pick up their pens and pencils and other objects and do better… He believed that most of the things he did could be done only [on television]: "I hope that by example, and by humour, children will start to make pictures for themselves. Show them, don't tell them!"" I was terrible at art, and most forms of drawing, but I could watch his hands work all day.
-
The New Frontiersman is on Flickr. The paperverse is collapsing. (Although: "taken on August 10, 2008" breaks the illusion a little).
-
Leslie roughly captures a few thoughts I've had and some reasonably opinions. In a nutshell: the social value of tagging is broad, fuzzy, and a second-order effect. As a loose, freeform taxonomy for personal use, they're superb, and delicious captures that excellently. I tag for me; if it's useful for you, that's a nice side effect.
-
"You know the [dark days] when all the MBAs left, and the people who loved the Web went on building it — building meaningful, crazy, artistic cool stuff, and the ethos of the social web war born, back before that meant more then widget crazy/Facebook-tulip-bloom-madness. Yeah, that sure sucked."
-
"…doing strategy happily is probably more important than doing it quickly or slowly."
-
Ooh – a decent search tool for cc'd Flickr images.
-
"This would be something different though potentially – not buying into a product design as a brand, but more like micro-investing in a product at it’s conception. Almost like a distributed commission of something that you’ve followed the progress of like a work of art."
-
"Director of Community Heather Champ doesn't just guard the pool and blow the occasional whistle; it's a far more delicate, and revealing, dance that keeps the user population here happy, healthy and growing." A nice SFGate piece that at least acknowledges the complexities of community management.
-
An interesting series of concept images of what context-aware, mobile search and data-diving tools might look like. Some neat thinking around transparency and context.
-
"I wanted to take portraits of people that would reveal a hidden part of their character. So I had them play videogames."
-
"Why did Weight Watchers work so well? For a really fascinating reason: because it isn't a normal diet. It's something more. Something fun. It's an RPG." Of course. Fantastic deconstruction from Clive Thompson.
-
Braid papercraft. Delightful.
-
Eesh. Tetris in 500 bytes of Javscript and HTML. Yes, they're obfuscated and unpleasant, but wow, etcetera.
More on multi-model search with acts_as_ferret
24 September 2006
So, Matt pointed out that when you do things like that, the scores for different Models are all ranked seperately because they’re coming out of different indexes. The trick, obviously, is to use the multi_search
method, which generates a multi-model-index, and that’s probably a better approach. This approach is very well documented in the RDoc. So all it shows is: probably should have RTFM. The thing below isn’t by any means bad, it’s just a little like re-inventing the wheel.
Never mind, eh?
Cross-model searching in Rails with Ferret
22 September 2006
If you’re building a Rails applciation with search, chances are you’ve run across acts_as_ferret. And if you haven’t, check it out – it allows any model to be searchable by Ferret, the Ruby port of Lucene. Ferret’s a pretty nifty search engine – reasonably fast, pretty accurate – and it’s nice to be able to use it so simply in your Rails app.
Of course, what makes acts_as_ferret
really handy is that it’s neatly designed to perform multi-model searches. Or, rather, the interface to do so is there, you just have to glue the results together. After some rough stumbling about, here’s what I came up with.
Firstly: don’t use find_by_contents
, that’s not much use. find_by_contents
is a wrapper around find_id_by_contents
. find_id_by_contents
is useful because it returns you only three things: a relative score, a model name, and a model id. That means you can merge everything into a big list, and then perform individual queries on the relevant models.
So how did I implement this?
My first stab was this (borrowing some real code from what I’m working on):
articles = Article.find_id_by_contents(query) authors = Author.find_id_by_contents(query) matches = (articles + authors).sort_by {|match| match[:score] }
This gives you an array of model/score/id hashes, which you can then do lookups on. The problem is it’s not very DRY, and it requires editing every time you make a new model that’s Ferretable. This is my more final solution, which I came up with. This time, I’ll walk you through each step.
First, somewhere like environment.rb
, define a constant array:
FERRETABLE_MODELS = %w[Article Author]
That means we can update things at a later date easily. Then, in your search controller action, start with this:
klasses = FERRETABLE_MODELS.collect {|klass| Kernelt.const_get klass}
That should give you an array containing the Article and Author objects – or whatever ActiveRecord objects you’ve chosen in your constant array. Next, let’s get the array that we arrived at last time:
matches = klasses.inject([]) {|out, klass| out << klass.find_id_by_contents(query)}.flatten
Bit more complex, but also more succinct. All this does is iterate over each klass
, using an inject method with an empty array passed in, and tells each class to call find_id_by_contents
, passing in the query. It then flattens that lot, so that the array is only one-deep. We're now where we were before.
Finally: let's generate an array of the actual objects we referred to, sorted by ranking. I'm going to generate an array of hashes. Each hash has two keys: :object
, the actual data object we want; and :score
, the rank that ferret assigned it. We get that out like so:
results = matches.collect {|match| :score => match[:score], :object => (Kernel.const_get(match[:model]).find(match[:id])) }.sort_by {|o| o[:score]}.reverse
Again, possibly a bit ugly. :score
remains the same; we run find on the appropriate ActiveRecord model, passing in the appropriate id to obtain the :object
. Finally, we sort the array by :score and flip it, so that results[0]
is the most popular search record. Obviously, you can pass extra parameters into that "find" method.
All that remains is to display that lot in your view, perhaps paginate it, and build a conditional to determine how to display each kind of object.
And that's it. I made a few changes to my dummy code when typing this up, so if something's broken, tell me and I'll fix it. I think that's a more maintainable way of searching across a range of models with ferret, and it takes advantage of some useful Ruby dynamics - finding objects through Kernel.const_get
, in particular. That's my Ruby fun for today, then.
Update
My colleague Ben proposes this much tidier (but untested) solution:
results = [] FERRETABLE_MODELS.each do |klass| k = Kernel.const_get klass k.find_id_by_contents(query).each do |m| results.push { :score => m[:score], :object => k.find(match[:id]) } end end results = results.sort{ |a,b| b[:score] <=> a[:score] }
I like the nested loop much more - should have thought of that myself - and will admit to being lazy wrt the sort_by
and .reverse
trick.