Critical Section

Archive: January 2003

Home

February 2003 >>>


About Me

Wednesday,  01/01/03  01:53 AM

Hi, I'm Ole Eichhorn.  I live in Westlake Village, California, which is about 45 miles north-west of Los Angeles, with my wife and a small menagerie of pets.  We have four daughters, two in college, two out, and one [adorable] granddaughter.  I've spent most of my life coding and herding coders.  In between I sail and ride bikes.  You can e-mail me here.

I am the CTO of InTouch Health, the leading provider of telehealth solutions, making it possible for specialists to treat patients remotely and thereby improving care and lowering costs for healthcare systems around the world.

Previously I was founder and CEO of eyesFinder, a startup making Visual Search a reality.  eyesFinder was founded in 2014, after I'd spent twelve years as CTO of Aperio (which was acquired by Leica), the leader in Digital Pathology.

Previous to Aperio I was with PayPal (SVP/Engineering), Intuit (General Manager of web finance subsidiary), Digital Insight (VP/Engineering), and XP Systems (VP/Development).  You can find me on Facebook and LinkedIn to learn more.

I am philosophical about software and I am writing thinking about writing a book.

My business teachers are Clayton Christianson (The Innovator's Dilemma, The Innovator's Solution) and Geoffrey Moore (Crossing the Chasm, Living on the Fault Line).

My philosophy guides are Douglas Hofstadter (Godel, Escher, Bach), Richard Dawkins (The Selfish Gene, The Blind Watchmaker) and Daniel Dennett (Darwin's Dangerous Idea, Consciousness Explained).

Things I like:

  • simplicity
  • [U|Li]n?x
  • C++
  • children
  • cats
  • wine
  • puzzles
  • markets
  • elegance

Things I dislike:

  • complexity
  • [D]COM[+]
  • .Net
  • self-righteousness
  • fundamentalism
  • whining
  • cheats
  • legislation
  • kludginess

 

W=UH

Wednesday,  01/01/03  01:55 AM

I hold the following to be the "equation of life":

W=UH

Where W=wrongness, U=ugliness, and H=hardness.  In English this equation means:

"if something is ugly or hard, it is wrong"

I first formulated this philosophy in regards to programming computers, where it is undoubtedly true, but gradually realized it had applicability to life in general.

You may have noticed the domain for this site is w-uh.com.  Well, I would have used w=uh.com, but equal signs aren't valid in a domain name.  Then I noticed that  if W=UH then W-UH=0, so w-uh is not only close, it is equivalent.  Kind of pretty, so it must be, er, right.  A recursive example of W=UH in action!

 

Frames

Wednesday,  01/01/03  01:56 AM

This site uses frames.  Why?  Because pages load faster.  Really.  Plus, the header stays at the top, and the navigation stays at the right, even if you have a long article which scrolls.  It is simply cooler.

Now, there are some drawbacks to using frames, but they can all be dealt with.  And this site deals with them.  Here are the drawbacks:

  • Each page doesn't have its own permanent link.
  • Each page doesn't have its own title.
  • Old browsers don't render frames correctly.
  • Non-standard browsers don't render frames at all.
  • Search engines can't index framesets very well.

These are important problems.  With a little work you can work around all of them and deliver a site to your visitor which is fast and works.  If you'd rather not do the work then avoiding frames is probably best.  But the work isn't that bad, and the remainder of this page explains what to do.

There are two main things you must do to make a site with frames work:

  1. Create a way for each page to be rendered without frames. 
  2. Create a way for a top-level URL to be associated with every content page.

The following paragraphs discuss these changes in more detail...

Render pages without frames

One obvious way to render pages without frames is to have two versions of every page, one designed to fit into your frameset, and one which is a "no frames" version with the header and navigation pages embedded alongside the content.  This isn't the most elegant solution, however; it involves a lot of care and ongoing work to keep the two sets synchronized.

A better way is to create a script which converts a "frames" version of each page into a "no frames" version, by rendering a page which has the header and navigation embedded.  This site has a script named noframes.cgi which does this. 

The trick to creating this script is to use the PATH_INFO environment variable, which is set to the part of the URL "beyond" the script in the path.  So a URL like /noframes.cgi/articles/frames.html will have PATH_INFO set to /articles/frames.html.  The noframes.cgi script simply uses this value to create the requested page with header and navigation embedded.

Here is the meat of the noframes.cgi script:

function body {
        sed -n "/^<body/,/^<\/body/p" "$1" |
        egrep -v "^<body|^</body" |
        sed "s/index.cgi/noframes.cgi/g" |
        sed "s|href=\"/|href=\"|g;\
             s|href=\"http:|href=\"http:|g;\
             s|href=\"mailto:|href=\"mailto:|g;\
             s|href=\"|href=\"noframes.cgi/|g;\
             s|href=|href=|g"
       }
body "header.html"
echo "<table><tr><td valign=top>"
body "$1"
echo "</td><td valign=top>"
body "nav.html"
echo "</td></tr></table>"

If you are not a shell script aficionado, I'll try to explain briefly what's going on here; the same thing could be done in any other scripting language or even with a CGI program. 

The core is a function named "body" which takes an HTML page, extracts the part between the <body> and </body> tags, and edits it a little bit.  The editing consists of modifying references to index.cgi into references to noframes.cgi (more on this later), and modifying all HREF URLs so they include index.cgi.  For example, an HREF to "articles/frames.html" is converted to "noframes.cgi/articles/frames.html".  This turns all the "frames" links into "no frames" links.

The outer logic is to create an HTML table which places the header, navigation, and content page appropriately.  Each of these pages' content is included with the "body" function.  The result is a page which contains the header, navigation, and content all embedded together; a "no frames" page.

See the little "no frames" link over there on the right?  Click it and you'll enter the parallel universe of this site without frames.  If you get tired of waiting for pages to reload, you can click the "frames" link on the right to get back.

Top-level URLs for every content page

To have a top-level URL associated with every content page, you must create a script which generates your frameset.  This site has a script named index.cgi which performs this logic.  The PATH_INFO trick is used by this script also; so a URL like /index.cgi/articles/frames.html generates a frameset with the page /articles/frames.html in the content pane.

These "frames" URLs enable a permalink to every page within the site, as part of the frameset.  Each article and post has a permalink associated with it.  Visitors can use these links to bookmark particular content, email them to friends, etc.

Every frameset can [and should] include a <noframes> section.  The contents of this section can be generated by the noframes.cgi script discussed above.  If a browser can't support frames, it uses the "no frames" version of the page.  In addition to supporting browsers which can't render frames, this also gives search engines a non-frame version of your site to crawl.

Okay, with these things done, where does this leave us?  There are a few other little things to do; let's re-examine the drawbacks noted above...

Each page doesn't have its own permanent link

This is pretty important, especially with a weblog.  Essentially every article and post should have a "permalink" in its header which contains a link that re-renders the page.

As noted above, the index.cgi script makes this possible.  Now every page has a permalink, and everyone's happy.

Each page doesn't have its own title

This is a nuance, but an important one.  The solution is to set the title for each page differently from normal.  The usual way would be:

<head><title>my page's title</title>...

This works great if the page is the "top" page, but doesn't work at all if the page is in a frameset.  However, you can also set the title this way:

<body><script>top.document.title="my page's title"</script>...

This works even if the page is not the "top" page.  Leave the <title> tags in the <head>, however, because they are used by search engines!

Old browsers don't render frames correctly

Browsers which try to deal with frames but mess them up are unfortunate.  This used to be a bigger problem in the past, but for a long time now the "current" versions of IE, Netscape, and other popular browsers (e.g. Opera) all deal with frames properly and consistently.  (This is why Netscape 7 is so important, not so many people use it, but people with technical or political reasons for avoiding IE now have an IE-compatible choice.)

The best way to handle this problem is to give users a "no frames" choice.  If they click on it they'll get the "no frames" version of your website and be happy.  Meanwhile the majority of your users who will be using a standard browser which works perfectly with frames won't be penalized.

Non-standard browsers don't render frames at all

There are non-standard browsers which for technical or other reasons can't render framesets.  Examples include WebTV and other TV-based browsers such as game consoles, cell phones, PDAs, and specialized browsers used by people with disabilities.  Browsers which can't deal with frames at all will use the <noframes> version of the home page (see above) and they'll be happy.  Those users will simply enter your "noframes" world. 

Search engines can't index framesets very well

This is true and important.  Search engines use programs called "spiders" which "crawl" a website, following links and indexing pages.  Remember the index.cgi script mentioned above?  Since it generates a frameset with the "no frames" version of each page embedded between <noframes> tags, search engine spiders can access the information and all is well.

You generally want spiders to exclude your header and navigation pages from their indices, even though you want them to follow links on them.  Put the following tag in each of your header and navigation pages:

<meta name="ROBOTS" content="NOINDEX">

This tells spiders "don't index this page", but they'll still follow links from them.

Yeah, it is a little more work to support frames.  But it isn't impossible, and the result is well worth it.  Just try clicking around on this site and notice how fast the pages load.  It really makes a difference.

[ Later - I made a couple of frames-related enhancements, please click here for details... ]

[ Still Later: I ran a survey, and nobody liked my frames, so I got rid of them. (Simple is good...) ]

P.S. I'm happy to share this code - shoot me email if you're interested.

 

The Point of Natural Selection

Wednesday,  01/01/03  01:58 AM

The picture in the masthead is a composite panorama taken at "The Point of Natural Selection", while mountain biking on the SlickRock trail in Moab, Utah.  I like it because:

  1. The point is beautiful and amazing and impressive and thought-provoking
  2. It is a great name, with several intertwined meanings
  3. It captures a memory of a terrific trip
  4. I am an adamant Darwinist
  5. It is a cool picture.

A larger version is available on my personal website.

 

First Post - Welcome!

Wednesday,  01/01/03  02:02 AM

Welcome world to Critical Section, my weblog. 

I started this weblog for two reasons.  First, I think they're a great means of communication; I spend a lot of time reading other blogs (see my favorites on the right), and felt like I have things to say myself and that it was time to start saying them.  Second, I am planning to write a book.  No, I have never written a book before, and no, I don't know anything about it.  So it will be a learning experience, please come along for the ride... 

I plan to post daily about computer software, medical science, business, politics, philosophy, and notes on book writing (!) 


© 2003-2017 Ole Eichhorn

 

Thursday,  01/02/03  11:03 PM

I saw LOTR the Two Towers today with my daughter Alex.  Man, what a movie!  Awesome.

John Doerr has written an interesting piece in the latest Red Herring, arguing strongly against requiring companies to expense stock options.  During the past couple of years, as the momentum for expensing options has gathered, I've found myself ambivalent.  One part of me thinks expensing options is "the right thing to do", another part thinks it would stifle innovation and entrepreneurship.  John is a VC legend, and he makes a strong case.

 

Turning Over Software

Thursday,  01/02/03  11:26 PM

Many of you are programmers, like me.  One of the hardest problems we face is turning over software.

A big part of the joy of programming is the act of creation.  Your code is uniquely yours, a work product which is intensely personal.  It may solve a business problem or automate a tedious task or otherwise do something useful, but it is also a work of art, a personal creation.  You know what I mean, I know you do...

But it is critical that someday each piece of code be turned over to someone else.  Programs are not static creations like buildings, they are more like gardens.  They have an initial plan and form and implementation, but they require ongoing care and maintenance, and enhancements.  If you don't turn your code over to someone else, eventually you will spend all your time caring for your existing code, and you'll be trapped.

In order for programmers to be productive and happy, they must feel a sense of ownership.  This is why when you turn code over to someone else, you have to give it to them completely - it has to become theirs.  It is tough enough to work on code someone else wrote without feeling like it is someone else's code.

There are two things you should do to make turning over code easier on you, and easier on the new owner:

  1. Finish it.  Now no code is ever really finished, but it should be at some reasonable state of completion.  Things should work, or at most there should be a well-defined list of bugs to be fixed.  The code should be feature complete, or at most there should be a well-defined list of enhancements to be made.
  2. Stay out.  Really.  Let the new owner be the owner.  They must have the freedom to change things, even stylistic things that have no actual functional effect.  It's like selling a house - you can't tell the new owners how to decorate.  This doesn't mean you can't answer questions or be helpful, of course.

Note that one of the things is not "document it".  I don't really believe in internal documentation.  There should be copious and accurate comments in the code, of course, and you should turn over whatever specifications and user documentation exist, but writing new documentation for the purpose of turning code over is time-consuming and rarely helpful.

The turnover itself should be a well-defined moment in time.  All the source should be turned over at once, if possible, along with whatever documentation exists, and along with bug lists and enhancement descriptions.  Give the new owner a 10,000' roadmap - do this in person, interactively, at a whiteboard if at all possible.

If relevent or possible, build the code with the new owner, and go through a sample debug session.  This gives them the end-to-end knowledge they'll need to actually "do" development.  You might think it is simple - just a Visual Studio project to be built - but do it anyway.  You'd be amazed at all the little things which come up during development ("oh yeah, that header file is in this directory").  Debugging is even more idiosyncratic.  During the course of development, you figured out the best way to do it, and this is part of the campfire knowledge which should be shared.

It is good to identify some simple first tasks for the new owner to perform, to foster familiarity with the code and overcome the intimidation factor.  Be as helpful as possible for these first tasks, and give the new owner as much credit for performing them as you can.  You want them to feel a sense of accomplishment right away.

I've spent much of last year building some code which I'm going to turn over in the next few weeks.  I'm not looking forward to it.

 

Friday,  01/03/03  11:15 PM

Went to the snow today, visted Blue Jay with my daughters Megan and Alex.  Made a snowman (well, more like a snow tower), threw snowballs, got wet, had fun.

Interesting how fickle the national mood is these days, or is it just me?  In November things were bad - consumer confidence low, market down, war pending.  In early December everything was better - retailers happy with Thanksgiving sales, market turning around, etc.  Now everything is again not O.K. - retailers unhappy with December sales, market up but only temporarily, etc.  The specter of war hangs over all.  I think we are experiencing deflation right now, we just don't know it yet - salaries are down, stock prices are down, consumer goods are down (cars, electronics), and housing is down in many areas.

Seems Apple is planning to charge for i-App upgrades.  Hmmm...  I guess this is good strategy - bundle them free with new Macs (so they continue to be a differentiator vs. Wintel PCs), but drive more revenue from people who already own Macs.  Kind of like charging for .Mac (their online services), users kvetched, but Apple is earning more revenue.

Megnut is talking about how ugly the new cars are.  I could not agree more.  This boxy look has got to be a fad, right?

 

So about this book...

Saturday,  01/04/03  12:15 AM

First, I'm not ready to say what it's about yet.  It isn't any great secret, but I have something to say (that's why I'm writing it), and I need to think about the best way to say it.  It is nonfiction, philosophical, somewhat political, and [probably] controversial.  I hope so, anyway.

Seems to me there are two big tasks.  {Actually three, task zero was figuring out what to write about, but after six months of thinking and writing some preliminary essays this is done, at least at a high level.}

Task One is writing the book.  In my infinite hubris and inexperience, this seems doable.  Here's what I'm planning to do, in approximately this order:

  • Come up with a working title.  Right now I like "Unnatural Selection", which could give you a clue what the book is about.  Another was or is "The Idiot Quotient".
  • Write an elevator statement.  I should be able to say "what is this book about" in like one sentence, in a way that everyone "gets it".  When I have this, I'll share it with you, I promise.  My budget for this is one month, starting now (although of course I can always amend/enhance later).
  • Write an outline.  Use it to organize everything I want to say and how I'm planning to say it.  My budget for this is two months, starting now.  Actually I have started this already.
  • Write each chapter, conforming to the outline.  When I'm done, I should have this massive 200-300 page Word document.  My budget for this is six months, which could be hopelessly optimistic, but hey, I'm a hopeless optimist.  I have begun two of the chapters, each of which started out as an essay, unrelated to the other.  It was realizing that they were not unrelated - at all - which prompted me to realize "hey, this is important, and hey world, check this out!"
  • Do a bunch of research to backup my writing.  The book will propound a theory.  The more facts I can find to bolster my theory, the better.  Google is my friend. 
  • Get as many people as possible to read as much of the book as they're willing, and give feedback.  The trouble with a book is that - unlike, say, software - once it is out there, it is what it is.  You can't fix typos, you can't reword unwieldy sentences, and - gasp! - you can't make an incoherent argument more coherent.  Seems like you have to get as much feedback as you can up front ("beta testing") and incorporate as much of it as you can, and then hope for the best.

Task Two is getting the book published.  I have no clue where to begin.  I can't even make a list.  So, here's my plan to make a plan:

  • Contact as many people as I can, and ask them for help.  Lots of people have written books and lots of people know people who have written books.  If I talk to as many of them as I can, maybe I'll learn about the process.
  • Scour the Internet looking for information about writing books.  Google is my friend.
  • Join writing clubs, etc. to associate with writers.  Not only is the networking good (I can ask the people I meet for help), but this has to be a shared problem.  Also I might learn much which will advise the actual process of writing (Task One).

Any comments?  What would you do?


© 2003-2017 Ole Eichhorn

 

Saturday,  01/04/03  11:15 PM

Went mountain biking with my friend Bill today, up at Sycamore Canyon.  A beautiful Winter day in Southern California, sun dancing on the waves.  Good workout, good to get out, good to talk to Bill about music.  Good!

This afternoon spent some time reading Steven Pinker's The Blank Slate.  I'm about halfway and it is getting better.  I knew I would like it - I'm in the choir he's preaching to - but the writing was a little unwieldy for a while.  Now he's picking up steam.  This is a good thing to keep in mind as I write, I need to keep things moving.  Like lawyers say, "if I had more time, I could have made it shorter".

I'm blogging while watching football - I've stayed away from the news sites, 'cause I don't want to know the scores.  {Amazingly I made it all through the day without hearing yesterday's Fiesta Bowl score; I watched it tonight, what a game!  But a bad pass interference call decided it in the end, too bad.}  I did see where I made Dave Winer's blog, talking up my Treo 300.  And Stephen Den Beste has posted another long treatise on the pending Iraq war (how does he find the time?)  Maybe I'll check around more a little later.  Tonight I want to get my visitor database going - I don't want to spend any effort getting people to visit my blog until it's done.

 

Tracking Visitors

Sunday,  01/05/03  03:56 PM

I built a little system for keeping track of visitors to this site.  Here's how it works - by way of disclosure, and in case you care...  and also in case you have suggestions for improvement!

Background

Many if not most sites track visitors, why?

  1. To make sure the site is working.
  2. Various technical reasons (browser compatibility, network connectivity, etc.).
  3. For accounting purposes (doesn't apply to a personal 'blog, of course).
  4. To watch where they are coming from.  Interesting and [perhaps] useful.
  5. Vanity.  ("Yippee, three hits!")

The general information available from a visitor comes from three sources:

  1. TCP/IP socket connection.
    • Source IP address (may lead to source domain).
  2. HTTP header
    • Browser type (aka "user agent").  Often implies platform and OS, too.
    • Referring URL, if any.
    • Cookies.
  3. HTTP request
    • Session information passed through from previous request.
    • Form information entered by user.

Keep in mind that HTTP is stateless, a webserver cannot remember anything from one request to the next.  The only way to maintain state across requests is by saving information via the user's browser.

For many website purposes it is important to maintain information within a session.  (Session is not a technical term, but it means roughly "same visit by same user from same computer".)  Temporary cookies or form variables can be used for this purpose.

For other website purposes it is important or desirable to main information across sessions.  Essentially this means "different visit by same user from same computer".  Persistent cookies are the only way to accomplish this.

When passing information from one request to the next via form variables or cookies, there are two basic techniques.  One it to pass the information itself through the browser.  This has the advantage that the server need not store anything, but it has several disadvantages:

  • The information is "visible" on the network.  This can be addressed by encrypting the information, at some cost of additional overhead.
  • The information may potentially be modified on the network or by the user.  Modifications can be detected via checksums, etc., but they may still impair the information.
  • The information may be lost entirely if the user clears their cookies, reloads their software, uses another computer, etc.
  • The information may be large, in which case the fact that it is passed back and forth on each request slows the interactions.

The other technique is to store the information on the server, and pass a pointer to the information through the browser.  This is preferred.

Details

I decided to assign each visitor a unique number, and store it in a permanent cookie.  (The cookie is named w-uh, if you'd like to check...)  This number is used as an index to a small database.  In the database I keep track of each new visit, with "a visit" defined as "each time I see the cookie after at least three hours have elapsed since the last visit".  I'm currently storing date, time, IP address, and domain, along with a count of visits.  I also have another little database where I store referring URLs and their corresponding targets.

Because I have the date and time of a user's last visit, I can highlight things which are new since they last visited.  I'm currently thinking about the most useful way to do this.  Possibilities:

  • Put a visible token next to each "new" post or article.
  • Shade "new" posts or articles on the home page.
  • Build a "what's new" page for returning visitors.
  • Some combination of the above...

Stay tuned - I'll let you know what I decide...

Along with mere traffic information, I'd like to have a visitor's email address.  That way I can communicate with them to tell them about site updates, ask their opinion, etc.  The only way to get a visitor's email address is to ask them for it, and naturally you don't want to pester them.  So I decided on the following logic:

  • If I already have a visitor's email address, I do nothing.  It doesn't seem worth verifying.
  • If I don't have a visitor's email address, after three visits I pop up a window asking them for it.  (I assume anyone who hasn't visited at least three times is probably not interested in getting email about the site.)  If they give it to me, great, otherwise I assume they don't want to give it to me and store a "not given" status.

The implementation was simple because my site has two entry point CGIs, index.cgi and noframes.cgi, as described in the frames article.  These CGIs simply call a common subroutine to manage the cookie stuff.

 

 

Sunday,  01/05/03  09:47 PM

Tonight I sent email to many of my friends telling them about this site.  If you're one of them, welcome!

I also sent email to every author I like and respect (many of these) and for whom I was able to find email addresses (not many of these), asking for help writing my book.  If you're one of them, welcome! and thanks!! in advance for whatever help you can offer.

Great football this weekend, eh?  The best thing about WiFi is you can take your computer to your TV, and watch football while you're working...  I can watch TV on my computer, but somehow that doesn't work as well.  And of course you need Tivo, so you can back up and watch the big plays after you've heard them.

Which reminds me - I just want to thank the enlightened people at NBC Sports who broadcast the Gator Bowl on New Years' Day.  They managed not to give any scores of the Cotton Bowl and Outback Bowl going on at the same time.  Finally a network realizes that nobody watches sports live anymore.

Today was my annual chance to kill myself falling off my roof, taking down the 'ol lights.  I survived.

 

Monday,  01/06/03  10:46 AM

Yippee, 79 visitors.  Thanks for coming by...

Just read about a program called ExtractStream, which extracts audio and video streams from a Tivo.  It requires TivoNet (a self-installed physical modification to your Tivo which provides an ethernet interface).  Looks wonderfully user-unfriendly.  I look forward to pissing away many hours messing around with it!  (And to think I nearly bought a DVD-recorder to make analog copies of Tivo recordings...)

 

The nonfiction publishing landscape

Monday,  01/06/03  12:44 PM

The clouds enveloping the foreign world of non-fiction publishing are breaking up a little - I'm getting glimpses of the landscape...  Thanks to everyone who's responded with ideas and contacts.  And Google is still my friend.

Two new concepts:

  1. Book Proposals.  According to Nonfiction Book Proposals Anybody Can Write (which I've ordered): 

    "A book proposal is a marketing tool used to describe your book idea and sell it to a publisher.  Virtually all nonfiction books are sold by proposal.  It serves as the conventional means of communication between writer and agent/editor.  In addition, it serves as a powerful aid to you, the writer, by helping you refine ideas, clarify organization, and speed the eventual writing of your book."

    Looks like I have a new Task One.

  2. Literary Agents.  Product managers for books.  According to www.writers.net:

"There is more to being a writer than stringing words together. Even great writers have to do more than write. Unless you can persuade someone to publish the words you slave over, your writing will remain unknown and unread and writing will drain rather than fill your bank account.

That's where a Literary Agent comes in. Your literary agent is the book-marketing expert who can sell your crafted words to jaded publishing professionals...  ...Your job, which isn't easy, is produce writing that an agent can believe in."

Looks like I have a new Task Two.


    © 2003-2017 Ole Eichhorn

     

    Monday,  01/06/03  02:31 PM

    The Wired Rave Award nominees for 2003 are in (aka "renegade of the year").  Want my opinion?

     

    Tuesday,  01/07/03  08:43 AM

    So Jon Johansen, the teenage kid who wrote DeCSS, was cleared of all charges.  Yippee.  The MPAA and RIAA continue to push their rocks up the hill, but they'll get rolled in the end.

    Dave Winer on the two-way web.  I don't get it.  But Dave is often way ahead of me...

    Man, Steven Den Beste does not like the French.  Personally I welcome anyone's help.

    Have you noticed how many 'blogs have really long blogrolls?  I guess they're hoping if they link to other sites, those sites will link back and give them traffic.  Defeats the whole purpose.  I like and endorse every site in my little 'roll and visit them daily.  There should be a timeout on 'roll links, if you don't visit a site at least once a week, don't list it.

     

    Tuesday,  01/07/03  10:50 PM

    Apple Safari Browser

    Lots of news on the Apple front tonight!  This new web browser Safari rocks.  On my iMac it is way faster than IE, and everything looks right.   The preferences are simple, the menus are simple, the look is clean.  Nice goin'!

    Today I tried to update my 'blog from afar, but was unsuccessful; no joy in SSH-ville.  My webserver is an old P233 running RedHat 7.1 (before you try the standard exploits, yes, I have applied all the Apache patches, and yes, I'm behind a firewall).  Citydesk can only update a local directory or use FTP, so I tried to setup an automatic rsync from a local directory automagically via an SSH tunnel.  It worked about as well as it sounds like it would work, which is to say it failed miserably.  I need something simple.  W=UH!

     

    Wednesday,  01/08/03  12:43 PM

    From Wired News:

    Bushtonian Ethics
    If you're going to make a mockery of the public trust, you might as well do it as unethically as possible. House Republican leaders did it in secret this week, weakening rules and making it easier for lawmakers to accept free food and vacations from lobbyists. Thus watered down, they were then concealed in a larger package of rules revisions that passed Tuesday on a party-line vote. A spokesman for House Speaker Dennis Hastert (R-Illinois) described the changes as "cosmetic" but Democrats said they seriously erode tough ethical standards introduced, ironically enough, by Republicans when they took control of the House in 1995.

    A political trojan!

     

    Wednesday,  01/08/03  12:50 PM

    Thanks, Adam!

    Understanding Computer Technology

    Dave clarifies the two-way web.  I still don't get it, but its getting closer [later: no, I still don't get it :]...

    Is there a there, there?

    I don't understand 802.11a, do you?  Since 802.11b is already much faster than everyone's Internet connection, what's the point?  (Apple doesn't get it, either.)

    Einstein is right again!  (love that picture, is it real, or is it Photoshop?)

    Well, this is cool!  (Thanks, Marc.)  My Tivo will play music on my surround sound stereo from my Mac...

    You know why we have to go to war? Saddam's too unreasonable for deterrence.  (Thanks, LGF.)  So, what about Kim?

    Halley continues her series on Alpha Males...  Lesson 4: watch Stag Films (e.g. Bambi).

     

    Wednesday,  01/08/03  10:17 PM

    Yippee.  I've been Googled

    164 of you have visited so far, of whom 50 have returned at least once.  Thanks!

    Guess what?  Posts since your last visit are shaded.  Please let me know what you think!

     

    Thursday,  01/09/03  06:08 PM

    This looks interesting!  Getting music and video from the computer to the living room is starting to be a "thing"...  and of course Tivo will be part of it :)  HP just announced their entry in the market, as well.

    Here's an interesting history of time.  (Thanks Sean)  Especially relevant because my book has a lot to do with things happening at different time scales...

    Digression:  Before the 'net, how would someone in California find out about an interesting essay written by a Norwegian?  No way.  Now it just happens...  via manufactured serendipty.

    I guess North Korea is hoping we'll get scared and give them fuel oil again.  That's the only thing that could explain their actions.  Somehow I don't think it will work this time...

    Please join me in welcoming Gene Expression to my blogroll!  In addition to the great name, there are some great posts in there, very relevant to the book...  please check it out...

     

    Friday,  01/10/03  04:38 PM

    Had lunch with Reid Hoffman today, he gave me a thought worth sharing: "gardening in relationships".  The idea being that good partners "garden" each other...  (He's a PayPal alum who has a new startup presently in stealth mode...)

    There's a lot happening in web-ville:

    My heros at Gene Expression are discussing my book!  (And they haven't even read it, yet)

    Another PayPal alum - Peter Thiel, the CEO - talks about his future plans...

    Want proof that truth is stranger than fiction?  Check out this family up for auction on eBay...

    Here's something every nonfiction writer needs, Carl Sagan's baloney detection kit...

    I love these cautionary tales about business excess, don't you?  (Thanks Clay via Joel)  I might have to add Clay to my blogroll, he's got some awfully good stuff.

    "It's like a Best Buy, Circuit City and Fry's Smackdown organized by Siegfried and Roy. "  Sounds fun...

    The problem with Metadata...  very funny!  (Thanks Dave)

    As usual, Stephen nails the North Korean situation...

    And finally, now that it is Friday night, are you ready for some football?

     

    Saturday,  01/11/03  02:49 PM

    Michael Powell, FCC Chairman, got a Tivo for Christmas.  And he likes it...

    A U.S. District judge has ruled that Kazaa may be sued in California.  Keep on rolling that rock uphill, RIAA and MPAA...

    The next Windows server product is renamed (again)...  For those keeping score, Whistler entered beta on June 30, 2000 with a projected release date of end 2001.  This story from November, 2000 says the next release after Whistler, code named "Blackcomb", was expected to ship in 2002.

    Last night I rearranged my office.  Everything's different, but the biggest change is that I hooked up a decent pair of speakers to my computer.  So today I'm listening to music while coding.  What a difference!  I used to do this all the time... wonder why I stopped?  Sometimes I feel like a listening to my music (usually a particular band), but other times the randomness of  "radio" is nice...  Live365 is to commercial radio as weblogs are to media websites.

    Have you seen the latest Apple Powerbook commercial?  Featuring Yao Ming and Mini Me.  Very clever!

     

    Sunday,  01/12/03  02:29 PM

    Wow!  Check out this treatise on "the garbage generation"!  There's some strong stuff out there on the 'net, people saying things that need to be said...  Much of this is opinion, of course, and open to debate; but the central problem (one-parent families) is not.  Nor the overall negative consequences.  I find the most interesting parts to be the exposure of incorrect social responses, as in the mutilated beggar argument.

    [By the way, Upstream has a lot of great stuff.  It also has a lot of rotten stuff - racist pseudo-science, invalid philosophy, crummy writing.  Too bad there isn't an editor, but then, maybe that's the beauty of it...]

     

    Monday,  01/13/03  10:42 PM

    Great football yesterday, eh?  Ole's Super Bowl picks: Raiders over Bucs.  It won't be close.

    Big news about Steve Case resigning as AOL Chairman.  Many people feel he was responsible for a lot of lost shareholder value since the Time-Warner merger.  Maybe so, but he was responsible for a lot of gained shareholder value prior to the merger, too!  I think the Time-Warner execs were at fault; looking back, who got the better deal ?  =)

    Why expensing options doesn't solve the problem...  And not only that, it would cause new problems.

    You've got to love Slashdot.  Check out this guy in Egypt who has a 1KM wireless LAN.

    Astronomers have seen the end of the universe.  And of course it lies in the distant past.  Not to be confused with the middle of nowhere.

    I've heard of debugging, but what do you call thisssss?  (Thanks, Karlin)

    Looking for new reading?  Check out All Consuming, sort of like DayPop for books.

    To wrap up today's postings, here's some food for thought; Steve Sailor asks:

    Why are "widows with children" now "single mothers"? ... Let's be frank: women who have children without a husband are harming society. Why should they be treated as sympathetically as a mother whose husband has died?

    In case you think this is merely language, consider that over 25% of all U.S. births are illegitimate.

     

    Tuesday,  01/14/03  07:59 PM

    Well, you knew what the lead item for me would be tonight, eh?  Guess who won the Wired Rave Awards?  The one person I felt absolutely should not win.  I guess the judges don't read.  Sigh.

    Personal Knowledge Publishing.  That's what I'm doing, right now.  (Thanks, Dave)

    Now that HP2 came and went, and LOTR2 has come (watched it twice so far), time to reloadSounds awesome!  (but we have to wait until May 15th)

    This is bad news.  FAO Swartz owns Zainy Brainy, which is my kid's favorite store, which means it it my favorite store - after Fry's, of course.  I sure hope they spare the one in Westlake.  (We've done our part in helping them boost revenues :)

     

    Wednesday,  01/15/03  09:33 AM

    Just came across something too great not to share.  From Jamie Zaworski, an original Netscape developer:

    ``Every program attempts to expand until it can read mail. Those programs which cannot so expand are replaced by ones which can.''

    This reminds me of Wirth's law, to the effect that "every sufficiently powerful computer language has equal power".  A good litmus test for this power is the ability to create a lunar lander game - or an email client.

     

    Wednesday,  01/15/03  10:03 PM

    This announcement by President Bush is very interesting.  He continues to show that he takes positions based on his true feelings, regardless of the political fallout.  This is commendable even when the positions themselves are not.  I agree with this one; racial quotas are indefensible even as a means to right past wrongs.

    Not unexpected, but the Supreme Court ruled against the challenge to copyright extensions (aka "Sony Bono Law").  Well, Larry, you gave it a good shot...

    Do you understand why Microsoft was ordered to ship Java in Windows?  Let's see - Microsoft included a JVM in Windows, Sun sued them to take it out [because it implemented Windows-specific extensions], so Microsoft pulled it out, so Sun sued them to put it back.  Huh?

    Don't you hate it when C|Net does articles like this?  The 30 second skip feature has been in Tivo since day one, and experienced Tivo-ers have known about it since day one.  Why write an article about it now?

    From ExtremeTech:

    At first blush, the [Onkyo] NAS-2.3 seems like a CD player, but it also has an embedded 80GB hard drive. So now it appears to be like any number of digital music players on the scene. But the NAS-2.3 also has a 10/100 Ethernet port, and is capable of acting as a music server to a network of Net-Tune devices. Running on the Integra product is an embedded Linux operating system, which acts as the server software.

    Have you been following the Louis Vitton Cup?  Oracle finally beat Alinghi today (yesterday?) making a race of it...  Great machines, great racing, and great personal drama.  The America's Cup Finals are going to be terrific!

    Turns out this 'blogging can be dangerous; just ask Iain Murray...

    I'm leaving town for Vancouver for a couple of days; I'm going to try remote posting, but who knows if it will work...

     

    Saturday,  01/18/03  09:49 AM

    I'm baaack!  Vancouver was cold but great.  As expected, rsync updating to my 'blog was an utter failure.  I need a good way to post from the road.

    Lots to do today... but first, I need a solution to remote email.  My Treo has a really cool interface to my desktop email (Outlook).  But - when I'm traveling, so is my "desktop".  Handspring has a product called Treo Mail which solves this problem, but it only supports one email account.  So I'm trying One-Touch Mail from JP Mobile.  Keeping my fingers crossed...  {There's a cool site called Handango which has a lot of Palm OS stuff - worth checking out it you're a Palmist.}

    Are you a Windows XP user?  Do you use System Restore Points?  I didn't even know they existed until today, but they are really cool.  A restore point is a checkpoint of all system files, registry entries, etc.  Checkpoints are created automatically by XP whenever you reboot, install new software, or remove software.  You can also create them manually with Start | Programs | Accessories | Systems Tools | System Restore.  This is also how you can view the checkpoints already created, and actually restore to a checkpoint.

    It is old news today, but Alinghi defeated Oracle again to take a 4-1 lead in the best-of-five Louis Vuitton Cup finals.  The winner becomes the "challenger of record" against New Zealand in the America's Cup later this spring.

     

    Sunday,  01/19/03  10:12 PM

    The fat lady has sung in New Zealand.  We're going to have an America's Cup without Americans.  So be it!

    You know me; I don't think the pirate bowl is going to be close.  Good football today in both games.  Is it just me, or are penalities being called too often?  I don't think it is the refs, I think it is the rules.  Too many.

    So, Colin Powell thinks race should be a factor in university admissions.  What a racist!  I like Colin Powell, but really, how can this point of view be defended?

    Want to read something really eye-opening?  Try this.  Then imagine what it will be like in one more generation.  (Now you know why I have to write my book.)

    This is special.  Iraq is going to form a team to help the U.N. find their own WMDs.  It won't be reported this way, but this amounts to an admission that their December report was incomplete.  Steven thinks the U.S. attack has already been ordered.  I think he's right.  [Later, here's a smoking gun.  Why haven't more outlets picked this up?]

    Finally, from my daughter Megan, 5½: "Hey, Dad, I'm me!"  "You sure are, Meg."  "No, my initials are M.E.; I'm me!"  Wow.  She sure is.

    I messed up and posted this Monday morning.  Forgot to click the publish button.

     

    Baby Steps

    Monday,  01/20/03  06:36 PM

    Some key findings from my advisors (that would be you):

    • A book proposal is a good place to start.  Double clicking on that, a good way to start a book proposal is with some key things which will go into it:
      1. A crisp "elevator statement".  (Pretend you meet the world's greatest publisher in an elevator.  You must tell her about your book in the time it takes to reach the ground floor.) 
      2. A definition of your readership.  Many people have asked "who is your book for?"  Well the real answer is "it's for me", because I need to write it.  But beyond that, I do have a vision of who the intended readers are - you are, for starters.  (Yeah, you).
      3. An outline of the book, chapter by chapter.
      4. One or more essays which will evolve into chapters.

    Once these things are done, the rest of the book proposal should be easy to assemble.

    • Most people who start out to write a book never finish it.  They never finish it because although they know how it starts, they don't know how it ends.  The best defense against this is to have a good outline.  I may get bored and stop writing before the book is done, but at least I won't wonder how it was supposed to end.
    • Many literary agents are vultures.  It seems it is not necessary to have a literary agent to sell a book, although it might be helpful, but rather literary agents are useful to negotiate a contract after the book has been sold.  So this comes at the end, in fact, it comes after the end.  The whole literary agent thing can be safely ignored for a while.
    • The best advice seems to be - the way to write a book is to write.  I'm going to pick several subjects from the book and write essays about them.  Then I'm going to share them with you, my intrepid readers, so you can pick them apart.

    So here's the plan of action...  First, you know the title, Unnatural Selection.  I have written the elevator statement.  It is not ready for your consumption - yet - but please stay tuned, I promise I will share it with you "soon".  I have begun the outline, but I'm not ready ready to share that, either.  But here's an outline of the outline:

      1. Intro: There is this phenomenon.  This phenomenon is causing problems.  The book is about the phenomenon, the problems, and possible solutions.
      2. Part I: What is the phenomenon.
      3. Part II: What are the problems it causes.
      4. Part III: Why the phenomenon is occuring.
      5. Part IV: Possible solutions.  

    The first essay is one I'd written some time ago, called Population Math.  It explains the growth of populations in terms of birth rates, average lifetime, and average generation time.  This will probably be an appendix - maybe not the best place to start! - but it provides important background for the rest of the book.  I'll clean this up and post it sometime this week.

    The second essay is one I've written twice already, but I haven't been happy with either version.  It will be called Social Selection, and deals with the issue of who, in present day human society, ends up having children, and why.  This will be part of Part III (why the phenomenon is occuring), and really sets the stage for the book itself.

    Thank you thank you thank you to all those who have emailed with advice, especially the authors among you.  Please keep it coming.


    © 2003-2017 Ole Eichhorn

     

    Monday,  01/20/03  07:56 PM

    This thingie is too cool not to share.  I love my iPod.  I just wish I didn't have to use wire to connect it to my car.  Or to my home stereo.  Now, I don't!  {This is a great example of good product thinking.  All music systems have an FM tuner already.  How do you get music into these systems?  Use FM.  Simple.}

     

    Tuesday,  01/21/03  11:25 PM

    Nicolas Negroponte: "Creating a Culture of Ideas".

    Projection keyboards, the next big thing.  Perfect for my little Treo.  (Thanks, Marc)

    More from Paul Graham on Bayesian Spam Filtering...

    The web is so cool.  Here's a French site about Citidesk, with a referral to my article on frames!  (Can anyone translate "écrit-il"?)

    If you have fifteen minutes and want to laugh, this one's for you.

    Welcome to the newest member of my blogroll, Surfin' Safari, a 'blog by Dave Hyatt, one of Apple's Safari web browser developers.  I don't know why I like it, but I seem to visit it just about every day, so there.  (For extra credit, click on Dave's Page Theme buttons - how cool!  I have to learn more CSS...  And here's something cool you can do with CSS :)

     

    Wednesday,  01/22/03  04:25 PM

    Sometimes I agree with President Bush, sometimes I don't.  I sure don't agree with his views on abortion.  He needs to read my book.  Which is why I have to write it.  Get busy, Ole!

    Steven Den Beste thinks the war will start on 2/1.  Fasten your seat belts 8(

    Chinese researchers announced Wednesday the discovery of a feathered dinosaur that glided on four wings.  I love it!  (As physicist I.I.Rabi commented when the neutrino was discovered, "who ordered that?")

    Hilary Rosen is stepping down as the CEO of the RIAA.  I used to think she was a dinosaur, but a great article in the latest issue of Wired made me feel sorry for her.  She's been trying to drag the music publishers into the 21st century, to no avail.  There's other great articles about the music industry in that issue, too, including one about Kazaa CEO Nikki Hemming.  The cover story is available online - The Year the Music Dies.

    Wow, a Linux powered PDA - from the Penguin-meisters at IBM.

    Here's some cool webness from GE.  How do they do that?

     

    Thursday,  01/23/03  09:18 AM

    Po Bronson is one of my favorite authors.  I so remember The First $20M is the Hardest, published in 1997, right as I was joining Digital Insight.  It captures the ethos of the late 1990s' boom clearly, and it is well worth a [re]read as a perfect snapshot of the time.  Po has a new book out called What Should I Do With My Life, and it could have been called The Second $20M is Even Harder.  This book (which I've ordered, but not yet read) tells the stories of fifty people who have rethought their life.  One of the stories is about Mike Lanza, who founded 1View, which was bought by Digital Insight in 2000.  Prior to that he founded Just In Time Solutions, now called Avolent, which was a key partner for Intuit when I was managing their online billpay business.  Small world!

    Printing living tissue.  What will they think of next?  Wow!

    Condoleezza Rice: Why We Know Iraq is Lying.

    Are you ready for some chess?  The world's best human faces off against the world's best computer.  This match features a grudge angle, in 1997 Deep Junior's "dad", Deep Blue, defeated Kasparov, marking the first time a computer had ever defeated the reigning world champion.  (Interestingly, while Deep Blue was more powerful than Deep Junior [in terms of hardware and consequent depth of search capability], most chess experts feel Deep Junior plays "better" [more elegant] chess.)

    Two Caltech astonomers have used the Hubble Telescope to locate the largest object in the solar system since Pluto was found 72 years ago.  The proposed name of the icy ball is Quaoar ("Kwa-whar", catchy, huh?)  Despite orbiting the Sun, this is not considered a 10th planet, rather a Kuiper Belt object (KBO).  In fact the finders suggest that Quaoar proves Pluto is really a KBO also.

    Halley posted some great jokes.  Just remember, use a pun, go to jail.  It's the law.

     

    Friday,  01/24/03  02:51 PM

    Interesting Wired article: The War Within Sony.  Sony is conflicted between being a leading media company (movie studio, record label) and a leading supplier of personal electronics.  A microcosm of the issues facing the media industry as a whole.

    Guess what?  There's now a DVD player on the market which plays DIVX video.  This will shift downloaded-movie-watching from the PC to the family room, where the home theater is located.

    Meme of the day: The Axis of Weasels.

     

    Saturday,  01/25/03  11:03 PM

    Just a few I had to share today - I'm too busy coding for anything else :)

    I find the latest announcements by the Bush administration very disturbing.  Either the Bush administration has a smoking gun – tangible evidence that Iraq has WMDs or has been trying to make them – or they don’t.  I’ve been assuming all along that they did, and that at the appropriate moment, they’d present their evidence to the American people and begin bombing.  Our so-called Allies would see this evidence and could decide whether it was conclusive or not, but there would be no doubt about why the American government felt war was necessary.  The Weasels would know the rationale even if they continued to disagree with the right response.  Now it appears the Bush administration does not have a smoking gun.  If they did, why back down now?  And if they don’t have a smoking gun, then the whole strategy is called into question. All the troop movements, all the talk of war, all the machinations of the U.N. and U.S. diplomats, would be revealed to be mere saber rattling – and very expensive and diplomatically damaging saber rattling at that.  Nobody believes the U.N. inspectors are going to find a smoking gun, in fact, their activities have caused all guns of any kind to be hidden or destroyed, whether smoking or not. The chances of a smoking gun being found now are slim.  Without firm evidence the U.S. could never have made a case for war, even with full international support; the U.S. people would not have stood for it.  Perhaps Colin Powell will clarify things in tomorrow's address...

    Slashnot: the Onion for geeks...  Really well done.

    Check out this picture. This is a real crop circle. Wow.
    Alien Crop Circle

     

    How to Write C++ Classes

    Sunday,  01/26/03  10:14 AM

    If you're programming in 2003, you're most likely coding in either C++ or Java.  These languages are quite similar syntactically, and provide a solid, well-defined way to package functionality in objects.  They also share a common defect, they make it difficult to hide interface details from implementation details.  I have the solution - read on!

    The Problem

    In a typical class, you have a header file <class>.h and a code file <class>.cpp.  The header contains the class definition.  The class's public properties and methods define the interface details of the class.  This is the information users of the class need.  The class's private properties and methods define the implementation details of the class.  This information is only used in the code file, it is not needed by any user of the class.  But, because both sets of properties and methods are in the same header file, all users of the class "see" the implementation details.  This is the defect.

    Before prescribing a solution, let me explain why this is a defect.  First, it is ugly, and by W=UH this means it is wrong.  Second, whenever the implementation data are changed, the header changes.  This causes all users of the class to require recompilation.  But changing the implementation should never affect any users of the class!  Third, changing the private properties and methods may change the size of the class's data.  This implementation-only change can affect users.  Consider the following example:

    _____ myclass.h _____
    class   myclass {
    private:
            int     theInt;
    public:
            myclass(void);
    int     getInt(void);
    void    putInt(int theInt);
            };

    _____ mycaller.cpp _____
    ...
    void    myfunc(void) {
    myclass localInt;
    int     stackInt;
    ...

    This shows a simple class which encapsulates an integer, and a simple caller which instantiates it.  Let's say we change the class slightly, as follows:

    _____ myclass.h _____
    class   myclass {
    private:
            int     theInt;
            int     counter;
    public:
            myclass(void);
    int     getInt(void);
    void    putInt(int theInt);
            };

    The new implementation datum is highlighted in green.  Even though this is only a change to the implementation, it will break the caller!  Because the size of the myclass object has changed, the location of stackInt will change.  Not only will every user be recompiled because the class header changed, but every user has to be recomplied, because the size of the object has changed.  All for an implementation-only change.  A defect indeed.

    The Solution

    Okay, now on to the solution.  The crux of the problem is that the implementation details (the private properties and methods) are defined in the class header.  So let's pull them out of the header, shall we?  Instead of defining private properties and methods in the class header, let's create a new internal class to "package" the implementation details.  This class will be defined in the code module for the class.  Only a pointer to the internal class will appear in the header.  Here's the class header with this organization:

    _____ myclass.h _____
    class   iclass;            // warn compiler iclass is a class

    class   myclass {
    private:
            iclass  *icp;      // internal data object pointer
    public:
            myclass(void);
    int     getInt(void);
    void    putInt(int theInt);
            };

    As you can see, there is only one private datum defined in the class header, a pointer to the internal class.  Here's the code module for the class:

    _____ myclass.cpp _____
    ...
    #include "myclass.h"       // external class definition

    class   iclass  {          // internal implementation class
    public:                      // everything in iclass is accessible
            int     myInt;
            };
    ...
    myclass::myclass (void) {  // class constructor
            icp = new iclass;  // instantiate internal object
            ...
    }
    ...
    myclass::~myclass () {     // class destructor
            ...
            delete icp;        // destroy internal object
    }
    ...
    int myclass::getInt (void) {   // class method
            return (icp->theInt);  // access internal data though pointer
    }
    ...

    Note that the internal class is defined right in the code module, there is no need to define it in a separate header, because this is the only place it will be used.  If we want to add a new datum to the implementation, we just go ahead and do it in the code module:

    _____ myclass.cpp _____
    ...
    #include "myclass.h"       // external class definition
    ...
    class   iclass  {          // internal implementation class
    public:                      // everything in iclass is accessible
            int     myInt;
            int     counter;
            };

    myclass::myclass (void) {  // class constructor
            icp = new iclass;  // instantiate internal object
            icp->counter = 0;  // can perform initialization here...
            ...
    }
    ...
    myclass::~myclass () {     // class destructor
            ...
            delete icp;        // destroy internal object
    }
    ...
    int myclass::getInt (void) {   // class method
            icp->counter++;        // internal-only data
            return (icp->theInt);  // access internal data though pointer
    }
    ...

    Again, the changes are highlighted in green.  Only the code module is affected; the class header did not change, and none of the users of the class have to be recompiled.  Isn't this pretty?  It must be right :)

    Cheshire CatThis technique is sometimes called a "Cheshire Cat" class, after John Carolan, an early C++ pioneer.  The lone private pointer to the internal data object is called "the smile", of course...

    More Advanced Example

    The example above was pretty simple, but more advanced stuff can be done with an internal class.  In particular, this class can have internal-only methods.  Here's an example of this in action...  the external class remains the same as in the examples above, so all this only affects the code module.

    _____ myclass.cpp _____
    ...
    #include "myclass.h"       // external class definition

    class   iclass  {          // internal implementation class
    public:                      // everything in iclass is accessible
            iclass(void);      // internal class can have constructor
    int     getInt(void);      // as well as other methods...

            int     myInt;
            int     counter;
            };

    iclass::iclass (void) {    // internal class constructor
            counter = 0;       // perform initialization here...
    }

    int iclass::getInt (void) {  // internal class method
            counter++;
            return (myInt);
    }

    ...
    myclass::myclass (void) {  // class constructor
            icp = new iclass;  // instantiate internal object
            ...
    }
    ...
    myclass::~myclass () {     // class destructor
            ...
            delete icp;        // destroy internal object
    }
    ...
    int myclass::getInt (void) {   // class method
            return icp->getInt();  // access internal data though methods
    }
    ...

    In this example, a constructor for the internal class has been added, as well as a method.  Because the internal class has addressability to all class data (by definition, since the class is used to encapsulate those data), there is no reason not to use internal class methods for all "local" subroutines, instead of private methods of the external class.  As with private data, this has the dual advantages of "hiding" the implementation details, since they are not in the class header, and isolating users of the class from any changes to those details.

    This organization has other benefits as well.  Suppose the class uses another class internally for implementation.  For example, say the myclass defined above instantiated a cString object.  In the standard organization, this would mean placing a #include "cString.h" in the myclass header, even though the cString object is only used internally.  This exposes any users of myclass to changes in cString!  By separating the internal data into an internal class only defined in the code module, the #include "cString.h" is only needed in the code module.  All users of myclass remain blissfully unaware that a cString is being used.  Now if cString changes only the code module for myclass would have to be recompiled, and that makes sense, because myclass uses a cString.

    There you have it - a clean solution to a troublesome problem.

    Caveat: Some readers have pointed out that there is overhead inherent in this technique.  For each object instantiation, there is another internal object instantiated, and the data required by each object is increased by the size of the private pointer plus the allocation overhead for another object (typically 16 bytes).  There are also extra calls to new and delete for each object allocation and destruction.  This is all true.  For tiny objects which are allocated and destroyed rapidly, the overhead may be unacceptable.  In most cases this overhead disappears into the noise, and the added elegance and maintainability are well worth it.

    [ Later - for more please see How to Write C++ Classes II... ]

    [ Later still - I am indebted to several readers for comments and suggestions which improved and simplified this technique, including Eric Holm, Klitos Kyriacou, and Horacio Peña.  Thanks! ]

     

     

    Sunday,  01/26/03  01:02 PM

    When I'm coding, I usually listen to music.  I either listen to MP3s, bring up Live365, or use Real Player's Radio feature.  The last week or so I've been listening to Jazz Network through Real Player.  No commercials, just a clean 132bps stream of beautiful jazz...  I just noticed Jazz Network is in Germany.  Wow.  All those little packets of sound are travelling deep under the Atlantic Ocean just to reach my ears.  The music industry is so screwed!  Why would anyone buy music?

     

    Sunday,  01/26/03  10:27 PM

    Don't know which was a worse beating, Bucs over Raiders or Kasparov over Deep Junior.  Neither was a good game, nor close.  My favorite ad was the one where Ozzie Osborne wakes up in bed with Florence Henderson, after dreaming his kids turned into the Osmonds.  Dumbest was the Bud Light upside-down drinker.  Who thought of that one?

    Joel seems to have run into Murphy's Law.  Poor guy.  Everyone out there does have current backups, right?

    FuturePundit: Cloning, Biotech, and the Future of the Family.  Very interesting!  An angle affecting the gene pool of the future I had not considered before...

    Real Networks and Major League Baseball have announced they will collaborate to webcast virtually all MLB games next season.  At $10/month only early adopters will try it, but this is an interesting trend.  For many radio has already moved to the web, maybe TV will also?  You still have the problem that the TV is in the family room, the computer is in the office...  of course 802.11g may solve that.

     

    Monday,  01/27/03  02:40 PM

    Why not switch to Linux?

    Don't you hate it when your database goes down?

    Now that Always On is back on, here's the text of Colin Powell's speech in Davos.  He makes a pretty compelling case...

    This is just a rumor, but I believe it.  Apparently Apple is working on a Word-killer.  I like Word, but there's nothing wrong with competition.  IE was "the standard", Apple releases Safari, everyone says "wow, that's cool", and poof everything changes.  (Safari has been downloaded over 1,000,000 times in the past two weeks.)

    Carl Sagan weighed in on crop circles in 1995.  Of course they are simply elaborate hoaxes.  Pretty well done, though.  For entertainment, you might enjoy these other explanations :)

    I just had a really weird experience.  My copy of What Should I Do With My Life arrived today (see this post for details.)  Naturally I eagerly scanned the table of contents to find Mike Lanza.  No names.  I turned to the back to find - no index!  I am holding this 370 page book, and the only way to find a name is a sequential scan.  I'm stuck...  It seems so strange that I can't convert this format into one that is rapidly searchable.  Bits are better than atoms! 

    [ Later: I found him.  The names have been changed!  Mike is "George", his story is "My New Start-Up".  I found it by Googling, which led me to a Commonwealth Club interview, in which Po Bronson mentions Mike and tells the story about how he referred to a girlfriend as his "new start-up".  So even with an un-indexed block of atoms, you can find what you're looking for on the web :) ]

     

    Wednesday,  01/29/03  04:39 PM

    Sorry for the radio silence.  I've been sick as a dog, and coding.  When I was in college people said if you were on drugs while studying for a test, you should use the same drugs while taking it.  Maybe this code will only make sense to sick programmers...

    There is big news in the world, of course; President Bush's State of the Union Address, the machinations of the U.S. diplomats trying to line up U.N. support for war with Iraq, and foreign posturing.  Maybe I'm too tied in to the news; every day it seems to swing one way or the other.  I still think:

    1. Saddam has WMDs and wants to make more.
    2. Saddam with WMDs is a terrible threat to world peace.
    3. Saddam will never disarm voluntarily.

    My crystal ball is cloudy, but is tough to imagine a peaceful resolution.

    So Ted Turner has left AOL, along with $99B.  The rats are leaving the sinking ship.  Of course, unlike Steve Case, who was AOL's largest shareholder prior to the acquisition, and who made out like a bandit, Turner was Time Warner's biggest shareholder prior to the deal, and lost the most.  Geoffrey Colvin wrote a great article in the latest Fortune magazine about how overvalued AOL really was.

    Several friends have pointed out How to Be a Programmer.  (The site seems to be holding up, despite being slashdotted.)  This essay starts out a little high-falutin' ("to be a good programmer is difficult and noble").  Then it rapidly gets into detail and IMHO really pins the crucial skills down.  Even stuff like "how to deal with difficult people" :)  Some of the stuff is a little thin - like "how to evaluate interviewees" - but other stuff is terrific, like "how to tell the hard from the impossible".  Anyway, it's recommended reading...

    This isn't new, but I just found it.  Tivo has preannounced a "home media option".  This will let you:

    • Use a home network to share video between muliple Tivos.
    • Play music and display photos from a PC located on the network.

    The dog that didn't bark, of course, is the ability to play movies from a PC located on the network.  Even if Tivo doesn't provide this capability, the legion of Tivo hackers will...  So that would mean you could watch a Kazaa'ed movie on your home theater.  Bad news for the MPAA, I'd say...

    On the lighter side, English pig farmers are now required by law to provide toy balls for their pigs.  I am not making this up.

     

    Thursday,  01/30/03  04:04 PM

    Last night my 5½ year old daughter Megan read Green Eggs and Ham all the way through, all by herself.  Wow.

    Still sick, and still coding.  I have rediscovered much of what I once didn't know about coding.  I already told you how to write C++ classes, but I added some rediscoveries.  Next up - constant correctness.

    Adam's site pointed me to Dave Winer writing about enclosures in RSS.  This seems like an important and under-reported capability.  It enables pre-downloading of big content, like video.  What if the de facto tool for watching movies on the 'net turns out to be Radio?

    My friend Paul Fiore recently opened a restaurant / bar / screening room called CineSpace (www.cine-space.com).  Looks cool!  Nice web site, I haven't seen the bar yet...

    Vladimir Putin and Dobby"A Russian law firm is reportedly drawing up legal action against the special effects people who dreamt up Dobby, the elf in the latest Harry Potter movie, arguing that the ugly but caring elf has been modelled on Russian president Vladimir Putin."  I am not making this up.

    Finally, the Vatican is taking online nominations to choose a patron saint of the Internet (Italian or English).  I am not making this up, either.  Hey, maybe they're catching up to the 21st century.  Now, about your position on birth control... 

     
     

    Return to the archive.

    Home
    Archive
    flight
    About Me
    W=UH
    Email
    RSS   OPML

    Greatest Hits
    Correlation vs. Causality
    The Tyranny of Email
    Unnatural Selection
    Lying
    Aperio's Mission = Automating Pathology
    On Blame
    Try, or Try Not
    Books and Wine
    Emergent Properties
    God and Beauty
    Moving Mount Fuji The Nest Rock 'n Roll
    IQ and Populations
    Are You a Bright?
    Adding Value
    Confidence
    The Joy of Craftsmanship
    The Emperor's New Code
    Toy Story
    The Return of the King
    Religion vs IQ
    In the Wet
    the big day
    solving bongard problems
    visiting Titan
    unintelligent design
    the nuclear option
    estimating in meatspace
    second gear
    On the Persistence of Bad Design...
    Texas chili cookoff
    almost famous design and stochastic debugging
    may I take your order?
    universal healthcare
    entertainment
    triple double
    New Yorker covers
    Death Rider! (da da dum)
    how did I get here (Mt.Whitney)?
    the Law of Significance
    Holiday Inn
    Daniel Jacoby's photographs
    the first bird
    Gödel Escher Bach: Birthday Cantatatata
    Father's Day (in pictures)
    your cat for my car
    Jobsnotes of note
    world population map
    no joy in Baker
    vote smart
    exact nonsense
    introducing eyesFinder
    resolved
    to space
    notebooks
    where are the desktop apps?