Hidden Mysteries of the Bayesian Conspiracy

 Jeff Atwood recommends that everyone read an Intuitive Explanation of Bayesian Reasoning in order to become an initiate in the Bayesian conspiracy. What he doesn’t tell you is that Bayes’ theorem is only the outermost ring of the Bayesian Conspiracy. Once you’ve been initiated and spent the necessary apprenticeship bringing beer to the poobahs, you will begin to hear of something called “Bayesian Belief Networks”. They’re what all the Illuminati use. Is Jeff ignorant of Bayesian networks or is he — perhaps — all too knowledgeable and withholding information? If so, for what nefarious purpose?

Editor Harry McCracken (PC World) Resigns — Apparently Over Ad Pressure

According to this CNet article, Harry McCracken of PC World resigned when pressured by SVP Colin Crawford to tone down stories critical of advertisers. I have no idea of the inside scoop on this, and the CNet article is full of anonymous sources, but sadly, I can believe it.

I was never inappropriately pressured from the business side of the magazines, but I have learned that such autonomy is more unusual than not and I strongly suspect the Web has made things worse (everything is harder when journalism has been devalued, both literally and metaphorically).

If the story’s accurate, McCracken deserves a big tip o’ the hat.

Rails Forms With Auto-Hyperlink On FKs

Because I use primary_key_prefix_type = :table_name this did the trick for me. Basically, I just set up a hash mapping primary key column names (“InvoiceID” and the like) to the name of the appropriate controller (“invoice_admin”). When outputting a column, if the name of the column is contained in that hash, output a link. All I had to do was write a script to generate the hash and a template for the show.rhtml and Bob was my uncle…

# Methods added to this helper will be available to all templates in the application.
module ApplicationHelper
    #lazy initializer for mapping between the names of FK fields and the appropriate controller
    #:return: => nil
    def initialize_identity_columns
        @identityColumns = { 
      'InvoiceID' =>  'invoice_admin' 
      # ... etc ... 
    #called within show.rhtml (probably) ala 
    # <% for column in LineItem.content_columns %>
    # <%= show_column_with_auto_hyperlink(@line_item, column) %>
    #<% end %>
    #:return: => String
    #:arg: currentObj => ActiveRecord::Base
    #:arg: column => ActiveRecord::ConnectionAdapters::Column
    def show_column_with_auto_hyperlink(currentObj, column)
      if @identityColumns == nil
      html = "<p><b>#{column.human_name}:</b> #{currentObj.send(column.name)}&nbsp;"
      optionalLink = nil    
      if @identityColumns[column.name] != nil 
          html += link_to("Show", { :controller => @identityColumns[column.name], :action => "show", :id => currentObj.send(column.name) })
      html += "</p>"
      return html


Auto-Database Browser With FKs as Hyperlinks?

Is there a product in the “cheaply deployable” range (say ~$100) that you can point at a significant SQL Server database and it parses the foreign key relationships and presents a table viewer in which the values in the foreign-key column automatically hyperlink to the relevant table? And this tool allows basic CRUD editing, searching, and sorting? Just like Access, but with navigation?

(Or do I have to create a Rails app for a db that has several hundred tables? Given that Rails doesn’t automatically generate the FK relationships, you’re talking about days of work.)

Update: I’m not talking about a tool for me, necessarily — have SQL, can travel and all that. And, sure, with Rails I can probably turn out a dozen or so forms (maybe more) in an 8-hour day. But, with a database with ~200 tables, you’re talking about me charging my clients thousands of bucks just to make simple Web pages. My requirement is ad hoc navigation through a database, with CRUD at the table level and a “development time” of no greater-than-a-day for a 200-table database. Really, very close to Access, but when there’s an FK in the table the person doesn’t have to say “Oh, okay, this line item has InvoiceID 256 — open the Invoices table, search for 256 — Oh, okay, that has a CustomerID of 538 — open the Customers table — let’s see, OrganizationID 23 … ”  Just:

LineItemID InvoiceID LineItemColumn LineItemColumn2
1 256 foo bar

…where that link leads to…

InvoiceID CustomerID InvoiceColumn InvoiceColumn2
256 538 foo bar

… etc …

Update: I solved the problem using Rails