Press "Enter" to skip to content

Month: January 2009

xckd: Learning a new language

xkcd
xkcd

This comic on xkcd is quite relevant at the moment Yes, I’m splitting up with my other half – No, don’t panic K, I’m not really 😉 But she and I were watching Firefly over the weekend (10 out of 14 episodes done: big pity they cancelled it) and we did find it annoying that we didn’t understand the Chinese language in it: and we know at nearly the big “three oh”, we’re both going to find it difficult to learn a new language (especially since we would prefer to learn Japanese or Mandarin/Cantonese) as our brains have “solidified”.. Shame!

Anybody got any tips for learning totally new languages when you are a bit old in the tooth? Neither of us know any other languages (apart from several computer languages and very basic French: but those don’t count)…

PHP: Zend Session: don’t set it up in the Initalizer

I’ve just wasted a few hours trying to get Zend_Session (part of the PHP Zend Framework) working correctly – previously, on this codebase, I had “rolled my own” cookie and session management system, but I thought I’d do it properly and utilise the Zend_Session system and store it all in a database…

It didn’t work.

Short answer as to why my sessions weren’t saving into the database (even after I switched to using the “default” Zend_Session_SaveHandler_DbTable ) was that I was setting up the session within the “routeStartup” section of Initalizer.php (which is loaded, in MVC fashion, via the bootstrap.php file). Changing bootstrap.php to:

// Prepare the front controller.
$frontController = Zend_Controller_Front::getInstance();
// Change to 'production' parameter under production environemtn
$frontController->registerPlugin(new Initializer('development'));
$maxSessionTime=60*60*24*30*6; // six months
Zend_Session::setSaveHandler(new My_Session_DbTable($maxSessionTime));
Zend_Session::rememberMe($maxSessionTime);

(i.e. take move the session savehandler out of the Initializer, but keep all the $thingy=new Zend_Session_Namespace whereever they are needed) means it started to work.

Most annoying thing: that there was no reason it didn’t work (no warnings, no errors, no documentation hints and no ‘out of place feeling’). Meh.

Personal: You know you are getting old…

  • When Policeman start looking younger
  • You don’t remember being absentminded.
  • You have more patience; but actually, it’s just that you don’t care any more.
  • Your memory is shorter and your complaining is longer.
  • You look forward to a dull evening.
  • You quit trying to hold your stomach in, no matter who walks into the room.
  • Your idea of a night out is sitting on the patio.
  • You begin every other sentence with, “Nowadays…”
  • A ‘late night’ now ends at 11 pm.
  • When the actor playing Doctor Who is younger than you

*sigh*