Quick and Dirty
On
Wednesday, January 30, 2008
Labels:
None
Of course, "exploratory programming" is just a euphemism for "quick and dirty" programming. And that phrase is almost redundant: quick almost always seems to imply dirty. One is always a bit sheepish about writing quick and dirty programs. And yet some, if not most, of the best programs began that way. And some, if not most, of the most spectacular failures in software have been perpetrated by people trying to do the opposite.
So experience suggests we should embrace dirtiness. Or at least some forms of it; in other ways, the best quick-and-dirty programs are usually quite clean. Which kind of dirtiness is bad and which is good? The best kind of quick and dirty programs seem to be ones that are mathematically elegant, but missing features-- and particularly features that are inessential but deemed necessary for propriety. Good cleanness is a response to constraints imposed by the problem. Bad cleanness is a response to constraints imposed from outside-- by regulations, or the expectations of powerful organizations.
Arc's Out by Paul Graham.
Labels:
gchartrb,
ruby
I spent a bit of time hacking on a lazy Sunday afternoon and managed to get out version 0.6 of gchartrb. This blog post is to illustrate the three new features that I managed to put in.
I added support for the undocumented lfi chart type, which is mentioned here, due to a request that came in. Please note that the support is experimental, until Google documents it. Here is a sample usage
# Financial Line Chart (Experimental)
flc = GoogleChart::FinancialLineChart.new do |chart|
chart.data "", [3,10,20,37,40,25,68,75,89,99], "ff0000"
end
puts "\nFinancial Line Chart or Sparklines (EXPERIMENTAL)"
puts flc.to_url
The output is

Second, I added the Line Styles feature. Here is the sample usage
# Line Style
lc = GoogleChart::LineChart.new('320x200', "Line Chart", false) do |lc|
lc.data "Trend 1", [5,4,3,1,3,5], '0000ff'
lc.data "Trend 2", [1,2,3,4,5,6], '00ff00'
lc.data "Trend 3", [6,5,4,3,2,1], 'ff0000'
lc.line_style 0, :length_segment => 3, :length_blank => 2, :line_thickness => 3
lc.line_style 1, :length_segment => 1, :length_blank => 2, :line_thickness => 1
lc.line_style 2, :length_segment => 2, :length_blank => 1, :line_thickness => 5
end
puts "\nLine Styles"
puts lc.to_url
which leads to

Last, I finally added support for customisable widths and spacing in bar charts.
# Bar Chart
GoogleChart::BarChart.new('800x200', "Bar Chart", :vertical, false) do |bc|
bc.data "Trend 1", [5,4,3,1,3,5], '0000ff'
bc.data "Trend 2", [1,2,3,4,5,6], 'ff0000'
bc.data "Trend 3", [6,5,4,4,5,6], '00ff00'
bc.width_spacing_options :bar_width => 5, :bar_spacing => 2, :group_spacing => 10
puts "\nBar Chart"
puts bc.to_url
end
which results in

Labels:
None
A head shot of Kerviel cut from a trading Web site showed an earnest-looking young man. When his identity was revealed in the afternoon, he had 11 friends listed on the facebook.com social Web site. That number later dropped to four. Kerviel was not available for comment.
:)
From SocGen reels from record $7 bln rogue trader fraud | Reuters
Market Timing
On
Thursday, January 17, 2008
Labels:
finance,
invesing,
stocks
As the Danish Philosopher Søren Kierkegaard noted, life can be only be understood backwards – but must be lived forwards. Looking back, you can exactly see when you should have bought and sold your stocks. But dont't let that fool you into thinking you can see, in real time, just when to get in and out. In the financial markets, hindsight is forever 20/20, but foresight is legally blind. And thus, for most investors, market timing is a practical and emotional impossibility.
The Intelligent Investor by Benjamin Graham
Labels:
None
Some people still think that there's an "Islamo-fascist tyranny"
somewhere that hates our freedoms and can organize Islam-dom into a
coherent fascist state... There's just no way. Al Qaeda and the
Taliban aren't true "fascists." Fascists can at least make trains run
on time. Even Communists were better-organized. The mujihadeen (sic) have
no organized army and no industrial policy and they don't know where to
find any. Because God was supposed to handle all that for them.
You're supposed to die nobly in a crowd of unwitting strangers, and
then God's supposed to make that all better. That's the big plan.
But when you blow up the china shop, God doesn't reassemble the plates
for you. Being faith-based doesn't trump reality.
State of the World, 2008
:)