Yahoo! 360° News | Beta Feedback
Start your own Yahoo! 360° page

Now in paperback! JavaScript: The Good Parts--> Click here

1 - 5 of 346 First | < Prev | Next > | Last

Douglas Crockford's The Department of Style Full Post View | List View

Media, Technology, Creative Discontent, Neandertals, and a Lot More.

Beauty is a viviparous oblong fish
Beauty is a viviparous oblong fish magnify

Sean McGrath gave the closing presentation at XTech 2008 last week in Dublin. He quoted from Jorge Luis Borges's The Analytical Language of John Wilkins. Wilkins was an 17th Century English scientist. (He is also one of the characters in Neal Stephenson's Quicksilver.) Wilkins designed a Philosophical Language in which the letters of each word give not just the sound but also the specific meaning of the word. It would have been an amazing accomplishment had it worked. Borges suggests why it didn't.

Wilkins's Real Character depended on his exhaustive taxonomy of all knowledge and topics of conversation. This must be done perfectly, and a perfect taxonomy is impossible to produce from our mortal vantage point. Borges points out that

The whale belongs to the sixteenth category; it is a viviparous oblong fish.

That may have been a reasonable classification in Wilkins's time, but in our time it looks wrong. But it could look much worse.

Borges's wrote in Spanish. There are translations on the net that render that statement differently.

Beauty belongs to the sixteenth category; it is a living brood fish, an oblong one.

Beauty is a fish? What does this mean? Is it a metaphor? No, it is a typo. In Spanish, beauty is belleza, and whale is ballena.

Tuesday May 13, 2008 - 09:23am (PDT) Permanent Link | 0 Comments
Black and White and Gray
Black and White and Gray magnify

Gray code is a binary sequence encoding in which any state differs from the next or previous state by only one bit. This is an example of a four bit Gray code:

BITS
4321
0000
0001
0011
0010
0110
0111
0101
0100
1100
1101
1111
1110
1010
1011
1001
1000

Gray code is useful in shaft encoders, where you want to sense the state of rotation. An optical encoder could have each state represented by a pie wedge, where the 0 bits are white and the 1 bits are black.

The Towers of Hanoi is a puzzle in which there are three posts and several discs of various sizes. This is a JavaScript program that solves the problem of moving the discs from one post to another:

hanoi = function (n, src, aux, dst) {
if (n > 0) {
hanoi(n - 1, src, dst, aux);
document.writeln('Move disc ' + n + ' from ' +
src + ' to ' + dst);
hanoi(n - 1, aux, src, dst);
}
};

The solution to a tower of 4 discs is obtained by hanoi(4, 'Src', 'Aux', 'Dst'):

Move disc 1 from Src to Aux
Move disc 2 from Src to Dst
Move disc 1 from Aux to Dst
Move disc 3 from Src to Aux
Move disc 1 from Dst to Src
Move disc 2 from Dst to Aux
Move disc 1 from Src to Aux
Move disc 4 from Src to Dst
Move disc 1 from Aux to Dst
Move disc 2 from Aux to Src
Move disc 1 from Dst to Src
Move disc 3 from Aux to Dst
Move disc 1 from Src to Aux
Move disc 2 from Src to Dst
Move disc 1 from Aux to Dst

The number of the disc to move corresponds exactly with the next bit to toggle in the Gray code.

Tags: javascript
Monday May 12, 2008 - 10:21am (PDT) Permanent Link | 0 Comments
JavaScript: The Good Parts
JavaScript: The Good Parts magnify

I relied on two models when I wrote JavaScript: The Good Parts. The first was Kernighan and Richie's The C Programming Language. It is a brilliant little book. I thought there should be a K&R for JavaScript. When it seems that most tech books are sold by the pound, it is nice to read a little book that cleanly lays out what you need to know.

The other was William Goldman's The Princess Bride. Goldman remembers his grandfather reading him a wonderful book by S. Morgenstern. When he's grown he searches for the book and is very excited when he finally finds a copy, but discovers to his horror and confusion that it really isn't very good. Why did he remember it as being so wonderful? Because his grandfather only read him the good parts.

Tags: javascript
Tuesday May 6, 2008 - 02:48pm (PDT) Permanent Link | 2 Comments
Suppose They Gave a Format War and Nobody Came?
Suppose They Gave a Format War and Nobody Came? magnify

Blu-ray won. Sony ultimately paid off enough of the other studios to tip the contest in their favor. Toshiba has withdrawn HD-DVD. But Sony's victory may have come too late.

The expectation was that when the format war ends, that sales of Blu-ray players would immediately exceed the sales of HDTV sets. That didn't happen. Sales of Blu-ray players have stayed pretty flat.

Blu-ray can deliver much higher quality than DVD, but the difference is not significant in most homes, so Blu-Ray is going to have a much harder time getting mass acceptance. Sony may be forced into price reductions. They don't have much time because the window is closing. To survive, Blu-ray must become dominant before is made obsolete by network delivery.

My recommendation is still to stick with DVD at least until Sony announces that they are going to remove the DRM components from Blu-ray. DRM makes the gear and discs more expensive and harder to use, so clearly it is something you don't want.

Tags: media, formatwar, drm
Thursday May 1, 2008 - 10:04am (PDT) Permanent Link | 2 Comments
Yahoo! pimping malware from banner ads
Yahoo! pimping malware from banner ads magnify

The Register reported yesterday Yahoo! pimping malware from banner ads. They say that banner ads displayed on Yahoo have contained malware:

The ads pitch women's deodorant, but behind the scenes, they contact servers that have been used by previous rogue ads targeting high-traffic websites. Typically, the ads produce a pop up that looks strikingly similar to official Windows dialog pop-ups that urge the end user to download software to fix problems. Expedia, Rhapsody, MySpace, Excite, Blick, and CNN.com have all served up similar malicious ads in the past.

Attackers who shoe horn their banners onto reputable sites usually take advantage of the highly decentralized way that online advertisements are sold. It's not unusual for there to be a succession of affiliates, making it possible for an attacker to pose as an authorized agent of a name-brand product or service. In this case, Yahoo has gotten hoodwinked into running ads that point to adtds2.promoplexer.com, which has been implicated in previous rogue banner attacks.

I don't know if this has actually been happening at Yahoo, but it is feasible. The architecture of the browser does nothing to protect users and websites from malicious ads. As a result, all websites that depend on advertising are at risk. All users of ad-supported sites are at risk. And things aren't all that hot for the honest advertiser, either.

We could blame the browser makers for making products that put everyone at risk. Or we could blame the W3C for producing standards that fail to track the way the web is actually used. Or we could blame the web publishing companies for choosing to implement their services on a technology that is clearly inadequate. Or we could blame the advertising industry for insisting on a body of practices that are unsafe. But I think assigning blame at this late date is a waste of time. We need instead to be fixing this thing. The easiest attack on web systems now is to buy ads. Ads can be cheap. They can be targeted. They can be highly effective.

The fundamental problem is that the browser's security model failed to anticipate that there are multiple interests involved in a web application. We have here the interests of the user, of the site, and of the advertiser. If we have a mashup, there can be many more interests. The browser does not defend these interests from each other. The best it can offer is the iframe under the Same Origin Policy, which does not prevent the abuse that The Register is reporting.

In the short term, the Advertising Industry must adopt safer practices. It must be requiring the use of Safe JavaScript Subsets in all ads because that is the only thing that can work today. I recommend ADsafe because I designed it. Google's Caja is also very good. Neither is effective unless it is used.

And in the meantime, you should be using Firefox's NoScript extention.

Ultimately, we must fix or replace the browser. It has been pushed way past its competence.

Tags: advertising, adsafe, mashups, security, yahoo
Tuesday April 29, 2008 - 10:13am (PDT) Permanent Link | 0 Comments

Add Douglas Crockford's The Department of Style to your personalized My Yahoo! page:

Add to My Yahoo!RSS About My Yahoo! & RSS
1 - 5 of 346 First | < Prev | Next > | Last