Monday, May 18

Film: Angels & Demons Click for more info

It seems that the only way I can enjoy a film adapted from something of Dan Brown's is to ignore the book in the first place. Unlike I did with The Da Vinci Code, I thought Angels & Demons was pretty darned good.

The main asset in such a film is the mystery of it all, or rather how it unravels as the film progresses. A&D was well paced; in fact I'd say that its pace was its best quality - it gave you just enough to make your own guesses but equally enough to make you doubt them again. Genius!

Everything else was standard fare: Tom et al played their respective roles well, Rome looked good and the whole thing was well produced. Well, except for the bits where they had to compensate for The Vatican's lack of cooperation; the CGI in these scenes were a bit shoddy but I guess they had to be done that way.

Overall it was a well balanced and enjoyable enough film to catch. Recommended.

Sunday, May 17

Film: Coraline Click for more info

Grim fairytale about a young girl who just doesn't realise how lucky she is (cough). And as usual it takes a monster of sorts to get her to figure this out; in execution though Coraline just about does enough to be something fresh rather than predictable.

There's no doubt that Coraline has been well put together, with love and attention pouring out of the film at its seams. The 3D is superfluous and in many ways a distraction to the art style of the film, but apart from that Coraline gets full marks for production. Interestingly the voice-acting is noticeably passable rather than excellent, something which also seemed to detract.

The biggest issue I had was with the inaccessibility of the film. As well as being disturbing (in more ways than one), it seemed to be pretty hard work appreciating what it was trying to do - a thinking man's cartoon then? It also took a bit of time getting started, and I found myself losing patience as it laboured on its opening point.

But overall Coraline was a good enough experience to sit through, and worth a watch if you know you have the patience for such things.

Saturday, May 16

Food: Don Pietro Click for more info

Don Pietro shows that you don't always have to drive for an hour to get a respectable eating experience; for instance take this local Italian sat right in the middle of the exotic location some of us like to call Gant's Hill. It serves up decent enough nosh at a fair whack (I got the garlic bread and what appeared to be the best veggie option on the menu in a gnocchi all for under a tenner), it's clean and cosy and service is brilliant. Yes, you have to make do with the inevitable Essex crowd you'll find in there, but that all just adds to the charm (and gives you licence to be as loud as you want, too).

It beats any local balti house hands down in my opinion. Recommended; well if you're in the area anyway.

Friday, May 15

New Music

Second Chance - Shinedown

Yes, more ballady soft rock. So sue me.

XKCD Click for more info

Is it lucky or unlucky to have mulitple opportunities?



Perhaps, but I'm not sure how this applies to those who'd rather remain single anyway - I guess some might be less fussy about an individual if they could have two of them. Maybe that's why four wives is a good idea? That last bit was a joke, ladies - four probably wouldn't be enough anyway.

Wednesday, May 13

Abstruse Goose Click for more info

It's all in your head girls:

Sunday, May 10

Shak's Choice: Zoe Saldana

For those of you who have seen the film Zoe plays a delightful Uhura in this weekend's Star Trek:



I'm sure a big part of her qualifications is due to the big ol' geek in me, but hey, we like who we like for a variety of reasons. And yes, it took me ages to find one of her in Starfleet garb. Boots and miniskirts? Ah, you just gotta love the fashion from sixties' sci-fi.

Film: Star Trek Click for more info

Okay. First things first: Star Trek is NOT a reboot. Those of you who think it is are either wrong, have no clue about ST or simply don't know what the word means. If you fall into the latter, a reboot would consist of stuff like making Kirk a bird or the Enterprise bright blue and shaped like a rocket. You know, as if you're reinventing something. No, this ST was perfectly consistent with the ST universe as already told, even though it's znantrq gb erjevgr gur cbfg Xvex ren; ohg url, gung'f gvzr geniry sbe ln. Anyway, lecture over - back to the review.

I thought Star Trek was fab. It managed to pack Starfleet action, Federation heroics and everything else that made Star Trek generally awesome. It was funny (Kirk the Perv was brilliant), poignant (kinda) and relevant to ST lore. I must say JJ did an absolutely brilliant job keeping true to the series.

There's little to complain about here. The acting was brilliant, with everyone contributing to the ST look and feel - quite astonishingly I sometimes forgot what the old cast looked like as the new ones made them their own (Hmmm, Uhura.). I got a bit annoyed at the action sequences as the usually classic and beautifully orchestrated space battles seemed to have become infected with those annoying BSG style camera pans and zooms.

But that's a minor complaint really. The film was fantastic, and I say that not only as a Trekkie; it also appealed to the single non-Trekkie who was forced to watch with us. I must admit that I'm a bit sad about what the story implies about the later generations of Star Trek (in short, they don't really exist anymore), but I'm sure I'll forget all that once the inevitable sequels arrive. In the meantime I'll just soak up all the pure and unadulterated Star Trek goodness this film provides. Recommended!

Co-dependence

I'll open with a story: once upon a time, there was man and woman and they were happy. The guy would go out to work and earn the bread, lift heavy stuff and use powertools. The woman would cook the bread, keep the home and raise the children. There weren't many complaints with this situation, or perhaps more correctly none were aired - the guy was bored and unfulfilled at work, while the woman felt she was always under-appreciated. However they each stuck to their responsibilities, ironically, because of each other. Even more bizarrely they were happy with their lot and wouldn't have it any other way.

Then something went wrong. What that something was is beyond the remit of this bit of writing, but it could have been sucky men leaving their wives with no way of fending for themselves, or it could have been the women feeling that they were better than just mere housework. Whichever it was, the balance had become irreparably upset and women (more than men) decided to take action.

This happened on both practical and emotional levels. Practically, a woman would now be called stupid for not making sure she had a professional backup plan, while men were told they need to learn to do housework partly as a useful skill (it is), but mainly to enable the general redistribution of roles that was occurring.

On the emotional side, men now had their boys and the women their girls: groups of people who were the most important to them - sometimes more so than family. These are the people you went to with your relationship problems (you know, instead of each other) and the people you went out with (you know, instead of each other).

And now we find ourselves in the position where we don't technically need partners any more. We have our own money, we can keep our own homes, we have our own friends to lean on. Faced with this there's no purpose or even room for a partner. I mean hey: what would be the point?

I'd be the first to admit that I depend on my family a lot, and in the ways you might typically think I do. Where some people have seen that as a weakness, I see it as a blessing. The fact is that I could move out and learn to cook and keep a home (I like to think I know how to do the 9-5 already); but possibly counter-intuitively I just don't think it would be very facilitating to my general well-being. I want to rely on someone else for some things, just like I would want my nearest and dearest to rely on me for the things I can best provide. Just like my friends who had moved out of uni could never return home, it's this familial co-dependence that keeps our home together. It's also worth noting that being needed provides some self-worth to an individual too.

Traditional roles aren't the only way to distribute roles though; I mean sure, perhaps it makes me a classic chauvinist how I personally feel men and women are better at certain things, but that doesn't mean roles can't be switched if that's what's been agreed upon (just remember though: working can suck as much as housework). It's the co-dependence that's important here, not the actual things that make that co-dependence possible and this should be discussed and negotiated rather than assumed.

But it isn't just practically that people are becoming more independent: it's happening emotionally too. Married people now keep group of friends where the spouse isn't relevant or even welcome; some even wish to travel without their partners after marriage. The idea that only friends can provide a level of well-being and social process that a spouse can't disturbs me quite a bit - in my idealistic world you not only would one not need much more than a partner who is also a best friend, but should also contribute to your existing group-dynamics too.

The usual response to my stance above is for people to claim that space and independence are important and even vital components for a healthy relationship. I'd say that bailing, however temporary, isn't a solution but merely wallpaper over the fact that you can't bear the company of someone for an extended period of time. I recognise that practically you can't do everything together - but I think it's important to at least aspire to that. And besides, space can be overrated: parents can't choose to have space or time-outs from their children for instance. I would also disagree with the assertion that co-dependence is somehow a weakness, or barrier to development. I didn't need space from my family to grow; in fact it helped with that in a very specific and unique way.

Co-dependence means exactly that; the support should go both ways and not just be the woman depending on the man, or man on the woman. It has to be almost symbiotic, since this is where the co-appreciation stems from. This requires a consciousness regarding your roles and responsibilities in a relationship whether you enjoy them or not (leaving aside the pleasure one gets from providing for a loved one).

And despite the coining of the term Superwoman Complex I don't think any specific gender is the most to blame. In fact quite ironically most of my female mates agree with the article in that they are actually looking for co-dependent relationships. For some reason however this wish doesn't manifest in the actual searching process, possibly due to it being seen as a possible sign of weakness, or perhaps it's the concrete and possibly rigid definitions that frighten some people.

I would say that looking around, the relationships which I see lasting the longest are the ones in which the participants are the most co-dependant. Put simply, needing each other is an incentive to work hard to keep one another - one reason why divorce is such an accessible option now is because it literally is. I'm not implying that people should endeavour to stay in bad relationships, but if you don't need to stay in one then that could be an easier option than trying to fix or bear with it.

And finally just to qualify my bias I should say that I personally find co-dependant relationships far more attractive than independent ones. I've been raised with the idea that I will one day provide for a family - this idea is what got me through study and my early years of working rather than any kind of professional or personal ambition to succeed.

I think that that's an aside to my suggestion that they're the strongest though. In essence it unfortunately just seems that we're now looking for someone we'll be able to live with, rather than someone we couldn't live without. I know which position I'd rather be in.

Originally drafted 2nd February 2009

Friday, May 8

Filmharmonic 2009 Click for more info

A last minute dash for tickets got us some pretty good seats at tonight's performance at the Royal Albert Hall. I hadn't been there since graduation and that poignancy alone had me excited. I didn't need that extra impetus though since the music, a selection of film and TV theme tunes from the past thirty years, was utterly brilliant.

All were instantly recognisable. We had Mission Impossible, Ghostbusters (yay!), Star Wars, Superman, Jurassic Park and even Dynasty and Dallas to name a few, and I was humming and tapping my feet to all of them.

I was a bit confused at how different some of the pieces sounded though - some bits were very different - but then I realised that this was probably the point; classic music reinterpreted by the RPO.

The two hours pretty much flew by,and I had a grin on my face throughout as I was taken back to when I first heard them all. Great stuff.

Rebel Muzik Click for more info

After missing it loads I managed to catch May's Rebel Muzik - it seems to becoming more and more popular each time I visit and I hope the intimacy isn't spoiled by that. Tonight's session was brilliant as usual if a bit late-running due to breaking for Maghirb. The open mic, although brave, wasn't as good as it usually is but the rest of the show more than made up for that.

Support was in the form of Reveal, Masikah and DPZ the latter of whom I thought was awesome - it was just a shame he came on so late (not that he looked like he wanted to stop any time soon).

Headlining was Lowkey who was launching his Tears to Laughter single - it's currently on iTunes where all of the profits made from a sale there will go to the DEC appeal. He quite plainly ripped it up tonight and even though I've seen him plenty of times before I'd say today was on another level.

The only complaint I had for today was the late running - as well as starting late it was packed to the brim and we ended up leaving at ten to midnight. The thin crowd at the end was a bit upsetting but DPZ managed to power through anyway.

Monday, May 4

Film: X-Men Origins: Wolverine Click for more info

In my opinion going back to where it started was a genius move by the people behind X-Men. The regular series wasn't going anywhere (and became a target for those looking for authenticity) and had lost its ability to be fresh.

Wolverine is essentially more of the same live action comic book stuff, but don't let the title fool you too much; although it is mainly about Wolverine it does go out of its way to explain a lot of the history behind the X-Men (well that in the universe of film anyway) in general.

So yes; we have other superheroes, we have fights and boss fights, and we have tragedy. The ending is as expected, largely since you should have seen it already anyway, the acting is alright, while the rest of the production does well. Of course it comes with plot holes galore (and I'm sure comic book fans would have noted more than I did) so leave your reason at home.

No surprises here, but a solid and enjoyable romp nevertheless. Recommended.

Sunday, May 3

Game: Left 4 Dead (PC) Click for more info

Sometimes you play a game and wonder why it hadn't been done before. L4D is survival horror, FPS stylee: so tons of easy to kill zombies (of the fast running variety - 28 Days Later has a lot to answer for). The real hook, however, is that you're not alone - there are four main characters in all opening up some of the best co-op play I've had the pleasure of, uh, playing.

The rest of the game is kept simple - there are no gimmicks here, no plot. There is a grand total of 5 or 6 weapons to pick from (a good thing in my opinion) of which you can only hold one - and when that runs out of ammo you have a pair of infinite handguns to play with instead. There are no boss fights per se, just hairy "climax scenarios" where you literally fight frantically for survival.

The simple nature of the game allows you to dictate the pace of it. You can go fast or slow, you can play with or against your team (and I'm not ashamed to say that I ran for the safety of the helicopter without a thought for my team mates) or you can just hang around, blasting away at continually re-spawning undead till the cows come home. Bliss.

It was enough to prompt me to buy a new graphics card for my pc (a 4770 if anyone is interested) and as it's currently 16 quid via Steam there really isn't much excuse. Absolutely brilliant.

Food: Citrus Click for more info

Posh and a bit pretentious at it, Citrus serves up overpriced yet oh-so-small portions of admittedly yummy food. I went for a spaghetti pasta dish and a Sea Bass main, both of which were pretty well made - unfortunately we had to pace ourselves a bit since eating at a normal rate seemed to make it all disappear a bit too quickly.

The place was nicely done; the decor had invoked a few comments from us, although the layout may have been a bit too intimate for a group of 10 rowdy East Londoners. Still, the service was top notch if a bit slow.

Price was an issue here - even after sticking to two courses and a drink the bill came to 15 quid a head: even after the Top Table 50% discount we all felt a bit short changed, something made even more apparent as we hit a chicken shop on the way back home.

Literally not worth it, unfortunately.

Wednesday, April 29

Game: No More Heroes (Wii) Click for more info

Hilarious third person slash-em-up where you play a wannabe assassin trying to climb the ladder in his chosen field. I'd call it GTA for dummies, except it pushes the boundaries quite a bit (albeit in a variety of amusing ways) so isn't really for kids. In fact I'd say its style and humour are pretty sophisticated (although perhaps not as much when you're recharging your blade), and the reason this game is worth a play in the first place.

Gameplay is simple and straightforward although a bit unresponsive at times. This isn't a problem in the main, but can make things a bit frustrating when you're up against a boss. Sound and graphics are passable but nothing amazing (even for the Wii).

Another bonus for me is the brevity of the game; I don't see the game lasting more than 10 hours which is the perfect length for someone who just doesn't get the time to play any more. That and the episodic flavour of the game make it great for picking up and playing.

Monday, April 27

Snippet

xxxx says (22:48):
my mom just showed me this new rishta's picture
Shak says (22:48):
hot?
xxxx says (22:48):
he's holding a really cute baby in the picture
way to manipulate girls eh
Shak says (22:48):
yeh
i did that with my nephews
didnt work
xxxx says (22:49):
and the second guy...got himself photographed infront of a mercedes
which looks rental
Shak says (22:49):
yeh
i did that
didnt work
xxxx says (22:49):
because he is wearing the same shirt in all three pictures
really
you rented a mercedes
Shak says (22:49):
no
xxxx says (22:49):
with leather red interior
Shak says (22:49):
it was a vauxhall zafira iirc
...
didnt work

[...]

Shak says (22:51):
http://www.radioshak.co.uk/2009/04/snippet.html

[...]

xxxx says (22:52):
lol..you responded the same way
as you did here...
OH
nevermind
i feel stupid

[...]

Shak says (22:54):
lol
that's funny
i gotta add that
xxxx says (22:54):
no don't....let's not publicize my blondness

Sunday, April 26

Film: Observe and Report Click for more info

Oh Seth. Why couldn't you have stuck to the plan? Yes, you play the loser brilliantly... But in this film you kinda fall short. It could have been because of the attempt at depth, perhaps it was just the setting of a mall that did it. But really I think it was just the dire and joke-thin script that failed you on this occasion.

There were some funny bits, like the classic exchange between Seth Rogen's and Aziz Ansari's respective characters. It soon becomes clear that the funniest parts of this film were the bits that had nothing to do with securing a shopping mall, and as such there weren't really that many of them.

Quite disappointing really.

Saturday, April 25

Spittin' Light, Healing the Hood Click for more info

To save me time I'm just going to link to this. There wasn't much difference in the line up in this year's Radical Middle Way tour, and unfortunately even some of the material was reheard. Still, the crowd was different enough (in both size and stature) to make the event as a whole different and since you can't get too much of a good thing overall I'm glad I went.

Thursday, April 16

Film: Let the Right One In Click for more info

It's official: Buffy has spoiled all vampire movies for me. Whatever twist or "fresh" approach a film of this genre takes will have already been seen in that seminal show, and alas that fact remains true with this one.

Okay, not quite. But this story of young love between people from vastly different worlds has been done before (and I'm guessing hordes of teenage girls will swear by Twilight) and what makes it worse in this case is that LTROI only has this particular gimmick to rely on. Take that away and there's not much left.

Still as a film it's well put together. The story is subtle yet deliberate, with a lot of things implied instead of being spelled out. This gives it a kind of engaging quality; multiple dimensions and questions for you to explore and debate. In that sense it's quite clever, but unfortunately cleverness alone doesn't make a film enjoyable.

A curiosity at best, I guess I was just expecting a bit more straightforward meat to relate to here. You should definitely check this out - just perhaps not in the cinema.

Wednesday, April 15

England People Very Nice Click for more info

Immigration is always a tough topic to tackle in a play. EPVN approaches it using humour, quite the risk considering how easily it could have been misunderstood by the audience. However since it actually tells the story of four different waves of immigration into London (French Protestants, The Irish, Russian Jews and Sylheti Lascars) it manages to get away with it.

The downside of all this action is that it took way too long to cover it all. The play weighed in at a massive three hours with a 15 minute interval (quite possibly the longest play I've ever seen). The final group got most of the face time, their story spanning almost a century (from the World Wars to the London bombings); I reckon the Bangladeshis alone could have had their own play.

As well as being funny EPVN was pretty relevant too. It took the same "play within a play" route that others seem to be taking; this was a production put on by modern immigrants, each waiting for the decision on whether they get their leave to stay or not. Mentions of things like Facebook and sufism vs wahabism give the play a thoughtful and contemporary feel and so it feels well placed to make the comment that it does.

The Olivier Theatre is really impressive, if not in the legroom area - a much bigger concern than usual because of the sheer length of the play. On stage we were treated to various costumes rather than complicated sets, although the generous use of projected animation was well-done and added some charm to the production.

Overall though the play was way too long. It managed to stuff a lot in there, but this was at the cost of my attention span; as mentioned above EPVN could easily have been split into two. But not really, since the first three stories of immigration provide some kind legitimacy for the final one and they wouldn't have really worked otherwise. The length is enough for EPVN to just miss out on a recommendation, but if you do go to watch just make sure you can bear the three hours.

Film: Fast and Furious Click for more info

Girls! Cars! Muscle! Except not quite enough. It was definitely better than the embarrassing second and third parts to the franchise, if only 'cos it had Vin in it, but even he didn't distract from the shallow plot, two-bit script and weak characterisation.

I must admit that I was expecting a great deal more, something along the lines of The Fast and The Furious (yes, the titles had me baffed too), and so it's really disappointment that you're reading here. As a sequel it probably does enough, it's just a shame that the people who made this didn't learn anything from the middle two; even more so when we were led to believe it the return of the original cast would fix everything.

Worth a watch since it is fun enough. Just about.

Video of the Day Click for more info

Oh snap, epic Pwnage!



Nicked from Mash, here.

Monday, April 13

Hever Castle Click for more info

Day trips are fun. There's just something about loading up cars with people and food and heading off after breakfast that sets up the day to provide a magical time. Even the little things like parking together and buying group tickets adds to an occasion where even the threat of bad weather doesn't spoil things. In my earliest memories these group trips were largely made up of family - cousins and aunts and uncles. Now it seems that it's all friends. Not bad, but different.

Today we checked out Haver Castle in Kent. If you haven't heard of it, don't worry; most of us hadn't either. It just happened to be close and cheap enough to draw a large enough crowd (thirteen of us) to make it work. We were there in 45 minutes and it cost us 7 quid to get in.

The day was spent dossing, boating, eating, dossing and dossing. The boating was a massive laugh actually with none of us having anything even resembling sea legs. After a while things fell into place and we ended up playing a game of tag with the two boats we had under our command. I may be biased but I reckon our larger boat (of 8 people) totally out-rowed the other for most of the hour.

We also checked out the gardens and maze; a typically boys vs girls affair with a dare for the losing team. As the majority of the group went off to play rounders (or some other activity requiring an excess of energy) the remainder of us just sat and chilled, imagining that the sun was shining behind the overcast clouds. Still, at least it didn't rain for the whole day.

We got chucked out at 6, us being the only ones still bringing in food from the cars towards closing time. We had already made the most of the day, but we unwinded at the home of one of the group; the perfect end to such a chilled out, fun and easy day.

Saturday, April 11

Film: 17 Again Click for more info

I like to think of myself as a secure enough chap. Still having said that it does take quite a bit to admit that I went to see this film - don't get me wrong, I have nothing against Zac Efron per se; I thought HSM was great (a fact those of you who've listened to my in-car music will attest to) despite our young hero and this even had Matthew Perry (swoon) to balance out any lingering prepubescent hormones. But still, this was one for the (teenage) ladies and that was probably enough to take it out of any running of what to watch on a Saturday afternoon. But the trailer looked fun so I thought I'd give it a try anyway.

It wasn't that bad. In fact there were plenty of laughs to be found amongst the skinny plot and hammy acting; I was slightly disappointed by the lack of any real feel good factor although I did care a bit about what was going to happen toward the end so there was definitely some kind of characterisation there.

Otherwise there's nothing particularly special about 17 Again: definitely watch it if you're a die hard Efron fan I guess, although even if you're not it won't be that painful by the end.

Thursday, April 9

Joke of the Day

What did one tampon say to the other tampon?
Nothing, they were both stuck up bitches.

Tuesday, April 7

Using Perl-like Regular Expressions in MySQL

Regular expressions are amazing. They allow you to parse bits of, search for patterns in and validate strings, all with a simple, uh, regular expression. For example the following represents any possible email address:

/\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\Z/i

It's not my expression - Google has expressions for almost anything you want to find, and you can easily figure out your own quite easily for the rest.

There is one pretty fatal flaw with regular expressions though: they're not necessarily universal or platform independent. The above pattern would be used by Perl, whereas the following represents email addresses in a POSIX regex environment, like MySQL:

^[[:alnum:][.period.][.hyphen.][.underscore.]]+@([[:alnum:][.hyphen.][.underscore.]]+[.period.])+[[:alnum:][.hyphen.]]{2,6}$

The things is, how much use are regular expressions if they can't be used across platforms? Sure, they're inherently faster (in development and execution) than hardcoding some pattern matching logic, but for me the real gain is being able to define immutable "facts" using them, and then referring to these facts from anywhere you need to. This requires a universal syntax.

Perl and POSIX are the most popular syntaxes, but there are others. Of the two, the Perl syntax seems to be regarded as the most powerful, and looking above the more concise. It's also more wildly used - many platforms (like .NET and Java) have a compatible syntax, but thanks to an excellent library called PCRE (Perl Compatible Regular Expressions), the Perl syntax has been made available to a wide variety of situations and platforms, including Ruby.

Since it made sense to store regex in the native format of MySQL, my first approach was to look for some kind of conversion library to convert from POSIX to Perl syntax. I found nothing. Nada. Zip. Zilch. Personally I found that pretty strange.

Going the other way was better - almost accidentally I discovered that some bright spark had created lib_mysqludf_preg, a bunch of User Defined Functions which accept Perl regex (once again using the PCRE library). Once installed, these would work in exactly the same way MySQL functions work on POSIX regex - I would then store all regex in the Perl syntax and use them in MySQL (via the new UDFs), Java, Ruby and wherever else I needed to (provided they accepted Perl regex, of course). Hooray!

Of course installing the library wasn't that simple. I was now in Linux world, and was required to, gasp, build my own copy of the library. This wasn't as difficult as I thought it would be - the hardest part was using Synaptic to get the MySQL development libraries. Compared to the rest of the installation, building was a breeze.

Each UDF is created using the following command:

CREATE FUNCTION lib_mysqludf_preg_info RETURNS STRING SONAME 'lib_mysqludf_preg.so';

where lib_mysqludf_preg.so is the name of the newly built library.

In my case, however, this returned the following error:

ERROR 1126 (HY000) at line 3: Can't open shared library 'lib_mysqludf_preg.so' (errno: 22 lib_mysqludf_preg.so: cannot open shared object file: No such file or directory)

The lib_mysqludf_preg readme warned me that I needed to place lib_mysqludf_preg.so in a location covered by LD_LIBRARY_PATH (whatever that was), and I had done this by adding the default build location of /usr/local/lib to ld.so.conf and running ldconfig to refresh the file cache for the linker. Checking the output of that last command confirmed that ld, the system linker, could indeed see the file.

pretending to be some kind of expert with these things, I used strace to figure out where MySQL was looking for lib_mysqludf_preg.so. This totally sent me down the wrong path as it complained about a permission error - as far as I could tell with my not-so-l33t Linux skills the file was readable by anyone.

After half a day of faffing around I finally found a lead on the MySQL forums: it turns out that the file had actually been built into the wrong location. I was running a 64bit MySQL on a 64bit Linux, and for that reason lib_mysqludf_preg.so had to be placed in lib64. After doing this, the CREATE FUNCTION command worked as advertised. I removed the path I added to ld.so.conf.

Any misgivings I had toward anything Linux (this wouldn't have taken a day to figure out on a certain other platform, I reckon) quickly dissipated after I adapted my database to use Perl regex instead of POSIX. I could finally use single regex "facts" across my application - something that was definitely worth the hassle getting it all to finally work.

Monday, April 6

Using The Rails MemoryStore Cache to Store ActiveRecord Objects in Development Mode

Despite the length of the title up there, wanting to use the Rails cache to store an ActiveRecord object isn't something that's too advanced or unreasonable. It makes sense to store relatively static objects in some kind of cache to save a round trip to whatever is actually storing them proper; since that store is usually a database of some kind it's likely that these static objects will be based on AR seeing as that's the default ORM doohickey in Rails.

That said, I'm not actually using proper AR models. The data for my models is coming over the wire from a magical place that has no databases, so in theory I shouldn't be using AR anyway. However a lot of non-ORM good stuff comes with AR (like validations and other convention-based magic), and seeing how some clever chap went to the trouble of writing a plugin to allow us to use "tableless" AR models I couldn't help but oblige and use it.

But I digress. This post is about what happens when we try to cache said AR object using Rails' built in cache functionality (when the cache is based on the hash-like MemoryStore). In short, the answer is a terrible disaster of immense (and typically agile-like if I'm allowed to make such a dig) proportions. Here's the technical bit: any instance methods you define on your AR models get lost when you retrieve them from the cache.

What the heck? Well, let's create a simple example. We'll start with a model representing a person - one who has a first name and a surname as fields/columns in the database. AR is magical in that it will look at the DB and create accessors for first name and surname for us. However we want something slightly more than that and so we define a method that will return a concatenation of the two. We'll call this method name, but I'll spare you the code.

Now we only have ten people in the system, and since these are guaranteed not to change in the lifetime of the application it makes sense to cache them after retrieving them from the DB. Let's ignore the fact that we could define them in the application itself (in my opinion, data belongs in the DB no matter how static it is). So let's store it in the cache:


all_persons = Person.get_all_persons
all_persons[0].name #returns a concatenated name
Rails.cache.write("all_persons", all_persons)


where get_all_persons returns a simple array of persons after getting them from the DB.

A Rails request later, and instead of calling get_all_persons we use the following:


all_persons = Rails.cache.read("all_persons")


Et voila, we once again have an array of all persons.

Except when we try the following something goes wrong and:


all_persons[0].name


results in:


NoMethodError: undefined method `name' for #Person


But... but my source code says the method is still there. What's gone wrong?

The trouble stems from how Rails loads classes. There is another (magical, naturally) option which tells Rails to watch source files and reload classes if any of them change. This is handy for development, since it means you can make a change and see it without restarting the Rails server. The way in which Rails does this magic is even cleverer - it literally reaches into the code of the class and modifies the methods which it has on offer. Amazing, no?

Well maybe. See, it's this exact mechanism which first strips an AR class of all its instance methods (something put in to deal with a memory leak) and then reload them later with the same magic used to create accessor methods. Except, for some reason, it misses out the ones defined explicitly like name, above. Yes, I was just as bemused.

But let's get our story straight; there are a few red herrings and caveats here. Firstly, this has nothing to do with Rails.cache - that just acts as a mechanism to keep objects around long enough to have their classes redefined. New objects created in the lifetime of a request use the original, and so correct, class definitions - which is why name gets called correctly the first time. No, it's Rails' class reloading (or rather, redefining) mechanism which is at fault here, or rather the way it deals with reloading AR classes.

Knowing this much presents us with a few options. The first and most obvious is to disable class reloading - indeed non of these problems occur in the predefined test and production environments where class reloading is disabled (or rather class caching is enabled). This would make development a pain though and take away one of Rails' biggest pros: it's facilitating of rapid development.

The second solution is a bit more sneaky. As we've discussed, freshly created objects in a request are loaded fine, and so if we somehow recreated the objects in the cache (perhaps via a copy) and use those, everything would be hunky dory. There is actually a more straightforward way to do this, and that's to use Marshal to serialise objects coming in and out of the cache; unmarshalling creates new objects to load up the data into. In fact since other cache stores (memcached and filestore) already do this marshalling by default (since they have to, whereas MemoryStore can just hold objects, well, natively), we don't see this issue (albeit by accident).

There are drawbacks here. Marshalling brings with it an unnecessary overhead - the marshalling isn't actually required, we just want to use its implicit "newing" behaviour. This means that when you push the code to test and productions, we're not doing things as efficiently as we could be (remember, we don't reload classes in those environments).

For now, I'll be marshalling explicitly when using a MemoryStore cache. Perhaps if I move to another cache I'll remove this redundancy, but for now I'll leave it in if it means I get to keep Rails' reloading of classes. Oh and for more info on this behaviour, see here.

Oh and before I forget, yes, I am now using Ruby on Rails to further my project. This flies in the face of a previous post but I don't mind contradicting that. I've not looked back since moving to Rails, but more on that in a later post.

Sunday, April 5

Film: Monsters vs Aliens Click for more info

You can hardly call Monsters vs Aliens run of the mill. It has everything that a classic CGI animation needs: it has monsters for one thing, and aliens for another. In that sense it's pretty much what you would expect from a film with such a title - this, however, ends up being the biggest thing wrong with MvA.

But let's start with the good stuff. The film is technically brilliant, with some good visuals, wonderful voice acting and laughs aplenty, something which we guessed must have come down to the presence of Seth Rogen (I laughed out loud at General Monger's description of Ginormica, for instance). As is fashionable with CGI nowadays we watched this in Not-Really-3D, except it wasn't actually that bad and I found myself even reflexively reacting to some bits. On paper there wasn't much wrong with this film.

But that's not enough in a genre where we expect nothing but excellence. In this case it was the story and plot which let the rest of the film down, with not enough time being spent on character or plot development. Things were happening way too fast, love for all the zany figures in the film was missing and as a result you find yourself not actually caring much about what happens. That's pretty much a failure for any animated flick.

So a bit of a let down, despite being really good otherwise? Pretty much. I'll still say that MvA is worth a watch though since even an average animation is better than most stuff out there.

Friday, April 3

The End Of An ERa

And that's it. After a whopping fifteen years on air, ER has finally finished.

Fifteen years. Let's put that into perspective: that's spanning a period of half my entire life - or over that for the most of the show's target demographic. Most successful shows don't get past their fifth or sixth year, but ER managed three times that. I would call that institutional.

Still, I must admit that I called for ER to end, although that was during a spat of boring seasons. Still, a part of me felt obligated to see through seasons ten and eleven, and by twelve I was glad my previous request was ignored. ER managed to get back to the awesomeness it had for most of its first decade, a time when it consistently made number one in the US ratings.

Quite laughably, if there was one thing which constantly reminds me of how I could have been a doctor, it was ER. Yes, all my doctor friends constantly tell me how it's not reality, but I'm sure that there's some truth in the excitement, friendship and, well, eliteness demonstrated by those in the show. It makes medicine look fun, intense and rewarding; way more than visiting Whipps Cross ever did.

As a show it was pretty special. ER wasn't about story arcs spanning multiple episodes or people having affairs or clever comedy or wordplay. There were no gimmicks, and no determinable hook other than making you want to follow the lives of some relatively real people in relatively real situations. In that sense you can see why it lasted much longer than other shows which possibly relied on a more short term attraction; it was very much about Barnett, Benton, Carter, Chen, Corday, Gallant, Gates, Greene, Hathaway, Knight, Lewis, Lockhart, Morris, Pratt, Rasgotra, Romano, Ross, Taggart, Weaver and many many others than what they did for a living.

There was the usual fan service seen during series finales in last night's episode - full opening credits (a rare treat nowadays), a return of old faces and even na bhgfvqr fubg bs Pbhagl Trareny, something we've never actually been shown before. It all made the occasion way more poignant than it should have been - the episode itself didn't offer anything more than a nod to what made the show so great. Understated yet still good, there was never going to be an easy way to end ER.

And so it's done. There is no more ER, and the show I've seen for the longest and most of is finally over. I'm actually going to miss it, I think.

Wednesday, April 1

All Good Things

There comes a point in time where you have to accept the facts of the matter - in this case the way in which I no longer have time to write anything of any interest any more. Yes, there's still the regular movie, games and restaurant reviews but judging by my inbox these are much less appreciated than the articles on Islam or relationships.

But why has Radio Shak been so lacking? I've managed to pin point a few reasons - the rise in my use of Twitter for inane comments, the fact that my work is now interesting and distracting (as opposed to virtually being paid to write as I was in my previous job) and plainly having better things to do are all causes for my writer's block. It's also possible that, finally, I've run out of things to say.

There is an argument that one should end these things on a high. This may not be relevant in my case since my hit counter has long been dwindling, but seeing how I doubt I'll again reach the heights I once was at, quitting would be better late than never. And so that's what I've decided to do. From this post onwards there will be no updates made to Radio Shak.

Of course this doesn't mean anything on a personal level; virtually I'll still be on email and IM, and I'll certainly have an opinion to air in person (if you're willing to hear any of it).

I sincerely hope you had as much fun as I did. Radio Shak is now officially off the air.

Shak

EDIT: As the comments indicate, yes this is all balls. Ironically the point still stands that this blog has been lacking recently. I'd like to promise that this will change, except I've done that already...