Archive for October, 2008

JavaScript on Steroids

Thursday, October 30th, 2008

JavaScript code monkeys like me have reason to rejoice: Jaxer, the world’s first AJAX server is available for free download. Now, I know this isn’t really news, since it’s been out for some time now, but I only just discovered it and it doesn’t seem to be well-known yet in the industry.

Just a little primer on Web programming languages… There are two basic types: server side and client side. Server side code runs on the Web server before the page ever gets sent to your computer. Because it runs on the server, it can access data on the server (other pages, databases, code snippets, etc.). Things like message boards and blogs are made possible by server side scripting. Technologies like PHP and ASP.NET are server side.

Then there’s client side. Client side code runs after the page is loaded, meaning the code is sent to your computer and run there. This allows the code to run while you’re viewing the page without reloading it. So when you see a webpage do something interactive, it’s usually client side code. Things like showing and hiding parts of the webpage, swapping out images, and animated menus are usually done with client side code. JavaScript is the client side language of the Web.

Now, there actually is a programming method called AJAX (Asynchronous JavaScript and XML) that allows JavaScript to parse XML files on the server or call small server side scripts. Google Maps is a good example of this. But there’s a good chunk of code needed to initialize something like this, and you still have to write the server side scripts in something like PHP or ASP. The whole process is clunky, although functional.

Jaxer lets you run JavaScript on both the client side and the server side—the same code!—so you don’t have to write and re-write functions in two different languages, or update functions twice. Not only that, but it’s far, far easier to make client side calls to server side scripts, or have server side scripts access information on a webpage.

I’ve yet to see if Jaxer has anywhere near the built-in code library of languages like PHP and Python. My guess is not quite—or, rather, not yet. I’m hoping to see this technology take off, since it could possibly become the server technology of choice for interactive Web application development.

A New Tactic

Wednesday, October 29th, 2008

I can’t really put into words how pathetic Zoey is whilst meowing outside of the bedroom, so I actually caught it on video:

I took the video and went back down to my computer to play some cards (I’m burning off stress… but that’s another entry) and the burrowing started. Now you know that I’ve been splashing water in his face whenever he does this, but it hasn’t been working. I knew it was time for a new tactic…

A little bit of outside help was just what the doctor ordered! I was able to drive him down the stairs.

Cat versus llama -- llama wins!

For the first time in my life, I’m sleeping with a llama tonight. If I could figure out how to make the llama spit water, it would be the perfect cat weapon.

Zoey Strikes Back!

Tuesday, October 28th, 2008

So Zoey has now traveled around our cleverly-constructed cat barricades; he’s gone over them too. Both of those have been thwarted by our two-tables-and-twenty-pounds-of-weight barricade. So what’s the buddy’s latest tactic? Burrowing.

A scratched-open card table

He first tried digging right through the first table itself. Not many cats can say that they’ve scratched the stuffing out of a table before. Bear in mind that we actually use this card table for (of all things) playing cards. Now, bear in mind that we have friends who like to play cards with us who are deathly allergic to cats. We’re able to clean up pretty well with our super-powered vacuum, but now we have to sit our feline intolerant friends, who are already kind of scared of the cats, at a table which has been disfigured by one of them. Way to ease their fears, buddy.

Anyway, Zoey figured out some time ago that scratching through the table won’t work. So he has a new tactic.

Zoey digging up the carpet

That’s right, folks: he’s actually trying to dig underneath the tables. I tried to get a close-up of the main damage, but it’s a little blurry:

Carpet now gone

In case you can’t tell, that’s bare wood showing in the corner there.

When we’re actually in the bedroom, we pull the table inside with us and push it up against the door to weight it so he can’t get in. That’s when the real damage happens, since he then has direct access to that corner. The night before last, I caught him doing it at 12:30. I promptly threw half of a glass of water in his face, and he went crying down to the living room. 2:15, the same thing happened. Then 3:25. When it happened at 5:30, he was actually expecting the water and ran away as soon as I opened the door. Same thing at 6:45.

It only happened twice last night, and I’ve now resorted to chasing him down with a bottle of water and soaking him after I open the door and he runs away. I’m just hoping that tonight I can actually sleep through the night. Of course, with Halloween coming up, that whole living dead thing might actually work out.

Don't worry, Tilly! I will endure.

Auto-Formatting Code Snippets with CSS

Tuesday, October 28th, 2008

Edit: I added overflow: auto to handle long lines of code.

I’ve recently thought about putting some of my code snippets up on this site, since I come up with a lot of them at work. This led to the question of how to format these without losing my mind. I wrote a few lines of CSS to do this automatically. The example of this is the below code itself:

<b>HTML</b>
&lt;code&gt;&lt;b&gt;Type of code&lt;/b&gt;
Code
  Indented code (tabs work!)
Code
&lt;/code&gt;<br />
<b>CSS</b>
code {
  display: block;
  margin: 1.5em 50px;
  padding: 12px;
  background-color: #DDD;
  border: 1px dashed #999;
  font-family: "Courier New", Courier, mono;
  color: #666;
  white-space: pre;
  overflow: auto;
}
code b {
  display: block;
  border: 1px dashed #666;
  width: 100px;
  height: 20px;
  background-color: #CCC;
  text-align: center;
  line-height: 20px;
}

I haven’t found a way to convert the < and > symbols, since I also have to use those internally for the subheaders, so I’m having to manually go in and change those to &lt; and &gt;, but I’ll look for a way around this.

Note: WordPress is deciding to “help” me by automatically closing tags if I put more than one line break in-between them and adding a <br> tag when I put in a line break. While this is usually a good thing, it doesn’t go well with my new design. I’ll work on taking out this functionality once I have some more time.

New Reading

Monday, October 27th, 2008

So I’m re-reading Watchmen right now, and I’m thinking that I probably have better things to do. I may start up Kierkegaard’s Fear and Trembling again, and I promised Janelle that I’d read some Annie Dillard, but are there any other good reads my three readers can recommend?

Quis custodiet ipsos custodes?

Wednesday, October 22nd, 2008

A while back, I picked up Watchmen to check it out, since the movie is coming out soon. I was blown away. I realize how geeky that makes me sound, given that this is a graphic novel (large-scale comic book). But consider that Watchmen made Time magazine’s list of 100 top novels between 1923 and today. (That’s novels, not graphic novels—it was on the list with The Great Gatsby and other classics.)

The quote in the post title, which means, “Who watches the watchmen,” sums up the premise of the story. The story covers a wide range of time, but basically, there are a few individuals who took it upon themselves to be superheroes. They didn’t have any special powers—just wits and physical prowess. They eventually band together into a team, to more effectively fight crime. But then, one of them attempts to rape one of the other ones.

There’s a public outcry. It makes sense. They don’t know who these people are, where they live. The police can’t catch them. If they decided to run amok, it would be quite difficult to stop them. Eventually, the government intervenes and passes an act which states that only government-sanctioned superheroes are legal; all others are to be hunted.

That’s all back-story, revealed later in the story. The story actually opens up with a murder of a man which is later revealed to be one of the costumed superheroes. One of the other costumed heroes (the only one who neither worked for the government nor retired) takes it upon himself to investigate this, since he doesn’t trust the police to finish the job. He uncovers something horrific, and—surprise, surprise—it’s something the costumed heroes can’t seek help with.

All of this sounds really cliché. It’s not. The writer took great pains to make these costumed heroes real people, who struggle with the morality of their actions and question the impact they can really have on the world. They show some of the good guys being bad guys, but they also show some of the bad guys being innocent victims. Even in the end, it’s not really stated whether the “villain” was justified in his actions. They very intentionally leave it ambiguous, with the action having both drastically good and drastically bad consequences and the characters not knowing how to react. It’s a story that really makes you think and doesn’t tell you what to feel in the end.

If you’re interested, you can actually pick it up pretty cheap on Amazon:

It’s by the same guy that wrote V for Vendetta, although I consider Watchmen to be the better story.

New Writing

Thursday, October 16th, 2008

I’m writing a totally fictional world and set of characters in it. I’ve been putting a lot of thought into the people and thought of this world and how to make it seem as robust as real life. This is a tidbit I came up with. The protagonist, Caelum Deleon, was born with a power he can’t quite control. Hopefully that puts this in context.

(more…)

@%^$% It! Zoey!

Wednesday, October 15th, 2008

So after I went to bed last night, there were a few more failed attempts by Zoey to get in and see his reluctant (hostile) cat girlfriend. And then there was a successful attempt. He jumped all the way over that cardboard and landed on the other side of it, then opened the door. I threw him out. This happened about five times between midnight and 8:00 a.m., and each time, I had to wake up and throw him out. (Oh that Zoey… such a maverick…)

So this morning, Janelle sent me down to the basement to find the behemoth from the depths.

A two-table barricade

That kept him out all day. The only problem is, we can only set it up while I’m not in the room (unless Janelle wants to seal me off and then let me out later). Well, we’re going to carry the table inside the room and use it to weight the door down at night so he can’t open it. Sheer brilliance.

So Janelle comes to me at about 10:00 tonight and says, “Why didn’t you just take Tilly and go to the guest bedroom? The door latches there.”

Outsmarted by Zoey. Again.

I’m upping my intake of fish oil and listening to classical music so I can battle this little furry genius. It’s a battle of wits, and I’m losing to someone who can’t even bury his own poop. I’m going up to my bedroom now, where I will practice lifting things with my mind.

Thoughts on the Debate—Featuring Joe the Plumber

Wednesday, October 15th, 2008

Joe the Plumber was almost aborted before he never went to charter school. What do you think about that, Senator Obama?

Monkey See…

Tuesday, October 14th, 2008

They say pets look like their owners. But do they sit like their owners?

Zoey sitting in the same position as Brandon