Talk @ Brumcon9
1v$ Thu Jan 1 0:00:00 GMT 1970
I’m giving a talk at Brumcon9 this Saturday, titled “Friend me! – Data-mining the social web”, this is my outline (work in progress):
- Who I am
- The “social web”, what’s thattabout den?
- Data mining, identity theft, social engineering, and digital forensics
- The case of the missing tweet
- Tools of the trade
- APIs, apps, loopholes & exploits
- Stalking Miss Daisy
- Outro
New job, and a new project
1v$ Thu Jan 1 0:00:00 GMT 1970
Okay, after about 2.2 years of working for Sense Internet I finally left the wonderful folks there to persue a career as a Python web dev, for Isotoma in York.
I actually did this about a month ago, as ever I’m just crap at pushing out any kind of update. ;)
Anyhoo, my latest project was finally released this weekend, memorised, a Python decorator for caching function/method results in memcached with very little faffing about.
For a write up on memorised, take a gander at my post on the Isotoma blog.
Prototype.js Event keycode constants
1v$ Thu Jan 1 0:00:00 GMT 1970
A more human-readable table of the keycode constants listed in Prototype.js’s Event class:
| Name | Keycode | Use |
|---|---|---|
| Backspace / Back delete | KEY_BACKSPACE | Event.KEY_BACKSPACE |
| Tab | KEY_TAB | Event.KEY_TAB |
| Return / Enter | KEY_RETURN | Event.KEY_RETURN |
| Escape / Esc | KEY_ESC | Event.KEY_ESC |
| Arrow left | KEY_LEFT | Event.KEY_LEFT |
| Arrow up | KEY_UP | Event.KEY_UP |
| Arrow right | KEY_RIGHT | Event.KEY_RIGHT |
| Arrow down | KEY_DOWN | Event.KEY_DOWN |
| Delete / Forward delete / Del | KEY_DELETE | Event.KEY_DELETE |
| Home | KEY_HOME | Event.KEY_HOME |
| Page up | KEY_PAGEUP | Event.KEY_PAGEUP |
| Page down | KEY_PAGEDOWN | Event.KEY_PAGEDOWN |
Still Alive
1v$ Thu Jan 1 0:00:00 GMT 1970
I’ve just spent the last couple of weeks getting over chicken pox..yeah I know, kids illness blah blah, it can be quite
serious when you’re an adult believe it or not, and more so for a diabetic. Anyway I’m still here and ready to go back
to work on Tuesday.
Haven’t really got many projects done, other than rekitting my new Dell Mini Inspiron 9, the Vodafone version with
integrated HSDPA chipset and GPS, with Ubuntu 9.10 and getting the 3G working. I’ll post more on this
later, posting this on the Mini 9 from my in-laws over 3G, with them still being in the dark ages of wired dial-up.
My new email setup
1v$ Thu Jan 1 0:00:00 GMT 1970
After years of resisting using Gmail for email (I still have an original early beta account), the everyday use of my Android powered TMobile/HTC G1 has made the push-email integration with Gmail too tempting at last, and I’ve switched my email use from a dedicated IMAP account over to Gmail.
However I’m not trusting GOOG completely with my mail use, and to make sure absolute available of all my latest mail, and my back archive of emails in case I ever want to move this is my current setup:
- Email goes to my personal domains, in which the MX records point to my dedicated server.
- Postfix runs these emails through greylisting (using greyfix) and SpamAssassin just to stop any barbarians at the gate.
- Postfix then forwards these emails to various local dynamic maps, which in turn forward to both my Gmail account and an offsite backup IMAP account.
- A cron’d script on my server periodically deletes emails from the offsite backup IMAP account every 2 weeks, meaning I can get access to the last 2 weeks of email as well as send email out from my personal domains (I can also do this from my server, obviously, for outgoing) if there’s ever a Gmail problem.
- Larch is also run every week to synchronise any emails in my Gmail account with a local IMAP archive, for future portability.
The upshot of this is that I get perfect webmail, desktop IMAP and push-email on my G1 without worry of any reliability on the GOOG. w00t.
Final Fantasy XI tip: get out of being "stuck" targeting someone
1v$ Thu Jan 1 0:00:00 GMT 1970
It seems my wife has become addicted to playing
I play it sometimes with her too, although FF isn’t really my thing it can be fun to play together. One annoying little game glitch that happens to us every now and again, mainly after a fight with a monster, is that one of us will become stuck on the other…or even on other people. By this I mean that the targeting cursor (that you use to perform most of the different type of actions with other players, objects and
Obviously this is slow and very annoying. The other day someone informed us as to a quick fix for this using the Xbox 360 controls (the game is available, and indeed we both us it on each of, Xbox 360 and PC), we translated these actions into the equivalent PC keyboard controls and have verified that it works on before, instantly releasing the fixation after pressing the key combo.
If this ever happens to you, you can use for the 360:
Press both B and L3 (inward on the left analogue stick), together
The PC equivalent:
Press both * and Esc, together
Dynamically adding methods and static methods onto classes at runtime in PHP5.3
1v$ Thu Jan 1 0:00:00 GMT 1970
Before I begin, let me state that I agree entirely with others who have said that lambda functions and closures aren’t meant to allow you to dynamically extend classes at runtime, what I disagree with is the assertion that there are other ways of doing this. Currently there is no other way of doing this, and while I don’t think I’d use this method in production, it is still an extremely fun hack to use!
You can do things like this inside Lisp-like languages such as Python and Ruby, but they’re naturally parts of the language itself, rather than exploiting the inner working of magic methods with the lambda language feature as I do here.
Returning to the to using some of PHP5.3’s more magic features, I realised that I was being a little short-sighted with my example. In fact you can expand it to include not only methods, but static methods, and not only modifying single objects at runtime but you can emulate modifying the actual class definition itself so that any instantiated objects will have the new methods.
This is made possible by using the new late static binding and __callStatic magic method features. By using late static binding we can call a static method in the base ancestor class which assigns the lamba function passed in to a static hash of methods, indexed by the descendant class you called it via, using the new get_calling_class() function to get it’s class name and use that as the index.
We can use a separate hash of static methods to add static methods (which are just lambdas again) to the class by defining an extra __callStatic() magic method, that works just like the __call() method, but obviously for static calls.
<?php
require ‘OneVersion/DynamicClass.php’;class MyClass extends OneVersion\DynamicClass {
public $name = ‘Dis is my class’;public function __construct() {
echo ‘Instantiating “’ . CLASS . ‘”’ . PHP_EOL;
}
}class MyOtherClass extends OneVersion\DynamicClass {
public function __construct() {
echo ‘Instantiating “’ . CLASS . ‘”’ . PHP_EOL;
}
}MyClass::addMethod(
‘test’,
function($this, $text=null) {
if ($text === null) {
echo ‘default test’ . PHP_EOL;
} else {
echo $text . ‘ test’ . PHP_EOL;
}
}
);MyOtherClass::addMethod(
‘test’,
function($this, $text=null) {
if ($text === null) {
echo ‘default test2’ . PHP_EOL;
} else {
echo $text . ‘ test2’ . PHP_EOL;
}
}
);$object = new MyClass();
// Should output:
// Instantiating “MyClass”echo ’1: ‘;
$object->test();
// Should output:
// default testecho ’2: ‘;
$object->test(‘monkeys’);
// Should output: monkeys testecho ’3: ‘;
$object->test(‘chimps’);
// Should output: chimps testecho ’4: ‘;
$object2 = new MyOtherClass();
// Should output: Instantiating “MyOtherClass”echo ’5: ‘;
$object2->test();
// Should output: default test2echo ’6: ‘;
$object2->test(‘chimps’);
// Should output: chimps test2echo ’7: ‘;
$object2->test(‘conan’);
// Should output: conan test2echo ’8: ‘;
$object->test(‘conan’);
// Should output: conan test
?>
I’ve released OneVersion\DyanmicClass 1.0 out into the wild under the LGPL v2.1, so download and play at your own peril. ;-)
Leeds2600
1v$ Sat Feb 9 12:34:51 GMT 1534
Spread the word: http://leeds2600.org.uk/2600 meeting in Leeds, first friday of every month, 7pm, first one will be @ The Elbow Room
Married
1v$ Thu Jan 1 0:00:00 GMT 1970
Just a quick note to say yes I did get married on Saturday, yes we did have a nice time in London, and no it doesn’t feel particularly different other than this strange ring that’s appeared on my finger.
Speechify
1v$ Thu Jan 1 0:00:00 GMT 1970
For those that don’t know, this Saturday I’ll be finally getting married to my long time (and long suffering) fiancée Andrea.
As joyous an occasion as this Saturday will be, there is one problem. I have to give a speech.
I’m not unaccustomed to public speaking, having given a few techy talks here and there, and during uni, but this…well..this is different.
Giving my speech as the groom of the day will involve standing up in front of a room filled with friends, family, and family-to-be.
As my manager said the other day, this is actually the one time in which your audience is more on your side than any other audience you’ll ever speak before, and yet it’s still as frightening as all hell.
As for how my speech is going, I’ve written over half of it, but I’m now considering re-writing what I’ve got as I’m just not sure if it’s the way I want to go.
Jonty has suggested I write a bunch, plus a markov chaining tool, and generate a speech. Of course he also suggested I include lyrics from The Fresh Prince Of Bel-Air.
Whatever I come up with in the end, I’m sure it’ll be fine, as long as I thank the right people and hit the right sentiments.
Now, this is a story all about how
My life got flipped-turned upside down
And I’d like to take a minute
Just sit right there…