Exporters From Japan
Wholesale exporters from Japan   Company Established 1983
CARVIEW
Select Language

April 2002 Archives

AddThis Social Bookmark Button

Every now and then, you catch a message on a mailing list of someone venting their frustrations:

And every now and then, you see someone with a logical, well-thought response, as in this one from Bill Bumgarner on the cocoa-dev mailing list:


NOTE:
To access this thread, you need to use “archives” as both the username and password.


This is probably one of the most thought out responses on a list I’ve seen in years.

Brian Jepson

AddThis Social Bookmark Button

Back in February, I was intrigued by Paolo Molaro’s
href="https://lists.ximian.com/archives/public/mono-list/2002-February/003128.html">How
does mono _look_ like? post. That post leads to a href="https://people.debian.org/~lupus/mono/">web page containing
visualizations of Mono’s class library created with monograph and href="https://www.research.att.com/sw/tools/graphviz/">graphviz.

monograph is a tool that Paolo developed; it generates the raw data
that graphviz uses to generate the images. (monograph is included in
current mono
release
.) After I started
href="https://onjava.com/pub/a/dotnet/2002/03/27/gettingstarted.html">working
with Rotor, Microsoft’s shared source CLI, I thought it would be
fun to use monograph to peruse Rotor’s base class libraries. I got
sidetracked by some other projects, and went a while without having
the latest version of Mono on my system. However, the href="https://conferences.oreillynet.com/etcon2002/">O’Reilly Emerging
Technology Conference is rapidly approaching, and I wanted to make
sure I have a comprehensive assortment of ECMA CLI implementations on my
laptop. So, I set up three partitions: the latest beta of Windows .NET
Web Server with Visual Studio .NET, FreeBSD 4.5 with Rotor, and
Mandrake 8.2 with Mono (to build Mono, the only things I needed to add
to the stock install of Mandrake 8.2 were href="https://mail.gnome.org/archives/gtk-list/2002-March/msg00522.html">glib
2.0.1 and href="https://www.freedesktop.org/software/pkgconfig/">pkg-config,
both of which I installed in /opt). I still have yet to install DotGNU
Portable.NET
, but it won’t be long before I add this to my
assortment.

After I had Rotor and Mono built and running, I downloaded and
installed
graphviz on my Linux system. Then, I copied Rotor’s
mscorlib.dll and System.dll over to my Linux partition. Now,
everything was in place for my sinister experiments.
First, I generated a call graph for
System.Net.WebClient.DownloadData():

[bjepson@localhost RotorDLLs]$ monograph -n -o example.ps -c 
   ./System.dll System.Net.WebClient:DownloadData

Note that I prefixed the DLL name with ./ to explicitly
specify the Rotor DLL I had copied over. Otherwise, monograph might
have picked up Mono’s System.dll. The figure I got was convoluted, so I tried limiting the recursion
depth with -d 1:

[bjepson@localhost RotorDLLs]$ monograph -d 1 -n -o example.ps -c 
   ./System.dll System.Net.WebClient:DownloadData

Figure 1 shows a thumbnail of the output. Click on the thumbnail to
see a larger version.


src="https://www.jepstone.net/images/rotor-callgraph-thumb.png">
Figure 1. Rotor call graph of System.Net.WebClient:DownloadData()

Since monograph generates an intermediate textual representation of
the call graph, I thought it would be interesting to compare two
implementations of the same method. So, I removed the -n
option, which automatically invoked the graphviz neato command, and specified a method that wasn’t quite as big as the previous example. This
leaves me with two text documents, mono.txt and rotor.txt:

[bjepson@localhost RotorDLLs]$ monograph -d 1 -o rotor.txt -c 
   ./mscorlib.dll System.Collections.Hashtable:Add
[bjepson@localhost RotorDLLs]$ monograph -d 1 -o mono.txt -c 
   /opt/lib/corlib.dll System.Collections.Hashtable:Add

As you can see, the implementations are quite different (I removed the
Hashtable: prefix from Hashtable’s methods to minimize
annoying HTML wrapping problems):

mono.txt:
digraph blah {
  node [fontsize=8.0]
  edge [len=2,color=red]
  "Add(object,object)" -> "Hashtable:PutImpl(object,object,bool)"
  "PutImpl(object,object,bool)" -> "ArgumentNullException:.ctor(string)"
  "PutImpl(object,object,bool)" -> "Rehash()"
  "PutImpl(object,object,bool)" -> "GetHash(object)"
  "PutImpl(object,object,bool)" -> "KeyEquals(object,object)"
  "PutImpl(object,object,bool)" -> "ArgumentException:.ctor(string)"
}
rotor.txt:
digraph blah {
  node [fontsize=8.0]
  edge [len=2,color=red]
  "Add(object,object)" -> "Hashtable:Insert(object,object,bool)"
  "Insert(object,object,bool)" -> "Environment:GetResourceString(string)"
  "Insert(object,object,bool)" -> "ArgumentNullException:.ctor(string,string)"
  "Insert(object,object,bool)" -> "expand()"
  "Insert(object,object,bool)" -> "InitHash(object,uint,int&,int&)"
  "Insert(object,object,bool)" -> "KeyEquals(object,object)"
  "Insert(object,object,bool)" -> "Environment:GetResourceString(string,object[])"
  "Insert(object,object,bool)" -> "ArgumentException:.ctor(string)"
  "Insert(object,object,bool)" -> "BCLDebug:Assert(bool,string)"
  "Insert(object,object,bool)" -> "InvalidOperationException:.ctor(string)"
}

Figure 2 shows the two call graphs.


src="https://www.jepstone.net/images/rotor-compare-thumb.png">
src="https://www.jepstone.net/images/mono-compare-thumb.png">
Figure 2. Rotor and Mono call graphs, compared.

The beauty of monograph is that you can use it with
an assembly from any of the ECMA CLI implementations. Given
that these implementations are huge, it’s helpful
to have a visualization tool that can turn complex relationships
into understandable pictures.

Have you made any cool pictures with monograph? If so, post the link!

Daniel H. Steinberg

AddThis Social Bookmark Button

Related link: https://www.apple.com/education/emac/

When Apple released the iMac, my chief concern was that these new elegant machines with their movable parts were not well suited to the education market. The all-in-one classic iMacs seemed better suited for a gaggle of grade schoolers. Today Apple has introduced a new product called the eMac, targetting educators. Check it out. While you’re at it, you may want to head over to the Powerbook page. Apple has quietly speedbumped the line so that the top model is at 800 MHz. I suppose it’s time for me to stop waiting and go ahead and buy one.

Derrick Story

AddThis Social Bookmark Button

There’s more to Web authoring than JavaScript and CSS. That’s why we’ve overhauled our former JS/CSS DevCenter and launched a new Web DevCenter in its place.

We’ll continue to cover JavaScript and CSS, probably more than ever. But we’ll also dig deeply into the latest offerings from Adobe, Macromedia, and other publishers producing tools of interest to our audience.

Weblogging will finally have a place to call home too. During the upcoming weeks we’ll feature some of the changes happening in that community along with the tools that bloggers use.

Stay tuned.

Brian Jepson

AddThis Social Bookmark Button

Related link: https://www.macadamian.com/column/tinymessenger.html

Macadamian Technologies presents a simple MSN Messenger client for Rotor, the shared source CLI. Like Rotor, TinyMessenger runs on FreeBSD and Windows.

Brian Jepson

AddThis Social Bookmark Button

Microsoft recently released the Smart Device Extensions for .NET (Beta 1) to MSDN subscribers. Although I am an MSDN subscriber, at the time the extensions came out, I didn’t have a smart device :-(

Technically, you don’t need a smart device to play with these extensions, since they include an emulator. However, I wanted the real thing (total coverage), so I went hunting for a decent Pocket PC that runs the latest Pocket PC 2002 operating system. I was upset to find that the leading handhelds cost upwards of $500, until I came across reviews for 5 handhelds. #1 on that list is the Audiovox Maestro PDA-1032, a rebranded Toshiba Pocket PC e570 with half the memory. I was able to find the Maestro for $299, so I went ahead and ordered it.

After it arrived, I naturally spent some time looking for games to run on it… the compact framework could wait. The next day, I downloaded the compact framework, and fired up Visual Studio .NET. I’m not much of a Visual Studio .NET user (I edit most of my C# using vim), but I decided I could make an exception, since Visual Studio .NET makes it very easy to work with compact framework applications.

Creating an Empty Application

To create a Pocket PC application, I did the following:

  1. At the Visual Studio Start Page, I chose “New Project”.
  2. Next, I selected “Smart Device Application” from the Visual C# Projects.
  3. I chose Windows Application as the project type, and Pocket PC as the target platform. A blank form (Form1) and backing code (Form1.cs) appeared.
  4. I dropped a ComboBox on the form.
  5. Finally, I changed the name of the ComboBox to lstCommodities.

Connecting to a Web Service

At this point, I could have deployed the application to the smart device, but it would just be a form with an empty list box. So, I decided I’d plug it into a web service that I’ve been working on for a tutorial at the O’Reilly Emerging Tech Conference. The web service can return a list of energy commodities and price quotes.

To hook up my application to the web service, I did the following:

  1. Right-clicked on my project in the Solution Explorer and select “Add Web Reference”
  2. Pasted in the WSDL for my web service.
  3. Clicked “Add Reference”

This left me with a namespace, SmartDeviceApplication1.com.brinkster.www30 (it’s a concatenation of my project namespace and the host name of the web service), that I could import with the using statement. So, I added this line to Form1.cs:

using SmartDeviceApplication1.com.brinkster.www30;

Next, I wanted to invoke the web service and stuff the results into the combo box. That namespace that I imported it full of all sorts of goodies, including a class (CommodityFun) that exposes the web methods, and classes (Commodity, Quote, etc) for all the return values of the web service. In this case, I’m interested in a list of commodities, so I need to deal with the Commodity class. Here is the code I added to my form’s source code:

private void Form1_Load(object sender, System.EventArgs e)
{
  CommodityFun wsfun = new CommodityFun(); // proxy class for remote web service
  Commodity[] commodities = wsfun.ListAll(); // invoke a web service method
  foreach (Commodity c in commodities)
  {
    lstCommodities.Items.Add(c.name); // add each commodity to the combo box
  }
}

Not much to it, is there? The web reference makes sure that my application knows about the definition of the web service proxy class (CommodityFun) as well as classes for the return values (such as Commodity), so I can refer to them as though they were locally defined.

Deploying the Application

This was the easy part. I selected Start from the Debug menu, and Visual Studio .NET deployed everything (the compact framework and the application) to my Pocket PC. A few seconds later, the form appeared on my Pocket PC screen, and I was able to debug it from Visual Studio .NET. Figure 1 shows a screenshot (from the emulator, since I haven’t figured out how to take a screenshot from my Pocket PC).



Figure 1. A simple web service client

Here’s an article I found that walks you through a Compact Framework example with many more screenshots: Creating Pocket PC Apps with the Smart Device Extensions.

That’s my trivial example. Have you built anything complex with the compact framework? Do you plan to?

James Duncan Davidson

AddThis Social Bookmark Button

Today, I find myself in yet another hotel. This time its the Wyndham in New Orleans and I’m here to spread the word about Open Source style collaborative development. "Thank goodness, there’s high speed internet access here," I thought to myself as I sat my bags down. I proceeded to pull out my trusty TiBook and hook myself up to the net.

Zip. Nada. No Net. Dammit.

I’ve faced this situation before. You do not want to try to get the front desk of a hotel to perform tech support. Especially after midnight. All you’ll do is end up waiting till the next day when you check out and never get connected.

So, I dove under the desk to see what might be the problem. "Lets see…yup. there’s power. Okay.. Where’s the incoming data line? Whoops. There’s only one line into the magic black box and its power. That means there’s no data going in or out." On closer inspection, I find that there are normal phone line jacks labeled "wall" and "phone" and nothing is connecting them. I look at the phone on the desk. The only telephone line around is going from the wall straight to the phone.

So, I did what every hotel guest is supposed not to do and unplugged the phone and ran its line straight into the magic black box. And da-dum! Network! Mail is flowing, and everything is good again.

So, who stole the darn extra phone cord from my room and made lord knows how many people think that the service was kaput? Whoever you are, stop stealing the phone cords!

Kevin Hemenway

AddThis Social Bookmark Button

Related link: https://www.theatlantic.com/issues/2002/04/rauch.htm

A rather long article entitled Seeing Around Corners that I find insanely interesting: “The new science of artificial societies suggests that real ones are both more predictable and more surprising than we thought. Growing long-vanished civilizations and modern-day genocides on computers will probably never enable us to foresee the future in detail?but we might learn to anticipate the kinds of events that lie ahead, and where to look for interventions that might work.”

AddThis Social Bookmark Button

Related link: https://www.nytimes.com/2002/04/23/science/physical/23COMP.html

The New York Times takes a look at the state of *@home distributed computing — Folding@home, Genome@home, Evolution@home, FightAIDS@home, and, of course, David Anderson’s SETI@home: ‘”People have been locked into this supercomputing mentality,” Dr. David P. Anderson, the SETI@home project director, said. “They want to have some gigantic thing in a box somewhere. I think that approach will ultimately go the way of the dinosaurs.”‘

Dr. Anderson will be presenting “The Software Infrastructure of SETI@home II” at the O’Reilly Emerging Technology Conference, May 13-16, 2002 in Santa Clara, CA.

James Duncan Davidson

AddThis Social Bookmark Button

A little over a year since the official release of Mac OS X, and a bit over two years since I started using OS X full time, I am finally able to run on a day to day basis without OS 9 launching up in the background. The reason? My copy of Adobe Photoshop 7 finally arrived today (after the first one was stolen in shipment!) at my doorstep.

Don’t get me wrong, Classic is a remarkable achievement. The team that worked on it deserve all the kudos that you can give them. However, the disjoint User Interface experience between OS X and classic was never satisfactory. As well, running two operating systems on the same machine just puts a drag on things. Now, Photoshop can live as a first class citizen among all my other OS X native applications.

There’s only one application left in Classic land that I would love to be OS X native: Macromedia Dreamweaver. However, Dreamweaver is a nice tool, not a necessary one like Photoshop. And even though Macromedia was one of the first companies to release a Carbonized app with Freehand, there’s no indication of when we’ll see a Carbonized Dreamweaver. I’m back to editing HTML in BBEdit, but I’m running Classic-free!

AddThis Social Bookmark Button

Related link: https://members.truepath.com/objective/propaganda.html

Just when you thought the human race was advancing, a religious zealot is accusing Apple Computer of:

“…[promoting] Godless Darwinism and Communism.”

To try and associate Apple and its Darwin Project (and poor little Hexley) with mind control and witchcraft is ridiculous! Among other accusations, Dr. Richard Paley (author of this piece) notes these similarities between Apple and evil:

  • Mac OS X is based on an open source project known as “Darwin” and, as you know, Darwinism promotes the theory of evolution.
  • “Open source” is another name for communism.
  • Apple was founded by “long-haired hippies”
  • Apple’s logo — an apple with a bite taken out of it — leads us into temptation.
  • Hexley, mascot of the Darwin project, is a platypus dressed up like a devil who “performs occult magic.”
  • Mac OS X is based on “BSD Unix,” which he refers to as “an obsolete system.” (Ha!)
  • The use of chmod 666 to open locked files is an evil reference!

Oh, man, this guy’s too good! And here I thought Microsoft was the evil empire.

What’s your opinion on this: Is Apple an evil company, or does this guy need to get a life?

AddThis Social Bookmark Button

Everything’s coming up Web Services this week! First
Google releases its Google Web API and yesterday I found a note in my mailbox from Amazon about their Amazon Associates XML interface:

New XML Platform For Developers

At Amazon.com, we are passionate about driving continuous innovation that serves our customers in the best way possible. We know you share this passion, and now we’re providing an even easier way to optimize your Amazon.com placements. By putting Amazon.com XML directly into your hands, you’ll now have the flexibility to display dynamic product information in any way you choose. (Reprinted by permission.)

A praiseworthy initial foray for Amazon into the world of publicly available Web Services, what I’m most looking for from the Amazon Associates XML interface is access to wishlists (both my own and those of thers), listmania, what’s related, and advanced searches beyond simple keywords (e.g. by author or ISBN).

An example of the sort of fiddling I’ve been doing with the interface is Amazox, a trivial app that makes a call to Amazon Associates XML interface, displaying the results in a table suitable for inclusion in a Web page.

What are you doing with the Amazon Associates XML interface?

James Duncan Davidson

AddThis Social Bookmark Button

On the cocoa-dev mailing list today, I saw a post for a new tool for browsing the Cocoa documentation. It’s called Cocoa Browser, it’s currently at version 0.3, and it’s released under the GPL.

Since I’m right in the middle of a book writing project covering Cocoa, I’m having to flip through the documentation all of the time. This program provides an easy way to browse the Cocoa libraries by class and method. In addition, you can even browse the functions and types of each of the Cocoa Objective-C frameworks. Need to remember what the fields are of the NSPoint structure? Just browse to Foundation–>Types and Constants–>Data Types–>NSPoint and the documentation pops right up.

It’s fast and way more convenient to use than the HTML docs in a web browser. 12 hours later, and the program has become an essential part of my toolbox. Highly recommended for Cocoa programmers.

James Duncan Davidson

AddThis Social Bookmark Button

It’s that time again for OS X users… Time to go to Software Update and get a fresh helping of OS X update goodness. Apple just posted the 10.1.4 update for download via Software Update. According to Apple, this update includes:

  • Updated and new support for Fast SCSI drives
  • Expanded support for SmartDisk, EZQuest, and LaCie disc recording drives
  • More reliable PPP dial-up connections
  • Faster file searching on remote and local volumes
  • AFP (Apple Filing Protocol) servers can be browsed on networks with 3Com routers
  • BSD-based TCP/IP connection improvements

Find anything that you’d like to comment on in this latest update?

AddThis Social Bookmark Button

Related link: https://www.wired.com/news/technology/0,1282,51563,00.html

Another article on the World Wide Lexicon (WWL) project. ‘”The idea is to create a distributed data collection system with the goal of handling less-common language pairs,” said McConnell. “There are a lot of sites out there that do English to non-English translations. When you get into non-English to non-English language pairs, that information is a lot harder to find.”‘ I’m glad to see Brian’s take on distributed (human) computation gleaning such attention.

AddThis Social Bookmark Button

In “Inventing the Future”, an article for the InfoWorld CTO Forum last week in San Francisco, Tim O’Reilly writes:

Why would a company that has a large and valuable data store open it up [via XML-based Web Service APIs

My answer is a simple one: because if they don’t ride the horse in the direction it’s going, it will run away from them. The companies that “grasp the nettle firmly” (as my English mother likes to say) will reap the benefits of greater control over their future than those who simply wait for events to overtake them.]?



O'Reilly Emerging Technology Conference.

Rael Dornfest is a
Researcher at O’Reilly & Associates focusing on technologies just
Rael Dornfest beyond the pale. He assesses, experiments, programs, and writes for the O’Reilly network and O’Reilly publications. Dornfest is Program Chair of the O’Reilly Emerging Technology Conference, May 13-16, 2002 in Santa Clara, CA.


Consider the nettle firmly grasped. The Google Web API opens a dialogue with the developers and researchers inventing the next Internet and quite possibly shaping the future of Google itself.
By exposing its cache of over 2 billion Web pages via simple Web services, the Google Web API is a breath of fresh air in a specification-dense yet implementation-sparse arena.

John Piscitello, Project Manager for Google Web APIs, says, “In part, we’re simply responding to developers who have been asking for Google to try something like this. We also see Google Web APIs as an opportunity to collaborate with developers who have great ideas for making the web more accessible and useful.”

What better way to interview potential new programming talent?

And Google offers a good lesson for others considering testing the open Web Services waters in its 1,000 search-per-day / 10 results per search limits. Opening up your data store doesn’t mean opening the floodgates; there’s plenty of room for embracing experimentation without simply giving everything away — you only stand to learn.



Google software engineer Nelson Minar will be talking about “Google and Web Services” at the O’Reilly Emerging Technology Conference, May 13-16, 2002 in Santa Clara, CA.

Web Services Get Street Cred

When the story leaked last week, the path it took and people who offered up their $0.02 was a veritable who’s-who of the Google API’s target audience: from initial post on the ruby-talk mailing list, to Geek journal
Slashdot,
Userland’s Dave Winer, Weblogger Cory Doctorow, IBM SOAP-builder Sam Ruby, and, of course, it spread rapidly through the Weblog community, evidenced by its immediate rise to #1 on DayPop.

News.com, Wired, et al didn’t say a word.

Much of the current noise around Web Services, both in the media and offerings, is all about business process, back-end integration, B2B transactions and remuneration, EDI-replacement, and the like — way beyond the purview, or at least interest, of many an intelligent coder. Complex specifications overshadow simple, yet often more interesting, implementations. High order discussions of workflow orchestration seldom include more than a nod to the kind of *nix-style pipelining that makes for interesting cross-pollination and unitended consequences. Not that some share of all this isn’t rather important. It just doesn’t have much in the way of street cred.

The Google Web API, while hopefully grabbing the attention of more traditional Web Services types, is really for who Tim O’Reilly affectionately refers to as “alpha geeks”:

The alpha geeks are often a few years ahead of their time. They see the potential in existing technology, and push the envelope to get a little (or a lot) more out of it than its original creators intended. They are comfortable with new tools, and good at combining them to get unexpected results.”

Google’s arrival at the Open Services experimentation party finds them in good company. Userland’s Radio Userland is a wellspring of DIY Web Services bootstrapping. Jabber-RPC transports XML-RPC messages over the Jabber instant messaging framework. Watson provides a stunning example of putting a GUI front-end on Web Services. My own Meerkat Open Wire Services provides open URL-line and XML-RPC interfaces which have reaped some unintented yet wonderful uses.

These are the sort of grassroots projects that finally put to rest what Jon Udell refers to as “the tired stock-quote example” — not to mention the equally tiresome state number and calculator interop favourites.

What’s in the Offing?

Diving into the package, what the Google Web API offers is a
SOAP (Simple Object Access Protocol) interface to searching Google’s index, accessing info and Web pages from its cache, and checking the spelling of words (even proper names) from the comfort of Google.com’s standard search syntax.

A freely downloadable Developer’s Kit contains:

  • A complete API reference describing the semantics of method calls and fields
  • Sample SOAP request and response messages
  • Google Web API WSDL file
  • A Java library, example program, and Javadoc documentation
  • A sample .NET program
  • A simple SOAP::Lite-based Perl script
  • README, Licensing, and so forth

Getting started is about as easy as 1-2-3. 1. Download the Developer’s Kit. 2. Create your Google Web API account. 3. Code. Each account key is entitled to 1000 queries per day, so use them wisely.

Getting Down to Brass Tacks

Enough preamble; let’s dive into some of the samples.

Note that I’ve replaced my actual key (a not particularly attractive string of characters) with X’s; I only have 1000 queries a day and so guard them jealously. Get your own key!

GoogleAPIDemo is a demonstration Java app that quickly gets you searching Google, grabbing from its cache, and spell-checking.

% java -cp googleapi.jar
com.google.soap.search.GoogleAPIDemo
XXXXXXXXXXXXXXXXXX search rael
Parameters:
Client key = XXXXXXXXXXXXXXXXXX
Directive  = search
Args       = rael
Google Search Results:
======================
{
TM = 0.066088
Q  = "rael"
CT = ""
TT = ""
CATs =
  {
  {SE="", FVN="Top/Society/Paranormal/UFOs/Organizations"}
  }
Start Index = 1
End   Index = 10
Estimated Total Results Number = 65800
Document Filtering = true
Estimate Correct = false
Rs =
  {
  [
  URL  = "https://www.rael.org/"
  Title = "Welcome to the Raelian Revolution"
  Snippet = "Arabic - PAGE UNDER CONSTRUCTION.
  Click here to Skip Flash Intro.  "
  Directory Category =
  {SE="", FVN="Top/Society/Paranormal/UFOs/Organizations"}
  Directory Title = "Raelian Religion "
  Summary = "Raelian Religion, the world's largest
  UFO religion with 50,000 members. Life on Earth
  is the result... "
  Cached Size = "11k"
  Related information present = true
  Host Name = ""
  ],
...
  [
  URL  = "https://www.oreillynet.com/~rael/"
  Title = "raelity bytes"
  Snippet = " ... that's not actually me. "They say
  Vorilhon, who   calls himself the prophet Rael and
  testified before Congress last year in a futuristic
  white jumpsuit ..."
  Directory Category = {SE="", FVN=""}
  Directory Title = ""
  Summary = ""
  Cached Size = "35k"
  Related information present = true
  Host Name = ""
  ],
...

GoogleAPIDemo simply data dumps search results, providing a peek at the resultant data in its Java-native form.

Let’s try our hand at a little speling. Google’s new spelling function, while predictably good at common words, really shines when it comes to uncommon words and proper names.

% java -cp googleapi.jar
com.google.soap.search.GoogleAPIDemo
XXXXXXXXXXXXXXXXXX spell meekrat
Parameters:
Client key = XXXXXXXXXXXXXXXXXX
Directive  = spell
Args       = meekrat
Spelling suggestion:
meerkat 
% java -cp googleapi.jar
com.google.soap.search.GoogleAPIDemo
XXXXXXXXXXXXXXXXXX  spell "real dormfest"
Parameters:
Client key = XXXXXXXXXXXXXXXXXX
Directive  = spell
Args       = real dormfest
Spelling suggestion:
rael dornfest

Lost or deleted that page you spent hours on yesterday? Perhaps Google got there just in time. Let’s see what we find in the Google cache for our oreilly.com home page.

% java -cp googleapi.jar
com.google.soap.search.GoogleAPIDemo
XXXXXXXXXXXXXXXXXX cached https://www.oreilly.com
Parameters:
Client key = XXXXXXXXXXXXXXXXXX
Directive  = cached
Args       = https://www.oreilly.com
Cached page:
============
<meta http-equiv="Content-Type" content="text/html;
 charset=ISO-8859-1">
<BASE HREF="https://www.oreilly.com/">
...
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN"
"https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="https://www.w3.org/1999/xhtml" lang="en-US"
xml:lang="en-US">
<head>
<title>www.oreilly.com -- Welcome to O'Reilly &amp;
Associates -- computer books, software conferences, online
publishing</title>
<meta name="keywords" content="O'Reilly, oreilly,
computer books,
...

Rolling Up Our Sleeves

Let’s write some Perl and Java code.

The first simplistic applications of Google’s API will predictably be “Google Boxes,” relevant search results incorporated into portal and weblog pages. My “raelity bytes” weblog, for example, sports a “Googling for Rael” sidebar entry (on the right), scanning Google once a day for references to (what else) me — not to mention assorted UFO believers and renewable energy projects. Here’s the Perl code behind it:

#!/usr/bin/perl
use SOAP::Lite;
@ARGV == 3 or die "Usage: googly <key> <query>
<number of results>n"
my($key, $q, $maxResults) = @ARGV;
# key, q, start, maxResults, filter, restrict, safeSearch,
# lr, ie, oe
my @params = ($key, $q, 0, $maxResults, 0, '', 0, '',
'latin1', 'latin1');
my $result =
    SOAP::Lite
    -> service("file:GoogleSearch.wsdl")
    -> doGoogleSearch(@params);
print join "n",
        map( { qq{<a href="$_->{URL}">} . ($_->{title} ||
$_->{URL}) . qq{</a>
<br />} } @{$result->{resultElements}} );
% ./googly XXXXXXXXXXXXXXXXXX rael 5
<a href="https://www.rael.org/">Welcome to the Raelian
Revolution</a><br />
<a href="https://www.rael.org/press/">RA?L</a><br />
<a href="https://www.oreillynet.com/~rael/">raelity
bytes</a><br />
<a href="https://www.oreillynet.com/weblogs/author/35">
O'Reilly Network: Weblogs [April 10, 2002]</a><br />
<a href="https://www.oreillynet.com/pub/au/35">O'Reilly
Network: <b>Rael</b> Dornfest [February 03,
2002]</a>
<br />

And the same thing in Java — borrowing heavily from the GoogleAPIDemo.java included in the Google Web API Developer’s Kit.

import com.google.soap.search.*;
import java.io.*;
public class Googly {
 public static void main(String[] args) {
  if (args.length != 3) {
   System.err.println("Usage: java Googly <key>
<query> <maxResults>");
   System.exit(1);
  }
  String clientKey = args[0];
  String query = args[1];
  int maxResults = Integer.parseInt(args[2]);
  GoogleSearch s = new GoogleSearch();
  try {
   s.setKey(clientKey);
   s.setQueryString(query);
   s.setMaxResults(maxResults);
   GoogleSearchResult r = s.doSearch();
   GoogleSearchResultElement[] re = r.getResultElements();
   for ( int i = 0; i < re.length; i++ ) {
    System.out.println("<a href=\"" + re[i].getURL()
    + "\">" + re[i].getTitle() + "</a><br />");
   }
  } catch (GoogleSearchFault f) {
     System.out.println("The call to the Google Web APIs failed:");
     System.out.println(f.toString());
  }
 }
}
% java Googly XXXXXXXXXXXXXXXXXX rael 5
<a href="https://www.rael.org/">Welcome to the Raelian
Revolution</a><br />
<a href="https://www.oreillynet.com/~rael/">raelity bytes</a><br
/>
<a href="https://www.oreillynet.com/weblogs/author/35">O'Reilly Network:
Weblogs [April 09, 2002]</a><br />
<a href="https://socrates.berkeley.edu/~rael/rael.html">Renewable and
Appropriate Energy Laboratory (<b>RAEL</b>)</a><br />
<a href="https://www.wibble.org.uk/"></a><br />

Good, Clean SOAP (and WSDL too)

Taking a quick gander at a Google Search SOAP request (lifted right from the Developer’s Kit’s soap-samples folder) reveals a rather simple underlying set of XML documents.

<?xml version='1.0' encoding='UTF-8'?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="https://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="https://www.w3.org/1999/XMLSchema-instance"
xmlns:xsd="https://www.w3.org/1999/XMLSchema">
 <SOAP-ENV:Body>
  <ns1:doGoogleSearch xmlns:ns1="urn:GoogleSearch"
  SOAP-ENV:encodingStyle="https://schemas.xmlsoap.org/soap/encoding/">
   <key xsi:type="xsd:string">XXXXXXXXXXXXXXXXXX</key>
   <q xsi:type="xsd:string">shrdlu winograd maclisp teletype</q>
   <start xsi:type="xsd:int">0</start>
   <maxResults xsi:type="xsd:int">10</maxResults>
   <filter xsi:type="xsd:boolean">true</filter>
   <restrict xsi:type="xsd:string"></restrict>
   <safeSearch xsi:type="xsd:boolean">false</safeSearch>
   <lr xsi:type="xsd:string"></lr>
   <ie xsi:type="xsd:string">latin1</ie>
   <oe xsi:type="xsd:string">latin1</oe>
  </ns1:doGoogleSearch>
 </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

What this boils down to is a call to the GoogleSearch service with access key XXXXXXXXXXXXXXXXXX for the first 10 results in a search for “shrdlu winograd maclisp teletype”. For details on the particulars of the rest of the settings, I leave you to the API Reference documentation available in the Developer’s Kit.

In Conclusion

I do so look forward to the community reaction to Google’s Web API as well as seeing and playing with what folks build on top of it.

And it seems I finished my article just in time…

The call to the Google Web APIs failed:
com.google.soap.search.GoogleSearchFault: Fault
Code = SOAP-ENV:Server
Fault String = Exception from service object:
Daily limit of 100 queries exceeded
for key XXXXXXXXXXXXXXXXXX

Update: The limit just raised to 1,000 queries per day with 10 results per query.

Resources

AddThis Social Bookmark Button

Related link: https://story.news.yahoo.com/news?tmpl=story&ncid=581&e=8&cid=581&u=/nm/20020410/…

“Starting Wednesday night, computer maker Gateway Inc. will launch a radio and TV ad campaign urging consumers to visit its Web site to download free music and learn more about a copyright debate that so far has been dominated by Washington lobbyists and corporate lawyers.”

Derrick Story

AddThis Social Bookmark Button

As you know, we’re having a great time with Mac OS X around here. It’s getting to the point where we ask, “I wonder if it can do this?,” then proceed to try.

Lots of folks have noticed our interest in this Unix-based OS. A good example is the team over at Macworld magazine lead by Colin Crawford (CEO) and Rick LePage (editor in chief) who initiated a brainstorming session with us late last year.

Colin said that he wanted to get out of the city and breath some clean country air. We have lots of that here in Sebastopol. The fresh air must have worked its magic because the result of that get-together is on the newsstand shelves now: “Total OS X.”

Total OS X is the first cooperative effort between Macworld and O’Reilly. Our goal was to pool our collective knowledge about Apple’s new OS and publish a special 13th issue that was unlike anything already on the streets.

The Macworld group got their act together quickly. Rick LePage brought Missy Roback in to manage this mountainous project. Jason Snell brushed up on his Unix chops and was raring to go. We all got together at the Yerba Bunea Starbucks during Macworld SF to map our course.

On our end, I was coordinating editorial content and Cathy Record was handling the logistics. Her heavy lifting resulted in O’Reilly landing some very nice ads in the issue.

I can’t speak for Rick, Missy, Jason, and Colin, but from my perspective, I hope this is a sign of good things to come for the Mac community, Macworld, and O’Reilly. We took a first step at inviting the power users and developers to the same party. So far the turnout looks good.

Sure there are some things we would have done differently. And our next effort should be even better. If we can pull off this type of cooperation, the Mac community might finally be able to shed the image of being nothing more than a bunch of GUI sissies. Imagine a community where the artists and the developers interact on the same platform. The Mac could become a real powerhouse in the computing world.

I think there’s room for every type of Mac user at this party — from home power user, to designer, to command line geek. This recent experience with Macworld leads me to believe that I might not be crazy after all.

Let’s talk “Total OS X,” new Mac user, integration … you name it.

Brian Jepson

AddThis Social Bookmark Button

Related link: https://www.macnn.com/news.php?id=13610

MacNN reports that the March 2002 ATI Retail Update is now available. This seems to solve the artifacting problem that plagued a recent ROM update. I installed it on my Power Macintosh 9500 (running Mac OS X with the XPostFacto extensions), and it is working fine so far.

Brian Jepson

AddThis Social Bookmark Button

Related link: https://www.newsfactor.com/perl/story/17161.html#story-start

Maybe this means I’ll be able to do all my .NET work on my iBook finally. I’ve been using Virtual PC for some of that stuff, but it’s still not fast enough for some of the CPU and I/O intensive XML crunching that I’ve been doing. [Updated]Peter Drayton has a follow-up here.

If Microsoft brings .NET to Mac OS X, will you use it?

AddThis Social Bookmark Button

Related link: https://www.newscientist.com/news/news.jsp?id=ns99992115

The World Wide Lexicon will attempt to harness distributed spare multi-lingual brain cycles in an effort to build a translation database. Modeled on distributed computation applications the likes of SETI@home and distributed.net, the WWL will tap idle users for a moment of their time to translate a word or phrase for inclusion in its database. By exposing its API (via SOAP) as a Web Service, the WWL hopes to encourage integration of the service into client software (word processors, email clients, and so forth) beyond WWL’s standard application.

WWL’s Brian McConnell will be presenting “Worldwide Lexicon - Using P2P Technology To Build A Global Translation Dictionary” at the O’Reilly Emerging Technology Conference, May 13-16, 2002 in Santa Clara, CA.

Brian Jepson

AddThis Social Bookmark Button

In WinInfo Short Takes: Week of April 8, Paul Thurrott speculates on the impact that the FreeBSD release of Rotor might have on Mac OS X:

Apple has moved its product line from OS 9 to OS X, which happens to be based on–you guessed it– FreeBSD. Does this mean we can expect a full .NET environment for Mac OS X? I hope so.

To be precise, Mac OS X is not exactly based on FreeBSD: it is a hybrid of Mach 3.0 and BSD Unix, with various NetBSD and FreeBSD pieces added in. To see an informative example of this lineage, take a peek at the comments in the top utility source code (taken from the Darwin source code):

 *  Copyright (c) 1984, William LeFebvre, Rice University
 *
 *  This program is designed to run on either Berkeley 4.1 or 4.2 Unix.
 ...
 * HISTORY
 * 22-Apr-99  Avadis Tevanian (avie) at Apple
 *      Another rewrite for Mach 3.0
 *
 * 21-Apr-90  Avadis Tevanian (avie) at NeXT
 *      Completely rewritten again for processor sets.
 *
 *  6-May-88  David Golub (dbg) at Carnegie-Mellon University
 *      Completely rewritten for MACH.  This version will NOT run on any
 *      other version of BSD.

That minor clarification aside (which I’ll be lucky if I got right), Paul raises a fascinating question: will Rotor lead to an implementation of .NET on Mac OS X? I’ve contemplated this one myself. What would it take to bring .NET to Mac OS X, assuming Rotor on FreeBSD is the first step?

Porting Rotor to Mac OS X: threads and opcodes

The current version of Mac OS X lacks a full implementation of pthreads. However, the Darwin team is working on it. So, if you’re looking to make a name for yourself as the programmer who ported Rotor to Mac OS X, do you help Darwin finish the pthreads implementation first, or work around the limitations by hacking rotor?

Another hairy issue is the fact that Rotor has hooks into the x86 platform through its JIT (Just-In-Time Compiler). If you want to port Rotor to Mac OS X, you’re going to have to port that JIT. I haven’t written assembly code in years, and even when I did, I was just doing silly tricks with the display list interrupt on my Atari 400. Still, my feeling is that porting x86 assembler to the PowerPC will be relatively straightforward. It would be good to have some Computer Science or Computer Engineering courses under your belt, though.

From Rotor to .NET

Rotor would be a round-about way of porting .NET to Mac OS X. Rotor is a stripped-down version of .NET with simplified internals and far fewer public types than the roughly 4000 that are part of .NET. (Although Rotor is an implementation of the ECMA CLI, it has a few more public types than the approximately 300 specified in ECMA). Rotor doesn’t have Windows Forms, ASP.NET, ADO.NET, and many other things that make .NET the compelling development platform that it is.

Still, porting the core would be the first order of business, so if Microsoft has plans to bring .NET to Mac OS X, Rotor could be a first step.

Anything’s Possible

Who knows? Maybe it will all go down like this (shortly after the ghosts of Abbie Hoffman and Philip K. Dick join forces to put Chew-Z in the world’s water supply):

Year Event
2002 J. Random Hacker ports Rotor to Mac OS X
2003 Microsoft ports the rest of .NET to Mac OS X
2004 Microsoft ports Office to .NET managed code
2005 Apple releases OS X for Intel,
Microsoft ports last application (EDLIN.EXE) to .NET managed code.
2006 Microsoft abandons Windows in favor of OS X :-)

(One of these events heralds the immanentization of the eschaton. Which one will it be? Wait and see. I think you’ll be pleasantly surprised.)

What do you think? Has daylight savings time made Brian tired and giddy?

David Sims

AddThis Social Bookmark Button

Google will have an API.

Scripting.com and Slashdot are both pointing to
this post on Ruby-Talk from Ian Macdonald, a sysadmin at Google, who is experimenting with SOAP as a protocol for a programmatic interface for Google.

Cory Doctorow
says he was sworn to secrecy, but now can’t wait to see what folks will develop with such a tool. Meanwhile, Saul Hansell has a timely article in Monday’s New York Times, “Google’s Toughest Search Is for a Business Model.”

David Sims

AddThis Social Bookmark Button

Esther Dyson writes that during an interview with Qwest CEO Joe Nacchio at last month’s PC Forum, two wireless bloggers in the audience were engaged in high-tech heckling that changed the course of the on-stage interview. While Nacchio was “bemoaning” the challenges of today’s tough telecom market, “Linux Journal Senior Editor Doc Searls and San Jose Mercury News columnist Dan Gillmor, got e-mails from a friend … with a hyperlink to Nacchio’s stock sales,” Dyson writes. “Both posted the link, and Gillmor added to the thread: ‘Joe Nacchio, CEO of Qwest, is whining. Poor guy, who took gazillions out of the company … in stock sales while piling on the debt and giving shareholders a not-so-good deal, is bemoaning problems in capital formation …”

Somewhere around this point, the audience — many of whom had laptops with them and were monitoring the real-time blog, turned hostile. Dyson can’t say whether their reaction was due to the blog with its link, or simply to Nacchio himself, but she says one thing was clear: a second conference was occuring simultaneous to the first.