After Paris, I took the EuroStar up to London. It was supposed to take 2 1/2 hours, but ofcourse the train going to Paris broke down at Ashford International so they had to take our train back to Paris and we had to wait while they fixed their train to take us to London. Atleast I didn't have to wait 4 hours as some of the London Perl Mongers did.
Once in London, a friend met me at Waterloo Station and we took a cab up to a swedish pub. Once there, we found it was occupied by a private party (Bummer), so off to McDonalds for some dinner. It is without doubt the most expensive BigMac & Co I've ever eaten. Later that night we went to a pub in Chelsea.
On monday, I went to stay with sky in his apartment and do some sightseeing. Took the bus from Old Street down to Waterloo to catch Matrix Reloded on IMAX, but they only screen it in the evenings. So I walked over to Tate Modern, cross the millenium bridge and up in St. Paul's Cathedral. 600 stairs makes me really tired. After some random walking in London, I went to see sky again.
On tuesday, more random tourist activities.
On wednesday evening, there was a emergency London.pm social meeting because I and R. Geoffrey Avery were in town. Lots of beer and booze and sky managed to hand out homework for those who had little to do.
Thursday and it was time to fly back home. Took the train from Paddington out to the airport and got lost in the terminals. Managed to find my way to the SAS check-in after a while. After going thru security check and not beeing searched I was kinda suprsised, because I thought they had tighten up security. But when entering the gate, they randomly (yeah right, eat my shorts) selected me for a security check. Two people who had checked-in didn't board the aircraft, so they had to unload all luggage and remove theirs so we were an hour late away from London.
Well, that's about what I've been up to.. now it's time to do some programming (and play SimCity 4 ofcourse).
I'll be doing two presentations this year, Making Applications scriptable and Filter development for Imager.
However, I need a wacky idea on what the Imager plug-in should actually do. I have some ideas of my own, but yours are probably better.
If you have one, please either send it to imager@surfar.nu or post a comment to this journal entry.
See you in Paris,
Claes
Me, kane, sky and 6 other friends cruised in a limo to the climbing place where sky climbed some walls. Then we headed home for a three course dinner I prepeared, and afterwards we had cigars & booze. Later in the evening we ended up drinking beer & vodka in their sauna.
I hope everyone is more or less alive today.
Anyhow, I installed SquirrelMail on my mailserver yesterday because I wanted a web-interface to my mail. It's nice and all that, except it's written in PHP and really slow with lots of mail in the inbox. Are there any nice mod_perl based web-mail solutions or will I have to write one myself?
Next thing I want is an Apache module for publishing my Keynote slides like the HTML export feature in Microsoft PowerPoint. I wrote some code to objectify the presentation.apxl file, it could probablly end up in something useful. This could, ofcourse, be used for other things as well, like rendering each slide with Imager or like.
My implementation of the li/rpc protocol (http://lirpc.berlios.de/) is comming along fine. I've renamed it to li/rpc-e (e for enhanced) since it adds a number of features not found in li/rpc. Hopefully, I can post it on CPAN sometimes next week.
Oh, and I need to learn python and tcl.
I've been investigating Java RMI lately... expect wicked stuff.
During the last few days, i've been doing some heavy programming incorporating execution of Java code inside our Content Management System. Except the possiblity to run Perl and JavaScript in the webpages the system creates, the marketing people also wanted native Java support. At first, this sounded like an "almost" impossible task (since i had 3.5 working days to fix it). But nothing is impossible =)
Inline::Java fixes the problem to run java inside perl, but once you want java code to call perl subrutines (or methods) things get harder. So i realised it was time to dig into JNI (Java Native Interface) and mix that with perl API calls. Inline::Java is really really nice, but didn't really do what i wanted so i ended up using Jvm.pm which is just an interface to JNI Invokation Interface. We wanted to wrap our perl classes inside Java and that was the problem. This is basiclly what i ended up with:
----------------------------------------
# Wrapper Java class
public class FooWrapper {
int _SVaddr = 0;
static { System.loadLibrary("FooWrapper") }
public FooWrapper(int ptr) {
_SVaddr = ptr;
}
public native void printID();
}
# Some JNI code, compiles to libFooWrapper.so needed for System.loadLibrary
SV *get_sv_reflect(JNIEnv *env, jobject obj) {
SV *reflect_sv;
jclass class_ref;
jfieldID addr_field_ref;
jint addr;
class_ref = (*env)->GetObjectClass(env, obj);
if(!class_ref) return NULL;
addr_field_ref = (*env)->GetFieldID(env, class_ref, "_SVaddr", "I");
if(!addr_field_ref) return NULL;
addr = (*env)->GetIntField(env, obj, addr_field_ref);
if(!addr) return NULL;
reflect_sv = (SV *) addr;
return reflect_sv;
}
JNIEXPORT void JNICALL Java_FooWrapper_printID(JNIEnv *env, jobject obj) {
dSP;
SV *ref;
ref = get_sv_reflect(env, obj);
if(ref) {
ENTER; SAVETMPS; PUSHMARK(SP);
XPUSHs(ref);
PUTBACK;
call_pv("Foo::printID", G_VOID);
FREETMPS;
LEAVE;
}
}
# Our java code
public class Party {
public Party {
}
public void run(FooWrapper foo) {
foo.printID();
}
}
# Some perl code
package Foo;
sub new {
my $class = shift;
my $id = shift;
return bless { id => $id }, $class;
}
sub printID {
my $self = shift;
print "ID is: $self->{id}\n"
}
package main;
use Inline ( C => "int get_sv_addr (SV *var) { return (int) var; }" );
use Jvm;
my $party = new Jvm("Party", "()V");
my $foo = new Foo(10);
my $foow = new Jvm("FooWrapper", "(I)V", get_sv_addr($foo));
$party->run("(LFooWrapper;)V", $foow);
----------------------------------------
The real code i wrote throws Java Exceptions if the perl subrutine/method dies =)
Magic =)
Tomorrow at 4 am, I'll be on my way to Amsterdam and Yapc::Europe, woohooh!