Anyone know of a supplier of fresh pistachio nuts?

April 6, 2008 by Roger Costello

Recently I purchased some pistachios from the grocery store.  After tasting a few, I threw them out.  They tasted horrible.  It was clear that the pistachios were harvested a long time ago, and had been sitting around.

I would like to find a place (in the U.S.) which actually grows pistachios.  I have heard that some suppliers will actually Express Mail the pistachios the very same day that they are harvested.  That’s what I want.  I want to be eating the pistachios within a day or two of being harvested (and I’ll freeze the rest).

Does anyone know of a supplier of fresh pistachio nuts?

Why JSON is Important to You!

April 5, 2008 by Roger Costello

WHAT IS JSON?

JSON stands for JavaScript Object Notation. (JSON is pronounced like the name Jason)

It is a data format. (XML is also a data format)

The JSON data format is ideally suited for consumption by a JavaScript program. (In fact, JSON is JavaScript!)

WHY SHOULD I CARE ABOUT JAVASCRIPT?

Because Ajax applications use JavaScript. (And because JavaScript is very cool)

BUT AJAX APPLICATIONS CAN PROCESS DATA FORMATTED AS XML, SO WHY BOTHER WITH JSON?

If the data is formatted as XML then Ajax is limited to fetching data from the same domain (website) that the Ajax application came from.

If the data is formatted as JSON then Ajax can travel across domains. That is, Ajax can access data from anywhere. Think of the power of this: a single Ajax application, running in your browser, can reach out and grab data from an unlimited number of web services, and present it in your browser in a coherent fashion. Awesome!

WHAT DOES JSON LOOK LIKE?

Here’s information about a person, his website, and his email, all structured as JSON:

{”person”: {
“name”: “John Doe”,
“website”: “http://www.example.com/”,
“email”: “jdoe@example.com”
}
}

HOW IS THE DATA IN JSON EXTRACTED?

Very easy: (suppose the variable “data” holds the above JSON data)

data.person.name returns “John Doe”
data.person.website returns http://www.example.com
data.person.email returns jdoe@example.com

ARE THERE WEB SERVICES THAT SERVE UP JSON?

Yes. For example, all of Yahoo’s Web Services can return JSON if it’s requested. Here’s an example:

http://api.search.yahoo.com/NewsSearchService/V1/newsSearch?appid=xyz&query=Obama&output=json

SHOULD MY WEB SERVICE SERVE UP JSON?

I think that it would be good for your web service to be capable of serving up both XML and JSON. You might implement it in the same way Yahoo does, e.g.

http://www.example.com/web-service?output=json

http://www.example.com/web-service?output=xml

WHO DISCOVERED JSON?

JSON is the brainchild of Douglas Crockford, one of the preeminent JavaScript coders in the world today (http://www.crockford.com).

WHERE CAN I GET MORE INFO?

See the excellent book: Bulletproof Ajax, by Jeremy Keith, p. 77-87

Word of the Day: Categorical statements

March 30, 2008 by Roger Costello

Categorical statements are statements that talk about whole categories of objects or people. Furniture, chairs, birds, trees, red things, and cities that begin with the letter T are all examples of categories.

There are two types of categorical statements:

  • Universal statements: These are statements that tell you something about an entire category. Here’s an example of a universal statement:

    All dogs are loyal

    This statement relates two categories and tells you that everything in the category of dogs is also in the category of loyal things. You can consider this a universal statement because it tells you that loyalty is a universal quality of dogs.

  • Particular statements: These are statements that tell you about the existence of at least one example within a category. Here’s an example of a particular statement:

    Some bears are dangerous

    This statement tells you that at least one item in the category of bears is also in the category of dangerous things. This statement is considered a particular statement because it tells you that at least one particular bear is dangerous.

Logic for Dummies by Mark Zegarelli

70 watts of energy being used by my home entertainment system when it’s turned off!

March 29, 2008 by Roger Costello

Yesterday I got a device that measures how much electricity an appliance uses. Instead of plugging the appliance into the wall, you plug it into this device, and then the device into the wall. Turn on the appliance and the device shows how many watts are being used by the appliance.

I was particularly interested in knowing how much energy my entertainment appliances use when they are “off”:

  • stereo
  • DVD
  • VCR
  • cable box for cable TV

I plugged all these appliances into a power strip, plugged the power strip into this device, and then plugged the device into the wall.

With all of the appliances turned “off” (i.e. the TV is off, the stereo is off, the DVD and VCR are off) the device showed 70 watts of power being used. Wow! That’s a lot of energy being used with absolutely no benefit. That’s like running a 70 watt light bulb 24 hours a day, 365 days a year, in a closet.

From now on, I will turn the power strip off when I am not using my home entertainment system.

Giving of ourselves is what makes us feel alive

March 23, 2008 by Roger Costello

Giving to other people is what makes me feel alive.  Not my car or my house.  Not what I look like in the mirror.  When I give my time, when I make someone smile after they were feeling sad, it’s as close to healthy as I ever feel.

tuesdays with Morrie by Mitch Albom

A very cool way to display images on a web page

March 22, 2008 by Roger Costello

 Click on an image on this web site: http://www.huddletogether.com/projects/lightbox/ 

The image pops up, overlaying the web page; the web page is still visible translucently.  It’s a very cool way of displaying images.

It’s easy to add this capability.  The capability is implemented using some JavaScript code, so you just connect your web page to that JavaScript.  In your HTML, add this attribute rel=”lightbox” to any link to an image.  That’s all there is to it!   The instructions are on the Lightbox web site (URL above).

“Life would be simpler if I was stupider …”

March 18, 2008 by Roger Costello

“Life would be simpler if I was stupider and could do only one thing.”

– Anonymous

Fascinating show on The Science of Sleep

March 17, 2008 by Roger Costello

Yesterday the TV show 60 Minutes had a fascinating segment on the importance of sleep [1].  This statement particularly caught my attention:

“But you know I find it amazing to see how many people are asleep within five minutes of boarding an airplane at 11 o’clock in the morning. You know, sit down and boom. It shouldn’t happen. A normal adult shouldn’t be falling asleep at 11 o’clock in the morning, minutes after sitting in a small, uncomfortable airplane seat. It just shows that, you know, people are exhausted.”

Yikes!  I am one of those people who fall asleep in the plane.  Time to get more sleep I reckon.

[1] http://www.cbsnews.com/stories/2008/03/14/60minutes/main3939721.shtml

More people have direct access to more knowledge than at any time in history

March 16, 2008 by Roger Costello

“The World Wide Web is a marvelous thing.  Because it exists, more people have direct access to more knowledge than at any time in history.”

– Walt Mossberg, The Wall Street Journal

Isn’t clapping an odd thing we humans do?

March 15, 2008 by Roger Costello

We bang our open hands together which produces a sound.  We call it “clapping.”  We repeat it over and over. We perform this action when we want to express enthusiasm.

I got to thinking about this today.  “What an odd thing to do,” I thought.  “Why would people swiftly, almost violently slam their hands together?  Why is the sound that is produced in any way indicative of support? (It’s just a noise)  When did this clapping custom begin?  Is it a recent thing, or have peopled been doing this for a long time?”

Anyone know the history of clapping?