Displaying feedback after each block in E-Prime

August 8, 2009

If you don’t use E-Prime for psychological experiments, skip this post.
It’s written for the benefit of psychologists who have the misfortune of using E-Prime without a programmer husband to help them out.
Read on

Sin, punishment and the Halting Problem

August 4, 2009

Sin, punishment and the Halting Problem
*This possibility is not available in Buddhism.

Was FogBugz really released ahead of schedule?

August 2, 2009

On July 20, FogCreek released FogBugz 7. Joel Spolsky bragged about being a week or two ahead of schedule thanks to using EBS 2.0. However, the release had some pretty annoying bugs. Those bugs were fixed in the next release, on July 28.

With all due respect to EBS, I think that instead of releasing ahead of time, FogCreek should have started eating their own dog food. They would have discovered most bugs themselves, fixed them and released approximately on schedule, but without the bugs.

The way I see it, the real release was on July 28, and the date of the buggy release is irrelevant.

Science and free will

June 8, 2009

On one hand, since I believe in the scientific approach, I don’t accept free will. Instead, I believe that human behavior is determined by the laws of nature, and where those laws are non-deterministic, our behavior is truly random.

However, I find I must assume free will or my world will be overturned. For example, without free will, ethics loses its significance. Of course, people will still behave ethically most of the time because of law enforcement, selfish genes and upbringing, but in the phrase “thou shalt not steal” the word shalt becomes meaningless.

Political freedom, too, becomes pointless. In the absence of free will freedom turns into recognized necessity. What difference does it make then if the state makes its citizens recognize a different necessity?

But science itself, paradoxically, needs free will, too. In experiments, independent variables are used to test causality. But how can a variable be independent in the absence of free will?

All of this is not to say that free will exists; rather, it’s a simplified model we have to contend ourselves with until we have a better one, in the same way that physics freshmen are implicitly taught that Consciousness causes collapse because we don’t yet have an established “correct” interpretation of quantum physics.

The new name

May 16, 2009

We in the Western world are used to names being fixed since our birth. In other cultures it is different. Indians, for example, used to take new names after significant events. Chinese children were sometimes given permanent names only at the age of three, when a monk would visit their house and choose a name for the child.

Nowadays, most urban Chinese have English names. They select these names for themselves in English lessons at school. Then they use those English names when talking to Westerners.

The modern Westerner has a name he chooses for himself, too. It’s the Web name. If one acquires even a little Web fame via one’s blog or some social site, the username becomes a name for all practical purposes. Sometimes, people are even called by their Web names in real life. (This hasn’t happened to me yet, though.)

My seven-year-old son already has a Web name he has invented for himself, and I’ve heard a friend call him by that name. Now that’s a child of the 21st century!

AshkEnte

May 1, 2009

The Rite of AshkEnte, quite simply, summons and binds Death. Students of the occult will be aware that it can be performed with a simple incantation, three small bits of wood and 4cc of mouse blood, but no wizard worth his pointy hat would dream of doing anything so unimpressive; they knew in their hearts that if a spell didn’t involve big yellow candles, lots of rare incense, circles drawn on the floor with eight different colours of chalk and a few cauldrons around the place then it simply wasn’t worth contemplating.

This quote from Terry Pratchett reminds me of programming.

Adding C code to Perl on PC

April 9, 2009

I tried adding an external C library to Perl, more specifically, ActivePerl on PC. Here are my findings:

The recommended way is using something called xsub, a utility that has its own language, XS. The process is documented in two long manpages, perlxs and perlxstut. It’s long and complicated, involving a makefile generated by a local script, makefile.pl, in turn generated by xsub. The makefile doesn’t work because the backslashes there aren’t escaped. I tried replacing each backslash that wasn’t at the end of a line by two backslashes, but it didn’t work for some other reason. The conclusion is that MakeMake is broken on PC, and therefore so is xsub.

Then there is C::DynaLoad. It allows calling functions from shared libraries. In its doc the author says that xsub is much cooler, but doesn’t explain why. The only reason I can think of is that it can work with Perl variables, but then why not allow passing those variables directly to C functions? Anyway, guess what. C::DynaLoad is written using xsub. So I still had to build it using the makefile and everything, and the makefile was still broken. I tried to find it compiled for PC, but failed.

Now on PC there is Win32::API. Actually it allows calling any function from a DLL. It’s like C::DynaLoad, only it doesn’t require compilation. It actually can receive the C prototype of a function, and you can pass structs that on the Perl side look like hashes. I compiled the library I needed into a DLL, and it works just fine.

On PC, calling C functions in DLLs is standard. This isn’t surprising, since it’s a very simple interface. Why does Linux require jumping through all those hoops? I suppose because it’s more interesting in a geekish way. And that’s symptomatic of the general reason why Linux isn’t popular.

As an aside, I used MinGW, a port of gcc, to compile the DLL. You have to make the functions __declspec(dllexport) and WINAPI (because that’s what Win32::API expects). Now gcc understands the former, but the latter is defined in "winnt.h", on which gcc chokes. It turns out that WINAPI is defined to mean __stdcall (not __pascal any more), and gcc understands that. Then the function names are decorated with @4. I suppose it’s possible to turn off this decoration, but it’s simpler to pass the decorated function names to Win32::API. It works. The flag for making DLLs is -shared.

The wise men of Chelm strike again

April 3, 2009

Recently I’ve mentioned that there are many Wise Men of Chelm in governmental agencies. Well, there are especially many in armies. Here’s a recent example from The Daily WTF.

Its logic runs like this: On one hand, we want to be able to deal with unexpected moves, so let’s add a random factor to the simulation. On the other hand, we want the random moves to be the same every time!

The Wise Men of Chelm

March 28, 2009

   

The wise men of Chelm are a gallery of wrong decision making. For example:

The wise men of Chelm discussed how to make the Chelmians in general wiser. They decided that stupid people should not have children. To achieve that, they decided to make the village shtetl idiot divorce his wife. “But he isn’t married”, someone objected. So the wise men decreed that the idiot should marry and then divorce.

That’s right. Set an intermediate goal and forget the final one. Large bureaucracies such as ministries and government agencies do that all the time.

The bridge at Chelm was dangerous: People passing over the bridge would slip at its end and break their arms or legs. So the wise men of Chelm decreed to build a hospital next to the bridge.

Programmers call that patching.

The Chelmians wanted to build a public bath. However, they couldn’t make up their minds whether to rasp the floor boards. For if they didn’t, people might get splinters in their feet, but if they did rasp and the boards were smooth, people might slip on the wet floor and fall. After discussing the matter for several days, the wise men decreed: The carpenter must rasp the boards but put them smooth side down.

Conflicting goals. And so on.

The wise men of Chelm live among us. Unfortunately, some of us are their employees.

Multivac

March 23, 2009

   

Isaac Asimov thought there would be a Multivac storing and processing data on all the people on Earth. In fact, he was quite close. Only there are several such Multivacs, each with its own part of the data. What Asimov missed completely is that the data is entered voluntarily, and most of it is publicly available.