Chad Perrin: SOB

22 August 2008

meter.rb uses a linear function now

Filed under: Geek — apotheon @ 01:12

In Sucks-Rules-O-Meter Value Comparison, a couple days ago, I mentioned a program I wrote that translated values collected for Sucks-Rules-O-Meters into sucks/rules quotients that are more easily compared.

Today, I refactored the program a touch and added in a linear function along with the decelerating curve function that meter.rb previously used. Now, the linear function that ranks list items from 0.00 to 10.00 is the default, and the decelerating curve from -inf (negative infinity) to 10.00 is used when you use the -t d option.

I created a test file called test.meter. It contains:

high,50,100
highest,0,100
low,100,50
lowest,100,0
middlest,50,50

The output of meter.rb test.meter using the new algorithm looks like this:

highest : 10.00
high : 7.50
middlest : 5.00
low : 2.50
lowest : 0.00

The output of meter.rb -t d test.meter looks like this:

highest : 10.00
high : 9.50
middlest : 9.00
low : 8.00
lowest : -inf

The output of meter --help looks like this:

Usage: meter [options]
    -t, --type=OUT_TYPE              Specify the type of output you want.  At
                                    this time, the only option that has been
                                    implemented is 'd', which indicates a
                                    decelerating curve function whose maximum
                                    output value is 10.00.  If the '-t' option
                                    is not specified, the default of a linear
                                    function whose output value ranges between
                                    0.00 and 10.00 is used.

The source code of the current version of the program is stored at meter.rb.txt. For more information on some of what’s in the program — in particular, what can be done with the path variable — see Sucks-Rules-O-Meter Value Comparison.

Prompted by Sterling in comments, I realized I needed to add the output of meter.rb using the new algorithm, with the Operating System Sucks-Rules-O-Meter data as input. I’m using the data from two days ago, though, because I’m too lazy to check whether the numbers have changed at all since then. So, here’s the output:

VMS : 9.96
FreeBSD : 9.72
MacOS X : 9.42
NetBSD : 8.74
OS/2 : 8.48
MVS : 7.94
Unix : 7.82
AmigaOS : 7.16
Linux : 6.50
Solaris : 5.07
OS/400 : 5.00
NetWare : 3.73
BeOS : 3.58
MacOS Classic : 1.51
OpenBSD : 1.00
Windows : 0.82

Did I forget to mention anything else?

5 Comments

  1. […] (note: There’s a newer version of the meter.rb program I use to munge Sucks-Rules-O-Meter data, which I discuss in another SOB entry titled meter.rb uses a linear function now.) […]

    Pingback by Chad Perrin: SOB » Sucks-Rules-O-Meter Value Comparison — 22 August 2008 @ 01:29

  2. So me being the lazy type, what do the specific OS results look like using the new algorithm?

    Comment by Sterling Camden — 22 August 2008 @ 02:15

  3. Sorry — shoulda included that already. I’ve added the results to the original SOB entry.

    Comment by apotheon — 22 August 2008 @ 02:32

  4. Have you considered contacting the author of the original meter with this tool?

    Comment by Joseph A Nagy Jr — 22 August 2008 @ 03:12

  5. I hadn’t really thought about it.

    Comment by apotheon — 22 August 2008 @ 03:57

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.

All original content Copyright Chad Perrin: Distributed under the terms of the Open Works License