Life in the Canadian Embassy

I know how much you guys like the pretty pictures, so I was hoping to wait until I had some photos to upload before I posted this… but my fans have spoken and I shalt deliver.

Two entries without pictures… in a row! Can you handle it? emoticon

I have also been doing a lot of thinking about what kind of posts I should be making here. Not only is this website a place to see pictures of us, but I have decided to expand a little bit on what goes on in my everyday life (rather than the really terribly spelling ungrammatical inane non-sequitor posts that I usually put up…) .. not a good a start, I know.

At any rate, the embassy is pretty fantastic. (I will post a picture soon!) I am working in the public affairs section of the Canadian Embassy in Tokyo. The building is fantastic (now that I am inside!… see below) and I find myself actually doing something of consequence. I am compiling a report on the Educational Promotion efforts of the 5 other English speaking countries with embassies in Japan. (UK, US, Australia, Ireland and New Zealand.) Basically I get to visit each embassy, learn about what they are doing to promote Japanese students to study in their country, and write a report making suggestions on what Canada can do to improve our own efforts. Cool eh? I thought so.

Other than that, Kiko is sitting at home… (nothing new)… in Tokyo. We are staying at a friends house. It is actually one of our very few couple friends (Japanese guy and a French woman) with a 1 year old son. So I am getting a taste of what my life will be like in 3 months. emoticon Excitement… let me tell you.

On another cool note, my very good friend the one and only Brian Chapman recently had a review published in the Daily Yomiuri, one of Japan’s leading English newspapers. It was none other than the review for the new Harry Potter book. Take a look… it’s super.

Harry Potter and the Half-Blood Prince (Book 6) [Adult Edition]

Read the review here.

The Canadian Embassy

I don’t think I have had a chance to tell everyone, but for the month of August I will be working at the Canadian Embassy in Tokyo as an intern. emoticonTake a look at it, the building is super fantastic.

… or it would have been if I wasn’t the biggest dumbass in the world.

So, after securing a place to stay with our good friends Dave & Eri (who read this everyday… right?), I was supposed to begin work this morning. So I get to the embassy at 9am in my suit. I call my supervisor down. She gives me a little lecture about what I should expect during my stay at the embassy and then we start to go upstairs… until I get stopped at the door and asked for my picture id.

 … oh yeah. I guess at a government building ID would be required. I left mine back in Kagawa with Kiko. "What about your foreigner ID card that you have to carry with you at all times??"

".. umm… yeah, well you see, i don’t really have that either."

"so let get this straight. You came to your first day of an embassy job without any form of ID??"

emoticonThat’s pretty much how that conversation went.

So anyways, apparently I have a really nice office in a really competitive job that I should be greatful for getting. I somehow managed to swing the time off work for free, and was gratiously put up by my friends in Tokyo with the super pregnant Kiko.

 I guess I will let you know about the embassy when they let me in.

that is all. 

 

I, Mac?

I am so clever. emoticon

Now, let’s get something straight. I am the last person in the world that would have ever considered buying an I-Book. I hate MAC’s. There silly little buttons confuse me, and I remember getting my disks stuck in the drive. Don’t let me get started on the 1-button mouse. Here’s the story though… My Sharp Mebius (a fantastic slim labtop) broke. It was hurtin’. Now, since I have a desktop (and 2 if you count my Linux/MythTV server!! It’s cool!) I only used my labtop for school work. All I needed was simple:

  1. Internet
  2. Word
  3. Portability

 I was faced with two choices. Pay 150,000 yen for a new Sharp, or pay 100,000 yen for a new I-book. After looking at the costs, and a good talking too from Greg, I decided to go ahead with the Mac. I figure I needed something portable, something that can do simple things, and I had never before used a MAC and wanted to learn. To be honest it is a little heavy (I figured a little weight was worth the $600 in savings) but other than that…

Best Purchase Ever 

Seriously… no joke. The things is amazing. It looks good, is fast, is intuitive and does everything I want it to. The presentation is amazing, sounds is fantastic, even the packaging was cool. Crap… I used to hate listening to MAC people whine… fact is it was (for the most part) deserved.

It’s not going to replace my desktop anytime soon, but considering that it met my criteria for a substantial amount less than other computers would, it was well worth it.

Here is a picture of my new baby, and the cool Japanese Apple Hanko (<- read what a Hanko is about there.)

 

 imac.jpg

 

 

Also, look at this swell picture that my good friend Toru drew up. Anyone remember Popeye? Thanks Tommy!!! emoticon

 

popeye-toru.jpg 

7/29 – My Bad Day

7/29 – My Bad Day

 I wish I could provide photographic evidence (maybe I will), but after a few days of not visiting the vegetable field, I went to find all 8 of my remaining watermelons have been destroyed / eaten. I don’t just mean like a little messed up, I mean like inside out, completely gone. All 8 of them. Small ones and big ones alike. Kiko thought it was birds, but I am convinced it was dogs. emoticon

 

That wasn’t the worst of it. I have been doing translating on the side and I haven’t been getting much work in the last few weeks after a supervisor change. Anyways, he decides to give me another job without actually getting my confirmation that I will do it. (long story…) well a long story that ends up with him calling me and berating me for not doing it. I point out that I never said I would, and then he accuses me of ignoring the confirmation e-mail he sent … which I didn’t receive.

Alas, I am on my way to Tokyo for the JET Tokyo Orientation. I will be leaving pregnant Kiko alone, I have to do that translation (or I’m in "more" trouble) and I don’t have any watermelons to look forward to.

Woe is me. (is the spelling right?) emoticon 

Recently…

Other than yesterday’s exciting Jet Journal news, here are a few pictures of what we have been up to the past few days.

It has been very hot, and very busy, but our very good friends from California were in Japan, and we got together in Okayama to see them for a few days. Their kids are crazy cute.

One of Kiko’s best friends, Sanae, has some very good news and is up from Tokyo to visit her boyfriends family in Takamatsu. We were really happy to be able to see them (and Kouichi for the first time!)

Finally, a very nice family, the Yamauchis, had Kiko, myself and Greg over for a great BBQ and a magic show. Don’t get me started with the magic show, the kid is amazing. I have some on video and hopefully I will start getting video up on this site.

Anyways, e-mail me and post in the ugly shoutbox already. Don’t say I don’t love you. 

Also, look at the pictures already.

Friends in Japan Picture   Friends in Japan Picture   Friends in Japan Picture   Friends in Japan Picture

Oh yeah… also had a Jamaican cooking class with semi-real Jamaican food and a real Jamaican. It was actually really good. Curry chicken, rice and peas and pepper jelly. nice. I know you’re jealous.

Jamaican cooking picture

 

Jet Journal 2005

Now… if you have been following this site, you may have seen me refer to myself as a Camera Genius, or a Picture Taking Machine (or something like that)…

 Well, it’s true. I submitted some pictures to this year’s Jet Journal (a magazine that goes out to all 6000 JET’s, and three of my pictures have been selected for publication. Take a look at the cover, and click on it to take a look at the pictures themselves. I’m super. emoticon

Jet Journal Cover 

Writing WordPress Plugins and Hooks

Original can be found here

Hooks: why?
————-

When you write a plugin you want to be able to switch it on and off whenever you want. This is not that trivial: say you write a function that does something useful, simply calling the function from your code gives an error when your plugin is deactivated. If you are lucky, it displays nothing, if you are less fortunate it displays all kinds of ugly debug information that people can abuse.

That is why ‘hooks’ were invented. Simply put, a hook is a point somewhere in the generation of your page where you can attach functions. When the hook is reached, all functions attached to it are executed in order of priority. When there are no functions attached to it, it does nothing.

So a plugin should do two tasks:

  • define a useful function
  • attach that function to the right ‘hook’

Many hooks exist already, and most people stick to those hooks. However, hooks are not black magic. Nothing stops you from defining your own hooks, and that is exactly what I’ll do in this page: I’ll create a trivial plugin, put it on my own hook at a place in the page where I like it.

Adding a hook
————–

The first thing I’ll do is the thing many people fear: I’ll create a hook. Using the default theme as an example, the page has a div called "content" which contains the posts in one page. I might want something to happen on the top of the "posts" section, maybe a status message, or a ‘recent comments’ section. That would be the right place to add my own hook.


Now before do that, there is some danger here: many hooks exist already, and before everyone starts defining their own hooks with the same names, let’s set a rule here: if you define your own hook, it should start with your own initials, to let the world know that it works for your plugins and to avoid name collisions. If it is a useful hook, it might become a standard hook for everyone one day.

Ok. Now let’s dive into the "default" theme directory (of course, we work on a backup) and start hacking on "index.php". The spot I had in mind was on line 4, right below the "content" div. I create a hook here called ‘lv_content_head’, because ‘lv’ are my initials, and it is the head of the content. I don’t use any parameters for now.

Below line 3 of "index.php", right below the "content" div, add the following line:

< ?php do_action("lv_content_head"); ?>

That’s all. If you load the page, you’ll see that nothing special happened. That is as it should, because there are no functions attached to it yet.

Now let’s write a "Hello World…" function.

A "Hello World" function
————————-

Now let’s create a real plugin; the file is called "helloworld.php", which will go in the "plugins" directory. The function is plain php; the "Plugin Name" entry in the commented section is is mandatory.

< ?php
/*
Plugin Name: Hello World
*/
function helloworld() {
echo "Hello World…";
}

Now if you would add the closing php-tag, you could see it already in the plugins part of the site administration. Right now, it is not a plugin yet, because it merely defines a function. The next step is to put the function on the hook. Keep the editor open!

Attaching a function to a hook
——————————

Just now we did two things:

  1. we created a hook somewhere in the generation of the page, and
  2. we created a function that is to be called when the hook is reached.

The next step is to attach the function to the hook. This is done by calling the function add_action, where its first parameter is the name of the hook (‘lv_content_head’ in our case), and its second parameter is the name of the function (‘helloworld’ in our case).

Our editor is still waiting for us, so add the function to the hook, and close the php part:

add_action("lv_content_head", "helloworld");
?>

Now the entire plugin looks like this:

< ?php
/*
Plugin Name: Hello World
*/
function helloworld() {
echo "Hello World…";
}

add_action("lv_content_head", "helloworld");

?>

Call it helloworld.php and put it in the wp-content/plugins directory.

From the admin panel it can now be activated, and it should display "Hello World…" on the top of the content area.

A few more pictures from Canada

I finally managed to pry a few more pictures off of my cellphone. This is Kiko, Chris, Franz & I celebrating Chris B’s birthday at a very good restaurant: Banzai sushi. I still owe him a present though… (not that seeing me wasn’t present enough mind you…) ps. Franz was kind of enough to treat Kiko and I to dinner. Thank you!! (my brain was not working, and I apologize, but upon reflection I could have used that as an opportunity to give Chris a birthday present and pay for his dinner. d’oh. chris, forgive me!)

 

chrisfranzdavidcanada2005.jpg   davekikojuly2005.jpg