miscellaneous stuff


I think about, make, and do various things.







aluminum rubik's cube



I enjoy playing with Rubik's cubes, and after examining the internal structure I figured I could make one. With the help of a friend's machine shop, we produced a fully-functional cube from solid 6061 aluminum. Yes, I can solve it, though not with notable speed (around 1' 30"). Interestingly there are only five unique parts: eight corners, 12 edges, six two-piece face centers, and a central hub. It is basically an exact copy of the usual plastic Rubik's cube, though substantially heavier at about 500g (1.1 lb), about four times that of the real one. Its weight makes it very satisfying to play with.

The original cube. Mmm, shiny.
Since the grooves engraved into each face are hard to see, they were colored in with various colored permanent markers and cleaned up with some alcohol. It should be fairly durable, though filling it with hard colored wax, paint, or epoxy would be better.
The other three faces of the colored cube; one face had no design engraved in it and was left uncolored. Yes, it really works.
A checkerboard pattern, showing which faces oppose.
The classic 'dots' pattern.
Here it is partially disassembled to show the internal structure and constituent pieces. Note the grey arcs on the inner faces; rubbing pieces of aluminum together will leave this grey oxide crud, which only serves to further abrade the aluminum. This is one of the drawbacks of aluminum, and we would have made it out of stainless steel but for the ridiculous cost and difficulty of machining.
It is the same size as a real cube. (The cube in the photo was swag from a trade show.)





hexagonal weave



I was thinking about how to layer scales isotropically (as for scale armor or such) when I hit upon the idea of an unusual hexagonal weave. Typical rectangular weaves just use two perpendicular sets of strands woven together, so the obvious extension is to use three sets of strands offset at 60 degrees, producing a pattern with hexagons and triangles. With this pattern, though, the large hexagonal holes in constrast to the small triangular holes make for a rather porous weave.

This 'weave' is different. Instead of parallel strands being woven together, it consists of three interlocked hexagonal nets. Imagine a flat hexagonal net:

hexagonal net

Now overlay a second net:

double hexagonal net

Now interleave a third net:

hexagonal weave

Nothing terribly original, but think of it instead as a way to connect a network of three-lobed shapes together:

hexagonal net pieces

It is homogeneous and isotropic, and I imagine it would produce a dense, solid weave. One could strategically combine flexible and stiff tri-lobe pieces to create a pliable weave suitable for the originally intended scale armor, though what benefit this would have over a traditional layup is unclear. Holes would need to be covered as well, likely with hexagonal plates. Alternatively, the spoked pieces could be expanded to hexagons, thus filling the area but complicating manufacture. Ultimately I have no idea what practical purpose it might serve.

These images were generated using POV-Ray as a 2D vector renderer. SVG might produce better-quality results, but POV-Ray is easier to code by hand. The source is here.




indentation



If you have written any amount of code, you will have been hit by some part of the infamous indentation debate.

I do not care how wide your tab spacing is. If you are that oddball that likes five character tabs, so be it. I personally prefer eight, because it is a comfortable amount of spacing that makes code look neat, and I am used to looking at it.

What I do get annoyed about is the use of spaces for indentation. I see absolutely no reason not to use the actual tab character (\t, 0x09) for all indenting purposes. Spaces are to be used to align relevant statements that belong at the same tab depth. The advantage of this method is that it does not matter how wide you like your tabs. You set the tab width in your favorite editor (another common point of contention) to whatever you like, and anyone who looks at your code sets the tab width to whatever they like. No issues.

Here is an example, in the 'One True Brace' style:

int main(int argc, char **argv) { if(argc != 4) { printf("No!\n"); return 1; } if(strlen(argv[1]) > 5 && strlen(argv[2]) == 6 && atoi(argv[3]) == 100) printf("Accepted.\n"); return 0; }

You can highlight parts of it to see how the indenting is done. Tabs are used for indenting everywhere here. The if statement is long and is thus broken up into three lines, both of which are indented to the same level as the 'if' with tabs but further spaced with spaces to align with the other comparisons. If you copy this into your favorite editor and change the displayed tab width, you can see that it is properly formatted at any tab width.

Regardless of what indent style you prefer, use tabs for indenting and spaces as shown above to align code in a sensible manner. This allows everyone to have whatever size tabs they like without disrupting the formatting of the code. Those who like to mix tab and space indentation are the worst offenders. You know who you are, and now you know the right way to do it.




traffic



Traffic jams suck. Waiting for people to move at a traffic light sucks. While this can be the fault of poor roadway design and insufficient capacity, preventing the majority of traffic jams requires only that people suck less at driving.

Various instantaneous events cause traffic jams, surely, but the majority of them form gradually as people slow down unnecessarily. These actions result in a colossal mess for other people. Two major (and hopefully obvious) steps you can take to avoid this are as follows: Those two guidelines will help prevent traffic jams as well as help dissipate those already formed. While clearing up a jam might not help you get to your destination faster, it will save you and a lot of people behind you the headaches and inefficiencies of stop-and-go traffic.




poking around



Humans are curious. We like to find out about things we do not know. For a number of people, this means wandering around various places that one does not usually visit. Some silly but well-meaning people like to place obstacles to getting to such places. Of course, there is to be no such limit to natural curiosity, and perhaps you have found ways around such obstacles. Here are some ways to get started.

You come across a locked door. Usually this means that someone forgot to unlock it, as they should have. There are various ways of dealing with this. The one that often comes to mind is picking the lock. Lock picking is a useful art, but it is difficult to master and requires special tools. Modern locks used on larger installations are relatively pick-resistant by default and it takes significant practice and knowledge to defeat a lock. Often, getting around the lock is the most viable solution.

Firstly, you can go through the door. Older door latches are not card-resistant and using a cut-out card to force the bolt in is a common technique. Nobody with any sense has installed such locks within the past several decades, and most locks you are likely to come across have a small metal tab that is depressed by the latch plate and prevents the bolt from retracting, which effectively precludes carding. This is not a perfect system; the bolt can still move a little, and a lot of door frames (especially wooden ones) have enough space between the door and the frame to allow the door to open when the bolt is halfway out. If the bolt is resistant to being forced, you may try other methods.

The hinges are another obvious route of attack. Again, newer facilities have hinges that cannot be disassembled while the door is closed, but older or temporary doors are vulnerable. A metal rod might be used to push the hinge pin out of the hinge, or the hinge can be removed altogether. As before, doors with questionable hinges are rare of late and you might do well to try something else.

Double doors are particularly vulnerable because the doors often have a gap of substantial width between them. An L-shaped metal rod can be inserted into this gap to push a 'crash bar' on the other side. Suffice to say, any number of objects can be inserted in the gap and used to manipulate things on the other side.

Maybe the door is opened by a card swipe. Often, they have a magnetic door latch that consists of a strong electromagnet and a metal plate. These have the dubious property of sucking ass. While the electromagnet holds with substantial force, a strong person (or two) can sometimes simply pull the door open. If the door is held in a sturdy frame but can wiggle inward and outward, it can be resonated until the latch is defeated.

Perhaps the easiest way to open such a door is to trigger the person sensor on the other side. The sensor is there to disengage the magnet when someone shows up, to prevent such hilarity as expecting to open the door but instead walking into it. It is not very smart, and sometimes it can be convinced that a piece of paper or a stick is worth opening the door for.

A second method is to simply go around the door. Often, there is a less resistant door that leads to the same place. The goal is to look around anyway, so look elsewhere. Remember that doors are not the only openings to a room. The room has a ceiling and a floor in addition to walls. If the room has a low wall that terminates just above a drop ceiling, going over the wall may be feasible. Maybe making your way into the ceiling and out on the other side is a better route. Other areas have tunnels or raised floors. Within both are fascinating areas to explore.

It is in fact very rare that a place of interest to the casual explorer is strongly resistant to attack, especially if the facility is old. Just look around.