adamtj's comments

adamtj | 5 years ago | on: Open IP over VHF/UHF

It is allowed to used an encrypted connection to administer a remote repeater, like for amateur satellites. Only the control link may be encrypted. The repeated signals may not, just like any other amateur transmissions.

adamtj | 5 years ago | on: Open IP over VHF/UHF

Radio spectrum is a limited and shared resource. It makes sense that it's licensed and regulated. But compared to other parts of the spectrum, the license is cheap and easy to get and the regulations are minimal. It's a public space for experimentation. If you don't want to be seen in public, go to some other area of the spectrum.

adamtj | 6 years ago | on: Ending the Era of the U.S. Survey Foot

That's not hard to imagine. Quick, what's 1/3 of a meter? The sometimes problem with metric is it's base-10. The prime factors of 10 are 2 and 5. Feet are in base-12, which has the prime factors 2 and 3. Three is much more useful than five. There are marks on your measuring tape at exactly 1/3 of a yard or 1/3 of a foot.

Metric is often easier and more convenient, but not always. So, in the US, we tend to use metric or customary units depending on which is more convenient for the task at hand. Actually, it's a lot like the UK and other countries where older systems still exist alongside metric. The difference with the US is that we don't have as many unnecessary laws mandating metric. You're an adult. You're working with other adults. You're perfectly capable of figuring out what to do without the input of lifelong politicians who've never measured a thing in their lives. Except for the amount of your money that they're going to spend. They like measuring that.

adamtj | 7 years ago | on: Judge says ‘literal but nonsensical’ Google translation isn’t consent for search

I believe you are under a mistaken assumption. It's never ok to kill the suspect. Still, one can be justified in using lethal force. It's a very subtle distinction. You never shoot to kill. That's simply murder. You shoot to stop the attack -- even if that's very likely to result in the death of the person you're shooting at. It can be justifiable to shoot somebody running at you with a deadly weapon. Shutting down the circulation is a fairly quick and reliable way to stop somebody from taking actions that threaten your life. But, once they stop running at you and crumple to the ground, you have to stop shooting. If you continue shooting, that's murder. If somebody turns to run, a civilian must stop shooting or it's murder. (In certain circumstances, the police can and should continue shooting.) Again, it's subtle.

So, it's not ok to intentionally kill the suspect, but it can be ok to use deadly force. I'll assume you're really asking why deadly force might be acceptable. A pipe in the hand is a lethal weapon. If a police officer is duty-bound to apprehend a person who is using lethal force against him, it would be insane to use anything less than lethal force in response. If an officer attempts to use less effective non-lethal means, but fails and is killed, then he is not only dead, but also has failed in his duty to protect the public just as if he had run away.

It's important to remember that these situations can happen extremely fast, under enormous stress. A routine encounter can turn deadly serious in a fraction of a second. The whole thing can be over in under three seconds. There is no time to think or reason. To think is to hesitate, and to hesitate is to die. You must have a trained reflex: if they use deadly force, then I shoot at center-of-mass. Seeing a pipe in the hand of an approaching person might be the trigger for that reflex. It's not quite so simple, though. It's best to prime the reflex by thinking it through before-hand. Police officers must constantly maintain situational awareness, thinking through possible scenarios and priming their reflexes based on who is around and how they're acting. It's a very difficult and dangerous job.

adamtj | 7 years ago | on: Judge says ‘literal but nonsensical’ Google translation isn’t consent for search

Are the police not able to run away? No, not really. To threaten somebody with deadly force is a felony. You or I would have a duty to run away if possible. A police officer has a duty to apprehend the suspect. What if the officers ran away and their assailant went on to assault and kill others?

As for how much risk a blunt weapon poses, a pipe can easily cave in a person's skull with a single blow. Successfully blocking the strike could result in a compound fracture of the forearm ... and then a caved-in skull. Broken ribs can cause punctured lungs and death from a pneumothorax. And it can all happen in a fraction of a second.

Real life violence is not a dance, like those long drawn-out fight scenes in movies. It's not about throwing punches and inflicting pain until somebody gives up. It's about breaking bodies so thoroughly that it's irrelevant whether the other person wants to give up or not. It's sudden, fast, confusing, brutal, and often horrific. The survivors of real world violence often come away knowing the smell of brains or freshly spilled bowels.

Before second guessing the police, it's important to know just what they really face. Read some books on real life violence. It's sobering. Rory Miller is a good place to start.

adamtj | 8 years ago | on: Strava heatmap can be used to locate military bases

Websites are like salespeople and the police: they can and will use your data against you.

The first time I was told about Strava, I immediately dismissed it as useless. (After all, what service could they possibly provide when I'm unwilling to tell them precisely where I go to work out?) I almost gave a quizzical look to my conversation partner, but that would have given him more insight into my thoughts than I cared to share, so I surpressed the expression.

adamtj | 10 years ago | on: Going Fast Slowly

I'm told that the US military uses the phrase "Slow is smooth, smooth is fast."

adamtj | 10 years ago | on: Speed as a Habit

If you are unprepared for a meeting, who's fault is that?

There are different kinds of meetings. You need know what kind one is before you agree to attend. If it's a decision meeting, then you need to do your silent reflection before it begins.

adamtj | 10 years ago | on: Python string formatting and UTF-8 problems workaround

The fix isn't quite right. It may technically produce correct output now, but it's sloppy. The sloppy code is brittle and dangerous and perfect food for bugs, but that's a minor problem. After all, a single mistake or a small bit of sloppy code can only cause a few bugs at most. The major problem is that the sloppiness indicates a possible lack of understanding. A misunderstanding can continue to produce bugs and brittle code indefinitely. Misunderstandings are the devil!

The symptom is that the .encode() comes too early. The general principle is to .decode() as early as possible and to .encode() as late as possible. The results of .encode() should be as temporary as possible -- preferably never even assigned to a variable.

Seeing the encode in the wrong place leads me to suspect that the author is confusing byte arrays and strings. These are two distinct things, but most documentation makes that distinction clear as mud.

The key thing to realize is that strings are not bytes, and bytes are neither characters nor strings. Think of strings as abstract data structures, like hash tables or linked lists. Bytes are binary integers. On the surface, byte arrays are integer arrays, not strings nor hash tables nor lists of objects.

Programs interface with the world via bytes. Files are bytes. The ntetwork is bytes. Everything is bytes. Bytes are not strings. A byte is an 8-bit integer. When you do I/O and get bytes from the world, you must deserialize them into whatever abstract data structure they represent. Ignore the C language and it's misnamed "char" type. A string is an abstract data structure, as is a hash table, or a list. In some sense even binary integers are abstract data structures that need to be serialized. String serializations are called "encodings". Binary integers are serialized by choosing a byte order (big or little endian). There are various standard ways to serialize hash tables and lists, like json, various XML formats, python's "pickle" and "shelve", etc.

When you get bytes from the network or a file and those bytes are supposed to represent a string, you must deserialize the bytes into a string object. This is called decoding. Often you're using a web framework or other library that does this for you. Python 3's file objects do it. If it's not done automatically, then you must do it yourself. You or your framework should decode bytes into a unicode string object as soon as possible. You should do this everywhere that you do input, and then leave your strings as strings for as long as possible. Do all of your operations on strings ("unicodes"), not bytes. You parse strings, join strings, replace characters in strings, trim, find lengths and match regexes on strings ("unicodes"). Doing any of those operations on byte arrays is nonsensical and will lead to bugs. Only when you have your final string completely ready to go should you worry about serializing it for printing or to write to a file or the network. Only then, at the last possible moment, should thoughts like utf-8 or ascii enter your mind.

As written, it's unclear whether "freqs" containing byte arrays or unicode strings. Getting that mixed up can result in failing to find and item which really is in the dict, or miscounting frequencies, or it can even cause more UnicodeEncode/DecodeErrors. By decoding as early as possible and encoding as late as possible, such sneaky bugs are much less likely to occur.

In Python 2, I would have fixed the problem like this:

  for e in results:
      simple_author=e['author'].split('(')[1][:-1].strip()
      if freqs.get(simple_author,0) < 1:
          print ("%(date)s -- %(author)s -- %(title)s" % {
              'date':   parse(e['published']).strftime("%Y-%m-%d"),
              'author': simple_author,
              'title':  e['title'],
          }).encode('utf-8')
You might dislike my multi-line print and would prefer to .join() a list, possibly with a temporary variable. Or, maybe you'd prefer the newer .format(). Regardless, the important point is that the .encode() should happen later than it does in the article.

adamtj | 10 years ago | on: Hackers Remotely Attack a Jeep on the Highway

Should hackers actually kill somebody, I struggle to find a reason why the relevant automotive engineers and their managers shouldn't be charged and convicted of negligent homicide, or worse. After all, somebody had to make the decision to connect a radio receiver to the CAN bus. Others are aware of the wireless and choose not to remove it.

To be a professional is to have a duty to refuse to do stupid stuff like this, even if it's legal and even if your job depends on it. But is it legal? Why would we need any new laws for this? Connecting a wireless receiver to the same network that controls a car's brakes and steering seems to me like reckless endangerment. No need to wait for innocent people to die.

If history has shown us anything, it's that we cannot rely on software to separate two systems sharing a network. Only physics can do that. If we must have wireless for entertainment, then the entertainment and vehicle control networks must be air-gapped.

This seems blindingly obvious to me. What am I missing?

adamtj | 10 years ago | on: What are Bloom filters?

Pedagogy? No, this article is written in that modern style of popular non-fiction which is meant to entertain above all other concerns, including such silly things as pedagogy, clarity, rigor, or sometimes even factual correctness.

This style is characterized by titles like "Catchy Phrase: The surprising tale of a subtitle that actually tells you what the book is about. Or does it?" "Catchy Phrase" tells the story of an single data point, or maybe three, with edge-of-your-seat tension provided by a jumbled chronology. It opens a generation before the main data point was born, then skips to the present day, before jumping into the middle of a tangential story. Then it's back to where we left the origin story of the data point, but this time we're in a different location looking at the second data point. Next comes some speculation about a possible rosy future and maybe a motivating example. Next we end the tangential story, which introduces the third data point, at it's funeral. The tangential story begins. As you read, you can see a complex theme slowly but deftly woven from the timelines of the several stories. It's a pattern that a knitter might call "felt". You can't help but be drawn in. It's so fascinating and intricate that you, like the author, sometimes have trouble distinguishing cause from effect, which adds an alluring air of mystery. The ideas must be Important. Despite the complexity, in the end the conclusions seem simple and obvious. You feel smart. You go to a dinner party and gush about it to your friends. They wake up the next day and, despite one-too-many cocktails, find that they remember the title of "Catchy Phrase". They look it up, and One-Click (tm) later, the life cycle is complete.

You aren't the audience, you're the vector.

adamtj | 10 years ago | on: De-Obfuscating the Statistics of Mass Shootings

Intentionally or not, the author has cherry-picked the data in a way that completely undermines the article. The conclusion that "lives are at stake" is obviously true and supported by the data, but the implication that the US has too many guns is not. An analysis is only as accurate as the data. Here, the missing data makes it painfully obvious that, while we should whatever we can to reduce gun violence, we cannot morally accomplish it by disarming US citizens.

If you merely look back to about 1939, you would find numbers for Poland alone that dwarf any statistics for the US, even ignoring differences in population! Poland isn't the only such example. Around that time, certain groups of people suffered from numerous horrific shootings, decimating their populations, despite those groups having been recently disarmed almost entirely. Of course, I'm being sarcastic. These people suffered at the hands of their own governments because they were disarmed, not despite it. There are some still alive who remember.

An honest assesment of history, even very recent history, makes it clear that America's current level of gun violence is a mere rounding error next to the real threat: descent into tyranny. We're lucky that we live in such a relatively peaceful time, but let us not delude ourselves. No human will ever live without the threat of tyranny. No government of the people or by the people will ever, by it's own internal guidance, remain civilized indefinitely. We must never surrender the tools needed to provide the most drastic of course corrections for a government gone astray.

We are fortunate that by keeping and maintaining arms, we make it more likely that we will never have to use them. Armed violence is always the absolute last resort, but if we give up our last resort, we give up all the other ones too. Speech, for example, is of little use against a tyrant with absolute power. But speech from the mouths of well-practiced riflemen, with their weapons close at hand? Those words cannot be safely ignored by anyone.

It is for this reason that the right to keep and bear arms is not unique to just the United States. Rather, it is a fundamental and irrevokable human right. The Constitution of the United States does not and cannot grant this right -- though it does explicitly recognize it, lest we forget.

Yes, gun violence is awful, and we should work hard to reduce it. But let us not forget that is is the price we pay for a civilized society, and it is a small price compared to the alternatives. I grow tired of articles that completely miss this point.

page 1