Monthly Archives: March 2009

Mike’s Tips for Falling Asleep

Last night, I had a pretty hard time getting to sleep.  This is not a new phenomenon to me, and I doubt I’m alone.  I’ll bet you (yes you) also have trouble getting to sleep sometimes.

So I thought I would share some of the techniques I use for falling asleep.

By the by, I’m clearly not a doctor, and this is by no means a definitive sleeping guide – but these tips seem to work for me.

Here we go.

Tip 1

I try to avoid consuming caffeine and large amounts of sugar within an hour or so before sleeping.  That means tea, chocolate, coffee, cola, sugary cereal, etc.

That’s just common sense.

Tip 2

Write down everything that I need to do for the next day.  That way, I’ve reassured myself that I’ll deal with those things when I wake up, and I can allow myself to let them go in the mean time.

Tip 3

Turn my computer off.  I actually feel muscles in my body relax when I hear it power down.  When my computer is on, I’m alert and thinking.  When it’s off, then I can sleep.

Tip 4

If I’m lying in bed, and I can’t fall asleep, it makes me tense.  Nothing is more frustrating in the night than insomnia, and that frustration usually manifests in me as muscle tension, which keeps me awake.

It’s a vicious cycle.

So, if I’m lying there in bed, all frustrated, I usually ask myself this question:

Is my face all scrunched up?

I’m surprised at how often the answer is “yes”.  And how can I go to sleep with a lemon-sucking face?

If my face is tense, no doubt other muscles in my body are tense.

Here’s a lesson that took me 2 years to fully realize:

The easiest way to relieve muscle tension is through breath.

I know, sounds crazy, but it’s true.  Here’s how I can prove it to myself:  Go into any stretch as far as I can go.  Hold it.  Now inhale and exhale.  I can usually go down quite a bit more by “riding” the exhale.  Hmph.

So, anyway, if my face is tense, probably other parts of my body are tense.  I try to do a full inventory of these muscles, starting from my toes, up to the top of my head, figuring out what’s tense.  If I can’t ease the tension with breath, I give it a good ol’ massage.

Tip 5

I cannot sleep without a clear head.  There have been so many times that the only thing keeping me awake was some crazy idea, or a song, or a solution to a problem, etc.

For me, what helps to calm down my overactive brain, is to force myself to only concentrate on one thing.

This is a lot harder than it sounds.  It takes practice, and there’s plenty of time for practice if you can’t sleep!

Here’s how I clear my head:  I try to picture a black circle on a white background, or a white circle on a black background (some nights, one is easier than the other.  Strange…).  Then, I just focus my hearing on my breathing, and just focus on breathing in and out.

I try to let myself become absorbed with the act of breathing – trying to find the nuance and uniqueness of every inhale and exhale.

And usually that’ll do it – next thing you know, my alarm clock will be going off, and I’ll be hauling myself out of bed.

Does anybody else have any sleeping tips?

Cesar Salad in my Satchel – A Cautionary Tale

There’s a little cafeteria at Innis College that I like.  My favourite menu item is BBQ’d chicken on rice with a Cesar salad – only $5.50!  It’s a lot of food, and it tastes great.  I usually get some on Mondays.

Today is Monday, and I took my meal to go.

And put the solid-looking plastic clam shell container in my satchel.

A brisk walk later, I sit down in the Playhouse lobby to enjoy my delicious meal.

I reach down and pick up my satchel, unclasp the top…

and there’s Cesar dressing everywhere.  More dressing than I thought could possibly cover a salad.  It was absolutely incredible – like a white paint can had exploded in my bag.

Have you ever had your faux-leather wallet dripping with Cesar dressing?  You don’t want to.

Yech.

Anyhow, the meal was delcious, despite the Cesar salad debacle.  I highly recommend that little cafeteria.

Just wanted to share that.

MyTTC and StopFinder

So maybe everybody else in Toronto knew about these mashups, but I sure didn’t.

Until this afternoon.

So here’s some free publicity for them…

MyTTC

New to Toronto?  Intimidated or confused by the Toronto Transit System?

If you’ve tried the actual TTC website, you may find it confusing, and lacking in beginner information.  You just want to know how to get from point a to point b.

Enter MyTTC.  Just give it your starting and finishing location, and the hour you plan to leave, and it will plot you a trip through the TTC, lickity split. Google Maps style, with instructions on where to board, and where to get off.

I could have certainly used this during my first year here.

StopFinder

Tired of paying too much for parking?  Think you’re getting ripped off by sketchy lots?  Wouldn’t it be nice to get a good look at the entire “parking” picture of Toronto?

Check out StopFinder.  Just give it your destination, when you intend to arrive, and for how long, and it will show you the nearest lot, the cheapest lot, and all of the other options in the area.  Also via Google Maps.

Cool and useful mashup.  I like.

Memorizing My Lines

In all of my performance classes, without fail, I’ve had to memorize lines at some point or another.

This year, in Voice class, I had to memorize an edited version of JFK’s “We go to the moon” speech.  I was the one who edited it, and it came down to about a little over a page of text.

And I memorized it, fluidly, in about 3 days.  Not bad.

So, here’s how I normally go about memorizing my lines:

  1. If there is an original recording of the speech, or lines in question, avoid it at all costs.  Do not taint your performance with someone else’s interpretation.
  2. Understand the text.  This is the most important part.  What am I saying?  Why am I saying it?  Who am I saying it to?  Why do they care?  Why do I care?  What is causing me to speak?
  3. Examine the text for clues.  What is the key word, or idea in each sentence?  Look for rhetorical devices, like metaphor, repetition, etc.
  4. Break the text into “argument” sections.  These are usually just paragraphs.
  5. Record myself speaking the lines, without any “acting” – just speaking them normally, and adding the appropriate pauses and breaks for punctuation.
  6. Break that recording up into the argument sections, and put the individual files on my MP3 player in speaking order
  7. While I’m walking in between classes, play the sections.  Listen to myself, pretending I’m the audience.  Ponder how to deliver what I’m hearing.  Ponder how to deliver any rhetorical devices.
  8. Start to speak the lines with the recording.  For me, this is the kinesthetic learning bit.  My mouth and lips learn the “dance” of the speech, so that if I happen to forget a line, my mouth and lips know where to go for the next line, which may remind me what my next line is (understanding the logical structure of the argument also helps to pull out of forgotten lines – if I need to get from A to C, of course I need B…)
  9. Repeat repeat repeat.  Keep playing the MP3 player, and speaking the lines to myself.  Go section by section.
  10. Play the MP3 player even when I’m working on other things, so that it’s playing in the background.
  11. Sleep (without the MP3 player playing).  It’s amazing how, in the morning, all the stuff that I’ve been repeating in my ears and with my mouth is still there, and comes faster and naturally.
  12. Now I’m ready to try to rehearse this thing.  If I have scene partners, I get together with them and just give it a shot.  If I’m doing a solo performance (like with the JFK speech), I try delivering it aloud to an audience of friends.
  13. Practice practice practice.  Rehearse.  Don’t get stuck in a delivery pattern.  I try new things:  I dance the speech, yell the speech, whisper the speech, seduce with the speech.  I get playful.  I put the story of the speech at higher priority than my performance; what is absolutely necessary is that the message/story gets across.  The “acting” is secondary.

And that’s how I do it.  Nothing special, and it works for me.

Making my First Firefox Extension…in 90 Minutes

It’s a race.

I’m going to attempt to create a simple Firefox extension that will display the DOM ID of an element that my mouse cursor is hovering over in the status bar.

There are probably a ton of Firefox extensions that will do that already, but I want to give it a shot as a project.

It’s 3:30PM right now, and I want to try to get this done by 5:00PM.  I’m going to be using Ubuntu 8.04, gEdit, and Google to get me started.

And I’m going to record my progress here in this blog post.

Note: After I’m done, I’m going to edit my sporadic notes so that they make more sense.  So if you’re wondering just how I managed to stay so cool, calm, and collected in my prose under such time pressure, and why the publish date on this article is after 5PM, now you know.

3:35PM:

Gonna start with Google:  “building a firefox extension”

Ok, found an article about how to create a Firefox extension.

Apparently, the first thing I want to do is try setting up a development profile in Firefox.

3:41PM

Finished setting up my dev profile by opening up FF with this command:

firefox -no-remote -P

Then created a profile called “Development”.  After that, I typed “about:config” in the URL bar, and changed some settings as instructed on this site.

3:49PM

According to that last article, I can create a skeleton Extension project using this site.  Done – calling the project DOM ID Displayer

3:53PM

Installed this Extension – apparently, it’ll be some help.  Will let me reload Firefox’s chrome  shtuff without restarting the browser each time.  Useful.

3:55PM

Found this article on making a status bar extension in XUL.  Easy as pie.

4:05PM

Ok, I’ve coded something in XUL that should display a new panel in the status bar.

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="chrome://domiddisplayer/skin/overlay.css" type="text/css"?>
<!DOCTYPE overlay SYSTEM "chrome://domiddisplayer/locale/domiddisplayer.dtd">

<overlay id="domiddisplayer-overlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script src="overlay.js"/>

<!-- Firefox -->
<statusbar id="status-bar">
  <statusbarpanel id="domiddisplayer" label="Hello, World!" tooltiptext="Dom ID Displayer" />
</statusbar>
</overlay>

I put that in the “overlay.js” file in my ~/Experiments/Extensions/domidinspector/content folder that was created using that Wizard from 3:49.

Now, to get this thing to run in my Development profile, I create a symbolic link to it in the Development profile’s extensions directory

ln -s ~/Projects/Experiments/Extensions/domidinspector ~/.mozilla/firefox/nzuzbdpz.Development/extensions/domiddisplayer@mike.conley

Open Firefox with Development profile:

firefox -P Development &

4:16PM

Looks like I can access and relabel the XULElement that I’ve ID’d as “domiddisplayer” using this:

domiddisplayer.updateDisplay = function(event) {
var dom_element_id = event.relatedTarget.id;
document.getElementById('domiddisplayer').setAttribute('label', dom_element_id);
}

Cool – I can now change my text in the Firefox status window.  Now I just need to capture any time a mouse moves over a DOM element….yikes, that might be tricky.

4:33PM

Been tinkering with this as a way of putting a mouseover event listener on everything in the window:

window.addEventListener("mouseover", function(e) {
  domiddisplayer.updateDisplay(e);
}, false);

4:35PM

Seems to only be capturing mouseover/mouseout events on Chrome elements – so I can get the ID’s of the statusbar, etc.  These are XUL Elements, not the DOM elements of a web page…

So I’m close.

4:44PM

This page is super helpful…

Apparently, I need to wait for the content of the page to load before I can attach observers to all of its sub-elements.  Makes total sense.

So, in my domiddisplayer.onLoad function, I write this:

var appcontent = document.getElementById("appcontent");
if(appcontent)
  appcontent.addEventListener("DOMContentLoaded", domiddisplayer.onPageLoad, true);

And now, I create a function called onPageLoad, which looks like this:

domiddisplayer.onPageLoad = function(aEvent) {
//Runs when the page is loaded
  window.content.document.addEventListener("mouseover",
  function(e) {
    domiddisplayer.updateDisplay(e);
  }, false);
}

5:03PM

Done.  I’m over time, but I’ve finished a (relatively) working extension.

Here, it’s a mess, but you can download the whole thing right here if you want to tinker with what I did.

Download domiddisplayer.zip