Wednesday, October 25, 2006

Python: Functional programming

I'm trying to get used to functional programming and I must admit, it's kinda fun!

Here's a trivial example using both generators, and built in functions to acheive the same result:

Thursday, October 05, 2006

Leslie Lamport

I just stumbled upon Leslie Lamport's website, which has electronic copies of most of his published work.

I've studied some of Lamport's work in the past (mainly in regards to Lamport Logical Clocks & totally ordered multicasting, etc) and was recently doing some digging to find out how & why he created the LaTeX extensions to TeX.

That was when I came upon his papers.. wow.

Friday, September 15, 2006

Graduate school

Katharine has submitted her final MRP to the school of graduate studies, and will do her oral defence in just under a week. Should all go well, then she'll have her MA.

This has gotten me thinking about my own future possibilites in graduate school. I have the marks, and just have to maintain my average with the requisite math courses (Calculus, Linear Algebra, Statistic) and my current courses.

I spoke with a professor with whom I'm aquainted, and I must admit that he's piqued my interest in pursuing a M.Sc at Trent.

This means that I'll have to pay higher attention to my studies, since I've (until now) been treating my B.Sc. as a terminating degree.

Wednesday, September 13, 2006

First day of class

New semester started up yesterday and I captured the telemetry of my drive. Below is a screencap from an internal application used to inspect data drom our onboard electronic recording device (nice name, eh?).

Saturday, September 09, 2006

kd-tree creation tutorial

I've started work on the walkthrough mentioned in my previous post. It doesn't touch on topics such as searches of the completed tree, but sticks to the theory behind the creation and balancing of the resulting tree.

The graphic(s) for the walkthrough were created using graphviz. I wrote a small utility module in python that is used by the tutorial to generate the images.

Friday, September 08, 2006

New school semester

Starting a new semester at school next week. Will be at school three days and at work three days, with Sunday off.

Will post more once classes have begun.



Here's a screenshot of some trip data aquired from a test device installed in my car.





I hope to post a demonstration of kd-trees using Python in the not too distant future. It should be fun.

Friday, August 11, 2006

Cisco Switch -> NIC problems

The other day I noticed terrible transfer rates between two UNIX servers at work. Both were autonegotiating to 100Mbit/full-duplex, but the switch port that the slow server was on was showing a lot of 'orange blinks'.

I figured that the switch wasn't setup for 100Mbit/full, so I sent an email to the manager of that switch and he replied that all ports were forced to 100-fd.

After googling, I came accross this table which outlines all of the possible mis-matches in switch/nic configuration that could cause duplex-mismatch and create a ton of collissions.

I forced the server's nic to 100fd and was able to transfer at 80Mb/s again.

Then I started thinking...At our remote location we were experiencing terrible transfer rates of ~200Kb/s on the Internet. I double checked, and found that the firewall's (a freebsd 6.1 machine) internal nic which is serving as an 802.1q vlan trunk had autonegotiated to 100Mb-half-duplex!

I logged into the switch at the co-location and forced all ports to 100-full then did the same with all nics on the server.

After the switch & firewall renegotiated, I was able to get 40Mb/s transfer rates through the firewall to the internal servers.

Unbelievable.

Thursday, July 13, 2006

How not to make coffee

In the past few weeks we've had a number of humourous (and dangerous!) coffee experiences such as mixing boiling water in the coffee grinder, turning the coffee maker off after the first cup, etc etc.

Here's a picture of today's coffee.

Wednesday, July 12, 2006

Online storage with Box.Net

Signed up for a free account with box.net today. You get 1GB of storage space with the limitation of 10MB files.

This size limitation on the "free" account is a little annoying, but it's easy enough to split my files first.

We'll see if I'm still using the service in a month.

Thursday, July 06, 2006

Some benchmarks

Did a few simple benchmarks on a couple of FreeBSD machines at work that are used to VPN our Hamilton & Toronto locations.

tpgvpn1:


OpenSSL 0.9.7e-p1 25 Oct 2004
built on: Wed Apr 12 10:24:56 EDT 2006
options:bn(64,32) md2(int) rc4(idx,int) des(ptr,risc1,16,long) aes(partial) blowfish(idx)
compiler: cc
available timing options: USE_TOD HZ=128 [sysconf value]
timing function used: getrusage
The 'numbers' are in 1000s of bytes per second processed.
type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes
md2 1638.20k 3516.44k 4954.45k 5548.25k 5704.30k
mdc2 5364.32k 6914.55k 7521.42k 7624.97k 7705.83k
md4 12433.45k 47035.26k 136420.21k 306165.92k 481776.95k
md5 11107.62k 38561.00k 109706.75k 210811.74k 287746.12k
hmac(md5) 14013.40k 49112.06k 131354.82k 229386.40k 291448.39k
sha1 9059.35k 25369.27k 57307.40k 88381.24k 105989.38k
rmd160 7511.49k 22129.82k 46165.80k 67428.84k 78017.10k
rc4 93653.74k 109422.32k 113919.20k 115308.83k 115680.63k
des cbc 58475.17k 61181.88k 62006.46k 62025.47k 61894.47k
des ede3 21643.57k 21967.56k 22083.05k 22130.20k 22114.93k
idea cbc 0.00 0.00 0.00 0.00 0.00
rc2 cbc 20740.90k 22695.78k 22893.82k 23239.87k 22849.82k
rc5-32/12 cbc 147578.81k 158957.43k 168257.95k 171201.41k 171239.86k
blowfish cbc 94637.96k 101551.60k 102807.14k 103450.35k 103305.91k
cast cbc 83145.40k 88404.94k 89604.76k 90079.13k 89946.25k
aes-128 cbc 62447.41k 62234.48k 64136.66k 64602.90k 63681.85k
aes-192 cbc 55820.88k 55668.59k 56812.85k 56763.62k 56988.42k
aes-256 cbc 50017.98k 50337.99k 51038.58k 50574.14k 51127.44k
sign verify sign/s verify/s
rsa 512 bits 0.0009s 0.0001s 1115.8 11984.3
rsa 1024 bits 0.0044s 0.0002s 228.6 4268.8
rsa 2048 bits 0.0265s 0.0008s 37.8 1308.3
rsa 4096 bits 0.1756s 0.0027s 5.7 368.7
sign verify sign/s verify/s
dsa 512 bits 0.0007s 0.0009s 1370.6 1118.1
dsa 1024 bits 0.0022s 0.0027s 455.8 370.8
dsa 2048 bits 0.0073s 0.0087s 137.3 114.3


core1:


OpenSSL 0.9.7e-p1 25 Oct 2004
built on: Sun May 7 03:08:51 UTC 2006
options:bn(64,32) md2(int) rc4(idx,int) des(ptr,risc1,16,long) aes(partial) blowfish(idx)
compiler: cc
available timing options: USE_TOD HZ=128 [sysconf value]
timing function used: getrusage
The 'numbers' are in 1000s of bytes per second processed.
type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes
md2 689.54k 1497.71k 2116.48k 2362.59k 2444.21k
mdc2 2582.80k 3138.69k 3315.10k 3368.65k 3376.00k
md4 5538.51k 20431.26k 66112.68k 150588.74k 239281.97k
md5 4837.07k 17335.76k 52498.88k 106514.46k 152909.54k
hmac(md5) 8870.64k 29192.61k 75483.85k 126350.29k 157551.74k
sha1 4349.97k 13238.35k 34171.43k 56445.42k 69773.18k
rmd160 4158.92k 13428.72k 33624.91k 53853.32k 65470.42k
rc4 131339.75k 149218.64k 159794.61k 162431.71k 163566.16k
des cbc 29754.63k 30797.61k 31205.75k 31267.00k 31324.31k
des ede3 10977.26k 11112.41k 11175.22k 11194.61k 11194.92k
idea cbc 0.00 0.00 0.00 0.00 0.00
rc2 cbc 11394.78k 11796.30k 11897.23k 11932.45k 11929.00k
rc5-32/12 cbc 82203.59k 94505.04k 100379.68k 101657.50k 102098.28k
blowfish cbc 45409.02k 48400.70k 49780.22k 50007.64k 50007.22k
cast cbc 44914.14k 47809.21k 49023.44k 49306.77k 49333.89k
aes-128 cbc 30723.93k 31820.69k 32113.55k 32244.90k 32282.16k
aes-192 cbc 26401.29k 27386.46k 27623.19k 27743.82k 27753.52k
aes-256 cbc 23762.41k 24460.65k 24633.90k 24730.52k 24737.95k
sign verify sign/s verify/s
rsa 512 bits 0.0012s 0.0001s 856.6 8413.9
rsa 1024 bits 0.0053s 0.0003s 188.3 3317.8
rsa 2048 bits 0.0305s 0.0009s 32.8 1069.9
rsa 4096 bits 0.1997s 0.0031s 5.0 320.0
sign verify sign/s verify/s
dsa 512 bits 0.0009s 0.0011s 1095.4 921.7
dsa 1024 bits 0.0026s 0.0031s 390.3 321.2
dsa 2048 bits 0.0084s 0.0103s 119.4 96.9

And now for the bandwidth:

[peterb@tpgvpn1] netperf> /usr/local/netperf/netperf -H 204.15.193.30 12865
TCP STREAM TEST to 204.15.193.30
Recv Send Send
Socket Socket Message Elapsed
Size Size Size Time Throughput
bytes bytes bytes secs. 10^6bits/sec

65536 32768 32768 10.04 5.75

Wednesday, July 05, 2006

Been offline for some time

Just writing to say that I haven't abandoned this blog. Just with work full time, and family full time, I haven't found the time (or motivation?) to sit down and write anything of substance or worth in a while. Here's a quick list of things that have happened in the past few months:
  • Winnifred started pre-school
  • Started work full-time
  • ...
  • That's about it
Well, the list is rather small and not very impressive, but its contents have been keeping me very busy!

Thursday, April 27, 2006

A finish to exams

Just finished my last exam. Now I just have to finish writing a report on AFS and my semester is complete.

I've backed up all of my unix/netware files to my new flash disk (1gig) that I bought last night along with a new laser printer (brother hl-2040) for Katharine. We've been without a printer for ~6months, and it's been a real pain in the neck. After being able to print out all of my course notes to study with last night, I was regretting having put off the printer purchase for so long.

If anyone is in the market, I highly recomend getting a monochrome laser. The quality is beautiful, and how often are you really printing colour?

Wednesday, April 26, 2006

Davis' Computer is Vegetarian

I recently did a 'w' command on a shell server to see who was online, and my friend's remote hostname came up as: "CPEbadbadbeeeef...".

Now, that hostname belongs to Rogers internet, and they (appear to) use a combination of strings and hex values to denote their customers' address.

I just find this (arbitrary) address funny.

Note: http://en.wikipedia.org/wiki/0xdeadbeef is a funny little bit of trivia

Wednesday, April 12, 2006

Messy Girls

Since Fin is tube-fed, she hasn't really developed much of an appetite, but she still likes to get messy with the rest of us during meals.

Attached are a few pictures of her eating palenta & pesto.

Oh, and Fin's learning to crawl:

Friday, April 07, 2006

Personal Web News Aggregator

I've just written a little python programme to pull a number of news xml files, and present them on my website for viewing.

It by no means compares with certain browser based news aggregators, but there are times when I'm at a computer that cannot run such aggregators, so it's nice to be able to simply go to my website and view them there.

There's also a link at the bottom my news page to the script's source code.

Tuesday, April 04, 2006

Deletion in RET Gene / Fin's Gear

Today the geneticist called with results from her DNA tests which confirmed the suspicion that her RET gene was "garbled" in some manner. Our next step is for Katharine & I to get tested to determine if we're carriers of the faulty gene, or if Fin developed the gene deformity all on her own.

It really doesn't make a difference to us, but it helps the greater research in Hirschprung's & genome mapping.



I've decided to post a couple of pictures of Fin and her gear for a few people who've shown interest in what kind of gear she sports.

Fin's Ostomy:



Fin's G-Tube (her feeding tube):



Fin all dressed:



Just Fin:

Dinner

On Friday we had a friend over for a nice light dinner. Now that it's spring time, we decided that a lighter dinner was in order (plus, it leaves more room for desert!).

Stephanie is always a good person to have over because she never gives any of our vegan recipes a funny look.

I think that the salad was a hit with everyone. Also, we had some neat sodas.

Friday, March 31, 2006

Down with protected class variables?

I'm not sure.

Kasia writes in her blog entry:

If a variable is not final then it should be private. If you need to make it accessible to another class and there is no accessor then you're probably not doing something right.

While true, that making fields/attributes publicly available via an interface of sorts (not "Interface in the sense of an abstract class, but just in the sense of certain known methods), and not directly from a "friend" class/function or a derived sub-class.

But, unless the compiler is doing some inlining for you, then the performance hit on making those extra accessor calls, and the extra layer of indirection seems prohibative.

But, then perhaps I'm forgetting that computers are constantly evolving and these kind of pre-conceived bottlenecks aren't actually anything to worry about.

Monday, March 27, 2006

Programming languages and their relationship styles

http://maradydd.livejournal.com/293666.html

I particularly like the comment on C:

I don't think C gets enough credit. Sure, C doesn't love you. C isn't about love--C is about thrills. C hangs around in the bad part of town. C knows all the gang signs. C has a motorcycle, and wears the leathers everywhere, and never wears a helmet, because that would mess up C's punked-out hair. C likes to give cops the finger and grin and speed away. Mention that you'd like something, and C will pretend to ignore you; the next day, C will bring you one, no questions asked, and toss it to you with a you-know-you-want-me smirk that makes your heart race. Where did C get it? "It fell off a truck," C says, putting away the boltcutters. You start to feel like C doesn't know the meaning of "private" or "protected": what C wants, C takes. This excites you. C knows how to get you anything but safety. C will give you anything but commitment

In the end, you'll leave C, not because you want something better, but because you can't handle the intensity. C says "I'm gonna live fast, die young, and leave a good-looking corpse," but you know that C can never die, not so long as C is still the fastest thing on the road.

I love this:
"You start to feel like C doesn't know the meaning of "private" or "protected": what C wants, C takes. This excites you. C knows how to get you anything but safety."


I love it!

It's very much worth the read.

Friday, March 24, 2006

C++ Exceptions: Continuance

In designing a language that supports exception handling, one must consider the aspect of continuance: where does execution resume after the exception has been raised?

I recently came upon an online conversation of Bjarne Stroustrup, in which he discusses why resumption directly after the statement that raised the exception wasn't implemented.

Basically, someone resuming from an exception handler can never be sure that the code after the point of throw was written to deal with the excecution just continuing as if nothing had happened. An exception handler cannot know how much context to "get right" before resuming. To get such code right, the writer of the throw and the writer of the catch need intimate knowledge of each others code and context. This creates a complicated mutual dependency that wherever it has been allowed has led to serious maintenance problems.
This is probably of very little interest to many people, but I find it rather facinating to see why certain decisions were made.