• Vim: Macros

    Vim (The editor) is able to record and replay macros; unfortunately, this feature is often unknown. Since I learned about it, I'm not afraid any more to do large and monotonous editing tasks as Vim can do most of the work for me. OK, but, what is a macro? A macro is a list of prerecorded actions that can be executed (replayed) at any time in an automated fashion. Macros are identified by a single letter and can be recorded while Vim is running — that they are volatile in the sense that they are forgotten when the editor is closed.

  • Java: Visibility

    I'd always (incorrectly) believed that, if you didn't specify the visibility of an attribute or method in a Java class, it'd be private in the former case and public in the latter. This is not what really happens. In fact, Java has four different visibility modifiers: public, protected, private and "package". The first three are the "standard" OOP types, while the last one is Java specific. There is no reserved keyword in the Java language to denote an attribute or method as "

  • Case-sensitive vs. case-preserving

    A file system is case-sensitive when it differentiaties uppercase letters from lowercase ones. This means that foo.c is not the same thing as Foo.c and therefore you are allowed to have these two files living in the same directory. While I've lived with case-sensitive file systems for a long time (since I discovered Unix), I haven't yet found any advantages to them except for an easier and faster implementation. In these file systems, detecting a file match is a matter of a raw comparison of the characters you are given agains the ones stored on disc.

  • Java: Dynamic class loading, part 2

    As we saw in a previous post, Java has the ability to dynamically load classes based on their name. We previously assumed that the classes being loaded had a constructor with no arguments. However, this restriction is ficticious. Let's now see how to load a class with random constructors. The first thing we have to do is to create a vector of Class objects that describes the constructors' prototype. Each element corresponds to a function parameter.

  • RAID: Monograph

    I've just finished writing a monograph for the APC university course, a subject in which we study the PC architecture. My monograph talks about RAID and is 30 pages long. It starts describing what RAID is, which levels it has and ends up analyzing some current hardware and software solutions to set up a RAID system. Please note that it is in the Spanish language. Oh, by the way, this makes the 200 post!

  • NetBSD: File system directories, part 2

    In the first part, we saw what a directory is and gave some fuzzy ideas on how it is implemented. Let's now outline the most common operations run on directories: lookup and readdir. The lookup operation receives a path component name (a string without slashes) and returns the node pointed to by this name within the directory, assuming, of course, that the entry exists. Otherwise, it tells the caller that the entry is missing or incorrect (i.

  • How to prolong lithium-based batteries

    I've been recommeded to read the How to prolong lithium-based batteries article after asking how to manage my new iBook's battery. I'm posting the link here because I found it useful and interesing, so it can be helpful to you too.