Posts

Showing posts from 2015

Transaction ethics as root of social/libertarian disagreement

In order for two parties to enter a transaction, both have to benefit from it. However, the benefit can be distributed unequally. A potential transaction has a minimum price where it's still acceptable for the seller, and a maximum price where it's still acceptable for the buyer. The total value gained from a transaction is the spread between the maximum and the minimum.

An unfair, but still voluntary, transaction is one where the negotiated price is closest to one of the extremes, instead of closer to the middle. The result is that one party gains most of the benefit from the transaction. A transaction where one person gets 90% of the value, and the other gets 10%, is frequently seen as unethical by many people, and is described as "robbing" the other person.

You can see that people consider such transactions unethical in ultimatum games, such as the dictator game. In experiments, most people will accept a reward with a 40-60 split. But when offered a 10-90 split, a…

Janez Janša

Those outside observers who even know about the existence of Slovenia may be wondering:
Why Slovenia saw it fit to hold a referendum about whether people should have equal rights, after a law had already been passed to make rights equal.Why those who voted saw it fit to overwhelmingly vote against equal rights.The reason is that there are political points to be gained from undoing a law backed by a currently unpopular government.

For decades, Slovenia has had a prominent but divisive political figure, Janez Janša, who has been Prime Minister at one point but is now in opposition. Mr. Janša builds support for himself by fomenting division. He has surmised that, if properly cultivated, Slovenia can be divided into two groups of people. On the one hand are the secularists: left-leaning – socially liberal, economically statist descendants of people who were privileged when Slovenia was part of Yugoslavia until 1990. On the other hand are the Catholics: socially conservative, economically l…

Survey of SSL/TLS use in SMTP mail exchangers

Some eight years ago, I made a logic error. Last month, I discovered it, proceeded to slap my forehead, and fixed it. We prepared new releases containing the fix, and began the process of notifying our users.

I now, therefore, have rough statistics about the prevalence and availability of TLS/SSL when sending email. Our notifications went to tens of thousands of unique addresses, with the following rough results. Percentages are based on the number of unique addresses in each category, so large email services (Google, Outlook, Yahoo) are represented according to their size. However, the results are filtered through the self-selected lens that is our users:


16%NoTlsThe SMTP server did not offer STARTTLS (large majority), or TLS handshake failed due to protocol error (small fraction; errors encountered were SEC_E_INVALID_TOKEN and SEC_E_ILLEGAL_MESSAGE).20%Tls_NoHostAuthThe SMTP server offered TLS, but could not be authenticated. By far the most common reason was SEC_E_WRONG_PRINCIPAL, f…

Republicanism is fascism

US Republicanism is not just "like" fascism. It is fascism. It fits criteria of Umberto Eco's 1995 definition.

Based on Wikipedia:
The Cult of Tradition, combining cultural syncretism with a rejection of modernism.The Cult of Action for Action's Sake, which dictates that action is of value in itself, and should be taken without intellectual reflection. This, says Eco, is connected with anti-intellectualism and irrationalism, and often manifests in attacks on modern culture and science.Disagreement Is Treason - fascism devalues intellectual discourse and critical reasoning as barriers to action.Fear of Difference, which fascism seeks to exploit and exacerbate, often in the form of racism or an appeal against foreigners and immigrants.Appeal to a Frustrated Middle Class, fearing economic pressure from the demands and aspirations of lower social groups.Obsession with a Plot and the hyping-up of an enemy threat; this often involves an appeal to xenophobia with an identif…

The doghouse: Vagaries of the Excel COM interface

Image
Wow. It's been a while since I've seen a more fragrant turd than the COM interface exposed by Excel which would, theoretically, allow you to interact with workbooks from e.g. PowerShell.

Theoretically is the key word, I'm sad to say. In practice, it's so buggy and poorly designed that you might save more time if you did what you wanted by hand.

Let's start with the simplest possible script:
  $xl = New-Object -com Excel.Application $wb = $xl.Workbooks.Open("C:\Temp\file.xls") What does this do?

Each invocation of this script creates a copy of Excel which then just hangs around. Indefinitely. Like this:


If you just created the COM object, Excel would exit. But since you opened a workbook, it does not. Not even closing the PowerShell window exits these instances. You have to actually go and kill them using a task manager application.

Okay. Let's try modifying the script to close the workbook:

  $xl = New-Object -com Excel.Application $wb = $xl.Wor…

"auto" considered (often) harmful

Edit: Thanks to Drammon, Simon Brand, and Nicola Gigante for important corrections (see comments).

It's now in vogue to write C++ code like this:
autoconst& container = Function();for(autoconst& element : container){autoconst& member = element.AccessMember();...}const& is necessary because auto strips references and const/volatile qualifiers. This is good: it is apparent when you're not copying a whole object, even if its type is hidden from view.

But please don't do this (too much).

The value of strong typing in C++ is not only in ensuring consistency at compile-time, it's also to document what the code is doing.

The above snippet requires that the reader knows:
what Function returnswhat container.begin() or begin(container) returnswhat element.AccessMember() returnsin order to just know that the code is doing this:
  Container const& container = Function();for(Container::Element const& element : container){ Member const& member = elem…

Our bitching and moaning: Why the Middle East cannot have peace

In a nutshell: Terrorism and wars in the Middle East are not about Islam vs. the West. Instead, there cannot be peace in the Middle East as long as major world powers – the US and its allies on the one hand, and Russia on the other – have strong and opposite preferences about the price of oil; and of course, as long as the price is controlled by who has more influence over large oil producing countries.

It's easy to see ourselves as enlightened, and to perceive Middle Easterners as these backwards people with fundamentalist beliefs, who can't stop fighting each other and us, regardless of our "noble" attempts to "free" them. We try to "liberate" them from the Taliban, Hussein, and al-Assad – and they attack us!

Except we have never intervened in the Middle East to liberate; or to help build anyone's peaceful country. We only intervene to stir the shit, but secular values require peace to come about. As we stir shit, unrest and extremism prospe…

The advantages of Seq, and the demerits of std::string const&

A few weeks ago, I was reviewing some code, and found something similar to this:
std::string host =...;int port =23;size_t pos = host.find(":");if(pos != host.npos){ port =atoi(host.substr(pos +1).c_str()); host = host.substr(0, pos);}Looks reasonable enough. This code parses a parameter in “host:port” format. It's perfectly decent where it appears. It will run rarely, once per process invocation, so performance is irrelevant. It’s an acceptable way to achieve what’s intended.

But suppose this code was in a tight inner loop. Suppose it was part of a parser that needs to digest hundreds of megabytes of data, and performance is relevant.

In that case, this code does two suboptimal things:
A heap allocation to copy the “port” portion of the string into. Why not just read the number from the original string?Another heap allocation to copy the “host” portion of the string. Again, why not just read from the original string?Seq as an improvement over std::string const…

Can we stop with this idiocy of private courts?

There are smart people out there – people in many ways a lot like me, i.e. borderline idiot savants – who are attracted to the idea that the world needs to be saved through some kind of easy, adversarial revolution; rather than through a huge amount of incremental and cooperative effort. I suspect this is because cooperation seems boring; imposing one's will on others with violence seems fun; and plain old effort is hard and boring. Frequently, these are white middle-class Americans who do not recognize just how damn good they're having it, and how much worse things are in many other parts of the world.

Not in all parts for all things, of course. There are specific things that are genuinely better in other places. But overall, things are pretty great in the US for the middle and upper class. And yet, some of these same people can't stop going on about how awful everything is; and how everything could be much better if we just overthrew the entire system, and replaced it wi…

On Daylight Saving Time

Around this time of year, complaints pop up about the need to adjust clocks by an hour. I am usually one of the complainers, so I wondered: why do we still change clocks to DST and back, when apparently, most people hate it? If most of us prefer a single time throughout the year - what are the obstacles to making this happen?

After some research, I suspect the answer is:
We do in fact prefer more daylight during evenings in summer. Because of this, we might prefer permanent DST.However, we can only borrow the evening daylight from mornings during summer. In winter, there's no light to borrow, unless we want mornings to be black.In northern places, like Seattle, permanent DST would mean sunrise at 9 am at end of December and early January. Even as far south as Dallas, with permanent DST, sunrise in January would be at 8:30 am.

It appears that permanent DST would be great for those of us who get up late (more daylight!); but it would make winter mornings dreary for people who need to…

Modern-day pyramid building

Image
A commonly understood truth is that consumer spending is good for the economy. A common misunderstanding is that this is true for all forms of consumer spending: even $500 million superyachts; private jets; and the building and maintenance of luxurious villas that most of the year, no one lives in.


A superyacht is absolutely no better than an Egyptian tomb. It is to build a huge and expensive thing for one person (and their close friends), instead of spending the time and resources building something more widely useful. To think this is better than a pyramid is to fool ourselves with economic sophistry. Anyone who looks at this from a 1,000 year perspective will consider us foolish.

To say that superyachts and private jets are "good for the economy" is equivalent to the Broken window fallacy. Superyachts, jets, and villas that no one lives in, are extremely expensive broken windows.

Progressive consumption taxI do not suggest defining some arbitrary categories of products as …

Spec author "fixes mistake", wastes everyone's man-year

I came across the Referrer Policy proposal, which is already implemented in Chrome and Firefox, and allows sites to provide more privacy for their users by restricting referrer information sent to other websites when users follow links.

For example, with default browser behavior, if you are browsing the following page:
https://www.reddit.com/r/bigdicklovers/... then if you click any links on that page which take you to a third-party site, for example:
https://www.employer.bigfirm/... your browser will kindly send to that site the full address of the "Big Dicks" page you came from.

This has some unfortunate privacy implications, so finally, browsers (except Microsoft's, of course) are allowing sites to exert more control over what referrer information is sent with outgoing links.

One of the nice new policies a site can choose is origin-when-cross-origin. Or is it? In 2014, the First Public Working Draft of the spec made a "mistake", and defined this policy without…

This ex-libertarian endorses Sanders

I have less than billionaires, or even the wealthy millionaires, but more than most people. What I have, I built "myself": this is to say, with much personal effort; but also with critical, non-negligible components of luck, and considerable help and work done by the right other people. My own personal work has been indispensable – but on its own, it wouldn't have been enough.

From my little perch, it seems to me that claiming one's little empire and yelling "I built all of this myself!" is nothing short of hypocrisy and egocentrism. There's no way one person builds an empire. Hundreds, or even thousands of people build it. The leadership provided by one person or several is critical, but you are not yourself building the empire. Other people are building it for you, with your partial guidance.

For there to be thousands of people who can help you build your empire, there has to be infrastructure before your business even starts. There have to be schools…

When monospace fonts aren't: The Unicode character width nightmare

Image
Some things haven't changed since the 1970s. Programming is still done in text files; and though we have syntax highlighting and code completion, source code is still best displayed in monospace.

Other aspects of computing work best with monospace, also. The Unix shells; PowerShell; the Windows Command Prompt. Email is still sent with a copy in plaintext, which has to be wrapped on a monospace boundary. Not least, this persists because HTML email is excessively difficult to render securely, and there are user agents that still work better with plaintext.

In all of these situations, the problem presents itself that the originator has to anticipate how text will be rendered in advance. You cannot just send text and expect the recipient to flow it. You have to predict the effects of Tab characters correctly, and word wrap the text in advance, often not knowing the software that will be used for display. In terminal emulation, e.g. xterm via SSH, when the server sends the client a cha…

C++ Relocator proposal

Last month, I spent two weeks working on the following formal proposal for a new C++ feature:

Relocator: Efficiently moving objects

After incorporating much feedback in the C++ Proposals forum, I believe this proposal represents not only my ideas; but close to a consensus of everyone who expressed interest in this feature. I believe the document is fairly polished. I have submitted it as proposal P0023 via Ville Voutilainen, chair of the Evolution section of the ISO C++ working group (WG21).

It so happens that Ville is also the person who most vocally disagreed with my observations last month about problems in C++ standardization – to the extent of us colliding in a somewhat fiery altercation:

Ossification and Hawaii: Impressions of a C++ working group

When I submitted this proposal, Ville reiterated his position that I need to find a champion to represent it in the next WG21 meeting in October in Hawaii. This is how the Working Group goes about its work.

So far – despite considerable p…

Acetaminophen (paracetamol, Tylenol) more toxic than thought

Study:
Real-time monitoring of oxygen uptake in hepatic bioreactor shows CYP450-independent mitochondrial toxicity of acetaminophen and amiodarone

Prediction of drug-induced toxicity is complicated by the failure of animal models to extrapolate human response, especially during assessment of repeated dose toxicity for cosmetic or chronic drug treatments. [...] Importantly, exposure to widely used analgesic, acetaminophen, caused an immediate, reversible, dose-dependent loss of oxygen uptake followed by a slow, irreversible, dose-independent death, with a TC50 of 12.3 mM. Transient loss of mitochondrial respiration was also detected below the threshold of acetaminophen toxicity.I posted previously about a paper suggesting that acetaminophen may cause autism and ADHD in vulnerable children.

Apple design is anti-nerd

I figured out why I dislike Apple, and the average person loves it.

The Apple design is anti-nerd.

It allows people to use technology without being ashamed that their skill is rudimentary. It puts regular folks on equal footing with skilled users. It is the intent of the product that its uses are limited and basic. By design, it lacks advanced features and flexibility, so that it cannot be used more effectively by being good at it. It's not just the low skill threshold; it is the low skill ceiling that makes people want to use it. Some uncool, nerdy person can't outskill you at iTunes.

Then, it's pricey and stylish, and therefore a fashion statement: something nerds don't know how to use.

It turns the table around on nerds. Therefore, normal people love it. Genius. :)

Science, spirituality, and the limits of the materialist paradigm

"The first gulp from the glass of natural sciences will turn you into an atheist, but at the bottom of the glass God is waiting for you."This is a quote attributed to Werner Heisenberg – a pioneer of quantum mechanics, known for the Heisenberg principle of uncertainty.

There are a number of my friends who oppose religion; for good reasons that I also used to champion. Such people are very much miffed by Heisenberg's mention of "God". They argue the concept means nothing; that it's useless. "God" and "spirituality" are just labels we put on things we don't understand. Anything we don't yet know, science will eventually explain. Until it does, it is useless to guess.

I would argue guessing is an essential part of the scientific process. Most progress started first by guessing. However, more than just this – I wish to address the assertion of spirituality being useless.

The materialist paradigm exists for a reason. If it's what …

The ethics of non-consensual monogamy: coercion and dead bedrooms

Here's a hypothesis.

Monogamy is only ethical if both partners continue to choose it. Not just once, but every day; and without guilting each other into it. Each of the partners has to continue to choose it, and the choice has to be truly free; without conditions or attached strings.

Folks have begun to warm up to the idea that open relationships can sometimes work, for a few weird people. However, even among people accepting of this – even among those who are poly – the idea of physical loyalty remains sacrosanct. The idea remains dominant that, if you made monogamous vows, it is your duty to uphold them. No one respectable should cheat. Cheaters are literally worse than... racism.

Consider this, though.

Monogamy boils down to the expectation that you won't use your genitals in a way that isn't useful to, and approved by, your partner.

This is objectification. It is abrogation of each partner's individuality. It is dismissal of a person's independent sexual nature.…

How the Yugoslav army dealt with liabilities

This is an anecdote told by my wife occasionally.

Jana and I are from Slovenia, which used to be part of communist Yugoslavia. My wife's grandmother had a sister who used to work in Belgrade, in the headquarters of the Yugoslavian army, as an assistant or secretary. She was close to where important things happened.

As a hobby, she was into sewing / tailoring / knitting, and for this reason, she purchased West German magazines which were ubiquitous at the time – thick, heavy catalogs for people into this hobby; Burda was one of them. The army supervised people working in its headquarters, so they knew about her reading these magazines, and this was suspicious. She was interrogated about it more than once.

Eventually; some time in her middle age years – not soon enough for retirement; she wanted a change of scenery, to go live back home, and quit. At this point, she became untrusted and a liability, and the way they dealt with that is that they had her interned in a psychiatric hosp…

Ossification and Hawaii: Impressions of a C++ working group

I've recently interacted informally with the mailing list of the ISO C++ Working Group. I've tried to float the following ideas.

Aggregated exceptions. I think I came up with a neat and complete proposal, but it's too ambitious for an existing language, given the changes it proposes and its relatively niche concern. We've migrated to VS 2015, so I've begrudgingly accepted noexcept destructors. And since C++11, lambdas provide a practical way to solve problems where one might previously want to use complex destructors.

So I guess we can live without multi-exceptions. Okay.

I then tried to float an is_relocatable property. A shortcoming of C++ right now is that it allows object content to be moved; but it doesn't allow movement of objects themselves. Even though anywhere from 50% to 100% of the objects we store in containers can be moved with memcpy — formally, this is undefined behavior. This is a problem for container resizing, and requires inefficient deep copy…

Love and function

Someone asked the following conundrum. This was asked in the context of whether it's "shallow" for a person to refuse another as a partner, based solely on that they aren't sexually compatible:

"If your love is predicated on sex then is it really love or is it just two people using each other?"

Loving someone, and being useful to them, are not opposites. The two work together. To love someone is to offer yourself to be useful to them. It is to serve them gladly, with the expectation that this will be appreciated and returned. To accept being loved is to welcome this offer; to return it, and appreciate it.

Love is a willingness to serve: without coercion, and without feeling coerced.

"Love" and "relationship", though, are different things. Every one of us can love everyone, hypothetically. However, we can't have functional relationships with people who can't meet our needs.

Relationships are love + function. If you take away the fu…

"Good, traditional" traits

I find that "good" and "traditional" don't exactly go hand in hand.

If it makes sense, it's not called tradition. It's called common sense. If it's called tradition, it means that at some level, it doesn't make sense. It's being practiced despite it.

It does not make a person good if they follow imperatives that violate sense. It makes them compliant.

Being compliant makes sense, to an extent. However, being overly compliant makes you a tool. At best, you're a tool for nonsense. At worst, you're a tool for perpetuation of suffering and hardship.

Attractiveness is not shallow

There are large groups of men online — they're mostly men — who consider themselves unattractive, and adopt this as their identity, and an embittered perch from which to carp about life.

If you're an unattractive man — or woman — stop the lifestyle that makes you feel and look that way.

Most people can look great if they invest the effort. You aren't going to get taller, and you aren't going to grow a bigger penis. But you can fix almost anything else - lose fat, gain muscle, develop a sense of style, develop self confidence due to the results you have achieved.

None of this is beyond anyone's reach save a handful of really unfortunate people. Chances are that you're not one of those. Chances are that, if you think of yourself as unattractive, it's a result of a lifetime of ugly thoughts leading to disrespect and neglect of yourself and your body.

Now tell me. Who wants a person who chooses a lifetime of these ugly thoughts? Who has the option to invest the…

VS 2015 projects: "One or more errors occurred"

Image
For the most part, I find that Visual Studio 2015 is awesome. However, it did ship with kinks that need to be worked out. Not least, it has crashed on me from time to time, while working on a large solution.

I recently experienced a problem where I couldn't open Visual C++ projects (.vcxproj) after I copied them to another location. When trying to open the projects, VS 2015 would give me nothing more than this "extremely useful" error:


That is some talent, right there. That must have taken a lot of work to get this right.

After trying various things, and having researched this without success for a few hours, I finally got the idea to try opening the projects in Visual Studio 2013, instead.

Behold: VS 2013 actually displayed a useful error, which informed me that my projects had Import dependencies that I forgot to move.

So, yeah. If VS 2015 helpfully tells you that "one or more errors occurred" — try VS 2013.

Algorithm for selective archival or aggregation of records

Given the absurdity of the US patent system, it comes to mind that I should publish all technical ideas, no matter how inane, when I think of them — simply to provide a prior art reference, in case anyone claims that idea in a future patent.

The ideas I publish are arrived at independently, and based on publicly available information. This does not mean that existing and currently "valid" patents don't exist that cover parts of my ideas. It does, however, mean that such patents are obvious, and that the patent system is legalized enabling of extortion.

Without further ado, here's an idea for how to archive old log files to:
maintain required storage under a manageable threshold;store the latest data, as well as older data in the event of undetected corruption;avoid predictability to an attacker who might rely on a particular pattern of deletion.We assume that log files are being archived in regular periods. This period may be an hour, a day, a week, or whatever works …