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.
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!
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.
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"
};
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.
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.
Well it’s been a long time since I’ve posted something. A part of that was the decision to move away from my custom blog code (mostly XSLT based, believe it or not!) to something much easier, Wordpress. In the process I moved all of my old posts over, but I lost all the links. Oh well!