Thursday, December 13, 2007

Whatever

  • Two interesting stories about human evolution and what has driven the process
  • Technology can help solve our "energy problems," as usual
  • Exposing the flaws of the social-welfare state
  • Wow! I think my wife might want this software.
  • This is why I started playing the guitar. Even though the sound isn't what it used to be it's still a neat story.
  • So what?

Saturday, December 08, 2007

Whatever

Tuesday, December 04, 2007

Fight the ignorance

One blog that I read daily is the Neurologica Blog which is run by Dr. Steven Novella. His articles are always very interesting and informative even when the topic is a complex scientific/medical issue. (I highly recommend his podcast the Skeptics Guide to the Universe. He and his fellow "rouges" can always be counted on to provide a humorous and informative look at science and skeptical news of the day.)

I want to comment on this article in which Dr. Novella examines the legal and social issues of "free citizens giving medical advice." He wonders how we protect the public from those who spout bogus medical advice while at the same time upholding the basic right of free speech. Novella doesn't claim to have the answer, but I wanted to comment on something he says at the end of the article. Here's what he says
"...although I think we do need to thoughtfully tighten up our regulation of the giving of medical advice, any legal remedy is extremely problematic. The far better solution is to educate the public so that they can recognize nonsense when they see it. This, however, is also a very imperfect solution as it is far easier to spread misinformation than it is to correct it."
He is skeptical of legal remedies, as I am, and offers education as a possible solution. I think this solution can actually be more powerful than he understands.

I think we as individuals can start by changing expectations about what is acceptable in society. Educate the credulous; call bullshit on those who perpetuate bogus claims; don't let snake oil salesmen go unchallenged - call them out in a public forum. Setting such expectations creates true organic law that is a better reflection of values shared by individuals in society. Political legislation creates constituencies of power that pit groups against each other and creates a market for pull. (DRM is an example of legislation that doesn't reflect the reality "on the ground" but has powerful constituencies that have the ears of politicians.)

Is this idea of "organic law" via expectations a perfect solution? No. But it is at least more nimble than political legislation which punishes the many to stop the few.

I also believe we have to be careful when informing others about pseudo-science and other false claims. I was recently in a discussion with a friend about natural medicines and homeopathy and I was a bit harsh in my criticisms. If I had to do it over again I would most likely take a different approach because in the end I think my harsh tone was counterproductive. There are times, however, when just calling bullshit is necessary.

You'll read more about this idea of "organic law" if I ever get back to live-blogging Law, Legislation, and Liberty. Until then, fight the ignorance!

Saturday, December 01, 2007

Whatever

Sunday, November 25, 2007

Reign over me (cont.)

I sent the following to the Raleigh News & Observer
In your editorial "No dynasty needed," you quote Warren Buffett as saying that "the resources of society I don't think should pass along in an aristocratic dynasty of wealth." This you use to help make your case for keeping the estate tax.

If we are truly concerned about "aristocratic dynasties," however, why not go after the more harmful dynasty of power? Let's amend the Constitution so that family members of former elected officials are prevented from taking their relatives' former seat - a growing phenomenon with regards to Congressional seats. It is possible, after all, that by the year 2017 the presidency will have been in control of two families for nearly 30 years. Why is that less troubling than someone handing down rightfully acquired wealth to his heirs?

We easily violate property rights to prevent so-called "dynasties." Why should we let eligibility requirements for political candidates stand in our way?

Thursday, November 22, 2007

Thanksgiving Whatever

Happy Thanksgiving!

Sunday, November 18, 2007

Reign over me

"The resources of society I don't think should pass along in terms of an aristocratic dynasty of wealth. I believe in keeping equality of opportunity as much as you can in this country."

Those were the words of renowned investment guru Warren Buffet when he spoke to the Senate Finance Committee recently. He was there to lobby the U.S. Congress to keep the Inheritance Tax which was set to expire in 2010 (it would actually only expire for that year and would return in 2011). It's somewhat sad that such leftist shibboleths are spoken by a man who seems to have the Midas Touch when it comes to investing.

Let's start from the beginning. "The resources of society..." No Mr. Buffet they are not society's resources they are yours. You created them with your hard work - they would not have existed otherwise. Why does "society" have a claim on them? Okay, maybe you can make the claim that if it wasn't for "society" you wouldn't have had the ability to acquire such wealth. But the reverse case could also be made: other members of society wouldn't be as rich or even have jobs if it weren't for men like you.

"... I don't think should pass along in terms of an aristocratic dynasty of wealth." I applaud the healthy suspicion of aristocracy, but let's not forget the other American tradition: respect for property rights. I would also argue that a "dynasty of wealth" is somewhat innocuous unless that wealth is allowed to wield the power of government. We can blame the owners of such wealth for influencing government power, but the onus must fall upon elected officials who allow themselves to be bought.

A note on terminology: Aristocratic dynasties are primarily governing institutions. If we really wanted to stop true "aristocratic dynasties" shouldn't we amend the constitution to prevent family members of former elected officials from running for office? (It is possible that by 2017 the U.S. Presidency would have been in the control of two families for almost 30 years. There is also a growing trend where children are replacing their parents in Congress.)

"I believe in keeping equality of opportunity as much as you can is this country." How is it that opportunity is taken away from anyone if you, Mr. Buffet, are able to leave your wealth to your heirs? I would argue that your wealth has created opportunity for countless numbers of people - whether it be with jobs that were created or investments that increased in value. Do you trust the political process with such wealth more than your heirs? You may want to think that your taxed wealth will go to better someone's life, but it could just as easily be said that that money will go to support more corruption and war. I would hope that you would look to clean up government before giving it more wealth to destroy.

Here's an idea: Why not continue your philanthropic ways by willing your estate to a cause (or causes) that would provide opportunity directly to individuals? Why should that wealth have to be pass through the unproductive sieve of a political bureaucracy?

Unfortunately, Mr. Buffet is part of a sad tradition of wealthy people who want to fund and lobby for the destruction of the very engine that made them wealthy. Maybe this book by Garet Garrett would be a valuable read.

Thursday, November 15, 2007

Whatever

Some random whatever

Tuesday, November 13, 2007

Milton Friedman on "greed"

I love this YouTube video of Milton Friedman giving Phil Donahue a good smack-down. In contrast to Donahue's banal, simplistic arguments, Friedman teaches with reason and trenchant arguments while maintaining a sense of class.

Ants and order

Here's an article from Carl Zimmer talking about how insects create order by following very simple rules. What's interesting is that in the article Zimmer mentions that experiments were run with humans to mimic this order making phenomenon. I couldn't help but wonder why they had to run experiments with humans, because you could easily study human society to find similar spontaneous orders. Medieval law, language, the market process and other aspects of human culture can be traced to individuals following simple rules.

I will have more to say about this in future blog posts when I continue my live blogging of "Law, Legislation, and Liberty."

Saturday, November 10, 2007

Two minute answers

I've joined Toastmasters recently, and in this past week's session the table-topics master asked "how would you fix the problem of rising gas prices?" I regret not volunteering to answer because it would have been a good forum in which to educate people on the market process. So here is the answer I would have given.

My answer is that I don't know, and neither do you. No one in Washington knows and no environmentalist or oil company executive knows.

The answer, or more likely answers, will emerge from what Ludwig von Mises called the "daily repeated plebiscite" of the market process. Each of us contributes to this process by acting on our own bit of information. Consumers make decisions about what and how much to purchase, and producers and entrepreneurs decide on what and how much to produce. What governs this process is not some central authority with god-like powers; nor is it some committee of wise men with only the public good in mind. The governing mechanism of this "daily plebiscite" is the price system. Rising prices encourage consumers to cut back on purchases while at the same time encouraging producers to find new sources of supply. Innovative new products and technologies become more viable with higher prices.

Now I know this answer is somewhat simplistic because it ignores the international political issues going on in the world. It also assumes that the normative statement of rising gas prices being a problem is correct. But there was a two minute time limit!

Wednesday, November 07, 2007

Whatever

Some random whatevers

Monday, November 05, 2007

Economics of health care

I've written many blog posts about health care and the problems with government-run systems, so I was excited to see that the latest episode of EconTalk with Russ Roberts was about the economics of health care. Take a listen.

BTW, if EconTalk is not one of your regular podcast subscriptions, you should make it so. Russ Roberts is a great host, and his topics are very thought provoking and interesting. If you have listened to EconTalk before then think about voting for it as the Best Podcast of the Year.

While I'm on the subject of the economics of health care, here are some interesting articles to peruse

Monday, September 03, 2007

Kosmos and Taxis


Go to the ant, you sluggard;
consider its ways and be wise!
It has no commander,
no overseer or ruler,
yet it stores its provisions in summer
and gathers its food at harvest.
-- Proverbs 6:6
I continue my live-blogging of Law, Legislation, and Liberty here with an investigation into order and its sources.

Order

Hayek defines social order in the following way:

“a state of affairs in which a multiplicity of events of various kinds are so related to each other that we may learn from our acquaintance with some spatial or temporal part of the whole to form correct expectations concerning the rest, or at least expectations which have a good chance of proving correct.”

The key word in that definition for me is expectation – order is expectation. Order is knowing that a cause will have an effect. Hayek expounds on his definition by saying that order manifests itself in the matching of intentions and expectations of different individuals who are members of a society and who are dependent upon cooperation with others.

Sources of Order

Now, having defined order we need to determine how it comes about. According to Hayek there are two sources of order – made order (taxis) and spontaneous order (kosmos).

Made orders require a “maker” from outside the system (exogenous) with a deliberate arrangement in mind. The “maker” is authoritarian and requires knowledge that is not possible to attain when dealing with complex systems. Simple organizations are made orders that have defined rules for the different roles. The operational details of those roles, however, are still left to the individual members.

Spontaneous orders, on the other hand, emerge based on rules not known by the individual elements. Nature teems with this kind of order (e.g., evolution, insect colonies, etc.), but we can also see it in human institutions. Language is a classic example, but what is more interesting is the order that emerges in basic human civilization. For a social order to exist individual members must follow certain rules, but how are those rules defined if a social order does not yet exist? The rules must evolve over time. Just like evolved traits that allow biological forms to survive and reproduce, social rules that allow individual members of a group to survive will be passed on and allow the group to survive. (We must be careful here and not equate social groups (i.e., society) with organisms. Organisms are concrete entities while social groups are mere abstractions that are constructed by the mind.)

Hayek says this about the rules that govern human society:

"Although man never existed without laws that he obeyed, he did, of course, exist for hundreds of thousands of years without laws he 'knew' in the sense that he was able to articulate them."

Could this be why murder seems so intuitively wrong to us? What about theft and property rights in general? Could we have evolved past a primitive state without these “laws”?

Conclusion

What is the purpose of defining order and its causes? Hayek is basically leading us to a differentiation between law and legislation - laws are naturally forming while legislation is man-made. Laws are what bring about a natural order. What does legislation bring? To be continued...

The End of Scarcity

This article is another reminder that John Edwards is an economic illiterate. If he were to be elected president he would do to this country what George Bush is doing to Iraq. Ok, that's a little strong, and there aren't many other candidates in this race that would be better, but come on! We are talking about a basic understanding of scarcity and incentives.

Monday, August 20, 2007

Divorce

This past weekend I closed the Window on a fifteen year relationship. The decision was inevitable. The relationship had become too routine even though we continually tried to Start anew. The age difference had finally begun to show. Separation was the only course of action, as Macabre as it may seem.

With one relationship ending, however, another has begun. For the past year or so I have been flirting with this other. Several years ago, an office fling was started but amounted to nothing - immaturity kept it from ripening into anything serious. Now at a Mini-mum, everything seems right. The combination of beauty, elegance, and prowess gives me hope for a long, fruitful relationship.

I only hope I haven't given in to succulent lust when another Vista may have opened in front of me.

Sunday, August 12, 2007

NFJS: The Java Memory Model

[More of my first "No Fluff, Just Stuff" experience]

The Java Memory Model session with Brian Goetz was intense, and I wasn't the only attendee to come away from the talk feeling that way. I'm still trying to absorb some of the concepts mentioned in the session, but I will do my best to summarize it here.

"A Memory Model is an abstraction for how one thread sees the effects of another thread's actions on memory." The following optimizations may interfere with this visibility
  • Values might be sitting in a processor-local cache and not yet flushed, or the local processor may have stale values in its cache
  • Values could be cached in registers and not written to memory
  • The processor may have executed instructions out of order
  • The compiler may have reordered certain instructions
The problem with these optimizations comes when you are trying to access shared data.

What blew the minds of some of the attendees was the idea that "sequentiality is an illusion" with modern processors. "This is not your father's Von Neumann machine," as Brian put it. But Java does provide the developer with mechanisms to ease the pain.

Synchronize

The synchronize mechanism is one of the tools Java provides to help developers deal with the complexities of concurrent programming. Here is Brian's Rule of Synchronization
If you are writing a field which may next be read by another thread, or reading a field which may have been last written by another thread, you must synchronize.
  • Synchronization is required by both the reading thread and the writing thread
  • Both reading and writing threads must synchronize on the same lock
In essence you must synchronize when accessing shared, mutable data. Something else that Brian mentioned that probably should be a global rule of programming is "make it right before you make it fast." (Hey, that rule could apply to guitar playing as well!)

Brian then talked about the happens-before relation which states that "if one action happens-before another, then the first is visible to and ordered before the second. This relation is defined in the Java Language Specification (Chapter 17).

So what problems could arise if the Java Memory Model (JMM) did not have the happens-before rule? The optimizations listed above will give you a clue. The order of operation execution in thread A, for example, may appear different from thread B's perspective (just like Special Relativity – order of execution is relative to the observer). Essentially, operations could occur in almost any order.

Volatile

The other tool that Java developers have for dealing with concurrent programming complexities is volatile variables. The visibility rules are similar to synchronized blocks, but there are no atomicity or mutual exclusion guarantees. Volatile variables are good for flags and "for safely publishing objects where atomicity is not required."

There is a lot more in this session including a little history of the JMM, problems with the old JMM, the double-checked-locking problem and how the new JMM fixes it with volatile. He ends with the following advice
  • Don't try to reason about ordering in under-synchronized programs
  • Make it right, then make it fast
  • Avoid tricks which rely on unsynchronized nonvolatile reads, like double-checked locking
  • Don't try to outsmart the JVM (synchronization is trickier than you might think)
Like I said, this session was intense. There were people who seemed visibly amazed at some of the things Brian was telling them (myself included). I think another idea from Einstein applies: spooky action at a distance. Spooky indeed.

A note on the speaker: Brian is a good speaker and very knowledgeable. He was obviously the smartest person in the room. He did a very good job explaining something that is very complex which tells me he really understands this subject.

Next up: The Holy Grail(s)

Saturday, August 11, 2007

NFJS: The Holy Grail(s)

[More of my first "No Fluff, Just Stuff" experience]

My last session at "No Fluff, Just Stuff" was Advanced Domain Models with Grails with Jason Rudolph. (N.B.: Jason is a friend and former co-worker of mine.) I saw Jason's Getting Started with Grails session at a recent Triangle Java User Group meeting, and was impressed with the simplicity and power of Grails. I was eager to learn more.

Jason started the session by talking about the benefits of GORM (Grails Object Relational Mapping) and how DAOs are evil (maybe those are my words). This is one aspect of Grails that I really like because, as Jason said, no one wants to write another DAO. We should be spending our time as programmers writing business logic, not plumbing.

Here are the key benefits of GORM
  • Zero-configuration persistence management
  • Rich relationship model
  • Declarative validation
  • Powerful query support
  • Easy scaffolding
All this makes for a happy, productive developer.

GORM, by the way, is built on Hibernate which is something that impresses me about Grails. It is built on proven technology with intuitive behavior. Jason did a great job emphasizing this aspect of Grails by building an application from scratch throughout the session.

Jason showed how easy it is in Grails to map relationships between entities. Using Groovy, here’s how you create a 1-to-n relationship

class Knight
{
static hasMany = [swords : Sword]
}
class Sword
{
static belongsTo = Knight
}
Grails takes care of the rest. It can’t get much easier.

Using EJB3 POJOs was about as easy as updating a Hibernate configuration file with the fully qualified class name. Converting those classes to Groovy was easy and, I believe, the preferable approach. In fact, the power of GORM allows you to swap out domain classes written in different languages with little effort.

What was great about this presentation was that Jason spent more time doing and less time pointing at slides. One thing I found a little disappointing, however, was the domain he was using for his examples. I get the joke about Knights and Swords, but I would have liked to see something more related to a business-oriented domain. (I overheard someone in a different session groan about having to see the bookstore example again.) I know it’s not possible to create a real-life application in ninety minutes, but incorporating some of the challenges found in enterprise applications might be useful. For example, ummm….I’m drawing a blank at the moment. This session did run a little short, so I think there is some room for a more complex example.

A note about the speaker: Jason is a good, knowledgeable speaker who knows his domain. He’s not a natural presenter like some of the others, but after seeing him present a few other times I do notice him improving. His passion for technology shows and that makes for an enjoyable session.

--

That's it! That was my first NFJS experience. It was a fun and exhausting weekend, and I look forward to next year. I hope these session summaries were somewhat valuable.

Thursday, August 09, 2007

SOA what!

[More of my first "No Fluff, Just Stuff" experience]

My last day at the Raleigh "No Fluff, Just Stuff" symposium began with a session called Implementing SOA. This was another session with Neal Ford who seemed to be in competition with Venkat Subramaniam to see who could speak at the most diverse set of sessions.

The session started off with Neal's opinion that a Service Oriented Architecture is not possible without agile best practices. He supports this by saying that such an architecture must be able to adapt to change gracefully. This seems intuitively correct to me because of the fine-grained nature of services and the complexity of the overall architecture. Without the small stuff being correct and stable, the big stuff won't matter.

What is SOA?

Here is how Neal defines SOA
  • Enterprise-wide architecture that breaks monolithic applications into a set of finer grain services
  • Services are available enterprise-wide through standard protocols
  • New applications are assembled from existing services rather than built from scratch
  • Services are registered in a central registry
  • Services can be discovered and interfaces can be 'negotiated'
  • Common services such as security can be shared by all applications or application services
That seems straightforward enough, but something tells me that even these clear guidelines can be stretched to include architectures that don't embody the spirit of SOA. Because what exactly is a "service" anyway? Hmm. Let's see if we can't flush that out as we evolve to an SOA.

Stages of an SOA

Stage 0, as Neal called it, of an SOA is a set of siloed applications that have no integration. This is the typical scenario of many IT organizations - disparate applications that could share common libraries (e.g., security, logging, etc.), but don't talk to one another and could possibly duplicate information.

In Stage 1 we start to see applications exposing functions as Web Services, but there is no integration or management of these services. This is relatively easy to accomplish, and as a best practice should be done via Web Service facades.

Stage 2 starts the process of centrally managing the exposed services from Stage 1. This is where a centralized service, like a Security Service, can start to be used and is, in fact, a good "case study" for the larger SOA.

Stage 3 is the "paradigm shift" - applications are dissolved into coarse-grained business services and business processes are managed across those services. The business functionality in those siloed applications (Stage 0) start to get cleaved away into standalone services that can be orchestrated or choreographed into business processes. This is where I see the agile/iterative process being a key to success.

Service Versioning

Once you have your services up and running what do you do when you need to version a service? The answer depends on whether your services are strongly typed or loosely typed. Strongly type services look something like this
public int AddOrder( Order toAdd, LineItems[] lineItems )
This is the typical way in which we define a method in Java, but you can see the problems if the interface needs to change.

A better way is to loosely type your services. This is done by having your services pass around a canonically defined document. Endpoints end up looking like this
public void service( Document doc )
What changes in this version is not the service, but the document. The service can then use a factory to retrieve the proper logic for handling the given document version (Strategy Pattern).

With loosely coupled services, we can now create a bus architecture that is document-centric and more resilient to change. Defining a robust meta-model for your document structure, however, is paramount to making this architecture a success.

What's also important (maybe most important) to remember here is that your services must have the correct granularity. Too granular and you get latency issues. Too coarse means there is not enough separation of business behavior. "Business function should drive service granularity."

Other things of interest that Neal mentioned included using XSL/XSLT to transform documents before putting them onto or getting them off of the bus. What I found most amusing are Neal's feelings on BPEL. He calls it “doodle-ware” and thinks it's a bad idea - "keep behavior in code," he says.

Conclusion

This session was jam packed with information, most of which was really useful. With my company starting to implement an SOA I will frequently be returning to my notes on this session.

Next up: The Java Memory Model