Another Blog

Mostly about computers, generally Linux-related

Wow… xmonad does it again!

I’ve been happily using xmonad for a while now. It’s a tiling window manager written in Haskell. To me it’s a huge boost in productivity and it has helped me rediscover the fun of using a computer. Although I’ve initially tried it simply because it was written in Haskell (I was a happy wmii user then) , I now dread every single moment of using a different window manager.

Above all, xmonad is incredibly flexible. This comes from the huge extension library it has. It can tile windows in a myriad of ways, and even float them in unexpected manners. It has per-workspace configuration, so I can have 9 or more workspaces, each with different layout algorithms. I greatly appreciate a program which has allowed me thus far to go through 4 “patterns of usage”. To be more specific, I’ve gone through:

  • The “tall” default configuration. This keeps my “main” (master) window occupying 70% of the screen, and the other windows stacked to the right of the screen. The proportion occupied by the master is adjustable (see screenshot) and so is the number of masters. This is a lot more flexible than it sounds — I can have 4 equal xterms in a few keystrokes, by setting the number of masters to two and the split point at the half of the screen.
  • Three columns. I have tried this briefly for my widescreen laptop, before realising I rarely need to view 3 different source files at once. I’ve also realised I’m greedy with my non-xterm windows, so I prefer Firefox or Evolution to grab the entire width of my screen, which is what brought me to the next iteration.
  • Tabbed windows. I’ve whole-heartedly returned to my first tiling experience (with Ion3) and used Tall and Tabbed exclusively up till, well, today. The general pattern was to stuff a lot of related windows into a single tabbed workspace if I only needed to see one of them at a time. This worked wonders, but I’ve long wanted an extension to it, cue a few hours spent reading and tweaking today. I’m not delusional — I don’t consider my work so important and difficult that I needed to change the perfectly fine configuration I had; changing it was just a lot of fun. If I realise I’ve made a mistake, I’ll just use darcs to change back to my old config.
  • Tall-Tabbed Combo. Today I’ve added a new layout mode to my configuration, partly inspired by David Roundy’s sample. It splits the screen in two, similarly to Tall, and each half of the screen contains tabbed windows. This enables me, for example, to keep half a screen containing a few documents which I can cycle through, and the other half containing code which I clumsily write. I can easily move windows from one half to the other, bar a few hours of getting use to the commands. Of course, “half” is a generic term, since I can resize the two chunks to any proportion. This uses the excellent Layout.Combo and Layout.WindowNavigation extensions, in addition to Layout.Tabbed, Layout.NoBorders, and Layout.PerWorkspace, which I had previously been using.

So, to sum up another probably tl;dr post, xmonad rocks because:

  • I’m immensely productive with it.
  • It’s fun to both configure an use.
  • It’s alive. When I first started using xmonad (which was, mind you, not at its very beginning), many of the extensions I use or have used in the past didn’t even exist.

If you feel like giving it a try, be aware that you need some knowledge of Haskell if you want a custom configuration, but I’m more than happy to help with what limited knowledge I have. A much better place to go if you have a little background is #xmonad on FreeNode.

December 22, 2008 Posted by | functional programming, haskell, linux, school | 2 Comments

Wow. I Made a Difference

I haven’t posted much of anything lately — I meant to log some of my homework efforts, but I’m not much of a writer. However, there is something that impressed me very much last week. Instead of trying to disguise the whole matter so as not to give away true identities, I’ll just spit everything as it is. Note that it is not a means to apologize for my previous words and both viewpoints are entirely true, though at a different moment in time.

The semester is about to end, and Algorithm Design had been on an ascending slope. The lecturer (I hope I’m right in the translation) had asked for feedback three times and had actually read it. Of course, there hadn’t been earth-shattering changes, but what he could change from one week to another, he did when someone suggested. After the final lecture, he called me by name and asked me to stay a moment; the whole name thing was surprising, but what happened afterwards was even more amazing. It appears he had read my blog and the (short, but far from positive) review I’d given his class and thanked me for the impulse he found in it.

I was speechless. Not because of fear, as one would easily have implied from my constipated face, but because I actually made a difference. Someone had actually changed something in that school and I had the small merit of having said things out in the open (although I quite frankly never expected any of my professors to read my random ramblings). It is an awesome encouragment, and it came at the right time — I was beginning to think that students couldn’t change anything, at least not without resolving to extreme solutions (strike or whatever). This proves that change can happen in an amiable manner, from the inside, without any sort or rupture between the groups or individuals involved.

I’m still chewing on what happened, and I will study hard for the Algorithm Design exam. I shouldn’t expect someone else to take their job (i.e. teaching) seriously, if I don’t take mine (i.e. studying).

June 2, 2008 Posted by | school | 1 Comment

Fourth Semester

And so we reach the end of this three-post sequence, the real reason that kept me away from this blog. Don’t get me wrong, I’m not complaining; I don’t really like to keep a log of my life and I really love what we’re doing in school so far. Without further ado, I’ll list my thoughts on every subject I have, with the warning that my translation of names will probably not be accurate and that the list is in (almost) random order.

Communication Protocols

An introduction to network models and protocols, without going too deep into the field of networks (which I will study next semester). A young team, slides prepared beforehand, but a slight lack of skill from the teacher (Florin Pop). Thumbs up for trying, though, and also for this: he finished his lecture 15 minutes earlier and asked us to stay that 15 minutes and have a chat. This didn’t happen to the entire year — a group will stay longer each week (note: this might be hard to understand if you’re not familiar with Romanian superior education organization).

At the lab we were introduced to Jasper, a protocol simulator written in Java. The idea is wonderful and the result is great, but it’s horribly written, especially because it’s Java. I realise OOP was well chosen for the task, but I have a personal spike against Java.

We have a homework, spanning two weeks, where we must implement RUPD (Reliable UDP) in Jasper. Myself and another classmate have already expressed concerns about putting the packet header (which we must implement) in a String (hence Unicode). What’s more, last time checked, the course portal did not have a forum associated with this homework, so we’re pretty stuck. The homework was almost 48 hours late to appear, which is disturbing, even though the deadline was extended.

Virtual Intruments

I honestly hope I translated this right. It’s a “filler” course, not specifically linked to Computer Science, but still better than History of Philosophy (yes, I studied that). It has so far dealt with standard setups for extracting information from a physical process, but will hopefully come to actually using virtual instruments.

The course is pretty boring, but has the merit that it fills certain holes in the Systems Theory course. The lab looks exciting; although “hard” by our standards (i.e. not programming per se), it introduces us to actually working with an outside device that is not another computer.

Digital Electronics

A continuation of the “Analogic Electronics Elements” from previous semester, with the same two gentlemen for the lecture and seminar, and a different lab assistant (the same one as in Virtual Intruments). I honestly hoped this would be more interesting than the past semester, it started off amazingly interesting, but died out after the first two hours. Still clinging to things which should primarily concern electronics engineers IMO, still a shitload of theoretical nonsense shoved down our throats, still making fun of us with every opportunity. Hopefully it will all be worth it and in the end we’ll actually have a mental image when we say CMOS or TTL.

The lab, however, is particularly new, in that we are actually doing something. We learnt what the four boxes on every desk do, how to operate them, and this week we even got to work them. Of course, Lucian actually got all the work done, while me and Roxi were in utter amazement at how fast and accurate he was. We did make a few funny mistakes, but nothing really crucial.

To top things off, we got a homework for this class. I frankly don’t understand why they did that, because we will ultimately copy them from each other, even though we have separate numerical values for each student.

Numerical Computers

An amazingly interesting course at first sight, going closer to the hardware, yet keeping a computer engineer’s view to it. We’re learning Verilog HDL, but everything is a bit to high level for me: using a huge IDE (Xilinx ISE) and learning how to click through it thus far. I got a simple homework, building a simple FSM that has to work on the FPGAs in the lab.

For testing purposes, we’ve been introduced to a virtual interface to the FPGAs built by older students. Myself and a few classmates agreed that it could have been much more impressive, but it’s still a wonderful effort. Too bad they’re not giving us accounts to the damn thing yet, although they promised to almost a week ago.

Algorithm Design

A continuation of previous semester Algorithm Analysis, for which I will be a lab assistant, Algorithm Design is a very badly held class. The lecturer just brings papers which he reads, occasionally writing silly and inexpressive drawings on the blackboard. He doesn’t even write the lecture notes himself. Moreover, we have the option of just listening to him, because he gives us the photocopied notes in advance.

We have a young (read: a year older than us) lab assistant. Not very sure of herself, but she’s definitely trying. Too bad the problems we’ve had to solve the past 2 labs have been insanely difficult (highschool algorithm olympics, and, hell, that’s hard). There’s also a semester-long project, a program which will play chess. They could not have picked an uglier game, or one that’s so easy to find readily-written programs for. Still, I’m happy with the group I’m in and it will probably be fun regardless of the badly chosen homework.

Programming Paradigms

I intentionately left this last. It’s about “exotic”, as our professor calls them, languages and paradigms. We will study (to some degree) Scheme, Haskell, CLIPS, and Prolog. But beyond the contents of the course, I have the utmost respect for the professor, mister Cristian Giumale. He truly has a gift for making us understand. Listening to him is sheer pleasure. As a comparison, I use some of the best professors I have met thus far; they come with slides, hold an interactive, energetic course, insist that you not take notes since slides are publicly available, and encourage you to address them by their given name; a true hope for higher education in these times. Then, there is mister Giumale. He comes with nothing but a set of keys (God knows why), speaks at a slow pace, and gives the impression of a shy person. But then he catches your attention and soon you’re all ears to what he says. Not using any sort of helping material for apparently hard constructions in lambda calculus is truly amazing, although I realise that to him things appear mundane. The two types of professors are definitely not in competition, but shold both be equally appreciated; they belong to different eras, equal in talent and potential, with the sole difference that one has already proven itself.

The lab is held by someone whose name has a keen resonance to me, Mugurel, whom I know by name from algorithmics highschool olympics. He’s apparently quite bored and uninterested in what he is doing, but will engage conversations on the subject and prove he’s just a bit chronically tired. We’ve been promised a project, preferably in Scheme, but I’ve been (informally) given the permission to write it in Haskell, as long as it has a graphic interface (for which I can use GTK2Hs or wxHaskell). It is my new great ambition to become a lab asistant for Programming Paradigms next year, and hearing that there is a desperate shortage of personnel in the faculty brings a new hope to me.

March 15, 2008 Posted by | school | 1 Comment

A busy week

I actually wrote my first lines of code for cspay these days, but they were mere headers for the library I am writing. I started reading parts of the standard and making a rough sketch of what will have to be included in an ods file; the standard is huge, but hopefully things can be simplified to a bare minimum, stock proto-spreadsheet. I am having difficulties deciding what to take for granted and what to expect from the user. libspreadconv has to strike a balance between being easy to use and widely applicable; so, while we have to be able to customise styles, they shouldn’t have to be specified if one wants a plain sheet. I will probably ask my friends for help on the mailing list.

In a totally different direction, I took part in some student things which I can’t really translate in English. One for Physics, about the quantity of information transmitted by measurements (again, translation may have ruined the meaning), and in Mathematics, about the coding of information by neuronal spike trains. The latter was slightly more interesting, but we only had to do a translation — and the professor practically forced it down our throats, but all in all both events were useful and failry exciting (intellectually, mind you).

I also helped RobyC with a very interesting piece of homework: compressing a bmp file into jpeg. Most of the program was already done, including the headers and file input and output, all we had to do was encode the information. This proved difficult because of not having read the homework specification thoroughly enough. We spent hours debugging, with hex editors and all, only to have someone suggest a detail which we had left out. Infinitely stressing, especially since I had an exam the following day, but also very interesting; you kind of get that warm feeling of accomplishment when you see it’s actually a stadards-compliant jpeg file.

Busy as I was, I got into some serious Armagetron Advanced with the boys these days, causing me to see coloured walls in my sleep and to miss this mornings Data Structures course, which I heard was surprisingly interesting. Heading home tomorrow, with that guilty feeling of leaving Roxi behind and skipping two days of school, but also happy I’ll finally get to see my family (6 weeks is apparently quite a lot by my standards). I’ll have a lot of work to do for Numerical Methods and other projects when I return, but I have to get it over with somehow.

Damn anal wordpress added extra line breaks and my text (pasted from vim) looked like shite.

May 19, 2007 Posted by | cspay, games, programming, rosedu, school | | Leave a comment

Starting the Yet-to-Be-Named Project

I got rejected for Google Summer of Code, but that was to be expected. As easy as Plan 9 is and as much as I loved working with it at the beginning, such matters ar too serious to be covered within a week. Perhaps next year I will be better prepared in a field; I would of course like to try my hand at it again.

But Razvan (my Operating System Usage teacher in the first semmester) came up with a proposal to write a system that generates spreadsheets for hourly paid course assistants in our faculty. I naturally agreed and a team was quickly formed. We met today for the first time. While the project itself doesn’t sound like much, we decided to do it properly. We are using Razvan’s server for the entire development process (I got a new IMAP email address courtesy of him), including mailing lists, RCS (to be decided), web page, wiki and testing.

Everyone is very excited and we’ve already outlined a brief design: a C library for reading a configuration file and actually outputting the spreadsheets, a (probably PHP, which I’m not happy about) web interface, a minimal, console based program, which will be called by the web interface, and classic, offline programs for both Windows and Linux. We are considering GTK or wxWidgets. The latter looks better, but I’m reluctant to use C++ and it has no C bindings. The spreadsheets will be XML-based, using ODF and Open Office XML, but we’re planning to keep the config file simple (no XML, as parsing it would probably be harder than generating the documents).

For the moment, we still need to find a name, although a mailing list is in place. A wiki and versioning system will follow. I’ve chosen to read up on creating dynamic libraried and to think of the configuration and console program format. Razvan also suggested using a lexer, which is an entirely new concept to me (actually it was until a couple of hours ago).

Amazing how much a little planning can save; we probably would have switched ideas a lot of times and still wouldn’t have come up with a design close to this one. Still, as good as it seems, it will probably be subject to change once coding gets off the ground.

April 17, 2007 Posted by | cspay, programming, rosedu, school | | 2 Comments

Computational Physics

I got this monumental shock today when I went to my first Computational Physics class. I thought it would be a uselessly hard, overly theoretical course that is not connected to computers. On the contrary, 70% of the grade is based on part of a program I need to write. I already chose my task, which is finding the common surface between two Gauss bells (one ideal, and the other real). It will be my first opportunity to code something useful to another area and I look forward to getting started. I was thinking of including a Gtk2 interface, but it is not essential — a graphical representation is not required.

The teacher looks like a typical elderly geek, a helpful, non-ignorant, but probably fully vertical man. Although the course is optional and there are very few of us taking it, we’re probably going to have to work hard for an A; but hard work is not what I fear.

C is, of course, the language of choice; its speed and simplicity will allow me full liberty, although I will probably need to be careful with floating point operations (which abound in my task). It will be interesting to see the errors that occur, as well as the manner in which our various programs will be combined into a single one (the professor has great plans, but I think he’s biting more than he can chew). Time permitting, I might volunteer to help glue code together, although I shiver at the thought of what I might find in others’ code. I have this strange lean towards never changing code that’s not mine.

March 3, 2007 Posted by | programming, school | Leave a comment

Fidling around with SPICE

My roumored-to-be-impossible-to-pass Electrical Engineering course uses SPICE for lab applications. It was quite easy to install, just a simple, stable emerge, but running spice in the command line has proved much more difficult that I had expected. Not because of the awkward interface (which is quite awkward, by the way — no basi line editing), but because of my poor understanding of the concepts at work. I ultimately managed to get things started, although an exact example from my lab notes did not work as expected — I need to look into it tomorrow or something.

While it’s not going all that great, I love learning new things and this is one area which appeals to me. The course today (first one this semmester) proved to be quite boring, although I can get the entire courses off the Internet. The only problem is I have to go to class — an overcrowded, uncomfortable room, with an improvised projection device. And a grouchy teacher, but apparently my kind of guy — maybe this will change if I fail.

March 3, 2007 Posted by | school | Leave a comment