November 2003 Archives

Chris DiBona

AddThis Social Bookmark Button

Check out my review of the Treo 600, on Newsforge., I’d be interesting in what thoughts O’Reilly readers might have about this device.


Since I wrote the article, I have only become more enamoured with the device. There are so many very high quality apps available for the device. Anyhow…thoughts?

Check out my review of the Treo 600, on Newsforge.

Andy Lester

AddThis Social Bookmark Button

Here are a few of my favorite things. They make my life easier and more enjoyable, and I’m thankful they’re there:

  • MTR - Matt’s Traceroute
    is a beautiful combination of ping and traceroute that
    makes pinpointing network chokepoints a breeze.

  • Vim, my one true editor. Steve Oualline’s
    book Vi
    IMproved (Vim)
    is chock full of instructive goodness.

  • The folks who contribute to HREF="http://search.cpan.org/dist/WWW-Mechanize/">WWW::Mechanize:
    All I do is shepherd the patches. Most of the real work is done by
    people sending me code.
  • CVS, without which I could
    never do any real work. It’s more than just a way to keep
    source code. It’s become a document distribution system for me.
    Essential CVS by
    Jennifer Vespermann is the best CVS book out now.
  • SourceForge, for being my CVS
    repository for public projects
  • Mac OS X, which has
    allowed me to have a solid Unix on my desktop, with a usable GUI with
    support for the applications I need.

  • Exposé,
    which is a godsend in desktop management.

  • RT,
    Jesse Vincent’s great ticket-tracking system, and
    rt.cpan.org, the bug-tracking system
    for the CPAN.

And of course, I’m most thankful for my wife
Amy and daughter
Quinn,
and I’m thankful that my friend and Perl cohort
brian d foy
is back from
Iraq
– if only for a week —
alive and in one piece.

What are you thankful for?

Schuyler Erle

AddThis Social Bookmark Button

Related link: http://www.wired.com/wired/archive/11.12/intel.html

A fascinating Wired piece on Intel’s research into smart motes - tiny devices outfitted with a microprocessor, some sensors, and a wireless link to its peers - which could be “the size of a grain of rice and selling for around $5 by 2011,” if Intel’s plans bear fruit. (Thanks go out to Adam Flaherty for the link.)

Adam Trachtenberg

AddThis Social Bookmark Button

Related link: http://www.apachecon.com

I enjoyed my first time at ApacheCon. As usual, it’s the people who make
the conference, even more than the location or the sessions.

Las Vegas can be fun, but it doesn’t do much for me as a conference
destination. There’s really no place to go unless you want to gamble or
shop. But gambling is no fun alone (nobody else was stupid enough to
waste their money playing blackjack besides me) and the stores are all
chains. That’s one of the reasons I loved OSCon. Portland rocks!
Likewise, I didn’t make it to php{con West earlier this year because I
had no interest in hanging out in Santa Clara.

I really did not attend many of the sessions on the first two days. It
was all “Java this” and “Java that” and I’m just not that interested in
Java. So, I hung out and talked shop with Chris and Nat and others.

The third day, however, was the PHP and Perl track. This not only
motivated me to listen to speakers, but it even had me up in time for an
8:30 talk: Geoff Young’s “Writing Tests with Apache-Test.”

I’ve recently taken a big interest in test-driven development. Geoff’s a
mod_perl guy and the mod_perl developers extensively use Apache-test in
mod_perl 2.0. Apache-test seems really cool because it lets you define
custom Apache httpd.conf settings for each test. Then, when you run your
tests, Apache-test automatically starts up a new copy of Apache using
your exact settings, runs the test, and then shuts down Apache. And it
does this for each test, so there’s no side effects among tests.

PHP has its own testing framework (and PHP works with more Web servers
than Apache, unlike mod_perl). However, I’m interested to see if there’s
some synergy between the two projects.

The following talk was again given by Geoff: “Why mod_perl 2.0 Sucks!
Why mod_perl 2.0 Rocks!” Geoff developed this talk from his experiences
(i.e. frustrations) trying to port his mod_perl 1.3 application to
mod_perl 2.0. It turns out mod_perl 2.0 Sucks! because it’s really hard
to transition from 1.0 to 2.0. On the other hand, it’s much more
powerful than 1.0; therefore, mod_perl 2.0 Rocks! Or does it suck rocks?
Hard to say. (Sorry Geoff.)

I remember moving from php/fi to PHP 3 and then again from PHP 3 to PHP
4. I’m interested to see how the move from PHP 4 to PHP 5 goes. Maybe
I’ll end up writing “Why PHP 5 Sucks! Why PHP 5 Rocks!” Who knows? (Or
maybe Chris will do it, since it was his idea first.)

Speaking of Chris Shiflett, his “PHP Attacks and Defense” talk was the
most intesting presentation of security that I’ve ever attended. He
walked through developing applications that minimize the risk of
Cross-Site Scripting (XSS) and Cross-Site Request Forgery (CSRF)
attacks. It’s amazing to learn how even “secure” pages really aren’t
secure at all.

There was one interesting moment when someone asked a question that
proposed “fixing” HTTP to prevent one type of attack, but before Chris
could answer someone jumped up and said “I wrote the HTTP specification
and it specifically says you’re not supposed to use GET to do these
types of things.” For a moment, I was a little worred for Chris, but he
handled it really well by shifting the blame away from HTTP and onto how
it’s implemented by Web browsers.

I guess the “Localizing BBC News for a Global Audience” talk was good,
but I mostly sat in the back and checked the Internet. Sorry. I was
mostly interested in serving up multiple languages using the same code
base and the talk turned out to be about writing an Apache module to map
URLs to different pieces of content.

Last, I heard “PHP 5 and Databases” by Marcus Börger. I’m already
playing around with SQLite and Iterators, so that part wasn’t too new.
However, I picked up a little bit about PDO, yet-another database
abstraction layer.

All in all, it was definitely worth it.

What did you like best about ApacheCon?

Andy Oram

AddThis Social Bookmark Button

Related link: http://blogs.law.harvard.edu/2003/11/17#a651

In a widely circulated weblog, software designer Dave Winer has called
on major Democratic presidential candidates to issue statements about
current intellectual property battles. Winer is backed up by another
weblog
by noted law professor Lawrence Lessig. Their goal, which I and most
other people in high-tech support, is to to “keep the Internet free of
interference from the entertainment industry,” as reflected in the
DMCA and its harsh application, the anti-KaZaa lawsuits by the RIAA,
the recent broadcast flag required by the FCC on digital reception and
playback equipment, and so forth.

I would go further and say it’s time for a broad-based but officially
sanctioned summit on information transmission involving Congress,
relevant agencies such as the FCC, technology leaders, and content
providers. These would not be the stacked hearings and closed-door
negotiations that usually drive policy in these areas, but a frank
examination of what technological change is doing to our data. It
would not be restricted to the field known as intellectual
property. (The term is not really appropriate, of course, and
technological change is making that more and more obvious as time goes
on.)

Don’t think that current IP battles are just large entertainment firms
defending turf. We will all eventually be towed in by the deep
currents that the content providers are struggling with now.

The plummeting cost and increasing ease of transmitting material
changes everything about information. But policy got off on a bad
footing back around 1995 in the first serious government examination
of the issues, the notorious document “Intellectual Property and the
National Information Infrastructure: The Report of the Working Group
on Intellectual Property Rights,” by Bruce Lehman and the Information
Infrastructure Task Force. This report founded the original sin of
digital policy, defining the movement of bits within a computer as a
“copy” of a work and therefore as a copyright-infringing act.

Lehman’s report essentially declared that the government’s approach to
protecting copyright holders’ interests would be business as usual.
The Clinton administration hereby set itself inexorably against the
technological tide and committed itself to a philosophy totally out of
touch with reality, a course that led to the dismal results we see
today. And yet the doctrine of the infringing computer copy has
spread throughout the world and is being urged by copyright holders on
governments everywhere.

Similar defenses of business as usual have distorted policy in just
about every other area of “intellectual property,” including
trademarks, patents, and trade secrets. While the World Intellectual
Property Organization and its adherents claim to balance technological
change with the interests of current big business, decisions always
slant toward the latter.

But we must not lose all discernment in our fight against abuses by
large intellectual property interests, because they are touching on to
something that affects us all. The ease of storing and transmitting
information that essentially takes on an eternal existence is a social
issue that we all must face. One current manifestation of the problem
is the recent decision by many health clubs to ban cell phones because
some contain cameras that can catch members in compromising positions.

The spread of cameras, sensors, and wireless networks will lead to
more such dilemmas that will make us wish we could sit down with the
intellectual property interests and discuss what we all have in
common. Too many people fall back on the oft-discredited but easy
phrase “information wants to be free,” which is no more appropriate to
the situation than the “get over it” response to violations of
privacy.

We can’t stop the spread of information, but we can try to establish
norms and ground rules for its use. We have to celebrate what we can
achieve with the potent combinations of new technologies, but try to
remain masters of them. And that is why it’s high time for a summit.

Right now, we’re in a battle where those with the most social and
political power benefit at the expense of the rest of us. This means
large corporations having free rein over information transfer where it
benefits them, while they legally restrain its transfer where they
sense a loss. A summit will necessarily have to raise questions of
power, which are the questions powerful interests are most loath to
address. We must push all the harder to make the issues explicit.

What can we learn from the current copyright battles?

Andy Oram

AddThis Social Bookmark Button

Related link: http://www.curia.eu.int/en/actu/communiques/cp03/aff/cp0396en.htm

Sweden has long been a leader in the implementation of Europe’s
privacy directive. Back in 1998 I
reported
on a controversial application of its very strict privacy law. A very
similar case was recently circulated and is described in the featured
URL for this blog.

I think the issues raised by this case, as well as the 1998 one,
should be carefully examined. Let me give a bit of background here.

In sharp contrast to the United States, Europeans have been passing
comprehensive laws for decades to restrict what governments and
companies can do with people’s data. This is partly because Europe has
a more intrusive regulatory environment in general, but partly because
the Nazi experience made the European public conscious of the
importance of privacy and the potential results of its violation.

The current state of legal privacy is reflected in a European
Parliament directive of 1995 that was supposed to go into effect in
laws passed by members of the European Community in 1998. The Swedish
law is very strict one and, as you can see, is strictly interpreted.

Given a directive aimed at abuses by large institutions, it is easy to
scoff at the enforcement of the law against a woman reporting on the
activities of fellow church-goers. But the case alerts us that the
world of data and publishing has changed. A casual mention on a
personal Web site is a big deal, and the court is merely recognizing
reality.

My daughter recently did a Web search for herself, and was surprised
to discover that she can be found on the Web. In fact, her picture was
on the Web thanks to someone who had snapped photos at a casual town
event and posted them with captions. We are not particularly happy
that a girl’s name, photo, and approximate location can be found on
the Web without her decision. I am not ready to go all the way and
call for Swedish-style law enforcement, but I think we should all be
more aware of what we’re doing online.

How does one balance privacy and availability of information?

Uche Ogbuji

AddThis Social Bookmark Button

Related link: http://www.time.com/time/2003/inventions/invmusic.html

I’d probably consider iTunes an invention of a business model than anything else, but I gues that counts. I think its success demonstrates that Jobs’s great gift is not so much inventive genius, but just the doggedness to pursue arbitrage where other business people are bewilderingly blinkered. The Mac was addressed the need for a computer with even a pretense of design values, as opposed to cattle-car PCs. iTunes represents a determinaton to make money off people’s yearning for digital media options designed with even a pretense of respect for consumers. See the article for details on how Jobs realy looks to make money through iTunes. It’s amazing that Apple’s competitiors couldn’t figure out a business model along these lines.

I just said “…Jobs’s great gift is not so much inventive genius…” Perhaps the greatest inventive genius after all is that which makes you wonder in retrospect whether everyone else in the field was sleepwalking when the invention was taking place.

Will we be comparing Jobs/iTunes to Edison/phonograph a century from now?

Schuyler Erle

AddThis Social Bookmark Button

A couple weeks ago, Tim O’Reilly forwarded a posting about mobile phone interoperability in Europe from the Interesting People mailing list to ORA’s editorial discussion list. It seems that travelling abroad with a tri-band GSM phone isn’t enough, according to UCSD professor Sid Karin:

… I can’t resist relating my own experience with Vodaphone last month in Europe. I bought a Vodaphone pay as you go phone in London and ran out of minutes in Switzerland. As it turns out
there doesn’t appear to be anyplace in Switzerland that you can
go to to to top off a Vodaphone phone. I went to an Orange store
to see if they could help. They tried, but no luck. It seems that
Vodaphone modifies the Nokia phones that they sell so that
competitor’s SIM cards won’t work. So much for interoperability
and standards.

Well, this was a familiar story. I recently visited the UK, thinking I would obtain a local network SIM for my Nokia 3650 - which *is* a tri-band phone,
after all - so that I could make calls in country without paying AT&T’s
exorbitant international roaming *and* long distance fees while there.

Needless to say, the phone immediately rejected the European SIM. Then
I proceeded to visit a sequence of cell phone service/repair shops in
London, each of which assured me that they could programmatically unlock
my phone, before returning within ten or twenty minutes to confess that
they could not om fact do it. Most independent mobile service locations in the
UK have, apparently, a Windows
application, that allows them to somehow modify the firmware on phones like mine
– but they need some kind of access code to do it, and the repair shops
in the UK just didn’t have the necessary code. “Which provider do you
use in the US?” I was asked by one. “AT&T? That’s not on my list.”

So much for getting a local SIM abroad. Rumor had it that AT&T would unlock my phone over the air for a fee, so, after I got back to the States, I called their customer service to inquire about it. “Oh no, that phone can’t be unlocked, it’s been locked by the manufacturer,” I was told. Uh huh, right. A call to a local retail location yielded the response, “Yes, the phone can be unlocked, but we aren’t trained to do it, and we don’t recommend it. You might damage your phone.”

Well, I’ve never been one to let a little warning like that stop me. After all, I paid for the phone, and I want it s full capability. Granted, AT&T gave me a hefty rebate on the phone, but as far as I can tell I’m under no obligation to keep the phone that I already paid for in any particularly half-crippled state.

Enter O’Reilly editor Brian Jepson, who remarked in response to Tim’s forward that:

If you want to do it yourself, recent Nokia phones are pretty easy to
unlock (download some freeware to generate a code); Sony Ericsson phones need a special cable (usually best to send it
out to someone to have it done). IANAL, but from what I’ve read, it’s not
illegal to unlock, but it is sort of cheating. If you want to avoid the
problem, just buy an unlocked phone (but you’ll pay a lot more).

Unable to resist a challenge (and not wanting to repeat this month’s phone bill the next time I go abroad), I called AT&T again to inquire of their customer service department - hypothetically, of course - if there was anything in my service contract that would leave me liable for termination of service or legal action if I did unlock my phone. I was told, first, that nothing in my service contract with them prevents me from unlocking my phone; second, that AT&T has no way of knowing if I have unlocked my phone; and, third, that unlocking my vendor-locked phone was illegal. When I pressed for details on the illegality of SIM unlocking, I was told they couldn’t provide me with any further information on that subject. And, of course, I’ve never been misled by an AT&T representative, heavens no.

So I decided to go ahead. This information is provided for educational purposes
only, and you should understand that acting on this
information may irreparably damage your SIM and/or
your phone. As far as legalities go, check the contract
from your service provider, as some contracts may
prohibit this activity. O’Reilly & Associates, Inc.
disclaims any liability for any consequences of using
this information.

I started by googling for nokia unlock software, and, lo, and behold, I found unlockme.co.uk, which has a substantial section on unlocking Nokia phones, including freeware downloads and a walk-through tutorial. I couldn’t get the Win32 unlock code calculator from unlockme.co.uk to run under wine on Linux, but at Brian’s recommendation, I also visited unlocksmith.com, which offers a self-extracting, freeware Nokia DCT4 unlocking suite. (Don’t ask me what the difference between DCT3 and DCT4 is - the aforementioned sites will tell you which one applies to your phone.) When I installed this package in wine, I found a command-line tool called DCT4NCK.EXE that wine executed with no trouble at all:


DCT4NCK by jozso v0.0a
----------------------
Usage: dct4nck locktype imei provider [boxserial]

The locktype, according to unlockme.co.uk, is usually 2, unless you’re on a 3650 or 7650, in which case it’s 5. The IMEI is the hardware serial number of your phone, which you can read off the inside label underneath the battery, or retrieve from the phone itself by dialing *#06#. Finally, you’ll need the provider code, which is a 5-digit number you can pull from this network provider code list. Unlock code calculators give you seven different codes, at least one of which should unlock the phone when entered with the SIM removed, but you only get five tries, before the phone locks you out. So, you really want to double-check your work before entering would-be unlock codes into the phone.

Undaunted, I ran DCT4NCK using the appropriate locktype, IMEI, and provider code for my phone, and got back seven 22-digit codes. Following the recommendation of the unlockme.co.uk tutorial, I took the SIM out of my phone, turned it on, and entered the seventh and final code listed, hitting ‘*’ consecutive times to get the ‘p’ and the ‘w’, but I omitted one of the digits, and got an error message from the phone. So I tried again, careful to enter the whole code, with the same result. Then I noticed that, a little further down, the network provider list shows special provider IDs for Nokia 3650s with particular IMEIs — which included mine! I generated a new set of unlock codes, and punched the last one into the phone. Same error.

Well, now I was starting to sweat a little. I’d gotten three consecutive errors, and I only had two tries left. So I went over the tutorial one more time, and found the following footnote: “For 3650 AT&T USA, always use code 1 out of the 7 generated!” Crossing my fingers, I tried the first code of the seven I’d generated instead, and voila — Success! A message popped up on the phone indicating that it had been unlocked. I put the SIM back in the phone, powered it up, and I was back in business, with no apparently harmful side effects.

So don’t believe the hype if your network provider tells you that your Nokia phone can’t be unlocked, or if a service location tells you that you need to pay someone for the privilege. Although your mileage may vary and you naturally do so at your own risk, with a little time and a little patience, you too can unlock your own GSM phone, and use it with a SIM from the service provider of your choosing. Power to the people!

NOTE (2005/04/30): Please don’t email me or post your IMEI here. I’m not an expert on this subject, and all the information I can offer on the subject has been given in this weblog entry. You also might try this site as well. My humblest apologies for any inconvenience.

Have you had any experiences with SIM-locked mobile phones? Is the ability to manually unlock a phone an abuse of the network provider or a consumer’s right?

Andy Oram

AddThis Social Bookmark Button

In the server market, Linux and Microsoft were supposed to
be mauling each other like jackals by now. Instead they are
contentedly polishing off the bison of Solaris, IRIX, and
other proprietary Unix server software. Linux and Microsoft
Windows have both grown in the server market–Windows faster
than Linux.

Linux on the desktop is a similarly confusing story. A

conference on desktop Linux
,
the first of its kind, was held in the Boston, Massachusetts
area on November 10. The forum allowed the leaders of Linux
and free software development to evaluate the progress these
have made on the desktop.

Linux as an end-user system is at an early stage, but
inroads are impressive. One statistic puts annual growth of
Linux on the desktop at 44%. It is already in heavy use as a
limited, kiosk type of application (point-of-sale terminals,
for instance) and as a technical workstation. More general
use is expected to come within the next couple years.

By now, free software office utilities are perfectly
satisfactory and largely compatible with Microsoft Office;
if they lack certain features of Office, they also lack
certain bugs, and compensate with their own features and
bugs. A sizeable base of knowledgeable administrators has
emerged. And installation shouldn’t be such a big issue.
Windows installation can be hard too, and people often turn
to professionals for installation.

So why hasn’t Linux made big inroads yet among ordinary
computer users? Let’s look at a few theories–two that are
relatively commonplace, and one of my own.

The first theory is that Linux’s advantages will eventually
overcome corporate and government conservatism. A roadmap
was even laid out in the Desktop Linux Conference (described
in my

weblog from the conference
).
In fact, the tipping point could be so near that we may all
soon be laughing about the time we were worried about
Linux’s difficulties. Japan and China, combining one of the
world’s most important established economies with one of its
most important emerging ones, are pouring huge amounts of
money into Linux. IBM is no slouch either. People are
getting it: Linux is a solution to many current computing
ills.

A second possibility is that Linux may not catch on at all
for Mr. and Ms. Average Schmo, at least not for the
foreseeable future. But is that so important? Linux could
meanwhile become dominant for servers, embedded systems, and
kiosks. It could also reach the Average Schmos on large
organizational networks using
Linux Terminal Server Project.

But we should also consider a third theory. Nat Friedman of
Ximian (now Novell) explained at the Desktop Linux
conference that the highest barrier to Linux adoption is the
cost of rewriting applications. This was the conclusion of a
consulting firm brought in by the city of Munich to
determine whether it should replace Windows with Linux. The
consulting firm warned that application migration costs
would override the savings in licensing fees, and Microsoft
came in with a stunningly low counter-offer. Munich decided
to move to Linux anyway, for strategic reasons. But it’s a
hard decision to make.

Friedman and the Munich consulting firm were not the only
ones to point this out. Back in September, the well-known
consulting firm Gartner reportedly told companies that it
would cost them money to move to Linux–precisely because
they’d have to rewrite their applications. For desktop
users,

“migration costs will be very high because all Windows
applications must be replaced or rewritten.”

And this is the same Gartner that had warned companies to
get off of Microsoft Windows because of security flaws!
(Before Gates and Ballmer started to make grand promises
about putting security at the top of their priorities.)
Despite Linux’s advantages in the areas of licensing,
stability, and openness, Gartner believes companies would
lose money by switching.

Another
article
is more hopeful but suggests that it would take five years
to see financial benefits after a switch from Windows to Linux.

And that leads me to my theory.

For Linux to reach the ordinary user, it has to offer more
than good office suites and The Gimp and other free software
implementations of common applications. Most people won’t
make the move just so they can keep doing what they did
before. Security and freedom mean a lot to a few of us, but
they are not enough incentive for the vast range of Average
Schmos. And we need those Average Schmos; the median is the
message.

People will move because they feel forced to–because there
is an entirely new way of working that the old system cannot
offer, and the new system can. It must be a shift that
sweeps up millions of adherents and becomes a perceived
necessity.

Historically, graphical user interfaces were just such an
innovation (although if you were around when they first came
in, you might remember how many ordinary people stubbornly
stuck to their old command or full-screen utilities for
years). The Internet was another: Microsoft, AOL, and others
had to really scramble to avoid being swept into the dustbin
by it.

No single new application is enough to cause a switch.
Microsoft is perfectly capable of writing applications, so
if somebody thinks up a neat utility on Linux, people will
soon get something like it on Windows. What we’re talking
about is a new paradigm (pardon that word); a whole shift as
big as GUIs and Internet use. What could it be?

Let me break my chain of reasoning here to point out that
Microsoft itself is not afraid of changing the way people
use computers. It’s forging ahead with initiatives such as
Longhorn and SharePoint which, if they live up to the hype,
will put people in new relationships with their data and
with each other. Microsoft has put tremendous energy into
separating data from presentation and creating frictionless
chutes that carry the data from database to office
application to Web page with minimal user intervention.

As usual, one can get snowed when presented with Microsoft’s
lists of audacious upgrade features. But what emerges for
me, as the basic Microsoft vision for the computing future,
is an impressive pervasiveness of data–data that can
instantly be viewed and tabulated by anyone who wants it
using the most convenient tool at hand, without fussing over
conversions and conscious transmission from place to place.

Microsoft is not stuck in the past; they’re pulling as hard
as they can to move their users to these upcoming
innovations–trying to make them seem indispensable to
staying competitive–because otherwise the company will have
to stand by and watch the hose that gushes license fees
gradually diminish to a trickle over the next couple years.
No, Microsoft is pushing ahead. If any developers are stuck
in the past, it’s the free software programmers diligently
recreating what’s been done before.

But the kink in Microsoft’s hose is that its business plan
is a plan for business, not for end users. On the whole,
Microsoft’s initiatives revolve around corporate data use,
and depend on adoption by corporations. And corporations
are naturally conservative. They’re afraid, for instance,
that the grand SharePoint achievement of integrating office
applications and corporate servers will lead to more bugs
and security problems with both. They’re not likely to
budge.

Individual users, by contrast, are not conservative. History
has shown them to be, if anything, quite reckless. Look at
what hordes of ordinary people did when they get their hands
on Web server software in the early 1990s. Look at the
current popularity of instant messaging, and now SMS, both
of which started as novelties. Look at the millions who
signed up for the original Napster, and then slid over
comfortably to current peer-to-peer systems.

So Linux has a natural user base it can appeal to. The very
people advocates are trying to reach–individuals at home
and in school–are the people likely to drive radical
innovation in computing.

The area where Linux excels is services. Apache, Samba,
MySQL, and mail transfer agents are practically household
words thanks to Linux (although of course they run on many
other systems too, and are found on Windows more often than
people give credit for). Anything that you need to do that
requires running a service benefits from the
state-of-the-art network stack and security offered by
Linux. This includes peer-to-peer applications, as I
explained in a
talk
I gave back in 2002.

What’s the advantage of running an application as a
continuous, background service? Many find it hard to
remember, because the division between server and client has
become so commonplace (and the second-class citizenship of
the Average Schmo, exiled to the client side, has been
enforced for so long). Advantages include:

  1. You’re more in charge of your own data. You don’t have
    transmit it to some remote system under somebody else’s
    bailiwick or beg for someone to put it up for you before
    others can access it. Immediacy opens up whole new
    dimensions, such as the ability to provide dynamic,
    instantly customized content.

  2. You’re more in charge of your own processing. You can choose
    when to process information in tiny chunks and when to
    postpone processing and do it in batches. You can choke off
    access or open up new threads to accommodate more. The
    simple, synchronous connections clients have may work for
    small amounts of communication, but when you get busy it’s
    critical to have the flexibility of a server.

  3. You’re more likely to be able to support multiple users.
    Many servers recognize the idea of an account and offer
    access controls.

But running a service on your computer is socially
disruptive. It puts control in your hands rather than in a
central professional staff, so it’s suspect in large
organizations. It also bothers Internet providers because
you need potentially more bandwidth, a static IP address,
and perhaps a domain name. But accommodations have been made
for activities as diverse as file-sharing, Web servers, and
chat. The practice may grow, and that’s where the arguments
against migration to Linux break down.

Will the move to desktop Linux take place?

Andy Lester

AddThis Social Bookmark Button

Three times a week, MarkovBlogger posts an entry at
use.perl.org.
It always has something interesting to say, like:


as we all fear about cloning is reproductive cloning - replacing your failing organs with fresh, healthy ones (by creating a new IO system on my knee for about an hour with wireless (source)


if we decide to install ZoneAlarm on the schedule because there are no O’Reilly books for us, the Old Executive Office Building was in Monterey, I think. Perhaps “furniture” is a pro-choice/anti-microsoft one.
(source)


I’m glad I got another email message to fill a bottle with a laser printer for a database with lots of useless constant globals. :-)
(source)


I went to lunch with most object inheriting from the heat. The crocodile feeding was the response to a different icon)
(source)



The MarkovBlogger was created by
Joe Johnston.
It’s
a simple Perl program adapted from a program in The Practice Of Programming that performs its analysis on use.perl.org journal entries, and posts a journal entry of its own twisted creation.


I first ran into autogenerated text back in 1984 from an article in Byte with a program listing for
Travesty generator. I believe it was in BASIC, and I had to translate it into Turbo Pascal. I was hooked, and threw every scrap of text at it that I could find.


My thanks to Joe for providing this valuable public service.

Where else have you seen Markov chains applied on the web?

Dale Dougherty

AddThis Social Bookmark Button

In what could be good news for the Web, the Director of the US Patent and Trademark Office has ordered a re-examination of the ‘906 patent, which was the subject of a patent infringement lawsuit this summer brought by Eolas against Microsoft.

Issued in 1998 to Michael Doyle of Eolas Technologies, the patent (#5,838,906) covers the ability to embed and control applications (or objects) in a web browser. Doyle succeeded in obtaining a $500M judgement against Microsoft. In the aftermath, Microsoft said that changes to the browser were necessary to work around paying royalties on the patent, and that these changes would impact developers who create and maintain web pages. Many believe that the patent would also affect other technologies such as Flash and Java as well, which are launched from a browser.

On October 23, the World Wide Web Consortium (W3C) filed a request for re-examination, citing prior art that defined the early HTML standard, written by Tim Berners-Lee and Dave Raggett. In their appeal to the Commissioner of the PTO, the W3C said: “The cost to the larger World Wide Web community of fixing the problems created by such a change to Internet Explorer is incalculable, but would likely require changes to millions of Web pages, as well as changes to Web page authoring tools and other software and systems designed for the World Wide Web.” It called this kind of “disruption” to the web “completely unwarranted, in view of the patent’s invalidity.”

Apparently, the PTO responded to this request, saying “a substantial outcry from a widespread segment of the affected industry has essentially raised a question of patentability.” This order, issued on October 30, reviewed the claims and declared that the prior art introduced by Berners-Lee and Raggett raised “a substantial new question of patentabity.” The order, signed by Steve Kunin, Deputy Commissioner of the US PTO, called for a reexamination of all claims relating to the ‘906 patent.

A patent lawyer that I spoke to said that the quick response by the PTO was unusual, and he thought it was a good sign. He said that the order seemed to give a clear indication of support for the claims against the patent. We’ll now have to wait for a patent examiner to examine the evidence in more detail and rule on the patent.

If you want to follow the adminstrative procedures, go to http://pair.uspto.gov/cgi-bin/final/home.pl and the type in the application number: 90/006,831.

Note: I testified in the trial this summer on behalf of Microsoft’s claim that the early Viola browser developed by Pei Wei was prior art for this invention.

What do you think?

Andy Oram

AddThis Social Bookmark Button

Related link: http://www.butrain.com/itp/desklinux.asp

It was a lucky stroke of fate that brought the first Desktop Linux
Conference on November 10, a time of some distress among Linux
proponents. In the past two months we have had to assimilate Red Hat’s
abrupt change in licensing, which reduced its consumer presence
(although, as VP Brian Stevens pointed out at the conference, Red Hat
Professional Workstation is still available, albeit at a higher price
than earlier offerings). Rubbing in the message even further was the
blunt
declaration
a week ago by Red Hat CEO Matthew Szulik that Linux was not ready for
ordinary home users: “I would say that for the consumer market place,
Windows probably continues to be the right product line.”

The

purchase of SuSE by Novell

offered a bounce in the news, but we still don’t know what difference
that will make.

In this context, a spanking new and dynamic Desktop Linux Conference
from the
Desktop Linux Consortium
can remind us that Linux adoption is on a strong upward trend. The
central lesson did not depart much, actually, from Szulik’s
assessment. Nat Friedman, cofounder of
Ximian,
pointed out in his keynote that it’s not a question of “when will
Linux be ready for the desktop,” as if some key feature will fall into
place and cause a “big bang” that leads to instant acceptance.
Instead, Linux will advance steadily in the desktop space, as it has
in the server space. Sam Docknevich, Linux and Grid Services Executive
at IBM, pointed out that Linux penetration on the desktop is actually
proceeding faster than its penetration among servers. For the past
couple years, desktop adoption has been growing at 44% a year.

Friedman, Docknevich, and others gave similar messages: that one
doesn’t get far by indiscriminately pushing Linux everywhere, but must
determine what environments and users are ready for Linux. The
speakers even charted a similar roadmap for the stages of adoption.

First is the kiosk: point-of-sale terminals and other systems with
extremely limited applications, where programmer control over user
activity is fairly complete. Linux is already making big inroads in
that market.

Second are technical users, who often use Sun or SGI workstations and
are now moving to Linux. Learning Linux is easy for them, and many
applications are already ported.

Successive trends are barely starting, but will come in time. And
probably sooner than the five years or so that many analysts predict.

The next stage will bring Linux to workers who need computers, but for
fairly basic operations. Their usage does not go beyond email, Web
browsing, moderate use of word processors or other office
applications, and perhaps one or two custom applications that a
company can port to Linux. These people can often use Linux with
Evolution, OpenOffice, and Mozilla without even realizing that they
aren’t on Windows. A thin client solution such as
Linux Terminal Server Project
will make migration particularly easy, and maximize financial savings.

Last, and most difficult to conquer, are the advanced knowledge
workers. These people often carry out sophisticated tasks with
specialized features of proprietary software that aren’t reproduced in
free software equivalents. The path for them may involve an emulator
such as
CodeWeavers
(based on
Wine)
or
NeTraverse,
both of which were introduced a full session of about 35
attendees. Jeremy White of CodeWeavers explained that he considers
Wine “a bridge to a Linux desktop.”

Other presentations at the conference covered other projects that are
currently driving Linux adoption or will be potentially significant in
the future: LTSP,
SELinux,
OpenSSL,
GNOME,
KDE,
and
Freedesktop.org.

But the conference atmosphere did not always consist of holding hands
and singing hosannah. Significant disagreements were aired. Several
participants criticized Red Hat’s new licensing policies and suggested
either that they violated the spirit of the free software movement
(because of restrictions placed on customers) or were simply part of
an outdated and doomed pricing strategy. “Selling Linux by the seat,”
said Desktop Linux Consortium spokesperson
Bruce Perens
in his keynote, “may not be healthy for Linux.” And Nat Friedman
declared, “Per-seat desktop licensing is dead.” He suggested we
“fundamentally alter the economics” through thin client solutions such
as LTSP.

Posing a direct challenge to the Red Hat strategy, Perens announced a
“user-driven Linux” initiative. Here, major customers would pool their
money and put it into creating an alternative enterprise Linux that
would be distributed freely, instead of paying licenses. While he
acknowledged that Red Hat’s opening up of Fedora met some of the same
needs as the GNU project’s open
Debian
project, he said Fedora “just feels too much like putting money in Red
Hat’s pocket. I’d rather have it go to the users.”

Brian Stevens of Red Hat, when the time came for his session, got to
present an explanation and justification of Red Hat’s current
strategy, as well as showing how their development process supports a
reliable and easy-to-maintain set of products.

He cited the Open Source Architecture
announced
by Red Hat in September 2003, which built on an announcement made a
month earlier at LinuxWorld and reported in my
weblog from there.

Red Hat is moving “up the stack,” including applications and other
components, “building full enterprise solutions.” Examples of the
customer concerns Red Hat has to address include how to do single
sign-on, and making sure the operating system has the resources needed
to run a high-availability database cluster. Perhaps predictably, Red
Hat is sounding less like a “Linux company” and more like a “solutions
company,” where it will compete with a different set of vendors.

Stevens also pointed out that the move from high-end Unix systems to
Linux on cheap Intel chips has caused the number of systems to
proliferate. Customers tend to run a single server on each
system. And the use of many systems creates a management problem.

Perens presented a talk on the SCO situation (which I couldn’t get to)
and Tom Adelstein, of
Project Leopard
and the
Open Government Interoperabilty Project,
described an initiative to define standards for critical government
software and disseminate open source solutions. Right now, governments
everywhere are struggling with old software that vendors no longer
support. Their systems are out of sync with their own standards, and
therefore unable to communicate with the systems in other agencies to
carry out critical tasks such as exchanging criminal records. With
Project Leopard, not only will governments save millions of dollars,
but for the first time they will have software that actually
interoperates and conforms to the standards they wrote.

All in all, the Desktop Linux Conference is a big step forward. Thanks
go to the Desktop Linux Consortium, who announced that they will soon
be offering membership to individuals, and to Boston University for
providing an excellent facility and support. I will post a follow-up
analysis in a couple days.

What’s happening with Linux on the desktop?

Chris DiBona

AddThis Social Bookmark Button

Please don’t read this as me endorsing or not endorsing any one method over another, I just wanted to put up a chart comparing all the different services/methods in a realistic picture of the state of the music trade in the age of dsl, cable modem and cd burners. Many such comparisons ignore some of the realities of the internet, files servers and the very existence of email and cd-burners.


Some cost notes: I considered CD capacity as being 100 songs (giving roughly 6-8 megabytes/song which seemed fair) and an upstream bandwidth cost of $1/gigabyte as per Jim Gray and others, which could be a bit low, but good enough for this chart, considering that isn’t how many pay for their bandwidth.


Any suggested additions are welcome! Post em in the comments!

style="width: 90%; text-align: left;">
Method Price/Song Provider Pros Cons Notes
iTunes 99¢ Apple Works great with iPod/liTunes
player
aac format, drm, troubling with
other non-ipod mp3 players.
Stylish!
buymusic.com 79¢ to $1.79 Buy.com Can’t think of any. only works with internet
explorer, overly complex, seriously flawed drm & burning
characteristics, doesn’t work with many players.
Guh.
email .488¢ (if you pay for bandwidth or nothing. Your ISP/Work Share mp3s with anyone you like,
burn or use on whatever player
Large email sizes slow down
regular email and spam. Potentially illegal but  prosecuttion
unlikely.
Cost derived from a 1$/gb
transmitted upstream cost.
over the wire from shared server Free Your Lanparty/ Work Fast! Fun! Limited to the tastes of the
people you know, hard to find some albums. Potentially illegal
but  prosecution unlikely.
Kazaa .488¢ Kazaa Vast Selection Could get sued, poor quality
d/ls sometimes and interrupted transmissions. Potentially illegal.
Cost derived from a 1$/gb
transmitted upstream cost
mp3s burned onto blank cds .08¢ You/Friends Fast, easy, burn as mp3s or cd
audio for car, flexible & usable format widle supported
Limited to the tastes of the
people you know, hard to find some albums. Potentially illegal
but  prosecution unlikely.
Cost derived from blank cds
costing 8¢ on special (I paid 5¢ once, so I thought that was
fair)


I didn’t include Rhapsody because I have a professional relationship with Real Networks.

itunes vs. buymusic vs. burning cds..

Andy Oram

AddThis Social Bookmark Button

Related link: http://www.vocera.com/

Tamara Shelton,
CEO
of
Athene Consulting,
has alerted me to a cool and useful combination of database
technology, 802.11 networking, and voice recognition. Vocera assembles
these building blocks into a convenient and intuitive system that ties
people together tightly throughout an organization. The product is
particularly popular in hospitals, where speed and cooperation are
often critical and where (I imagine) the staff don’t feel
self-conscious sporting a four-inch high black badge in addition to
their other professional garb.

Typical uses for Vocera include:

  • Calling people by name and being connected instantly to them, no
    matter where they are in the building.

  • Finding out where people are located.

  • Requesting someone by group (”Get a Rehab Therapist here”) and being
    connected to the closest member of that group. This is a fairly simple
    database join between the group and the set of base station locations.

VP Brent Lang says, “Vocera is to the telephone what instant messaging
is to email.” In other words, Vocera offers immediacy, presence, and
enough efficiency to encourage tiny interactions.

The Vocera system itself is an intriguing juxtaposition of elements
from different areas of computing:

  • MySQL database

  • Java application

  • Windows 2000 Server with 802.11 networking.

  • Nuance (http://www.nuance.com/) voice recognition system

Nuance is described by Lang as the leading voice recognition system in
the industry. Its Web site says, “The modular approach of the Nuance
architecture enables the separation of light client processing from
CPU-intensive server processing.” This sounds like a good match for
the small Vocera badges.

While cell phones are banned in many hospitals because they could
interfere with medical devices, the 802.11 spectrum use poses no such
risk.

System administrators have to initialize their Vocera database so it
contains the device for each person, groups such as Rehab Therapists,
administrative groups (such as who can add and remove people), and
names that identify where base stations are located (so the system can
produce vocalizations like “Dr. Fon is in the cafeteria”). Lang
describes Vocera administration as quite easy; information for a
600-person site could be entered into a database in one or two days.

The administrative interfaces range from a CSV file to a Web graphic
display to voice commands. Thus, if you want to add somebody to a
group quickly and have the privileges to do so, you can do it by
speaking into your badge. Privacy is achieved by keeping up with
improved standards for wireless encryption (such as Wi-Fi Protected
Access) and through the careful enforcement of access rights.

Shelton, a product management consultant and evangelist for wireless
communications, writes, “VoIP will play a big role in the clinical
professions, especially in hospitals, emergency services and in
mobile-field clinics.” She notes that nurses waste a lot of time
waiting on hold, or leaving messages to other medical personnel.

Vocera shows the power of planting familiar technologies into a
fertile combination. Substantial improvements in how organizations
work can sometimes be achieved without risking radically new and
untested technology. As one of Vocera’s clients might say, removing
impediments from natural ways of operating may lead to a more
effective cure than forcing invasive changes.

What are some other nonintuitive uses of wireless?

Rod Chavez

AddThis Social Bookmark Button

a couple of weeks ago, a friend of mine here at BEA from the NetUI team
(Eddie O’Neil) sent me email saying he’d
been playing around with MySQL and WLS, and that he thought it’d be interesting
to post that work so that people could have an easy path to follow when trying
to get the two working together. i agreed of course, so i told him to send me
what he had and i’d take it, wrap some words around it, and put it online. if
life were only that simple <g>

that was over 3 weeks ago. he sent me something that worked, i spent 5
minutes reducing it to a smoking mess and the rest of the 3 weeks getting
everything going again. what took so long? some of it is just me, in that i’ve
got a particular way i want things to work so that what seems simple winds up
being quite hard (and i can be a tiny bit stubborn, so when i hit a rough patch
i tend to keep going forward, when all sense would dictate that i go back and
try something else), and some of it is that there are a number of subtleties
that make it hard all by itself. we’ll wind up covering both here, and see
which is which

the first thing i always want to do when trying to show how something works is
to use it to do something. somehow i just find i don’t understand something,
and hence can’t explain it, until i’ve done something “real” with it. but what
to do, what to do?

TinyURL
i don’t know about you, but i’ve been seeing people using tinyURLs just about
everywhere lately. if you’ve never heard of them, they perform a very simple
but useful task; they turn big URLs into small ones. tiny ones, in fact <g>.
the big problem this solves is the line-breaking-in-email problem. i’m sure
you’ve all experienced a situation where you’ve gotten a piece of email
containing a “long” URL (like a Yahoo map or a Google query) where somewhere
along the way the URL got split onto multiple lines, and part of the link gets
“broken off” so when you click on the link, it doesn’t take you where it
should. you wind up having to paste twice or some such manual hackery. and if
you sent the ling to someone who’s a bit clueless, you’ll get a “your link
didn’t work” reply back

TinyURL takes care of this problem by allowing you to submit your “long” URL
and they return a “tiny” one. this can be used pretty much anywhere the long
one could have been, and since it’s really short, it pretty much never gets
split or broken. it has the added benefit that you can use it places that a
long one wouldn’t fit, like in your IM status

what do TinyURLs have in common with MySQL and WLS? nothing in particular, but
i thought it would make a cool, simple example of a data based web-app that did
something useful, all by itself, in not too many lines of code, so that’s what
i decided to build

how does TinyURL work?
before i could write a line of code, i had to figure out how TinyURL worked.
so the first thing i did was submit the following URL,
http://www.oreillynet.com/pub/au/1303,
and they returned
http://tinyurl.com/sr66. not a huge
reduction in size, but enough for you to see what they do. and when i chase the
URL they returned, i wind up at the page i submited (which happens to be my
bio on ORN)

so the next thing i did was use wget to see what was actually going back
and forth on the wire to make this dance work. here’s what i found

$ wget http://tinyurl.com/sr66
--14:29:19--  http://tinyurl.com/sr66
           => `sr66'
Resolving tinyurl.com... done.
Connecting to tinyurl.com[216.234.186.14]:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://www.oreillynet.com/pub/au/1303 [following]
--14:29:19--  http://www.oreillynet.com/pub/au/1303
           => `1303'
Resolving www.oreillynet.com... done.
Connecting to www.oreillynet.com[208.201.239.37]:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]

    [  <=>                                ] 19,325        36.79K/s             

14:29:20 (36.79 KB/s) - `1303' saved [19325]

so looking closely at what happened, wget chased
http://tinyurl.com/sr66, only to have the server return a 302 and
another URL, http://www.oreillynet.com/pub/au/1303. a
302
response code
means, in essence, that the server understands what you’re
asking for, but wants you to know it’s temporarily someplace else, and
that place is at this URL i’m handing you. so the user-agent (read: browser, or
more properly, http-client) should now rerequest the document from this new
location. which of course is what wget does, returning the final target
document. nice

MySQL
now that we know how TinyURL works from an HTTP protocol point-of-view, we need
to start thinking about what kind of storage needs we’re gonna have. first,
we’re going to need to accept a URL (let’s call this the userUrl) and
return a URL (let’s call this the tinyUrl). sounds pretty simple. we
create a table with two columns (tinyUrl, userUrl), uniquely indexed on
tinyUrl. ok, that seems simple, just create a table like that, both columns as
TEXT, and then… wait a minute. er, exactly how did that tinyUrl get created?
i mean, how do we create a unique tinyUrl for one userUrl, and a different
tinyUrl for a different userUrl? and also make sure that it works properly in
the face of simultaneous requests, which compounds the problem of trying to
create something unique by introducing synchronization issues into things. i
mean, what good would it be to make sure we didn’t duplicate any “already
created” tinyUrls, if we didn’t also make sure that we didn’t accidentlly
create duplicates because the tinyUrl generation code was run twice at the same
time?

fortunately for us, databases turn out to be great at helping to solve these
kinds of problems. first off, they’re built to handle simultaneous requests and
enforce all sorts of interesting rules about how to deal with concurrency. but
they also understand how to play a role in creating uniqueness, like
customer-id used as the primary-key in a database. i’m not going to try to
cover these concepts in a general way, as there are (quite large) books
dedicated to these subjects <g>. but i’ll drill into the parts we need to make
our service work

AUTO_INCREMENT
MySQL has this cool feature where you can declare an integer column as
AUTO_INCREMENT. when you insert a new row into a table with a column like this,
MySQL determines what the current MAX value in the column is, adds 1 to it, and
uses that as the value for that column in the new row. the great thing about
using this feature is that MySQL is taking care of both problems we were
dealing with, namely how to come up with the “next” tinyUrl to use, and also
how to do it in such a way that simultaneous requests don’t result in the same
tinyUrl being created. MySQL, like almost all database products in existence,
handle concurrency as a matter of course

of course, this changes the code we’re going to need to write somewhat. instead
of storing tinyUrl as a string it’ll be an integer in one of these
AUTO_INCREMENTing columns. so where does the URL come from? it’s interesting to
notice that most of what’s returned to the user to use as a tinyUrl is always
the same. the only part that’s really unique is that little bit at the end. in
the above example where we used the real TinyURL, that was just sr66

given our new desire to store this little unique bit as an integer, it would
make things nice and simple if we just turned it into a string, so that the
integer 1 would turn into the string “1″. and so our URLs would look like
…/1, with the ellipsis (…) being the “static” part of the URL, the
part that never changes. hmmmmm, that is simple, why doesn’t TinyURL do that?

i have no idea how TinyURL is actually written, although some friends and i
have speculated on this a few times. but i think it’s safe to assume they are
doing something similar to what i’m describing. but as we already know, the
unique part of their URL doesn’t look like an integer. or does it?

most of the developers reading this will be familiar with hexadecimal
notation
, or HEX for short. HEX is a base-16 number format, which means
there are 16 different values possible in any given “place” in a number. as
opposed to the base-10 system we (or must of us) grew up with where the values
are 0 through 9 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9), in HEX the values
are 0 through f (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, a, b, c, d, e, f).
but things don’t really have to stop there…

sexatrigesimal
welcome to sexatrigesimal <g>. that’s the correct name (i think) for
a base-36 number format. googling around, i found a page on the
Names of bases for
number systems
“. and while the page does not provide a name for base-36
directly, i think i understand the rules being used and base-36 would be named
sexatrigesimal, or what i’m going to call STG for short

in STG the values are 0 through z. in other words, instead of
stopping at f the way HEX does, it keeps going until z. of course
the next question would be, why bother? why not just use decimal or HEX?

the answer would be, to keep things tiny! taking the case above where TinyURL
returned sr66, and assuming i’m doing the math correctly, and also
assuming that i’m correct about how this string is encoded, i’d say that that
value represents 1386134. or a shortening of almost 50% over the
decimal notation (from 7 characters to 4). and it should only get better over
time, as the number of pages just keeps getting larger

one other question some of you may be asking is, “ok, but why not keep going
with this? why not split the alphabet into upper and lowercase letters to
yield another 26 values to our number format (that’d get us base-62), and there
are lots of other characters that could be used in the path of a URL, like
(’.‘, ‘/‘, ‘&‘, etc), why not use them too? we could get
up to base-70 or maybe 90? the only answer i can think about that makes sense
is that in addition to making URLs a lot smaller, this is also supposed
to make things easier (which is a reason near and dear to my heart). and
it’d be a real pain to type or copy (or speak aloud?)
http://tinyurl.com/s.S&“, don’t you think? and just to double-check and
see what TinyURL actually does, i hit them with the URL i’d gotten back from
them earlier, but with the sr66 up cased to SR66, and they still
bounce me to the same page. so it at least appears like they’re using
something like STG as their format

whew, what a rathole, eh? <g> ok, now let’s see where we are. we know how
TinyURL does their tricks with the browser, how they encode their URLs (or at
least how we’re going to do it), how we’re going to interact with MySQL to help
us generate unique URLs and deal with concurrency, is there anything else, or
can we just start doing stuff yet? i think we’re ready to go now, let’s
build it

MySQL install and startup
first, we need to get MySQL installed and ready to run. since i’m doing this on
RH9 it’s drop-dead-simple, since MySQL comes as part of the RH distribution. so
as root, run the following commands to get the RPMs installed:

$ sudo rpm -i mysql-3.23.54a-11.i386.rpm perl-CGI-2.81-88.i386.rpm 
    perl-DBI-1.32-5.i386.rpm perl-DBD-MySQL-2.1021-3.i386.rpm
$ sudo rpm -i mysql-server-3.23.54a-11.i386.rpm

the other nice thing about using the MySQL that comes with RH9 is that it’s
been setup to run as a service in the *nix style. so once installed, again as
root, all you need to do to get it running is to run the following command:

$ sudo /sbin/service mysqld start

you can stop it the same way (but replace the word start with stop). and if you
want MySQL to start at boot time, then the following command will make sure
that happens too:

$ sudo /sbin/chkconfig mysqld on

now that MySQL is installed and running, we can install and run the ‘tiny’
service i’ve written

download and install the ‘tiny’ app
if you want to install the service yourself, or just use the scripts and code
for your own purposes, it’s all packaged into a zip that you can
download. i’m going to
walk through the steps to install it, and after that walk through in detail how
it works

  1. shutdown WebLogic Server. if you’re using the same configuration that i
    describe in my
    first blog post, all you
    need to do is the following

    $ sudo /sbin/service wls stop
    

    note that the rest of these instructions are all relative to that install.
    if you’ve got WLS someplace else, translate accordingly

  2. now we need to add the MySQL JDBC driver to the WLS classpath. to do this we
    need to download it and put it where WLS can find it. MySQL maintains the
    following page,

    http://www.mysql.com/downloads/api-jdbc-stable.html
    , where you can download
    a tar or zip of the latest production JDBC bits. go there and click on the
    “Pick a mirror” link for getting the zip file. from there you can pick
    whatever download site is closest to you. once you have the zip pulled down,
    run the following command to unzip it and put it where we’re going to have
    WLS find it

    $ sudo unzip mysql-connector-java-3.0.9-stable.zip 
        -d /bea/weblogic81/common/eval/mysql
    
  3. then we need to get the startWebLogic.sh script to refer to the MySQL JDBC
    driver we just unzipped. this could be done by editing the startWebLogic.sh
    script directly, but that’s a poor choice. the reason has to do with the way
    the WLS config-wizard works. one of the things it does is to overwrite the
    startWebLogic.sh every time it runs to completion. believe me when i say this
    can get very annoying. fortunately, there’s a much better choice if you
    want to add things to startWebLogic.sh without getting stepped on by the
    config-wizard

    there’s a file, startscript.xml in the directory
    /bea/user_projects/domains/wls/_cfgwiz_donotdelete. the config-wizard
    will honor and merge any changes it needs to make with any changes you need to
    make. so edit this file and add the bold line you see below to the same
    spot in the file
    as it appears here (we’ve put this bit in a separate window because of the long code lines).

  4. unzip tinyapp.zip and move into the directory it creates

    $ unzip tinyapp.zip
    $ cd tiny
    
  5. next, run the ‘tinySetup’ script provided in the zip file. this will create
    all the resources needed so that the everything will work. i’ll walk through
    what’s going on there after we get everything running

    $ sudo ./tinySetup
    
  6. finally, restart WLS

    $ sudo /sbin/service wls start
    

that’s it! at this point, you should be able to hit the
http://localhost/tiny and see your very own “tiny” URL service. or, if
you didn’t complete the install, you can play with the one we’ve made available
up on the net. it’s right here. you’re
free to use it just like you’d use TinyURL. when you chase this link, you’ll
see a form that allows you to enter your “long” URL, and when you submit it the
service will return a “tiny” URL for you to then use just like you’d use a
“real” TinyURL. neat huh?

it’s time now to dive into how all the pieces fit together. here we go…

tinySetup
let’s take a look at the source to tinySetup and see what it does

#!/bin/bash

# make weblogic/weblogic a (super)user in the mysql system
mysql --user=root < userSetup.sql

# add the database and tables for the tiny service
mysql --user=weblogic --password=weblogic < dataSetup.sql

# add the connection-pool and data-source to the server for the tiny service
/bea/weblogic81/common/bin/config.sh -mode=silent -silent_script=$PWD/silentCTiny.txt

# copy the tiny web-app over so the server will deploy it on startup
cp -r tiny /bea/user_projects/domains/wls/applications/tiny

first, it runs mysql and sets up the “user” account that the app will use to
access the database. then it runs mysql again, logging in as the newly created
user, and creates the database and table that the app will use. next it runs
the WLS config-wizard, creating both the connection-pool and the data-source.
it finishes by coping the “tiny” webapp into the “wls” domain so it will be
automatically deployed when the server is restarted. let’s take a quick look at
each of these steps. after that, we’ll check out the code to see how the story
ends <g>

userSetup.sql - MySQL user creation
here are all the parts of the “userSetup.sql” file, used at the start of the
tinySetup script

# make the MYSQL database the default for the following statements
USE mysql;

here we see the USE
command used to set the default database for all subsequent commands to operate
on

# create a superuser that can connect from on this machine from the command line
GRANT ALL PRIVILEGES ON *.* TO weblogic@localhost
    IDENTIFIED BY 'weblogic' WITH GRANT OPTION;

now we’re creating the user “weblogic@localhost” using the
GRANT command. this names
the user, defines his rights and sets the password. in this case, the user
can access anything. one thing to notice is the way the user name is seen by
MySQL. it’s user-name@location. in this case, since the database and app
are running on the same machine, it’s the user “weblogic” on this machine (aka
“localhost”).

# create a superuser that can connect from on this machine from WLS
GRANT ALL PRIVILEGES ON *.* TO weblogic@localhost.localdomain
    IDENTIFIED BY 'weblogic' WITH GRANT OPTION;

now this is weird. this shouldn’t actually be needed, but it turns out
there’s a RH9/MySQL interaction problem that causes “local” user names being
presented to MySQL as “user-name@localhost.localdomain“. according to
the MySQL README that comes with the JDBC driver it’s a RH9 bug. and i know
that you don’t need to do this on RH8. in any case, this GRANT is only there to
work around this issue. and this sure was a fun one to figure out <g>

one final note: if you’re going to deploy this service other then in a demo
manner, make sure you change the password created in userSetup.sql and used in
tinySetup and TinyServlet.java

dataSetup.sql - MySQL database and table creation
the “dataSetup.sql” file has all the commands to create a database and a table
for use by our app

# create the database TINY to be used by the tiny service
DROP DATABASE IF EXISTS tiny;
CREATE DATABASE tiny;

the DROP DATABASE
and CREATE
DATABASE
commands are used so that we wind up with
a database named “tiny”. this is the database where our apps data will live.
btw, the reason it leads off with a DROP DATABASE command is so that you can
run the dataSetup.sql script multiple times if needed. i had to when writing
this, and it’s a useful habit to get into. the “IF EXISTS” clause is there for
the same reason

# make the TINY database the default for the following statements
USE tiny;

of course we now make the “tiny” database the default for the next statements

# create the table REDIRECT for use by the tiny service
DROP TABLE IF EXISTS redirect;
CREATE TABLE redirect
    (tinyVal INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
    userUrl TEXT);

and we wrap up our MySQL work by using
DROP TABLE to remove
any old “redirect” tables we might have had, and then using
CREATE TABLE to add
a table named “redirect”. look carefully at the column named “tinyVal”. this is
the column will hold the integer we’re going to lookup as the unique part of
the tinyUrl. that column has “NOT NULL AUTO_INCREMENT PRIMARY KEY” as modifiers
on it. the “NOT NULL” is not particularly useful, as the database will always
be setting it, but the “AUTO_INCREMENT” is critical for the reasons discussed
above and the “PRIMARY KEY” was added so that MySQL would know that this would
be the main access mechanism for queries on this table, and it could build
indices appropriately to speed things up

silentCTiny.txt - connection-pool and data-source creation and deployment

i’m not going to go through the entire silent-configuration script
line-by-line. you can read about how all the options work
online.
but i am going to point out a few choice parts that caused me problems so that
you’ll be successful if you customize these scripts yourself

// open domain
read domain from "/bea/user_projects/domains/wls/";

when writing a silent-config script, the first thing you have to do is figure
out if you’re creating a new domain, or modifying an existing one. here i’m
modifying an existing one, so i’ve got to tell the config-wizard to read it as
it currently exists

// define the tinyPool connection-pool
create JDBCConnectionPool "tinyPool" as tinypool;
.
.
.
set tinypool.TestConnectionsOnReserve "true";
set tinypool.TestTableName "SQL SELECT * from redirect";

here a connection-pool is being created, along with the settings it needs in
order to run. here you need to be careful of the
TestConnectionsOnReserve and TestTableName settings. this is
quite confusing (IMO) if you’re going through the WebLogic console to create a
connection-pool. here’s what’s going on

at a high level, a WLS connection-pool is a cache of connections. whenever an
app running on that server needs one, it can get one from the pool, use it as
needed, and then return the connection to the pool where it’ll sit until some
app needs it again. the reason that modern app-servers have connection-pools is
because creating a connection, with the associated user-authentication that
goes along with it, can be quite expensive. connection-pools make this a
(mostly) one-time expense. this can be a huge performance win for functionality
just like that in this app, where a request is going to result in exactly one
query (the lookup from the tinyUrl to the userUrl). on a lightly loaded server
you might not notice it, but on a even moderately loaded system, things would
get bogged down pretty quick if each external request had to pay the connection
creation and teardown cost. so life is good

er, life is good as long as the connections in the pool are valid. but what can
happen (quite easily it turns out) is that the connection sitting in the pool
waiting to be reused can go bad. network problems, timeouts, there’s a number
of things that can render a connection useless. all of which wouldn’t be so bad
but unfortunately there doesn’t seem to be anything WLS can do to detect this
situation. so the app asks for a connection out of the pool, tries to use it,
and as Steve Matchett would say, “ka-BLAMMO”

the solution to this is setting both the TestConnectionsOnReserve and
TestTableName fields. what you can have WLS do for you is to test each
connection before it’s pulled out of the pool. the first tells WLS you want
this done, and the second provides a query to use as the test. it’d be great if
WLS could just know what query to run based on the database type, but this
really isn’t possible because in real production environments application
connections aren’t privileged to access system tables and such that are a
built-in part of the database. so you have to provide a query that you know can
run successfully (assuming the connection is valid). then WLS will try to run
it before handing the connection out and if it fails they’ll throw it away and
create another one

// deploy the tinyPool connection-pool
assign JDBCConnectionPool "tinyPool" to target "myserver";

here you can see the connection-pool being deployed on the server “myserver”

// define the tinyDS data-source
create JDBCTxDataSource "tinyDS" as tinyds;
set tinyds.JNDIName "tinyDS";
set tinyds.PoolName "tinyPool";

// deploy the tinyDS data-source
assign JDBCTxDataSource "tinyDS" to target "myserver";

then we create the data-source, which references the connection-pool, and
deploy it

// update the domain
add template "/bea/weblogic81/common/templates/applications/DefaultWebApp.jar";
update domain;
close domain;

finally we update the domain and close it. one thing to watch out for is that
even though you’re simply modifying an already existing domain, you still need
to refer to a “template” to make it work. so i refer to one that ships with
WLS. if you don’t do this the script will fail at the end, which is annoying
but harmless as until the “update domain” succeeds, nothing has really happened

TinyServlet.java

most of this class is just plain vanilla servlet code, which i won’t go into.
but there are a few interesting points to cover. if you look at the code, the
real work is done in the two methods, getTinyVal() and
getUserUrl(). we’ll look at each one in turn

private String getTinyVal(String userUrl)
    throws Exception
{