[ no comments ]
It's been five days since I've last been able to post to my blog. Things wouldn't be so bad, but my hosting company has restored an old copy and not given me access to it. Of course to make matters even worse my old co-worker Ned linked to my blog this week. Now everyone who reads his blog and follows the link is going to think I'm a blog zombie or worse. Then on top of this all, just this afternoon I received an email from a avid reader/friend who was lamenting my lack of postings. It's truly painful to be this isolated.
[ no comments ]
[ no comments ]
This theory is being applied to explain processes not only on Earth but on Mars as well. Recent measurements of the Martian atmosphere indicate a level of Methane present that cannot be explained by simple Martian volcanic activity. Some scientists are suggesting that microbial life deep underground on Mars is the source of this gas.
I want these theories to be true. Not just because knowing there's life on Mars would be cool, or that thinking about this new biosphere living in dark fissures of the earth feeding on methane and or oil is kind of bizarre. I like the experience of the fundamental brain quake associated with paradigm shifts. News like this is like crack for nerds.
[ no comments ]
[ no comments ]
Going forward I would like to finish the Java scripting library I started a while back. I will probably roll the verbose regular expression parser I talked about recently into it. I think both are cool little ideas and worthy of some level of completion. I don’t envision either of those tasks being significant.
Once those are completed, that leaves me without a hobby project to hack away at. I’ve thought about trying to get into doing some open source work but my free time is very scattered. I think most active open source projects move too fast for someone with my limited availability.
I will need to ponder this and come up with something new and fun to work on while I complete the scripting library.
[ no comments ]
[ no comments ]
Lucas: Ultimately, I'm going to probably move it into television and let other people take it. I'm sort of preserving the feature film part for what has happened and never go there again, but I can go off into various offshoots and things. You know, I've got offshoot novels, I've got offshoot comics. So it's very easy to say, "Well, OK, that's that genre, and I'll find a really talented person to take it and create it." Just like the comic books and the novels are somebody else's way of doing it. I don't mind that. Some of it might turn out to be pretty good. If I get the right people involved, it could be interesting.
I hope some young Frank Miller type gets a hold of the genre and turns it back onto a darker path.
[ no comments ]
While skimming the companies technology overview document I was struck by the similarity between one of their breakthrough optimizations and what the Sun HotSpot JVM attempts to do for Java.
The optimizing kernel reads the intermediate representation and optimizes the code. At first, simple optimizations are performed. In most applications, however, a 90/10 rules holds where 10% of the code is executed 90% of the time. The optimizing kernel looks for blocks of code that are executed often, spends increasing amounts of time improving the optimization of this code, and then stores this optimized code in memory. Each time a frequently used block of code needs to be executed, the highly optimized code stored in memory is used instead of optimizing that block of code again. Because the blocks of code that are executed change frequently, the optimizing kernel flushes old optimized blocks and generates new ones. The optimizing kernel produces superior code optimization compared to static binary translators or compilers. It optimizes code based on how an individual user is using that application and does not need to optimize code for the general case.
[ no comments ]
"The harder a bug is to track down, the simpler the fix tends to be."
I don't agree this is a law at all. Mr. Tauber doesn't even seem too sure. The word 'tends' leaves too much wiggle room for a law. But the observation is not without merit. However, I'd say this is a rule of perception not reality. Most bugs are easy to fix once you know what the problem is. Bugs that are super hard to find just seem easier in relation to the task of finding them.
What really got me thinking about this however was the feeling that I haven't really had to chase a super hard bug since I started working in Java. Sure I've been confused by some class loading issues and hit a few JVM problems that were a pain but these pale in comparison to the stray pointer issues in C you would encounter, especially before protected memory and NuMega's Soft-Ice came on the scene.
[ no comments ]
Of Love and Other Demons is the story of a girl who is accused of being possessed by demons. The story takes place in an unnamed Latin American port city in the time of slave trade and Spanish colonialism. As the story unfolds the girl is imprisoned in a convent to await her exorcism. There she encounters a young scholarly priest and an illicit and tragic love affair follows.
What really makes this book isn't the story, however, it's Gabriel García Márquez's writing. Even though it's translated from Spanish the sentences are alive and full of color. I can only imagine how good it must be in it's orginal form.
[ no comments ]
[ no comments ]
[ no comments ]
[ 2 comments ]
I just stumbled across the political parody site: Rowboat Veterans for Truth.. It's not especially clever. I'm blogging about it because the real Rowboat Veterans where actually from my home town of Marblehead MA.The men who rowed Washington across the Delaware and also away from Long Island were Marblehead fishermen from then Col. John Glover's Massachusetts Regiment. Glover later became a General. Just as important but less well known Glover assembled the first ships for a deep water force for use by Gen Washington from Marblehead and surrounding towns. Although not nationaly recognized Marbleheaders still claim their home is the birthplace of the US Navy.
If you ever visit Marblehead, visit Abbot Hall in the old section of town. Hanging in the hall is the original Spirit of 76 by Archibald Willard. It's a very impressive both in historical significance and scale - it's pretty darn big.
Finally, while looking for some historical information about Glover and the Marblehead fishermen I found an online copy of The History and Traditions of Marblehead by Samuel Roads Jr. – 1880. I doubt I'll ever read it but it's an interesting piece of history.
[ no comments ]
Man on Fire isn't a perfect film; I can see why some reviewers complain about the second half dipping a bit too deeply into cliché, and the editing being a bit choppy, but beyond that it's very, very good.
Denzel does a great job bringing life to a flawed and troubled character. I think his Creasy character is the perfect post 9/11 anti-hero. His brutal revenge has a clarity that eschews any moral ambiguity about killing those who have wronged him. It's a complex and powerful performance.
In the final analysis I give the movie only a B+, but a D- is just crazy.
[ 4 comments ]
[ no comments ]
I think a better mechanism is to use the class loader's getResourceAsStream("filename") call to load a file containing the pre formatted text. My only concern with this approach is there's no standard way of dividing multiple multi-line strings in a single text document. I'd rather not have one file per block of text.
So there's no standard solution, but there are examples in the SDK of Java solving the same problem. The policy documents under the jre/lib/security directory use a simple curly brace delimited syntax for encompassing multiple lines.
grant codeBase "file:${java.home}/lib/ext/*" {
permission java.security.AllPermission;
....
};
Simply using curly braces isn't a good choice for a generic solution though because the text being wrapped may well contain curlies and you would need to start escaping the content; and that's pretty much what this exercise is trying to avoid.For my proposed solution I turn back to the syntax of the fore mentioned here-documents as the best generic solution to this problem.
NAME=END-BLOCK-TOKEN random content END-BLOCK-TOKENThe benefit of this approach include the following :
1.) The contained blocks of text would be accessible in a manner consistent with regular property files.
String s = BlockProperties.get("NAME");
2.) The syntax is close to that of a standard property file.
3.) Content would not need escaping.
4.) Super simple to parse.
[ 1 comment ]
Instead of writing:
static String test =
"This is line 1\r\n"+
"This is line 2\r\n" +
"This is line 3\r\n" +
"This is line 4\r\n";
You get to write:
static String test = <<<END_OF_BLOCK This is line 1 This is line 2 This is line 3 This is line 4 END_OF_BLOCK
This is a great little feature for embedding little languages like HTML, XML or the alternate regular expression syntax I've been talking about within another language.
There's a JSE for the feature on Sun's Java developer site. Please vote for it if you agree it's a good idea.
[ no comments ]
Standard Regex:
^(([^<>()[\]\\.,;:@"]+(\.[^<>()[\]\\.,;:@"]+)*)|(".+"))
Verbose Regex:
define restricted ('<>()[]\\.,;:@"')
anchor begin
group(
group(
oneOrMore(notAny(restricted)) +
zeroOrMore('.' + oneOrMore(notAny(restricted))
)
)
or group('"' + oneOrMore(any) + '"')
)
Standard Regex:
^[a-zA-Z0-9](([_\.\-]?[a-zA-Z0-9]+)*)@([a-zA-Z0-9]+)
(([\.\-]?[a-zA-Z0-9]+)*)\.([a-zA-Z]{2,})$
Verbose Regex:
define ALPHANUM (range('a','z','A','Z','0','9'))
define ALPHA (range('a','z','A','Z'))
anchor begin
ALPHANUM +
group(zeroOrMore(zeroOrOne('_.-') + oneOrMore(ALPHANUM)))
+ '@' +
group(oneOrMore(ALPHANUM)) +
group(zeroOrMore(zeroOrOne(any('.-')) + oneOrMore(ALPHANUM))) +
'.' +
group(repeat(ALPHA,2, ))
end anchor
The expression (Standard and Verbose) in each box are identical. The result of running the verbose syntax parser is the standard expression.I haven’t added the named groups feature I talked about yet. I wanted to get the basic parser done first. I also need to expand my set of unit tests and flush out the capabilities. I’ve seen certain expressions that I cannot even read so it’s quite difficult to know how to parse them. If nothing else this project is honing my regular expression skills.
[ no comments ]
[ no comments ]
I agree that there are better ways to write a complex regular expression, like the mail address parsing example, using common language features; simply breaking a complex expression like this into named blocks would go a long way to improving its understandability. However, my issues with regular expression go deeper than what can be done with simple syntax substitution.
Take for example the current regular expression's use of the simple parentheses. In regular expression parentheses serve a dual purpose: they act both as scope boundries for operators like the quantifiers "?", "+", "*" and "{x}".
Quantified Expression: "^([a-f][0-9]-){3}[a-f][0-9]$"
Matches: "a8-b2-c3-f6"
Doesn't match: "a9-b3-c8-x8"
And as group delimeters to capture subsets of the matched string for back references or for extraction by the caller.
Sub Expression: "^([a-f][0-9]-([a-f][0-9])-([a-f][0-9])-([a-f][0-9])$"
Matches: "a8-b2-c3-f6"
Group 1: "a8"
Group 2: " b2"
Group 3: " c3"
Group 4: " f6"
Back Reference Expression: "^(.{4})-\1$"
Matches: "aaaa-aaaa"
Group 1: "aaaa"
If you have a complex expression with a lot of parenthesis you either have to count them very carefully to determine the correct group number or else you have to do some experimentation to determine what number matches which group. If the expression ever changes or you need to add or subtract parenthesis the back references and the code that uses the expression will break.
A first step to fixing this would be named groups. Rather than having to use group numbers you would be able to address the group by name. Here's a short example of what I mean that recreates the examples above using the basic syntax I created in my previous post.
# Equivalent to "^([a-f][0-9]-([a-f][0-9])-([a-f][0-9])-([a-f][0-9])$"
DEF ID_PART (RANGE(a-f),RANGE([0-9))
ANCHOR BEGIN
GROUP("REGION_CODE", ID_PART),
'-',
GROUP("STATE_CODE", ID_PART),
'-',
GROUP("TOWN_CODE", ID_PART),
'-',
GROUP("STREET_CODE", ID_PART)
END ANCHOR
# Equivalent to "^(.{4})-\1$"
ANCHOR BEGIN
GROUP("START_PART", (FOUR_OF ANY)),
-',
USE_GROUP("START_PART")
END ANCHOR
Named groups as I described them above wouldn't fix one class of problem however. But it's a problem standard regular expressions have too. You can't use quantifier blocks and groups simultaneously. Examine this expression:
Quantified Expression: "^(([a-f][0-9])-){3}([a-f][0-9])$"
The block "(([a-f][0-9])-)" must repeat three times. This block however contain the parenthetic group "([a-f][0-9])". It seems like you should you be able to access each group of the repeating block. But you can't. Given the input, the actual results are:
Grouped quantified expression: "^(([a-f][0-9])-){3}([a-f][0-9])$"
Matches: "a8-b2-c3-f6"
Group 1: "c3"
Group 2: "c3-"
Group 3: "f6"
[ no comments ]
1. If you’re going to have two classes called Tokenizers (StringTokenizer, StreamTokenizer) it would be nice if they had the same semantics. Besides the fact they both break up a sequence of characters into tokens these classes have nothing in common.
2. In Java 1.1 when they introduced all the Reader IO classes why didn't they make a ReaderTokenizer instead of adding a Reader constructor to StreamReader and deprecating the InputStream constructor. They added BufferedReader, FilterReader, etc to replace BufferedInputStream and FilterInputStream, why stop there.
3. The operation of StreamTokenizer is not well documented. In order to use the class you really need to understand it's implementation model.
I've never seen the code but from playing with the API it appears the class keeps an array in the background that mirrors the character set. Each slot in that array has attributes that describe its corresponding character. The attributes determine whether the character is whitespace, a word character, string delimeter, etc... The class then provides you with a bunch of methods that let you change the attributes in the slots.
However, if you don't understand the underlying model I just described the methods like the following are hard to understand:
public void wordChar(int low, int hi) Specifies that all characters c in the range low <= c <= high are word constituents. A word token consists of a word constituent followed by zero or more word constituents or number constituents.There's nothing in the doc or the method signature that lets you know you can call this repeatedly to set different ranges of characters as word characters.
4. The Javadoc for StringTokenizer calls it a 'legacy class' and recommends people use String.split(String regex) instead. This advice is fine for certain uses of StringTokenizer but for others a more appropriate statements would be to use: StreamTokenizer() with a StringReader().
[ no comments ]
^(([^<>;()[\]\\.,;:@"]+(\.[^<>()[\]\\.,;:@"]+)*)|(".+"))@(((
[a-z]([-a-z0-9]*[a-z0-9])?)|(#[0-9]+)|(\[((([01]?[0-9]{0,2})
|(2(([0-4][0-9])|(5[0-5]))))\.){3}(([01]?[0-9]{0,2})|(2(([0-
4][0-9])|(5[0-5]))))\]))\.)*(([a-z]([-a-z0-9]*[a-z0-9])?)|(#
[0-9]+)|(\[((([01]?[0-9]{0,2})|(2(([0-4][0-9])|(5[0-5]))))\.
){3}(([01]?[0-9]{0,2})|(2(([0-4][0-9])|(5[0-5]))))\]))$
Please, there's got to be a better way. I know Python supports verbose regexs, but even that's not much of an improvment. Why isn't there a higher level regular expression language? If such a thing exists I couldn't find it doing some basic Google searches.
What I would like to see is a language that's more verbose, less cryptic and supports block reuse. I've invented a little syntax below that I think is easier to read and I've attempted to translate the above expression. I think it's a lot easier to read.
DEF SEQUENCE INNER_IP (
(
ZERO-OR-ONE(SET(01)),
ZERO-TO-TWO(RANGE(0-9))
)
OR
(
'2',(
(RANGE(0-4),RANGE(0-9))
OR
('5',RANGE(0-5))
)
)
)
DEF SEQUENCE DOMAIN_NAME (
ZERO-OR-ONE (
RANGE(a-z), (ZERO-OR-MORE RANGE(a-z,0-9),RANGE(a-z,0-9) )
)
)
DEF SEQUENCE ADDRESS (
SEQUENCE DOMAIN-NAME
OR (
'#',ONE-OR-MORE RANGE(0-9)
)
OR (
'[', THREE-OF(SEQUENCE INNER-IP, '.'), SEQUENCE INNER-IP,']'
)
)
DEF SEQUENCE MAIL_ADDRESS (
ZERO-OR-MORE (
(
ONE-OR-MORE NOT-IN SET(<>(\)[]\\.,;:@"),
ZERO-OR-MORE('.', ONE-OR-MORE NOT-IN SET(<>(\)[]\\,;:@"))
)
OR
('"', ONE-OR-MORE ANY,'"')
)
)
ANCHOR BEGIN
(
SEQUENCE MAIL_ADDRESS
),
'@'
(
SEQUENCE ADDRESS
),
'.',
(
SEQUENCE ADDRESS
)
ANCHOR END
[ 1 comment ]
Given I'm such an Eclipse hound now and MSDEV 6.0 is getting long in the tooth, I thought I'd give the Eclipse CDT project a spin. It's certainly easy to install and setup. On Windows I just had to install the Cygwin and Gnu dev tools and unzip the project into my Eclipse 3.0 directory.
Once I had the CDT running I attempted to configure the editor to my liking. Here's where I hit my first sign of disappointments to come. The preferences panel only offers basic color coding options and has none of the automatic formatting goodness of the Java IDE.
Once I had the editor setup I wrote my first little hello world program and tried to compile it. It failed when it couldn't find a make target. This got me a little nervous because I've happily purged most of my make knowledge from memory and didn't relish diving in and refreshing those brain cells. Luckily the CDT offers two modes of working with make: managed projects and standard projects. With managed projects it does all the work and builds the make file. With the standard project you need to do the make file work, you just teach the IDE about the build targets. I had started out creating a standard project (it sounded simpler) when I should have created a managed one. I just created a new managed one and everything worked great.
Once I had some simple code working I switched over and went looking to explore the CDT refactoring capabilities. If you don’t already know, this is where the Java IDE really shines. You can rename classes, methods and attributes and have those changes propagated throughout the project. It’s really an amazing time saver. However, to my great disappointment none of this magic has been carried over to the CDT.
The Eclipse CDT is pretty cool but currently it's not that much different from my old MSDEV. Given that work on the CDT continues I hope to see some of the Java magic make its way into the c++ environment. Until then, given their similarities I probably won’t bother to port the PE project, but I may choose the CDT for any new projects I start.
[ no comments ]
Create new communication channels and use them. There can be a temptation to hold back information, especially bad news, until you are sure. The result can be decreased trust, since people usually can tell when something is going on. Often the information void will be filled with anxiety-producing rumors.
While it's annoying not having all the facts, I usually make the best of these times by making a game out of it. I gather all the rumors I can before the transition and then compare the rumors with the final reality. There are usually some pretty strange and off base rumors. The most extreme version of this survival strategy I've heard of was from friend of mine who told me their experience in the army. Him and his coworkers would routinely entertain themselves by creating new rumors and monitoring whether and or how long they took to come back to them.
[ no comments ]
This Space.com article on mysterious triangular aircraft is pretty interesting. Given it's reported slow speed I doubt it's the oft mentioned and mysterious Aurora, but who knows.
On a more humerous note, I've dug a little deeper and found folks speculating it's an "incredibly advanced gravity-defying triangular super-secret aerial platforms at least partially derived from ET technology" called the TR-3B. It's amazing how much detail people claim to know about the thing:
A circular, plasma filled accelerator ring called the "Magnetic Field Disrupter" surrounds the rotatable crew compartment and is far ahead of any imaginable technology. Sandia and Livermore laboratories developed the reverse engineered MFD technology. The government will go to any lengths to protect this technology.The MFD generates a magnetic vortex field that disrupts or neutralizes the effects of gravity on mass within proximity by 89 percent. This is not antigravity. Anti-gravity provides a repulsive force that can be used for propulsion. The MFD creates a disruption of the Earth's gravitational field upon the mass within the circular accelerator.
The mass of the circular accelerator, and all mass within the accelerator, such as the crew capsule and the nuclear reactor, are reduced by almost 90%. This causes the effect of making a vehicle extremely light and able to outperform and outmaneuver any craft yet constructed--except, of course, those UFOs we did not build. The TR-3 is a reconnaissance platform with an indefinite loiter time. "Indefinite" because it uses a nuclear reactor for power
[ no comments ]
1. The blogger Troutgirl was terminated from Friendster for blogging. While the posts that caused her termination do mention work and the technology they employ, they hardly seem cause for termination. I've always been fairly cautious in this vein; I guess it's the smart thing to do.
2. While reading about the horrible terrorist attack in Russia I came across the word denouement.
With hospitals overflowing and many bewildered relatives still seeking news of missing loved ones after Friday's bloody denouement, President Vladimir Putin ordered a security crackdown in the Caucasus.It's not very often that a word in a news article stumps me, but this one did. According to Hyperdictionary denouement means:
1. [n] the final resolution of the main complication of a literary or dramatic work
2. [n] the outcome of a complex sequence of events
[ no comments ]

