John Hoffmann's Weblog

All | AI | Comedy | Cool Threads | General | Java | Open Source | Robotics | Solaris 10 | Wiki
« Previous page | Main | Next page »

20050812 Friday August 12, 2005

Fair Tax Eliminating the IRS sounds good to me. There is growing momentum behind the idea of the Fair Tax. I bought and read The FairTax Book after hearing about it on the radio. I have emailed my representative in the House to pass it, bill number is HR 25. Thanks for the kick in the action pants, Skrocki! I've even asked The Donald over at Trump University what his opinion of it is!

Here are the main points of the Fair Tax:

The goal

What goes away What gets added Expected results My questions New areas for fraud (2005-08-12 13:37:12.0) Permalink Comments [8]

20050810 Wednesday August 10, 2005

Don't call it AI The last few days my colleagues and I have been wrangling with various approaches for architecting a provisioning solution. We need to integrate an entitlements system with Sun's Portal Server. The entitlements system will store user/asset mappings while the portal stores user/role mappings. The disparity is that not all entitlements map to a role. An obvious approach is to create a simple webapp for business users to manage those mappings and expose a webservice for the entitlement and portal systems to interact with.

However, considering that I have experienced 8 years of interesting and ever evolving marketing requirements, I wonder if this might not be the perfect opportunity to implement a rule engine. This would give the business the flexibility of developing more complex logic to derive roles from an assortment of entitlements. It would also put the power to change the rules in their hands. The idea behind rule engines is that the business logic can be coded by non-programmers in simple syntaxes - or even GUI abstractions - like drag and drop flow charts. These new rules can be added to the system on the fly like any other data. Essentially the rule engines allow the logic of a system to be changed just as easily as all systems allow the data to be changed.

Looking at rules engines and the Java Rule Engine API, JSR 94, led me to a neat interview with the inventor of Jess (Java Expert System Shell), Dr. Ernest J. Friedman-Hill. I was particularly entertained by this exchange regarding the perception of AI in the job marketplace (emphasis added):

JM: I'm concerned that AI/expert systems experience is still too esoteric for most employers of Java programmers to value as a skill. Am I wrong? How does a Jess developer market him/herself?
EJF: You're right to say that AI experience isn't going to impress many potential employers. But I just did a search at monster.com for business rules and found 1,200 job listings. Like anything else, it's all in the marketing. The cardinal rule of defining AI [is] if it works, it's not AI anymore - €”it's just programming.
(2005-08-10 07:17:44.0) Permalink Comments [1]

20050728 Thursday July 28, 2005

Running in Austin Today marks my third morning jog this week. Looks like I managed about 4 miles this morning. I have been a treadmill runner for many years, but having none at my disposal has forced me back to nature. I am really enjoying it so far. I waive to lots of walkers and joggers and send cotten tail bunnies hopping for cover. I'm worried about my leg muscles and joints though. I alreay experience some popping between my right calf and ankle after I've cooled down. I guess I'll have to do more than 15 seconds of stretching at 35 years old. We had several inches of rain last night from significant thunderstorms, so the resididual wetness left a terrific fresh smell in the air and a nice cloud cover to keep the sun at bay. A great start for the day. (2005-07-28 07:09:32.0) Permalink Comments [0]

20050720 Wednesday July 20, 2005

Outsmarting myself Earlier today I was adding 2 additional languages to a localization utility I had written several months ago:
# !/bin/csh
#
## Invoke this script from the english branch in the directory
## of the file(s) that need to be copied to all the locales
##
## use -n switch to echo commands instead of executing them
##
## Example: where pwd is
## /web/www.java.com/en/renderers
##
## /web/tools/cp_l10n.csh -n javacom-rate-this-page.jsp javacom-rb.jsp
##
## output for dry run should be:
## /bin/cp javacom-rate-this-page.jsp /web/www.java.com/de/renderers/javacom-rate-this-page.jsp
## /bin/cp javacom-rb.jsp /web/www.java.com/de/renderers/javacom-rb.jsp
## /bin/cp javacom-rate-this-page.jsp /web/www.java.com/es/renderers/javacom-rate-this-page.jsp
## /bin/cp javacom-rb.jsp /web/www.java.com/es/renderers/javacom-rb.jsp
##
set dry_run=
if ( $#argv > 0 ) then
  if ($argv[1] == "-n") then
    set dry_run=echo
    shift
  endif
  foreach lang (de es fr it ja ko nl pt_BR sv zh_CN zh_TW)
    foreach file (${argv[*]})
      set destination_dir = `pwd | sed 's-/en/-/${lang}/-'`
      eval ${dry_run} /bin/cp ${file} ${destination_dir}/${file}
    end
  end
else
  cat $0 | grep "^##"
endif
While I was in there, the sed command attracted my attention - probably because its the only fun part of part of the script - well the eval of the dry run variable and the grep through $0 for lazy usage message are kinda neat too, but back to the story. I thought, "Gee John, you were really playing fast and loose with your regex. Replacing any occurance of 'en' is crazy. We need '/en/' to be safe to match only the english directory name. So I hastily changed the sed line to:
sed 's-/\/en\//-/\/${lang}\//-g'
Thinking, "Great, now it will only match the exact string '/en/'". Note: '\/en\/' being the escaped form of the pattern - since as everyone knows sed uses '/' as its delimiter...

You all laughing yet?!

Yeah, you seasoned regex guys, and I'm one of you - just having one of those days - you're seeing that when I had originally authored the sed command I chose '-' as the delimiter since '/' was going to be heavily used in the pattern. So now sed was looking for literally this mess: '/\/en\//'. Naturally it found no such patterns in the list of files and the script accomplished nothing.

I've had some half-baked idea that future coding in IDEs might free us from regular expression escaping problems and all syntax for that matter. I envision some visual clue that sets off a regular expression from the surrounding code such that no escaping is needed since the expression is expressed in non-ascii characters. I'll get back to that idea some day, or help me out here - anyone else thought about this?

Not sure if there is any lesson to be learned. The good thing is I used the dry run switch when I invoked the script and therefore had a chance to see that the pattern did not work and the script, if it were not in dry run, would have simply copied the same english file onto itself 11 times. I'm frequently surprised by how often the code I have authored looks foreign to me. Could be related to the fact that I continuously switch between perl, csh, sh, ksh, java, jsp, and jstl. Hard to believe, 50 years into the history of software programming, a single programmer is regularly using 7 or more different syntaxes for "if then else if" branching.

perlif ( ) { } elsif ( ) { }
cshif ( ) then else if ( ) then
shif [ ] then elif [ ] then fi
kshif [ ]; then elif [ ]; then fi
javaif ( ) { } else if ( ) { }
jsp<% if ( ) {%> <%} else if ( ) {%> <%}%>
and my personal favorite, not!
jstl<c:choose><c:when test='${}'></c:when><c:otherwise></c:otherwise></c:choose>

I've annotated another copy of the script, in the event anyone can learn from it:

# !/bin/csh
#
## Invoke this script from the english branch in the directory
## of the file(s) that need to be copied to all the locales
##
## use -n switch to echo commands instead of executing them
##
## Example: where pwd is
## /web/www.java.com/en/renderers
##
## /web/tools/cp_l10n.csh -n javacom-rate-this-page.jsp javacom-rb.jsp
##
## output for dry run should be:
## /bin/cp javacom-rate-this-page.jsp /web/www.java.com/de/renderers/javacom-rate-this-page.jsp
## /bin/cp javacom-rb.jsp /web/www.java.com/de/renderers/javacom-rb.jsp
## /bin/cp javacom-rate-this-page.jsp /web/www.java.com/es/renderers/javacom-rate-this-page.jsp
## /bin/cp javacom-rb.jsp /web/www.java.com/es/renderers/javacom-rb.jsp
##
# be default the dry_run variable is set to nothing
set dry_run=
# check to see if we have more than 0 arguments
if ( $#argv > 0 ) then
  # check to see if the dry run flag is the first argument
  if ($argv[1] == "-n") then
    # if it is set its value to the command "echo"
    set dry_run=echo
    # remove -n from the argument list
    shift
  endif
  # Loop through the set of languages
  foreach lang (de es fr it ja ko nl pt_BR sv zh_CN zh_TW)
    # Inner loop through the remaining arguments which should be file
    # names in the current directory
    foreach file (${argv[*]})
      # create a variable that substitutes the enlgish directory name
      # for the directory name of the language in the outer loop
      # use the back tick to cause the pwd (present working directory)
      # comand to be run and
      # pipe the pwd output into sed which does the language
      # search and replace, the resultant value is stored in
      # the variable destination_dir
      set destination_dir = `pwd | sed 's-/en/-/${lang}/-'`
      # use the eval command to execute the value of the dry_run varaible
      # if dry_run was empty, then /bin/cp gets executed
      # otherwise the echo command gets executed and /bin/cp
      # is simply printed to standard out as text
      eval ${dry_run} /bin/cp ${file} ${destination_dir}/${file}
    end
  end
# if we had less than 1 argument, cat the file and use grep to 
# show only the lines marked as usage instructions designated by ##
# $0 a predefined shell variable set to the path of the script 
else
  cat $0 | grep "^##"
endif

Note, my professor of "Unix Shell Programming" would be very dissappointed that I have repeatedly referred to this utility as a script. He encouraged all his students to call them programs so that Unix administrators who wrote in shell would command the same salaries as programmers. They are slightly different skills, but I'm not sure I place a higher value on one over the other. Shell programming provides more instant gratification in that it usually provides very quick returns on time invested. It also often has higher risk in that you can easily create run away programs that do very bad things if they fail to check for arguments or validate accuracy of constructed paths. Something to watch out for is hooking up a script as a root cronjob. Make sure you test that script in a pure root environment before setting it loose. The ENV for root is often different than what you experience su'd to root. Use the su - , to make sure you're not bringing along any ENV baggage that cronjob root won't have. Whenever possible I also like to adjust the time the cronjob is set to run so that I can watch the results while I am at work, since it is often the case that you set your crons to run at night and its never fun to be greeted first thing the next morning, or the 1st of the month with an unwelcome surprise. (2005-07-20 12:19:18.0) Permalink Comments [3]

20050714 Thursday July 14, 2005

Ergo breaks in Austin On two of my first four days at work in the Austin campus, I have sauntered out to the pond behind building 9. On my return visit this afternoon, I was determined to identify the creatures jumping from the reeds into the pond as I made my way around the perimeter. On my first walk, I saw only fish and dragonflies and heard the kerplop of the skittish mystery creatures. Today, the pond greeted me with a colorfully striped snake about 2 feet long swimming across the surface. Next, I spotted a brown toad swimming away from the shore without a kerplop. Continuing around, I heard several more entries into the pond, but only saw the disturbance in the mossy waters. At the end of circling the pond, there floated upsidedown a mostly eaten 18 inch fish. It had a large mouth and no whiskers, so I'm guessing a bass. Next to the carcass, I spotted a small turtle's head with red stripes. That was more consistent with the amount of rustling and noise I had heard. I am fairly confident it is turtles, not the toads that I am scaring into the water. It is too hot for the toads to stay out of the water and we all know how turtles are sun worshippers. Now a new mystery needs solving, what predator took the life of the fish before the scavengers got to him? We've seen large herons in the area, but I think that fish was too big for them and I beleive they swallow prey whole. If anyone in the Austin area knows the local wildlife, I'd love to hear from ya. I'll bring my Pentax *ist D tomorrow so I can share the experience. (2005-07-14 11:12:15.0) Permalink Comments [2]

20050620 Monday June 20, 2005

Hasta La Vista Kali-four-nia This is my last week as a resident of California. I used the phonetic pronunciation above so you can read it like our Governator would say it. I hope he can turn the State around. California has been great to me and my family, but changing economics and telecommunications advances have culminated in a decision to relocated to Texas. At their same stage of life, my parents migrated our family from Florida to the "Golden State" in 1977. My father found double the salary and double the house price, but net-net it was a great move - and the weather.... Now, however the economics are not so good; perhaps it is still double the pay, but the house prices are quadruple or worse. We are forging our own path in the good old American tradition and starting anew in Austin. The hope is to settle into a neighborhood the kids can enjoy during all their growing up years just like I had in California. We have lost three quarters of our close friends and family in the last 5 years since the dot-com bubble burst. So we are hoping Austinites are less mobile folk. We already know they are a freindly lot. On all three of our trips there thus far, they have been extraordinarily welcoming of our intent to immigrate. We already know more about our future neighbors from a few conversations on our barren lot than we know about our current neighbors. Of course there is the weather.... I'll be blogging after the move and share my thoughts after the honeymoon wears off.

Leaving my buddies at Sun is the biggest downside to the move. An engineering team that I used to manage took me out to "Joy Luck" Dim Sum in Cupertino so I could enjoy chicken feet and jelly fish one last time before setting off to the land of barbequed red meat - which I have nothing against mind you.
Left to right: Brian "Yukfai" Lam, Tiep Vo, Matthew Montgomery, John "Hoffie" Hoffmann, Richard "Tony/Frosty" Welch, Mike Matsui and Venky "Venkman" Kumar.
Photo taken by our former colleague and longtime friend Gwynn
(2005-06-20 10:10:10.0) Permalink Comments [0]

20050617 Friday June 17, 2005

DTrace for Java The benefits of DTrace have been extended to help Java programmers. So any Java developers going to JavaOne ought to take their code along on a CD or USB drive and you can have it observed!
Take the Solaris 10 DTrace Challenge at JavaOne
Get a performance improvement on your Java application while you wait -- or you can win an iPod!

Good fun. I'd love to drop in and observe the observing, if I were in town, but more about that later... (2005-06-17 15:55:29.0) Permalink Comments [0]

20050606 Monday June 06, 2005

Kraftwerk's "Home Computer" - a redux I started cleaning out my office this morning in preparation for my relocation to Austin. Among the mess, I found some lyrics I wrote several years ago to the tune of Kraftwerk's "Home Computer". The original song starts out...
I program my home computer, 
beam myself into the future.
The hoffie redux...
I program my Ultra 60
Java on Solaris computes swiftly

Orient my objects in elegant hierachy
cronjobs orchestrate the desired chronlogy

Threads abound in the process
signals and interupts spin the mutex

Far removed from gates etched in silicon
I extend stubs and create singleton

Garbage collection is a Godsend
pointer arithmetic, a byegone trend

The JVM shields my UltraSparc
crashless computing hits the mark

Users appreciate the app's availability
System admins embrace the stability

Ant for build, tomcat for container
open source has become a no-brainer

Solaris stands as the king 
of symmetric multi-processing

Will the maturation of Linux end its reign?

Against legions of developers kernel hacking, 
Sun must change if it desires to remain

"Software wants to be free"
Java Business Expo 1999, Scott McNealy
Back in 2002, I had left the lyrics open-ended and unpublished, but today there are more answers than questions and I have this blog as a medium. Sun has answered the marketplace on several fronts. Solaris 10 has been open sourced and the Scalable Systems Group has doubled down on its SMP strength by funneling in-house chip development to Niagara. Those systems are supposed to rock, to the tune of 15 times today's performance. That will truely be music to many people's ears. (2005-06-06 12:52:55.0) Permalink Comments [0]

20050524 Tuesday May 24, 2005

Ransomware precursor to PC "protection" racket? You've probably heard the news about the latest type of virus called ransomware. Hackers lock all your files and demand a payment to give you the key to unlock them. When you are doing "business" with unscrupulous people, you have to wonder how long it will be before they lock up your files again and demand more payment. This harkens back to the mob days when you had to pay "protection" in regular installments in order to not be attacked by the gangs. Too bad in the PC world I don't think entrepreneurial mobsters with skilz are going to be able to gurantee your protection from other hackers. The good news is I do know a trustworthy vendor who can offer real protection from all on-line threats; Sun of course. Sun offers the Java Desktop System for $100 per desktop per year. Looks like the promotional price of $50 is still in effect. That is a phenominal value for a great OS and complete peace of mind. (2005-05-24 08:57:21.0) Permalink Comments [0]

20050428 Thursday April 28, 2005

Truss and the Matrix Hokey as it may sound, I find that I am more focused when scanning truss output if I'm listening to Matrix Reloaded's instrumental tracks. Surely it has more to do with the fast paced rhythm than any supernatural ability to be one with machine code, but the parallels are there to be drawn.

Neo sees Agent Smith laying a trap

Hoffie sees a missing class file
That output is from running truss on the process ID of the webserver demon; webservd. # truss -p 25150
And of course a little editing in The GIMP which came packaged with my Java Desktop System.

The debugging above is from my current project to install Sun's Java Enterprise System stack to provide a Portal infrastructure. We're deploying it on a Solaris 10 whole root zone that was created from a minimized install intended to be internet facing. This will be the first use of zones in my group's internet presence. For this test deployment we are using using two smokin' fast v40z's.

I'm jacking back in, uh, I mean turn up the volume. (2005-04-28 10:56:04.0) Permalink Comments [2]

20050427 Wednesday April 27, 2005

Humanizing Sun Yesterday, the blogs team was officially recognized by Scott McNealy and rest of the executive leadership team as one of 15 recipients of Chairman's awards. The title of our award was "blogs.sun.com: Humanizing Sun, Changing Perceptions and Re-Enlisting Champions".

Back row, left to right: Me, Dave Johnson, Simon Phipps, Will Snow, Tim Bray

Pat, we missed you. (2005-04-27 08:58:42.0) Permalink Comments [10]

20050329 Tuesday March 29, 2005

Oath of allegiance I attended the swearing in ceremony for 1400 new United States citizens this morning two of whom were Brits that have been family friends for 6 years. 100 countries were represented by the individuals taking an oath of loyalty to the United States of America. It was a truly powerful event for my wife and I (all five kids were present as well, but being aged 8 to 8 months, they probably weren't equally moved). Sure we salute the flag and say the pledge of allegiance on a weekly basis at Awana club meetings, but the oath of allegiance conveys the responsibility of citizenry in addition to the ideals of our society communicated in the pledge of allegiance:

"I hereby declare, on oath, that I absolutely and entirely renounce and abjure all allegiance and fidelity to any foreign prince, potentate, state, or sovereignty of whom or which I have heretofore been a subject or citizen; that I will support and defend the Constitution and laws of the United States of America against all enemies, foreign and domestic; that I will bear true faith and allegiance to the same; that I will bear arms on behalf of the United States when required by the law; that I will perform noncombatant service in the Armed Forces of the United States when required by the law; that I will perform work of national importance under civilian direction when required by the law; and that I take this obligation freely without any mental reservation or purpose of evasion; so help me God."

As people born into citizenship, we have taken much for granted and might consider a military draft an incovenience. I remember feeling impetulant about registering with the Selective Service when I turned 18. Immigrants are faced directly with the bi-directional nature of American citizenship. My wife expressed concern over how many new citizens there were. My response was that these legal immigrants are the ideal people with which to swell the ranks of America; hard working, law abiding and hopefully sincere in their oaths. (2005-03-29 15:28:26.0) Permalink Comments [3]

20041215 Wednesday December 15, 2004

Chomp Sticks As the family was eating Chinese food over the weekend, my 4 year old son Ian asked, "Why did people make chomp sticks?" Having a keen interest in cognition and linguistics and artificial intelligence, I latched on to the mis-pronunciation of "chop stick" as "chomp stick". Chomp is a synonym for bite, so I presume Ian's mind has categorized chop sticks as biting sticks. Makes tremendous sense to me, you certainly don't use chop sticks to chop your food! I documented some other great "mistakes" in language learning that my children have come up with, namely rainbrella and smooshmellow. Much of the knowledge we have is built up one tiny layer upon another "in terms of" the smaller things we already know.

While not a believer in hard AI, I'd like to see progress toward it. The only way I can envision that progress is to model it after my children. It seems imperative for computers to start to build up their own knowledge "in terms of" everything else they know. This implies these systems will have to learn and that every system would end up creating a different corpus of knowledge than every other one. It will depend on what it has been exposed to and in what order. Given the widepsread adoption of systems like these, there will become a new profession; teaching computers! It will be the responsibility of the teacher to expose the system to new material and check the conclusions it draws. I would postulate that only if the machine is capable of making mistakes in its learning, will it be capable of creating new insights. When we learn, we are bombarded with words we don't yet understand and ideas that make no sense. Somehow our fantastic brains store much of that ambiguity in the background and future experiences and learning gradually shape the noise into clear ideas.

I read and write code every day. The vast majority of it is mechanical in nature and like machines it can only cope with the specific circumstances for which it was designed. Unfortunately the circumstances for which it is designed are limited by both budget and time constraints and the imagination and experience of the programmer. My great hope is that I will be part of a software revolution that will be building systems that learn and improve with experience rather than die of software rot akin to the rusted fate of their mechanical couterparts. (2004-12-15 10:04:48.0) Permalink Comments [2]

20041014 Thursday October 14, 2004

Open Source/Software Patent Affinity As a software engineer, I have struggled over the years to understand the net impact of software patents. I have wondered what types of conversations occur at small software companies developing new product. Do the engineers expend much effort checking to see if any components infringe? Does the company management or their investors calculate the potential impact of requests for royalty payments by patent holders? A quick search reveals that the risk has not only been recognized but quantified: software patent infringement insurance does exist.

One might guess these issues are having some degree of a cooling effect on the industry; the opposite effect from the intention of the patent system which was designed to encourage innovation, sharing and profit for all. My concerns were recently inflamed by reading a ten year old paper, Software Patents: An Industry at Risk, and by following the news around Sun's righteous though expensive indemnification of Java.

Today however, I just read Tim Bray's Patent Theory essay which has helped clarify my thinking. I agree with him. His idea about the best use of the software patent system and his suggestion that an open source implementation be required to get a patent, parallels exactly my experience at Sun as an inventor and patent holder.

When I innovated a better user experience for web page and database interaction for JavaOne attendees to create their personal schedules, I was encouraged to file a patent. As soon as the filing was completed, some five years ago, I open sourced all the code and posted a demonstration showing how to implement it. Sun protected the invention from being patented by anyone else. The company's intention was to make the technology available to anyone without fear that it would ever be used against them. The patent, 6,728,769, was granted just this April.

I had been feeling guilty about being part of a system that I wasn't sure I believed in. Not anymore. I am confident that Sun has done the right thing with my innovation. Just as they have done with Java itself, they made my tiny contribution available to programmers the world over and protected them from ever worrying that using it may come back to haunt them.

I am proud to work for a company that innovates, shares with the community and does what it can to protect that community within a system that is not perfect. In an ethical world, power must always be tempered by responsibility. From my vantage point, Sun does an admirable job wielding its power responsibly. (2004-10-14 13:12:16.0) Permalink

20040928 Tuesday September 28, 2004

Wiki Rising Wikis and blogs seem to have started gaining traction around the same time in the technology circles, but until now blogs have garnered all the media attention. Yesterday a mainstream article about wikis appeared and it was great to see Sun's very own John "jbob" Bobowicz quoted in the article. The two technologies are complimentary and I think equally profound. They both empower everyone with an internet connection to publish to the world wide web. Blogs focus on building reputation and trust around individual personalities. Wikis focus on the collaborative building of knowledge by the community. Both technologies smash the barriers to publishing and thanks to Google's apparent preference for both mediums, the content published by these technologies is likely to be read!

I'll never forget my first exposure to wiki when Matthew and I logged into wiki inventor, Ward Cunningham's, wiki.org. We had no clue about wiki's relying on CamelCase to create hyperlinks, so we thought, "Gee, while we're here let's contribute and fix all these smashed up words." Now I rely on wikis everyday. A couple weeks ago I was inspired by an email Tim Bray sent around at work to make my first, albeit plain, contribution to the wikipedia. I had recently come across a word that was not defined online. I am subscribed to a discussion group on Abrassive Water Jet technology after seeing the tool in action on an episode of Orange County Choppers. In that forum someone tossed around the word autofrettage. A google search did not lead to a definition of the word, so I supplied the definition to wikipedia after gleening what I could about the term from various references to it. Hopefully someone from the metallurgy field will come along and improve the entry.

I am thrilled to both benefit from and participate in the sharing of the world's knowledge. (2004-09-28 07:45:45.0) Permalink