Every now and then, it actually strikes me as odd how my much life has become one defined primarily by multitudes of overlapping rectangles containing an nearly infinite but ephemeral stream of tiny meandering thoughts sent seemingly from a universe away by my little square friends often to no one in particular and apropos of nothing.
And then I get back work...
Just me, my furry office mate and my tiny little square friends. What an ultramodern, fantastical and lonely little world we've made for ourselves.
One of the things you'll see in the changelog for the next stable release of Catalyst, is a reworked component resolution system. By "component resolution" i mean, fetching components from view()/views(), model()/models(), controller()/controllers() and component().
Back in May I posted a message to the Catalyst-dev list describing some issues with the way it was currently working. Although I painted a slightly convoluted picture of doom and gloom -- it turns out that all is not lost; you were probably relying on an "undefined" behavior to begin with (kind of like assuming "keys %hash" will return things in a particular order).
For example, consider "MyApp" with two views: "Foo" and "Bar." Now, when you call "$c->view()" (i.e. with no arguments) what gets returned? Well, it depends. :) If you have none of the appropriate config (default_view) or stash variables (current_view, current_view_instance) set, then it's pretty much random.
If you write a test for the above, and see that "MyApp::View::Bar" is returned -- don't count on that test working in 5.7100 (the message I posted to the list has the technical details as to why). Though the test *may* continue to work, the above scenario will throw a pretty large warning:
Calling $c->view() will return a random view unless you specify one of:
* $c->config->{default_view} # the name of the default view to use
* $c->stash->{current_view} # the name of the view to use for this request
* $c->stash->{current_view_instance} # the instance of the view to use for this request
NB: in version 5.80, the "random" behavior will not work at all.
(FYI, if your application only has one view, calling "$c->view()" is considered "acceptable" and will spare you the warnings.)
A similar warning is thrown for $c->model(). $c->controller() with no arguments will continue to return the controller for the dispatched action. $c->component (sans args) will also stay the same, returning a sorted list of all component names.
Another issue I discovered while re-working the code was a failed reliance on the "regex" fallback.
Consider another "MyApp" with two views "Foo::Bar" and "Foo::Baz". What does "$c->view('Foo')" return? We've maintained backwards compatibility on this one -- it will return all matching views (order unknown). It is important to note that this returns an array, so list context is important. We've added a warning for this scenario as well:
Relying on the regexp fallback behavior for component resolution is unreliable and unsafe.
If you really want to search, pass in a regexp as the argument.
As noted above, if you truly were just searching for views, pass it a regex ("$c->view(qr{Foo})") and it will act as expected.
So, if you think you might be affected by these particular issues, test out the dev release! Don't say I didn't warn you. :)
More of my heroes on the Colbert Report; Richard Dawkins was on a while back.
(Crossposted to the Catalyst-dev list)
We're putting out one final development release before we go full bore
with 5.7100.
NB: It is IMPERATIVE that you TEST this release against YOUR code. Quoth
mst: "If you do not test now any bugs we ship with are your fault!" --
so, there you have it :)
Also, we've reworked the authors list to be much like DBIx::Class; in
one spot (Catalyst.pm) with each person's IRC nick, name, and email. In
you can fill in any of the blanks, fire off an email or catch us in
#catalyst-dev and well gladly fix it up.
Whilst the release is making its way to CPAN, you can grab it from here:
http://dev.thefeed.no/stuff/Catalyst-Runtime-5.7099_02.tar.gz
The Changes since the last stable release include:
5.7099_02 2008-07-16 19:10:00
- Added PathPrefix attribute
- Removed Catalyst::Build; we've long since moved to
Module::Install
- Updated Catalyst::Test docs to mention the use of HTTP::Request
objects (Rafael Kitover)
5.7099_01 2008-06-25 22:36:00
- Refactored component resolution (component(), models(),
model(), et al). We now
throw warnings for two reasons:
1) model() or view() was called with no arguments, and two
results are returned
-- set default_(model|view), current_(model|view) or
current_(model|view)_instance
instead
2) you call a component resolution method with a string, and
it resorts to a regexp
fallback wherein a result is returned -- if you really
want to search, call the
method with a regex as the argument
- remove 0-length query string components so warnings aren't
thrown (RT #36428)
- Update HTTP::Body dep so that the uploadtmp config value will
work (RT #22540)
- Fix for LocalRegex when used in the Root controller
- Get some of the optional_* tests working from dirs with
spaces (RT #26455)
- Fix Catalyst::Utils::home() when application .pm is in the
current dir (RT #34437)
- Added the ability to remove parameters in req->uri_with() by
passing in
an undef value (RT #34782)
- Added $c->go, to do an internal redispatch to another action,
while retaining the
contents of the stash
I just realized that what I'd really like in Firefox is sticky tabs (always visible tabs in the tab-bar), is that already possible with the help of an add-on?
update: ok, my friend google returns:
https://addons.mozilla.org/en-US/firefox/addon/2558
I'm not sure the tab is always visible, but I can't verify since it doesn't work yet with FF3
Taichi inspired me to post this and it's actually a QoTD on Vox Japan: today is Famicom (NES) 25th birthday since it was on sale 1983/07/15 in Japan. Let's talk about the memories!
I didn't have Famicom until 1986 when Twin Famicon along with the Disk System was out, which is a smart device that has both NES and the Disk System built in a single device.
At that time I didn't know the reason but now I can see that a bit clearer: our home didn't have an analog TV at that time and had a video deck and a monitor TV that doesn't have the antenna built-in. So the standard Famicom which requires the standard TV antenna input to display the game console output on channel 2 (I guess that's the origin of the anonymous bulletin board site 2ch. Is that correct?) didn't work for us. Twin Famicom has a standard video output so just connectin the Red-White-Yellow cable to the TV works. Oh yeah, the video deck was obviously SONY beta. Such a nerd is my dad :)
So I don't remember the exact date when I got the first famicom, but when I watch the video series of "Complete guide of NES games" on Nico Nico Douga, I can tell when I got the device based on the game I bought: it's early 1986, but wait, Twin Famicom was release July of 1986. Hmm, so maybe I got the console right when it was out and bought the titles backdated early 1986. Maybe.
The first game I played, I think, was Sky Destroyer. I don't know why but my Dad bought this when he purchased the Twin Famicom for me, probably that's one of the latest title at that time. But it's apparently not... Now I really doubt if Twin Famicom really is the first console for me since I remember I played lots of mid 1985 games real time, like Super Mario 1 and Gegege no Kitaro. Hmm :)
That said, I really am looking forward to the Retro Game Master (originally called Game Center CX) DVD is out in North America. I love the show.
One of the biggest differences I noticed between living in the U.S. and living abroad is the number of stupid laws made here and signs to inform you of all of them and those other things the control freaks want you to know.
Go to any park or into an underground MUNI station to see what I mean. No smoking, no pets, no offleash pets, no loitering, no camping, no panhandling, no vending, no solicitig, stay to the right, yield seats for handicapped and elderly, stay behind yellow line, no unauthorized personally, don't touch the third fucking rail.
O RLY?
Since returning from Europe -- where there are relatively few of these things -- I've been tormented by the condescension. But there was something else; some other reason it bothered me. Upon reading this (via ydnar), it hit me:
The Drachten Experiment
Think of Drachten, where they removed all of the traffic lights and stop signs, based on the work of the late Hans Monderman. "The many rules strip us of the most important thing: the ability to be considerate. We're losing our capacity for socially responsible behavior," says Monderman. "The greater the number of prescriptions, the more people's sense of personal responsibility dwindles."
That's it. Making sure that Everything You Need to Know is written on the walls and signs around you creates an environment where an individual is essentially absolved of the full breadth of things that make us good neighbors and educated well-mannered citizens. When communities try to hold their people and way of life together with tactics akin to passive-aggressive sticky notes on the refrigerator, we all become lesser co-habitators.
I don't need a sign to tell me to give my seat on the bus to those who need it. I don't need a sign to tell me to pick up my dog's shit. I don't need a sign to tell me not to jump down onto the track of the BART train and touch the third-goddamned rail. These things should be completely and utterly obvious and ingrained in everyone. And if the failing of our society seems imminent without these prescriptions, then perhaps a few third rail surprises might actually help us all.