Saturday, February 13, 2010

Night of '10 Jan 11 - JJ Abrams

It's been a while since I've had a weird dream. I've had trouble remembering them. But I remembered this one for some reason.

Recently I got the Adobe CS4 Production Premium, complete with Premiere, After Effects, Illustrator, Photoshop, and many others. This has thrown me into a filmmaking frenzy. I haven't made any real full length feature films yet (I'll let you know when I do) but I'm beginning to get all of these great ideas for them. It's as if having the tools to create has inspired creation.

Anyway, last night I had this dream...

I had a dream that I came up with some genius idea for a movie, and that some famous producer was considering funding it. Naturally, I was flattered that any big name producer would even consider producing a film by an inexperienced director like myself.

It turns out that this producer was the one and only J.J. Abrams. Abrams is my favorite filmmaker of all time. I contacted him, even though every part of me believed he wouldn't want to deal with me. I thought I would do it just so I could say I did. You can imagine my shock when I got a phone call saying he was coming over to my house to talk with me about my idea!

So he shows up at my house, and as I open the door, I see Mr. Thompson, a teacher of mine, staring right back at me.

MR. THOMPSON WAS J.J. ABRAMS! I asked him why he never told me this secret, and he said it was because he never thought it was relevant. This made things even better because he knows me and would undoubtedly want to produce my film.

Then I woke up.

Saturday, February 6, 2010

C struct Inheritance

Inheritance is generally thought of as belonging to object oriented programming languages like C++ and Python, but it can actually work with procedural languages like C.

In C, there is a data type called the struct, which is basically a collection of various types.

A struct typedef like this:

typedef struct
{
int val1;
char *name;
} super_t;

can be "sub-structed" by another struct typedef like this:

typedef struct
{
super_t sup; // this HAS to go at the beginning of the struct
char otherval;
} sub_t;


With the types set up like this, if a pointer to a variable of type sub_t is casted to a pointer to super_t, then the attributes of super_t can be accessed like normal.

The only problem is that a sub_t instance needs to get the values of its superclass through the sup variable.