The Insightful Troll

Rants and ruminations.

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.

Gov. Ralph Northam Must Resign

| Comments

Democratic Virginia Gov. Ralph Northam confirmed Friday he was in a racist yearbook photo showing one person dressed in blackface and another in the KKK’s signature white hood and robes, and apologized:

Earlier today, a website published a photograph of me from my 1984 medical school yearbook in a costume that is clearly racist and offensive. I am deeply sorry for the decision I made to appear as I did in this photo and for the hurt that decision caused then and now.

This behavior is not in keeping with who I am today and the values I have fought for throughout my career in the military, in medicine, and in public service. But I want to be clear, I understand how this decision shakes Virginians' faith in that commitment.

I recognize that it will take time and serious effort to heal the damage this conduct has caused. I am ready to do that important work. The first step is to offer my sincerest apology and to state my absolute commitment to living up to the expectations Virginians set for me when they elected me to be their Governor.

There is no place for racism in America. Governor Northam you can start your “commitment to living up to the expectations Virginians set for me when they elected me to be their Governor” by resigning. Imediately.

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.