Tuesday, December 14, 2010

Do you sell any clocks in this bookstore?

When I was in college I worked in a bookstore. One day a lady came in and asked us if we had any clocks for sale. Today, that question might not be too strange. After all, mega-bookstores like Barnes and Noble and Borders carry a lot of different stuff, but it was an odd question at the time.

I was reminded of that incident today while thinking about job interviews. Why? Hold on.

Imagine a universe where that lady's question was perfectly sensible. In that world, you might enter a traditional book-only bookstore and be greeted by the proprietor who asks you "What kind of product were you looking for?"

I think some interviewers have been to that world.

I selected your company to send my Resume to. I even applied for a particular job you are offering. Why are you asking about what kind of job I want? If I were looking for something you can't offer, I wouldn't be here.

Monday, December 6, 2010

Who says you don't need your MFC books anymore?

I have a problem with my van. The battery connectors are corroded and I don't have the money to have it fixed. (Did I mention that I approach car repair like the stereotypical grandma approaches installing an operating system on her computer?)

Anyway, I needed something heavy to hold the wires to the battery while I started the van, so Jeff Prosise's Programming Windows with MFC came to the rescue. I also have a copy of Jeff's Programming Microsoft .NET, but I hope to have my van repaired before I need it.

Friday, September 17, 2010

What I learned about JavaScript from Douglas Crockford

About a year and half ago, O'Reilly published Douglas Crockford's book: JavaScript: The Good Parts. It's a great book and is particularly useful if you have the opportunity to create new JavaScript code so that you can use the subset of the language that he describes.

One thing the book lacks is a summary of all the good advice in the form of a best practice list. Now, such lists are useful as long as we keep in mind that nearly every "rule" has an exception. Perhaps Crockford deliberately avoided the problems that can come from separating recommendations from their explanation and justification.

Nevertheless, I want to present some of his recommendations as a list that you can apply without necessarily knowing their background. I highly recommend that you consult Crockford's book for more details.

  1. Mitigate JavaScript's default global variables by creating a single global variable that acts as a container for your application.
    code example:

    var THEAPP = {};
    THEAPP.book = {
    "name": "JavaScript The Good Parts",
    "author: "Douglas Crockford"
    };


  2. When using the Function Invocation Pattern, save a copy of this in a variable (called "that" typically). This will allow an inner function access to the outer function's objects.

  3. JavaScript doesn't have block scope, so declare a function's variables at the top of the function body.

  4. Use the Module Pattern to encapsulate singletons.

  5. Use Cascade to call many methods on the same object in sequence in a single statement. Each method of the Cascade returns the object.

  6. The length property of an array is the largest integer property name in the array plus one. So assigning a smaller value than the current one to the length property truncates the array.

  7. Avoid the for in statement and use the conventional for statement instead.

  8. When to use arrays vs. objects. When the property names are small sequential integers, use an array. If not, use an object.

  9. Regular expressions are best when they are short and simple.

  10. The array.sort, sorts arrays of numbers incorrectly because its default comparison method does a string compare.

  11. Use K&R style braces (put "{" at the end of the line) to avoid a serious language design flaw in JavaScript's return statement.

  12. Don't use an assignment expression in the condition part of an if statement.

  13. Don't allow switch cases to fall through to the next case.

  14. Don't use implied global variables. Any variable used without declaring it, will be global by default.

  15. Avoid using new.

  16. Always provide the radix parameter when using parseInt.

  17. If you intend + to add, make sure that both operands are numbers.

Link to book description: JavaScript: The Good Parts
Link to Douglas Crockford's JavaScript Video

Friday, August 13, 2010

One of my favorite Spoon River Anthology quotes

Edgar Lee Masters wrote a very unusual book of poetry where each character described their life and sometimes their death. A collection of fictional auto-obituaries you might say. One of my favorites is

ALEXANDER THROCKMORTON

IN youth my wings were strong and tireless,
But I did not know the mountains.
In age I knew the mountains
But my weary wings could not follow my vision—
Genius is wisdom and youth.

Saturday, July 24, 2010

Daniel Schorr

The long time, highly respected journalist, Daniel Schorr died yesterday at the age of 93. Years ago I had the pleasure of reading his book: Clearing the Air which described his experience reading his own name on President Nixon's enemies list on live TV and his leaking of the Pike Congressional Committee's report on illegal CIA and FBI activities.

He once described how he approaches a television news story:

"My typical way of operating is not to stick a camera and a microphone in somebody's face and let him say whatever self-serving thing he wants to say, but to spend a certain amount of time getting the basic information, as though I was going to write a newspaper story.... [I] may end up putting a mike in somebody's face, but it is usually for the final and hopefully embarassing question."

In broadcast news today, the philosophy seems to be that "balance" comes from allowing each side a chance to say "whatever self-serving thing" they want to say, as opposed to searching for, and broadcasting the facts.

There's a great and detailed tribute to Mr. Schorr at NPR: http://n.pr/9BMHz4.

Tuesday, July 20, 2010

Conservatives' advice to the unemployed increasingly bizarre

Laid off from your job? No problem. Just offer to work at your old job for half the money. That's the advice of Jeff Miron of the conservative Cato Institute. In a debate on The Nightly Business Report about extending unemployment benefits, Mr. Miron said the following:

"The broader thing is it creates the wrong incentive. There's clear evidence that people who are unemployed tend to leave unemployment just before their unemployment benefits run out. It's not just a question -- it's not the right way to think about it -- are there jobs? The right way is are there jobs at what wages? If people lower their wage demands, if they offer to take say their old job for 50 percent of what they were getting, there would be a lot more jobs out there. That's the adjustment that needs to happen in many cases. But unemployment insurance and especially very, very long-term unemployment insurance impedes that kind of adjustment."


Full transcript is here: http://to.pbs.org/d3tLvb

Perhaps Mr. Miron has never been laid off or has no experience in HR. If he did, he'd know that being laid off isn't an opportunity for negotiation - it's about completing some paperwork before you're escorted off the premises. After that you're persona non grata at your former place of employment. They will talk to you about the bureaucratic aspects of being terminated such as your 401K or Cobra, but they're not interested in talking to you about positions in the company.

Monday, July 5, 2010

Great minds think alike :)

It seems that economist Paul Krugman agrees with me about extending unemployment benefits: http://nyti.ms/bMqVmn .Of course, his article is more informed and eloquent than mine: http://bit.ly/9Pa2G0

Saturday, July 3, 2010

I Got a Free T-shirt!



I got a free shirt from Replyz for answering a lot of tweeters' questions. Very nice. Pikachu not included.

I described Replyz in a previous blog post: http://contextisall.blogspot.com/2010/06/replyz.html

Do conservatives believe deep down that the unemployed are really deadbeats?

Last night on the PBS News Hour there was a debate about extending unemployment after the Senate failed to approve a bill that would have mandated it.

William Beach of the Conservative Heritage Foundation stated that if you extend the benefits people are less likely to look for work:

JEFFREY BROWN: Right. But we also heard that there is longer -- people are unemployed for longer periods.

WILLIAM BEACH: Indeed. Indeed. And we have created a bit of a problem by extending unemployment beyond that 26 weeks.
We know that that changes the behavior of people who are unemployed. They don't look for work as much as they otherwise would be. If you have got that 26th week looming ahead of you, all the academic studies show that you go out and you really begin to make an active job search.
Not as much job training is undertaken or education, so there are some incentives that are put in place that are rather perverse...

The full transcript is here: http://tinyurl.com/233gsea

Of course no matter how active the unemployed are at looking for work, you can't hire five people for one job opening. 5-to-1 is the current ratio of job seekers to employment opportunities among the officially unemployed (when those who are not receiving unemployment benefits are counted the ratio is higher).

So, what about retraining? Well, I've been a software developer for over 20 years and just a few years ago my profession was the sort of job people were retrained for. Now there are many unemployed technology workers and if those like myself who have a college degree and years of experience have trouble finding work, what chance do the retrained have?

The fact of the matter is that businesses throttle the rate of employment, not workers.

I wonder. Can I be retrained to be a smug political pundit? There seems to be a lot of demand for them.

Wednesday, June 30, 2010

Droid X ad mocks Apple's Antenna Woes

Motorola ran a full-page advertisement in the New York Times for the Droid X. It touted the X's double antenna that allows the user to hold the phone "anyway you like" without compromising clarity.








Monday, June 28, 2010

Twitter Follower Bot Redemption

Most people want followers when they first sign-up for Twitter. One way to do this is by using a service that promises "thousands of followers". Unfortunately people don't always read the fine print, so they don't realize they've entered into a "devil's bargain" .

They get more followers, but they've also agreed to allow the "service" to send spam tweets to their followers in their name. In some cases these spam tweets are sent once an hour and they go on forever.

You can look for an opt-out option on their website (the URL is included in the spam tweets) but the opt-out doesn't always work. In addition, sometimes their url "shortener" (e.g. tinyurl.com) figures out they are spamming and drops the target URL. In that case you may not be able to figure out what the actual URL is for the "service".

One sure-fire way to stop spamming your followers is to change your twitter password. Then the "service" can no longer access your account to send tweets.

Monday, June 21, 2010

Replyz

My followers on twitter may wonder why I have so many tweets that start with "A:" and why I seem to be answering random questions and sending the answers to random people.

The reason is that I'm using a site called Replyz. Replyz searches through twitter looking for tweets that contain questions and then stores and displays them. So you can see questions being asked by people who you aren't following on twitter and post answers if you wish. The answers will show up in twitter as Replies.

If you wish, you can filter the questions if you only want to see questions in a particular category. I haven't used the filtering function which is why my answers may seem a bit random to my followers.

The "A:" at the beginning of my reply is just my own convention to hint that this is in answer to a question. Lately I've been trying to incorporate a simplified version of the question in my answer in case a follower might actually be interested in the question.

If you want to check it out go to http://replyz.com/ and request an invitation.

Update: You no longer need an invitation to use replyz.com

Thursday, June 17, 2010

How to solve VMware black screen

I run VMware fusion on my Mac to develop and test Windows applications. I've noticed when running XP as the guest OS it will sometimes hang with a black screen when I resume it (I think it happens when an automatic update for XP has occurred).

Anyway, I couldn't get it to respond and attempting to close it didn't work. I could suspend it, but it just saves the bad state. Finally I found the answer at VMware Communities: http://communities.vmware.com/message/893646#893646

Digium

In 2002 a company called Digium was incorporated. It made PBX software based on the open source PBX software called Asterisk which the company founder, Mark Spencer created.

In late 2007, Digium bought a small company called Switchvox which had taken the Asterisk software, simplified PBX management and user operations so that non-tech companies could operate it, and wrapped it up as a turn-key PBX system (This is a great simplification, but you get the idea).

Recently Switchvox announced the Switchvox Extend API and Switchvox Developer Central which is a portal for Switchvox integration developers. One of the coolest features of this site is the API Test Suite which allows you to make any Extend API call to your Switchvox system. It displays both the request and response data.

If you want to check-out the Switchvox Extend API but don't own a Switchvox PBX, you can get a free account on the demo server and use the Test Suite with that.

Just one disclaimer - I'm a former employee of Switchvox.