The Insightful Troll

Rants and ruminations.

Model 3 - 24% of Small and Midsize

| Comments

From CleanTechnica

At the moment, while the verdict isn’t final, things are looking good for Tesla and Tesla fans. We don’t know precise Tesla Model 3 sales figures in the US, and even educated estimates are very rough estimates until we get more data from Europe and China, but our expectation is that there were between 40,000 and 50,000 deliveries in the US in the third quarter. On the more conservative side, we’ve estimated 43,000 US deliveries. That blows away sales of any other midsize or small luxury car.

1979 - Fifty Songs 3 Minutes

| Comments

Chicago mashup masters The Hood Internet has released a musical tribute to 1979, combining 50 songs released that year into a tight 3-minute mix. This shouldn’t work, but it does!


ABBA, AC/DC, Anita Ward, Billy Joel, Blondie, Boomtown Rats, The Buggles, The Cars, Charlie Daniels Band, Cheap Trick, Chic, The Clash, The Cure, Donna Summer, Doobie Brothers, Earth Wind & Fire, Electric Light Orchestra, Fleetwood Mac, The Flying Lizards, Gang of Four, The Gap Band, Gary Numan, Joy Division, Kiss, The Knack, Kool & The Gang, Lipps Inc, M, Michael Jackson, Pat Benatar, Pink Floyd, The Police, The Pretenders, Prince, Queen, Rainbow, Rupert Holmes, Sister Sledge, The Specials, Squeeze, The Sugarhill Gang, Supertramp, Talking Heads, Tom Petty & The Heartbreakers, Van Halen, The Whispers, Wire

Next four are due every week this month 1980-1983!!!

We Just Want Normal Libraries

| Comments

Alia Wong writes an interesting article in The Atlantic - talking about how maybe in the digital age we are trying to re-invent what is and alway was unbroken:

Likely in the hopes of proving that they have more to offer than a simple internet connection does, many college libraries are pouring resources into interior-design updates and building renovations, or into “glitzy technology,” such as 3-D printers and green screens, that is often housed in “media centers” or “makerspaces.”

Yet much of the glitz may be just that—glitz. Survey data and experts suggest that students generally appreciate libraries most for their simple, traditional offerings: a quiet place to study or collaborate on a group project, the ability to print research papers, and access to books. Notably, many students say they like relying on librarians to help them track down hard-to-find texts or navigate scholarly journal databases. “Google can bring you back 100,000 answers,” as the writer Neil Gaiman once said. “A librarian can bring you back the right one.”

The library has always been for most people a collection of books and a quite place to read them - but it has also been a vital and central infrastructure of a functioning urban society.

As best summarized by Ruth Faklis, director of the Prairie Trail Public Library District in suburban Chicago

It never ceases to amaze me just what libraries are looked upon to provide. This includes, but is not limited to, [serving as] keepers of the homeless … while simultaneously offering latch-key children a safe and activity-filled haven. We have been asked to be voter-registration sites, warming stations, notaries, technology-terrorism watchdogs, senior social-gathering centers, election sites, substitute sitters during teacher strikes, and the latest — postmasters. These requests of society are ever evolving. Funding is not generally attached to these magnanimous suggestions, and when it is, it does not cover actual costs of the additional burden, thus stretching the library’s budget even further. I know of no other government entity that is asked to take on additional responsibilities not necessarily aligned with its mission

Couldn’t have said it better myself.

HAL 9000 Prop

| Comments

I have always been fascinated by Fisheye lenses. Their crazy 180 degree (and sometimes more!) angle of view leads to some crazy images. However, I could never justify owning one as I had no idea what I would be using one for - besides the occasional goofy portraiture.

But here an interesting article over at Kosmo Foto about another use for a Nikon 8mm F8 Fisheye.

HAL 9000 needed to be all-seeing — the film’s plot hinges on his ability to detect a conversation between two of the crew. So he decided to use a camera lens.

The on-screen HAL 9000 — the single “eye” in blazing red — was played by one of Nikon’s most extreme lenses, its 8mm f/8 fisheye. But how did they add the glow? Simple — they used the camera’s very own red filter (R60) which screws on to the back of the lens. Then they simply shone a light through it.

Peter Jackson owns one of the original props now, and showed it to Adam Savage. What a clever use for a $1500+ specialty lens.

There are so many aspects of 2001: A Space Odyssey that were so dead on. HAL 9000 was everywhere. Quietly listening. Quietly analyzing. And Quietly plotting. Its amazing that all of the devices strewn through out our homes are doing the same thing - our iPhones, Alexa, Google Home, etc.

Gives me the chills…

Exercise Whenever You Think of It

| Comments

For the Atlantic, Olga Khazan writes about an approach to physical fitness called “greasing the groove”, which some people have translated into the Michael Pollan-esque “lift weight, not too much, most of the days”.

One way to grease the groove is to just do the exercise whenever you think of it. Ben Greenfield, in Beyond Training, describes how he would do three to five pull-ups every time he walked under a pull-up bar installed in his office doorway. By the end of the day, he’d have performed 30 to 50 pull-ups with minimal effort.

McKay opted for something similar: He set up a pull-up bar in his door frame, and every time he walked under it, he would do one. “You’re allowing yourself to practice more without going to fatigue,” he says. “If you’re constantly thrashing your body, doing max sets every time you do a pull up, you’re gonna have a bad time.” Anyone who has tried to climb the stairs to their apartment on achy quads after an overly ambitious leg day knows the risks of overexertion. Within a month, McKay says, he went from being able to do about five pull-ups to about 15.

Gun Control

| Comments

America’s gun control laws are the loosest in the developed world and its rate of gun-related homicide is the highest. Of the world’s 23 “rich” countries, the U.S. gun-related murder rate is almost 20 times that of the other 22. With almost one privately owned firearm per person, America’s ownership rate is the highest in the world; tribal-conflict-torn Yemen is ranked second, with a rate about half of America’s.

Here is what gun control looks like in Japan:

To get a gun in Japan, first, you have to attend an all-day class and pass a written test, which are held only once per month. You also must take and pass a shooting range class. Then, head over to a hospital for a mental test and drug test (Japan is unusual in that potential gun owners must affirmatively prove their mental fitness), which you’ll file with the police. Finally, pass a rigorous background check for any criminal record or association with criminal or extremist groups, and you will be the proud new owner of your shotgun or air rifle. Just don’t forget to provide police with documentation on the specific location of the gun in your home, as well as the ammo, both of which must be locked and stored separately. And remember to have the police inspect the gun once per year and to re-take the class and exam every three years.

Contrast this with Texas, USA:

Anyone can openly carry rifles in Texas without a permit, and a handgun license lets them put semi-automatics over their shoulders or pistols on their hips when they run to the corner store. Spotting an armed Walmart shopper in the produce aisle is not exactly a cultural rarity. When open-carry laws were approved in Texas, Walmart adopted a policy that employees must request to see a shopper's gun license before allowing them to carry their weapon in the store. Open-carry activists were not happy with the corporate decision.

So how does this translate into gun violence? Here are the numbers for 2019 (only half way through the year as of this writing) gun death rates per 100,000 people from World Population Review for Japan & the US.

Country Total Homicide suicide Accidental
Japan 0.06 0.00 0.04 0.1
USA 12.21 4.46 7.32 0.15

And for those who are numerically challenged - here it is visually:

To our elected officials - we don’t need our thoughts and prayers. We don’t need the outpouring of emotion and the standard visits with the family. We need GUN CONTROL NOW. Japan’s gun policies would be a great place to start.

Builder's Remorse

| Comments

A great post by Tim Carmody on

This is the builder’s remorse. Not that you invented a thing, not that the consequences were unforeseen. It’s that you gave the thing to a power structure where things were overwhelmingly likely to end in ruin. You gave the power to people who don’t care about what you claim to care about. And that problem, because of the nature and structure of money and power, is extremely hard to avoid.

A Pixel Is Not a Square!

| Comments

A technical memo that I came across by Alvy Ray Smith from July 15, 1995. A good point is made here. Every other book/article/graphics tutorial always models a pixel as a square.

A pixel is a point sample. It exists only at a point. For a color picture, a pixel might actually contain three samples, one for each primary color contributing to the picture at the sampling point. We can still think of this as a point sample of a color. But we cannot think of a pixel as a square—or anything other than a point. There are cases where the contributions to a pixel can be modeled, in a low-order way, by a little square, but not ever the pixel itself.

Walkman 40 Years Old Today

| Comments

On July 1 of 1979 - Sony first began to sell the TPS-L2 Soundabout, and soon rechristened the Walkman.

It’s weird to think that, in the years before the Walkman, there was no way to listen to music privately while out in public. There were ways to bring music with you — on transistor radios, on boom boxes, on car stereos — but they forced you to subject everyone around you to that music, as well. The Walkman freed us up. It allowed us to make music more a part of our lives, to build our own private soundworlds.

It was a transformative invention, one of the few that utterly upended the way we listen to music. Soon enough, more and more portable cassette players would hit the market, and the price fortunately dropped. But no matter which company made them, we still used the word “Walkman” to describe them.

That Answer Is Unacceptable

| Comments

When asked by Rachel Maddow, “Why isn’t [the Afghanistan war] over? Why can’t presidents of very different parties and very different temperaments get us out of there? And how could you?” Ryan had a ready, pre planned scripted answer:

I appreciate that question. So I—I’ve been in Congress 17 years and 12 of those years I’ve sat on the Armed Services Committee either the Defense Appropriations Committee or the Armed Services Committee. And the lesson that I’ve learned over the years is that you have to stay engaged in these situations. Nobody likes it. It’s long. It’s tedious.

Ryan didn’t answer the question. He didn’t talk of American goals, exit strategies or cost. Instead he was defending a war that is in its 18th year which has no end in site. A war in which we just lost two more - bringing the total to 3,551 Americans. No policy statement. No stance on the subject. Just we need to do more of the same - that I have done for the last 17 years.

And Tulsi Gabbard offered the best foreign policy statement of the night:

Is that what you will tell the parents of those two soldiers who were just killed in Afghanistan? Well, we just have to be engaged? As a soldier, I will tell you that answer is unacceptable. We have to bring our troops home from Afghanistan…We have spent so much money. Money that’s coming out of every one of our pockets…We are no better off in Afghanistan today than we were when this war began. This is why it is so important to have a president — commander in chief who knows the cost of war and is ready to do the job on day one.

This is what the Democratic party needs more of – simple, direct and common sense policy. You want to win against Trump – that is how you do it.

Who Wants to Loose the Election?

| Comments

Last week’s Democratic debate - lets just say it was depressing. Besides going on and on about how much the Democrats care about illegal aliens - and I get it, I am a supporter of treating people entering our country illegal or not - with dignity and respect. But when asked the question - do you think illegal immigrations should receive health care? - everyone candidate raised their hand.

What I wish they said was – “Yes. As should every American”

Stewart's Defense of 9/11 First Responders

| Comments

If you didn’t have the opportunity yesterday to watch Jon Stewart’s scathing and powerful opening statement before a House subcommittee about providing health benefits for surviving 9/11 first responders, you really should; it’s quite something:

As I sit here today, I can’t help but think what an incredible metaphor this room is for the entire process that getting healthcare and benefits for 9/11 first responders has come to. Behind me, a filled room of 9/11 first responders and in front of me a nearly empty Congress.

Shameful. It’s an embarrassment to the country and it is a stain on this institution. You should be ashamed of yourselves, for those that aren’t here, but you won’t be. Because accountability doesn’t appear to be something that occurs in this chamber.

This is the kind of talk we need in modern politics. If Stewart runs for office, he has my vote.

GPS Distance

| Comments

I recently had to calculate the distance between a large number of co-ordinates. I could have used one of the many Ruby Gems that are available but due to business limitations had to develop the code myself. After some research I came across the haversine formula.

The haversine formula is an equation important in navigation, giving great-circle distances between two points on a sphere from their longitudes and latitudes. It is a special case of a more general formula in spherical trigonometry, the law of haversines, relating the sides and angles of spherical triangles.

You can read the full details on the maths here. For those who just want the code here is the implemenation I came up with:

module GPS
  class Distance
    RAD_PER_DEG = Math::PI / 180
    GREAT_CIRCLE_RADIUS_KILOMETERS = 6371 # some algorithms use 6367

    attr_accessor :great_circle_distance
    attr_accessor :point1
    attr_accessor :point2

    def initialize(great_circle_distance = 0)
      @great_circle_distance = great_circle_distance
      @point1 = [0,0]
      @point2 = [0,0]

    def to_miles
      @great_circle_distance * GREAT_CIRCLE_RADIUS_MILES
    alias_method :to_mi, :to_miles

    def to_kilometers
      @great_circle_distance * GREAT_CIRCLE_RADIUS_KILOMETERS
    alias_method :to_km, :to_kilometers

    def to_meters
      @great_circle_distance * GREAT_CIRCLE_RADIUS_METERS
    alias_method :to_m, :to_meters

    def to_feet
      @great_circle_distance * GREAT_CIRCLE_RADIUS_FEET
    alias_method :to_ft, :to_feet

    def to_nautical_miles
      @great_circle_distance * GREAT_CIRCLE_RADIUS_NAUTICAL_MILES
    alias_method :to_nm, :to_nautical_miles


    # Radians per degree
    def rpd(num)
      num * RAD_PER_DEG

    def calculate
      # Accept two arrays of points in addition to four coordinates
      if point1.is_a?(Array) && point2.is_a?(Array)
        lat2, lon2 = point2
        lat1, lon1 = point1
        raise ArgumentError
      dlon = lon2 - lon1
      dlat = lat2 - lat1
      a = (Math.sin(rpd(dlat)/2))**2 + Math.cos(rpd(lat1)) * Math.cos((rpd(lat2))) * (Math.sin(rpd(dlon)/2))**2
      @great_circle_distance = 2 * Math.atan2( Math.sqrt(a), Math.sqrt(1-a))

Here is a quick script on how to use it:

irb(main):001:0> d =
=> #<GPS::Distance:0x007fb93b036050 @great_circle_distance=0, @point1=[0, 0], @point2=[0, 0]>
irb(main):002:0> d.point1 = [40.7457395,-73.991623]
=> [40.7457395, -73.991623]
irb(main):003:0> d.point2 = [40.9176771,-74.2082467]
=> [40.9176771, -74.2082467]
irb(main):004:0> d.to_meters
=> 26413.70207758391
irb(main):005:0> d.to_kilometers
=> 26.413702077583906
irb(main):006:0> d.to_miles
=> 16.40128793265138
irb(main):007:0> d.to_feet
=> 86598.80028439929

Hope this helps. If you have any questions, or comments feel free to leave a message or contact me directly.

The Clap

| Comments

From an editorial from Monica Hesse in the Washington Post:

“You weren’t supposed to do that,” he said, chiding them for unexpectedly cheering at a moment he hadn’t anticipated.

No, they weren’t. The attention was to have been on him. This was to have been an uninterrupted performance.

But instead, Nancy Pelosi clapped for the president, and a group of congresswomen sat for the president, and they both displayed the art of stealing someone’s thunder without saying anything at all.

This is the look of a women who knows something that we are all going to find out very soon. This just might be the image that defines the Trump presidency.

You Have a Choice

| Comments

Control has its benefits. Facebook and Google really need to emulate Apple and protect their users.

SNL Cards

| Comments

Its kind of amazing how this is still a manual process. Sure the cards could be printed digitally, but I think the actors appreciate the “human” touch involved. Some things are just best done in the analog world.

What Global Warming?

| Comments

Millions of Americans in the midwdest woke up to temperatures an astonishing 50 degrees Fahrenheit (28 degrees Celsius) below normal this week – as low as 35 degrees below zero. Combine with a strong wind, and the winchill can be as low as -60 F. At the same time, the North Pole is facing a heat wave with temperatures approaching the freezing point – about 25 degrees Fahrenheit (14 C) above normal.

This cold is nothing to sneeze at. The National Weather Service is warning of brutal, life-threatening conditions. Frostbite will strike fast on any exposed skin. Of course the climate change deniers are all out in force smugly asking “What ever happend to Global Warming?”

Jennifer Francis, senior scientist at the Woods Hole Research Center, writes that the polar vortex bringing cold air into the Midwest is connected to the rapidly warming Arctic.

Because of rapid Arctic warming, the north/south temperature difference has diminished. This reduces pressure differences between the Arctic and mid-latitudes, weakening jet stream winds. And just as slow-moving rivers typically take a winding route, a slower-flowing jet stream tends to meander.

Large north/south undulations in the jet stream generate wave energy in the atmosphere. If they are wavy and persistent enough, the energy can travel upward and disrupt the stratospheric polar vortex. Sometimes this upper vortex becomes so distorted that it splits into two or more swirling eddies.

These “daughter” vortices tend to wander southward, bringing their very cold air with them and leaving behind a warmer-than-normal Arctic.


| Comments

XML and JSON are the two most common formats for data interchange in the Web today. XML was created by the W3C in 1996, and JSON was publicly specified by Douglas Crockford in 2002. Although their purposes are not identical, they are frequently used to accomplish the same task, which is data interchange. Both have well-documented open standards on the Web (RFC 7159, RFC 4825), and both are human and machine-readable. Neither one is absolutely superior to the other, as each is better suited for different use cases.

XML Advantages

There are several advantages that XML has over JSON. One of the biggest differences between the two is that in XML you can put metadata into the tags in the form of attributes. With JSON, the programmer could accomplish the same goal that metadata achieves by making the entity an object and adding the attributes as members of the object. However, the way XML does it may often be preferable, given the slightly misleading nature of turning something into an object that is not one in the client program. For example, if your C++ program sends an int via JSON and needs metadata to be sent along with it, you would have to make it an object, with one name/value pair for the actual value of the int, and more name/value pairs for each attribute. The program that receives the JSON would read it as an object, when in fact it is not one. While this is a viable solution, it defies one of JSON’s key advantages: “JSON’s structures look like conventional programming language structures. No restructuring is necessary.”[2]

Although I will argue later that this can also be a drawback of XML, its mechanism to resolve name conflicts, prefixes, gives it power that JSON does not have. With prefixes, the programmer has the ability to name two different kinds of entities the same thing.[1] This would be advantageous in situations where the different entities should have the same name in the client program, perhaps if they are used in entirely different scopes.

Another advantage of XML is that most browsers render it in a highly readable and organized way. The tree structure of XML lends itself well to this formatting, and allows for browsers to let users to naturally collapse individual tree elements. This feature would be particularly useful in debugging.

One of the most significant advantages that XML has over JSON is its ability to communicate mixed content, i.e. strings that contain structured markup. In order to handle this with XML, the programmer need only put the marked-up text within a child tag of the parent in which it belongs. Similar to the metadata situation, since JSON only contains data, there is no such simple way to indicate markup. It would again require storing metadata as data, which could be considered an abuse of the format.

JSON Advantages

JSON has several advantages as well. One of the most obvious of these is that JSON is significantly less verbose than XML, because XML necessitates opening and closing tags (or in some cases less verbose self-closing tags), and JSON uses name/value pairs, concisely delineated by “{“ and “}” for objects, “[“ and “]” for arrays, “,” to separate pairs, and “:” to separate name from value. Even when zipped (using gzip), JSON is still smaller and it takes less time to zip it.[6] As determined by Sumaray and Makki as well as Nurseitov, Paulson, Reynolds, and Izurieta in their experimental findings, JSON outperforms XML in a number of ways. First, naturally following from its conciseness, JSON files that contain the same information as their XML counterparts are almost always significantly smaller, which leads to faster transmission and processing. Second, difference in size aside, both groups found that JSON was serialized and deserialized drastically faster than XML.[3][4] Third, the latter study determined that JSON processing outdoes XML in CPU resource utilization. They found that JSON used less total resources, more user CPU, and less system CPU. The experiment used RedHat machines, and RedHat claims that higher user CPU usage is preferable.[3] Unsurprisingly, the Sumaray and Makki study determined that JSON performance is superior to XML on mobile devices too.[4] This makes sense, given that JSON uses less resources, and mobile devices are less powerful than desktop machines.

Yet another advantage that JSON has over XML is that its representation of objects and arrays allows for direct mapping onto the corresponding data structures in the host language, such as objects, records, structs, dictionaries, hash tables, keyed lists, and associative arrays for objects, and arrays, vectors, lists, and sequences for arrays.[2] Although it is perfectly possible to represent these structures in XML, it is only as a function of the parsing, and it takes more code to serialize and deserialize properly. It also would not always be obvious to the reader of arbitrary XML what tags represent an object and what tags represent an array, especially because nested tags can just as easily be structured markup instead. The curly braces and brackets of JSON definitively show the structure of the data. However, this advantage does come with the caveat explained above, that the JSON can inaccurately represent the data if the need arises to send metadata.

Although XML supports namespaces and prefixes, JSON’s handling of name collisions is less verbose than prefixes, and arguably feels more natural with the program using it; in JSON, each object is its own namespace, so names may be repeated as long as they are in different scopes. This may be preferable, as in most programming languages members of different objects can have the same name, because they are distinguished by the names of the objects to which they belong.

Perhaps the most significant advantage that JSON has over XML is that JSON is a subset of JavaScript, so code to parse and package it fits very naturally into JavaScript code. This seems highly beneficial for JavaScript programs, but does not directly benefit any programs that use languages other than JavaScript. However, this drawback has been largely overcome, as currently the JSON website lists over 175 tools for 64 different programming languages that exist to integrate JSON processing. While I cannot speak to the quality of most of these tools, it is clear that the developer community has embraced JSON and has made it simple to use in many different platforms.


Simply put, XML’s purpose is document markup. This is decidedly not a purpose of JSON, so XML should be used whenever this is what needs to be done. It accomplishes this purpose by giving semantic meaning to text through its tree-like structure and ability to represent mixed content. Data structures can be represented in XML, but that is not its purpose.

JSON’s purpose is structured data interchange. It serves this purpose by directly representing objects, arrays, numbers, strings, and booleans. Its purpose is distinctly not document markup. As described above, JSON does not have a natural way to represent mixed content.

Impeaching Donald Trump

| Comments

Yoni Appelbaum clearly and methodically lays out the case that Congress should begin the impeachment process against Donald Trump in The Atlantic.

The oath of office is a president’s promise to subordinate his private desires to the public interest, to serve the nation as a whole rather than any faction within it. Trump displays no evidence that he understands these obligations. To the contrary, he has routinely privileged his self-interest above the responsibilities of the presidency. He has failed to disclose or divest himself from his extensive financial interests, instead using the platform of the presidency to promote them. This has encouraged a wide array of actors, domestic and foreign, to seek to influence his decisions by funneling cash to properties such as Mar-a-Lago (the “Winter White House,” as Trump has branded it) and his hotel on Pennsylvania Avenue. Courts are now considering whether some of those payments violate the Constitution.

More troubling still, Trump has demanded that public officials put their loyalty to him ahead of their duty to the public. On his first full day in office, he ordered his press secretary to lie about the size of his inaugural crowd. He never forgave his first attorney general for failing to shut down investigations into possible collusion between the Trump campaign and Russia, and ultimately forced his resignation. “I need loyalty. I expect loyalty,” Trump told his first FBI director, and then fired him when he refused to pledge it.

Trump has evinced little respect for the rule of law, attempting to have the Department of Justice launch criminal probes into his critics and political adversaries. He has repeatedly attacked both Deputy Attorney General Rod Rosenstein and Special Counsel Robert Mueller. His efforts to mislead, impede, and shut down Mueller’s investigation have now led the special counsel to consider whether the president obstructed justice.

America has urgent challenges to address on behalf of all of its citizens and they’re just not getting much consideration. Instead, we’ve given the attention of the country over to a clown and a charlatan who wants nothing more than for everyone to adore and enrich him.

Gradually, Then Suddenly

| Comments

Tim O’Reilly writes about some technology-related changes happening in the world where incremental advances in recent years are set to soon become pervasive.

2) The rest of the world is leapfrogging the US
The volume of mobile payments in China is $13 trillion versus the US’s $50 billion, while credit cards never took hold. Already Zipline’s on-demand drones are delivering 20% of all blood supplies in Rwanda and will be coming soon to other countries (including the US). In each case, the lack of existing infrastructure turned out to be an advantage in adopting a radically new model. Expect to see this pattern recur, as incumbents and old thinking hold back the adoption of new models.