Today, a client asked for a way to hide the content of one page from casual browsers. I came up with the following:

$wgHooks['BeforePageDisplay'][] = 'stopDisplay';
function stopDisplay( $output, $skin ) {
        if( 'Passwords galore' === $output->getPageTitle() ) {
                global $wgUser, $wgTitle;
                if( !$wgTitle->userCan( "edit" ) ) {
                        $output->clearHTML();
                        $wgUser->mBlock = new Block( '127.0.0.1', 'WikiSysop', 'WikiSysop', 'none', 'indefinite' );
                        $wgUser->mBlockedby = 0;
                        $output->blockedPage();
                        return false;
                }
        }
        return true;
}

There may be another way to do this and this is certainly not secure against all attempts to read page content. For instance, if you want to hide a Wiki page like [[Passwords_galore]] from people using this technique, all they would have to do is include it using a template to get around this hack: {{:Passwords galore}}.

I’ll be looking at more ways to access the page and more ways to block it soon.

 | Posted by | Categories: mediawiki |

This is just a general reminder that life sucks, not a navel-gazing, self-pitying examination of my own life. I’ll save that for another day. This is just a rambling rant that I felt the need to write down.

Most of us who don’t live in war zones get complacent. We like safety and comfort. We like predictability. We want tomorrow to be only moderately different than today. Not exactly the same, mind you. We saw Groundhog Day already and are pretty sure that would be a nightmare.

Even if we do like to mix it up some — Skydiving, anyone? — we are still looking for exciting, exhilarating life experiences, not life changing catastrophes.

But the reality is that life is filled with pain and heartache. The reality is that danger is ever-present and tomorrow, let alone the next second, isn’t guaranteed.

Too often, we come up against this hard reality and we wonder “Why me? What did I do to deserve this?” Yes, something you did probably contributed to how your life sucks, but even if you lived perfectly and we can find nothing to fault you with, life sucks and, worse, it isn’t fair so your life will suck or, if you’ve somehow been able to live a life of pure bliss in which you did nothing wrong (ha!), you are still going to die.

But that isn’t all. Before you die, you’ll see people you care about, even those you love, having a sucky life and dying.

So, yeah, your life will suck. You’ll end up miserable and experiencing more pain than you deserve.

Instead of asking “Why me?” — instead of thinking that you shouldn’t have to live in misery and fear, remember that everyone’s life sucks. If you spend a little time reflecting on it, you’ll probably realize things could be worse. At the very least, you should realize that your misery isn’t unique. Everyone else’s life sucks at some point, so a better question is “Why not me?”

Instead of looking at the person you despise who is in misery and feeling smug or thinking “Well, that person deserved it!” try asking yourself “Why not me?” If you do that right — if you realize there really is little reason for you to escape suffering for what you’ve done while that person is in misery — you’ll find yourself hoping that the person you despise quickly recovers.

Yes, life sucks. Yours, mine, and everyone else’s. There is no escaping it. Misery and suffering are inevitable.

 | Posted by | Categories: life |

I love to read, and I love to read books that make learning fun; The Information is one of those books.

I’ve been enjoying the trip the book provides. It talks about the some of the oldest written language we have and quotes Plato sounding like a teacher complaining about the invention of the pocket calculator:

For this invention [writing] will produce forgetfulness in the minds of those who learn to use it. … You have invented an elixir not of memory, but of reminding; and you offer your pupils the appearance of wisdom, not true wisdom.

Imagine if Plato saw how many of us use more modern technology — an always-available Internet search engine, for example — so that we don’t even have to think twice about getting access to entire libraries of “the appearance of wisdom”.

It goes on from there to explain how people in Africa developed long-distance communication with their “talking drums” long before Europeans had strung up the first telegraph. He uses the telegraph to lead into a discussion of cryptography, information theory, and data compression.

Over and over, he returns to this idea of how we communicate and collect and understand our knowledge. In the process he introduces people like Gödel and his incompleteness theorem or lesser known people like his student, Gregory Chaitin, a mathematician who so fascinated me that I went looking for the source of a quote and discovered his “Paradoxes of Randomness, a piece of which I’ve managed to quote in my email signature:

Sometimes mathematical truth is completely random and has no structure or pattern that we will ever be able to understand. It is not the case that simple clear questions have simple clear answers, not even in the world of pure ideas, and much less so in the messy real world of everyday life.

Of course, any recent book about how we think about what we know and how we collect and classify what we know wouldn’t be complete without some discussion of Wikipedia. And, here, there was a hidden gem for me. I discovered that I know one of the characters in a story he tells about the growth of an article about a butcher shop in South Africa. Jimbo Wales, co-founder of Wikipedia, created a stub article about a butcher shop he visited and a few hours later, ^demon, a developer I’ve worked with at Wikimedia and grown to respect for his keen eye for detail proposes deletion.

I fairly squealed when I saw ^demon’s handle in the book.

But even if you don’t know ^demon or appreciate the finer details of information theory, you’ll likely enjoy the book. I asked my 14 year old son to read a bit and he quickly tore through the first few chapters before agreeing that it was well-written, fairly entertaining, and accessible.

 | Posted by | Categories: books |

40 years of life

28 March 2013

Sunset may 2006 panorama.jpg
Today marks 40 years since my birth.

It is a birthday I share with Lady Gaga (but she is 13 years my junior); the Three Mile Island leak (when I was 6); Anheuser Busch, Jr., a beer brewing magnate; and the death (four years before my birth) of President Eisenhower (one of my favorite presidents for his prescient words about the “military-industrial complex”: the potential for the disastrous rise of misplaced power exists and will persist. (As it happens Ronald Reagan was shot just two days after my eighth birthday, but I would have to wait exactly four months for my wife to be born.)

There is a lot more you could learn about March 28 in the news or in the Orthodox Church (my chosen religious tradition), but I’ve spent far too much time navel-gazing for now.

Instead, I’ll just note that the past 10 years have been a lot better than I ever thought they would be. I’ve been lucky enough to survive an head injury and I moved to the East Coast but I still haven’t got my first billion dollars. Somehow I still manage to be happy and satisfied with where I’m at with my family, friends, and life.

(Photo is CC BY-NC. Photographer is Fir0002/Flagstaffotos.)

 | Posted by | Categories: life |

File:Old-Train-Engine.JPGYoda is well known for (among other things) his admonition to Luke Skywalker: “Do or do not. There is no try.” I like the saying, but when I’ve mentioned it to some people, they’ve taken offense. Americans, in particular, seem to be put off by this sentiment.

My impression is that our concept of “trying” is influenced by the story of the The Little Engine that Could. We look at our failures and console ourselves with “Well, at least I tried.”

Now, of course there is nothing wrong with trying. But sometimes that is the entirety of our effort. I came across this quote today that helped me think about this some more:

[I]t is important to distinguish “training” from “trying.” I might try very hard to win a marathon race, but if I have not trained, I will not even finish, not to mention win. Without training, the resources simply are not in my muscles, they are not in the ingrained habit structures of my body. On the day of the race, no amount of trying will make up for the failure to train. It is the training that will enable me to participate effectively in the race.

Richard Foster in Christianity Today


The quote was part of larger chapter on askesis (Greek: ἄσκησις) or spiritual exercise. But leaving aside the spiritual component, the Richard Foster quote above makes it clearer why just putting in an effort to accomplish something is insufficient.

In discussing “trying” vs “training” this morning, I came to a realization: trying something lasts only as long as our interest. In order to try, we don’t have to plan or prepare. Who knows? It is possible you’ll succeed if you try without any preparation. Indeed, some people will try so many times (taking the to heart the aphorism “If at first you don’t succeed, Try, try, try again.”) without any more preparation that the culmination of all your effort (and the practice that comes with it) will result in success.

But any real effort to achieve a goal will require some planning. It will require effort even when we don’t feel like trying any more because our failures have so discouraged us.

With this understanding, Yoda’s words (“Do or do not. There is no try.”) become clear. He isn’t telling us failure isn’t an option, but that we can’t be satisfied with just making an effort. If we’re really interested in finishing successfully, making an effort isn’t enough.

An example from my life is probably the best way to clarify this. I’ve been trying to lose some weight for quite some time. Instead, since my accident (when I lost a few pounds), I’ve gained almost 25lbs (11kg or 2 stone). I was trying to lose weight but the whole time I gained weight. But I didn’t have a plan. Without planning, I ate more than I needed to for the work I was doing. Without planning to, I gained weight. I should have realized “there is no try”.

 | Posted by | Categories: life |

File:Gyárfás_Piety.jpgI had an interesting discussion with a friend about piety and morality after I pointed to Fr. Stephen’s essay on “Godless Morality on Twitter.

This led me to look up what these two words have to do with each other. From Wikipedia:

Piety
The word piety comes from the Latin word pietas, the noun form of the adjective pius (which means “devout” or “good”). Pietas in traditional Latin usage expressed a complex, highly valued Roman virtue; a man with pietas respected his responsibilities to gods, country, parents, and kin.

Morality
Morality (from the Latin moralitas “manner, character, proper behavior”) is the differentiation of intentions, decisions, and actions between those that are “good” (or right) and those that are “bad” (or wrong).

So, moral behavior would be derived from the piety one felt and what that respect would mean. Morality, to put it bluntly, cannot be objectively quantified. All morality is relative.

(We usually say “filial piety” when we mean respect to the family to distinguish it from respect for one’s god. It is interesting that the original Latin word could be used to talk about piety towards one’s country. Today, we use the word “patriotism” for that.)

As a result of this etymological search I don’t see a separation between piety (in the more general, Latin, sense) and morality. It looks to me like morality flows from the pieties one maintains.

That is, if you don’t have piety for my God, you won’t be motivated to do things that are in the moral system I have that results from the pieties I maintain.

Most of us have piety (that is, respect) for at least some sense of order and life, so prohibitions against, say, murder fit into both of our moral frameworks.

However, I have piety (respect) for God that others don’t share. Many people have a great piety towards science or reason that I don’t share. So they will do things that I wouldn’t do and I’ll do things that they won’t do. (For example, I am more ready to embrace the irrational, and many people don’t bother with loving God.)

So, when you hear people ranting about how immoral some people are, they’re absolutely right. However, they can’t expect anyone who doesn’t share their pieties to share their morality.

 | Posted by | Categories: life |

Recommended Reading: 1491

22 November 2012

I just finished reading 1491 by Charles C. Mann, and I have to say, everyone should read this.

Columbus discovery of the Americas changed the world, but until reading this book, I didn’t have any clue of the degree to which the world changed. Before reading it, the idea I had of the Americas that Europeans discovered was closer to that of the noble savage than anything else. In my old, incorrect, paradigm, the indigenous population was destroyed by the genocide of greedy conquistadors and similar violence.

Instead, anthropologists now think that that the population of the New World rivaled that of the Old, but the people there lacked genetic diversity. An example of this would be the distribution of blood types. The A and B blood alleles were almost completely absent in Central and South America, so that the entire population had Type O blood.

As a result of this homogeneity, the lack of exposure to contagious diseases like smallpox and the plague, and the resulting ignorance of how to use quarantine meant that disease decimated 90% of the indigenous population before they even saw an explorer.

That information alone cast the native population in a new light. But this also means that the populations of the various fauna found in the Americas was much smaller than later observed. For example, the natives kept large animals like the bison a days journey from any village and kept their population under control.

Another story of the fauna of North America is the passenger pigeon. It is now extinct, but John James Audubon recorded watching what must have been billions of pigeons passing overhead for three days straight. The bird was not seen in this magnitude because the indigenous people kept them in check.

Finally, 1491 showed me that the foods from the Americas have become the staples of the world. Three of the top five staple foods that the world consumes — maize (corn), potatoes, and cassava — have their origins in the Americas. Mann asserts that the introduction of cassava into Africa made the later slave trade possible since it became the staple of choice in much of Africa.

I haven’t even talked about how great the civilizations in America were — empires rivaling those of ancient Rome grew and thrived and then died out centuries before the first explorer showed up. In the past, some people have floated theories of ancient European colonizers to explain the unexpected sophistication that we found among the “noble savages”.

So go get a copy of 1491. You won’t regret it.

 | Posted by | Categories: books |

Robots are job creators

19 November 2012

File:Toyota_Robot_at_Toyota_Kaikan.jpgI was catching up on my reading this morning when I saw (via Patrick’s “Jobs worth doing” post) a Gizmodo article about things that computers are doing now, notably sports writing and filling out perscriptions.

These two cases aren’t terribly frightening: filling perscriptions is clearly something that should be automated to reduce the number of potentially fatal errors. And, as the article points out, most sports readers aren’t looking for great prose — they just want the highlights.

Now comes the question: What happens when computers take my job. Some people, (like this commentor) will see this as a good thing:

Tax the robotic factory well enough to give the unemployed decent wages for doing “nothing”. If you work you get paid very well. If you choose to go surfing every day and live off of the state you get a nice check to cover your living expenses.

I’m just as lazy as the next person — probably lazier — so I definitely see the attraction for being paid to surf. But I also think that humans are extremely creative and love to be challenged.

That, and I’m prejudiced: I’ve never been surfing. It could be that surfing poses new challenges every day. It would certainly challenge me if I were to try it.

And this, too, is why I’m not too concerned about a computer taking my job. If it takes my job, I’ll figure out something else to do. It may not pay as well, and I may end up hunting for feral cats to feed my family, but we’ll get by.

The idea of getting robot-run factories to just support people whose job has been “taken” by a computer job doesn’t seem reasonable (or scalable), though. In fact, it would probably serve to stifle creativity.

And it is here that my faith in people’s ability to creatively cope comes into play. When faced with elimination people have risen to meet the challenge. Which is not to say that everything will be fine and no one will suffer. Suffering is a given. Those of us who are suffering will probably use a lot of energy — all of it, sometimes — to deal with the suffering. But those of us on the edge see suffering and it motivates us to come up with new solutions, ways to escape the suffering.

Which is to say, those robots taking your jobs are (indirectly, at least) job creators

 | Posted by | Categories: life, meta |

Open Source Bricks

12 November 2012

The Year of Open Source has discovered the $1500 brick press that Open Source Ecology has developed.

This got my interest because it uses dirt and an inexpensive 20-ton press to make bricks. I spent the summer of 1987 working at an orphanage outside of Cap-Haïtien using cinder blocks made on-site. Since the design of the brick press is available for anyone to use, I could see a village using a portable brick press to help build new buildings.

The cost of raw materials for cinder blocks is more than the pressed bricks — cement is needed for the cinder blocks, pressed bricks only need dirt — and the manpower needed looks roughly equal. The trouble comes because, as cheap as it is, the brick press is more expensive than the equipment needed for creating cinder blocks,

Still, I’m curious.

 | Posted by | Categories: life |

MediaWiki support

8 November 2012

Monday, I announced MediaWiki 1.20.0, affirmed a six-month release cycle, and stated a plan for long-term support for the 1.19 series of MediaWiki. This is the first release that has been managed by a non-WMF employee, and I think it bodes well for third party users of MediaWiki.

I’m hoping that by working with Debian and other Linux distributor on 1.19 support, we can make MediaWiki more welcoming to new and old users. For example, by looking at some of the older MediaWiki installations recorded on WikiStats, I contacted a few wikis and encouraged them to upgrade to 1.19, especially some that were running ancient MediaWiki.

Long term support is especially important for people who customize MediaWiki for their own use. Of course, I would encourage anyone who adapts MediaWiki like this to use hooks and, ideally, share their modifications with us. But, as Linus Torvalds says, “reality is complicated”.

So, instead of saying telling users of MediaWiki “If you modify MediaWiki, we can’t help you at all”, I would rather say, “We’re going to support this version for 2 years, but you’re responsible for upgrading to the next release when the time comes.”

This gives people something that they’re able to plan around more easily than something that changes every six months. Using WikiStats, I’ll contact more MediaWiki installations that are out of date, encourage them to upgrade, and let them know how they can be notified of security updates and later long term support updates.

We have a really good tool, but we need to support users who aren’t the Wikimedia Foundation itself better. This is a start that should encourage the users of MediaWiki to keep their installations up-to-date as well as encourage wider use of MediaWiki.

 | Posted by | Categories: programming, wmf |