There’s a local group of entrepreneurs and developers that meets every couple of months in Cambridge. I was curious about this month’s presenters’ choices of development platform, so I took at look at their headers and here’s what I found.
Of 7 presenters the platform stats fall out thusly:
2 Ruby on Rails (plus one suspected, but not confirmed)
2 PHP
1 Asp.net
1 Python (cherry py)
By way of contrast, a quick and dirty survey of jobs in boston/cambridge/brookline on craig’s list turned up the following stats
232 jobs containing Java
113 jobs containing ASP.net
164 jobs containing PHP
46 jobs containing Python
34 jobs containing Ruby
Presumably the difference is because of lots of folks in the area are working at medium sized companies on older, established (i won’t say “legacy”) systems?
In the image below I’ve plotted the average gas price in each state for 4/25/07 (data from here) with and without state per-gallon taxes included. Without the taxes included, it becomes obvious that gas prices increase on the west coast, perhaps due to transportation costs? ( a quick search didn’t turn up any port-by-port oil import stats).
Kristi and I saw “The Ten” on Saturday night at the Boston Independent Film Festival – the premise of the movie is to create a sketch touching on each of the ten commandments. Each sketch is really funny with cameos from many actors. The sketches are often quite different,
but like great Improv, they make callbacks to include characters and ideas from previous scenes. Great closing scene with the whole cast, great movie overall.
Loading geographic map data and drawing maps is pretty easy to do with two Ruby tools – ruby-shapelib (to load the map data) and RImageMagick (to create the drawings).
I didn’t see any tutorials or sample code, so I’m posting this sample as is – it will draw every shape part of every shape in a given shape file. Note this code does not perform any geographic projections.
require 'rubygems'
require 'RMagick'
require 'rvg/rvg'
require 'shapelib'
include ShapeLib
include Magick
USSTATES_SHAPEFILE="/Users/jkk/projects/shapelib/statesp020/statesp020.shp"
OUTFILE="/Users/jkk/projects/shapelib/test.png"
def drawshape shape, canvas
#each shape can have multiple shape parts...
#iterate over each shape part in this shape -
0.upto(shape.part_start.length-1) do |index|
part_begin = shape.part_start[index]
unless shape.part_start[index+1].nil? then
part_end = shape.part_start[index+1]-1
else
part_end=-1
end
#NOTE we're assuming all the parts are polygons for now...
#draw a polygon with the current subset of the xvals and yvals point arrays
canvas.polygon(shape.xvals.slice(part_begin..part_end),shape.yvals.slice(part_begin..part_end)).styles(:fill =>"green",:stroke=>"black",:stroke_width=>0.01)
end
end
#create a viewbox with lat/long coordinate space in the correct range
def create_canvas rvg, shapefile
width = shapefile.maxbound[0] -shapefile.minbound[0]
height = shapefile.maxbound[1] -shapefile.minbound[1]
#puts "viewport #{shapefile.minbound[0]},#{shapefile.minbound[1]} - width= #{width} height= #{height}"
#invert the y axis so "up" is bigger and map the coordinate space to the shape's bounding box
canvas = rvg.translate(0,rvg.height).scale(1,-1).viewbox(shapefile.minbound[0],shapefile.minbound[1],width,height).preserve_aspect_ratio('xMinYMin', 'meet')
end
shapefile = ShapeFile.open(USSTATES_SHAPEFILE,"rb")
#create a new RVG object
rvg = RVG.new(1000,100)
rvg.background_fill='white'
canvas = create_canvas rvg, shapefile
shapefile.each { |shape| drawshape(shape,canvas) }
shapefile.close
rvg.draw.write(OUTFILE)
Next year’s pulitzer prize has to go to Marianne Lavelle of US News and World Report for this article titled “Is a penny a gallon worth a detour?” and subtitled “Cutting back on driving rather than searching for bargains is often a better way to save money on gas.”
Wow! Who would of thought driving less would save you money, and that going out of your way for a few cents per gallon savings wouldn’t be worth it?
Now that she’s gotten this difficult study wrapped up we can all look forward to her future work on ending the war in Iraq and converting to a hydrogen economy – should be easy by comparison 🙂
I saw on the Globe’s website that the founder of ZipCar has started a new company, goloco.com, which aims to promote ride sharing by splitting up the costs of a trip, handling payments to the driver, and taking a 10% cut of the proceeds. I don’t know why, but I happened to skim the terms of service which were all pretty standard stuff, until i found this:
13. Carbon Credits
You agree to assign the rights to any Carbon Credits resulting from any trips arranged using our service to GoLoco.
Pretty crafty – if they do well, and if we ever get some kind of cap and trade system for carbon (which is a lot of ifs) they could stand to make more money selling carbon credits than on their users’ tithe.
Thomas Friedman wrote a phenomenal article on green power in last Sunday’s New York Times magazine. The gist of it is that America leads the world in developing technology to conserve and cleanly generate in the few markets where the US government has acted in the past to mandate strict emissions restrictions, as in the example of diesel locomotives, and creating well-paying domestic jobs to boot. He argues that the free market can’t work properly without the government creating regulations that can provide guidance on future costs of emissions and fuel. People can’t and won’t invest hundreds of millions of dollars if they can be wiped out the next time oil prices drop. It needs to cost money to burn fossil fuels or no alternatives will be developed.
I’ve heard this before at Technical Review’s emerging tech conference last fall – hopefully with Friedman articulating the case for pro enviroment so well and in a manner that should make sense for lots of society, not just the “tree-huggers” we can finally make some real progress on meaningful environmental legislation.
Over the past two days, I’ve had the misfortune of gathering a good sample of Authorize.net’s support hold time. (fyi, they are an internet credit card processing gateway) Four calls – each with hold times between 12 and 15 minutes! At between 9 and 10 eastern time, so a good chunk of the country is still sleeping no less. That doesn’t seem like any way to run a business. When I asked about the hold times (on the third call), the guy said its because its the first weekdays after the monthly billing cycle. That was meant to be reassuring but its got to make you wonder what are they doing wrong with their customer billing so that everyone has to call them about it?
In their defense, the problem I was calling about wasn’t their fault, and they indicated they thought some of our information was wrong right from the get go.
Hopefully it’ll be smooth sailing from here on out and I won’t have to call them again.
I found out something cool about JSTL’s expression language today that I didn’t expect at all – like a real scripting language, EL allows one to access an object’s fields not only like object.fieldname (which wouldn’t be changeable at runtime) but also as object[“fieldname”] and by extension with any string variable as an argument. Wow! I don’t remember seeing any examples of this in the wild – somehow i stumbled upon it in the bowels of a unified expression language tutorial.
This came in handy DRYing out some JSP code today that differed only in the fields accessed on the same kind of objects – I thought immediately, if only I had a scripting language this could all go away! Then I thought about the long and winding road one might take to do that in java, involving reflection and/or long if/else blocks. I was pleasantly surprised to find out JSTL can do that. Phew.
Here’s a poor example:
I put together this quick hack to show the borders of all the containers in a flex application – I found myself wishing for something like firebug’s inspector for flex while spending way too much time debugging a pixel precise layout this week This biggest problem for me was figuring out which control or container was contributing padding to the layout in places where the alignment was off, and it appeared that some of my styles in an embedded css file weren’t working.
The code inserts a canvas over the contents of the application, disables its mouse events (making it transparent to the app/user) and then listens for mouse move events on the Application object. Each time the mouse moves, it queries the display list to find out what’s under the mouse, then draws outlines around that control and all of its parents.
There’s obviously a lot more that could be added to this – like shading padded regions, having a tool tip display which control you’re over along with attributes, but as I don’t know when I’ll have the time (and more importantly the inclination) to make those enhancements happen, I’m putting it up now.
You can right click on the example to view the source. If the embed isn’t working, you can go here where all the flash player autoinstall magic will happen.
Note: this will only work in your application if your root application object has absolute layout because of the way flex containers work- i.e. only containers with absolute layout allow overlapping controls. I had some code that attempted to reparent the children of the application if it had vertical or horizontal layout, but the guts of flex were throwing an error so that code is commented out presently.