Friday, October 31, 2008

Two Questions I Wish Larry Had Asked

Larry King has an interview out with John McCain. Watching the clips and reading through the transcripts, I would have loved to have heard McCain explain just a couple of his statements.

Anyone want to venture a guess as to what McCain is thinking? What questions would you love to have Barack Obama answer?

Question 1

KING: Did you think your vice presidential nominee would be as controversial as she is?

MCCAIN: You know, I didn't think she would be so controversial. But, I got to tell you, every time I'm around her, I'm uplifted. This is a solid, dedicated reformer. A fine governor. The most popular governor in America. She ignites crowds in a way that -- I got to be honest with you -- and I'm not a immodest person. But, I haven't seen a candidate ignite people the way that Sarah Palin has.
I love her family. And it's just been a great joy for me to be -- to have her with me.

I get this. And believe, it's pretty clear now that both Republicans and Democrats got huge boosts this election by including some non-traditional choices on the ticket. But here's my question: Didn't you spend months, and months, and months, hammering away at Barack Obama for being a super star who's primary quality was that he could bring a crowd? Aren't you now saying that you like Sarah Palin for this exact reason? This seems like a significant contradiction; please explain.

Question 2

KING: Concerning spreading the wealth, isn't the graduated income tax spreading the wealth? If you and I paid more so that Jimmy can get some for him, or pay for a welfare recipient, that's spreading the wealth.

MCCAIN: Well, that's spreading the wealth in the respect that we do have a graduated income tax. That's a far cry from taking from one group of Americans and giving to another. I mean, that's dramatically different.

Sen. Obama clearly has talked about for years, redistributive policies. And that's not the way we create wealth in America. That's not the way we grow our economy. That's not the way we create jobs.

And when small business people see that half of their income, half of the income of small businesses is going to be taxed by Sen, Obama, then they're very upset with it.

I'm pleased to see here that both Obama and McCain are on the same page - our tax system is setup to spread the wealth around. That's just how it works. Can you give me specifics how Obama plans to: "[take]from one group of Americans and giving to another. I mean, that's dramatically different."

Is this "redistributive" logic in his economic plans? Or, has he left it out of the plans, and he's effectively (a) lying to the country about this to get elected and (b) plans to pull a bait and switch when he gets into office?

This is a serious accusation to make, what specifics can you provide back this up?

Thanks,
Ben the Programmer

Say Something Nice

I love this article on CNN.com. They went around to ardent supports of McCain and Obama and got them to say something nice about the one they aren't voting for.

With all the mud that's being slung, it's nice to take a breath and remember that both candidates are remarkable men.

Thursday, October 30, 2008

Surprise Date Night

Tonight I surprised Shira and myself by getting tickets and attending the 2008 Gymnastics Superstars show. Shira's always been a huge fan of watching gymnastics, and I figured the opportunity to see some of the medalists from this most recent Olympics was too good an opportunity to pass up. I even managed to keep the plans a secret for all of 8 hours, so she didn't quite know what I had in mind tonight.

You might wonder who attends such an event. Well, imagine the Verizon Center, about 1/3 full, mostly consisting of moms and their 8-12 year old daughters. There was the occasional family, but you could see the husband and little brother were mostly along for the ride. This especially made sense when we learned that the entertainment was a recently signed Disney Band.

As for the show itself, I'd break it down like so: 10% Disney concert, 30% gymnastics, 15% circus-like acrobatics and the remaining 45% a gymnastic-themed Chippendales show.

I'm telling you, if the Olympics allowed the men to compete with their shirts off, women would finally have a sport to oggle while the men were watching beach volleyball. Below are some photos. I apologize for the number of shirtless men in them. Shira played photo editor, as you can see.

The show was an awful lot of fun, the tricks were great, and I'd highly recommend it.

Here are some of the gymnasts coming in... look, there were women here!

And here is the 2008 Bronze Medal Winning U.S. Men's Gymanstics Olympic Team

These are the Hamm brothers and Blaine Wilson

The men borrowing one of my moves

Stay tuned for more photos from Shira. Yes, Nastia Liukin and Shawn Johnson were supposedly the stars of the event, but we just didn't get any good photos...

Sign Language Distractions

I'm really excited to be starting a brand new project that's dedicated to helping deaf students, and parents of deaf students improve their communication skills. Check out the coming soon page that's up.

Apparently, the statistics are staggering when it comes to the number of parents who can sign with their deaf children - the number is awfully small. And this site plans to do something about it.

As I'm starting to build out the site, I naturally need to find some place holder content. And while I place holder text is easy to come by, I always enjoy digging up some place holder video from YouTube and the like.

Here are some fun clips I found today. The first one, I found more memorizing than anything else. The second one is just down right hilarious.


What a joy it is to get to work on projects like these.

Wednesday, October 29, 2008

This Power Outage Is Right On Time

They say there's never a power outage around when you need one. But the
one that just happened (and ironically was fixed as I started typing
this) was timed perfectly.

All of a sudden, all the distractions of e-mail, Facebook, The Daily
Show, and Web in general were off. All I had was my laptop and the
ability to write code. It was perfect.

Alas, power's now on and I have to immerse myself back into the world of
distractions. But for a few moments - there was real quiet around
here.

Oh, and luckily I wasn't really cut off from the world - with my cell
phone I could still google the usage of the "abbr" tag, set my Facebook
status, and yes, Blog.

I wonder if a daily power outage would be a good practice to institute?

--Ben

Cool Postfix Feature: recipient_bcc_maps

A client of mine had a request for all incoming e-mail to be both delivered to the recipients and copied to another e-mail of his choosing. He wanted this to keep a pulse on the e-mail traffic coming in to various accounts.

My first instinct was that this was going to require some tricky aliasing hackery. But, it turns out, postfix makes this really easy. It's all described in this article:

The idea here is that any email that is caught by Postfix and matches either a sender or recipient address is bcc'd to another account,

It works by setting up a config file with the people to apply this to:

 # recipient_bcc map
 mike  dave
 sarah dave
 greg  dave

Then, add the following setting to your postfix main.cf:

 recipient_bcc_maps = hash:/etc/postfix/recipient_bcc

See the article for complete details to get this working.

Now, any mail for mike will be sent to him, and silently sent to dave.

This does exactly what my client wants. You could also use this setting to archive all sent mail by setting sender_bcc_maps. This might be a good way to archive messages offsite.

I have to say, I'm more and more impressed by postfix's capabilities.

Instructions For Configuring Outlook To Talk To Postfix

Rimuhosting has a nice HOW TO for setting up E-mail on their servers. It includes a quick 7 step overview, along with more details. This how to isn't specific to rimuhosting per se - it should work with most any server that runs postfix/dovecot.

When I completed the steps, I had working e-mail, which is great. But, what I didn't have were a set of instructions to tell Outlook users how to access their e-mail. Here's my attempt to do this.

There's almost certainly a better tutorial out there than this, but, I figured this is better than nothing:

  For this example, we assume the following:
    name: Joe Smith
    e-mail address: joe@superserver.com
    password: abc123

  Given the above e-mail address we 
  know that our username is:  
  joe   (without the @superserver.com)

 Open up outlook
 Go to: Tools >> Account Settings
 Click "New..."
 Select "Microsoft Exchange, POP3, IMAP or HTTP"
 Select "Manually configure server settings or additional server types"
 Select "Internet E-mail"
 Fill in:
   Your Name: Joe Smith
   E-mail Address: joe@superserver.com
   Account Type: POP3
   Incoming Mail Server: mail.superserver.com
   Outoging mail server: mail.superserver.com
   User Name: joe
   Password: abc123
 Click "more Settings..."
 Click "Outgoing Server"
 Check "My outgoing server (SMTP) requires authentication"
 Select "Use same settings as my incoming mail server"
 Click "Test Account Settings..."

Tuesday, October 28, 2008

Wordpress Serendipity - Helpful Resources

These last few days I've done a whole bunch of WordPress work. And, for the most part, I'm really enjoying it. I've been really impressed with how far you can push WordPress, even making it a e-commerce platform.

Without even searching, here are a few handy WordPress resources that have fallen into my lap:

  • Revolution Theme's - these are clean, professional themes, which really showcase some of WordPress' CMS capabilities. They aren't free, but they are really affordable.
  • WordPress How Tos - Here's a collection of WordPress How Tos. Many of them have an emphasis of using WordPress for a website and not just for blogging.
  • Addicott Web's Plug In Recommendation's - I'm subscribed to Adicott Web's newsletter, and just today I got this handy list of recommended plug ins. Some I had heard of, some I hadn't. All great stuff.

Politically Jumping The Shark

I'd like to propose some new political terminology. It's not misspeaking and it's not gaffing: it's Politically Jumping The Shark.

Here's how it works:

  1. Say something truthful and juicy to your supporters (i.e., Obama knows Bill Ayres)
  2. Get positive feedback from your supporters that this is both a great line of thinking and that there's more to the story
  3. Step it up a notch, using a bit more explicit rhetoric (i.e., Obama had a serious relationship with Bill Ayres)
  4. Repeat until you say something absurd (i.e., Obama "pals around with terrorists"). At this point, you haveofficially Jumped The Shark.

Take this most recent example. McCain and Palin have been hammering Obama on his tax plan (and he's been hammering right back). That's mostly good news. Then Obama mentions spreading the wealth around and Palin had her opening to hint that Obama is suggesting socialism. Then, the next day, she outright calls his policies socialist:

"Senator Obama said he wants to quote 'spread the wealth.' What that means is he wants government to take your money and dole it out however a politician sees fit," Palin said, drawing boos from the crowd of several thousand.
...
Friends, now is no time to experiment with socialism.

A couple days later, Palin officially jumps the shark on this issue with this gem from a speech yesterday:

"See, under a big government, more tax agenda, what you thought was yours would really start belonging to somebody else, to everybody else. If you thought your income, your property, your inventory, your investments were, were yours, they would really collectively belong to everybody. Obama, Barack Obama has an ideological commitment to higher taxes, and I say this based on his record... Higher taxes, more government, misusing the power to tax leads to government moving into the role of some believing that government then has to take care of us. And government kind of moving into the role as the other half of our family, making decisions for us. Now, they do this in other countries where the people are not free. Let us fight for what is right. John McCain and I, we will put our trust in you."

Somehow we've gone from Obama wants to raise your taxes when the economy is bad to Obama wants to create a brutal communist state, where you aren't free.

I think it's pretty clear that there's a feedback looping going on here between Palin and her closest supporters. I think for any political, heck any leader, this is really dangerous.

Two reasons come to mind why this is such a mistake: (a) at some point, you're simply no longer telling the truth, and we'd pretty much like our leaders not to lie to us. (b) When you start spewing out this crazy talk, your closest supporters will love it, but what about the rest of the world? Heck, what about your thinking supporters? How can you not look silly going to such extremes.

Monday, October 27, 2008

Measuring Linux Memory Allocation

I've been trying to understand why one of my Linux servers keeps getting out of memory errors. While Googling around, I found this useful article which talks about measuring Linux memory usage.

It sums up the problem like so:

The moral of this story is that process memory usage on Linux is a complex matter; you can't just run ps and know what is going on. This is especially true when you deal with programs that create a lot of identical children processes, like Apache. ps might report that each Apache process uses 10 megabytes of memory, when the reality might be that the marginal cost of each Apache process is 1 megabyte of memory.

Although the problem of measuring memory on Linux is tricky, the article does give quite a bit of explanation and even introduced me to a new tool - pmap. It's a good place to start for understanding what makes your system go.

Update: Want to see the current top 10 processes that have the largest resident set size? Just run:

 ps -e -o user,pid,%cpu,%mem,rss,cmd --sort=-rss | head

Sunday, October 26, 2008

Twitter For Terrorists - Missing The Point

This is just too much for me not to comment on. The US Intelligence community is concerned that terrorists may be using Twitter to plan attacks. I'm so not making this up:

The U.S. intelligence community is concerned that terrorists might use micro-blogging tool Twitter to coordinate attacks, according to a purported draft Army intelligence report posted on the Web.

The report--present by the 304th Military Intelligence Battalion and posted to the Federation of the American Scientists Web site--examines the possible ways terrorists could use mobile and Web technologies such as the Global Positioning System, digital maps, and Twitter mashups to plan and execute terrorist attacks.

The report goes on to list at least 3 scenarios in which you could use Twitter in an attacking scheme.

OK, I suppose this is possible. But here's the thing - Twitter is all public*. If there's one service in the world you'd want Terrorists to use, it's Twitter. There's no need to get any warrants or crack any encryption. I mean, a public stream of searchable data - this has to be an analyst's dream.

It's when the terrorists figure out PGP that you've got a problem.

Oh, and I love the quote:

"Twitter has also become a social activism tool for socialists, human rights groups, communists, vegetarians, anarchists, religious communities, atheists, political enthusiasts, hacktivists and others to communicate with each other and to send messages to broader audiences," the report said.

Lord knows, if my shul is using Twitter, or worse yet, vegetarians are - then you know terrorists can't be far behind.

* - OK, the service isn't entirely public. You can direct message people. But that defeats the purpose of twitter, and is as useful as say E-mail. Even then, the different relationships between users is public.

Sticking to a liquid diet

Today, I got to watch some football with my buddy baby Grace. And, as you can see, she was really enjoying herself.

Actually, both Grace and I don't watch a lot of TV, and we certainly don't get to watch it on a super-large-screen TV. So, we both sat together, staring in awe, at all the pretty colors on the screen, with a bit of drool dripping from our chins. Good times.

The rest of the folks there were fun to hang out with too! There was a lot of good food, though I think Shira's cookies and brownies may have been the best option. Though, I'm probably biased in this respect.

Can't wait till she's old enough to talk software architecture with - at the rate she's going, that should be in another year or so.

Friday, October 24, 2008

Kinder Than Robo Calling, Though More Illegal

I mentioned that I thought McCain was on the right track with robocalling. Well, sort of. He should be thinking non-traditional-guerrilla tactics, he just shouldn't be spamming in the process. And while making these comments I mentioned that a low tech solution, with say stickers, could be just as powerful as a fancy schmancy SMS/Facebook application.

At least one Obama fan agrees with me. Check out their approach to raising Obama awareness:

Hyping Obama in the "battleground state" of North Carolina, BooneOakley has launched a guerrilla campaign. The agency printed decals of the Obama sunrise logo, each, at a diameter of 9.25 inches, sized perfectly to fit over the green circle in a stoplight sign. Of course, it's all supposed to mean "GObama."

Here's their handy work:

I'd like this approach even more if it wasn't (a) illegal and (b) potentially dangerous. But, hey, at least it's not spam!

Review: D.I.Y.: Design It Yourself

I was haphazardly browsing the shelves of my local library when I stumbled upon D.I.Y.: Design It Yourself by Ellen Lupton. The premise of the book hooked me immediately: these days, anyone can get in on the world of designing clothes, websites, stationary or pretty much anything else creative. Whether you're being cost conscious, making a political statement, or just trying to be unique - there's no reason you can't be designing the stuff you see around you ever day.

The book takes a tour through various creative elements - from book making to website building. Along the way, it gives an overview of different approaches you can take to tackle these projects, and rates each one in terms of cost and time.

I have to say, I'm largely disappointed in the book. To say that it took the approach of breadth of depth is being kind. There's just so little information presented on each topic as to make it little more than a catalog of techniques.

If the book did accomplish one thing, it was to serve as a catalyst in sparking my creativity. Why aren't I doing more with i2x T-shirts? And what other creative marketing could I be doing? So the book was hardly a total loss. Just don't expect to get enough information from it to actually design anything.

I give the book a 5/10 - it was inspirational, and that certainly counts for something.

Thursday, October 23, 2008

Think You've Got Hard To Buy For Family? Think Again

I'm shopping for a gift for my mom - oy, I'm late, and should have done this last week. Luckily, she believes in the concept of a Birthday Month, so I've still got a couple days. I hope.

Anyway, if you think you've got it tough when buying for family, check out this plea for help:

What Do You Get the Brooding 18 yo Goth Niece Who Has Nothing & Hates Everything?

Every year she hates what I buy her, doesn't say thank you, and scowls.
Lump of coal not an option.
I'm a turn the other cheek kind of person.
Suggestions much appreciated. Not a joke post.

The thing is, the posts are actually quite helpful. Like a sock zombie or the suggestion to get Type O Negative CD. Hard to believe, there's over 100+ responses to this request.

How exactly did we survive before the internet?

The PuppyCam: All the cuteness, none of the mess

This is closest we'll be coming to owning dogs. Now, say it with me..."Awwwwwwwwwww, how cute":

Free live streaming by Ustream

Case Study: Website Worst Case Scenario

There's story in this issue of Wired which should catch the attention of anyone who either runs a website, or plans to. Here's a summary of the story:

  1. UrbanBaby.com was a premier web destination for parents
  2. They got purchased by CNET
  3. CNET made tweaks to the site
  4. The users were angry because they did not like said tweaks
  5. A week later, YouBeMom.com launches
  6. Significant amount of traffic defects to the new site
  7. CNET loses

Can you imagine investing in a site, only to have it's traffic jump ship? Like I said, I think this is the Website Worst Case Scenario.

I think there's bad news and good news here.

Bad News: Yes, this can happen. Just because you're a well respected, top site, doesn't mean that you are always going to stay that way. This means that you can't just make changes to the site that aren't in your user's best interest. It also means you can't just let the site stagnate. If you do either of these, it can and will come back to bite you. Every service business knows this already - but the effect is magnified on the internet, where the cost of switching sites can be so low.

Good News: The good news is, while YouBeMom.com won this battle, they don't need to win the war. There's nothing stopping UrbanBaby.com from not only putting the site back to the way it was, but making it even better than YouBeMom.com. This, plus a sincere: "we were wrong, we're officially kicking the suites out..." message would probably go along way to fixing this.

This all goes back to a concept mentioned in The Dip: the fact that the market can shift quickly for you, can work just as much in your favor as it works against you. Just be better than your competition, and you'll be all set.

Monday, October 20, 2008

Gotcha Of The Day - Google Maps app stops working

This one is just plain whacky. All of a sudden, a Google Maps app I've been working on stops working. It would no longer allow me to add controls to the map, and the call to open an info window would result in nothing being shown.

After much debugging, I finally narrowed it down to the fact that Google Maps and Prototype were conflicting.

My hypothesis for what's going on is that I'm importing the latest version of Google Maps by saying:

 google.load("maps", "2.x");
 google.setOnLoadCallback(load);

Perhaps Google made a slight modification to their API and now it conflicts with Prototype? That seems a bit much, as I can't find any announcement anywhere from Google that they've updated the API.

Googling around, I found this guy had a similar problem to what I had going on. But, he had his issue back in June.

Still, his solution worked - he suggests explictly pulling back a past version of Google Maps. So for me, doing:

 google.load("maps", "2.115");
 google.setOnLoadCallback(load);

"fixed" things.

I don't love this solution, but at least the application is back to working again. Anyone who has any insight into this, I'd love it if you shared. Thanks.

Robo Calling - Close, but not quite

So, not every is pleased with McCain's new robo call campaign. Though, I think he's on the right track in many respects.

Look, the guys is down in the polls and his opponent has ridiculous amounts of money. Like all small folks going after the big guys, he's going to have to pull out some guerrilla tactics to beat Obama. My guess is that robo calls are one of the main guerrilla approaches he's using. After all, are cheap and reach a huge audience.

The Gotcha

With all that said, I can't imagine that robo calls are all that effective at changing the candidate's image in the mind's of the voter. In other words, do they really work? Besides, is this really the best way to get your message out?

My first thought was that the technology was wrong. In this day and age, if you want to reach thousands of people cheaply, we have YouTube, SMS, heck, even e-mail. I mean, robotic phone calls? That's one step above a mass telegram.

I was thinking that this was another example of the McCain campaign not quite getting the power of the web. But, upon further reflection, I think this isn't actually the case.

The Real Gotcha

Let's say, instead of robo calls, McCain did a mass e-mail. We wouldn't term this a clever guerrilla campaign - we'd call it what it is, SPAM. And that, in fact, is the problem with the robo calls. They're spam, pure and simple. And spam is evil.

The fact is, there have to be guerrilla maneuvers that the McCain camp can use that don't fall into the spam category. Regardless of the technology level. Heck, maybe low tech is good. Maybe a clever button or sticker campaign could work. Or, better yet, maybe you can mix low tech with high tech - buttons and stickers with an SMS number to get more information. What if you bought a few less TV ads, and sent out hundreds of flip camcorders to supporters with the suggestion to record their McCain message, and then forward on the camcorder to a friend? OK, crazy, but you get the idea.

McCain should definitely use his underdog status to his advantage. He should definitely avoid fighting Obama in the traditional, expensive, mediums where he'll probably lose out to his budget. He just shouldn't throw out his soul in the process.

Here's the deal - if someone tells me the address of where to send it, I'll be glad to ship McCain a copy of The Purple Cow so he can get back on track. I'll even send it express, as I know time is of the essence.

Making Lemon Vodka out of Lemons. Kind of.

Today, we are winding down the holiday of Sukkot, and are officially done with waving the lulav and etrog. After 8 days, my lulav is pretty much toast. But, my etrog is still going strong. See what I mean:

David had suggested that we cook something with it, as that's the preferred way to dispose of it? I wasn't so sure of this. Was it really kosher to take something that had been used for a sacred act and eat it? So, I asked my rabbi this morning. As is too often the case, David was right and I was wrong. My rabbi basically said the same thing mentioned here:

Regarding the lulav and etrog: once the mitzvah is complete, the objects no longer have any sanctity, so it is permissible to discard them; however, because they have been used to perform a mitzvah, the should be discarded in a respectful way. You wouldn't want them to wind up in a landfill under a pile of used diapers!
...
The etrog can be eaten. The peel is good for any candied citrus peel recipe.

Turns out, eating is considered an appropriate way to retire the etrog. My rabbi's suggestion? Make etrog vodka. Or, I suppose we could go the more tame route and make etrog jam.

Who am I kidding? We'll no doubt end up drinking Sukkotini's. Etrog vokda, here we come!

Gotcha Of The Day - screen not starting up - no ptys found

While setting up a new Linux server (hmmm, this seems to be a weekly occurance), my first order of business was to install screen. That way, a lost ssh connection doesn't mean a lost working session.

I installed screen by saying:

sudo yum install screen

I went to run screen and was greeted with the error message No more Ptys. This took a fair amount of Googling to solve. Eventually, I figured out that this was related to some incorrectly created /dev/* files.

The fix boiled down to:

mknod /dev/ptmx c 5 2
chmod 666 /dev/ptmx
mkdir /dev/pts 
chmod 755 /dev/pts

mount -t devpts -o gid=4,mode=620 none /dev/pts

It's also a good idea to confirm your /etc/fstab includes a devpts entry like:

devpts  /dev/pts   devpts  gid=5,mode=620  0 0

Once the problem was solved, I could get back to the fun work of copying over files, creating new databases and generally getting the server humming along.

Sunday, October 19, 2008

Geographically Confused

It was so kind of the McCain campaign to enlighten me on fairly critical detail of my every day life: I don't actually live in the state I think I live in.

I certainly agree that northern Virginia has gone more Democratic. And as a proud resident of Oakton, Virginia I can tell you that the Democrats have just come in from the District of Columbia and moved into northern Virginia. And that’s really what you see there. But the rest of the state, ‘real’ Virginia if you will, I think will be very responsive to Senator McCain’s message.

This, of course, brings up some fairly pressing questions, that if the McCain Campaign could explain I'd be really helpful:

  • If I don't live in the Real Virginia, where do I live? What is my state abbreviation?
  • Do I still have to pay Real Virginia taxes? Or, can I just skip paying state taxes this year?
  • I'm guessing that the Real Virginia is Pro American. How about where I live? More importantly, am I Pro American?
  • What are the exact boundaries of the Real Virginia? Do I need some sort of permit or visa to enter?
  • Are comments like this really useful?

Friday, October 17, 2008

Some Election Humor

It's Friday, lighten up with some humor from all sides. There's atually something wonderful about watching Obama and McCain rib each other. Well done on both their parts.

Understanding Flex Event Propagation

A couple weeks ago, I struggled to make sense of Flex event oropagation. Looking back at it last night, it all came together for me in about 4 minutes. Amazing.

I was struggling with a scenario like so. Imagine that you've got a blue canvas and a green button on the canvas:

Canvas
Button

I wanted to be able have a single mouse listener on the Canvas that wasn't thrown off when I hovered over the button. At first, I found this frustratingly difficult: (a) I tried attaching one listener to the Canvas and one to the Button and have them stay coordinated and (b) the value of localX and localY were vastly different when the mouse switched from the Canvas to the Button.

In this case, I was definitely working against Flex - as it makes solving the above problem quite easy. Here's what I did:

  • I didn't need to attach a mouse listener to the button. In fact, that's bad. By not attaching one to the Button and only having it on the Canvas, the Canvas would automatically be delivered the Button's events. This is called bubbling, and it just works. If you want, you can add a listener to the Canvas that hears events before the button itself - this is known as capture, and while doable, wasn't what I needed.

    A key item I needed to make sure of was that the event handler was on the Canvas, specifically, the Button's parent. If I had an event handler on an object that was say a sibling of the Button, it would never hear the Button's events.

  • My localX, localY shift was caused by the fact that I was using the event's target attribute. When the Canvas is delivered the Buttons'e event (because the Button doesn't handle it, so it bubbles up) - the value of target is the Button. However, if you look at the value of currentTarget will be automatically adjusted to tell you which object is currently handling the event. So, it will start off set to the Button, and then update to the Canvas.

    In order to get the x, y coordinates of the mouse in the right context I needed to switch from:

     function(e:MouseEvent):void {
       doIt(e.target, e.localX, e.localY);
     }
    

    to:

     function(e:MouseEvent):void {
       // currentTarget will be my Canvas
       // with mouseX and mouseY initialized properly
       doIt(e.currentTarget, e.currentTarget.mouseX, e.currentTarget.mouseY);
     }
    

Flex events definitely take some getting used to - but they are powerful, and quite usable. Now when I get that feeling that I'm doing work that the Flex API should handle (say, converting x,y coordinates to the right values for a given context), I know to go shopping around on the API itself for a solution. This sucker is pretty dang complete.

Update Thanks to Dave Nelson for sending me a note to tell me my title was misspelled. Usually, I'd blame this type of error on Firefox not spell checking the title field by default. However, I typed prorogation - which is in fact, a real word. Defined as: discontinuing the meetings (of a legislative body) without dissolving it. I do believe this could be a handy word to use. Thanks Dave!

Thursday, October 16, 2008

Joe The Plumber - Getting Ugly

Oy, this Joe The Plumber stuff is getting really ugly. I'm amazed that this guy's reputation is being dragged through the mud for so little.

Do the folks on the left think this is helping?

Of course, McCain and Joe himself are fanning the flames by suggesting that Obama's explanation ("we've got to spread the wealth around") was either Rabin-Hood-eseque or just plain socialism.

You know what's really interesting? To actually watch the interaction the interaction between Obama and Joe. In many ways, I think this is Obama answering a tough question as best he can. And surprisingly, he even gets truthful enough to say: "I respect what you do and I respect your question, and even if I don’t get your vote, I’m still gonna be working hard on your behalf."

Actually watch the whole clip and see what I mean:

In a lot of ways, the discussion here was more interesting (although, one sided) than what we heard in the debate last night.

As for the "spreading wealth comment" around, check out the actual context:

If you’ve got a plumbing business, you’re gonna be better off if you’ve got a whole bunch of customers who can afford to hire you, and right now everybody’s so pinched that business is bad for everybody and I think when you spread the wealth around, it’s good for everybody.

It's a funky argument: Joe, you want your customer's taxes to be low, so they can afford you. In other words, spreading wealth around has nothing to do with taking money from Joe and giving it to someone else. It has everything to do with the fact that Joe needs customers, and if people in his community pay less taxes, they'll be better customers. Therefore, spreading the wealth (lowering taxes) benefits everybody (Joe gets more customers). Like I said, funky - and perhaps inventive - argument. But still, nothing to do with men in tights.

Bottom line: what a mess. Skip the media filter, go to the source of the content, and you'll be better off.

Update: The daily show really captured the out of control nature of this story. As they explain, the media doesn't know whether Joe's their new hero, or their new punching bag.

Function of the day: $$

For some time now, I've been a fan of prototype. I find it hard to write any sort of DOM manipulating JavaScript without first importing it.

So, I was a bit surprised to learn that I've been missing out on one of its coolest features - the $$ function.

This function allows you to iterate over arbitrary nodes in an HTML document based on some CSS specification. Say you've got a document that looks like so:

<form id='contacts'>
<ul>
 <li><input type='checkbox'/> Alice</li>
 <li><input type='checkbox'/> Bob</li>
 ...
</ul>
</form>

You can trivially get to every input input tag in the list by running the following:

$$('#contacts li input')

To mark every checkbox in the list, do:

$$('#contacts li input').each(function(i) { i.checked = true; }

What I really like about this approach is that it allows you to re-use the logic you've already setup to power your style sheets. CSS and JavaScript, using the same annotations effectively- cool, eh?

To all those that are disappointed this blog post isn't about money -- need I remind you, I'm married. Now, if the post talked about allowances...well, that's a different story...

Monday, October 13, 2008

Time for another holiday...this time a fun one!

You know what I could really go for? Another Jewish Holiday!! OK, I'm feeling a bit rushed because I haven't really recovered from the last one yet.

But, this one is a fun one! There'll be plenty of eating and general rejoicing. And who can't make time for that?

Happy Sukkot! If you're sleeping outside this holiday, I hope you have clear nights ahead of you.

If this doesn't put you in the mood, then what will?

Sunday, October 12, 2008

Tool of the Day: 7-zip

I'm in the middle of migrating from a Windows to Unix server, and I decide it's time to move the database HTML files over. Not a problem. I right mouse click on the root folder, select Send To » Compressed Folder and poof, it's off and cooking making a big 'ol zip file full of the website contents.

I come back 20 minutes later, and still chugging away. The problem is that the file tree contains a handful of video files which are humongous. Those video files were totally gumming up the works.

If this were Unix, I'd just write a quick find + zip command to leave off any video or otherwise huge files. But, this isn't Unix, it's Windows. So, what to do?

I could have installed cygwin - but that seemed a bit of an overkill. Instead, I installed 7-Zip. 7-Zip is yet another compression program. And while it has its own format, it produces .zip and .tar files, and has a handy command line version I could use.

I whipped up the following command line and in just a few seconds I had a zip file of all the pertinent files:

C:\Inetpub\vhosts\myhost.com>"c:\program files\7-zip\7z" a  \
   -r -tzip files.zip -x!*.mov -x!*.avi -x!*.wmv

This included all the .php, .html and other files, but left out the videos.

Later on, I ran the command:

C:\Inetpub\vhosts\myhost.com>"c:\program files\7-zip\7z" a  -r -ttar \
   movies.tar *.avi *.mov *.wmv

This went ahead and picked up all the videos I had left off. I specifically used the tar format, as it doesn't do any compression. That, and I'm pushing this to a Unix box anyway.

I'm sure there are plenty of good reasons to use 7-zip - add quick, unix like capabilities to the list, will you?

Gotcha Of The Day - mysqldump and database views

I'm in the middle of migrating from a windows server to a Unix server, and needed to dump and restore a fairly large database. Using the definitive phpMyAdmin I was able to generate a dump. But, it failed to load into the target mysql database.

Here's what I needed to correct to get it to work:

  • Various PHP notices were getting included in the dump regarding some unknown offset. I ended up manually removing these by searching for the regular expression ^[<]. Though, probably could have cleaned the file all at once by saying:
     grep -v '^[<]' dump.sql > dump-clean.sql
    
  • The handling of database views was whacky. There was CREATE VIEW statement, followed by INSERT statements into that view (what the?!), followed by the actual CREATE TABLE statements which were used in the view. The result: the view failed to be created because the tables didn't exist, and then all the rows failed to insert because no table existed. In other words, mysqldump and views don't work.

    The latest version of mysqldump hints that this has been corrected.

    The best solution I could find was to not dump the views (manually unselect them), load in the database, and then re-create the views from my source tree's SQL files. Clumsy, but workable.

Don't get me wrong - I like MySQL and use it plenty. But, I do miss using PostgreSQL, as it has none of this nonsense.

Review: Savio's Restaurant

Shira and I have started up a little tradition: on Saturday night, we've been seeking out new restaurants to try out. Our sources for restaurant ideas include: The Onion's local pages, Washington Post's restaurant reviews and our Entertainment Book.

Last night, I was in the mood for Italian, so we gave Savio's Restaurant (www.saviosrestaurant.com, 516 S. Van Dorn St, Alexandria, VA - 703-212-9651) a try.

Our first impression, as we walked in, was a good one. The place seemed welcoming and busy. Though the crowd of 30+ high schoolers there for Homecoming was scary (turquoise taffeta was everywhere), I can hardly blame Savio's for this.

The food, overall, was very good. I got Pizza Bianca - a three cheese pizza and it delivered just what it promised. Shira's mushroom linguini was also good. The portion sizes were reasonable, not grotesque, but not leave-you-still-hungry either.

The bruschetta was a real hit. It was different than most bruschetta we've had, in that a heaping pile of veggies was served over what almost seemed like fried dough/bread. I'm quite certain it was bad for us, and quite good tasting.

Our only complaint was with the service. It was a bit slow. Perhaps if they had gotten to us quicker, once we sat down, we'd have a different perspective on this.

Even with the mediocre service, I'd still go back again. The food was delicious, the ambiance nice and I'm willing to assume the service was a fluke.

Friday, October 10, 2008

YouTube Clip Of The Day: Town Meeting, Wasilla, Alaska

Not sure why I found this so funny, but I think it is really well done.

Enjoy!

Update: I've been thinking why I found this so funny, and why I thought it was worthy of mentioning here. I think it has to do with the same reason I like comics so much. This shouldn't work.

It's one guy, a boring transcript from a small town meeting, and him talking. Yet, using mostly his voice, the actor makes this all come together into something really funny.

It's impossible storytelling - storytelling that shouldn't work, but does.

Wednesday, October 08, 2008

Ben and Dave Take On Dinner

This is a challenging time in the Simon household - what, with the fact that we won't be eating for the next 26 or so hours. So, when Dave and I were faced with the challenge of making a chicken for dinner tonight, we decided to use an All Of The Above Approach.

And Shira wasn't here to tell us we were idiots, so we said - Yes We Can.

And we did.

Here's what went into our All Of The Above Approach Chicken:

  • Heaps of vegetables in the pan
  • Salt & Pepper
  • Beer
  • Sports drink
  • A stick of butter
  • Whatever spices weren't nailed down
  • Honey
  • A lemon and onion strategically crammed into the chicken
  • Love

The result? Mmm, mmm, good. Seriously, we'll never be able to recreate this again. Nor will Shira allow me to.

If any meal is going to hold me for 26 hours, it's this one. Well done Dave!

G'mar Tov, and catch you on the flip side of the holiday!

My Wish For You Tomorrow

If you're fasting tomorrow, then my wish for you is that your fast is both easy and meaningful.

G'mar Chatimah Tovah! y'all!

Oh, and by the way - if you're reading this, you're forgiven for anything bad you've done to me this past year.

Google Like It's 2001

PocketNow.com pointed me to: Google Search, 2001. As Google Says:

In honor of our 10th birthday, we've brought back our oldest available index. Take a look back at Google in January 2001.

This is a fun one. You can get a glimpse of life back in 2001 - not that long ago in human years, but ages ago in computer years.

  • Google knew nothing of twitter, flickr and facebook.
  • Obama was just a senator, though McCain was delivering straight talk, and running for President
  • ECMAscript had 200 hits, versus 2,000,000 it has today.
  • A search for the Iraq War brings up hits about the Iraq-Iran war.
  • There were only 780,000 hits for the word Bikini. Today, there are 102,000,000. (How did we ever make do back then?!)
  • SEO stood for Sponsors for Educational Opportunity.
  • The WII was the Wildlife Institute of India
  • A search for "mortgage crisis" returns a whopping 50 hits. Today, it returns over 2,000,000.

What have discovered by looking back at 2001?

Windows Tips: Trying to improve startup time

Lately, my Windows laptop has been taking forever to boot up. To try to speed things up, I decided to cleanup what programs get started when the computer boots. Fewer programs should mean a faster boot.

You can catch a glimpse of some of these programs by looking in the far right corner of your task bar, to the area known as the "system tray." Here's mine:

Turns out, controlling what gets started at boot time, and what fills up your system tray, can be controlled by the MSConfig program. Here are some handy instructions to get you started in cleaning things up.

The quick version is to go under the Start menu, select Run and type in MSConfig. It should pop up a little program, where you can select the startup tab. Mine looks like:

I'm sure there's an intelligent way to figure out what you should and shouldn't turn off. Whatever it is, I didn't follow it. Instead, I looked at the name of the startup item, the command that was being run, and basically started turning off anything that didn't seem important. Windows Defender from Microsoft stayed, while eFax Messenger and Wave's Document Manager went.

I figure I can always turn things back on if I've made some horrible mistake.

Does my computer actually boot any faster because of this? Probably not, but at least I feel like I'm doing something. Think of it as the digital placebo effect.

Monday, October 06, 2008

E-junkie.com - Making Economic Lemonade

Oy, times are tough. But, that doesn't mean you should throw in the towel. Nope, as E-junkie is showing, this is just the time to be innovative. In this case, they are being innovative not with technology, but with a marketing promotion. See what I mean:

Times are tough. Lay-offs are becoming as commonplace as mosquitos at dusk in the summertime. Our friends are getting fired for what appears to be no good reason at all.
...
Now is the time to take things into your own hands! Why not turn this into the opportunity to start your own online business?
...
We are offering you the opportunity to use our shopping cart for a year FREE, with no obligation whatsoever. Simply make a copy or a scan of your termination notice and send that to us, and we'll grant you a free subscription to the E-junkie shopping cart service for one year, at our basic $10 per month level.

There's a lot I like about this marketing move:

  • They've found a way to turn an economic downturn into a way to pick up new clients
  • They're showing they are human and care
  • They show that they truly believe in their product
  • They're saying and doing the unexpected

Well done.

I have a hunch that a promotion like this works especially well at a small business. I can just see the team sitting around a table talking about a friend who got laid off, and wondering what they could do about it. So they did something about it.

This offer seems like a TPE's dream. It's yet another way you can start up your business without gobs of (any?) cash.

Living in Virginia and Not Registered To Vote? Today Is Your Day

And Now For A Public Service Announcement...

Heads up: today is the last day to register to vote in Virginia.

So, print out the form, or hit your local library and pick one up there. Then either mail in the completed form, or drop it off at a local registration office.

Virginia makes this all especially easy. You don't need to show proof of residence, and the form even includes a line captioned:

If Rural Address or Homeless, please describe where you reside

You simply have no excuse for not registering.

Vote for whoever you want - just vote.

If you want to go the Web 2.0 route, you can try this site. It's offered by Barack Obama's campaign, and uses various databases (and a Web 2.0 look) to walk you through the process of registering to vote. Not sure if the McCain camp has one too.

Israelis For Obama

Mickeleh summarized this video best:

Video: Israelis for Obama. A little Schmalzy, but 100% kosher

A little shmalzy? I'd probably up that to a lot - but still, it's well done.

Gotcha Of The Day: Can't Log In After Upgrading Wordpress

Upgrading Wordpress is basically a simple 3 step process. I've done this a handful of times before, so I didn't expect tonight's upgrade on a client's site to be any more eventful than those other times.

I did step zero and made a backup. I did step two and uploaded the files. And then I went to do step three, that is visit: http://www.mysite.com/wp-admin/upgrade.php, yet I was always bounced over to:

http://www.mysite.com/wp-login.php

I re-checked my work,and re-uploaded the files. No change - I wasn't able to complete the upgrade. Also, attempts to login to the back end kicked me back to the login screen again.

Houston, we have a problem.

To diagnose the problem I added in print statements in the Wordpress code till I found the block that was misbehaving (man I love open source software!). Turned out, it was the process of reading in the plugin files were kicking me back to the login page. Apparently one of the plugins the site used wasn't compatible with the latest version of Wordpress.

This of course reminded me of something I had read in step 0 of the instructions:

Deactivate your plugins. A plugin might not be compatible with the new version, so it's nice to check for new versions of them and deactivate any that may cause problems. You can reactivate plugins one-by-one after the upgrade.

D'oh! Apparently I should have actually done all of step 0, not just the parts I thought were important.

Now I had a bit of a pickle - I couldn't finish the upgrade of Wordpress, and I couldn't log in to deactivate the plugins, so that I could finish upgrading Wordpress.

I solved this one by connecting to the database and running the following SQL. It clears out all the active plugins from the database:

  UPDATE wp_options SET option_value = '' WHERE option_name = 'active_plugins';

With the incompatible plugins out of the way, I was able to complete the upgrade process, log in and even upgrade and reactivate the needed plugins. Life was good again.

Friday, October 03, 2008

Gotcha Of The Day - phpShop not being able to log in

Oh, this gotcha hurt. Big time. Here's what happened...

I'm installing phpShop for a customer and all is going well. I deployed the files, setup the database and pretty much got things setup the way I wanted. But, for the life of me, I couldn't log in.

Oh, it would look like it was trying - I'd enter my username and password, but it would take me back to the homee page, still logged out. At first I thought it was cookie issues, but setting:

 define("SESSION_PATH","/home/content/../sessions");

didn't help my problem. It did, confirm that the session file was getting created, which was a good thing.

I then dropped some code into one of the views to try setting a variable in $_SESSION. Something like:

 echo "Before:";
 var_dump($_SESSION);
 $_SESSION['foo'] = isset($_SESSION['foo']) ? 100 : _$SESSION['foo'] + 10;
 echo "After:";
 var_dump($_SESSION);

This didn't work as expected, and I thought, Aha! I've found the issue. But, it turns out that phpShop does some wicked things to the session, and it isn't sane to store scalar values in there like I'm trying.

Back to the drawing board. Finally, I hooked the browser up to Fiddler, and realized that my browser was taking an extra hop from:

  http://www.mydomain.com/shop
to
  http://www.mydomain.com/shop/

Then it hit me - oy, I set the variable wrong in config.php. Instead of:

 define("URL","http://www.mydomain.com/shop");

I needed:

 define("URL","http://www.mydomain.com/shop/");

One. Lousy. Slash. Argh.

Amazing that progress can be ground to halt because of one missing character.

I added the slash in, and the site worked just like it was supposed to.

Insurance As A Startup Business Idea

Here's a topic I bet you haven't talked about with your financial planner: SafeGuard Guaranty is planning to offer Marriage Insurance.

SafeGuard Guaranty offers "marriage insurance" through a Web application. Apparently the longer you stay with your mate, the more the policy is worth.

Don't believe me? Check out this video explaining more:

This actually reminded me of an idea that myself and a fellow co-worker (Mike R. from Amazing Media) crafted some time ago, but apparently, I've never blogged.

Why can't I buy Wife Insurance? Wife Insurance would work just like health or car insurance. I'd pay my monthly premiums, and I'd get some basic services: flowers and cards delivered to the wife, a reminder service for anniversaries and birthdays, and other basic member services. Think of it as well doctor visits - the insurance company invests a bit in me while I'm healthly, to keep me from needing the ER.

Then, just like health insurance, it would support the occasional catastrophic claim - they'd have a diamond necklace delivered to me, to give to my wife, in less than 24 hours, upon some unfortunate comment I did or did not make.

What husband wouldn't think it a smart investment to protect himself from screwing up with this wife?

OK, I'm probably 70% joking here - but still, I think it could work. Oooh, www.wifeinsurance.com is available...I should so buy it.

Being First Is Overrated

Sooner or later, almost all my customers have the same realization: their completely unique idea, isn't. Someone has invariably beaten them to launch of their idea.

While I've written about this topic before, I really like David Mullings approach to it. He's written up an excellent blog post that reminding me just how frequently being first is't the key to being the best.

David picked up on one classification of entrepreneurs, which breaks them down into 3 types: Inventors, Innovators and Introducers. For our purposes, it's the inventor which is most interesting. As he explains, the inventor is the entrepreneur that develops a completely novel idea or thing. He then goes on to compare some classic inventors versus the now market leader. Here's a bit of the list:

  • Computer mouse - Xerox (not Logitech)
  • DOS - IBM (not Microsoft)
  • Cellular phone - Motorola (who is hurting and wants to sell that part)
  • Portable music player - Sony (now Apple runs the show)
  • Commercial Word Processing software - WordPerfect (not Microsoft WORD)

What a powerful reminder that being first doesn't guarantee you'll be the market leader. In fact, letting another company trip over all the landmines out there in a new business field, may in fact be the smarter approach to take.

Regardless of whether you're first to tackle an idea, or 1000th, I think the answer is still the same: innovate and you'll win.

Thursday, October 02, 2008

Joe and Sarah on Roe vs. Wade

Here's Joe Biden and Sarah Palin answering the same question about Roe vs. Wade. I was impressed with Joe's answer, and have never heard it broken down quite like this before.

Agree or disagree with them - it's interesting to see their points of view juxtaposed.