Monday, December 31, 2007

What will 2008 bring?

Last year, I wasn't able to go anwhere/do anything for New Year's Eve due to "family obligations." Basically, someone made a bad choice and I had to clean up the mess. This year, I'm under no such obligations . . . except I'm just done getting over a sinus infection, my energy levels are pathetically low, and I didn't exactly make any great/fantastic plans.

I know, not the most auspicious start to yet another year that I swear is going to be better and different than last year. Still, in comparison to the first two weeks of last year, it'd be a major surprise if this year isn't better.

I'm in year two of the "new job", so I guess I can't technically call it "new" anymore. I stated five professional goals in my first year evaluation, and with the research I completed last week while everyone else was on vaca, I was able to make major progress on one of them. If I can get this one piece automated like I want, it should free up about two work hours of my time every week-- that's 104 additional work hours per year I can apply to accomplishing the other four remaining professional goals.

Of course, there's more to life than your vocation. There's the "living" part, and that's the part I haven't exactly been very good at in the past few years. Part of the problem was that my previous job demanded so much of my time, it was nearly impossible for me to have a life "outside" of it. People would call me before work hours, after work hours-- their expectations were just insane. They'd send an email to my Blackbery, and then call me ten minutes later demanding to know why I hadn't responded to their email. Fortunately, the climate at the new job is an improvement-- they understand the difference between email and instant messaging.

The problem is, now that I've reclaimed the time, what exactly do I do with it? I don't exactly have fantastic hobbies, and few of my interests are socializing-oriented. One or two of my friends have been talking about trying to fix me up with someone. They mean well, but they can't possibly understand why I might find that sort of talk insulting or offensive. I've spent/lost too much time and energy in my life trying to make other people happy. Having a significant other isn't guaranteed to improve the quality of my life, and it's more than likely to prevent some opportunities to do new things. (Example: I'm toying with the idea of learning how to ski-- but being "stuck with" someone who's unwilling to consider learning something new would completely demotivate me.)

The real kicker, though, is going to be the home renovation. I've tried to do piecemeal home improvement projects in the past by financing them with my tax refunds. The gas fireplace was a fiasco that went way over time and budget; but it did have one bright side. It taught me that this piecemeal nonsense would never get me anywhere, and that I should pursue a line of credit to finance the rest of the improvements in a more compressed time line.

So, now I've got the money to make it happen- I just need to know exactly what I want to accomplish.

Sunday, December 30, 2007

The FOAF (Friend Of A Friend) phenom

(for those of you expecting a technological post on social networking as a metric of accurate merit, this ain't it.)

I must be in some bizarre contemplative mood this morning. I could go for the easy joke about Dita Von Teese being single again, and learning that I'm the same age as Marilyn Manson-- but instead, I find myself contemplating some bizarre human inter-relationship phenomenon that I can only call "Friend of a Friend."

Let's say you actually read this entire blog. You would wind up with a series of inferences, some of them right and some of them wrong. The point is, the inferences you walk away with are never going to be as complete and accurate as knowing me in real life. This is obvious, right? I mean, I'm not revealing any great mystery or surprise here by saying that. People manage their disclosures online to be more like the way they want to be perceived.

All right-- let's change the script a little bit by replacing "read this entire blog" with "hear stories about me from one of your friends." Over time, as you hear these different stories, you begin to build a series of inferences about me. Some of these inferences might be spot on, while others might be erroneous. Why would some be erroneous?

Because people are like prisms-- when they tell stories about something they've witnessed or experienced, they filter and bend the reality according to their worldview. I'm not even talking about "spin doctoring" or any of that cynical nonsense now, I'm talking about frames of reference. Ask a teenager to define what old is, and they might say "over 35 . . . "; ask someone who's 36 what their concept of old is, and they might say "over 50 . . ."; ask a 51 year old if they feel old, and they might ask you to arm wrestle. ;)

When people tell stories, they include the parts they think are interesting, or that drive home the point they want to make. They rarely tell the story in its entirety, and who can blame them? That would take too long and who has that kind of memory and attention to detail anyway?

But, wait-- there's more! ;)

I control my own information in my blog. I can choose what to post, or not to post, I can spell check my words so I look more literate/educated, I can go back and fix "bad" posts or remove them entirely. The resulting impression you get of me is directly related to the skill and care I put into cultivating my public persona.

We enjoy no such luxuries when our friends tell stories about us. They can choose to tell the private stories about us that we wouldn't tell ourselves (Thanks, C!) or not to tell stories that contradict how they like to think of us. The delta between reality and the stories told tends to be even greater.

It's sort of like when the public mistakes the actor in a television show for the character that he or she portrays, and then are all disappointed when reality shows they are nowhere near as ideal/cool/sexy/intelligent in real life.

Saturday, December 29, 2007

Will cell phones make wrist watches obsolete?

Despite what web site polls at Gizmodo would have you believe, cell phones will not make wrist watches obsolete.

You've seen the polls. The latest one states that 2/3's of the respondents use a cell phone to tell time instead of wearing a wrist watch. First of all, it's not the most scientific survey in the world: they left off an option for people who use both their cell phones and their wrist watches to tell time. I think there is also an argument to be made that having the poll on a gadget-themed web site will get you skewed results-- much like having a survey of people leaving church will get you skewed results if you ask religious oriented questions.

Here's what the surveys don't tell you: wrist watches aren't about telling time. They are about making statements via fashion status symbols. When you go to a job interview/business meeting/cocktail party sporting an Omega or Tag Heuer on your wrist, you are sending a message to others about who you are in the economic pecking order. Yes, I know-- technical types tend to disparage this fashion statement business, but that doesn't mean it's any less real or valid. It just means that there are different modes of the same game. Look at the iPhone, for instance, which will cost you about as much as a man's luxury watch by the time you add in the data plan, etc. -- or the proliferation of personalized ring tones. It's the same game, but people play at the level they feel they can afford.

(For the record, I haven't worn a wristwatch on a regular basis for a few years now, and when my cell phone rings it sounds like Dr. Who's TARDIS.)

Thursday, December 27, 2007

Fortune Cookie Message

"It's nice to be remembered, but it's far cheaper to be forgotten."

~ Chinese fortune cookie

Sé un poco sobre un montón de cosas diferentes

El conocimiento puede ser "profundo" o "amplia."

"Profundo" significa usted sabe todo lo que posiblemente es saber sobre un tema específico. Gente considera que un documento de expertos sobre el vino, o haikus, o los Beatles. (Sugerencia de la pluma a B.)

"Amplia" significa que tiene triviales el bloc de notas de los conocimientos en las diferentes áreas, pero no la información completa de los expertos en una sola disciplina. Es posible saber la 54 elemento en la tabla periódica que pasa a ser de xenón, pero no tiene idea de cuántos elementos hay en toda la tabla periódica. En los viejos tiempos, hemos llamado a estas personas Renaissance hombres / mujeres.

Como estoy seguro de que ha de deducirse el título de esta entrada, mi conocimiento tiende a ser "amplia" en vez de "profunda". ¿Qué puedo decir -- Tengo una licenciatura en artes liberales de la tradición. Es curioso que algunas personas recordar mi testigo de una peculiar información tidbit (por ejemplo, utilizando HTML comentarios "encubrir" Javascript para que pueda pasar a través de un validador de éxito) y asumir soy un experto en ese tema. Es incluso más cuando alguien con la "amplia" del conocimiento (por error??) Cree que es un experto en un tema.

Tengo un amigo, el "Agoraphobe", que ella misma considera un experto Beatles. Un día, conoce a este chico, que también tiene un amor apasionado a los Beatles. Ella toma un pase de fantasía a la gente dice y las huelgas de una conversación. En el curso de la conversación, surge la cuestión "¿Cuál es tu Beatle favorito?" La gente responde: "Peter". Al punto que mi amigo dice gente asume que es un poser, y todos sabemos que los expertos y fanáticos no puede tolerar falsa aficionados -- por lo que desestimó dicho gente de la cola posiblemente interesante.

Más tarde, cuando ella está recordando su triunfal exposición de poser dijo a mí, y me deja de preguntar, "¿No era el baterista Ringo antes llamado Peter algo?!" "Sí, Peter Best," las respuestas y, a continuación, después de una larga pausa: "No creo que en realidad quería decir... Aw, [interjección], tienes que estar bromeando!"

¿Hay alguna lección que hay que aprender? No sé. Con terminología como "amplia" y "profunda", es tentador para terminar esta entrada con un ingenioso doble sentido. Salvo no puedo dejar de pensar, pero los expertos no están obteniendo algunas amistades / relaciones / oportunidades a causa de su elitismo -- y si renacimiento de personas podrían centrarse sólo un poco más sobre un tema que se podrían tomar un poco más en serio que "dilettantes" O "gatos / jills de todos los oficios."

No hay antiguo gurú en la cima de la montaña que sabe todo. Él desapareció para dar lugar a las conveniencias modernas como la radio y las torres de antenas de teléfono celular. Somos nuestros propios expertos; somos nuestro propio renacimiento de los hombres. Todo el mundo tiene algo que ofrecer, y tenemos que despertar y darse cuenta de ello en breve.

Wednesday, December 26, 2007

I know a little about a lot of different things

Knowledge can be "deep" or "wide."

"Deep" means you know everything there possibly is to know about a specific topic. People consider you an authoritative expert on wine, or haikus, or the Beatles. (Tip of the pen to B.)

"Wide" means you have trivial scraps of knowledge in many different areas, but not the comprehensive information of the expert in any single discipline. You might know the 54th element on the periodic table happens to be Xenon, but you have no idea how many elements there are in the entire periodic table. In the old days, we called these people Renaissance men/women.

As I'm sure you've deduced from the title of this entry, my knowledge tends to be "wide" rather than "deep." What can I say-- I have a degree in the liberal arts tradition. The funny thing is some people witness my recall of a peculiar info tidbit (e.g. using HTML comments to "cloak" Javascript so it can pass through a validator successfully) and assume I'm an expert at that topic. It's even funnier when someone with "wide" knowledge (mistakenly??) believes they are an expert on a topic.

I have a friend, the "Agoraphobe," who considers herself a Beatles expert. One day, she meets this guy who also has a passionate love for the Beatles. She takes a passing fancy to said gent and strikes up a conversation. During the course of the conversation, the question comes up "Who is your favorite Beatle?" The gent answers: "Peter." At which point my friend assumes that said gent is a poser, and we all know that experts and fanatics cannot possibly tolerate faux fans-- so she dismissed said gent from the possibly interesting queue.

Later, when she is recalling her triumphant exposure of said poser to me, I stop her and ask, "Wasn't the drummer before Ringo named Peter something?!" "Yes, Peter Best," she replies, and then after a long pause: "You don't think he really meant . . . aw, [expletive], you've got to be kidding me!"

Is there some lesson to be learned there? Beats me. With terminology like "wide" and "deep," it's tempting to finish this entry off with a witty double entendre. Except I can't help but think experts are missing out on some friendships/relationships/opportunities because of their elitism-- and if renaissance people could just focus a little longer on one subject they might be taken a little more seriously than "dilettantes" or "jacks/jills of all trades."

There is no ancient guru on the mountain top who knows everything. He vanished to make room for modern conveniences like radio towers and cell phone antennae. We are our own experts; we are our own renaissance men. Everyone has something to offer, and we need to wake up and realize it soon.

Tuesday, December 25, 2007

Worst Christmas EVAR!???

Possibly so.

Next year, I'm going to plan to be away for Christmas-- Colorado, Albuquerque, Montreal, I don't know yet-- but it will be far away from all the selfishness/hypocricy/insanity that this time of year seems to bring out in the people around me.

And-- No, I *really* don't want to talk about this.

Monday, December 24, 2007

Office Politics Article at Dumb Little Man

I'm re-reading the "How to improve your skill at office politics" entry for the third time now, trying to figure out why something here is bothering me. I think it is an outstanding article, I should mention. It's definitely more positive and helpful than the general commentary and advice on office politics that is currently out there.

And yet, when I think about trying to apply it to working with my situation-- it breaks down once it goes beyond my immediate office (i.e. specifically interacting with members from other departments).

I think the advice works when everyone is being honest. Unfortunately, the organizational structure of hierarchies frequently pits one department against another-- and discourages people to be honest and forthright about their concerns and needs.

I also disagree with the statement about incompetence being excusable if the person is likeable. True, being competent does NOT give you license to treat other people badly-- and if you think otherwise, you need to stop watching House MD reruns and get out in the real world more often. However, I've worked on teams where an incompetent staff member has pretty much single handedly destroyed the performance of that team. It's an absolute morale killer, period. Just ask anyone who's had to work over the weekend to fix the problems caused by another teammate's incompetence. If you cannot or won't learn to do the job correctly, you should admit it and move on to another job that you can do properly.

Sunday, December 23, 2007

The jigsaw puzzle that is Google

There's this hilarious scene in "Moscow on the Hudson," where Vladimir (Russian defector played by Robin Williams) goes to the grocey store to buy coffee . . . and begins to hyperventilate because he's overwhelmed by the staggering number of brands available to him.

That's also a good representation of what I felt like when trying to figure out which APIs I should use in my first Google Mashup Editor experiment! Fortunately, I've been able to make some decisions to narrow that scope considerably. I decided to limit my first mashup experiment to only Google provided feeds/API's. I know, that seems kind of arbitrary, but when you think about it, the most likely feeds/API's to have problems with the Google Mashup Editor are the ones NOT created by Google. So by limiting it to Google products initially, I should have a better chance of succeeding.

So, I've been reading up on the various Google Data APIs-- and there are probably well over a dozen of those! You've got the Blogger Data API, which lets you read/create/update/delete entries in your Blogger powereed blog. You've got the Google Docs Data API, which allows you to list the various documents you have in your collection of online documents. You've got a Google Spreadsheet API which allows you to read data from a specific spreadsheet. It's still quite a lot to absorb.

But the one that blows my mind the most is Google Base and its associated APIs. Basically, Google lets you create a database (except its all in XML instead of tables, rows and columns) and then use that database as the backend for your web application. The data is public, so you wouldn't want to put any confidential info in it, but if you are building a web app, chances are you are trying to make that data as public as possible anyway, right? Otherwise you would be running it on an Intranet server or internal file server. (Yes, I know, some people have no damn sense, so I shouldn't assume that.)

The potential of Google Base is enormous. I just need time to wrap my brain around the whole new paradigm-- to stop thinking in terms of relational database tables, and start thinking in terms of XML items that can have one or more possible values for the same attribute built into each item.

So, assuming I can figure out Google Base-- what other APIs should I mash it up with? The obvious/too easy choice is Google Maps. Google Base features a "location" type, so I could use it in conjunction with Google Maps to track locations of some type or other. But, how incredibly lame and unimaginative is that? I mean, everyone and their brother has already done that-- so unless I decide to track something really offbeat, like Elvis sightings or crop circles, no one else is going to find it useful or interesting. And let's face it, Elvis and crop circles are novelty items at best.

The goal here is to come up with a-- an-- "alloy" of two services that no one has really considered combining, and winding up with something greater than just the sum of the two original parts. Like maybe Google Base with a bunch of data about the various incarnations of Linux distributions and their ancestor/decendent relationships, combined with Google Charts to provide some kind of visual "family tree."

Sigh. Yeah, I know-- no one besides hard core Linux geeks would care. And maybe not even most of them. But it's an example of the sort of ground breaking thought process that needs to go into a mashup.

Saturday, December 22, 2007

Friday, December 21, 2007

When former co-workers resort to slander, nobody wins

I was invited to the retirement ceremony of a former colleague this week. Even though I was no longer a part of that organization, someone took the time to recognize that I had worked closely with this person on the web development team for our group, and decided I should be invited. I thought this was a pretty classy move, so I RSVP'ed that would I attend.

Turns out, it was a big mistake.

About twenty seconds after I step in the door, one of my former coworkers walks right up to me and says, "We don't allow traitors in here." At first, I think I must have misheard what he said with all the background noise in the room, so I ask him to repeat himself. He does, and I tell him to kiss my ass and walk right past him.

The sad part about all this is I could contact his supervisor and file a complaint about being publicly slandered like this, except I'm sure it would all be explained as "he was just joking . . . you shouldn't have taken him seriously, you need to get a sense of humour, etc." and then subsequently swept under the rug. Unfortunately, that double standard of discipline has become SOP for upper management in my former organization. It's one of the many reasons why I decided to leave.

So, here's the deal-- I know (thanks to Google Analytics) that at least one of you reads this blog. I've overlooked a lot of the stuff that was said about behind my back when I worked for you, but I don't work for you anymore and I don't have to put up with it now. Here's what's going to happen: the next time *anyone* from my former workplace contacts me and asks for assistance, my answer will be no. When I explain why I'm refusing to help them, I'm going to cite the comment that was made at this retirement ceremony and the name of the person that made it.

It's called "The Prisoner's Dilemma." You try to screw over someone that you have to interact with into the future, and you can expect retaliation. In this particular case, I'm taking a page out of Ghandi's book and using passive resistance. Just be glad I didn't pick a tactic from someone else's book-- like Hannibal.

Thursday, December 20, 2007

The Raw Ingredients of a Good Mashup

I got an email a few days ago confirming my new Google Mashup Editor account. I haven't had time to play with it very much, but it is basically a front-end/toolkit for creating web mashups.

I know-- what's a mashup, right?

A mashup is when you take features from two different web sites and blend them in such a way that it forms a new, and arguably, superior result. There are already hundreds of mashups in existence, but the most popular kind of mashup appears to involve GoogleMaps.

So, here I am, with the best toolset yet to create a mashup-- and I can't figure out which ingredients to use. I don't want to do a retread of the same stuff that's already been created, but my knowledge of all the APIs, RSS and Atom feeds, web services, etc. is so tiny that I can't even think of two elements that would be a logical choice to mesh together.

So, I found a web site called The Programmable Web that lists something like 20 million different APIs-- and now I'm drowning trying to figure out what each one does.

Google Analytics, cntd.

A few days ago, I wrote about how the new version of Google Analytics code broke valid HTML pages. I've noticed some people are using search keywords related to that topic and winding up at my site, so I figure I'm not the only one experiencing this problem.

I decided to contact the Google Analytics team with the suggestion of using "Javascript cloaking" in their new code so it can pass through a validator successfully. Who knows-- nothing may come of it, but then again, they might make the change.

Monday, December 17, 2007

My next car ;)

Get an old black El Camino . . . have this guy replace the engine with something light years ahead of GM's current output . . . trick out the doors . . . and, oh yeah, it's got to have a wicked paint job.

Bet that'll get you some looks the next time you need to get some stuff from Home Depot!

Sunday, December 16, 2007

New Google Analytics Code breaks valid HTML

Et tu, Google? ;)

When I get sick, I tend to do two things: sleep a lot and catch up on coding articles that I never get to read otherwise. So, when I learned that Google Analytics (the service I use to track visitor stats for this blog) had released new tracking code, I decided to remove the legacy code and drop in the new stuff.

And, because I'm gradually becoming OCD about web standards in my new job, I made sure to run the W3C's HTML Validator tool against it. Yup, you guessed it, the new code breaks valid HTML. Seven errors if you place it near the tail end of your document, like GA's documentation suggests, or 29 errors if I put it in the head portion of my blogger template.

After some experimenting, I think I found a way to include the code so that it doesn't throw errors in a validator. I need to make sure the code is working properly by checking my visitor data in the next day or two, but I think this should work. The trick is to use HTML comment tags after each opening script tag and before each closing script tag. Like so:

<script type="text/javascript">
<!--
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write("\<script src="'" type="'text/javascript'">\<\/script>" );
-->
</script>
<script type="text/javascript">
<!--
var pageTracker = _gat._getTracker("UA-XXXXXX-X");
pageTracker._initData();
pageTracker._trackPageview();
-->
</script>

Yeah, I know. Most people won't care. If you do, though, and this saves you time, you're welcome.

Cheryl Crow nails it in one lyric

I'm not much of a Cheryl Crow fan, but there's this one song-- I couldn't begin to even guess what the title is-- where she reveals a universal truth:

"It's not getting what you want/
It's wanting what you've got . . . "


Saturday, December 15, 2007

The Significance of Color (Biological?)

I take color for granted. Since I'm more of a web developer than a designer, that makes sense.

You know what I mean-- colors are supposed to have certain meaning and symbology attached to them. Red indicates passion, yellow and black represent danger. The only problem is, the symbology breaks down when you cross cultures. In the western world, white is the color of innocence and virginity and black is the color of death and mourning. In the eastern world, however, white is the color associated with death. You wind up needing a matrix of culture versus color just to "decode" any color symbology a designer might have intended.

Or-- maybe you don't!?

Everyone catches colds. When you have a cold, you tend to sneeze and blow your nose. If the mucus is clear, that's a good sign. But if the mucus comes out with a nasty green tinge that means you've got a sinus infection. Doesn't matter if you are white, asian, hispanic, or Lithuanian, nasty green snot is nasty green snot-- and a sinus infection is what you've got.

Let's say you've been sneezing and blowing your nose a lot, and the sinus cavity has gotten all raw-- you might possibly blow your nose and see hints of red in your Kleenex. Or, worst case scenario, you might get a full on nose bleed and see a lot of red. Again, doesn't matter what race you are, red is red, right? I'm beginning to think we can make an argument for color symbology that might transcend cultural norms, provided we all stick to the syntax of biology.

It's not just the color-- it's the syntax we see those colors in. When I give blood for a medical test, I'm not alarmed or surprised to see red blood filling the vial. And neither is anyone else. It's when we see green blood that people start getting antsy. So, as human beings who share the same fundamental biology, we have an understanding of when we should and when we should not be seeing certain colors. If anything, it seems like we shouldn't be taking exceptional notice of color until it appears in a context that we don't expect to see it.

Friday, December 14, 2007

So close, and yet . . .

Every winter, I get sick. I don't know if it's the mold from the leaves, or the dramatic change between hot and cold weather on a day by day basis, but I usually wind up with a cold and/or sinus infection. Since this usually happens for me around late October/early November, I was thinking I might have avoided that fate this year. If I could just get to Jan 2008, I've have made it one year without my usual winter illness.

I should be so lucky. ;)

I've been washing my hands, using the Purell, taking the Airborne/Vitamin C, etc. and yesterday afternoon I started getting that familiar feeling in the very back of my throat that always proceeds a sinus infection. Just in time for the weekend, naturally. :'(

I'm hoping the Airborne will kick in and give my immune system that extra little boost to fight this back, that this crud just sort of pooled in my sinus and throat while I was lying in bed, and that gravity will help clear things out and I'll feel better.

Thursday, December 13, 2007

iTunes, Smart Playlists and the iPod shuffle. WTF?!

I've wasted an hour of my life trying to trouble shoot a stupid problem. It's actually pretty stupid and pathetic. I have a "Smart Playlist" in iTunes that dynamically keeps track of all the podcasts I've downloaded, but not listened to yet.

Every morning, I drag and drop this "Smart Playlist" onto my iPod icon in iTunes and the contents of that list gets copied into my iPod. You'd think I'd be happy and leave well enough alone.

But, no. I "had" to get the Autofill feature working.

The idea behind Autofill is just like it sounds-- you're basically telling the iTunes software to automatically fill your iPod with content. That content can come from a static playlist, or one of the dynamically generated "Smart Playlists."

Except the Autofill feature is crap. Oh, it works great if you use one of the built in playlists that comes with iTunes, such as "Purchased" or "Music." But, the second you try to use a home-made Smart Playlist, it refuses to copy anything from that list. It doesn't matter that you can click on the Smart Playlist and SEE the darn podcasts in there . . . or that you can manually drag the Smart Playlist to the iPod icon and it will copy the podcasts just fine.

I've dug through multiple articles on the iPod Support forum, tried the suggestions, but nothing works. You think I'd just do the smart thing and give up on the stupid Autofill feature. I've got too much to do as it is without wasting my time/life on trouble shooting this nonsense, but here I am still bitching and complaining about it.

At least I was smart enough to take care of the more essential things on my "to do" list first . . . like putting out the recycling, mailing in that insurance info to the credit union. But, damn, this kind of nonsense really bothers the heck out of me. It's clearly a known issue, but there's apparently no fix for it. What's the point of having a smart playlist if its just going to be locked away on my laptop computer?

Did I mention I also downloaded the gOS Live CD and tried it out? Yup, you guessed it-- doesn't support the proprietary wireless network card on my Dell laptop. Pretty much useless without a network connection, although I have to admit the interface was user friendly without coming across as "too cute."

I'm sorry, but somehow I don't think God put me here to fix other people's mistakes for the rest of my life. Or, if he did, then I sure as hell better get paid good money for it.

Monday, December 10, 2007

The Paradox of Podiums and Messages

I think I've discovered a paradox.

When you are young, you have so much to say about how things are done in the world around-- except no one listens and you don't have anywhere that you can speak your piece. The message is pretty much, "No one cares what you think, so shut up."

Then, you finally get to the point where you have a platform to express yourself (a web page, rock band, paintings, whatever) and suddenly, you discover that you seem to have lost the ability to say anything worthwhile.

I'm sitting here in front of my computer, going over all the inane and stupid ideas I had for blog entries-- like how unreliable my Windows Handheld PC is versus how reliable my Nokia cell phone is, or how my 30 day trial of Filemaker Pro is going. The truth, though, is no one cares. Heck, *I* don't even care, and I'm the guy writing it!

There's got to be something worthwhile and meaningful to write about, think about, live your life about, but it's like there's just so much bullshit in our daily lives that it becomes impossible to keep your eyes and mind focused on what is important. Maybe I'd feel differently if I had children? It's an interesting thought experiment, I guess, but the simple reality is I don't have children and unless there's a sudden and drastic change in my life, it's not too likely to change.

When I was in college, a group of my friends got in a ridiculously overblown pissing contest about a production of Rosencrantz & Guildenstern are Dead. That same semester, in a totally unrelated set of events, two fellow students decided to take their own lives. I know that seems like a weird, random thing to mention, and it is-- but at the time, it seemed very important to me to tell people that they were being impossibly stupid about a damn theatre production when people around them were feeling urges to end their very lives. Of course, I had no venue to express this, and no one would have cared or listened if I had.

Now, almost two decades later, I have a web site that receives visitors (albeit in a paltry number) from foreign countries . . . and I can't find a single thing I feel is worth saying.

Please tell me that isn't completely messed up.

Sunday, December 9, 2007

Secret mailing list rocks Wikipedia | The Register

Secret mailing list rocks Wikipedia | The Register:

"Meanwhile, Durova continued to insist that she had some sort of secret evidence that could only be viewed by the Arbitration Committee. 'I am very confident my research will stand up to scrutiny,' she said. 'I am equally confident that anything I say here will be parsed rather closely by some disruptive banned sockpuppeteers. If I open the door a little bit it'll become a wedge issue as people ask for more information, and then some rather deep research techniques would be in jeopardy.'" (emphasis mine)

Wikipedia's editorial elite have a secret email distribution channel to help them go after members they don't like. They invoke sanctions against those people, and then try to avoid justifying their actions with wording that sounds like it was taken verbatim from a White House press conference.

Is anyone actually surprised by this? This problem isn't unique to Wikipedia. It happens every day in thousands of so-called web communities. It also happens in lots of places that aren't on the Internet-- like workplaces, courts of law, churches, and let's not forget school playgrounds. That's right-- some adults never grew up beyond the petty and childish paradigm of making themselves feel more significant or important by singling other people out for harrassment.

Durova is just one example of someone who publicly professes one philosophy (i.e. the egalitarian tenets of Wikipedia) and then indulge in their true beliefs privately. Maybe she should run for political office-- I have a hunch that she'd fit right in.

Friday, December 7, 2007

T-Shirt folding video

I'm scanning through Lifehacker's RSS feed when I stumble across this gem:

Fold a t-shirt in 2 seconds!

It's actually a pretty handy little trick. If I wore t-shirts more often, it might speed up laundry day considerably. It took me about three viewings and five minutes to get it right. The camera vantage point makes step #3 a little more difficult to follow (i.e. pulling over and through).

Which got me to thinking-- is video a good instructional tool? What makes one video a "better" educational video than another? Is there a set of "best practices" that you can use to consistently achieve better quality in such video clips?

Thursday, December 6, 2007

No phishing in my pond, asshat

I killed my first phishing site today.

It's not my job to do that, but when criminals try defrauding my clients and the people who are supposed to protect them aren't doing their job, don't expect me to sit by and do nothing.

This particular scam was a typical PayPal spoofed email, claiming that such and such charges had been authorized on a person's account-- won't you please click here and log in to dispute the charge? Sadly, some of my clients are naive enough to fall for that trick. They're not computer people-- they just see a page that looks exactly like the PayPal screen they have seen before, and assume it is genuine.

It never occurs to them to study the URL carefully. Or to look the IP address up with a WHOIS service and find the organization that owns that particular range of IP addresses. They wouldn't know about contacting the abuse address and reporting a "Terms of Service" violation.

But I do, and I will.

Sunday, December 2, 2007

Sudoku - Wikipedia, the free encyclopedia

Robert Henry might not want to read this . . . .

Sudoku - Wikipedia, the free encyclopedia: "In the 'what-if' approach (also called 'guess-and-check', 'bifurcation', 'backtracking' and 'Ariadne's thread'), a cell with two candidate numerals is selected, and a guess is made." (emphasis mine)

Lousy performance from expensive sheets

Yes, the bed sheet saga continues . . .

I was able to take my original bedsheets back to Bed, Bath & Beyond and exchange them for a new set. They were very decent about it, no hassle or paperwork. Just show the receipt, hand over the old set, and take a new set off the shelf. I didn't even have to wait in line again.

Naturally, it was all part of the plot. ;)

You guessed it. This time the stitching came apart on the first run through the washer/dryer cycle. And since I didn't get a new receipt when I made the exchange, I can't prove that I've had this set for less than 30 days.

The upside of this is that this time, the stitch that broke was the top part of the sheet-- so there's nothing exposed to unravel. I'm hoping I can take this by my drycleaners and pay them to add a stronger thread/stitch to all four edges. I like the feel of the material. It's a shame that the quality of the workmanship that keeps it all together is so abysmal.

Sudoku Solver, revisited

I put aside the "killer sudoku solver" project for a few days. It was a nice diversion during the Thanksgiving holiday weekend, but it consumed far too many hours and mental energy.

But, now that I've got some more time on my hands, I find my thoughts returning to it again. I did some reading up on regular expressions, and I've come away more convinced than ever that a dictionary-attach approach to Sudoku puzzles is still the best way to handle it. There are a finite number of possible valid Sudoku puzzles. If I can capture them all in a simple text file, then it's just a matter of running a tool like grep with a regular expression against the text file, and voila!

Since my original file of 362880 lines with nine characters per line comes in at about 3.5 MB, I assumed a full "Sudoku dictionary" of 81 characters per line would come in at well over 30 MB. Since I haven't figured out a way to reliably generate only valid combinations, I can only begin to guess at the size of the final product. The overall length of each line is increasing to nine times its original size, but I'm not sure that some lines won't be eliminated entirely by the logistics of the puzzle structure itself.

Blogger, Web Standards, and "An Error Occurred . . . "

Yes, I know. Adding the "links to this post" feature has caused some pages on this site to fail W3C validation. The front page and archive summary pages still validate, but the individual permalink blog entries are now broken thanks to the unencoded ampersands in the "Create a Link" code auto-generated by Blogger. I can't fix the ampersands because they don't actually appear in the template code window that end users see. My options are basically:
  1. to remove that backlink feature entirely and run 100% standard compliant
  2. keep the feature and live with the shame of a site that fails to adhere to standards
  3. cajole/wheedle/nag/bribe the Blogger Team to fix their unencoded ampersands
  4. move to a new site and blogging tool entirely.

Geekhaus: To Blog or Not To Blog?

For the past few years, I've been trying to improve my house in a piecemeal process by using my tax refunds to finance the various projects. Looking back, I feel this approach hasn't worked for me. Contractors and home improvement folks just don't take your job very seriously when it's "only" got four digits. It bothers me, but I've got to be realistic about it-- if I had to pick between a small job that would earn me maybe 3 thousand dollars, or a big job that will let me earn five times as much money, I'd be lying if I said I'd treat both jobs with equal degrees of care and diligence.

So, I've applied for and received a home equity line of credit. I've already got several ideas on how I should improve my house (e.g. replacement windows, get rid of the carpets and go for wood floors or laminates, increase my storage space, etc.), but I know I haven't thought of everything. It's tempting to put a lot of the details about what I've got in mind up online in a blog and let people comment on them, or make new suggestions-- but at the same time, I've got some trepidation about putting out that kind of info. It's not so much that I'm expecting someone will figure out where I live from the blog info and do me like Sean Taylor, but there are some aspects of the home improvement project that just isn't anyone else's business.

For example, last December my house was burglarized. Although I have no way to know or prove who did it, more than one person I've spoken to about it indicated that there were some peculiarities about it that suggested the person(s) responsible knew things about my house that a complete stranger would not have known. I've taken several steps to improve the security of my house. I'm not going to list them here, because-- let's think about it-- one part of security is not to run around and divulge details about what precautions you've taken!

I mean, if I told people that forcing entry of the front door triggered a series of tear gas cannisters embedded in the door frame, they might bring gas masks. Then they'd only have to worry about my blood thirsty, guard ferret, Grendel.

( Bugger! Did I just say all that out loud?
) O o . ;)

Saturday, December 1, 2007

Google Maps and Google Docs

This may be a case of the technology progressing faster than I can learn it, but I read a blog entry months ago about creating customized Google Maps without having a web host or database. The idea is that you can use a Google Docs spreadsheet to "power" the mapping engine.

I have to admit, I couldn't get it to work when I tried it several months ago-- but now that I have taken a class on Ajax and "made peace" with Javascript, I thought I'd come back and take another stab at it. This time, I was able to get it up and running in less than an hour.

The intriguing part is that you can share out Google Docs with others and allow them to collaborate on the spreadsheet document . . . which means other people can add/delete/update locations on your map without even having to know any code. Pretty cool concept, don't you think?

Of course, now that it is possible to collaborate directly in Google Maps, it's all sort of a moot point-- but at least I know I was able to figure it out.

Monday, November 26, 2007

DC gets no respect

London gets written up in GQ as being the coolest (and most expensive) city on the planet.

Paris has wine, women and a cool underworld scene.

What do we get for DC? A story about bagels with a goatse picture.


I know a lot of people mentally equate Washington DC with politics and nothing more, but what would it take for DC to get some cool buzz?

Sunday, November 25, 2007

I hate Javascript

You'd think that a guy who used to write some seriously bitching C programs would have no problems working with Javascript, right? For the life of me, though, I just cannot seem to get a strong handle on it. At first, I thought it was the whole divergent "Document Object Models" in Netscape versus IE. You know, the object you needed to "use" was located under document.window.form.thisandthat.value on one platform, and on the other platform it had a completely diffferent path.

Then I learned about the GetElementByID method, and things got better.

Two nights ago, though, when I was trying to come up with a program that would generate a range of valid candidates for rows or columns in Sudoku, I couldn't manage it. The idea was simple enough-- start with an integer set to 123456789, copy/convert it to a string, run a series of tests/checks on it, if it passes then print it in the list and if not then get rid of it, increment the original integer variable and repeat until you reach 987654321.

I couldn't get Javascript to do the whole integer/string conversion bit with the toString() function. It turns out that toString is a method of an object, not just a stand alone function. So you need to do something like this:

var x = 0;
var xString = toString(x); // WRONG!
var xString = x.toString(); // correct!


So Javascript is kind of objected oriented, but not really. It's more like a language that isn't object oriented and encourages plain old procedural programming style, but if you want to do anything really useful with it, you'll need to learn about and use the objects that are included with it.

I think I understand why people get frustrated when they try to learn English. (sigh)

Saturday, November 24, 2007

DC Examiner Classic Sudoku


Last weekend, I spent waaaay too much time on the DC Examiner's Classic Sudoku puzzle (6 star difficulty). But that was a week ago, and I've been doing a lot of puzzles. I can't be sure, but I think the programming project might also be causing me to have some improvement as well.

I blew through the 5 star Sudoku Pacific rather easily. Then, I turned my attention to the Sudoku Classic puzzle. At about 30 minutes in, I was pretty sure it was another diabolical puzzle. I inked in the numbers I was certain about, and switched to a pencil. I had to choose between a 6 and an 8 at Row 4, Column 5-- wound up choosing the 6 and discovered about 6 minutes later that path resulted in a conflict. At that point, I had to erase everything from the past six minutes worth of work. That was disheartening. I chose the "8 path" at that point, and was rolling along until an hour and 18 minutes had passed-- and that's when I hit a brick wall.

I've never heard of such a thing as a "double diabolical" puzzle, but I found myself once again in the position of being unable to eliminate any of the remaining possibilities on the grid and having to pick one of two pairs. I suppose it is possible that I overlooked something, but in every row and column the number of empty squares and the number of possible values were equal. At this point, I was so mentally exhausted, I stopped for lunch and took a break to watch an episode of "My Name Is Earl" on the DVR.

Then, I came back and took a new stab at the puzzle. Once again, I couldn't find any way to break the chain of possible values down further-- so I inked in the numbers I'd picked once again (no turning back now, right!?) and choose a path to explore. Fortunately, it turned out to be the correct one. Total time spent on the puzzle: 1 hour and 48 minutes.

Now, I need to get some aspirin and lie down. ;)

Friday, November 23, 2007

Sudoku Dictionary

Since I wasn't making headway on the rest of my "Ultimate Sudoku Solver" program, I decided to pursue the idea of creating a Sudoku dictionary that I had mentioned previously. Solving a Sudoku puzzle can be, in a lot of ways, similar to cracking a password-- so why not create a dictionary of all the possible number combinations that can be in a row or column, and then use something like regular expressions to quickly narrow the range of possibilities a bit.

So, I decided to create my Sudoku dictionary. Manually. It wasn't actually as bad as it sounds. It took about three hours, but there were patterns that developed which allowed me to make good use of Find & Replace and Copy & Paste. [It would have taken even less time if I were actually a TextWrangler power user, instead of a tyro.] With each milestone I reached, the progress jumped dramatically. 24 replacements made . . . 720 replacements made. 350KB became 800 KB. By the time I was done, I had a 3.4 MB plain text file that contains all the possible legal values (note: 362880, to be precise) for one row or column in a Sudoku puzzle.

Now, erm . . . where can I post it? LMAO.

My first thought was Google Docs, but it's a bit too large for that as a text file-- or even as a spreadsheet. I'd like to share it with others, much like I've done with the solution checker, but unless I divide it into segments I don't have anywhere I can post it reliably.

Sudoku Solver Progress, cntd.

My plans for "Black Friday" fell through, so I decided to spend some time optimizing and tweaking my Javascript code for my Sudoku solution testing piece. It's considerably smaller, thanks to a pair of for loops. It's also leaner and uses less processing because it doesn't bother to check the columns if it finds a problem in the rows.


// NAME: sudoku.js
// AUTHOR: Jonah Chanticleer
// VERSION: 2007.11.23
// LICENSE: Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License

function checkRows(S) {

var sumOfRow = 0;
var x = 0;

for (x=0; x<9; x++) {
sumOfRow = S[x][0] + S[x][1] + S[x][2] + S[x][3]
+ S[x][4] + S[x][5] + S[x][6] + S[x][7] + S[x][8];
if (sumOfRow != 45) return false;
}

return true;
}

function checkCols(S) {

var sumOfCol = 0;
var x = 0;

for (x=0; x<9; x++)
{
sumOfCol = S[0][x] + S[1][x] + S[2][x] + S[3][x]
+ S[4][x] + S[5][x] + S[6][x] + S[7][x] + S[8][x];
if (sumOfCol != 45) return false;
}

return true;
}

function testSolution(S) {

var valid = false;

valid = checkRows(S);
if (valid == true) valid = checkCols(S);

return valid;
}

Thursday, November 22, 2007

Sudoku Solution Candidate Testing code

As I mentioned in a previous entry, I've created a prototype in Javascript that tests a solution candidate to see whether it is valid or not. It's just the first piece in my "Ultimate Sudoku Solver" programming project-- more code will be necessary, but this is an important piece.

Usage is pretty straightforward, I think. Add this funtion to your web page, then create a two dimensional array (9x9, of course), populate the cells with valid numbers, and pass the array to my function, like so:

testSolution(puzzle);

The function adds up the sums of the nine columns and nine rows. Each result should equal 45. If so, the function returns true. If not, the function returns false. Yes, there is definitely room for improvement-- e.g. make it faster, or return more info about which row or column is "broken"-- but considering it was a quick coding job, I don't think it's too bad.

Since I've wanted to learn more about Creative Commons Licensing, I decided to release this code (see below) under that licensing paradigm.

<!-- NAME: sudoku.js -->
<!-- AUTHOR: Jonah Chanticleer -->
<-- VERSION: 2007.11.22 -->
<!-- LICENSE: Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License -->



function testSolution(S) {
var row1 = 0;
var row2 = 0;
var row3 = 0;
var row4 = 0;
var row5 = 0;
var row6 = 0;
var row7 = 0;
var row8 = 0;
var row9 = 0;
var col1 = 0;
var col2 = 0;
var col3 = 0;
var col4 = 0;
var col5 = 0;
var col6 = 0;
var col7 = 0;
var col8 = 0;
var col9 = 0;



var row1 = S[0][0] + S[0][1] + S[0][2] + S[0][3] + S[0][4] + S[0][5] + S[0][6] + S[0][7] + S[0][8];

if (row1 == 45) { var row2 = S[1][0] + S[1][1] + S[1][2] + S[1][3] +
S[1][4] + S[1][5] + S[1][6] + S[1][7] + S[1][8];
}

if (row2 == 45) { var row3 = S[2][0] + S[2][1] + S[2][2] + S[2][3] +
S[2][4] + S[2][5] + S[2][6] + S[2][7] + S[2][8];
}

if (row3 == 45) { var row4 = S[3][0] + S[3][1] + S[3][2] + S[3][3] +
S[3][4] + S[3][5] + S[3][6] + S[3][7] + S[3][8];
}

if (row4 == 45) { var row5 = S[4][0] + S[4][1] + S[4][2] + S[4][3] +
S[4][4] + S[4][5] + S[4][6] + S[4][7] + S[4][8];
}

if (row5 == 45) { var row6 = S[5][0] + S[5][1] + S[5][2] + S[5][3] +
S[5][4] + S[5][5] + S[5][6] + S[5][7] + S[5][8];
}

if (row6 == 45) { var row7 = S[6][0] + S[6][1] + S[6][2] + S[6][3] +
S[6][4] + S[6][5] + S[6][6] + S[6][7] + S[6][8];
}

if (row7 == 45) { var row8 = S[7][0] + S[7][1] + S[7][2] + S[7][3] +
S[7][4] + S[7][5] + S[7][6] + S[7][7] + S[7][8];
}

if (row8 == 45) { var row9 = S[8][0] + S[8][1] + S[8][2] + S[8][3] +
S[8][4] + S[8][5] + S[8][6] + S[8][7] + S[8][8];
}


if (row9 == 45) { var col1 = S[0][0] + S[1][0] + S[2][0] + S[3][0] + S[4][0] + S[5][0] + S[6][0] + S[7][0] + S[8][0];
}

if (col1 == 45) { var col2 = S[0][1] + S[1][1] + S[2][1] + S[3][1] +
S[4][1] + S[5][1] + S[6][1] + S[7][1] + S[8][1];
}

if (col2 ==45) { var col3 = S[0][2] + S[1][2] + S[2][2] + S[3][2] +
S[4][2] + S[5][2] + S[6][2] + S[7][2] + S[8][2];
}

if (col3==45) { var col4 = S[0][3] + S[1][3] + S[2][3] + S[3][3] +
S[4][3] + S[5][3] + S[6][3] + S[7][3] + S[8][3];
}

if (col4==45) { var col5 = S[0][4] + S[1][4] + S[2][4] + S[3][4] +
S[4][4] + S[5][4] + S[6][4] + S[7][4] + S[8][4];
}

if (col5==45) { var col6 = S[0][5] + S[1][5] + S[2][5] + S[3][5] +
S[4][5] + S[5][5] + S[6][5] + S[7][5] + S[8][5];
}

if (col6==45) { var col7 = S[0][6] + S[1][6] + S[2][6] + S[3][6] +
S[4][6] + S[5][6] + S[6][6] + S[7][6] + S[8][6];
}

if (col7==45) { var col8 = S[0][7] + S[1][7] + S[2][7] + S[3][7] +
S[4][7] + S[5][7] + S[6][7] + S[7][7] + S[8][7];
}

if (col8 == 45) { var col9 = S[0][8] + S[1][8] + S[2][8] + S[3][8] +
S[4][8] + S[5][8] + S[6][8] + S[7][8] + S[8][8];
}

if (col9 ==45) { return true; }
else { return false; }
}

Wednesday, November 21, 2007

Sudoku Solver Progress

Decided to take a tentative stab at creating "the ultimate Sudoku Solving Program" (snort!) tonight. Wound up prototyping a function in Javascript that checks a solution candidate and returns true if it is valid or false if it is not valid. I know, using Javascript for the whole program would be lame, but for quick prototyping one function it wasn't too bad.

I'm actually pleasantly surprised how well it turned out. I pass the function an array, and voila!

It's funny, but the more I think about this, the more I realize I was wrong in my initial assumptions. This happens for me a lot-- I think I understand something, learn more about it and think about what I've learned, only to realize I was wrong and have to revise my understanding. Problem is, I was wrong in that means the program should be even easier/faster because there are fewer possibilities to sort through than I thought.

I originally stated that there were 81 cells with 9 possible variables, and then revised it downwards based on the average number of givens provided in a puzzle to something like 9 to the 53rd power. It's actually less than that.

Each row has to have the numbers 1 through 9, with no repeats. It's not 81 cells with 9 possible variables- it's a subset of that because each row and column must be a combination of the digits 1 through 9*. I have no idea how to represent that mathematically, but I'm pretty sure that brings the number of total possibilities down considerably.

* for example: 123456789, 234567891, 345678912, etc. but never 111111111, 111111112, etc.

Tuesday, November 20, 2007

Using Tidy to keep your web pages valid

Tidy

Use the proper tool for the job.

As a web developer in my second year, I've started advocating web standards at my workplace. It's an enormous undertaking, with over 3 GB of material on an Internet and Intranet site. Some pages were done with Dreamweaver (our currently supported tool), others in Adobe GoLive (our previously supported tool), and the rest in whatever tools someone had available-- Claris Home Page, Netscape Composer, or even text editors and FTP clients.

I've taken advantage of most of my clients being on leave during the Thanksgiving week and started consolidating entire subfolders of web pages over to a Dreamweaver template. But I can't just copy and paste the content into a template and forget it-- I wanted to make sure the page was at least valid Transitional XHTML. The designers can keep their nested tables (for now) if they like, but the pages must run successfully through a validator for me to be happy with them.

So, this is what my work flow has been like:

1) Create a new file and apply the appropriate Dreamweaver template to it.

2) Select the "content" region of the original page, and then copy and paste it into the "content" region of the newly created file.

3) Select all of the HTML from the new page (i.e. the template shell and the content), then copy and paste it into the W3C's validator. (It's an Intranet page, so I can't just point the validator at the URL of the page).

4) Go back and forth in an iterative process between Dreamweaver and the validator's error messages-- fixing what I can understand, and getting closer to that green "This page is valid Transitional XHTML" banner.

This process is time and labor intensive. That may work for a small web site, but when you've got 15,000 pages, you need a fast way to validate and fix broken pages. Otherwise you'll never get the majority of your web pages into a valid state and enjoy the benefits of a standardized web site.

I've been underwhelmed with Dreamweaver's built-in validator. It was time to get serious and take a second look at Tidy. I'd looked at Tidy a long time ago, but never got far with it because the man page seemed impenetrable.

Tidy is a small utility program created by one of the big brains at the W3C. It doesn't just tell you what's wrong with your HTML code-- it tries to fix it. If most of the errors you make in your xHTML code are things like: forgetting to close your unpaired tags (e.g. img, br, hr, etc.) or using deprecated attributes or improperly nested/overlapping tags, then Tidy can clean it up for you.

Is it perfect? No, it doesn't recognize Dreamweaver's non-editable template code, and has made changes in part of the page that are supposed to be off limits. Fortunately, since my templates are already valid HTML, that's not as much of a concern as you'd think. On the plus side, it's sped up Step #4 in my workflow considerably. I run Tidy against the local copy of a file, then FTP it up to the web server. Since Tidy can use standard input and outputs, I bet there's probably some way to script Tidy so it can do batch processing of files.

Monday, November 19, 2007

Sudoku Solver Program Idea

If I keep writing about Sudoku all the time, people will think I'm obsessed. Or boring. I'm not sure which is worse. Obsessed people have some possibility of being freakishly intriguing to a small audience that shares the same interest/hobby. Boring is just . . . well, boring.

I digress.

Tonight, I find myself preoccupied with the idea of creating a computer program that solves Sudoku puzzles-- including diabolicals. I haven't tested every single solver program in existence, obviously, but the ones I have seen don't appear to solve diabolical Sudoku puzzles. At first, this made sense-- the program is applying the various solving techniques (lone number, hidden pairs, etc.) and takes the puzzle as far as it can go with those techniques. Once the techniques stop producing results, the process has no choice but to stop.

But computers aren't humans, and vice versa.

Instead of trying to make the computer mimic human solving techniques and processes, it makes sense to capitalize on the unique strength of the computer's raw computational power. There are 81 cells in a typical Sudoku puzzle, with 9 possible variables in each cell-- that's 9 to the 81st power (or, um . . . 1.96627050476e+77 for those playing along at home). I know that seems like a lot, but with advances in processor speeds, distributed clients, and a smart approach, it isn't completely impossible. Right? Also, don't forget that the values of some of the squares are given at the start (28 given clues in yesterday's diabolical puzzle), so it's more like 9 to the 53 power (aka 3.75710212614e+50).

It's basically a multi-dimensional array, 9 by 9. It helps to think of a series of car tripometers when trying to visualize this-- except each tripometer has nine places, and they are stacked one right above the other. You increment the value of the last cell, and then you perform a series of 18 checksums-- one for each row, and one for each column. If the checksums each add up to 45, then you have a valid sudoku solution. If not, then you know there's at least one number that is wrong, you increment the number again and start over. Humans don't have the speed or patience to pull off such maneuvers-- but computers are fantastic at this sort of thing.

You could do it as a series of 81 nested for loops as well, I suppose, but that'd be crass and ugly. This reminds me of a program I wrote years ago that generated letter combinations for telephone numbers to help people find "vanity" numbers for their phones. Same concept, except you'd be running the process on nine digit numbers instead of seven.

If you really wanted to make it fast, I think you could create a "dictionary" of valid Sudoku puzzles-- in other words, run the program and let it generate all the possible valid combinations of numbers for all possible complete Sudoku puzzles (much like password cracking programs use dictionaries to assist their attacks). Then, all you'd need to do is run a match against the given clues and filter out all the solutions that don't match the values and positions of those clues, and-- voila! -- you have your solution. Of course, storing an array of that size (in RAM or hard drive space) might be problematic.

There must be something wrong in one of my assumptions. It can't possibly be *that* easy, or someone else would have already done it. The total number of possibilities (with 28 provided clues) multiplied by 18 checksum operations is 6.76278382705e+51. Of course, you wouldn't carry out all 18 checksums for every possible combination-- you'd stop running checksums as soon as the first one didn't total 45.

What language would you choose to write something like this in? Jeez, almost every programming language I know is web-oriented these days. That's certainly not too practical for this sort of operation. Maybe it's time I dusted off those old C programming skills and see if I can pull this off.

If anyone's interested in taking a shot at this with me, drop me a line.

Sunday, November 18, 2007

DC Examiner's Diabolical Sudoku Classic Puzzle

Our local newspaper, the DC Examiner, recently began running two Sudoku puzzles each day-- Sudoku Classic and Sudoku Pacific. Generally speaking, the Monday puzzles are easy and the difficulty level progresses through the week. By the time you get to the weekend edition, you are looking at maximum skill level puzzles. I know my Sudoku solving techniques are incomplete, so I've been drilling myself with these puzzles to try to force myself to improve.

I could be mistaken, but I think the folks in charge of the Examiner's "Games!" page decided to throw us a curve ball this weekend by featuring a "diabolical" puzzle for the Sudoku Classic (shown below). It's marked with 6 out of 6 stars, and about two-thirds of the way through working the puzzle, you reach a point where it becomes impossible to eliminate any more possibilities.



You don't see many diabolical Sudoku puzzles in mainstream newspapers these days. (It tends to upset the so-called Sudoku purists who insist that all puzzles must be solved by logic alone and should never involve any guesswork.) There is a technique called "Ariadne's thread", which I have not mastered, that might address such situations-- but let's be honest here, it amounts to picking a cell with only two possible values, choosing one of those values and solving forwards from there until you either encounter a conflict or solve the puzzle. If you do find a conflict, you erase your way "backwards" to the point before you picked that value, and then you select the other option and progress forwards. Using a photo copier or different colored pencils makes this process much easier.

Saturday, November 17, 2007

This entry sucks (literally)

Small double sided suction cups!

Small double sided suction cups!

Small DOUBLE SIDED suction cups!

(Hmm. That's odd-- when Bill Griffith does that, it's hysterical.)

Christmas music . . . already?

I'm lying in bed in my townhouse-- and my next door neighbors are playing "Rudolph the red nosed reindeer" so loud that I can hear it through my wall. (They're great people, really-- but they've got to be stone deaf.)

Isn't there some rule about playing Christmas songs before Thanksgiving has happened? You know, like no white shoes before Easter? ;)

I guess I shouldn't be surprised. After all, the department stores practically do everthing they can to blur the October-December time frame into a monolithic consumer orgy: HalloGivinMas.

Thursday, November 15, 2007

Effective, meaningful page titles are hard, but essential

It is difficult to create effective, meaningful titles for web pages or blog entries.

We've all been guilty at some point of writing the "clever" title-- you know, the play on words or rhyming. The problem with that approach is we're so busy trying to seem clever that we do a less than adequate job of communicating to our readers what the article is really about. "Oh, but you want the reader to be a little mystified . . . it draws them in to read the rest of the entry."

Really? Interesting theory. Let's put it to the test.

Let's say that someone performs a Google search and one of your entries appears in the results. People don't read every single word of all the results that were returned-- they scan the titles of the results to find the best match for the mental concept they had in mind when they performed the search. If they see your entry with a "clever" title they have to "decode" and another entry that has a "boring, but very clear" title, which link are they more likely to pick first?

News websites, such as the DC Examiner, understand this-- and they seem to spend an enormous amount of effort revising their titles over several days. Just take a look at their RSS feeds, and you can see multiple copies of the same article under permutations of the same basic title. (I really wish their RSS feed would treat revisions of the same story as one entry instead of separate entries amongst themselves-- but that's a blog entry for another day!)

Monday, November 12, 2007

Doing it right, versus just doing it

This entry is probably going to be a train wreck. Consider yourself warned.

I've got a million half-baked ideas in my head that seem to interconnect, and it seems important to get them out on "paper" somehow-- but I'll be darned if I have any idea where to start, or how to go about accomplishing this. Pretty ironic, considering my BA in English, huh?

Worse yet, even if I do make a decent effort, someone will stumble across this entry and interpret it in a way that I never intended it. They might get offended, or have hurt feelings, or something I can't even anticipate. The odds of it coming out right, being understood, helping another person, etc. are tiny. The smart thing is to quit before I even get started.

Good thing I'm stupid about these kind of things then, eh? ;)

Here's the deal-- I am the product (or victim!? Ha ha!) of a liberal arts education. I see connections between all sort of different academic disciplines. A change or discovery in one area of human knowledge creates ripples in other areas of life. This can actually be a good thing, because some times you can take what you know about in one area-- like economics, for instance-- and apply it to other situations in your life entirely, like nutrition. Yeah, I know, it's a stretch to see it if you weren't indoctrinated in the liberal arts tradition and prefer the traditional Western thought of dissecting something into its component pieces and studying them in a vacuum.

I'm not saying that you have to see things the way I do in order to understand this post or to get along with me-- I'm just letting you know where my head is at and what perspective I'm coming from as I write this entry.

I'm in the very early stages of what looks like will become a massive home improvement project. This is the planning and studying stage, I guess you'd say. I feel woefully unprepared for this task, and trying to enlist professional help seems to be almost as frustrating and pointless as doing the work myself. There's just so much to be done, and the amount of time and money is going to be staggering.

There is one lesson I've managed to pick up though-- it's not enough to do the work; it has to be done in a specific sequence. For instance, add any new electrical work before you upgrade your insulation. Again, it's a lame and obvious example-- but what did you expect? I'm not a contractor; I'm an amateur who's in desperate need of an architect/contractor/designer and son on.

If this simple fact (i.e. doing the right tasks in the right sequence) translates from home improvement to-- well, to the way in which we choose to run our lives-- then it's hard not to become one of these neurotic and obsessed "efficiency experts." I don't want to be that guy who argues about whether it's "better" to button your shirt from the top button down, or the bottom button up. The potential ROI for such a small change makes it almost worthless to even contemplate.

However, it does bring a character flaw of human nature to light. We tend to want "to do everything" now. We're like little kids-- we want to be cowboys AND astronauts AND railroad engineers AND firemen, all at the same time. We lack the discipline to focus on one thing and invest the time, energy and technique/craftsmanship in it to get the best results. We spread ourselves way too thin and then wonder why we are getting such average or even piss poor results.

Modern day society doesn't exactly make it any easier, either. There's so much competition for our attention now, it takes a super-human amount of will power (or a convenient electrical blackout!) not to get sidetracked. I suspect that in the not-to-distant future, there will be a place of business where people go to "unplug from the grid" and isolate themselves from all possible distractions.

Sunday, November 11, 2007

Seth Godin suggests an internal blog

Internal blogs are a good idea, but I'd never set it up on the Internet-- even with a password.

Seth Godin suggests that it's a perfect time for people to start an internal blog. The idea being that it is like a daily diary, so you can look back at how you dealt with day to day issues. I think it's a good idea, but since many of the issues I seem to deal with are the personality quirks and technological ignorance of my "clients", I can see this diary becoming a nightmare if it became public somehow (e.g. FOIA request, legal action, successful hacker incursion, etc.)

If you decide to take Seth up on his advice, you might want to consider using Wiki on a Stick instead. Go on, you've been wondering what to do with that cheap, promotional 128 MB USB thumbdrive you got from that conference/demo/Halloween party, anyway.

Friday, November 9, 2007

I am obsessing over SMS and data

If you start sending and receiving text messages on your cell phone, look into getting a plan.

Before I got my basic media plan ($10 a month for 400 messages and 1 MB data), I paid 10 cents a message. As long as I stayed under 100 messages a month, it was cheaper not to get the plan. Problem is, once you start text messaging, it grows on you real quick.

Maybe you start off with some information service, like Air Quality SMS. One of your friends sees you doing SMS, and they figure out how to do it themselves and you wind up trading messages once or twice a day. Don't forget television programs that allow you to vote via SMS (usually at an extra charge, I might add). Then you discover you can microblog with Twitter or receive automated alerts from Google-- and it's over.

So, like any data obsessive geek, I'm reviewing my SMS stats for the past seven months-- to reassure myself that I'm really saving money with this plan. Or, is this another resource going to waste like my "rollover minutes." Four of the seven months I've sent more than 100 messages, but three of those seven months are in the mid to high 90s. I do the math and wind up figuring out I've saved something like $12.50. Not bad, but far from a stunning and compelling amount. Of course, when I factor in the fact that I've been using my cell phone for web page testing and learning about creating web pages for portable devices, I can't really figure out an easy way to attach a dollar amount to that.

Is it possible to "get more/do better" with SMS than I am now? For example, if there were a service that sent me a text message once a day with-- I don't know, let's say the Dow Jones/Nasdaq closing prices-- I'd be more in tune with what the stock market is doing, and I'd only wind up using 31 messages a month to do it. Or maybe I could set up something on my work computer to notify me when there's a problem or outage? No, bad idea-- I'd definitely wind up over 400 messages in a month then, considering how often there are issues.

Still, it's worth pondering. Can I use my SMS texts in a smarter way than I am now?

Thursday, November 8, 2007

Now THAT'S a workout!

Decided to change things up a bit by skipping my cardio this morning and doing it this evening instead. What a difference!

I went further, in less time, and burned more calories doing it. To be honest, work today was frustrating and pointless, so I think I took some of my frustrations out in the cardio workout.

Wednesday, November 7, 2007

Twitter, micro-blogging, etc.

Yeah, I could have written about Day 4 of my DST fitness plan, but let's be honest-- it gets old real quick and no one cares about my workout routine THAT much.

Let's talk about twitter instead. I don't really *get* twitter. I know lots of people use it, and I use it myself half-heartedly. But I don't understand the widespread appeal of it.

I mean, I remember reading just a few short years ago a parody of a blogger who obsessively blogged every little detail of his life.

9:53 AM

Lost my pencil.

9:55 AM

Found my pencil.

10:02 AM

I sneezed.

We used to ridicule people who had blogs like that, you know? Now, it seems as if Twitter and other microblogging platforms are "social networking" tools. For instance, I can say "going to open mic night at Firehouse Grill in Fairfax"-- and everyone who follows my twitter feed will see where I'm headed and has the option of joining me there. (Yes, this assumes that I actually have people who follow my Twitter feed and that they are local, but you get the idea.)

When did "microblogging" suddenly grow up and become the cool kid on the block? Where are the people who once mocked microblogging now? Has their opinion changed any in light of recent events?

And, most importantly, will I ever find a way to add comments or trackbacks to my blog in a way that doesn't create invalid HTML?

Tuesday, November 6, 2007

Day 3 of my DST opportunity

Got up at 5:30 AM again. The act of getting up and out of bed has been surprisingly easy for me, so far. I guess my circadian rhythms are still on the old pattern at this point, so my body's "ready" to wake up by the time my cell phone alarm sounds.

I did make one small change in the routine, and it sort of bombed. I'd been popping DVDs into my iBook, figuring I could get through my Netflix queue while I got in my cardio. But, since I'd finished "Wordplay", my next movie would have been that old Tarantino classic "Reservoir Dogs"-- and that's just a little too much to take at 5:30 in the AM!

So, I decided to switch to podcasts instead. I figured I had a huge backlog of those to get through anyway, so it'd be a helpful switch. Here's the weird part-- I can watch/listen to a DVD while I'm working out, no problem. But, when I try to listen to a podcast, the audio gets drowned out by the noise of the XL Glider. It's the same iBook, same volume level-- you'd think it would work, but it doesn't. All I can figure is that it must have something to do with the audio quality of the podcast itself.

So, unless I find some way to boost the audio on the podcasts, I won't be listening to those when I work out in the near future.

I did manage to get my 20+ minutes of cardio workout accomplished. Today was particularly challenging because I had to arrive an hour early at work for our fall conference, but I still managed to get my work out in. I just hope I can stick with this habit long enough to derive some long term health benefits from it. I think Saturday morning will be the real test, of course.

Monday, November 5, 2007

Taking advantage of DST opportunity, Day 2

Got up at 5:30, popped the Wordplay DVD into the iBook and hopped on the XL Glider for 24 minutes of cardio. Still not living up to my old pace, but it was a definite and noticable improvement over yesterday's pace. I managed to finish my workout and the DVD at the same time even, so I dropped the Netflix envelope into the mailbox on my way to work this morning.

I can't say that exercising for two days has made a quantum difference-- I'm not jumping over tall buildings or picking up small cars, but I do seem to have a little more energy and mental focus today. Amazing what a good night's sleep and a little bit of cardio can do for your frame of mind, isn't it?

I just hope that I'm smart enough/have enough common sense to keep this habit up.

Sunday, November 4, 2007

Is quality the first casualty in a flat world?

I just took my brand new sheets out of the dryer, and roughly six inches along one of the edges has begun to fray. It's been through the washer/dryer cycle twice, and it's now falling apart. The problem is that the stitching that was done on one of the edges was a single stitch-- and the thread has broken.

$80 sheets, and they start to come apart in less than two weeks!?

"Made exclusively by Zorlu for BED BATH & BEYOND

Made in Turkey"

You figure it out.

Javascripts work better when you remember to include them

I have no delusions of grandeur when it comes to my website traffic. When the number of automated webcrawler bots outnumbers visitors who actually require oxygen in order to survive, you get a pretty clear picture of how unimportant you are in the grand scheme of things. ;)

But I knew something was wrong when I pulled up my Google Analytics and I have zero visitors for the entire month of October. Heck, I visit my blog at least once a week, and I didn't set up any filter to ignore my visits!

It turns out, with all the template revising-- trying to get the page into valid HTML shape and all-- I wound up removing the piece of Javascript that Google Analytics uses to gather site visitor data! LMAO!

I'm such a numbnutz sometimes, honestly. Needless to say, I've restored the code now.

Day 1, my DST plan

As I mentioned previously, I planned on using the "fall back an hour" to jump start my fitness regimen again. Ironically enough, my body's circadian rhythms are so strong that I woke up at my regular time (i.e. an hour early instead of 30 minutes early.)

I popped a DVD (Patrick Creadon's "Wordplay") into my iBook and managed to get in 24 minutes of cardio on my XL glider. I'm not achieving the distance or calorie burn that I used to, but to fair I've been away from it for almost a year, so I know it's going to take time to build back up to it.

Let's see if I can make Day 2 as successful.

Saturday, November 3, 2007

The opportunity of DST change

This is the weekend when we turn our clocks back one hour. I always find this whole custom amusing, because it points out how artificial and arbitrary the human construction of time is. Think about it:

Q: What time is it?

A: It is 1:59 AM and 50 seconds . . .

(long pause)

Q: What time is it now?

A: It is 1 AM.

Q: But that's not possible. You just said . . .

A: It is 1 AM and 10 seconds.

Q: How . . . ?

A: Because I said it is.

And, when you sit down and think about it, it's not just the time-- it's everything. The months of the year, for example-- the tenth month of the year is called OCTOber?! That's when you realize that the name and the position in the sequence are completely irrelevant! The month it was "created" and named in honor of an ancient Roman emporer. And the days of the week? Norse Gods. Norse Gods!? Go on, pull the other one while you're down there.

Time, in the sense that we as human beings know and understand it, is an artificial construct. It is arbitrary and a matter of convenience, so we can all agree to meet for lunch at some point in the future and have a halfway decent of arriving at the restaurant at the same time.

(There is, I should mention, another sense of the passage of time-- the Earth doesn't care about days of the week, or months of the year. It's all cycles and processes. Cycles within cycles, actually.)

But, I digress . . . the topic of this post is about opportunity. Specifically, what can you do with the "extra" (snort!) hour this weekend?! I'm planning on using it to jump start my new fitness regimen for the winter months.

I need to get in the habit of doing at least 20 minutes of cardio each day, preferably before breakfast. Of course, that means getting up earlier than I already do-- a thought that immediately puts a damper on any enthusiasm I might have for the task.

However, if I set my alarm clock to go off 30 minutes early when I go to bed tonight-- after I've already turned it back an hour, that is-- I'm actually getting up 30 minutes later than I would have been when I really started! And there wasn't even any time travel or British accents involved! :)

Then I leave the clock set for 30 minutes ahead of my customary time from here on in, and let the habit entrench itself for the next month.

Friday, November 2, 2007

Linux + iPod and DJ mixing

You know, I've never done any DJing in my life, but when I read about this little gadget the other day, I was tempted to order one and give it a spin. ;)

Wednesday, October 31, 2007

All I want for Christmas is . . .

Gift cards.

I'm telling you, this year it's gonna be gift cards, period.

Every year, I go through the same nonsense with about half a dozen people. They ask me what I want for Christmas. Then there's the whole ridiculous back and forth-- I tell them there's nothing really that I need urgently, they nag me for a list. I give them a list, and they lose it or don't understand how to go about getting it (some of these people just aren't online kind of people, ok?!) and the next thing I know I wind up with a pair of bedroom slippers that resemble elephants . . . that is, if elephants had gray fur and black, beady, rat-like eyes.

It's even worse in reverse. I get a list, do my research with the consumer review websites to get the best model and deal, bust my ass to get people what they told me they want . . . and some of the gifts never get used.

Sigh. It's enough to make me convert to Judiasm some times. Or Jehovah's witness maybe.

So, this year, I'm going to insist on Borders gift cards only. They are only about as ubiquitous as Starbucks, so even the "I don't do online" crowd should be able to get them. End of discussion.

Monday, October 29, 2007

What does it take to get a good night's sleep?

I've got the new bed. I've got the new pillow. I've even got the new sheets.

And I've got a crazy neighbor who apparently likes to rake up leaves at 4:30 in the AM.

Who rakes leaves at 4:30 in the morning? How can you even see to rake leaves at 4:30 in the morning? I thought about going outside to see which one of my neighbors it was, but it dawned on me, someone who is capable of raking leaves at 4:30 in the morning is quite capable of all kinds of crazy.

Wednesday, October 24, 2007

Don't complain; we need the rain

It's been raining for most of the day. Considering that we've been in a nasty drought, this is a good thing. Still, I can't help but feel that the weather is having an impact on my mood.

Or maybe it's the fact that I get invited to meetings, asked for my input, and then am completely ignored?

Or maybe it's the fact that my neighbor promised he would clean up that oil he spilled weeks ago, but never got around to it-- so I've just tracked motor oil into my house and on my carpet?

It's time to focus on the positive.

(crickets chirping)

Um . . . I managed to get ColdFusion communicating with the mySQL server on my iBook finally.

(crickets stop for a moment, resume chirping)

I added alternate stylesheets from the W3C site to this blog, along with some Javascript "style switcher" code, and my blog still validates as XHTML 1.0 Transitional. (I'm hoping I can use the alternate stylesheets as a demonstration to some of my co-workers to persuade them of the benefits of non-presentational HTML and CSS).

(crickets jump away, laughing)

Just keep reminding myself: "We need the rain."

Perfectionism (or "In the land of the blind, the one-eyed man is king")

Recently, one of my friends called me a perfectionist.

(Relax, I wasn't offended-- I just didn't have anything worthwhile enough with which to reply.)

I don't consider myself a perfectionist. I'm sure all my co-workers are probably rolling their eyes and laughing hysterically right now. But seriously, I'm not a perfectionist. I make too many errors and am too prolific at work to be a perfectionist.

I do, however, think that you should make a real honest effort to do things properly as much as humanly possible. In certain fields, like web developing, this isn't an unreasonable expectation. There are tools you can run on your web pages to make sure the code is valid.

It's not my fault if no one else in my area bothers to run their code through a validator-- or still uses nested tables to control their layouts because they can't be bothered to learn about div tags and CSS.

Sunday, October 21, 2007

Closed Captioning brought to you by . . .

Ever since I got my DVR, I've become a big fan of BBC America. Doctor Who, Torchwood, etc. What's not to like? The problem is that sometimes I don't quite catch all the words-- after all, they are speaking British. ;)

The BBC America PSA's suggest, in a way that is both helpful and cheeky, using closed caption to help decode the various dialects and accents. It sounds so simple, doesn't it? Invoke the closed caption option on my TV, leaving the audio on, and all's well.

Except, ever since I had to redo the connection between my TV, DVD player and the DVR unit, I've never been able to get the closed captioning on my television to work properly. I think part of the problem is that I've got the audio portion of things routed through my DVD player's Dolby 5.1 speaker system rather than through the TV-- and the other part is that you need to be able to drill down in the TV menu settings to toggle the caption feature, but the "universal" remote doesn't seem to let me get into the TV menu. Or, if it does, I haven't found out how to do it with this particular remote.

The good news is that I have found a pretty slick workaround. One of the caption options on my television is "Activate CC w Mute"-- in other words, whenever the TV gets muted, the closed captioning comes on. There is actually a mute button on my universal remote, and that does "talk" to the TV set. It doesn't actually do anything, because remember that the sound is channeled through my DVD player now. So, now, whenever I hit the mute button on my universal remote, I get closed captioning.

Not too shabby, I guess. Although I have to admit it is a rather a clumsy workaround in terms of the label being misleading and all.

Saturday, October 20, 2007

AJAX? It's complete

Just finished my first real AJAX app. I can't exactly link to it because it's all contained on my iBook, unfortunately. This is the first real exercise I've done after the class, because I'm trying to reinforce what I've picked up.

There's plenty of room for improvement, obviously, but it's at least a fully functional AJAX app and it works! :)

Part of me wants to go out and celebrate this accomplishment- and the other 99% of me wants to crawl under the sheets and go to sleep.

G'night all.

Everything you "need" to know to create Web 2.0 web sites

I'm sitting here, reviewing in my head all the different pieces and parts of technology that I've used to put together my little Ajax application.
  1. mySQL database (to store and manage the data)
  2. Structured Query Language (to get info out of the database)
  3. Apache (the web server program that responds to client requests for pages)
  4. Mac OS X (or OS for the computer running the database, web server, etc.)
  5. php (so the web server and database can talk to each other)
  6. HTML & CSS (the skeleton of the web page that folks see in their browsers)
  7. Javascript (for the dynamic interaction of AJAX)
That's a long list! Granted, I'm not saying you have to be entirely fluent with every single feature of every piece of technology on that list-- some folks would argue that by getting a proper web host that you can scratch some items, like items 1, 3 and 4, off your list entirely.
However, I believe you'll want a basic sense of familiarity so you can troubleshoot when things are not working properly or get better results when calling your web host for technical support.

AJAX, c'ntd.

Since I spent all of Wed. and Thurs. evenings working on my little Ajax problem, I decided I was going to take the night off and go out for a bit. Naturally, this is when it decided to rain. It didn't just rain, though-- it rained sideways because of the heavy winds.

So, I wound up staying home and eventually got back to the ajax project. The back end piece is all done. I've got the mySQL database set up, with a lame little database table of red wines and associated info in it. I've got php talking to it, so my little web app can query the database and show results. It even sends the results back in XML.

Now that the back end is complete, it was time to focus on the client side of things. I'd been reading good things about some of the extra features of AJAX frameworks (e.g. Prototype and Dojo), so rather than go with the bare bones implementation of AJAX code I got from the class, I decided to download and use the Prototype framework instead. Nothing against Dojo, it's just that more third party tools seemed to use Prototype than Dojo, such as OpenRico.

"Installing" Prototype on my web page (more like including it, actually) was pretty straightforward and easy. I had to modify my thinking a bit from what I learned and did in the actual class (e.g. creating the object "up front" and then passing info along at a later point), but I wound up being able to send my request via Javascript in the background, getting an XML response, and then displaying it in a Javascript alert on the client. I still need to write some Javascript (wines.js) to handle the unique code for this application, but I'm almost done with it. Of course, I've saved the most difficult (for me, that is) part for last-- using Javascript to manipulate the web browser's Document Object Model, aka DOM, for short.

I've always hated working with the DOM. I think a lot of my frustration has been that different browsers had different models, and you had to check each one you looked at to figure out how to work it properly. The good news is that the models have moved closer to being standard, and with the getElementById function in Javascript I no longer have to worry as much about where in the tree a particular element lies.

Friday, October 19, 2007

Is It AJAX yet?

Yes, the AJAX saga continues. ;)

I'd spent the majority of Wednesday night getting php to talk to mySQL, so last night I'd finally get to work on my AJAX material. Or so I thought.

My approach was going to be:
  1. start off with a simple php application (a search form page and a results page).
  2. convert simple php application into an AJAX version.
Turns out, simple is a relative term. I'm tempted to make some generalized statement like, "PHP is harder than ColdFusion," except I think it's more of a case of what one is already familiar with versus working in unknown territory.

It took all night, but I finally have a simple php application. The first page has a drop down list of various red wines-- dynamically generated from a query in my database, thank you very much. The user selects one of the wines from the drop down list and hits the submit button, and then they are taken to the "results" page where they can see all the relevant info about the wine they've chosen (temperature, body, taste, etc.)

This morning, I just happened to wake up early and I decided to take a stab at converting the app over to AJAX. I wound up saving copies of my pages before I did any work, just in case I screwed up something. I managed to strip the HTML out of the results page, and converted it so it returns only the bare minimum response in valid XML. I'm on my way-- but, of course, the alarm clock just went off, so I've run out of time to work on this for now.

It's not the darn AJAX itself that's taking so long, it's all the prep work leading up to working on it. It's mildly frustrating, but I guess I'm learning some things out of this.