Friday August 12, 2005 Here are the main points of the Fair Tax:
The goal
Wednesday August 10, 2005 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]
Thursday July 28, 2005
Wednesday July 20, 2005
# !/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.
| perl | if ( ) { } elsif ( ) { } |
| csh | if ( ) then else if ( ) then |
| sh | if [ ] then elif [ ] then fi |
| ksh | if [ ]; then elif [ ]; then fi |
| java | if ( ) { } 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]
Thursday July 14, 2005
Monday June 20, 2005
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]
Friday June 17, 2005
|
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]
Monday June 06, 2005 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 McNealyBack 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]
Tuesday May 24, 2005
Thursday April 28, 2005
![]() 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 25150And 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]
Wednesday April 27, 2005 
Pat, we missed you. (2005-04-27 08:58:42.0)
Permalink
Comments [10]
Tuesday March 29, 2005
"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]
Wednesday December 15, 2004 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]
Thursday October 14, 2004 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
Tuesday September 28, 2004 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