# Unused Cycles

## August 13, 2008

### Trying out Gentoo Linux on my Dell E1705

Filed under: GNU/Linux — Tags: , — Kevin @ 10:16 am

Over the past few days, I’ve been trying to make the days pass more quickly by messing around with Gentoo Linux on my Dell laptop (which Dell finally fixed under my warranty). As a reminder, I’ve been using (K)Ubuntu for over a year, and I recently installed OpenSUSE 11.0 on my desktop, so I’m not a total newcomer to Linux.

My first reaction is that it’s definitely a more hands-on Linux distribution. I did a minimal installation using the Gentoo handbook, in which you boot from the minimal install CD and there’s really no install script. The first steps are to partition everything manually using fdisk, install Portage (the package management tool for Gentoo), and install a bare kernel which you can configure manually. And when I say bare, I mean bare naked. One must literally install everything that he or she wants on the target system – I even had to emerge iptables using Portage.

There are two options for configuring the kernel. First, one can try to configure it manually, though I had issues with ndiswrapper when I tried that, so I used the second option, emerging genkernel and using that “vanilla” kernel that supports most hardware. Maybe sometime if I get brave enough I’ll go back and try configuring my own again.

I had somewhat of a headache trying to get X installed, but that was because when I emerged Xorg it didn’t install the mouse and keyboard drivers, so I had to 1) figure out what kernel modules I had to install (xf86-input-mouse and xf86-input-keyboard) and 2) install them manually. After that, I had already installed my graphics driver so there were no issues with that from the start (amazing! I’ve had troubles with Ubuntu from the beginning where the driver would be installed but it would be using Mesa for OpenGL and not the fglrx driver). Then I had to emerge KDE. At the moment, everything is running very quickly (although I still think the default KDE look is very bland and uninteresting, so I’ll have to fool around with that later).

But not everything is going well.

I still haven’t figured out how to get sound going (I think it’s just a matter of adding my normal user to the proper group,, but that’ll have to wait until I’m done emerging some big files on Konsole so I can restart X)

1. The keyboard is very annoying. Sometimes keys stick, even though I hardly tap them. As a result, I’vvvvvvve been having issues while typing this entry (as you can see with the extra “v”‘s and a few extra spaces which I’ve let unaltered from the original typing). This isn’t an issue with the actual keyboard, because I don’t have any problems with it in Vista (yes, I took the plunge! So far it’s nota s bad as people makeito ooooooooooooooooooooout t obe. AAnd again with the kyboard issues).
2. I can’t get knetworkmanager working. I’ve merged it and when I run “emerge –pretend knetworkmanager” it says that it would rebuild it if I tried to emerge it again. But yet when I try to run it at the command line, it says that the command cannot be found. Furthermore, when I try to run it from the K menu, it pops up in the system tray; however, when I place my mouse over the tray icon, it immediately crashes.
3. Konqueror has issues with displaying images and some pages properly. We’ll see if my issues with being in the wrong profile (default instead of 2008.0/desktop – see below) fix things.
4. I haven’t been able to emerge Firefox yet, but right now I’m re-emerging cairo with the X USE flag, so I think that will fix it. (Update: I’ve gotten Firefox 3 to emerge. It looks great!)
5. There’s no ebuild for Firestarter (my favorite iptables frontend)! Instead I’m using Guarddog, but I’ve had issues with internet connection sharing and Guarddog in the past.
6. I’m not entirely sure that both of my CPU cores are being utilized. They’re being reported in cpufreq-info and /proc/cpuinfo, but things are still choppy. Installing Superkaramba and running a dual-core monitor reports both CPUs are always at the same percentage of usage, which leaads me to believe only one is actually being utilized.
7. I can’t get sound working yet, at least not in KDE. It works fine at the command line with ogg123, and lsmod shows that the module that I need for my particular sound card is loaded. I’ve done a forum post on the Gentoo forums and one user noticed that I probably wasn’t using the desktop profile. I’ve changed over to this and I’m re-emerging things.
8. More of a gripe than an issue: while the idea of compiling software is very cool, it’s sometimes a bit of a pain to wait to compile it. Although the fact that Konqueror loads as fast as lightning makes up for it 🙂

So I’m pretty happy with it, I suppose. When I’m done, maybe I’ll go through and make a list of how I got certain hardware working.

As a last thought, I took a screenshot of my desktop. Click it to enlarge.

My KDE desktop on Gentoo 2008.0

## August 3, 2008

### The Gordon Game

Filed under: Mathematics — Tags: , — Kevin @ 11:30 pm

The Gordon game is a game to be played by two people who know a bit about group theory (and by a bit, it’ll suffice to read my introduction to group theory). I found of the game in the book “Adventures in Group Theory: Rubik’s Cube, Merlin’s Magic and Other Mathematical Toys” by David Joyner.

According to the book, the rules are as follows. Take two copies of a set corresponding to the group $(G,\ast)$ and call one $M$ and the other $P$. The rules are then as follows:

1. Player one chooses an element $p_1$ from the group $P$ and $m_1$ from $M$. These can be any element he chooses, and once they are chosen they are removed from the sets $P$ and $M$
2. The next player chooses an element $m_{i+1}$ and $p_{i+1}$ such that $p_{i+1}=m_{i+1}p_{i}$. Both elements are removed from their respective sets.
3. Repeat the previous step. The first player that cannot move loses.

I’ve written a program in C++ that will compile under GCC. The group used here is $\mathbb{Z}/7\mathbb{Z}$, that is, the integers modulo 7. You can download it here, although this link may change after I graduate. I wrote it hastily, so it’s not commented well and it probably has bugs. To compile, use the command

``g++ gordon.cpp -o gordon``

I can compile it fine on OpenSUSE 11.0. There’s no AI yet, so it simply switches between two human players. In the future, I may add support for user-defined groups and possibly some rudimentary AI.

Enjoy!

UPDATE: I updated the program a little bit so that you can make your own groups. As a result, you’ll now need to download the default file, z7z.grp, if you  want to be able to run the program.

1. On the first line, list all of the group elements separated by a space and followed by an exclamation mark.
2. Now just list the multiplication table, with a space between columns and a new line between rows.

For example, the group $\mathbb{Z}/7\mathbb{Z}$ looks like this:

``````0 1 2 3 4 5 6 !
0 1 2 3 4 5 6
1 2 3 4 5 6 0
2 3 4 5 6 0 1
3 4 5 6 0 1 2
4 5 6 0 1 2 3
5 6 0 1 2 3 4
6 0 1 2 3 4 5``````

To use your new group, pass it on as a command line argument, i.e. run

``./gordon mygroup.grp``

That’s it! Try it with a complicated group, for example a large order dihedral group.