An Election with Real Consequences

I think Jones’ victory in Alabama will prove to be as described in the subject in this post. Presidents are term-limited, so even if he weren’t historically unpopular, Trump’s days would be numbered compared to Representatives and Senators (who can serve for decades).

The Jones victory shows that Trumpism is having increasing difficulty attracting popular support. Republicans who want to serve the long careers in Congress they envisioned are now on notice that their own self-interest may well be better served by taking a political stance that’s independent of the White House.

At the very least, the influence of fascists like Steve Bannon over the the Republicans just suffered a big setback tonight.

World Pixels: The Best Map Tiles Technique

If you go to the Open Street Map Wiki, you can find pages like this one giving helpful information about how map tiles work, and how tiles map to latitude and longitude.

But you don’t see any mention of a technique I call world pixels, an idea that woke me from a dream last night and which implementing put an end to countless headaches in getting map bounds just right.

Consider the following facts:

  • Zoom levels run from 0 through 18.
  • Each zoom level, Z, has 2Z tiles in each direction.
  • Each tile has 256 (28) pixels in each direction.
  • 18 + 8 = 26.
  • 26 ≤ 32.

Therefore, at all zoom levels, it is possible to code the (x, y) coordinates of all pixels in all tiles with two globally unique 32-bit integers. Put the tile pixel dimensions in the 8 least significant bits and the tile numbers in the next 18 most significant bits. Translate your lat/long coordinates to world pixels as early as possible in the process, and all your math then becomes integer math, which runs faster and is free from rounding errors.

Better yet, it makes zooming a breeze. Want to zoom in? Shift left; the most significant bit of the tile pixel number will become the least significant bit of the tile number. Likewise, want to zoom out? Shift right.

Simplicity itself; both easier to understand and it offers faster execution times and it produces more accurate results.

A New Appreciation for How Much Javascript Sucks

Developing a web site to report information in graphical, map form has given me a new appreciation for how much client-side Javascript (a technology I have never much liked to start with) sucks.

In fact, Javascript was never really the first choice for this site. If there was a simpler, purely declarative way to draw a map that used tool tips to display the details of each observation, I’d have used it in a heartbeat. But there doesn’t seem to be, and moreover, the best package I could find for presenting maps used Javascript. So Javascript it was.

The problem is the execution environment for mobile devices. It simply varies too much. For desktop browsers it was fairly easy to come up with a page that worked well with every browser I thought to try. Mobile sites have so far frustrated that desire. What I have works on my iPad, but no friend’s smart phone has made it work likewise. Some don’t let one zoom in at all. Some zoom in but always draw the dots ridiculously small (despite their being specified as 4 pixels in diameter). Some don’t register touches that call the touch callback. And so on.

It shouldn’t have been a surprise, really. It’s not as if most web developers are totally incompetent, yet attempting to use Javascript-heavy web sites on a mobile device is always asking for trouble. Those developers weren’t lazy or incompetent, they were just fighting against a platform that does its best to frustrate portable coding.

The rub is, tool tips are really needed to present as much information as I want to in a single graphic. As such, it’s probably time to realibrate my wants and make Javascript avoidance first and paramount. If presenting that much information requires Javascript, then presenting that much information in one graphic is the wrong goal. Time to come up with a version of the site that is basic, static HTML and point mobile users there.

Back to Safari… for Now

Circa 2011 I dumped Safari for Firefox. Safari had come out with what I term a “turkey upgrade” that made it painfully slow. Plus, Safari’s Javascript engine has always tended to suck. Add to that the recent slowness factor and it was worth putting up with how Firefox’s UI sometimes annoying departs from normal Macintosh standards.

Now Firefox has come out with a turkey upgrade of its own: Firefox Quantum. It’s almost hideously ugly and un-Mac-like. There’s so much clutter up top that the box that you enter the URL to browse to in can almost never display the whole URL at once any more.

Worse, the designers made the atrocious decision to devote the entire top part of the window to the browser tabs; there’s not much place to click on if you just want to move the browser window. You must fight your way to one of the far top corners in order to do that (and “fight” is the correct word, given that it makes it needlessly difficult to move the browser window).

What happens, of course, is that I’m used to Firefox acting how it used to (and, for that matter, how every other Mac program works), where the entire top most part of the window can be used to grab and move it. So I end up grabbing a tab and moving it. Which of course causes the tab to become a window of its own. This is something I almost never want to do. Congratulations, Firefox, you’ve made it easy for me to do something I almost never want and needlessly difficult to do something I often want.

Back to Safari for now.

New Cell Phone

No, it’s not a smartphone. To that, I strongly suspect the answer is “only when there’s no alternative”, as I have written many times before.

It’s a Nokia 3310 3G. I’ve been hoping HMD (the firm Nokia sold their cell phone business, together with branding rights, to) would come out with a version of the same that works with US cellular networks ever since reading that they were attempting a reboot of a classic dumb phone.

We shall see how well it works. One annoyance is that it is incompatible with the Apple headset I use (although I say “phooey” to their smart phones, Apple’s headset is very well-designed, and I strongly prefer to use a headset so as to distance my cranium from the radio transmitter in the phone). That is mostly counteracted by Nokia’s headset having a design that is distinctly better-than-average, and being included with the phone.

One plus is that it has an FM broadcast band receiver in it. That’s something I know I will be using from time to time. The ability to listen to news and music programming without encountering network congestion issues or paying any data charges: what’s not to like about that?

Actually, most cell phones have FM receivers in them; the makers of the chips for such things put them in because a) it doesn’t cost that much, overall; and b) the broadcast radio industry pressured them to do it. It’s just that the broadcast radio industry hasn’t been quite so successful at pressuring the phone manufacturers in enabling these receivers.

Apple is a particularly egregious example; in their iPhones, they deliberately omit making any connection between the lead going to the headset jack and the antenna on the chip, thus permanently crippling their phones by design. Even if you jailbreak your iPhone and install your own software to enable the FM receiver, you’ll still get a whole lot of nothing to show for your efforts.

Chalk it up to pure greed: most phone makers are in cahoots with cell providers, most phones being sold by the providers themselves and being locked to that provider’s network. They want their customers to stream audio and rack up network charges; it means more money for them.

The broadcast industry is naturally upset about that. Greed is in play there, too, of course. They want to have cell phone users deciding to listen to their stations and the commercials they broadcast. More listeners means higher ad rates and more money for them.

I end up squarely on the side of enabling the receivers. First, it’s a matter of choice. Nobody can force anyone to put their phone into radio mode. If one thinks broadcast radio is a vast wasteland*, one is free to not listen to it and to instead choose to stream audio. Second, is a matter of efficiency: broadcast radio has no problems scaling; it’s intrinsically one-to-many. Using it eliminates the problem of servers going down on big news days.

But the biggest argument is emergency preparedness. Broadcast radio is an older, low-tech technology. As such, it tends to be more robust than cell service. At least some stations stay on the air after a disaster takes the cell network down due to a combination of damage and subsequent overuse. Cell phones are battery-powered devices, enabling radio receivers in them to be operated without commercial power. It’s simply in the interest of public safety to have as many cell phones as possible be able to act like broadcast radio receivers.

* When one is talking about commercial radio, I tend to agree. But that’s not the only option; virtually everywhere I’ve visited there’s been non-commercial stations on FM. In my own area, there’s three very good ones.

Whistling Past the Korean Graveyard

What astounds me is how much the Establishment media are downplaying the grave and imminent danger of war between two nuclear-armed states both led by irresponsible madmen.

I was going to post something on this, then decided to shelve such plans when the news that Tillerson was secretly talking with the North Koreans came out. Which brings me to these points that Jennifer Rubin recently raised.

What’s wrong, I think, is that Tillerson is cracking under the stress of his job. That also explains why he’s trying to stay on: he has first-hand experience that the US president is in fact a madman, and fears what will happen if his influence attempting to moderate same is gone.

Of course, Rubin’s points are still valid, which means that Tillerson is probably on his way out. But keep in mind that Tillerson’s apparent worries are also valid.

What it all means is that Trump’s handlers are not able to rein in his worst attributes.

Make no mistake, the danger we are facing is now extreme.

So Much for Eclipse

I’ve been using the Eclipse IDE off and on for several years now, mainly because it’s something of a de-facto standard in the Java world, and I want to be something in sync with that world. Well, forget it. I’ve come to the conclusion that the annoyances outweigh the advantages:

  1. The editor is nowhere near as powerful as a stand-alone editor. That should not be a surprise; it’s competing for the attention of the Eclipse dev team with so many other priorities. By contrast, the dev teams working on text editor projects are totally focused on making those editors better.
  2. The editor is sluggish. It doesn’t respond as promptly to my keystrokes as any dedicated text editor I’ve used. This frequently trips me up.
  3. It’s almost as if it has an artificial intelligence engine working away to decide whether or not I’d like auto-completion to be offered for an identifier… and then does precisely the opposite of what I want. The feature pops up unbidden and gets in the way when I’m rapidly typing, yet never appears when I’m paused, trying to remember the precise name of something. Typing Control-Space remedies the latter situation, but still.
  4. Also, the auto-complete for things like parenthesis and quotes is thoroughly evil. It’s always introducing syntax errors into my code, because it comes up slightly too late; by the time it’s gratuitously inserting something, I’ve already gotten a keystroke or two in edgewise.
  5. The default is to indent with hard tabs, and you have to change many settings to defeat this misfeature.
  6. There is no simple, easy way (at least none I’ve found, and I’ve tried) to stop it from making files with lines that have trailing white space.
  7. When upgrading to a new version of Eclipse, nothing is done to import settings settings from any previous version you were using.
  8. When upgrading to a new version, the new version will create a new directory for its workspaces, instead of seeing if there is any existing such area in a default location used by a previous version. The default workspace path changes from version to version. There is no overriding pattern to the defaults.
  9. There’s no way to do something as simple and basic as renaming a project in Eclipse Oxygen. If there is; it’s very well-hidden; the action is not listed in the same menu that creating, deleting, and copying projects are listed.

The straw that broke the camel’s back for me was the mess with the workspace directories. I don’t need three separate, inconsistently-named, locations. Yet that is now what I have. And when I attempted to convert and old workspace into a new one, the conversion failed and left some projects inaccessible. I’m sure there’s a solution that would enable me to fix the problem, but it’s simply not worth continually expending effort at making an overly-complex tool behave itself.

So I’m in the process of reverting to a text editor and using that old reliable standby Ant to do the building of my Java projects. A pity, as some of what Eclipse offers (detection of errors as one types, being able to request auto-completion) really is helpful.

The Bigotry of Valerie Plame

Yes, that Valerie Plame, Joseph Wilson’s wife, the ex-CIA agent. First she tweets:

Then 90 minutes or so later she makes a feeble attempt at walking it back:

And yes, it’s a feeble attempt. If she “zeroed in on the neocon criticism,” then why mention Jewishness at all, if the problem is neoconservatives? Why retweet the subject, which was “America’s Jews Are Driving America’s Wars.” Not “America’s Neocons” or even “America’s Jewish Neocons”, but “America’s Jews” as a whole. The problem was identified as Jewishness, not political ideology.

That an article so titled would resonate with her (to the point of prompting an instinctive retweet) points to deeply-held antisemitic attitudes on her part. That’s a far bigger problem that a simple “Oopsie!” can atone for.

What a Madman

Probably doesn’t even see the irony in making a speech that contains both this:

Rogue regimes represented in this body not only support terrorists but threaten other nations and their own people with the most destructive weapons known to humanity.

and this:

The United States has great strength and patience, but if it is forced to defend itself or its allies, we will have no choice but to totally destroy North Korea.