Beutelevision

by Thomas Beutel

Brand new steam engine built in Britain

This is totally cool… a brand new steam engine was just completed in Britain and is undergoing testing. They used parts fabricated all around the world since the skills of making a steam engine in one place have disappeared.

The group I’m working with, San Francisco Trains is working to preserve both a steam engine and the place where running repairs for steam engines were made, namely the Bayshore Roundhouse just south of San Francisco. All of that same knowledge that goes into creating a steam engine was there at one time at Bayshore.

Geeks of 3D website

Geeks3d is “All 3D Tech News, All The Time”, and they just covered the Shapeways announcement.

3D printing for model railroading?

Shapeways looks really interesting. According to Technology Review you upload a 3-D design to the website, and 10 days and $50-$100 later, you receive a polymer version of your design.

I can see this as really handy for creating masters for items that I want to replicate in urethane or plaster, such as bridge parts or passenger car sides. Cool!

Useless use of private variable in void context (Perl)

Can you see what is wrong with this Perl code snippet?

foreach my $cat (@$categories) {
if ($cat->{col} == $column and $cat=>{pos} == $position) {
return $cat;
}
}

It gets the “Useless use of private variable in void context” at the last brace. Well, it took me a while, but it was the equal sign in $cat=>{pos} which should be $cat->{pos}. Worse, I copied and pasted this code somewhere else, which doubled the problem. (Yes I know, all copying and pasting is evil–I get it!)

In any case, this comment on Perlmonks was helpful, suggesting to look for typos backward from the point of the error. Yup, that’s exactly what it was.

Lava lamps for programming

I just love this idea: integrating lava lamps to Cruise Control so that you can see when a software build has gone bad. The idea is to turn on a red lava lamp when the build failed, otherwise turn on a green one. Cool!

Symfony project menus for Emacs

After reading the Productive Programmer, I was inspired to write a custom script to add Symfony menus to my Emacs editor. After some frustration (I find emacs LISP tough to grok), I finally figured it out. (script is below)

Anyway, here are a couple of pictures showing custom menus for a small project. This allows me to find and load module templates, action files, and models quickly and easily.

 

symfonu modules in an emacs menu

 

lib/models in an emacs menu

OK, I didn’t write the script in elisp. Instead, I use perl to generate the elisp code. To create the elisp code, I run this script at the root of the Symfony project.

#!/usr/bin/perl
$dir = `pwd`;
chomp $dir;   

print qq{
;; menu.el - quick access menus for emacs editor
;; *** auto generated by bin/symenu ***
;; To use this menu, load into buffer and then ESC-X eval-buffer
;; T. Beutel

(defvar my-menu nil "my menu")
};

my $menus = qq{
 (easy-menu-define my-menu global-map "My own menu"
 '("Modules"
};

my $count = 0;

while(){
  ($module) = (m/ \/ ([^\/]+) \z /xms);
  $count++;
  print qq{
(defun $module-actions ()
 (interactive)
  (let (mybuffer)
  (setq mybuffer (find-file "$dir/apps/frontend/modules/$module/actions/actions.class.php"))
 )
)
};

$menus .= qq{
 ("$module"
 ["actions" $module-actions t]
};

while(){
  ($template,$success,$tmpl2) = (m/ \/ (?: ([^\/]+) (Success) | ([^\/]+) ) \.php \z /xms);
  $template ||= $tmpl2;

$count++;
  print qq{
(defun $module-$template ()
 (interactive)
  (let (mybuffer)
  (setq mybuffer (find-file "$dir/apps/frontend/modules/$module/templates/$template$success.php"))
 )
)
};

$menus .= qq{
 ["$template" $module-$template t]
};

}

$menus .= ")\n";

}

print $menus . "))\n";

# Models

my $menus = qq{
 (easy-menu-define my-menu global-map "My own menu"
 '("Models"
};

my $count = 0;

while(
){
  ($model) = (m/ \/ ([^\/]+) \.php \z /xms);

$count++;
  print qq{
(defun model-$model ()
 (interactive)
  (let (mybuffer)
  (setq mybuffer (find-file "$dir/lib/model/$model.php"))
 )
)
};

$menus .= qq{
 ["$model" model-$model t]
};

}

print $menus . "))\n";

Update: After I wrote my implementation, I found this pure elisp implementation that creates an even better symfony navigation: http://svn.tracfort.jp/svn/dino-symfony/emacs-symfony/emacs-symfony/symfony-navigation.el

British Motors installs 287 KW solar roof in San Francisco

It’s enough to power 80 homes in SF and it offsets 14 million pounds of carbon over its lifetime, according to this Marketwatch article.

Crowds Overwhelm GoSolarSF Fair, Everyone Wants Solar

I spent some time this afternoon speaking with various solar installers at the GoSolarSF fair at the Eureka Valley rec center. To say the fair was crowded would be an understatement. I wasn’t able to speak to most of the installers–the crowds were too deep. It’s fantastic to see this amount of interest in solar.

Of course, San Francisco is doing its part by providing incentives, which along with state and soon to expire federal incentives makes it a no brainer. A typical $25,000 system will cost about half that after incentives, and with ever increasing electricity prices the typical return-on-investment is 5 to 7 years.

According to one of the companies I spoke with, the ROI is even better if you are using solar to power a plugin hybrid electric car. At current gas prices, a 1.5KW solar array along with a PHEV like the Chevy Volt would pay for itself in 2 years. 

The only question in my mind is whether to buy a larger array now, or wait until PHEVs are actually available.

A SproutCore example by Johannes Fahrenkrug

Johannes Fahrenkrug wrote a nice tutorial on building an OpenSocial app with SproutCore.

The Productive Programmer Book

I just finished reading the Productive Programmer and I really like the suggestions, such as SLAP (single level of abstraction). The book isn’t language specific, but it is Java-heavy in the examples. Still, everything is adaptable to other languages.

There is now also a wiki for the book.