[OT] Windows registry (was: managing applications)

Ric Werme ewerme at comcast.net
Thu Jan 10 22:57:52 EST 2008


Ben Scott misread my mail and got bent outta shape:

 >On Jan 9, 2008 1:42 AM, Ric Werme <ewerme at comcast.net> wrote:
 >>>> Maybe we could keep everything in a binary database.  We'll call it a
 >>>> registry.....
 >>>
 >>>   DIE!  DIE!  DIE!  DIE!  DIE!  DI--   Er, sorry.  Reflex action.
 >>
 >> DIE is too strong a word.  Replace, simplify, constrain are far more
 >> useful.
 >

 >  The fact that Ric found a use for the registry that didn't
 >immediately break down doesn't mean it's a good idea.

I didn't say I used the Windows registry.  I said I created a new Mysql
table to hold what I wanted to pass between programs.  Naming the table
"registry" was a joke.

 >  The problems
 >with such massive, all-in-one, opaque systems are huge and many.

Of course!  That's one reason it took me over a year before it
dawned on me I could add a registry table to my weather database
or other project and it would be a small addition that interferes
with no other application and heck, not interfere with the other
tables in the database.

To be precise:

/var/lib/mysql # ls -l wx
total 29433
-rw-rw---- 1 mysql mysql     9882 2007-03-16 21:38 all_obs.frm
-rw-rw---- 1 mysql mysql     2388 2007-03-16 21:42 all_obs.MYD
-rw-rw---- 1 mysql mysql     1024 2007-04-04 23:59 all_obs.MYI
-rw-rw---- 1 mysql mysql     8994 2004-03-12 23:48 daily.frm
-rw-rw---- 1 mysql mysql   100452 2008-01-09 00:05 daily.MYD
-rw-rw---- 1 mysql mysql    13312 2008-01-09 00:05 daily.MYI
-rw-rw---- 1 mysql mysql     8618 2004-10-16 22:33 foo.frm
-rw-rw---- 1 mysql mysql       36 2004-10-16 22:34 foo.MYD
-rw-rw---- 1 mysql mysql     1024 2006-10-25 20:02 foo.MYI
-rw-rw---- 1 mysql mysql     9550 2004-03-21 11:20 raw.frm
-rw-rw---- 1 mysql mysql 27218142 2008-01-09 19:43 raw.MYD
-rw-rw---- 1 mysql mysql  2662400 2008-01-09 19:43 raw.MYI
-rw-rw---- 1 mysql mysql     9882 2006-02-26 13:54 recent.frm
-rw-rw---- 1 mysql mysql     2656 2008-01-09 19:22 recent.MYD
-rw-rw---- 1 mysql mysql     1024 2008-01-09 19:12 recent.MYI
-rw-rw---- 1 mysql mysql     8696 2004-02-15 22:25 registry.frm    <===
-rw-rw---- 1 mysql mysql     1560 2008-01-09 19:43 registry.MYD    <===
-rw-rw---- 1 mysql mysql     2048 2008-01-09 14:23 registry.MYI    <===

 >A5. Binary.

Yeah, binary mostly sucks, but I'm already using Mysql, adding a
small wart that holds data being passed around various programs
isn't going be a big problem.  One of the reasons to write the
import/export code that deals with ascii files was feel smug about
not having to really on Mysql binary files as the sole container
of the data.

 >A20. Despite the availability of fine-grain ACLs, security is a mess
 >in practice.

That's one reason I added the registry table to the project database
instead of creating a separate registry database.

Anything that can get to weather data can get to the registry, and the
project pretty much needs that.  Not an issue.

 >A21. Moving software between systems is an absolute horrid mess.

Yay Python!

 >  To address Ric's example specifically, there's absolutely nothing in
 >there that couldn't be done in a simple file.  I know there are Python
 >libraries to give access to, say, an INI file, or even simple binary
 >storage.  Putting it into the registry instead has no benefit that I
 >know of.

Putting Linux working data into a Windows registry is well, I don't know
how I'd do that.  Let alone why I would want to!

Putting Linux working data in a new table named "registry" that is part of
the application's database is a fine idea.  Being able to manipulate it
with command line commands and ascii files is just common sense.

  None.  Zero.  Zip.  Zilch.  Nada.  Goose egg.

Which is pretty much describes Ben's comprehension of my post.  I could
have called it shared data, or weather environment stuff, but kept
"registry" sort of as a joke.  Ben, I'm not really an application
programmer, but I assure you I would not design something like the
Windows registry.  However, let me reiterate that if you extract the
little best from it and just happen to be writing code that uses a database,
one can come up with very handy, simple, reliable, and fast module
that simply doesn't have most of the problems of the Windows Registry.

 >  And if Ric
 >ever wants to, say, port his code over to a different platform (maybe
 >he gets new equipment or software, whatever), he's got one more
 >problem to worry about.

It's all Python code.  Porting it to a different database or an ascii
file will be a lot less work than talking a different weather station
vendor's protocol.  Hmm.  How about a Nokia 810 with a bluetooth link
to a propellor beanie hat.  Replace the propellor with annemometer
cups and, well, whoever wears the beanie would surely have a problem!

Heck, it's not even much Python code:
tux:vantage> wc mysqlreg.py reg.py  regtest.py
  148   765  6020 mysqlreg.py     (Module that implements the registry table
                   and import/export ascii file)
  107   469  3775 reg.py          (Command line interface)
   29    84   788 regtest.py      (Nearly comprehesive test code)
  284  1318 10583 total

tux:vantage> wc daily_update.py spotupdate.py rawupdate.py curupdate.py 
webupdate.py vantage_pro.py
  207   998  7270 daily_update.py  (Runs at midnight, records the day's 
data)
   89   446  3367 spotupdate.py    (Logs the current conditions)
  126   549  4327 rawupdate.py     (Updates the every 10 minute raw table)
   39   114  1424 curupdate.py     (Enters current conditions into the 
registry)
  211  1074  8272 webupdate.py       (Creates HTML changes and gnuplot 
files)
  367  1432 13471 vantage_pro.py   (Module used to talk to the weather 
console)
 1039  4613 38131 total

See http://wermenh.com/wx/vantage_software.html for more.

    -Ric




More information about the gnhlug-discuss mailing list