Tuesday, January 24, 2012

Real leaders follow through on their promises ...

Very few times in history have leaders actually followed through on what they promised. Government Transparency was one of those promises and this simple serves to hide what our elected officials are actually doing. This generally leads to disenfranchised voters that simply ignore the process in future elections. I will vote in the next election and I will vote for Ron Paul ... even if I have to write his name on the ballot myself.


Read the following article from Salon ...


Rules of American justice: a tale of three cases

As EFF’s Trevor Timm put it yesterday: this is the “6th time under Obama someone is charged with Espionage for leaking to a journalist. Before Obama: only 3 cases in history.” This is all accomplished by characterizing disclosures in American newspapers about America’s wrongdoing as “aiding the enemy” (the alleged enemy being informed is Al Qaeda, but the actual concern is that the American people learn what their government is doing). As The New York Times‘ Charlie Savage wrote this morning, Obama has brought “more such cases than all previous presidents combined,” and by doing so, has won the admiration of the CIA and other intelligence agencies which, above all else, loathe transparency (which happens to be the value that Obama vowed to provide more of than any President in history).

Tuesday, February 1, 2011

Rails 3 with SQLServer 2000

I've been working on a new front-end to our legacy system and was disappointed to find that ActiveRecord 3 would not support SQLServer 2000 due to some limitations with the Arel gem. So after trying without much success to find a patch that would make this work, I wrote my own.

One big change is that the table reference for :set_table_name is now case sensitive. I don't believe it was in the past. So either make sure those names match or you will see cryptic messages like:

NoMethodError: undefined method 'eq' for nil:NilClass (yeah that was fun to track down)

There are a couple of other basic changes that need to happen so make it work at all. You need to change the SUPPORTED_VERSIONS constant and also change the TOP definition in the Arel SQLServer Visitor ...

module ActiveRecord
  module ConnectionAdapters
    class SQLServerAdapter
      SUPPORTED_VERSIONS = [2000,2005,2008].freeze
    end
  end
end

module Arel
  module Nodes
    module Visitors
      class SQLServer
        def visit_Arel_Nodes_Limit(o)
          "TOP #{visit o.expr}"
        end
      end
    end
  end
end


This will get the basics to work. You still won't be able to use some of the advanced features like offsets without further modification but this did the job for us. Well almost, there were a few other changes that needed to be made in our case since our column names are mixed-case. If you would like more info on these, let me know in the comments.

All the code here is found within the activerecord-sqlserver-adapter gem. I created overrides for all the methods and placed them inside the Rails app so that gem updates wouldn't cause any issues.

Wednesday, May 27, 2009

Of Labels and Limits

Saw this come across my feedreader today and it resonated on so many levels.

================================================
Original Blog Post::: Of Labels and Limits
================================================
In an attempt to satisfy our need for identity and belonging, we desperately try to wear as many labels as possible, and to a certain extent labels are a necessity. When people ask you what you do for a living, it’s far easier to reply “I’m a computer programmer” than to try and explain the plurality and complexity of the exact criteria of your job.

The problem with labels is that they can place you in a box, at times greatly limiting who and what you are. So while it’s okay to use labels to efficiently communicate with other people, it’s important not to fall into the trap of taking them too seriously, thus letting them become who you are - or are not.

It’s not the label per se, but rather our perception of what our identification with a given role implies. If I identify myself too strongly as a “rubyist” I may not be inclined to recognize the good that is found elsewhere in other programming languages, or worse still, reject such good in an attempt to defend the choice I opted to identify myself with. This inclination is the basis of many of the “religious wars” you see online.

I sometimes find myself in the odd predicament of limiting myself because of some label or assumption of what “a person like me” can and cannot do. In such instances though I’m reminded of a few stories about courageous individuals who went beyond labels, above the layer of conventionality, breaking what common sense would have considered a “difficult to challenge” limit. I’m reminded of blind people who took on photography and managed to be successful at it, or of a black kid of Kenyan origins who managed to become the President of the United States of America. But there is one story in particular that always gets me, it’s the story of Django Reinhardt, after whom the the popular Python framework was named.

Django was a Gypsy jazz guitarist who was severely injured in a fire when he was eighteen. As a result of this accident his right leg was paralyzed and the third and fourth fingers on his left hand were severely burned. Doctors recommended amputating his leg and were pretty darn sure that he would never play guitar again due to the extensive damage to his hand. Django refused the amputation though and left the hospital as soon as he could. Within a year he was able to walk again, albeit with the aid of a cane. Even more surprisingly, despite being “disabled” in his left hand, he persisted through the pain to practice his beloved instrument. He went on to reinvent the conventional approach to guitar playing by performing solos with the use of only two fingers, using his half-paralyzed fingers for chord work. Today Django is considered one of the most influential guitarists of the 20th century.

I’ve learned to consciously fight the urge to limit myself. Whatever labels you feel may be cutting your potential short or holding you back, I encourage you to break free and rise above them. Does doing so mean you’ll reinvent the way a musical instrument is played, reshape the course of history or become a hero in your field? Perhaps, but even if it doesn’t, your own life stands to become richer and freer because you decided not to live within the confines of a label.
=================================================

Tuesday, May 19, 2009

Powering Nanorobots

Imagine that we could make cars, aircraft and submarines as small as bacteria or molecules. Microscopic robotic surgeons, injected in the body, could locate and neutralize the causes of disease—for example, the plaque inside arteries or the protein deposits that may cause Alzheimer’s disease. And nanomachines—robots having features and components at the nanometer scale—could penetrate the steel beams of bridges or the wings of airplanes, fixing invisible cracks before they propagate and cause catastrophic failures.



This is a fascinating read.

How to Build Nanotech Motors



Nanotech has implications in everything we do from healthcare to sports. It is the next great frontier. I believe healthcare will see the most dramatic improvements. One of the problems we face today with the treatment of cancer is that the tools we have are too large to attack on only the cancerous cells and therefore we lose a lot of healthy cells in the process. Nanotech will be able to remove only the infected cells and work at much faster speeds.

Wednesday, May 6, 2009

Behavior

Social Architecture ... very interesting article especially the thought that behavior is a function of a person and his environment: B=f(P,E)

Saturday, April 4, 2009

Rise of the Phoenix

Originally purchased in 2005, this 1968 Convertible Camaro has been a side project and been a little neglected of late. I finally pulled her out of the garage on Thursday April 2 2009 and sent her of the plastic surgeon. I already completed some of the restoration by removing and restoring the drivers side floor and rocker panels but quite a bit more needs to be done and I would rather drive the car this year than wait to find the time it needs to complete.

So, I'll post pictures of the progress and keep a running dialogue here.

Thanks for following along:


Direct link to Flickr photoset


Friday, April 3, 2009

Cleaning the Air

Am planning on trying this in my bedroom. Reduces respiratory problems by 34% so it couldn't be all bad ...