CPU transplant successful!

The Xeon W3690 transplant was a success!

A Xeon CPU upgrade for the computer

I picked up a used Xeon W3690 CPU from eBay to upgrade the Core i7-930 currently powering my computer. Browsing around eBay, I found several for under $80. For two extra cores and a few hundred more MHz, it seemed like a pretty good deal to me so I picked one of them and bought it.

The existing CPU still works fine, but after seeing a few friends talking about computer upgrades, I did a bit of research to see what I could put into mine to give it a bit of a boost without having to do a complete computer replacement.

My choices were dictated by the motherboard revision (a Gigabyte GA-X58A-UD5 Rev 1.0) and BIOS version (F7e). The best CPUs supported by this combination were the Core i7-970 and the Xeon W3690.

Doing my quasi-semi-annual computer cleaning and replacing the CPU will be a good weekend project. With luck, this computer will be up and running with a “new” and faster brain.

Validation in Laravel Artisan commands

One of the things I like most about using Laravel is that most everything I’ve needed to do so far is pretty intuitive.  If I try to code up something the way I think it’s supposed to work, usually it does.

I’ve been working on adding some new Artisan commands to my equipment database to handle some of the back-end administrative tasks that I’d normally have to fire up a browser for.

Naturally I want to validate the input.  Laravel’s got some really nice validation rules that would be nice to use in my new artisan commands.  The documentation covers doing validation on incoming HTTP requests, but isn’t clear on whether the Validator can be used more generically.

Looking at the documentation for manually creating validators, a Validator instance takes two arrays: an array with the data to be validated, and an array containing the validation rules.

It seemed like I could use the Validator facade pretty much anywhere as long as I had arrays of data and validation rules.  In my artisan commands, I added a use statement for the Validator facade,

use Illuminate\Support\Facades\Validator;

and the rest mostly followed the manual validator creation docs.

$validator = Validator::make($model->toArray(), [
  // validation rules
]);

if ($validator->fails()) {
  // show validation errors and exit
}
else {
  // do stuff with validated data
}

Much happiness ensued when I tested things out and saw that the validations were working just like I thought they should.

Dipping my toes into org-mode

I’ve taken one of the older but still very capable laptops in my collection and put it to use as my “school” computer.  The goal is to have something I can lug around and use for research, number crunching, and my research notebook.  Then I don’t have to worry about trying to keep all that stuff in sync if I were to use my work and home desktop computers.

My handwriting can get pretty messy, and even I have a hard time reading my own handwriting sometimes.  I decided I wanted to do some kind of electronic lab notebook to keep my research notes, data, bibliography, and whatnot. 

I’ve been making an effort to spend more time in Emacs, and I have a few developer friends who rave about org-mode, so it seemed like a promising choice.

A quick Google search returned a few blog posts by people who are already using org-mode for research lab notes and writing papers and other research related tasks.  Plenty of prior work out there to learn from as I develop my own workflow.