Monday, November 30, 2009

Hamiltonian Mechanics: Now I Get It

So today i was reading this and followed some of the links to the wikipedia entries. The one for Hamiltonian Mechanics really made a bunch of stuff clear and make sense.

Wanted to share.

Friday, September 18, 2009

Install Python 2.6.2 on CentOS 5.3

Normally I don't use CentOS but rather Ubuntu since I like the shiny new stuff. Unfortunately for me, though, my work gave me some new processing machines with the provision I use CentOS. CentOS is great in that it's rock-solid stable. It sucks because to get that stability the software versions are rarely updated except for back-ports of security fixes. This isn't much of an issue unless you need some features existing in newer versions. What sucked is my current projects take full advantage of the multiprocessing library in python 2.6. This was a bit of a pain to figure out.

For example, CentOS 5.3 has python 2.4 which is hella old. It works in general, but if your project requires the use of something like the multiprocessing library (available in python 2.6) then you're hosed. Furthermore, just upgrading CentOS to 2.6 will significantly break the system. Bunches of things are tightly bound to version 2.4, really important stuff like yum for instance.

The way around this is to install python 2.6 along side 2.4 and adjust your bash environment variables to look there. Once that's established you can take advantage of all sorts of tasty things like multiprocessing and virtualenv. Since it was a nuisance to figure out, I'm gonna go ahead and document the steps here. Much of this is swiped from Villa Road with some alterations determined from my own experience and some other sites I've already forgotten.

Step 1: login as root
ssh root@yourbox.com
cd


Step 2: Install the extra packages for enterprise linux repository. It adds some previously unavailable packages and also provides some updates to existing repo packages
rpm -ivh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm


Step 3: Install development tools, ssl and zlib. These development tools will allow us to build python properly as well as aide setuptools when using easy_install later in this tutorial.
yum groupinstall 'Development Tools'
yum install openssl-devel* zlib*.x86_64


Step 4: Download sqlite, python and setuptools
wget http://www.sqlite.org/sqlite-amalgamation-3.6.18.tar.gz
wget http://www.python.org/ftp/python/2.6.2/Python-2.6.2.tgz
wget http://pypi.python.org/packages/2.6/s/setuptools/setuptools-0.6c9-py2.6.egg


Step 5: Build and Install SQLite
cd
tar zxvf sqlite-amalgamation-3.6.18.tar.gz
cd sqlite-3.6.18/
./configure
make
make install


Step 6: Build and install Python 2.6.2. Now, there are some important things to discuss here. First and foremost we have given the option –prefix=/opt/python2.6. This option installs the python binaries and the python library in /opt/python2.6 (it will make the dir for us) rather than in /usr/local/ which would, as we stated above, replace the standard python interpreter and inherently be bad juju. The /opt directory in redhat based distributions is a directory provides a home for larger, mostly custom built, binaries and applications.

Also, we made sure that the interpreter is going to make use of multiple threads by adding the –with-threads option. The –enable-shared option just allows python to be embedded into other apps.
cd
tar xfz Python-2.6.2.tgz
cd Python-2.6.2
./configure --prefix=/opt/python2.6 --with-threads --enable-shared
make
make install


Step 7: Now we need to make sure all our users can use the new python. To do this, we will need to add a couple of aliases and an addition to the $PATH to each users .bash_profile. This file is kept in the home directory of each user (eg: /home/rwilson/.bash_profile)
su - root
cd
nano .bash_profile
# add the following lines to the bottom of the file
alias python='/opt/python2.6/bin/python'
alias python2.6='/opt/python2.6/bin/python'
PATH=$PATH:/opt/python2.6/bin
# 'ctrl + o' to save the file and 'ctrl+x' to close the file

# now do the same for every other user, like this:
nano /home/rwilson/.bash_profile
alias python='/opt/python2.6/bin/python'
alias python2.6='/opt/python2.6/bin/python'
PATH=$PATH:/opt/python2.6/bin


Step 8: Now we need to update BASH so that it knows about the new shared libraries that we have put on the system. Create a symlink to them and then reload the cache of the shared libraries

su -
cd
cat >> /etc/ld.so.conf.d/opt-python2.6.conf
/opt/python2.6/lib #hit 'enter' and then 'ctrl+d'
ldconfig


Step 9: Now that bash is aware of our new libraries and such, let's go ahead and make /opt/python2.6 writable by everyone. Normally this may be a no no, but it was the only way I could make a clean break from the system library when it came time to install setuptools.

chmod -R a+w /opt/bin/python2.6


Step 10: At this point I chose to close out my terminal and bring it back up, then log back in as a non-root user to be certain my .bash_profile was loaded correctly. There is most certainly another way to do it, but I'm lazy and know this works fine. Then I checked my python version (which should be 2.6.2) and went from there

#do this after logging out, closing the terminal, bringing the terminal back up, and logging back in as non-root user
which python
# should say:
# alias python='/opt/python2.6/bin/python'
# /opt/python2.6/bin/python

python -V
# should say:
#Python 2.6.2


Step 11: OK now we're all good to go with install setuptools to our new python

cd
wget http://pypi.python.org/packages/2.6/s/setuptools/setuptools-0.6c9-py2.6.egg
sh setuptools-0.6c9-py2.6.egg


Step 12: And finally we make a symlink for our shared library

cd /opt/python2.6/lib/python2.6/config
ln -s ../../libpython2.6.so .


Now you can use easy_install for grabbing things like numpy for your shiny new Python 2.6.2 =)

The next article will be about getting virtualenv setup and running. That one should be fairly universal for most distributions. Then later we'll be looking at building BLAS, ATLAS, FFTW and friends from source so they take advantage of our specific hardware. =)

Friday, August 28, 2009

It's Been a While

Indeed it has. So much has happened within the past month or so. Mom and Lowell came to visit. Benedikt our German intern moved in downstairs. My son Ben has grown a lot, holding his head up, smiling, etc. We even took him to Sears for a photo session. He was such a ham. I'll get some of the photos up sometime. I got offered a cool opportunity at work to present a scientific paper in November. Becky, Ben and I went to Anchorage for her cousins wedding. We shopped a lot, I had Arby's =), and we met up with a friend of hers. Yeah a lot has been going on.

I've been spending most of my time working on the science project. I was told I'm the only person at the facility that could possibly pull it off so naturally I accepted. The appeal to my ego worked it seems and now i'm spending many late nights in the office cranking out code and building a number crunching machine. That, actually, has been a real pain in the but. It's an 8-core xeon rig, with 12GB ram, and about 10TB storage. I've been having networking issues that after about 5 full days and extremely late nights of troubleshooting ended up being that it was plugged into a network switch that was failing. Good going linksys. Your $20 switch cost us about $1000+ in man-hours. Stupid.

Over the past month I've been coding a lot in python. It rocks my face off so hard I can't begin to describe. Part of my project involved doing a baseline set of image processing. I had the majority of the code completed in about two days because python handled a lot of the tedious stupid stuff like file management, memory management, and options parsing. I spent the next few days learning about the multiprocessing library so i could fork the number crunching software to multiple cpus. I only had 70 images to process for this round, but it took a whole 13 hours because i only had 2 cpus on my desktop. With my new server I can fork them to 8 cpus running about the same speed. Essentially it will be a switch from having a cpu limited process, to a throughput limited process. Each image is about 1GB, and I can only push data around from the hdd's so fast.

Anyways I should get going for now.

Laters

Tuesday, July 14, 2009

Ok, so I've toyed with the absolute minimal Arduino I could figure, see: http://itp.nyu.edu/physcomp/Tutorials/ArduinoBreadboard



I've drawn the electrical schematic (also with the corresponding Arduino pins from Arduino.cc):




Now for the best part - I priced the components (including a DIP socket for the ATMega8) from Jameco.com it comes out to $5.73! (8 pennies less if you don't care to have the power LED)

From what I can gather, it has no serial I/O, so complex sensors are out, but for simple read a sensor, take an action it doesn't get any better than this!

I'm hoping that it'll be as simple as swapping out the ATMega chips on an existing Arduino to burn the bootloader, then download your program. Then simply put in the ATMega chip and power up. Not 100% sure, I'll have to check the bootloader stuff on Arduino.cc


The best thing here is you won't have to waste your $30 Arduino for simple stuff!

Friday, July 10, 2009

Python - Recursively Zip Directories (extended)

This looks pretty useful, especially for work since we rip through hundreds of files for zipping and unzipping.

The idea and snippet are from Corey Goldberg's post sharing the work he did to improve a bit of recursive zipping code. I extended what he made to include command line options and some usage help, complete with lazy loading in case somebody wants to use it as a library later. Just wanted to share and record for my own purposes.


#!/usr/bin/env python

import os, zipfile

def zipper(dir, zip_file):
zip = zipfile.ZipFile(zip_file, 'w', compression=zipfile.ZIP_DEFLATED)
root_len = len(os.path.abspath(dir))
for root, dirs, files in os.walk(dir):
archive_root = os.path.abspath(root)[root_len:]
for f in files:
fullpath = os.path.join(root, f)
archive_name = os.path.join(archive_root, f)
print f
zip.write(fullpath, archive_name, zipfile.ZIP_DEFLATED)
zip.close()
return zip_file

if '__main__' == __name__:
# Late import, in case this project becomes a library, never to be run as main again
import optparse

# Populate our options, -h/--help is already there for you
usage = "usage: %prog [options]"
version="%prog 1.0"
parser = optparse.OptionParser(usage=usage, version=version)
parser.add_option("-d", "--dir", dest="inputDir", default="~/test", action="store", help="sets the input directory to something other than the default (~/test)")
parser.add_option("-f", "--file", dest="outputFile", default="~/temp/test.zip", action="store", help="sets the output zip file to something other than the default (~/temp/test.zip)")
parser.set_defaults()

# Parse the arguments (defaults to parsing sys.argv)
(options, args) = parser.parse_args()

# Here would be a good place to check what came in on the command line and
# call parser.error("Useful message") to exit if all is not well
if len(args) > 0 and (1 != options.inputDir or 1 != options.outputFile):
parser.error("Additional arguments are not supported\nYou can only change the inputDir or outputFile using the -d and -f options.\nType zippy.py -h for help.\n")


# Do the actual work
zipper(options.inputDir, options.outputFile)

Thursday, July 9, 2009

Weekend

My Arduino has arrived and I'm stoked =P Now I need to make some time to mess around with it. There are some oscilloscope projects I'm interested in fiddling with. Link Link Link

This morning I found a nifty little snippet for adding an ascii spinner to your output. So if you have a long process, which we face often here at work, you can have this displaying to let you know it's doing stuff.

And of course this Saturday is when Mom, Lowell, and my Grandparents are arriving for a week long visit =D To say we're excited is an understatement. So much to do in just a week.

Ben is looking into some local positioning systems. I don't know much about these yet so some investigation is needed. Surely there's a way to use bluetooth or rfid in a manner similar to how gps works.

Wednesday, July 8, 2009

Arduino GPS guidance

I've done a little bit of digging on GPS guidance for the Arduino, my main concern being accuracy of the unit. I've got several projects backed up in my head that involve GPS to some extent, the main project being the Lawnmowbot. But it seems that these projects are in jeopardy as I've found out that the accuracy of the GPS unit ( http://www.robotshop.us/adafruit-gps-logger-shield-kit-arduino-1.html ) is 5 to 10 meters - that's almost 33 feet! I can't mow a lawn leaving a 10 meter buffer ring around obstacles, infact for my yard that may only be one stripe down the center. So unless we can figure out some fancy workaround, the Lawnmowbot is going to have to be shelved. One idea I had is to mount two or three GPS units onto the mowbot. They'll be fixed (and known) relative to eachother, so perhaps we can come up with a method to trim down the error based on their readings and their known distances from eachother. I dunno, I'll probably have to buy one and tinker with it for a while. Worst case, I move on to the next GPS project - I'm thinking a UAV based on a R/C helicopter; 10 meters error shouldn't be detrimental for something like that :)

Monday, July 6, 2009

Arduino + Fridge + Beer = Happiness

Now this is a project worth working on =P link

this is the code from the project. there is likely some cleanup that can be done, or expansion.


/*
Purpose: Temperature Regulator for a Kegerator with LCD display.
Using a LM35 and Arduino to check temperature and display current temp to an LCD.
Also the Arduino will turn a Solid State Relay on/off within a defined temp range
-LM35 connected to 5V, Grd, Analog Pin 0
-Serial LCD connected to 5V, Grd, Digital Pin 1 (tx pin)
-SS Relay connected to Grd, Digital Pin 12
-Back Light Button connected to Digital Pin 3, Grd, 5V via 10K resistor (pin pulled HIGH in open state).

Many thanks to Brutus@ brutusweb.com and Mikal @ the Arduino forums for all the help and inspiration!
*/

#define ledPin 13 // LED connected to digital pin 13
#define lm35 0 // LM35 on Analog 0
#define blightPin 3 // Momentary switch for back light to digital pin 3
#define relayPin 7 // Relay connected to digital pin 7

unsigned long last_temperature_check_time = 0;
unsigned long last_lcd_turn_on_time = 0;

void sendlcd(byte command) //Quick function to send LCD commands.
{
Serial.print(command, BYTE);
}

void setup() // run once, when the sketch starts
{
analogReference(INTERNAL); //using internal voltage reference ~1.1v
pinMode(ledPin, OUTPUT); // sets the digital pin as output
pinMode(lm35, INPUT); // sets the analog pin as input
pinMode(blightPin, INPUT); // sets the digital pin as input
pinMode(relayPin, OUTPUT); // sets the digital pin as output
digitalWrite(ledPin, HIGH);

delay(1000);

Serial.begin(9600);
delay(1000); //Let Ports Stabilize

sendlcd(27); //Reset Command For LCD
sendlcd(122);

delay(500); //Full Reset takes a bit

sendlcd(254); //Clear and Go Home on LCD
sendlcd(1);
digitalWrite(ledPin, LOW); //turn off LED
delay(250);
}

//new loop with millis... sweet

void loop() // run till the end of days or the beer runs out...
{
unsigned long time = millis();
if (time - last_temperature_check_time > 20000) //has it been 20 seconds?
{ last_temperature_check_time = time;
digitalWrite(ledPin,HIGH); //turn on LED for running routine status

//Check Temperature routine
long temp;
long temp1;
long temp2;
long temp_x;
int lm35_val=0;

//delay(500); //Delay to allow stabilized analog read.. not needed?
lm35_val=analogRead(lm35); //read value of center leg of LM35
temp = lm35_val; //output voltage of LM35, 10mV = 1 Degree Celcius
temp1=temp/10; //creates true Celcius reading
temp2=temp%10; //modulus operation to calculate remainder for higher resolution reading

if (temp2 >= 5){
temp_x++;
}

//Send temperature to LCD routine
sendlcd(254); //Clear LCD Screen
sendlcd(1);
Serial.println("Current Temp"); //Print "Current Temp" message
Serial.print(temp1); //Print CelsuisTemperature
Serial.print("."); //Print decimal place
Serial.print(temp2); //Print "Tenths" place
sendlcd(223); //Print degree charater
Serial.print("C"); //Print "C" for Celsuis

digitalWrite(ledPin,LOW); //Turn off LED

//Turn Relay on/off routine
if ((temp1) > 7 ) //check temp is above x degrees
{
digitalWrite (relayPin, HIGH); //if temp is above x degrees turn pin "ON"
}
else if ((temp1) < last_lcd_turn_on_time =" time;"> 10000) // has it been 10 seconds?
{
sendlcd(27); //Turn back light off
sendlcd(42);
sendlcd(0);
}

}

Tuesday, June 30, 2009

On Productivity

One of my biggest problems is distraction and forgetfulness. There are so many projects and related things I want to get to that finding time to do them, heck even remembering to do them, is becoming a real challenge. Thats why when I come across good ideas for addressing this, I try to remember them.

Here is a nice collection from lifehacker for productivity

Try some of those out and let me know what you think.

Oh, and Firefox 3.5 was released =) We finally have multi-threaded Firefox =P

Now my system shouldn't hang so bad when I have 100 tabs open. Woot

More learning on the Arduino...

So I was able to control a servomotor with a potentiometer this past weekend. That was pretty cool, it was pretty much 1:1, half turn on the pot was about a half turn on the servo. I was using Analog out to control the motor, most of the tutorials I've found use PWM on a digital pin. Seems my way is easier (but I'm sure there's a reason for the PWM on digital that I have yet to discover).
Then I got the wild hair to hack an old mouse. Didn't work too well, but nothing detrimental. I cut off the PS/2 plug and stripped the wires: red, green, blue and white - notice anything missing? That's right, the black. But that's not the worst of it, the red wasn't even the power in; the blue was. green happened to be ground, red and white were send and receive. It took 5V @ 20 mA - just about the upper safe threshold for the Arduino. I wrote a program that read the red and white and sent back to the computer what it was reading to print on screen. I know something was going on because I initialized the variables to 0 but all I got on screen was:
mouseVar1 = 1
mouseVar2 = 1
mouseVar1 = 1
mouseVar2 = 1...
so it was reading something, but nothing discernible. I read online that the receive line was supposed to be a clock signal, so I'm guessing the mouse was having a hissy fit because it wasn't getting a clock in. I probably should have read a little more on the PS/2 mouse - somehow you're supposed to get an X, a Y, and 3 mouse clicks from just one line.
Next on the list, I'm going to have to buy a few MOSFETs and start learning about controlling high loads. Though here is a gripe I'm having with all of these tutorials, it's a trap I'm sure I'd fall into if I were writing them as well. It seems to me that the people writing these tutorials know the subject so well they're taking for granted that their audience knows certain things. For example, yesterday I searched between 10 and 15 tutorials for controlling DC motors with the Arduino, no two were alike when it came to the additional circuitry required to control the higher loads. That's fine, it shows the flexibility and different options. But what's not fine is not a single one explained why they chose what they did. Some used MOSFETs, others used H-bridges, some used 2 H-bridges, others used commercial motor control chips, and there were more that used off the shelf motor shields. Another example is the resistors, all the tutorials say "use xx Ohm resistor" and I'm left thinking, "Ok, no problem but... why that value?"
I'm mechanical. If I can't see it, I have a hard time figuring out how it works. A little explanation would go a long way to improving some of these tutorials.

[EDIT] Ok, so I'm learning now :P

It seems that the MOSFET is used for simple one direction high load on/off switching.
The H-bridge is for bi-direction, varying loading, and multiple high loads, and seems to be basically an array of MOSFETs.

here's a good academic link:
http://itp.nyu.edu/physcomp/Labs/DCMotorControl

Monday, June 29, 2009

Determining Multiple CPUs with Python

Just a quick entry for something i learned about that's pretty nifty. So if you wanted to take advantage of multiple cpus in python, it used to be you'd have to do a bit of OS detection first. This post has the source i repeat here:


def detectCPUs():
"""
Detects the number of CPUs on a system. Cribbed from pp.
"""
# Linux, Unix and MacOS:
if hasattr(os, "sysconf"):
if os.sysconf_names.has_key("SC_NPROCESSORS_ONLN"):
# Linux & Unix:
ncpus = os.sysconf("SC_NPROCESSORS_ONLN")
if isinstance(ncpus, int) and ncpus > 0:
return ncpus
else: # OSX:
return int(os.popen2("sysctl -n hw.ncpu")[1].read())
# Windows:
if os.environ.has_key("NUMBER_OF_PROCESSORS"):
ncpus = int(os.environ["NUMBER_OF_PROCESSORS"]);
if ncpus > 0:
return ncpus
return 1 # Default


That is a bit of a pain to remember all the time. Thankfully since Python 2.6, you can use the multiprocessing library to handle this for you. All the details of how it determines the number of cpus are now abstracted away from me. I don't really care, just do it =)


import multiprocessing
numCPUs = multiprocessing.cpu_count()


Then you can go from there. For instance, if i have 1 cpu, the program could decide to use the threading library. If i have 2+ cpus then it may benefit from using the full on multiprocessor library. Depends on your application.

Wednesday, June 24, 2009

"My" first Arduino program

Ray invited me to post on his blog to share in learning experiences and to collaborate on different projects. We both seem to be interested in learning the Arduino at the moment, so here's a bit on that, "my" first Arduino program. Not too interesting to many, but to anyone learning microcontrollers (specifically the Arduino) there might be a lesson or two to be gleaned.

I'll admit that it's not 100% mine, infact it's nearly all not mine (thus the quotes around "my"), BUT it didn't come verbatim from a tutorial (I hacked a couple tutorials to come up with it, mainly to force me not to just follow the bouncing tutorial-dot). It's a script that has chasing LEDs (Knight Rider style), and the speed which the LEDs chase is controlled directly with a potatometer (less resistance = faster chase. From 0 millisec up to 1023 millisec, just over 1 full sec in between flashes for max resistance).

The code is posted below. I would have posted pictures but my camera seems to have a crappy USB port, and won't upload pics. A moving picture would be better, but to my knowledge man has yet to invent moving pictures (or "movies" as I would like to call them).


The Schematic shown here is, if nothing else, pretty ugly. The jagged scribbles between the Arduino and the LEDs are resistors (I used 220 Ohm, for no other reason than that's about what all the tutorials use for LEDs - no idea why that specific value though). There's also an error in it, the digital pins 1-5 should be 2-6.

The first thing I realized was that pin 14 is also analog pin 0. They're one in the same, the only difference is when using it as an analog pin with "analogWrite" (or read) it's pin 0, when using it as a digital pin with "digitalWrite" (or read) it's pin 14. The second interesting thing I learned was kind of the opposite of PWM control, though it was inadvertent. I accidentially hooked up the potatometer's ground to the LED ground. When I ran the program, the potatometer controlled the brightness of the LED's rather than their speed. I was using an analog signal to control the digital outputs (in PWM, you use pulsed digital to control analog). Another interesting thing was that the Arduino was still reading the analog 0 pin (which was hooked up to nothing) so it read some random value, which just happened to give me about a half-second delay. Luckily I saw that I was hooked up incorrectly and rewired. The program ran exactly as intended. Turning the pot slowed or sped the chasing lights accordingly.

This excercise also drove home the operation of the "for" function. When the lights are chasing quickly, you don't notice, but when they're chasing slowly and you turn the pot, the way this program is structured, the lights will complete their chase before reading the new pot value to speed things up.

I was also able to notice how the "delay(x)" function delays everything - could be bad to use in certian situations when you need an immediate change or read, etc... if the sketch is in the middle of a "delay" it doesn't seem to respond to anything until it's good and ready.

Thanks for reading, hope I didn't bore you too much and maybe you learned from some of my errors.

Here's the code:


/* Variable Chasing LEDs
This adjusts the rate at which a chasing LED array operates
Circut: Potatometer is attached to analog input 0 (digital pin 14), 5 LEDs are attached to digital outputs 2 through 6 (to ground through 220 Ohm resistors).
*/

int sensorPin = 0; //initalize which pin is potentometer input
int ledPin[] = {2,3,4,5,6}; // initalize LED pin outputs
int numleds = 5; // number of LED outputs in circut
int potVal = 0; // potentometer's value (initalized @ zero)

void setup(){
//loop to initalize LED pins as outputs:
for(i=0; i
pinMode(ledPin[i], OUTPUT);}
}

void loop(){
potVal = analogRead(sensorPin); //read potentometer value

// forward chasing, delayed according to value of potentometer:
for(int i=0; i
digitalWrite(ledPin[i], HIGH);
delay(potVal);
digitalWrite(ledPin[i], LOW);
}
// now back chasing:
for(int i=numleds-1; i>=0; i--){
digitalWrite(ledPin[i], HIGH);
delay(potVal);
digitalWrite(ledPin[i], LOW);
}
}

Monday, June 22, 2009

Arduino and Contributing Author

The main intention of the blog is for it to be as much a way to share research progress as it is a way to keep in touch with friends and family. As such I want to share this space with my good friend Ben who is a fellow Casual Engineer (and who it happens my son is named after). I look forward to future posts from him =)

Ok, now an update on our Arduino progress. Ben got his hands on a Duemilanove this past week and got to monkeying with the tutorials. I have to still order mine but am reading as much as I can beforehand, not to mention daydreaming about all the projects =) MMmmmmm kegerator outfitted with sensors and digital display. It could send a tweet when the keg is running low, or maybe send a preformatted email to the local distributor to order a new one. Excellent!! (insert maniacle laugh)

Here are some of my favorite links so far:
Arduino's main site
Hacknmod
Ladyada
Sheepdog

So far I'm really liking how simple the basic software structure is.
void setup(){
setup stuff;
}

void loop(){
do stuff;
}

pretty cool. more to come later.

oh and a bit of coolness. uav with arduino =P

Solstice and Father's Day

This past weekend was pretty busy. Here in Alaska we celebrate the solstice, the longest day of the year. Fairbanks throws a huge block party and there is a midnight baseball game our local team hosts. Pretty cool.

This year we were absent from the town festivities since our friends Abby and Kyle got married on Saturday. That was a fun time with plenty of beer =P It was an outdoor wedding and wouldn't you know it we had our first big rain of the summer. But the party went on.

Sunday was also father's day =) Becky let me game all day with a few breaks to eat and open presents lol. It was nice to escape to the dungeon for a while. She rocked me with a sweet Dremel tool set!! I can't wait to start building things with it. And her parents surprised me with some desperately needed garden tools like a wheel barrow and yard rakes. It was a sweet father's day. I couldn't have been happier =)

Tuesday, June 16, 2009

Python, Arduino, and CUDA

It seems uncommon anymore to get really pumped about something. And by pumped, i mean real ultimate power pumped. It just so happens that a few things have recently got me that pumped.

1. The birth of my son. No question there and pretty self-explanatory so we'll move onto the others.
2. Python programming language. Holy heck is this a rocking language.
3. Arduino prototyping platform. Once again, rocking.
4. nVidia CUDA library. Using your video card as a math coprocessor? Awesome.

I've been programming for a little while now, mostly Matlab and Perl. Some C/C++ from classes but nothing production. It's only been recent that I've discovered Python, and quite frankly I wish I'd discovered it earlier. I'm enjoying how straightforward the syntax is and how much you can do with little coding. It's very programmer friendly. I intend to write much more about Python, especially since there is now a Python interface to nVidia's CUDA library.

The Arduino is essentially the face of physical computing. Generally speaking, it isn't a trivial thing to get your computer to interface with the real world and act upon it. There's all sorts of kits and what have you for the crummy basic stamp and related trash, but they were always extremely limiting and rather proprietary. In fact I always found those to be rather discouraging.

The Arduino, however, is open source, powerful, and very flexible. There are tons of projects on instructables involving the Arduino. There's tons of info out there where all sorts of people have fiddled with it and made really cool things. Heck here's one that has your plants twitter you when they need watering. Freaking cool. The biggest thing about what I find on instructables is how inspiring the projects are. Everyone swears by how easy the Arduino is to program. It's time to start fiddling.

And then there's nVidia's CUDA library. It essentially allows you to use your video card for matrix math operations. The one I have here at work was able to run a n-body simulation with 27,000 objects at 360 GFlops. Trust me, that's freaking insane. It also did an eigenvector decomposition of a 2048 x 2048 randomly generated matrix in 4.8ms. So yeah, if it's matrix math you need done, especially on a large matrix or system of equations, the CUDA library lets you have a supercomputer on your desktop.

Anyways I'll be writing more about these later. This is just the starting point.

Monday, June 15, 2009

Little Visitor


We had a little visitor in the house this weekend. Looks like he flew in from an open window. This is the second time we've had a bird in the house so it looks like I will need to put a screen up around the back deck. In fact, the whole deck needs some reworking, including the screen, a door, and astro turf.

There's also all this extra wood construction from when the previous owners housed their dog. They even built a ramp for him from the deck to the ground. I guess it had trouble with the stairs. So very sweet, but it has to go.

Yesterday I took the afternoon off work. Becky was thrilled and we planned on going to the movies and hanging out. After a nap of course, since we were exhausted. We wake up to hit the theater and realize it's 8pm lol. Of course the sun is up all day long now, so it doesn't feel like 8pm. Guess we needed to catch up on our sleep =P I ran out the blockbuster and rented some movies and got a Papa Murphy's pizza. We're planning to have a big date on the 30th though. I can't wait =)

Friday, June 12, 2009

Friday with some hockey

So today is Friday and as it turns out, it's also the NHL Stanley Cup finals. To celebrate game 7, the director of our facility is letting us out early. Out here the game will be starting at 4pm, so we're all heading out around 3-3:30. Pretty cool. It helps that she is a die hard hockey fan =P It seems many people in Fairbanks are.

I'm hoping to get quite a bit done this weekend. I really need to clean up the downstairs area at the house. It seems permanently under construction. Since my folks are coming up in a few weeks it seems better to go ahead and get some of this knocked out sooner rather than later.

There's a couple outdoor projects that need to get some traction as well. During the breakup, where all the snow and ice melt, our driveway was completely flooded. Since the drive is all gravel I've been thinking about having some more gravel dumped and spread around in an attempt to raise it. Maybe next year my little civic won't be swimming as bad.

Last weekend I tore through the backyard with the lawnmower, clearing out all the overgrowth. It seems the previous owners didn't do much in the way of yard care. It was looking like nature had reclaimed the land. The mower blasted most of the knee-high growth out so this weekend will be all about raking and preparing it for proper tilling. I just want to turn the soil over and start fresh. Heh, will need to put some before and after photos up to show the difference.

Wednesday, June 10, 2009

Begin

Hello to everyone. With all the requests for updates on Ben and life in alaska with Becky I figured it's time to try blogging. Not ready to do facebook or whatever, and this may allow for more creativity. That and some place to put the random things I get thinking about =P

Thanks, Justin, for giving some inspiration to do this. And best of luck with your move to Japan soon.