Yearly Archives: 2005

Javascript: How to pass objects to window.setTimeout

I was hacking some javascript and wanted to add a timeout to a callback
request (XmlHttpRequest / Ajax).  Note, only async requests
support the abort() function.  Many bad things happen when you try
to abort() a synchronous xmlHttpRequest.  A bit of background… I
create a new xmlHttpRequest object for each callback, so I couldn’t
just use a global variable as my one callback object.

Anyway, I needed to call a function with a parameter via the setTimeout
function.  I soon found out that passing variables/objects to the
specified function is not supported nicely.  So… I used an
anonymous javascript function to do my bidding.

This is the function I wanted to call via the setTimeout function:


function AbortIfCallInProgress(xmlHttpRequest)
{
    switch (xmlHttpRequest.readyState)
    {
        case 1, 2, 3:
            xmlHttpRequest.abort();
            break;

        // Case 4 and 0
        default:
            break;
    }   
}

This is how I called it:


 window.setTimeout(function () { AbortIfCallInProgress(xmlRequest); }, 5000);

Since this is not supported:


 window.setTimeout(‘AbortIfCallInProgress(xmlRequest);’, 5000);

Getting comfortable, socially

I don’t really know how to start this, so I’m just going to dive in and
see where it takes me.  I’ve noticed something about the social
interaction that goes on when I venture back to my home town.  I
have some great friends from high school who I, unfortunately, only get
to see a handful of times per year.  It seems that as more time
passes between each visit, the amount of time to get “reacquainted”
gets progressively longer.  I’m sure there could be a handy
equation, but I’m not feeling that adventurous yet. 

Currently, that time is about 1 night (about 4 hours).  This
varies depending on how many people are involved, but that’s the
current general estimate.  Meaning,
it takes about 1 night of bullshitting with each other (usually at a
bar) until we feel comfortable to just “hang out.”  It takes that
time to go through all of the crap going on in our lives… After we’re
done with that part, we hang out like we did when we were growing up
and just getting to know ourselves.

Now, I’m guessing this could be avoided if we all talked more.  But that just doesn’t happen…

The scientist in me wants to relate this to brain waves… I’d like to
think that since we’re all coming from different places, our brains are
all going at different frequencies.  That first night is like a
buffer.  It allows us to all get more in sync with the brain
waves.  So the following days, our brains are operating at similar
frequencies, making interaction more fluid.

Violence vs. sex

If you had a choice of what you would let your kids see, would it be violence or sex?

The American culture chooses to show violence to the shapeable youth
(and the rest of the population, for that matter)… apparently sex is
so taboo that the media would rather show us footage of a 14 year old
boy shooting a store clerk that asked him to leave… Not to mention
all of the movies that Hollywood pumps out… they’re all littered with
extremely violent scenes.  Look what it does to our society…
we’re fixated on violence around the world.  We have to have a
constant “war” in order to put the blame on others… If it’s not the
middle east, it’s the elusive terrorists… Guess what, the terrorists
are winning… they’re taking up the majority of TV air time… they on
everyone’s minds.  And the terror war will never conclude unless
the visible forces concede.

Now… think if sex wasn’t such a weird subject to talk about… Along
with the videos, that kids watch in health class, that show what a
penis and vagina are, I’d like to see schools teach some useful
information regarding sex.  Show real life cases of all of the
STDs.   Let the kids know all of the ways they can protect
themselves.  Show all birth control options and teach them not to
be afraid to buy/use them.  Show videos of how to please each
gender.  And I’m not saying just the quick blow job, but show them
that there is a sensual aspect as well.  Describe how it’s
possible to extend the sexual activities for hours… and yes, it’s
possible to do that for both genders…

What bad could come from that?  More people could actually have
good sex and be better educated about the negatives of sex.

And if you’re still not convinced about how much of a taboo sex is in
the American society, notice what happens if you accidentally bring up
a picture of a boob at work.  For some people, it’s about as bad
as closing the browser, scanning the room to make sure no one saw,
shutting down the OS, formatting the HD, and burning the
monitor…  maybe not that bad, but you know what I mean… people
freak out when something accidentally pops up on their screen.  

To me, this should change… Sex should be an open subject and violence shouldn’t have the celebrity status that it has now.

Are blogs replacing traditional diaries?

I personally think that diaries are a has been… I never got into
writing in a diary, when I was younger, cause I just didn’t like the
act of writing… It’s not that I disliked putting my thoughts down, I
just didn’t enjoy using a pencil/pen to record those thoughts. 
Now things have changed… I can type pretty fast (around 100 words a
minute I would guess), so I can throw my thoughts down fairly
quickly.  Plus, who wants to look through old notebooks?  I’d
rather browse the virtual pages… and having search functionality
improves usability dramatically…  And spellchecker… I would be
a mess without it.

The anonymity of the diary sort of exists… when I started this blog,
I told no one.  All of the people who read this stumbled across it
on their own.  Creating this blog in that fashion allowed me to
pour my thoughts out without a care in the world.  I didn’t (and
largely still don’t) know who reads this.  So, the effect was
similar to keeping a notebook in the solitude of a bedroom…

On another note, I really think that pen pals have been phased out,
also.  I never had a pen pal, but I could imagine writing bs to
someone in a different country… now, I think that practice has been
replaced with forums, IM, and email.

That said, I am changing my life.  Probably more appropriate would
be for me to say that I’m changing my lifestyle.  I will provide
more details as the time becomes more appropriate.

Clear…

I’m not quite sure why, but lately everything seems clearer to
me…  I notice new sounds in music I’ve listened to for years…
colors seem more vibrant than before.  I’m not quite sure why this
is all going on, but I figured I’d share…

As a side note, I have noticed something that I wouldn’t have picked up
prior to riding a motorcycle… There seems to be an understanding
amongst riders… it doesn’t matter what type of motorcycle you ride,
but everyone waves to everyone else.  In general, the wave is to
the side of the bike with a straight left arm.  The arm is pointed
out toward the ground… There are variations on it, but that’s the
gist.

Server upgrade to CommunityServer 1.1

After really too long, the server is back up and working… I upgraded to CommunityServer 1.1 and ran into an issue
After a quick fix, the site is functional again.  I want to
re-skin it, but I can’t guarantee when that time will come.

The other thing that is on my mind at the moment is about
intellisense.  I use Visual Studio primarily for development and
I’m not very happy with the current implementation of
intellisense.  I would really like to see a popup menu type thing
instead of the flat list.  Something that would separate events,
public, protected, and internal methods.

Phlosophy of Life…

A philosophy professor stood before his class and had some items in
front of him. When the class began, wordlessly he picked up a very
large and empty mayonnaise jar and proceeded to fill it with rocks,
rocks about 2″ in diameter.

He then asked the students if the jar was full? They agreed that it was.

So the professor then picked up a box of pebbles and poured them into
the jar. He shook the jar lightly. The pebbles, of course, rolled into
the open areas between the rocks.
Sand wagon

He then asked the students again if the jar was full. They agreed it was.

The professor picked up a box of sand and poured it into the jar. Of course, the sand filled up everything else.

He then asked once more if the jar was full. This time the students were sure and they responded with a unanimous “YES!”
Beer Can

The professor then produced two cans of beer from under the table and
proceeded to pour their entire contents into the jar — effectively
filling the empty space between the sand. The students laughed.

“Now,” said the professor, as the laughter subsided, “I want you to
recognize that this jar represents your life. The rocks are the
important things – your family, your partner, your health, your
children?things that, if everything else was lost and only they
remained, your life would still be full. The pebbles are the other
things that matter like your job, your house, your car.

The sand is everything else. The small stuff. “If you put the sand into
the jar first,” he continued “there is no room for the pebbles or the
rocks. The same goes for your life. If you spend all your time and
energy on the small stuff, you will never have room for the things that
are important to you.

Pay attention to the things that are critical to your happiness. Play
with your children. Take time to get medical checkups. Take your
partner out dancing. There will always be time to go to work, clean the
house, give a dinner party and fix the disposal.
Sand

“Take care of the rocks first — the things that really matter. Set your priorities. The rest is just sand.”

One of the students raised her hand and inquired what the beer represented.

The professor smiled. “I’m glad you asked. It just goes to show you
that no matter how full your life may seem, there’s always room for a
couple of beers.”

Pissed…

I was in a shitty mood last night.  It started when my washing
machine decided to take a shit.  Then, I found myself watching
Victoria Gotti’s “reality” show.  I had a beautifully crafted
slew of words describing my disgust for each celeb/rich person with a
show, to show how chaotic their life is.  Not to completely
offend, but I would like to see some of those people actually have to
do something without being waited on… wait, there was is that useless
retard, that is Paris Hilton, who proves my point… But then the
cherry on top
of it all was that firefox crashed and I lost my thoughts… ah well…
life goes on and in the end, this is all just sand in the glass.

Anyway, if you are looking for tips or info on how to repair an appliance, check out this kick ass site: http://www.applianceblog.com/

Vivid dreaming

I have been having quite a few vivid dreams lately.  It has been
fairly common for me to wake up (from a dream) in the middle of the
night.  The dreams have felt so real that I have a hard time
determining whether or not I’m dreaming at that point.

I have been pretty busy, but that seems to just be the nature of
summer.  I have a strong desire to start meditating again… I
think that would help with some stress that I’ve been feeling. 
Also, I am continuing to read (after a peroid of not reading) The Art
of Happiness
.  If you’re looking for a book to give you a better
outlook on things, give it a read.