The Safe-Cracker’s Puzzle


By Dane Mutters
2016

She is locked in a wooden safe, with the handle on the inside.
The dial on the outside spins
To the
Click
Click
Tick
Of a safe-cracker’s twitch.

His wrist is stoically poised,
The back of his hand just outside of his vision;
His fingers twist one way, as his thumb tilts to the other.
The safe clicks and ticks, but doesn’t open.

This safe is a custom build that nobody has been able to crack.
Though wooden on the outside, it is petrified to the hardness of steel.
The woman inside has a demur smile as she quickly opens the door to other pursuant safe-crackers,
Allowing them a timid peek at who lounges within,
Before slamming the door shut, again.

They are left with dreams of twinkling eyes and a sunrise behind swaying brown vines.

But for this safe-cracker, she leaves the door wide open until he approaches near.
As he smiles, she smiles and closes the door an inch.
As his footsteps echo upon the marble floor, she closes it another two.
Before he can offer his hand, the door is closed, so he walks away.
This safe-cracker is no fool.

…But after years of dreaming, he can’t resist the call of the safe that has never been cracked.
More than a Browning safe, with its floral design near its base, and proud name at its top;
Or a stoically red Amethyst safe with a single, tantalizing, golden handle;
This safe sings his praise, and promises secret riches of beating rubies, dripping pearls, and adorning diamonds.

For a long time, he stood far away, remembering the click of the closing door.
He cracked other safes in hope that they would satisfy his craving.
He walked to other cities and conquered strongboxes, stores, and banks by the power of his keen senses;
And their strongholds did nothing but adore him, swinging their hinges apart to give their treasures.
But their diamonds he dropped on the ground,
And he walked away shaking his head.
He can’t return to those places.

Why?” he thought, as the safe quietly went, “tock.”
He froze for a moment, and reached for the handle that wasn’t there.
He heard a footstep from the other side.
He pulled his hand away from the door and held his breath.
The door went “clunk”, but didn’t open.

From the other side, he heard someone slowly spinning a dial, as if listening for the right combination.

DO NOT DISABLE YOUR AD-BLOCKER!


If you’re using an ad-blocker like AdBlock Plus (you should be!), and a page tells you that you need to disable your ad-blocker to see the content, it’s time to leave that page, and not return until they change their policy. Here’s why:
 
1) The most popular ad-blockers have “whitelists” that let content providers submit their ads for screening. If their ads are respectful–don’t install malware on your computer, don’t pop-up and cover the screen, don’t play loud videos, etc.–then AdBlock Plus and similar will let you see it! There’s no excuse for not being on the whitelist.  Are you a webmaster?  Click this link.  Now, you really have no excuse.
 
2) If an ad is not on the aforementioned whitelist, it’s because it’s a truly obnoxious ad, and/or the site’s owner isn’t a responsible citizen of the Internet. It’s literally unsafe to display such ads. In addition to being REALLY ANNOYING, they can install viruses on your computer/phone/device, steal your credit card information/identity, give your personal information to dangerous people, cost you hundreds or thousands in electronics repair bills, etc. There’s no good reason for displaying such an ad.  There’s no good reason for trying to make people see such an ad.
 
3) If you boycot pages that refuse to make their ads respectful and safe, you will force web site owners to make their content respectful and safe…which they should have, to begin with. Don’t give in. Yes, that includes Forbes.com, or your favorite “reputable” web site. It’s only as reputable as its content.  Be patient, and keep your ad-blocker on.
(You should also consider installing Web of Trust.)

Anthropological Motivation For Not Fighting About Politics


For context, look up popular American news articles for March 12th, 2016.

Raja Yoga (the Hindu philosophy of using physical movement to achieve a higher spiritual state–called simply “yoga” by most westerners) seems to have arisen out of a collection of movements and postures practiced as part of human life. From bowing to a king, to taking a wide stance in preparation for delivering a sword blow, to stretching in the morning and evening to alleviate muscle and joint pain, to picking up a baby–this is a system of kinetic learning intended to explain and teach the human condition and how to function within it.

Humans are loving. Humans are powerful. Humans fight for survival, spend their days gathering resources; humans follow leaders; humans battle for control over the followers and means of acquisition. (Anyone who tells you otherwise is probably seeing you as their follower…) This method of teaching translates literally to “royal yoga”. As profound as it once was, it fails to teach apt governance or understanding in the absence of the cultural understanding that could only be truly had in the more revered and wealthy circles of the ancient world.

What would such a system look like, if it were created out of the successful strategies of governing and being governed within our own society? Are there any motions that we can still use to universally increase our usefulness and success as a part of the human meta-organism? Today, we crave a method that works for almost everyone, and mourn the absence of any such thing that can make us happy. There is currently no “one size fits most” method for anyone born after 1980, or, perhaps, before.

In politics and religion, alike, we are bereft of truly effective guidance. We celebrate the death of “storge” love while complaining about lack of agreement in public matters. (This is a contradiction.) We seek ancient wisdom that hardly translates to how to make a real living, today. We are amply taught, in school, church, home, and in casual society everything but what is known to be truly, universally effective–because nobody knows of any universally “human” means of survival that has, itself, survived the test of time.

In the last decade, much of the world has awoken to this predicament, and we are fighting each other because nobody can figure out how to make things work, again. The information age arose out from Pandora’s box, and our greatest minds have yet to tame it in a way that lets everyone live happily, who is willing to keep trying.

Or maybe that is the nature of the human condition: as the Buddhists say, “suffering exists”, and it’s up to us to figure out how to deal with that.

It is a part of human nature to fight. We committed genocide against every human species that came before us, until only Homo sapiens remained. (A chilling thought, but true, according to archeologists, evolutionary biologists, and anthropologists.) A new way of living will one day emerge out of the ashes of analog society and the minds of those who, like Homo erectus, failed to adapt (despite having a larger brain). In the mean time, let’s limit our battles to the ones that actually matter.

If an idiot or a fool gets elected president, let them show us how not to do things.

Some arguments can only be won by letting your opponent win, and then realize, on his own, that he should have been wiling to compromise (A.K.A. “adapt”). We decided in the late 40s that killing all the stupid people is wrong, so if such people end up running things, and we don’t crash and burn because of it, we will have proven that the antiquated morals of centuries past–survival of the fittest, when you boil it down enough–are truly not as good as the softer ones we revere, today.

And if letting stupid people self-actualize turns out to be a problem, we can always decide that Hitler had the right of things and commit genocide until all the stupid people are extinct, and we evolve into a species that’s better than Homo sapiens. (Personally, I don’t advocate this method.)

Seriously, folks, don’t get into physical fights over political beliefs unless you think we should silence, cage, and eventually extinct all the imbuciles–including, possibly, you.

Trump and Sanders fans, I’m looking at you.

Proverbs That Last Forever


“However, a much older Near Eastern origin is suggested by a near equivalent in the 6th century BC Proverbs of Ahiqar: ‘a sparrow in thy hand is better than a thousand sparrows flying’.”

I love finding proverbs that have somehow survived 25 centuries of linguistic translations and societal changes. Such proverbs are almost certainly somewhat accurate (in the right context), because the only way people would keep saying them for 2,500 years is if they feel like they have a decent reason to do so, themselves, and to teach their children to say them, too.

Interestingly, it’s possible that personal adherence to old texts of philosophy, poetry, mythology, scripture, and fable–stems from the same phenomena; and that, therefore, religion, philosophy, ethics, and more are a result of old thoughts being consistently seen as worthwhile enough to repeat and teach future generations to repeat.
The historic use of force to enforce adherence to ideas skews this effect, somewhat. This includes classic examples of European churches imposing laws and punishments, as well as popular non-religious philosophies making law with legislation and court cases (incl. case law), and punishing those who violate those laws. It can’t really be argued that the modern law and punishment is as brutal or authoritarian as ancient law and punishment; but when an armed person can come to your home and put you in shackles (handcuffs) for not obeying, one can neither argue that this isn’t the use of force. Sure, the methods are different, but disobeying gets you punished.
How do we decide whether and when old ideas are more/less valuable to us than new ideas? How effective have those uses of force been in making a given idea persist? Does an idea that has been appreciated (even/especially out of pure expediency) for 2.5 millennia have more (objective) believability than an idea that’s been around for 50 years? Each person chooses how to weigh these and other factors to create a personal philosophy. Then, they explain their philosophies to their children using proverbs.

Kitchen Chemistry: What are Calories, and Why Do We Eat Them?


At one time or another, we’ve all looked at a food package to determine whether a food is “healthy” or not, according to the nutritional doctrines of the day.  Often, the first (and perhaps only) thing that someone looks at on such a label is how many calories a food product contains per serving.  But what are calories?  Are they good or bad for us?

A calorie is a scientific unit of energy

What food packages label as “calories” are actually “kilocalories”, or a unit that equals 1,000 calories.  In chemistry (and other sciences), a single calorie is the amount of energy it takes to heat one milliliter of water one degree Celsius.  Wait…huh?

Momentarily setting aside the discrepancy in naming conventions, let’s paint a mental picture of what this “calorie” actually does.

Think of a centimeter.  A centimeter is about 1/3 of an inch.  Now, think of a square that’s 1cm on each side.  That’s a square centimeter because each side is equal, and all four sides are 1cm long.  To get the area of a square, you multiply the length–1cm–by the width–1cm–and get…you guessed it: 1 square centimeter (a unit of area).  Now, think of that same square and make it three-dimensional.  It’s now 1cm wide, by 1cm long, by 1cm tall.  That’s a cubic centimeter or “1cc”.  1cc equals 1 milliliter (1ml).

So, let’s take that 1ml (1cc) cube and fill it up with pure water.  Next, we’ll put a tiny amount of fuel under it and light it on fire, then wait for the temperature of the water to go up by one degree Celsius.  The moment it has done so, we put out the fire.  How much of that heat energy just went into the water?  Exactly one calorie.  How do we know?  Because by definition, 1cal is how much heat energy it takes to raise the temperature of 1ml of water by exactly 1 degree Celsius.  See?  We’ve just used a single calorie to heat water.  How scientific!

As it so happens, 1cc [1ml] of water weighs exactly one gram.  Isn’t the metric system neat?

Alright, I see that you’re wanting to know how this has anything to do with food.  The neat thing about a unit of energy (a calorie, for example) is that it doesn’t just measure heat energy.  It also measures kinetic energy, positional energy, nuclear energy, and–what we care about, right now–chemical energy.  The amount of chemical energy that our bodies can extract from a morsel of food is what is being measured and written down on the food label.  More properly, this is chemical potential energy: energy that’s stored in chemical bonds that can be re-arranged to make heat, movement, and other fun stuff happen.

Why, then, does the label use kilocalories instead of calories as its unit of measurement?  Creatures with over 15 trillion cells in our bodies, each of which need energy to survive, we need a great deal of energy to keep living.  So, any meaningful measure of nutritional energy will have to be in the thousands.  1,000 calories (“small calories”) = 1 “large calorie” or kilocalorie, which means that we don’t have to put a whole bunch of zeroes at the end of every “calories per serving” number on a cereal box.  That saves space and is easier to read.

Why do we need chemical energy to live?  Because without it, our cells would be rendered immobile–unable to respirate, unable to repair themselves, unable to move oxygen and water around, etc.  When our cells stop moving, we’re dead.  The tricky thing is that we can’t just pump heat into our bodies and have our cells magically turn that into energy; our cells are combustion reactors, not very unlike the engine of a car.

Wait, what?

Yes, you read that right.  An automobile takes chemical energy from molecules called hydrocarbons and breaks the chemical bonds to release energy.  How does a car do that?  First, it takes a bit of energy to get the process started.  This is called activation energy.  The battery sends a jolt through the system (with the help of the starter, spark plugs, etc.) that lights vaporized gasoline on fire.  That little explosion makes the pistons move, which cause the wheels to spin, and also gives parts of the engine enough kinetic energy to fill the reaction chambers with gasoline and light it on fire.  This produces a chain reaction, because each little reaction makes another reaction happen (until you break the “chain” by cutting power to the ignition process–A.K.A. “turning it off”).

Our cells do basically the same thing.  We have a chain reaction already happening inside each and every one of our cells since the moment of conception.  Our mother’s womb feeds those cells chemical energy in the form of sugar and other things–all of which are hydrocarbons–and that lets our cells keep going while having enough energy left over to make more cells.  Eventually, we get big enough to survive on our own, and voila! we are born!  Every day, we put more food into our bodies because that food is made up of hydrocarbons that our body knows how to break down.  We have enzymes, symbiotic microbes, digestive juices, and other things that let our bodies disassemble a wide variety of chemicals and turn them into the stuff that our cells run off of.

In fact, the chain reaction that keeps us alive is part of the same chain reaction that started life on this planet!  Think about that for a moment.  If, at any point between the creation of the first primitive lifeform and when we were born, that chain reaction had completely stopped, our mothers would have passed away before giving birth to us.  Isn’t that remarkable?

If cars use gasoline for fuel, what do our cells use?

Short answer: a simple sugar called glucose.  Most single-celled organisms love sugar because it’s the easiest thing to light on fire and get energy from.  In human cells, we have a little cell-within-a-cell called a mitochondria that does the hard work of lighting stuff on fire without making us explode and die.  Our cells take in glucose, burn it with oxygen, and use the energy that produces to turn a low-energy chemical (adenosine diphosphate) into a high-energy chemical (adenosine triphosphate), which then goes around and deals smaller, safer amounts of chemical energy to its “customers” in other parts of the cell.  That lets the cell move around and do its job for the rest of the body–whether that be passing around oxygen (red blood cells), killing invaders (white blood cells), contributing to larger movement (cells that are part of muscle tissue), storing energy for later (fat cells), and whatever else our bodies need to do.

The average adult requires 2,000 kilocalories of digestible chemical energy per day to avoid cell death

It’s true: if we don’t get enough calories, our cells die.  We need about 2,000,000 calories (2,000 kilocalories) per day to make sure that, at the end of the day, we still have the same number of cells that we started with.  Of course, if we spend a lot of energy on exercise, we need more than that to maintain the same number of cells; and if we don’t get much exercise, we’re spending less energy, and don’t need to eat as much chemical energy to keep us going.  If we want to lose weight, that means that we’re actively trying to make some of our excess cells die by not feeding them enough.  When cells are in distress, they release lots of chemicals that tell our brains (comprised of nerve cells) and other parts of our bodies that something is very wrong.  In other words, it hurts.  This can manifest in tiredness, moodiness, etc.  Our bodies are built to gather more energy and make more cells, not to lose energy and have cells die.

Up until the last 100 years or so, this wasn’t an issue because we didn’t have reliable food supplies, and therefore had very little capacity to overeat.  Food was too scarce, too expensive, and required us to spend a lot of energy to get it.  That kept us skinny.  Now, our food supplies are pretty awesome, and starvation is basically gone in the USA.  (Yes, it still happens, but almost never on the grand scale, which may be the most remarkable achievement in our species’ survivability, ever.)  We can now sit at a desk all day, spending almost none of our stores of chemical energy, and still have cupboards and refrigerators stocked full of food!  We eat because our bodies tell us it’s “time”, and if we get a little too much, our bodies say, “That’s great!  We won’t starve, now!”

Evolution is a little behind the times–and that’s why we get fat: our bodies are telling us to eat as much as we can so we don’t die of hunger, but we have so much food available that we can literally kill ourselves by eating too much.  From a biological standpoint, that’s a very good thing…mostly.

So, to finally answer the question in the title: we will die if we don’t get enough calories, and that’s why we eat them.  We read labels and diet because, for the first time in human history, literally billions of people have the unique problem of being so wealthy, in terms of food availability, that we can eat ourselves to death.  How many calories are too many?  That depends on your body’s size (how many cells you’re currently maintaining); the amount of chemical energy you’re spending on a daily basis (A.K.A. “exercise”); whether you want to gain weight, lose weight, or stay the same weight; and the unique quirks of your particular body’s metabolic process.  (Each person manages their chemical energy slightly differently, and as a result, some people can seem to “eat anything and stay slim”, while others can’t.)

Fun fact:The kinds of cells that die first are somewhat dependent on what you’re (not) eating.  Your brain and nerves love fat.  Your muscles love protein.  Everything loves carbohydrates (simple and complex sugars like glucose, fructose, sucrose, and starch–which is made of glucose and/or fructose).  Every diet has a trade-off.  Don’t believe anyone who tells you that a diet is risk-free.

The important thing to remember is this: (calories in) – (calories out) = (net gain or loss).  If the net gain or loss is 0, then you’ll stay the same weight.  More means you’ll gain weight, and less means you’ll lose weight.

Finally, please be aware that our bodies need things that aren’t caloric (don’t contain chemical energy that our bodies can burn) like minerals (iron, magnesium, etc.), vitamins, amino acids (what proteins are made of), and so on.  The only way you’re going to get everything you need is by consuming the right amount of calories (not too little or too much) from a wide variety of sources that also contain other stuff that you need.  If you eat nothing but starch, fat, and sugar, you’re going to get very sick, indeed.  Follow the age-old wisdom of eating a little bit of everything in moderation and not being too picky.

When It’s “Worth It”: The Ratio of Human Interaction


There’s an inherent calculation of human interaction that goes something like this:
 
(How much they improve your life) : (How much trouble a person causes you)
 
Put another way, it’s a ratio of Benefit:Cost or Happiness:Trouble.
 
Most people phrase this in an emotional context, but the meaning is ultimately the same. Personally, I find a simple mathematical ratio easier to convey than the amount of prevarication it would take to express such a thing emotionally.
 
When that ratio is consistently greater than 1:1, that’s a person who is worth “keeping”. If it’s only greater than 1:1 in some situations, then those are the only situations when it’s worth interacting with that person. When that ratio is consistently less than 1:1, it’s time to let that person go, and avoid him/her as necessary.
 
Naturally, foresight and personal preference comes into play, here. If a person is mostly troublesome, right now, but you foresee him/her being beneficial in the long term, then it might be worth keeping them around. If you’re OK with 1:1, even if it’s never greater than that, then that’s your threshold for deciding whether it’s “worth it”. Most people require a ratio much greater than 1:1 to consider it “worth it”. People with large circles of close friends that they consistently have problems with are less picky (requiring a lower lower ratio to be satisfied); whereas those who only really want to hang out with a few people who are particularly valuable to them are more picky (requiring a higher ratio to be satisfied). I’ve noticed that this level of “pickiness” directly corresponds with the amount of energy a person has for social interaction. Those who are more concerned with other things tend not to have any interest in those with less than, say, a 2:1 ratio of benefit:cost or happiness:trouble.
 
If you’re not providing at least a 1:1 ratio for someone, you’re doing it wrong. If you really want someone in your life, you need to provide them a higher ratio, and be sure that they’re doing the same for you, before committing to anything long-term.
 
Charity is an exception to this rule. (I’m using “charity” to refer to selfless love, rather than “giving money”, which, as an exclusive term, is a perversion of the original concept.) Charity is when someone offers you less than you would otherwise accept as a ratio of happiness:trouble, but you give that person your time, energy, and resources, anyway. You self-sacrifice for that person out of kindness. We can only do this to the extent that we have personal resources (time, energy, patience, emotional stability, money, etc.) to spare, and when we run low on this excess, we can no longer afford to give without receiving; otherwise, our own lives will suffer quite substantially. One only allows that for those we love most, such as family members. We give what we can, when we can, because we choose to; “obligation” is anemic to true charity, unless it’s someone we’re truly responsible for taking care of (such as an aging parent, a sibling in distress, or a child). Nevertheless, charity is what makes society worth having. We care for people who can’t give back as much as we give them, and, in turn, people do the same for us when we’re in need. Sadly, our society isn’t quite at the point when we can do this for each other very effectively (due to economics, and anger, mainly); but as we improve our way government and interpersonal interaction, this will slowly change–as it has been since the dawn of civilization.

Computing Lesson: How to backup a GPT hard drive using dd on Linux


This assumes you’ve already used “blkid”, “fdisk -l”, etc. to determine which drive is which.  All of these commands require root.

N = (number of partitions * 128) + 1024
The drive in question has 4 partitions, so N=1536
In this example, I’m using an eMMC drive: /dev/mmcblk0
Each partition appends “p<number>” after mmcblk0, such as “/dev/mmcblk0p1”
If you’re using a normal hard drive or USB drive as your source, it will show up as /dev/sd<letter><partition number>
My storage drive is mounted at /mnt/

Because one of the drives involved (storage drive) is connected via USB, it’s important to sync between transfers.  I find that using the “sync” mount option slows things down more than syncing manually.

First, backup the partition table:

dd if=/dev/mmcblk0 of=/mnt/mmcblk0.img bs=1 count=1536 && sync

(Note: the output filename is arbitrary.)

Next, back up each partition, syncing between transfers:

dd if=/dev/mmcblk0p1 of=/mnt/mmcblk0p1.img bs=4096 && sync && dd if=/dev/mmcblk0p2 of=/mnt/mmcblk0p2.img bs=4096 && sync && dd if=/dev/mmcblk0p3 of=/mnt/mmcblk0p3.img bs=4096 && sync && dd if=/dev/mmcblk0p4 of=/mnt/mmcblk0p4.img bs=4096 && sync

(Note 1: “bs=4096” sets “block size” to 4KiB, which speeds up the transfer.  Default is “bs=512”, which works, but more slowly.)

(Note 2: each “&&” tells the shell to only execute the command that comes next if the previous command worked.  This can also be accomplished with scripting, loops, etc.)

When you’re done, you should have a set of files representing the partition table and all the partitions.  They will be as big as the source data, so you may want to compress it with gzip or similar.  (This can be done with a pipe, but it might introduce a point of failure, so I don’t recommend it.)  To restore the data, first restore the partition table:

dd of=/dev/mmcblk0 if=/mnt/mmcblk0.img bs=1 count=1536 && sync && partprobe

(Note: I switched “if” with “of”, and added “&& partprobe” at the end.)

Then, restore each partition with the same command you used to create the backups, but swapping “if” and “of” after each instance of the string, “dd”:

dd of=/dev/mmcblk0p1 if=/mnt/mmcblk0p1.img bs=4096 && sync && dd of=/dev/mmcblk0p2 if=/mnt/mmcblk0p2.img bs=4096 && sync && dd of=/dev/mmcblk0p3 if=/mnt/mmcblk0p3.img bs=4096 && sync && dd of=/dev/mmcblk0p4 if=/mnt/mmcblk0p4.img bs=4096 && sync && partprobe

(Note: the “&& partprobe” at the end may not be totally necessary.  You may, however, have to reboot/replug the drives, regardless, at some point, to get the drive geometry to be properly refreshed in the OS.)

If, at any point, you run into errors, try removing “bs=4096” from each command that has it.  It will make the transfers slower, but more reliable.

Want to check the progress of a dd operation?  You can do this by sending dd the “USR1” signal.  If you have only one instance of dd going, you can simply do the following:

killall -USR1 dd

This will cause all dd commands to output–in their own terminals–their current status.  If you have multiple dd commands running, and only want to get a progress report from one of them, you can do this:

ps -A | grep dd
(Note the number to the left of the "dd" entry.)
kill -s USR1 <number>

Finally, if you want to periodically check on a dd command without having to keep typing or hitting ENTER, you can do the following.  In this example, “<command>” refers to either “kill -s USR1 <number>” or “killall -USR1 dd”.  Note that reporting progress uses more clock cycles than one would think, so it’s best to do so only once every few minutes.  This example checks once every 3 minutes.

while `true` ; do <command> ; sleep 180 ; done

(Note that the marks around “true” are backticks, not single quotes.  On a typical QWERTY keyboard, these are to the left of the “1” key, on the same button as “~”.)

You can press CTRL-C in the appropriate terminal to stop any of the above commands.

Happy computing!