Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Journal of HollyKing (5210)

Tuesday October 16, 2007
04:10 PM

Fame and Riches Step 1

What is step one? Contributing to CPAN of course.

I had been thinking about writing some myself but Mark has created a fine set of programs. My only wish was to have them read the AWS parameters from a config file. So I added the ability to read the settings using Getopt::ArgvFile and sent a patch to Mark. He accepted my patch and now that he's posted his module to CPAN I have achieved the first step of my plans.

Last weekend I went away to Deer Harbor on Orcas Island. The private cottage, hot tub and view were wonderful. I took advantage of the lack of phones, television and internet access to focus on finishing Math::IntervalNumber. The code is done. The documentation has been written. I plan on polishing the test suite and releasing the module this week. That's step two.

Step three? I'm not sure. Maybe Math::SurrealNumber.

Friday June 29, 2007
02:21 PM

Better way to call fe(set|get)round?

I'm still here. Changing jobs and living locations made me put some things to the side for a while. Still a bit of shift can't keep me down.

I have a need to call fegetround() and fesetround() to control how floating point operations are rounded. I've written up what I've found and my questions in aPerlMonks post, but why not get a few more eyeballs to look at it?

Monday February 27, 2006
11:04 PM

I'm sold!

While working on Math::Interval I wrote a few tests to validate that everything was working correctly. After fixing my typos in the .t files I was delighted to discover a few errors in my code. I say I was delighted because it was much easier to track them down now than later.

As a bonus using Devel::Cover I have a nicely formatted report that shows the code that was missed by my testing so that I can add a few more tests to make sure that all code paths are correct.

Thank you everyone who wrote these modules!

Monday February 20, 2006
10:21 PM

Interval Computation Module Design


I have a need to perform some Interval Computations for one of my projects. Since I was unable to find a module on CPAN I'm going to have to write my own. I would like to upload my module to CPAN so the next lucky stiff doesn't have to repeat my effort. Having never written a module for CPAN before I wanted to get some feedback about my plans before diving too deep. I know there are many answers so I'm not looking for the one true way, but some advice from those who've gone before me.

In this context an interval is a new type of number like a complex number. They can be added, subtracted, multiplied and divided. We can define exponentation, trigonometric functions and a whole host of other functions.

For my application an interval represents a value with a known amount of error. The interval [4, 6] means that the real answer is somewhere between 4 and 6, but we don't know exactly where. Because floating point calculations aren't exact, the results of interval calculations are rounded out by rounding the lower bound down and the upper bound up to the next representable numbers. The end result gives you a lower and upper bound that contain the real answer.

Here is an example of some basic operations on the intervals x = [1, 4] and y = [9, 12]:

x + y = [1 + 9, 4 + 12] = [10, 16]

x - y = [1 - 12, 9 - 4] = [-11, 5]

x * y = [ min(1 * 4, 1 * 12, 4 * 9, 4 * 12), max(1 * 9, 1 * 12, 4 * 9, 4 * 12)] = [9, 48]

x / y = { magic Perl code involving reciprocals and checking for division by zero } = [ 1/12, 4/9 ]

First, I was thinking of calling my module Math::Interval. That name captures the purpose and isn't unweildy. Another option was Number::Interval since intervals can be a new type of number like complex numbers. If you were looking for a module to perform interval calculations where would you expect to find it?

Next, my plan is to create a class that encapsulates construction and some validation while most of the interface would be contained in functions. For example to add two intervals the user would call Math::Interval::add(iv1, iv1) which would return the result as an interval. Would it be better to put everything inside the class? I know that this would increase potential naming conflicts if people just imported the entire namespace. Code like $arg1->add($arg2) looks wrong to me.

Thanks for any pointers and suggestions!

Thursday August 18, 2005
11:45 AM

Once more into the breach...

Without warning yesterday I was fired from my job. Joy. So after 5 years I'm updating that resume and searching job sites. Unlike the last time I was looking for work my wife has a good job and we'll still have health insurance. So I've been thinking about going back to contracting.

How is the contracting market in Portland these days?

Monday July 25, 2005
03:56 PM

I'm alive!

I haven't written here in a while. I have quite the reason but let's just say that I've had a pretty crappy year so far. Things are looking up now and I'm getting excited about OSCON next week. Yay!

I hope to see some of you again and meet a lot of new people.

Tuesday May 31, 2005
11:15 AM


As the only Linux using Perl developer at my office I'm used to explaining what I do and why it's valuable to my co-workers who don't understand my job. I don't mind and I've made some real progress getting out the message. At least I thought I had...

This morning I walk in wearing my Happy Hacking t-shirt that was purchased from the FSF booth at last year's OSCON. As I was walking through the cafeteria I was greeted by someone who added, "Whoah! I wouldn't wear that shirt here. That's against corporate policy." Perplexed, I stopped and asked how my shirt violated any policy. I'm sure that you all can guess his reasons. I took a few minutes to educate him about the differences between hacking and cracking and how the word existed long before computers, then went on my merry way to work.

The reason this bothers me so much is that I work for a company in the security industry. The products we develop block virus attacks, trojans, cracking and all sorts of other nasty stuff. I would expect that people working in the realm would know something of the terminology and culture. Sigh.

Friday May 27, 2005
10:48 AM

What to do when I'm sick and can't sleep...

After lying in bed for 90 minutes last night I gave up and went to the office. Since I wasn't sleeping I decided to do something useful. I read the first few sections of The Pragmatic Programmer. I even went as far as working all the exercises in the sections I read. ;)

I'm tired as hell but I feel pretty damn good about working toward my goals.

Monday April 04, 2005
06:18 PM

undef $foo != !defined $foo

I blame a lack of sleep and caffeine.

This morning I was convinced that undef returned true if its parameter was defined. I don't have any reason or excuse, but I stared at that section of code for far too long trying to figure out why it wasn't working. Falling back to RTFM it was easy to see my mistake.


Monday March 28, 2005
02:44 PM

Pay No Attention to the Daemon Behind the Curtain

Thanks to autarch I was able to use Subversion at work to make some progress. The basic functions work and doesn't seem to leak, although this is the first Perl program I've written that runs for any length of time so I hesitate to say for sure.

Before I unleash this on the world here's an list of items to finish:

  • Create a control script that will allow the daemon to start and stop during system startup and shutdown.
  • Add the ability to run as a user/group other than root/root.
  • Write documentation. I'll freely admit this is my least favorite part, but it needs to be done .

There are quite a few more items on my todo list, but these are the ones I think should be done to create a preview release.