Feb
21
2013
0

Molecular Lego

I’ve been re-writing the graphical version of AMMP to use the Qt API.  Qt is a powerful, multiplatform framework for interface designs, which uses C++ and other vaguely modern ideas in software engineering.  AMMP is a virtual machine simulator for calculations about molecules, written in C but using an object-based design.

The original time I wrote a graphical interface, it was tightly bound to windows. This was good, as windows is a popular family of OS’es, and bad as the framework was not highly portable.  Windows also tends to be notionally compliant with POSIX, which means I had to reverse engineer the occasional POSIX API call or Clib call (toupper, read, tmpfile, strcmp just to name a few).

I’ve tried a few other API interface libraries – Gtk, FLTK, and motif.  There were always headaches involved in having an animated process in the background (to handle molecular dynamics or watching energy minimization).  I’d found solutions, but they were, to put it gently, fragile.  (there is a gtk/linux version on asterix, but it is not easy to compile or run).  Qt seems to fit the bill.

Screenshot of the new interface

Screenshot of the new interface

A screenshot of the new interface shows what can be done.  There is now a command editor – with a menu that suggests scripts for various common things.  The display window is under development, but the picture shows what it will look like (mostly).  It uses openGL and gives decent, robust performance on modern machines.

I spent part of today putting in the Povray output methods.  Since Povray is a scripting language it is both fun to write programs that write programs, and to play with alternative styles.  One that is sort of fun is to make the atoms smallish, while increasing the size of the bonds (0.3, 1.2 times vdw radii).

Mellitin (2mlt), lego style

Mellitin (2mlt), lego style

Sort of looks like I’ve snapped it together with lego, doesn’t it?

Written by Rob in: engineering, science |
Dec
10
2012
0

Low-complexity Backpacking.

I’ve begun to think about what light-weight backpacking means.  This is partially because I’ve been helping to teach scouts about it, and partially to help myself understand what is special about it.  I’ve never been an especially ultra-light sort of backpacker – usually due to what I call “leader tax”, but have used many of the techniques and equipment quite successfully.

It occurs to me that light-weight is not the issue, in reality, but that it is a by-product of a different design process. Low-complexity implies that the kinds and numbers of things you bring are small.  If you bring fewer things then you automatically have lighter weight.  (well at least if you are vaguely careful.  One dutch oven is a highly multi-purpose item, but no one would ever consider one a part of light-weight backpacking (even if they were made in titanium)).

A good example that comes to my mind is the guy I teach backpacking with to scout leaders.  He’s a great guy, but a conventional backpacker.  His tent is light, only 3 lbs or so, has 2 layers, a complex pole system and so has a raw parts count of 14-15.  While he may be able to get away with leaving a few parts  behind, most of those are critical parts.  I use a trailstar or a luna solo (depending on whether I want space or need to worry about bugs).  So my parts count, including hiking sticks, is 7-8.  Here in the southeastern United States, my critical parts count is one (the tarp) as everything else can be improvised.  He carries very light weight camp shoes. I just loosen my hiking boots.  He has a neat stacking plastic bowl and lightweight cutlery.  I use the same titanium pot and plastic spoon to cook and eat. He has a crazy creek chair for his pad (2 parts). I have a small pad from my pack (1 part).  However we both carry very similar first aid kits because it’s hard to skimp on those.

The point behind this is that we’re both very comfortable in the woods.  I just bring fewer things, and therefore carry less, have a lighter footprint, and have fewer things to lose.

Written by Rob in: backpacking, engineering, outdoors, scouting |
Nov
25
2012
0

Preliminary Experiments with a Vapor Barrier

I was recently reading about vapour barriers (Andrew Skurka’s site and Section hiker). It sounded impressive.  The gear is not very expensive from Stevenson’s Warmlite (possibly the only R-rated outdoor gear catalogue in the world), so I ordered a shirt, gloves and socks. I’m nominally an XL, but L would probably fit better.

It wasn’t that cold over the weekend with temperatures into the low thirties, but I gave it a try. What seems to work is a wicking shirt like a polypro top, followed by a vapour barrier layer and then insulation.  It was surprisingly warm with even a thin outer layer.  Stevenson’s says it adds 15 degrees F when sealed up, and this seems realistic.

This got me thinking about cheaper ways to test out vapour barriers – I could have just worn my frogg toggs underneath and seen how that worked.  But then what would I have done for rain (if it rained?). I’m tempted to try using a bivy sack inside of a sleeping bag (well sleeping quilt) to see if that works before finding a real vapor barrier liner.

Written by Rob in: backpacking, engineering, gear lists, outdoors |
Aug
07
2012
0

Designing for Catastrophe

GSU’s internet went down today. Actually the internet-based phone system reached critical numbers of restarts and took down the rest of the network. It was basically a self-inflicted resource denial attack.

In essence, if too many of the phones request a new IP address at once, the delay on the response from the DHCP server takes longer than the time that the phone waits for its IP address. (It is a little more complex than this as the phones also download their system software so the process takes a “measurable” interval.) So the phone stops listening and eventually issues a new request. Which of course, reinitialises the process. If the request does not get addressed in time it issues another request, after a “random” delay. So the whole thing snowballs out of control and soon the network is full of nothing else than DHCP requests and invalid responses.

It would not make sense to size the network and phone-DHCP server for maximum possible load. (although maybe a bigger size might make sense). The capacity would not be needed 99.999% of the time – which is a huge waste of resources.

It uses a stochastic algorithm that works well when the load is moderate and which fails catastrophically above a critical threshold. Is there a way to cross over to a more deterministic algorithm when it would be needed? (Right now they more or less manually reset parts of the network).

A simple solution would be a gated network of physically distinct subnets, where each sub-net was smaller than the maximum capacity of the DHCP server. Then using a deterministic switch between each sub-net would let the the sub-net’s recover, while limiting the damage. This description is a bit simplistic but could work. This is somewhat similar in spirit to “token-ring”, but for DHCP only.

Another simple solution would be to use a different physical layer for the phones and the data. This would work, but defeats the economic advantage of the internet phones. On the other hand, it would preserve the integrity of the data network – which is sort of important when the students are registering online for their courses and faculty are trying to write grant proposals. (but then that’s another cost center).

Edit:
Apparently the crash was caused by “water damage”.

There is a software-only solution though. The central server should monitor the depth of its queue of unresolved requests. When this gets too large, it should issue “shutup” messages to the clients, reset the queue to zero, and then systematically (in O(n)) check and restart as needed. While this may take longer for total reset, it is bounded and more importantly will not shut the network down.

Written by Rob in: engineering, rant, security |
Jul
20
2012
0

More Experiments on HDR, Filters and Polarization

Digital SLR bodies have reached that magic point where the quality of the image is limited by the lenses and where the price, although high, is not out of reach for a non-professional. This re-opens the option of using filters and lenses in a much more controlled manner – something that even with kits like the CHDK is very difficult. It is always better to optimise and control the signal rather than to try to reconstruct from flawed data.

The next few photos show some preliminary experiments and comparisons using the in-camera HDR on a Nikon D5100 with polariser and various coloured filters.

Polariser vs. Polariser with HDR on Landscapes

Polarizer Alone

Polarizer Alone


The polariser on its own brings out the clouds, but compared with polariser/HDR the level of detail and drama is weak.
Polarizer and HDR

Polarizer and HDR

Using both the polariser and HDR give the best results for landscapes.

Polariser vs. Polariser with HDR when there is less contrast

Buddleia

Buddleia

This photo of a Buddleia flower shows (in the original) good detail and contrast.

Buddleia with Polariser and HDR

Buddleia with Polariser and HDR

HDR tends to wash out the image when it doesn’t have a lot of contrast to start with.

Getting Good Black and White Images.

Back in the day one trick to get high quality black and white images was to use a coloured filter with the film and emphasise the red/yellow colours with respect to the blues.

Something similar can be done. The D5100 will convert from colour to “monochrome” and thus produce reasonable images.

Red Original

Red Original


The red filter produces a bizarre image.

Converting to black and white brings out the clouds but loses the details.

Red Converted to B&W

Red Converted to B&W

The details are still lost, even when correcting for the highlights with the Gimp. (the correction is simply to adjust the histogram of density values so that it fills the whole range, the black and white generated by the camera from this image does not produce white for the brightest pixels)

Original contrast corrected

Original contrast corrected

Yellow preserves more colour information.

Yellow Filter

Yellow Filter

[caption id="attachment_679" align="aligncenter" width="480" caption="Yellow Converted to B&W"]Yellow Converted to B&W[/caption]

However converting from yellow to black and white leaves a lot to be desired as well. (This looks a bit like old-fashioned Infrared film)

Using HDR with a yellow filter recovers features in the sky.

Yellow with HDR

Yellow with HDR

These features are preserved in the black and white image.

Yellow with HDR converted to B&W

Yellow with HDR converted to B&W


The yellow/b&w is not quite as contrasty as the red/b&w so this is a matter of taste.

Red with HDR

Red with HDR

HDR with the red filter is interesting.

Red with HDR converted to B&W

Red with HDR converted to B&W

The HDR/Red gives good results. Especially after correcting the highlights with the Gimp

Contrast corrected Red/HDR

Contrast corrected Red/HDR

Written by Rob in: engineering, outdoors |
Apr
08
2012
0

Quick and Dirty Grill

We’ve been helping my father move into “independent living”, which is a bit fun.

The last full night at his house, before the movers came to pack, we thought we’d cook a nice meal. Of course there was not exactly much in the way of barbecuing/grilling equipment. So true to form, we improvised.

We bought a disposable aluminum backing tray and folded the rims up on the long sides. Then ran some skewers through to form a grill. In leave no trace fashion we put the thing on a pair of clay plant pots (bricks or sterile soil would work too), and light a fire. Once the coals were lit, we replaced the skewers and started to grill.

The grill after lighting the coals and before adding the steaks

The total weight of this contraption is quite small, and it would work as a back-country grill for fish or similar things. Even buying everything new, the total cost is about $5, which is much lower than similar “backpacking” grills I’ve seen advertised.  The pan is re-usable and will fold (carefully) to fit into a pack.
cooking the steaks

And the steaks were good.

Written by Rob in: engineering, outdoors, scouting |
Dec
25
2011
2

Back to the future?

I’ve had a chance to play with a scanner – to save some of our old slides and negatives so that they can survive the digital transition.

The Epson v600 photo scanner is supported under Linux and the drivers/programs load easily.  I found xsane to be easier to use that the Image scan program that comes with the drivers, but that is a matter of personal choice.

What is fascinating is the quality of the scanning.  Color slides worked reasonably well, but the quality of the black and white was impressive (even as a 256 level scan). Almost makes it worth using film again.

our dog in the 1970s

our dog in the 1970s

Since I write about outdoor gear more than a little bit, this shows what it looked like in the 1970’s.

my 1970's pack on a rock

my 1970's pack on a rock


This picture of one or my friends on a spring break scout trip (sort of what venturers do today) shows what we looked like.

Hiking in the not so distant past.

Hiking in the not so distant past.


We did about 50 miles in a week (Penmar to Mt Holly Springs). Less than I’d do today, but not bad given the gear and our experience. None of the packs were the huge conventional “backpacking packs”, and we were glad of the shelters as it snowed. (you can pack 10 people into an “5 person” shelter).

Oct
24
2011
3

Gas Downdraft Stove (mod 1)

Gas downdraft stoves are an interesting backpacking tool.  So I thought I’d make one and try it out.  It has passed the “driveway tests” with flying colors.  The design is derived from plans available from section hiker so I will mostly describe the differences.

The major difference is that I used one large piece of hardware cloth and four #6 bolts with standard washers, lock washers and nuts.  Two of the bolts hold the hardware cloth wrapping together and the other pair of bolts stabilizes the alignment between the can and the hardware cloth (keeping it all square).   I found that the fancy t-washers were largely a waste of money and didn’t help with either assembly or stability.

Schematic drawing of stove

Schematic drawing of stove

This made the manufacturing process easier and makes the stove cooler to handle as the hardware cloth is removed from the side of the can. The total weight after burn in is 101 grams, so this is not a large weight penalty.

To use the stove, fill with short pieces of wood laid sideways (some designs place them up and down, which didn’t work quite as well). The wood should not be much larger than a pencil. I was able to use pine straw and small tinder to start it (pile on top and let it burn down). Once it is going the nearly colorless flames extend quite high.

The working stove

The working stove

It is hot, burns for about 10-15 minutes and I think will work. I’m more optimistic about this than ethanol stoves.  (it is also approved in the “guide to safe scouting” as it isn’t a home made liquid fuel stove)

Written by Rob in: backpacking, engineering, gear lists, outdoors |
Oct
21
2011
0

Change your router password

I just read about a rather neat attack on routers – both wireless and wired ones.  Since you can supply a login id and password to an html query (http://user:password@site), it is not hard to have a script running locally on your machine that would log into a router set with default values and have it configure the router in an insecure manner.  In essence, a web page could set up the router to be remotely configured and thereby be vulnerable to all sorts of nasty fun things (how about a special firmware upgrade that makes it into a malware server or phishing workstation?).

The simplest solution to this is to change the password from the default.  It helps if you can change the account name, and if you use a different local network as well.

Cute, isn’t it?

Written by Rob in: engineering, security |
Oct
21
2011
0

The Wierdest Hardware Bug

Just a quick post, but one of the machines I built at home would crash in a somewhat random manner with the display locking up.  Sometimes several times in a row, but with no obvious pattern of cause and effect.  It did seem to be connected with the graphics system, so I was wondering about a new card, but hadn’t gotten around to fixing that.

Anyway I had a chance to replace the ancient CRT monitor (vintage 1995) with a new LCD one due to a house move.  Suddenly the machine is stable.   Apparently the monitor was creating voltage spikes or electronic noise which was upsetting the computer.  (They shared a common surge suppressor/line noise eliminator, but that wouldn’t have stopped what was in essence a ground loop).

So changing the monitor fixed the problem.  Go figure.

Written by Rob in: engineering |

Powered by WordPress | Aeros Theme | TheBuckmaker.com WordPress Themes