20 stories

If you blow up the Constitution, you’ll regret it


Predictably, the Stoneman Douglas High School shooting has triggered some talk on the left – and in the mainstream media, but I repeat myself – of repealing the Second Amendment.

I am therefore resharing a blog post I wrote some time back on why repealing 2A would not abolish the right to bear arms, only open the way to the U.S. government massively violating that right. Rights are not granted by the Constitution, they are recognized by it. This is black-letter law.

Thus, repeal of any right enumerated in the Constitution is not possible without abrogating the Constitutional covenant – destroying the legal and moral foundations of our system. The ten in the Bill of Rights are especially tripwires on an explosive that would bring the whole thing down. And of all these, the First and Second are especially sensitive. Approach them at your peril.

I will now add a very sober and practical warning: If the Constitution is abrogated by a “repeal” of 2A, it will be revolution time – millions of armed Americans will regard it as their moral duty to rise up and kill those who threw it in the trash. I will be one of them.

Left-liberals, you do not want this. I’m a tolerant libertarian, but many of the revolutionaries I’d be fighting alongside would be simpler and harder men, full of faith and hatred. If that revolution comes, you will lose and the political aftermath is likely to be dominated by people so right-wing that I myself would fear for the outcome.

You should fear it much more than I. Back away from those tripwires; you are risking doom. Ethnic cleansing? Theocracy? Anti-LGBT pogroms? Systematic extermination of cultural Marxists? In a peaceful, Constitutional America these horrors will not be. If you blow up the Constitution, they might.

Read the whole story
1632 days ago
Share this story

Follow my leader

1 Share

Choosing a key-map for your custom Vim commands can be difficult. The common advice is to use <leader> for user-defined mappings, but that’s not the only option. There are dozens of two-key mappings that are not bound to any built-in functionality. These available mappings are easy to find if you follow a simple formula.

Read the whole story
3102 days ago
Share this story

Dimitri Fontaine: Trigger Parameters

1 Share

Sometimes you want to compute values automatically at INSERT time, like for example a duration column out of a start and an end column, both timestamptz. It's easy enough to do with a BEFORE TRIGGER on your table. What's more complex is to come up with a parametrized spelling of the trigger, where you can attach the same stored procedure to any table even when the column names are different from one another.

I found a kind of trigger that I can use!

The exact problem to solve here is how to code a dynamic trigger where the trigger's function code doesn't have to hard code the field names it will process. Basically, PLpgSQL is a static language and wants to know all about the function data types in use before it compiles it, so there's no easy way to do that.

That said, we now have hstore and it's empowering us a lot here.

The exemple

Let's start simple, with a table having a d_start and a d_end column where to store, as you might have already guessed, a start timestamp (with timezone) and an ending timezone. The goal will be to have a parametrized trigger able to maintain a duration for us automatically, something we should be able to reuse on other tables.

create table foo (
  id serial primary key,
  d_start timestamptz default now(),
  d_end timestamptz,
  duration interval

insert into foo(d_start, d_end)
     select now() - 10 * random() * interval '1 min',
            now() + 10 * random() * interval '1 min'
       from generate_series(1, 10);

So now I have a table with 10 lines containing random timestamps, but none of them of course has the duration field set. Let's see about that now.

Playing with hstore

The hstore extension is full of goodies, we will only have to discover a handful of them now.

First thing to do is make hstore available in our test database:

# create extension hstore;

And now play with hstore in our table.

# select hstore(foo) from foo limit 1;

 "d_end"=>"2013-08-23 11:34:53.129109+01",
 "d_start"=>"2013-08-23 11:16:04.869424+01",
(1 row)

I edited the result for it to be easier to read, splitting it on more than one line, so if you try that at home you will have a different result.

What's happening in that first example is that we are transforming a row type into a value of type hstore. A row type is the result of select foo from foo;. Each PostgreSQL relation defines a type of the same name, and you can use it as a composite type if you want to.

Now, hstore also provides the #= operator which will replace a given field in a row, look at that:

# select (foo #= hstore('duration', '10 mins')).* from foo limit 1;
 id |            d_start            |             d_end             | duration 
  1 | 2013-08-23 11:16:04.869424+01 | 2013-08-23 11:34:53.129109+01 | 00:10:00
(1 row)

We just replaced the duration field with the value 10 mins, and to have a better grasp at what just happened, we then use the (...).* notation to expand the row type into its full definition.

We should be ready for the next step now...

The generic trigger, using hstore

Now let's code the trigger:

create or replace function tg_duration()
 -- (
 --  start_name    text,
 --  end_name      text,
 --  duration      interval
 -- )
 returns trigger
 language plpgsql
as $$
   hash hstore := hstore(NEW);
   duration interval;
   duration :=  (hash -> TG_ARGV[1])::timestamptz
              - (hash -> TG_ARGV[0])::timestamptz;

   NEW := NEW #= hstore(TG_ARGV[2], duration::text);


And here's how to attach the trigger to our table. Don't forget the FOR EACH ROW part or you will have a hard time understanding why you can't accedd the details of the OLD and NEW records in your trigger: they default to being FOR EACH STATEMENT triggers.

The other important point is how we pass down the column names as argument to the stored procedure above.

create trigger compute_duration
     before insert on foo
          for each row
 execute procedure tg_duration('d_start', 'd_end', 'duration');

Equiped with the trigger properly attached to our table, we can truncate it and insert again some rows:

# truncate foo;
# insert into foo(d_start, d_end)
       select now() - 10 * random() * interval '1 min',
              now() + 10 * random() * interval '1 min'
         from generate_series(1, 10);

# select d_start, d_end, duration from foo;
            d_start            |             d_end             |    duration     
 2013-08-23 11:56:20.185563+02 | 2013-08-23 12:00:08.188698+02 | 00:03:48.003135
 2013-08-23 11:51:10.933982+02 | 2013-08-23 12:02:08.661389+02 | 00:10:57.727407
 2013-08-23 11:59:44.214844+02 | 2013-08-23 12:00:57.852027+02 | 00:01:13.637183
 2013-08-23 11:50:18.931533+02 | 2013-08-23 12:00:52.752111+02 | 00:10:33.820578
 2013-08-23 11:53:18.811819+02 | 2013-08-23 12:06:30.419106+02 | 00:13:11.607287
 2013-08-23 11:56:33.933842+02 | 2013-08-23 12:01:15.158055+02 | 00:04:41.224213
 2013-08-23 11:57:26.881887+02 | 2013-08-23 12:05:53.724116+02 | 00:08:26.842229
 2013-08-23 11:54:10.897691+02 | 2013-08-23 12:06:27.528534+02 | 00:12:16.630843
 2013-08-23 11:52:17.22929+02  | 2013-08-23 12:02:08.647837+02 | 00:09:51.418547
 2013-08-23 11:58:18.20224+02  | 2013-08-23 12:07:11.170435+02 | 00:08:52.968195
(10 rows)


Thanks to the hstore extension we've been able to come up with a dynamic solution where you can give the name of the columns you want to work with at CREATE TRIGGER time rather than hard-code that in a series of stored procedure that will end up alike and a pain to maintain.

Read the whole story
3275 days ago
Share this story

The NSA is Commandeering the Internet

1 Comment and 16 Shares

It turns out that the NSA's domestic and world-wide surveillance apparatus is even more extensive than we thought. Bluntly: The government has commandeered the Internet. Most of the largest Internet companies provide information to the NSA, betraying their users. Some, as we've learned, fight and lose. Others cooperate, either out of patriotism or because they believe it's easier that way.

I have one message to the executives of those companies: fight.

Do you remember those old spy movies, when the higher ups in government decide that the mission is more important than the spy's life? It's going to be the same way with you. You might think that your friendly relationship with the government means that they're going to protect you, but they won't. The NSA doesn't care about you or your customers, and will burn you the moment it's convenient to do so.

We're already starting to see that. Google, Yahoo, Microsoft and others are pleading with the government to allow them to explain details of what information they provided in response to National Security Letters and other government demands. They've lost the trust of their customers, and explaining what they do -- and don't do -- is how to get it back. The government has refused; they don't care.

It will be the same with you. There are lots more high-tech companies who have cooperated with the government. Most of those company names are somewhere in the thousands of documents that Edward Snowden took with him, and sooner or later they'll be released to the public. The NSA probably told you that your cooperation would forever remain secret, but they're sloppy. They'll put your company name on presentations delivered to thousands of people: government employees, contractors, probably even foreign nationals. If Snowden doesn't have a copy, the next whistleblower will.

This is why you have to fight. When it becomes public that the NSA has been hoovering up all of your users' communications and personal files, what's going to save you in the eyes of those users is whether or not you fought. Fighting will cost you money in the short term, but capitulating will cost you more in the long term.

Already companies are taking their data and communications out of the US.

The extreme case of fighting is shutting down entirely. The secure e-mail service Lavabit did that last week, abruptly. Ladar Levison, that site's owner, wrote on his homepage: "I have been forced to make a difficult decision: to become complicit in crimes against the American people or walk away from nearly ten years of hard work by shutting down Lavabit. After significant soul searching, I have decided to suspend operations. I wish that I could legally share with you the events that led to my decision."

The same day, Silent Circle followed suit, shutting down their e-mail service in advance of any government strong-arm tactics: "We see the writing the wall, and we have decided that it is best for us to shut down Silent Mail now. We have not received subpoenas, warrants, security letters, or anything else by any government, and this is why we are acting now." I realize that this is extreme. Both of those companies can do it because they're small. Google or Facebook couldn't possibly shut themselves off rather than cooperate with the government. They're too large; they're public. They have to do what's economically rational, not what's moral.

But they can fight. You, an executive in one of those companies, can fight. You'll probably lose, but you need to take the stand. And you might win. It's time we called the government's actions what they really are: commandeering. Commandeering is a practice we're used to in wartime, where commercial ships are taken for military use, or production lines are converted to military production. But now it's happening in peacetime. Vast swaths of the Internet are being commandeered to support this surveillance state.

If this is happening to your company, do what you can to isolate the actions. Do you have employees with security clearances who can't tell you what they're doing? Cut off all automatic lines of communication with them, and make sure that only specific, required, authorized acts are being taken on behalf of government. Only then can you look your customers and the public in the face and say that you don't know what is going on -- that your company has been commandeered.

Journalism professor Jeff Jarvis recently wrote in the Guardian: "Technology companies: now is the moment when you must answer for us, your users, whether you are collaborators in the US government's efforts to 'collect it all -- our every move on the internet -- or whether you, too, are victims of its overreach."

So while I'm sure it's cool to have a secret White House meeting with President Obama -- I'm talking to you, Google, Apple, AT&T, and whoever else was in the room -- resist. Attend the meeting, but fight the secrecy. Whose side are you on?

The NSA isn't going to remain above the law forever. Already public opinion is changing, against the government and their corporate collaborators. If you want to keep your users' trust, demonstrate that you were on their side.

This essay originally appeared on TheAtlantic.com.

Slashdot thread. And a good interview with Lavabit's founder.

Read the whole story
3283 days ago
Share this story
1 public comment
3279 days ago
If you can't fight illegal actions because it's the right thing to do, then at least do it because it will be good for your business.

The Public/Private Surveillance Partnership

1 Comment and 4 Shares

Imagine the government passed a law requiring all citizens to carry a tracking device. Such a law would immediately be found unconstitutional. Yet we all carry mobile phones.

If the National Security Agency required us to notify it whenever we made a new friend, the nation would rebel. Yet we notify Facebook. If the Federal Bureau of Investigation demanded copies of all our conversations and correspondence, it would be laughed at. Yet we provide copies of our e-mail to Google, Microsoft or whoever our mail host is; we provide copies of our text messages to Verizon, AT&T and Sprint; and we provide copies of other conversations to Twitter, Facebook, LinkedIn, or whatever other site is hosting them.

The primary business model of the Internet is built on mass surveillance, and our government's intelligence-gathering agencies have become addicted to that data. Understanding how we got here is critical to understanding how we undo the damage.

Computers and networks inherently produce data, and our constant interactions with them allow corporations to collect an enormous amount of intensely personal data about us as we go about our daily lives. Sometimes we produce this data inadvertently simply by using our phones, credit cards, computers and other devices. Sometimes we give corporations this data directly on Google, Facebook, Apple Inc.'s iCloud and so on in exchange for whatever free or cheap service we receive from the Internet in return.

The NSA is also in the business of spying on everyone, and it has realized it's far easier to collect all the data from these corporations rather than from us directly. In some cases, the NSA asks for this data nicely. In other cases, it makes use of subtle threats or overt pressure. If that doesn't work, it uses tools like national security letters.

The result is a corporate-government surveillance partnership, one that allows both the government and corporations to get away with things they couldn't otherwise.

There are two types of laws in the U.S., each designed to constrain a different type of power: constitutional law, which places limitations on government, and regulatory law, which constrains corporations. Historically, these two areas have largely remained separate, but today each group has learned how to use the other's laws to bypass their own restrictions. The government uses corporations to get around its limits, and corporations use the government to get around their limits.

This partnership manifests itself in various ways. The government uses corporations to circumvent its prohibitions against eavesdropping domestically on its citizens. Corporations rely on the government to ensure that they have unfettered use of the data they collect.

Here's an example: It would be reasonable for our government to debate the circumstances under which corporations can collect and use our data, and to provide for protections against misuse. But if the government is using that very data for its own surveillance purposes, it has an incentive to oppose any laws to limit data collection. And because corporations see no need to give consumers any choice in this matter -- because it would only reduce their profits -- the market isn't going to protect consumers, either.

Our elected officials are often supported, endorsed and funded by these corporations as well, setting up an incestuous relationship between corporations, lawmakers and the intelligence community.

The losers are us, the people, who are left with no one to stand up for our interests. Our elected government, which is supposed to be responsible to us, is not. And corporations, which in a market economy are supposed to be responsive to our needs, are not. What we have now is death to privacy—and that's very dangerous to democracy and liberty.

The simple answer is to blame consumers, who shouldn't use mobile phones, credit cards, banks or the Internet if they don't want to be tracked. But that argument deliberately ignores the reality of today's world. Everything we do involves computers, even if we're not using them directly. And by their nature, computers produce tracking data. We can't go back to a world where we don't use computers, the Internet or social networking. We have no choice but to share our personal information with these corporations, because that's how our world works today.

Curbing the power of the corporate-private surveillance partnership requires limitations on both what corporations can do with the data we choose to give them and restrictions on how and when the government can demand access to that data. Because both of these changes go against the interests of corporations and the government, we have to demand them as citizens and voters. We can lobby our government to operate more transparently -- disclosing the opinions of the Foreign Intelligence Surveillance Court would be a good start -- and hold our lawmakers accountable when it doesn't. But it's not going to be easy. There are strong interests doing their best to ensure that the steady stream of data keeps flowing.

This essay originally appeared on Bloomberg.com.

Read the whole story
3293 days ago
Share this story
1 public comment
3292 days ago
The losers are us, the people, who are left with no one to stand up for our interests. Our elected government, which is supposed to be responsible to us, is not. And corporations, which in a market economy are supposed to be responsive to our needs, are not. What we have now is death to privacy—and that's very dangerous to democracy and liberty.

The People may be losing, but they dont have to be losers. Perhaps I am overly idealistic, but I dont think this will be taken laying down forever. Government has appeared beyond reproach in the past and it was disciplined (through regime change, new legal norms or open revolt). As for companies in a market, well identifying these companies as corporatists and not capitalists will help. The cry of the free market is seductive. Free to do what exactly? Abuse, manipulate, and control? Perfect competition is what we want, where we can discipline actors with our dollars. "Free markets" are ironically not free, they are a small club of megalomaniacle sociopaths that are permitted to exist by manipulating and deceiving those that patronize their wares....
Baltimore, MD

Blocks Out The Glaring Customers


(Grocery Store | FL, USA)

Grocery Store | FL, USA

(My coworker has just had laser corrective surgery on his eyes. Unfortunately, he’s experiencing a much greater than usual amount of swelling in the area. His optometrist has prescribed him eye drops and told him to keep sunglasses on at all times, until the swelling goes down, as bright light causes irritation.)

Customer: “Excuse me!”

(My coworker and I notice an older customer glaring at him angrily.)

Coworker: “Can I help you, ma’am?”

Customer: “How DARE you!”

Coworker: “Sorry?”

Customer: “You take those off right this instant! I won’t stand for this disrespect!”

Coworker: “You mean these?” *points to his sunglasses* “Oh, I’m sorry. I didn’t mean to offend you. It’s just that I had laser surgery on my eyes, and the eye doctor told me I have to keep these on because bright light makes the swelling worse.”

Customer: “LIAR!”

(The customer lunges over the counter and grabs the glasses right off of his face. She puts several bloody scratches on his forehead with her long fingernails.)

Coworker: “Oh, God!”

(My coworker clutches his face, doubles over, and staggers head-first into a wall.)

Me: “Good God, lady! Why the h*** did you do that?!”

Customer: “You young ruffians are worthless! Not showing me the respect I deserve because you want to look ‘cool’!”

(She drops the sunglasses on the ground and stomps on them, shattering them. The noise and commotion have attracted our manager.)


Customer: “That young punk was disrespecting me with his gang stuff! I demand that you fire him immediately!”

(The manager looks at the shattered sunglasses on the ground, and my coworker, who is doubled up, moaning and bleeding.)

Manager: “Did you assault my employee?”

Customer: “I can do whatever I want to scum like him! I’m the customer, so he has to do what I say! And he needed to be taught a lesson about respect, with those stupid things on his face!”

Manager: “He was wearing those because his optometrist told him not to look at any bright light!”

Customer: “You expect me to believe that? Give me a break! Now I DEMAND to be served RIGHT THIS INSTANT!”

Manager: “I’m calling the police.”

Customer: “Good! He SHOULD be in prison! He should rot there!”

(The customer actually stands there looking smug and triumphant as the manager calls the police right in front of her, while I lead my coworker to the front office to get the first aid kit. About ten minutes later, the cops show up. My manager and the general manager of the store explain to them what happened, with the customer agreeing the entire time, still convinced the cops will be on her side. It completely blows her mind when the cops start to drag her away instead, as she goes kicking and screaming that my coworker should be the one getting arrested, not her.)

Read the whole story
3300 days ago
Share this story
Next Page of Stories