Monthly Archive for August, 2005

Question: How do you know when a language’s OO/class/inheritance design is horrible?

Answer: when you have to write THE SAME METHOD in every single extension class:

PHP:
  1. public static function tableHeader(){
  2.    return parent::tableHeaderMaker(self::ColumnSpecs());
  3. }

PHP does not allow a parent class access to an extension class' static methods (or members).

Or maybe this isn't so strange? Can Smalltalk, Objective-C, Java, Ruby, or Python do this? I'm very interested.... if you are reading this and know one of these languages, please chime in.

Another gripe: see how I am calling self::ColumnSpecs()? I originally wanted to make ColumnSpecs a static member, but static members can't have instantiated Classes (or an array of instantiated classes, in my case) assigned to them. So I have to use a static method to generate this array with each call. It works okay in this case, but it's ugly, and incurrs a performance hit.

PHP:
  1. public static function ColumnSpecs(){
  2.    return array(
  3.       new ColumnSpec('shirt', 'Shirt'),
  4.       new ColumnSpec('mailingaddress', 'Address'),
  5.       new ColumnSpec('billingaddress', 'Address'),
  6.       new ColumnSpec('price'));
  7. }

Apache 2 virtual servers

Having problems configuring your Apache 2 virtual servers? I was banging my head against the wall for days trying to get them working. The trick is to comment out absolutely everything relevent to having a "main server" (I'm too lazy to look up the official term for that) and only have virtual servers. In Apache 1, I would always maintain my "main server" configuration and then have my virtual servers. I do think it's cleaner and more intuitive to have only virtual servers (each server has a parallel block of configuration syntax), but as far as I can tell, the necesity of doing this is not documented anywhere.

U.S. defies NAFTA ruling — vigilante tariff war to ensue?

WikiNews has the story:

The government of Canada is demanding that the United States stop applying duties on Canadian lumber and refund the C$5 billion in duties that has been collected. ... a NAFTA panel rejected Washington's claims justifying those duties, but the U.S. is not abiding by the NAFTA decision.

Canada had asked the WTO for permission to retaliate. Jacqueline LaRocque, a spokeswoman for Canadian Trade Minister Jim Peterson, said that Canada is considering imposing C$5 billion in duties on imports from the U.S. in retaliation. "Canada has wanted to make it very clear that we are not happy with the position of the United States to simply ignore what is a clear NAFTA ruling in Canada's favor," Canadian Finance Minister Ralph Goodale was quoted as saying.

The U.S. is still dealing with a 4 billion dollar ruling against it by the WTO relating to its practice of helping large American companies set up "Foreign Sales Corporations" offshore in order to have a competitive edge in Europe. That dispute resulted in the U.S. having to change its laws last year.

Library in Sweden allows people to borrow a human

This is just great:

The Living Library project will enable people to come face-to-face with their prejudices in the hopes of altering their preconceived notions, Ulla Brohed of the Malmö Library in southern Sweden told AFP.

"You sometimes hear people's prejudices and you realize that they are just uninformed," she said.

This weekend, nine people, including a homosexual, an imam, a journalist, a Muslim woman and a gypsy, will be available at the Malmö Library for members of the public to "borrow" for a 45 minute conversation in the library's outdoor cafe.

"Maybe not all journalists are know-it-all and sensationalist, just unafraid and curious. Maybe not all animal rights activists are angry and intolerant, but intelligent and committed," she said.

This is something I hope to achieve with my film -- showing that we all have much more in common than we realize. When face to face with someone (or listening to them give unscripted, non-soundbyte responses to questions), you have to treat them like a person, and not a stereotype.

(thanks to my sister Natalie for sending this story to me)

$50 iBooks inspire pandemonium

A school district in Virginia organized an event at a race track to offload 1000 4-year-old iBooks, for $50 each. Excerpts from the CNN article:

"This is total, total chaos," said Latoya Jones, 19, who lost one of her flip-flops in the ordeal and later limped around on the sizzling blacktop with one foot bare.

A little girl's stroller was crushed in the stampede. Witnesses said an elderly man was thrown to the pavement, and someone in a car tried to drive his way through the crowd.

one woman standing in front of her was so desperate to retain her place in line that she urinated on herself.

Jesse Sandler said he was one of the people pushing forward, using a folding chair he had brought with him to beat back people who tried to cut in front of him.

"I took my chair here and I threw it over my shoulder and I went, 'Bam,"' the 20-year-old said nonchalantly, his eyes glued to the screen of his new iBook, as he tapped away on the keyboard at a testing station.

"They were getting in front of me and I was there a lot earlier than them, so I thought that it was just," he said.

Employment discrimination through genetic testing

Ever see the movie Gattaca? One of my favorites. In the movie, the main character cannot realize his dream to become an astronaut, becuase his genes are sub-par. An op-ed in the Seattle Times discusses the issue, and brings to light a case where a company has already begun researching a genetic correlation with job-related injuries:

A couple of years ago, the Burlington Northern Santa Fe Railway tested the genes of injured workers, without their permission, to try to detect a genetic predisposition to carpal tunnel syndrome. The railway, apparently, was looking for a way to avoid workman’s compensation claims by using an unproven genetic test. Only media coverage and action by the U.S. Equal Employment Opportunity Commission stifled those threats.

Briano Eno on perception of time

Here are some comments Brian Eno made in an interview in 1996 about creating the startup chime for Microsoft Windows.

Q: How did you come to compose "The Microsoft Sound"?

A: The idea came up at the time when I was completely bereft of ideas. I'd been working on my own music for a while and was quite lost, actually. And I really appreciated someone coming along and saying, "Here's a specific problem -- solve it"

The thing from the agency said, "We want a piece of music that is inspiring, universal, blah- blah, da-da-da, optimistic, futuristic, sentimental, emotional," this whole list of adjectives, and then at the bottom it said "and it must be 3 1/4 seconds long."

I thought this was so funny and an amazing thought to actually try to make a little piece of music. It's like making a tiny little jewel.

In fact, I made 84 pieces. I got completely into this world of tiny, tiny little pieces of music. I was so sensitive to microseconds at the end of this that it really broke a logjam in my own work. Then when I'd finished that and I went back to working with pieces that were like three minutes long, it seemed like oceans of time.

I've experienced a similar effect when editing video. It's amazing how much the difference a few frames, sometimes even 1 frame, can make in how a transition feels.

Google Instant Messaging

Now Google has instant messaging, using the Jabber protocol, for everyone with a gmail account. Your username is your gmail address (the whole thing, with @gmail.com), and the server is talk.gmail.com. This is great news.

Many have said that there is no SSL support. However, there is TLS support. In fact, I could not connect when I had TLS off, even on port 5222, so it seems that it is required. HOORAY.

I checked and ports 5222 (traditional Jabber cleartext port), 5223 (traditional Jabber encrypted port), and port 5224 are open on talk.jabber.org. I didn't check if any of the other two do or don't support cleartext.

My setup:
client: Adium
username: mygmailname@gmail.com
server: talk.google.com
port: 5222
TLS: on

UPDATE: I am told that with iChat, port 5223 and "Connect Using SSL" works.

UPDATE: Port 5222 requires TLS, port 5223 requires SSL, and nothing works on 5224.

If you installed x-debug and there were no build errors and you followed the installation instructions perfectly and phpinfo() says that it is installed, and it is STILL not working…

Set display_errors = On in php.ini

It's off by default.

Two Guantanamo Bay PROSECUTORS think the system is rigged

The San Fransico Chronicle reports (emphasis and link mine):

As the Pentagon was making its final preparations for war crimes trials against four detainees at Guantanamo Bay, Cuba, two senior prosecutors complained in confidential messages last year that the trial system had been secretly arranged to improve the chance of conviction and to deprive defendants of material that could prove their innocence.

Some quotes from the prosecutors' leaked emails:

I consider the insistence on pressing ahead with cases that would be marginal even if properly prepared to be a severe threat to the reputation of the military justice system and even a fraud on the American people ... Surely they don't expect that this fairly half-assed effort is all that we have been able to put together after all this time.

You have repeatedly said to the office that the military panel will be handpicked and will not acquit these detainees and that we only needed to worry about building a record for the review panel.

Also see coverage at Wikinews. And as usual Dan Gillmor isn't mincing words.




Close
Powered by ShareThis