Divide-and-Conquer Comic

Dezember 21st, 2010

I found this one recently in my old notes. Homage to xkcd is extremely visible, but I hope someone will enjoy this one. Art majors among us: read this!
divide-divide

Emacs icon

Oktober 17th, 2010

New Emacs iconOld Emacs iconAs for me, I dislike the current Emacs icon. I like the old one with meditating GNU much more. That’s why you can download the old icon (courtesy of Emacs developers, not me, of course) here and replace the ugly new one with it. The only drawback is that is is available in icon size only, but–pfft! I do it every time, when I update Emacs and am not too ignorant. To replace the icon on Mac OS X, download and unzip the icon collection file. Then go to the terminal and say

cp /Applications/Emacs.app/Contents/Resources/Emacs.icns /Applications/Emacs.app/Contents/Resources/Emacs-bad.icns
cp ~/Downloads/Emacs.icns /Applications/Emacs.app/Contents/Resources/Emacs.icns

MinionPro Microtype Config for XeTeX

September 19th, 2010

Protrusion in XeTeXJust recently MacTeX 2010 was released. It includes the new XeTeX, capable of doing microtypography. With an early version of modded microtype package it is possible to use microtype character protrusion in XeTeX. However, I could not find a suitable config for MinionPro. The MinionPro support files provide a microtype config for pdfLaTeX, but it does not work out of the box for XeTeX.

Hence, I modded the latter file to work with XeTeX. It is not perfect, as some glyphs, e.g., ffi ligature, seem to have wrong code. But it works for me, and it is definitely a base to start off. So, grab here the MinionPro microtype config. The picture to the right was produced with it.

On ICFP Contest

Juni 25th, 2010

So, it’s time to summarize a bit on how our team stood during the latest ICFP Contest.

It went well, we are satisfied with the result. It is my personal record score rank for ICFP Contests. Read the rest of this entry »

ICFP Contest 2010

Juni 18th, 2010

Have not blogged for a while now. But this is a nice chance to start writing again…

ICFP Contest begins in less than two hours. Yay!

PaCT

September 1st, 2009

Sitting at the PaCT conference in Novosibirsk.

There were some interesting talks, will summarize them later.

Met Sergei Gorlatch in person. It’s a nice feeling to talk to somebody, whos papers you cite and regard the basis for your own work. Oh, and SAC guys are also there.

Websites’ Usability

Juli 28th, 2009

There are some things on the web I don’t understand. For instance Wikipedia urges its users to sign at the talk pages. There is even some JavaScript thing saying “you have not signed, please put –~~~~ after your text to sign it”. Excuse me, but what the hell? You wrote a Juggernaut of a wiki. You run on a special software written for you and by yourself. You adapt it to your needs. Is it so damn hard to add six charaters after the user submitted text, if he submitted it for a talk page, and not for an article? You need two simple lines of code to do that. And then your users sign their contributions automatically. Like—without thinking about it. Without some stupid JavaScript having to remaind them about it. Without appeals to sign in six different newbee guides. Without a huge drama, when someone forgets to sign. It. Just. Works. By itself. Do not force people to do something, a machine could do better.

And this is the point of this posting. Do not force some human-controllable rules on people, if you can force it in the software. If you do not want your users to edit other’s comments: don’t allow them to do that. Don’t allow not as in: tell everyone they will be machine-gunned for editing other’s texts.  Don’t allow them as in: make the comments non-editable. Even for the original author. Hell, it’s even much simplier to do. If you really want your users to be anonymous, don’t let them enter their name first. Just put this tiny text box which says “Your name” away. If you really-really encourage your users to be anonymous, but want a few geeks to have an ability to enter their name: keep the text box, but hide it in CSS. Normal mortals won’t play with it just to enter their name. If you do not want your users to post links to “bad” websites—whatever your idea of bad is—just check each submission for a known bad link and disallow it. Mechanically. Spam filter, anyone? So, do not allow people to do something, they should not.

The real problem arises when you have to tell “good” and “bad” things apart. The picture, user has uploaded may be a detailed depiction of something really horrible, intended to shock everybody around. Or it might be a picture of a bathtub duck. You don’t know. Hence you need a human to decide. Well, you might ban all the picture uploading. And then ban hot-linking. And then ban links to image hosters. And all links ending in “.jpeg”. But you probably won’t. Because you do not want to limit the functionality of your site—if people really need pictures there. Which they probably don’t, but everybody around and his dog allow it.

To draw a line: best rules are rules drawn in software. You need to decide firmly what you want and what you don’t want. And instead of forcing people to do good things and not to do some other bad things, just let some good things be done automatically and some bad things be prohibited from being done. Automatically, again. But still in cases where you need to tell good and bad things apart, you’ll need a human. You need a human, when software fails.

Solve-By-Play

Juli 9th, 2009

Well, how we solve the puzzle from the previous post?

Read the rest of this entry »

Business As Usual

Juli 8th, 2009

Still near Linz, at the RISC/SCIEnce Summer School. Different courses, interesting people, no time to blog. ;)

We were yesterday in Linz for the sightseeing and the conference dinner. ‘T was nice.

And by the way, I have a new puzzle for you. It was told to me by Padraig Ó Catháin. You have two rectangles with one being 3 times the area of other and other being 3 times the perimeter of the one. Find their sides in integral numbers. More difficult question: how many solutions are there?

Rubik’s Cube and GAP

Juli 1st, 2009

Rubik’s Cube
The afternoon lecture by Alexander Konovalov was a huge fun. Aside from all the algebraical goodness in GAP, he demonstrated something really amazing even to generic audience. It is actually easy to represent Rubik’s Cube as a group.

Let’s just unfold the cube and number the faces.

                     +--------------+
                     |              |
                     |  1    2    3 |
                     |              |
                     |  4  top    5 |
                     |              |
                     |  6    7    8 |
                     |              |
      +--------------+--------------+--------------+--------------+
      |              |              |              |              |
      |  9   10   11 | 17   18   19 | 25   26   27 | 33   34   35 |
      |              |              |              |              |
      | 12  left  13 | 20 front  21 | 28 right  29 | 36  rear  37 |
      |              |              |              |              |
      | 14   15   16 | 22   23   24 | 30   31   32 | 38   39   40 |
      |              |              |              |              |
      +--------------+--------------+--------------+--------------+
                     |              |
                     | 41   42   43 |
                     |              |
                     | 44 bottom 45 |
                     |              |
                     | 46   47   48 |
                     |              |
                     +--------------+

Then you can represent the cube as

gap> cube := Group(
> ( 1, 3, 8, 6)( 2, 5, 7, 4)( 9,33,25,17)(10,34,26,18)(11,35,27,19),
> ( 9,11,16,14)(10,13,15,12)( 1,17,41,40)( 4,20,44,37)( 6,22,46,35),
> (17,19,24,22)(18,21,23,20)( 6,25,43,16)( 7,28,42,13)( 8,30,41,11),
> (25,27,32,30)(26,29,31,28)( 3,38,43,19)( 5,36,45,21)( 8,33,48,24),
> (33,35,40,38)(34,37,39,36)( 3, 9,46,32)( 2,12,47,29)( 1,14,48,27),
> (41,43,48,46)(42,45,47,44)(14,22,30,38)(15,23,31,39)(16,24,32,40) );

GAP can tell you, how many different positions the puzzle has:

gap> Size( cube );
43252003274489856000

And that’s pretty damn much. But the best is: you can actually produce a solution from an arbitrary position just in three lines of GAP code. It looks like this: Read the rest of this entry »