more on “daemonic” programming

In the last post I alluded to trying to use a reactional programming model for distributed programs. Since it mimics network deamons – we call it demonic programming. (once thought about calling it project 666 – but not in the baptist south).

There are some security issues with such an approach, but they can be managed.
In addition to secure implementation of the deamon itself (i.e. it needs to be effectively sandboxed and not crash ungracefully) there are basically two features that ensure secure behavior.

  1. The XML document describes what the calculation does, but does not allow programming of the application. To put it simply the document can say add two numbers, but does not define what addition is.
  2. The deamon is stateless. No information is saved from invocation to invocation. In this sense, it is a purely functional approach. We’re used to this in the HTML world – Apache is a stateless program because requests arrive in arbitrary order and must be processed as they arrive. (when they are stateful – for example wordpress which is being used for this blog – the statefullness is via other parts of the code, like the database engine, and is always a potential security hole. It would be easier to break wordpress than apache).

    The system is then programmable in that it selects from a menu of defined (nominally secure) functions in some sequence. The sequence is controlled by the document, and more interestingly by the ability of the functions to proceed. So if events a,b,c are independent of each other, but even d requires the outputs of a & c, then a,b,c can occur in any order, but d must wait for a & c.

    There are some other issues involving what happens if you allow jobs to spawn multiple ones, and what happens if processors die, but I think it may be time to run a simulation.

Written by Rob in: engineering,laboratory practice,science |

Fun things with XML & Python

One of my rarer technical posts – or something to do with the day job ;-).

I realized that describing some of the ways XML can be used in the control and archiving of tasks was worth explanation. One of the really neat features of the Python language is the close integration of many of its libraries with the core functions. This is partially due to the semi-functional nature of Python where once you define an extension it acts like part of the language and partially due to the design of the language to be extended. We’ve used the XML libraries to handle input control in our structure prediction server, and to help with security by making cross site attacks and injection attacks just that much harder by translating input from the user into well formed strings of a data description language. The external user gets to describe what their job is, but not to describe how to do it.
But Wait! There’s More!
Most database engines have an XML interface, or at least can parse XML into internal tables (provided, of course, that the tables actually match the XML). This means that saving the task input and output in an XML-wrapped form allows the archiving, searching and retrieval of data. (We haven’t actually done this with the server – but it doesn’t quite get enough traffic for it to be worthwhile – but maybe for CASP9).

And with that you get!
Something we’ve been calling “demonic programming” or reactive programming. Basically if we set up a loosely coupled set of “program demons”, roughly modeled after the network demons that are helping you read this post, and use an XML document to describe the input, the kinds of calculations, and store the output and intermediate results – then we have a native form for distributed cloud computing. (Maybe Thunderstorm computing ?) We’ve tried this a bit, though it’s been hard for the students. (They see it as either too easy (wrong) or too complex and hard (wrong too)) Mayhaps its worth looking at again.

Written by Rob in: engineering,science,security |

On the tensile strength of metals

We were without power for much of last night due to a power failure due to a tree falling on the power lines. Nothing special and certainly much better than many people had from our recent storms. But it was a bit cool to see.

broken pole

broken pole

The tree landed on the wires and snapped the steel support lines. But the design of the lines allows for a lot of slack in the power, telephone and cable wires. Breaking the steel support absorbed a lot of the energy and prevented a much worse problem.

broken pole

broken pole

So by about 4 in the morning (my guess – I was asleep) it was all fixed and working. (a sincere thank you to the arborists & electricians who pulled this off).

There is a lesson in engineering that applies to this, even in software engineering. Design to handle failure gracefully.

Written by Rob in: engineering |

Even lighter shelter?

I’ve been recently, well with the onset of yet another of those millstones milestones called birthdays, been thinking about light weight shelter systems. Again. Back in the dark ages when we cooked brontosaurus burgers over our open fires I used a tarp. It was simply lighter and bigger than any alternative and until I tried it in a New England wood – where the mosquito and black fly reign – was my shelter of choice.

So when I started to backpack again – a “light weight” ;-) tent was my first choice. “light weight” seems to mean 4 lbs or more – which really is too much.

Even though I’ve since moved back down the weight scale to tarptents (great for 2) and sixmoons design Solo, I still yearn for the simplicity of a tarp. Bigger space, easier to adapt to situations, and general utility have their appeal. The bugs in Georgia just aren’t that bad (famous last words) – but I was the last one in my Northern Tier crew to get in the tents in the evening so it isn’t really a big problem. I really like the the six moon designs solo – except condensation is a bit of a problem & it is a bit small.

In the interim tarps have really changed. Gone (mostly) is the reinforced poly sheet. Which is a pity, but the siliconized nylong sheets are much lighter – even if much more expensive. They have also been engineered to have greater strength by the judicious use of seams and tie outs.

There are three alternatives I’m considering:

  1. 8×10 siliconized nylon tarp about 14-15 oz (Etowah outfitters is the least expensive ~ $90.00 & has loop tie outs rather than grommets. This is an updated version of a classic approach. Big, but light, and pitched however you want. The potential drawback is that you need to pitch it low in very inclement weather (which we do get in the south).
  2. Engineered tarp (Silwing by integral designs) slightly lighter (13-14 oz), a chunk more expensive ($135 or so) & slightly smaller footprint. Basically the non-tensioned parts of the tarp are removed resulting in a catenary cutout. Potentially very neat – but is it as adaptable as a regular tarp?  Does it pitch well enough to work in really bad weather?
  3. Pseudo-tent (Mountain laurel designs trailstar, Six Moons Gatewood cape etc). Something like the old tepee pup tents from turn of the last century (1900′s). Really looks weather-proof, but is it as adaptable as a tarp?

Time will tell.

Written by Rob in: backpacking,engineering,outdoors,science |

Fun with the ‘Flu

Flu and flu-like diseases are  rampant in good ol’ Georgia.  In addition to something like a third of my son’s schools being absent at a time, I’ve seen it in my classes, and it may become the reason for one of the few times my son’s troop cancels a trip.  ;-<  (actually x2 because it’s me with it).  It’s reduced the available adults to the bare minimum of 2 and since one of them is oscillating between good enough and awful may result in a canceled trip.  It already has subtracted several scouts from the trip between the troop meeting (tuesday) and today (friday)!

I’ve had to change my policy about absences as the students really shouldn’t go to the doctors if they have mild ‘flu.  This was an official university directive, but I would have anyway.  It’s also made me put the handouts & data files for my security course on the web.  I realized that if I make the directory have a unique yearly address (i.e. date it), then the sage of mountainview won’t cause cache confusion and allow the students an excuse to use last year’s assignments.

Written by Rob in: pedagogy,scouting |

What I did on my furlough

Since the sovereign state of Georgia (they actually passed one of those goofy 10th amendment laws – Oh for a Sherman) respects education and my university has record enrollment we professors got a furlough day. Nicely it was on labor day so I had a chance to play. Fortunately the clamps and stabilizers for my sail rig arrived from sailboats to go, so I had a chance to try them out – although in rather tepid winds.

Adjusting the sail forward, the rudder backward, and putting the leeboards about a foot back from the mast results in a very handy little boat. It readily tacks and is quite efficient. One way to measure efficiency is the difference in the angle between the course made good (where you go) and the heading (where you are aiming). The more efficient the boat, the smaller the angle, and the more closely you could tack to the wind.

sail canoe as rigged

sail canoe as rigged

How does it compare with the inflatable raft?
Well it is a little less stable feeling and has a bit more trouble with the high waves you get when some bloody dim-witted idiot tries to swamp you with his jetski or power boat than the raft. It tacks much better (though shifting the leeboards on the raft may help). It can hold two people (small canoe), as apposed to about four. It is faster in light winds, and handles variable winds quite well. It would be harder for someone who doesn’t know how to sail to learn on than the raft – so the raft would be my first choice if your skills are rusty. On the other hand you can set it up much quicker as you don’t have to inflate it. If you’ve had experience with the rope-based rudder that the old Grumman canoes had on their rig – you will find the steering oar very much easier.
Written by Rob in: engineering,outdoors |

Powered by WordPress | Aeros Theme | WordPress Themes