Men in lovePosted by Holger Schauer in
Linux
When I got a Handspring Visor (a Palm Pilot offspring) roughly ten years ago, I was amazed about all the nice things you could do with the device. I even wrote a German version of the visor linux howto, although I never really finished it. What I especially liked was the possibility to install a ssh client and use it to connect on the push of a button to my workstation -- which I took to good use several imes when my Xserver went beserk. Unfortunately, over time the major incentive to use the thing, syncing calender and address book vanished, as it turned out to be a major hassle when the main calendar to sync with was Lotus Domino. So, since some years my trusty Visor has only gathered dust. But even back in 2000, it was clear to me that the Palm Pilot would only be the starting point and that at some time in the then-unknown future, we would have small devices that would allow issuing phone calls, taking pictures, listening to music as well as providing the "usual" features of handhelds.
Back then, I didn't really think about when exactly that device would arrive but I think the time has come finally. Some days ago I bought a Nokia N900, which is a mobile device running Maemo on top of a Linux kernel on an ARM platform (see this overview of the hardware for more details). This is really a neat little gadget which is really as close to my ten year old dream as you can get: It comes with mobile phone capabilitiy, UMTS and wlan connection, 5MP camera, media player, RSS feed reader, etc. and also has a quite usable sliding keyboard. It's not really a mobile phone but a pocket computer which you can also use to call people with, which shows for instance in that most applications require the device to held in landscape position. Of course, what's most interesting to me is the software on the device. Basically, Maemo 5 is a linux distribution based on Debian technology, e.g. apt/dpkg and friends work as expected. You don't get all of your favourite linux applications of course, but still there are quite a lot of the regular stuff you would expect. This includes the mobile version of Firefox, Fennec, vim, OpenSSH (client and server) and even Emacs. Being the geek that I am, nearly the first thing I did was a remote login via ssh from my workstation on the N900 (also see this overview of USB networking on the N900). Native maemo applications are typically developed with Python and GTK, although that is probably going to change for Maemo 6 (Nokia has announced it favours Qt over GTK). The community seems quite active, too: just shortly, a port of Clisp (a Common Lisp compiling to byte code) was announced (including a running Swank backend, so you can connect from your development Emacs remotely), although I imagine that the development environment for Python is, generally speaking, more advanced (for Maemo development, this is). I haven't looked any closer into developing for Maemo up to now, but it surely looks interesting. ObTitle: Gossip, "Music for men" Break so easilyPosted by Holger Schauer in
Linux
When I upgraded lately, my old fbpanel configuration was broken. I basically stumbled over Debian bug #288594, my old configuration as well as the system default pointed to a no longer existing /etc/fbpanel/menu file. So, my fbpanel no longer showed a menu. Sure enough, my WindowMaker has its own menu, so it was not much of a hassle. The broken menu entry (I just edited out the reference in my .fbpanel/default) annoyed me nethertheless, so I gtfn[*] today and found the missing info: in order to include the system menu, you just have to include a systemmenu entry. My menu referencing section now looks like this and I have a working menu again.
Plugin {
type = menu
config {
image = /usr/share/icons/gnome/16x16/places/gnome-main-menu.png
systemmenu {
}
separator {
}
item {
name = terminal
image = /usr/share/fbpanel/images/gnome_terminal.svg
action = /usr/bin/x-terminal-emulator
}
}
}
ObTitle: The Mighty Mighty Bosstones, "Let's face it" [*] gtfn: googled the friendly net There's nothing left to seePosted by Holger Schauer in
Programming
Via Lambda the Ultimate I came across an interesting article On data abstraction, revisited by William Cook, written for OOPSLA'09. It carefully dissects abstract data types from objects. All theoretical considerations aside that distinguish ADTs and objects, there is one common characteristics given by Cook: you can't inspect the concrete representation of the data you're abstracting. This is in itself interesting and reminded me of two rather practical things.
First of all, I was reminded of a section in Bob Martins Clean code development which discussed the idea that you should on the one hand follow the rule "Tell, don't ask" and on the other hand have data access objects that don't have much, if any behaviour besides providing data. This is obviously directly related to Cooks article: if you want data abstraction, you shouldn't really provide any way to allow other objects/methods to access the internal representation. This somewhat also forbids getters as this is likely to lead to leaky abstraction, since more often than not programmers simply return the value of some data field, directly exposing the representation chosen. Now, please note that this does not necessarily follow from Cooks article, as it is possible to design getters in such a way that you can return whatever you want for a getter method, i.e., you can return a desired return type or an object satisfying a particular interface. For me, the relevant point here is the way of thinking about the kind of object at hand: do I want some behaviour (aka Cooks objects) or do I want a data sink. In the former case, and in line with what is suggested in the clean code book, it is arguably the best way to tell the object to do what is necessary rather than to inspect (get) the data it holds and do it externally in some other object/method. But even in the latter case, I think it is important to give great attention to hiding the internal representation from external access and to only allow very focussed access to the data itself. It could and has been argued that restricting the access to the stored data via getter methods is tedious (see e.g. the discussion in getters/setters/fuxors) and that allowing public access to members is allright, but looking at the issue from a data abstraction point of view it simply boils down to the question whether you want or need data abstraction or not. Second, I've recently seen these two postings on the merits of the Zope Component Architecture: The emperors new clothes and the reply The success of the ZCA. Malthe asks why one should use the ZCA to override the use of a particular implementation with another instead of using some kind of reloading (or rather says that the latter is the preferrable approach). Relating this to Cooks article, Malthe could be paraphrased roughly as: we have ADTs all over the place and we only should allow only one implementation per ADT (this is what the type system would guarantee in other systems). If you want another implementation (of some interface, as Cook shows for his objects), you should reload the object defintion with the one you want. The use of the ZCA, however, is directly related to the very idea of object oriented programming in the way Cook defines it: you only have interfaces that are the relevant defining characteristics of objects (values) and hence, the use of the ZCA is the way to deal with multiple implentations in Zope (or Python). For me, all I can say is that I'm happy that the ZCA and hence the ability to easily intermingle multiple implementations is there (then again, with me reading computer science theoretic articles I'm arguably not of the angry web designer type whose benefit Malthe is arguing for). There is another, more puzzling aspect of the article to me. After some considerations, I have to conclude that of all OO languages I happen to know, it's really only Java that seems to be object oriented in Cooks view of the world. This is because in Java, you can define a method to return objects satisfying an interface. In addition, in dynamically typed languages like Python, Ruby, or CLOS, you could try to come away with duck typing, but it's arguably only Python which tries to take it to the heart (for instance in CLOS, most values you're gonna deal with are non-CLOS values and you even have an ETYPECASE statement, which is a switch-statement on type distinction). Funny enough, Cook finishes his Smalltalk analysis with the statement that "one conclusion you could draw from this analysis is that the untyped lambda calculus was the first object-oriented language". But besides the point how some language is "more OO" than another, there is also to the point that in order to program truly object-oriented, you shouldn't (and in Cooks world really can't) rely on type checks, because the whole point of using objects as data abstraction is to rely on behaviour. ObTitle: Dial M for Murder, "Fiction of her dreams" 4th dimensional transitionPosted by Holger Schauer in
Emacs
I'm a long standing user of Gnus, the Emacs mail and news reader (news as in usenet for those geeks young enough to not have used it in the 90s). I've been using Gnus in various settings whereas the latest configuration was to talk to a local leafnode NNTP server on my workstation. This was all fine and dandy and also survived several distribution level upgrades of the linux installation running on the system. However, some time ago, I bought new hardware and opted for a completely new installation. Of course, I backed up my leafnode and gnus configuration and restored it once the system was running.
Which was when the trouble started. I ran into the problem that I couldn't see any articles on my local leafnode, although I could retrieve them with other newsreaders just fine. I then opted to go and do a gnus-cache-generate-nov-databases. This turned out to be a pretty bad idea -- as a result I couldn't retrieve my mail any longer. After digging quite a lot around, it occured to me that the active file might have a problem. Indeed, it was empty. Fortunately, I could restore that quite easily, so I could access my mail again. Otherwise, however, I had gained nothing: still no news wasn't so good news. Next try: see if the server buffer tells me anything new. It did: the connection to my leafnode was open and I could even access the new messages on it this way. But this didn't have any effect on my normal group buffer. Having learned to look around for the active file the hard way made me look into all kind of directions. Sometime in the past, I've used the agent-mode of gnus which resulted in a larger subdirectory tree in my News directory. And where which information was stored in the first place seems to have changed over time (or modifications I might to my configuration), too, so my News directory had lots of old files. After several tries and errors, I finally moved the News/cache directory out of the way and finally started to see new articles again. So, I'm now back to reading usenet. ObTitle: Porcupine Tree, "On the sunday of life" November has comePosted by Holger Schauer in
Linux
November is here and Ubuntu 9.10 Karmic Koala is there, too. As one of its promises is faster start-up time, I used the weekend to update my laptop (a Dell 610) which was still running Hardy (8.04). The upgrade path (hardy->intrepid->jaunty->karmic) took quite some time and I'm not entirely sure it was worth it:
- Bootup time doesn't seem to have improved, quite to the contrary. I'm mounting ntfs volumes on startup and it seems that the new parallel bootup procedure seems to run into trouble with that. - I lost support for fglrx, the proprietary driver for the ATI graphics. It's possible to reinstall the package, but modprobing the module gives a "failed to allocate memory" error. Hence, no "graphics effects" (aka) compiz for me. - Gnome-Shell isn't installed by default for me. - The xemacs21-mule package postinstall script fails. This has the not exactly nice side effect that the upgrade procedure decided to quit after installing new packages, which means that it didn't clean up the cruft left behind from the old installation and also didn't boot into the new kernel. - The update to grub2 didn't honour my old selection for which OS to boot by default (the laptop is mostly used by family members who prefer alternative systems). And as always on Ubuntu update, a lot of crap that I got rid off previously, gets reinstalled. Like fspot, tomboy and wvdial, to name but a few. I can't help being reminded of adware. Update:Turns out that newer fglrx modules don't support my ATI Radeon Mobility 1400 any longer (since jaunty, that is). To get GLX working, I had to un-install everything related to fglrx and re-install mesa. What I learned again the hard way during me fiddling with my old xorg.conf is that gdm is a real PITA if you have no working X configuration. What really annoyed me, though, was that status messages from dosfsck hosed the recovery (boot) mode in that the keyboard became unusable. Worse, my hard configured wlan setup at boot time is currently not working anymore, I can connect to my WiFi only through network manager. But without X I couldn't startup network manager, of course, so I also could't do a remote login. And the Wifi connection is really flakey whereas it had been stable ever since with the older hardy installation. Probably a driver issue. Update 2: Various forum entries suggested using backported modules for wifi, including a newer version of the iwl3945 driver. However, this didn't solve my problem. Another entry suggested switching to wicd instead of NetworkManager. And yes, indeed, my wifi problems are gone now. ObTitle: Gorillaz, "Demon Days" Magic theatre not for everybodyPosted by Holger Schauer in
Programming
If you just stumbled over this blog entry searching for what the heck all that buzzing about agile methods amounts to, I may have unfortunate news for you: An agile approach to development might for a lot of people all over the world, but may be not for you. For starters, take a look at the agile manifesto and its principles. These have quite a lot of implications, directly translating into presuppositions about you, if you wanted to participate in an agile development project.
Now, perhaps you're the well communicating, team oriented developer type who happens to work in a surrounding which you respect and general feel well motivated. But real life experience with your typical geek or ex-geek-turned-professional-developer suggests that having a hard time with direct communication, face-to-face, happening very often with those pesky guys and girls you don't really like is a more likely scenario ("Eeek, those business and marketing people" anybody?). Now, you might say, baah, I know some communication is a necessary evil of professional software development, but maybe I can get away with my old habits of trading documents (specs, bug reports, etc.) against direct communication, since that is the trusted old way and what do you mean by face-to-face communication being more effective? Everybody hates those horrible meetings eating up all your time, right? The point is that if you're wanting to go agile you should better soon adapt your view or else you won't see any of the promised benefits of all of those agile processes. Agile development is not only about using test driven design, timeboxing, iterations and releasing often. More than anything else, agility is about how people effectively interact with each other as quickly and direct as possible in order to come to solutions. To me, this basically boils down mainly to three issues: adaptability to (changing) situations, an open mind toward communication and taking responsibility for the project at hand. Being lazy, sticking bone-headed to "trusted paths", not seeking confrontation when it's needed, avoiding communication because of being too busy "doing" is the anti-pattern to agility. You could keep a product and sprint backlog, present new features every other week to your customer and even use continuous integration and still would be muddling in pseudo agile, doomed to fail water. What I would suggest is that you should revisit the agile manifesto and think about what those principles might imply for you and your current behaviour. Let's try an example: If you find that you might end up pointing fingers at your customer (or product owner to use the terminology from Scrum) because he won't behave as demanded in the agile manifesto, you should reconsider if that fits in with what the agile manifesto demands of you: you wouldn't do the project any good. You would build up frontiers where there should be a single team including the target of your pointed finger. This is not to say that you shouldn't point out the defect, no communication about problems is another all too familiar reason for frustration and lack of commitment. What is necessary is direct communication and finding a way that works for all people involved. Let me sum up this posting: if you're interested in agile approaches to software development, that's fine. If you don't feel comfortable about what this might imply for you, that's fine too. But it might also tell you that agile development approaches might not work for you. Update: Irionically, I stumbled via Infoq about the one essential agile ingrediment which says all about it much nicer than I ever could have done, only that Mark Schumann shows the confidence that agile works for the most part whereas I hold the more pessimistic view that it's not going to work for some, but for exactly the same reasons. ObTitle: Hermann Hesse, "Steppenwolf" It's oh so quietPosted by Holger Schauer in
Linux
So I finally bought a new desktop computer in order to replace my old and loud one. The new one should fulfill two more or less conflicting requirements: it should be fast and quiet. "Fast" mainly refers to cpu and disk speed, for the gpu I only had the minimal requirement that it would be possible to see videos (non-HD) and show some basic 3d effects. I left most of the details to a local dealer, but I verified that the components would work with Linux, which actually means I only needed to ensure that the board, an Asus P5Q-VM, which is based on the intel G45 chipset, would work. A little digging showed that there might be some problems with X11 if the distribution didn't provide new enough drivers but I found enough success reports to be optimistic.
Well, I finally got the new workstation. It's an impressive black box with a Silentmaxx ST-11 tower which is really very silent -- it's so quiet that they provide large blue leds on the box to that you have a reminder that the system is on -- this was one of the details I wasn't aware of when ordering the system. I started installing Debian Lenny on the box, as I always followed the rule that buying a new computer is a good point in time to install from scratch and get rid of old software cruft. So I did nothing to carry over my old installation which I had regularly updated at least since Sarge. That was actually a quite pleasant way for me as it was the first time I've got to see the "new" graphical installer. There were some minor obstacles, though. First, this time I wanted to have both an LVM setup and encryption running. I was pleasantly suprised to see the installer providing an option for such a setup, but quite less suprised to see it fail with a segmentation fault during wiping the (500GB sata) disk. Fortunately, the manual partitioning option provided enough easy guidelines to quickly rebuild the setup of the automated partitioning scheme while allowing to leave out the unneeded step to clean the disk, so this was not a big issue. Another point that I think is interesting is that hibernation worked out of the box even with the LVM/crypto setup -- I had thought that hibernate or better said, suspend to disk, would requre the swap to be unencrypted but apparently I was wrong. Very nice. I went on to install a very minimal system without any desktop setup. I went away from Gnome back to WindowMaker some time ago, but I had seen the LXDE as an install option which is a much smaller "desktop environment" with OpenBox2 as the central window manager. Now, compare the list of packages for Gnome with the list of list of packages for lxde -- that's quite a difference. But soon enough I realized how difficult it has become to avoid the larger environments. There are quite a lot of applications which I am used to using right now (having installed Gnome on my older desktop as well as running Ubuntu with Gnome on several other installations) which depend on Gnome. Evolution, for instance, which I privately mainly use as a glorified calender, depends on Gnome just as Rhythmbox does. This may hardly come as a suprise, but I've simpy not thought about it in advance. So I'm now looking for replacements for some applications. Of course, in order to run any desktop environment you have to have a running X11 installation. This failed at first: I had connected my 19"-TFT (an old Benq one) via VGA to the on-board graphic chipset from the G45, which resulted in the monitor proclaiming to get out-of sync timings. After replacing the VGA connection with a DVI one, the vesa driver provided a working X11 setup. However, I soon discovered that I would not want to stick with the vesa setup, as for instance there is no xvideo extension. Unfortunately, the xserver-xorg-video-intel package in Lenny is version 2.3.2, which is too old to support the G45, so even though I specified the intel driver in the device section of /etc/X11/xorg.conf, I didn't get a usable screen. However, packages for Xorg in version 2.8 had entered unstable some time ago -- as I had quickly installed kernel 2.6.30 from backports.org and the packages doesn't have to broad version requirements on other packages, this seemed like a viable option. So I know have an up and running intel driver for X11, but it remains to be seen how stable it really is over time. And, of course, I've got to keep an eye on security updates. ObTitle: Björk, "Post", (more info) Version control and testingPosted by Holger Schauer in
Programming What have version control and testing to do with each other? Well, first of all, both are common virtues in the clean code community. What you'll find is that both virtues are important on their own ground: version control provides a safety guard in that you can roll back to prior versions if you accidently introduce problems in your code. Testing (automated unit tests) provides a safety guard, too, because you can do regression testing when you work with your code. These are both fine goals but seemingly have little to do with each other.But in reality they do. For sake of argument, let's take a step back and assume that you have to work in an environment of several developers where neither of these things exists. What will you likely see? What we all have seen several years ago. Commented out code blocks, redundant and often misleading or outdated comments, timestamps with comments cluttered all over the code. And frightened developers that feared each minor change because of the miriad of subtle side effects it might have, let alone major changes to core components. It's an environment in which refactorings as welll as extensions are very hard and expensive, which results in frightened overworked developers and frustrated managers. So, what happens when you introduce only one of those virtues? Say, we introduce version control. Now, every change gets documented, except that documenting every change requires, from the developers point of view, documentation at the wrong point. They can't see the documented changes and the reason for these changes in the source, they see it only in the version control system -- iff they add a change message with every change at all. Much more likely is that you will see commit messages such as "." or "bug fix", and the same old mess of timestamps, outdated comments and commented out code as before. Why is that? Because your developers are now not as frightened as they used to be (because they can now rely on the version control system to fall back to older versions), but they still have the same need to understand and document the code. And the commit log is both "too far away" from the code and "out of it's purpose" for this task: the commit log shouldn't document what the code is supposed to do, only when something was implemented to behave in a particular way. This is where a development (unit) test suite comes into the picture: you document every required behaviour in tests. With every change to the code, you also update the test. As a developer, you can now look into your test suite to see what the code is supposed to do. Now developers will likely become much more confident with their changes, because they can run the tests and see what happens (hopefully next to immediately) without requiring time- and resource-consuming manual tests. But what about documenting the changes to the code? Well, you should simply document any changes in the commit message of your version control system, because it's now no longer necessary to keep the entire version history in mind to understand what the current code state is supposed to do. You have the tests that tell you what the code should do. The commit log now only serves the purpose of documenting what has changed over time and is no longer required to understand what the code should do. So you don't have to keep the clutter in your code, resulting in much cleaner source code files. Summary: Taken together, the whole of version control and testing adds up to more than a simple addition of their own values. I still rememberPosted by Holger Schauer in
Emacs
Betrand Mathieus blog article on cleaning up trailing whitespace comes in handy for me as I've frequently run into problems with the Python test coverage tool stumbling over trailing whitespace. It also reminded me of an emacs snippet I recently installed to detect a mix of space and tabs in my Python buffers -- I do set
(setq indent-tabs-mode nil) in my .emacs for python-mode, however, I still occasionally somehow manage to insert some tabs in my source buffers. So I came up with the following snippet which validates that a buffer in python-mode doesn't contain any tabs. It's hooked up with the very general write-file-hook, but there is no python-specific hook on saving buffers. In case the buffer does contain any tab, it will leave the point (the place where your cursor will be) at the fount tab.
Enjoy. Update: I should clarify that my previous reference to (set-indent-tabs-mode nil) is just a local function around setting the variable indent-tabs-mode directly. I use it also for a local toggle function, like so:
ObTitle: Bloc Party, "Weekend in the city" I guess I'll hang out my tears to dryPosted by Holger Schauer in
Programming
There seems to be a roaring discussion about a talk by Robert "Uncle Bob" Martin at this years RailsConf, which mainly seems to be concerned with the question (raised by a quote appointed to Ward Cunningham) whether languages such as Smalltalk make it too easy to create a mess. Languages such as C++ would penalize the mess at least by longer compile times.
As Giles points out that's an old argument, which I too have heard too often in the past about dynamic languages, regardless whether we're talking Smalltalk, Ruby, Lisp, Python or Perl. And the anti-dote was always the current idiot language of the date, i.e. Visual Basic at its high time, Java or C# (for those who considered C or C++ to be too dangerous). Please note that I'm not at all saying that users of those languages are idiots, but those languages are particularly claimed to be usable by idiots, too. This approach to languages or to their classification does a great job of misrepresenting programmers regardless of the language of their choice. It makes the bold claim that there are programmers that are idiots and that it's possible to design a language that even those idiots can do their jobs. And the exaggeration is that its only good business sense to enforce the use of those languages for all development projects, because, as we all know, there are more idiots than intelligent programmers out there, right? The only problem with this claim is that human stupidity is probably the only thing larger than the universe, if you make something idiot proof, nature will quickly make a better idiot. To put it a little less cynical, to err is human. And there is value in people making mistakes. As for instance, Tom DeMarco claims in his book "Slack" it's a particular good way to learn. Bob Martin tries to sell excessive testing (which isn't particular surprising, giving his background) as one safety guard to which James Robertson responds that this is not always necessary: Yes, tests are useful. But, the debugger is not something to be feared. Rather, it's a great tool to be used in order to have the computer do all the memory work for you. I can get a lot more done by working with decent tools like the Smalltalk debugger than I can by assuming the doc is good and writing tests that just help me a whole lot less than you might think. I can relate to this quote, being a fan of interactive development that languages like Lisp or Smalltalk made popular. But I think James is missing the point: tests are not only helpful during development. Sure, using an interactive approach helps getting the code run but does it help to come up with a clean design? Looking back at some code, I can assure you it doesn't, quite to the contrary it's a way to get a working solution But the real point summing up the discussion so far is the old Frederick Brooks quote: There is no silver bullet. It's good to be careful and to use the tools at your hands to help you avoid the big mistakes. As Paul Graham puts it for OOP: "For programs that would have ended up as spaghetti anyway, the object-oriented model is good: they will at least be structured spaghetti." But in the end you have to learn how to avoid the mess in the first place and no language and no tool can do that for you. ObTitle: Dexter Gordon, "Ballads" Ever fallen in lovePosted by Holger Schauer in
Computer, Music
Through this infoworld article on the greatest cults in IT I've discovered a new band: Press play on tape. The music isn't exactly what I'm listening to daily, but I have to admit I know probaby nearly all the songs they play: cover versions of old commodore C64 tunes. I also have to admit that I'm still not sure what to make of this, but the cover version of "Crazy comets" is quite cool.
Love is a loosing gamePosted by Holger Schauer in
Linux
Some time ago I updated my trusty old workstation from Debian Etch to Lenny. As always, there were some minor glitches, not necessarily all of them were due to Lenny itself, though. Here's a rough list.
One really annoying issue was that my trusty old Matrox G400 suddenly behaved unbelievably slow under X11. I could nearly watch the pixels going by. I could tell by the X server log that some things had changed (like Xrandr now running) but I couldn't tell what was responsible for the problem. Explicitly setting the option "NoAccel" to "false" and "NoHal" to "true" (I have a single screen setup) finally settled the problem. I also tried "UseFBDev" "true" but this only works for me with a Depth of 24, which in turn screws my screen whenever I switch to the console (for instance on hibernate), so I'm back to not using the framebuffer device (and a depth of 16). The Postgres update didn't work for me. I guess that this was mainly due to a lack of disc space. It took me some time to figure out that no default cluster had been created, which was the reason that the manual restore of the DB backup I had made failed. I took the chance and finally updated to Iceweasel (firefox) 3. Some of my extensions were lost this way, but I managed to replace or update nearly all of them. Only Hit-a-Hint required a manual intervention directly in the install.rdf of the extension. One typical annoyance of updates is that user settings are often not updated. This time I experienced that mainly with FBpanel in which all icon settings were broken. Of course, the update broke some of my proprietary programs because of library problems. Korrektor, BMM, all are history now. As are some trusty old programs I still used, for instance xmms is gone, too. I used to stick with xmms mainly due to the Windowmaker mini app wmusic which allowed control of xmms via the dock, but as I've been using Rhythmbox for quite a while now, which has a NETWM compliant panel control, I could finally let it go. ObTitle: Amy Whinehouse, "Back to black" Busy doing nothingPosted by Holger Schauer in
Linux
I've got tired of writing perl snippets just for simple shell tasks [*]. One such typical task is summing up the occurences of a particular pattern in a set of files to get a total of matches. Of course, this is trivial, but it's so trivial I tend to forget the use of 'expr'.
As a one liner for copy&paste: [*] The following quote is due to Kristian Köhntopp: "Use perl. It's necessary to know shell programming but not to use it." ObTitle: Love is all, "Nine times that same song" I write sins not tragediesPosted by Holger Schauer in
Emacs
One of the nicer extensions of mozilla I use is It's all text. It allows you to call an external editor to edit text fields which is a really nice thing if you're editing longer wiki pages, for instance.
Not surprisingly, my external editor of choice is XEmacs. But my XEmacs is heavily configured and loads a lot of stuff. Even worse, I usually run a beta version with debugging turned on, so that it runs extra slow, so the time gap between clicking on that little "edit" button below the text field and the moment when I could finally start typing started to annoy me quickly. I remembered that some years ago I used to log in remotely to a running machine, fire up some script and have either my running XEmacs session connected or a new XEmacs process started. Connecting to the running XEmacs happens via gnuclient, so much was clear but gnuclient doesn't start a new XEmacs if there is none running (actually, the server process gnuserv will die when the XEmacs process terminates, so there isn't much gnuclient can do). The emacs wiki page linked to above already contains a number of scripts that eventually do what I need to do, but I've found none of them convincing, so here is my version. It's linux specific in its BSD style call to 'ps' to determine the running processes, but should be portable sh otherwise. I could have sprinkled the fetch_procs function with OS specific variants, but as I'm currently running my XEmacs on linux only, I left that as an exercise to the reader.
ObTitle: Panic at the disco, from the album "A fever you can't sweat out" We were dead before the ship even sankPosted by Holger Schauer in
Computer
This list of top tips for project managers is what Dilbert is all about. For many probably too close to home, too near the bone ...
(PS. I've managed to sneak in two musical references into this one. Let's see if somebody figures them out.)
(Page 1 of 6, totaling 86 entries)
» next page
|
QuicksearchBlog AdministrationKategorienTagsCalendar
ArchivesPowered byBlog abonnieren |
|||||||||||||||||||||||||||||||||||||||||||||||||
Dieser Blog wird von 1on.de zur Verfügung gestellt; einem kostenlosen Dienst der IDEE GmbH
Powered by Serendipity 1.3.1.
Design by Carl Galloway.


