Blog Pseudoaccidentale

2008-04-24

Speed typing test

Filed under: Computers — keramida @ 10:57:49
Tags:

References: http://stsimb.irc.gr/2008/04/23/i-type/

66 words

I “cheated” in a way, because I went through the test 10 times, deleted the worst and best case numbers, and then averaged the rest of the results… but that was fun :)

2008-04-17

UTF-8 support in Gnus

It’s amusing once in a while to skim through the subjects of spam messages in my “mail.junk” folder. With Gnus running in UTF-8 mode, I can even read the text as you can see in

Spam in Gnus

The same folder is slightly less readable in text-only mode:

Spam messages in text-only mode

Now, you may be wondering why anyone would really want to actually see the text of spam message subjects. One reason why I tried this small experiment was that spam messages are commonly written in all sorts of bizarre or even broken ways. If Gnus managed to display these weird posts, that would be cool. It would be cool, because it would mean that Gnus in UTF-8 mode (under X11, not a plain xterm window) actually groks UTF-8 text and does the “right thing” with multiple languages in the same summary buffer.

Well… it does. Yay for the UTF-8 support of Gnus :-)

Update: A few hours later, the following showed up in my “mail.junk” folder too:

More interesting spam

I can’t really read Japanese, but it’s pretty amusing that Gnus can display almost any language the spammers throw its way :-)

2008-04-14

Useful advice for keramidia on the move

Filed under: Misc — keramida @ 11:38:39
Tags:

Being in preparation for a new job, I found it very nice that my instinctive “feelings” of wanting to know more about the people and the team are actually “normal”. I was reading through the management posts of “Rands in Repose” at http://www.randsinrepose.com/ earlier today.

The “Ninety Days” article was actually a very relaxing bit to read. It somehow makes sense, and difficult as it may be to “make sense” of how we feel, it seems to be comforting to see in writing that “it’s ok, and actually a good idea to feel this way”.

Naturally, what is “normal” and “ok” is a highly subjective thing. Different people have wildly varying ideas about what is “normal”. The tricky part, I guess, is going to be the search for my own normality in the wondrous diversity of the world :-)

2008-04-13

NADD? Uhm, yeah, you bet…

Filed under: Computers — keramida @ 11:56:17
Tags:

I don’t know if i’m happy or sad that “NADD” rings a bell.

http://www.randsinrepose.com/archives/2003/07/10/nadd.html

Yeah, I know it’s old. In internet time, five years is something like going back to the Stone Age, to see how people fought when all they had was pretty cool sharpened granite axes.

I’m just a bit worried that reading the post sounded familiar :)

Expiring vs. editing articles in Gnus

I’ve been using Gnus running inside GNU Emacs for my main email and news reader for a few weeks now. It has been a rather pleasing ride so far, and I am only now beginning to appreciate the infinite configurability and customizability that a Lisp based mailer offers.

One of the first things I wanted to tweak was the default keys for expiring and editing articles. A little background information may be useful before we go into the details of how the default keys can be tweaked.

Gnus uses a very newsreaderly method of handling your email messages too. This means that, by default, no email messages will ever be deleted from your local email folders. This is an important detail, so it’s worth repeating: Gnus will never delete email messages. Unless you ask Gnus to delete them forever. The method of asking Gnus to delete a message forever is to “expire” the relevant message/article. An article can be expired in the summary buffer of a mail or news group by hitting “E“.

Some message groups support article editing too. The “nnml” type of message groups does, and it’s a very handy feature too. I often have to edit email headers in email messages that use the wrong charset, for example. The default key for editing an article in Gnus is “e“.

After a few weeks of using Gnus for my email, I realized that I type “E” to expire articles far more often than I type “e” to edit articles. When I say “far more often”, I mean really far more often, as in several hundred of times per day vs. maybe once or twice. This prompted me to look into the manual of Gnus for a simple way to swap the behavior of these two keys. Having to hold down “Shift-E” instead of merely pressing “e” tends to get a bit old after the first few thousands of times you have reached for the shift modifier key.

The solution was, as is very commonly the case with the excellent manual of Gnus, already there. It was just waiting for me to discover it, in section 3.7.5 (Generic Marking Commands):

3.7.5 Generic Marking Commands

Some people would like the command that ticks an article (“!“) go to the next article. Others would like it to go to the next unread article. Yet others would like it to stay on the current article. And even though I haven’t heard of anybody wanting it to go to the previous (unread) article, I’m sure there are people that want that as well.

Multiply these five behaviors with five different marking commands, and you get a potentially complex set of variable to control what each command should do.

To sidestep that mess, Gnus provides commands that do all these different things. They can be found on the “M M” map in the summary buffer. Type “M M C-h” to see them all—there are too many of them to list in this manual.

While you can use these commands directly, most users would prefer altering the summary mode keymap. For instance, if you would like the “!” command to go to the next article instead of the next unread article, you could say something like:

(add-hook 'gnus-summary-mode-hook 'my-alter-summary-map)
(defun my-alter-summary-map ()
  (local-set-key "!" 'gnus-summary-put-mark-as-ticked-next))

or

(defun my-alter-summary-map ()
  (local-set-key "!" "MM!n"))

That’s it. The sample gnus-summary-mode-hook was all I needed to see. Then I added in my own personal ~/.gnus startup file my own hook:

;; Swap the default behavior of the 'e' and 'E' keys in the group summary
;; buffers.  Using a shifted key to expire articles is somewhat painful.
;; I expire articles far too often, but I only very occasionally edit the
;; contents of email articles.  So it should be easier to expire them.
(add-hook 'gnus-summary-mode-hook 'keramida-alter-summary-map)
(add-hook 'gnus-article-prepare-hook 'keramida-alter-summary-map)
(defun keramida-alter-summary-map ()
  (local-set-key "e" "MMen")
  (local-set-key "E" 'gnus-summary-edit-article))

To apply the changes I didn’t even have to restart Emacs or Gnus. I evaluated the expressions right there, inside my ~/.gnus buffer, by typing “C-x C-e“, and that’s all. They were instantly part of my running Emacs and Gnus session.

Now I can expire articles by simply hitting “e“, and for the rare occasion that I have to manually edit an article’s headers or body, “E” is always there too :-)

Yay for the astonishing configurability of Gnus!


Update (06:38am): I didn’t really like the mapping of “e” to “MMen” very much, because it means the behavior of the “e” depends on whatever happens to be mapped to that key combination. After reading the source of Gnus a bit, I rewrote the hook function to look like this:

(defun keramida-alter-summary-map ()
  (local-set-key "e"
    (lambda (n)
      (interactive "p")
      (with-current-buffer gnus-summary-buffer
        (gnus-summary-put-mark-as-expirable-next n))))
  (local-set-key "E" 'gnus-summary-edit-article))

This works equally well in gnus-summary-mode and gnus-article-mode. I am a bit unsure about the (interactive) property of an anonymous lambda function, so I’ve posted a question to the gnu.emacs.gnus newsgroup, asking if this is considered bad style. Let’s see what other, more experienced Gnusers have to say…

2008-04-11

Why the “R” part of REPL rules

Filed under: Computers, Lisp, Programming — keramida @ 02:00:59
Tags: , ,

Common Lisp environments include a read-eval-print loop that is also known as “REPL”. The interactivity of the REPL is cool, but there’s at least one reason why the “R” part of the REPL rules. (more…)

2008-04-08

Kinkyradio from Patras

Filed under: Music — keramida @ 03:33:05
Tags:

Vivh Vsl is a friend from the old GRnet IRC days, who now has her own radio show, yay!

Every Tuesday, at 18:00-20:00 EET/EEST, you can tune into the streaming server of Kinkyradio, by pointing your players at

http://www.kinkyradio.gr:9800/listen.pls

for two hours of great music, and news from the life of Patras :)

2008-04-06

Congratulations to “Kathimerini”

Filed under: Computers, Newspapers, Programming, Software — keramida @ 08:07:36
Tags: , , ,

Today’s edition of “Kathimerini” ([Wikipedia], official website [greek], official site [english]) deserves many congratulations. The economic section of the newspaper includes an article about phishing attacks. The topic of the article is well worth our praise, because it brings an important security issue to the frontlines of a very popular weekly edition of the newspaper. Thousands of people read Kathimerini’s Sunday edition. Many of the readers will undoubtedly notice that Kathimerini mentions phishing. A percentage of these readers will try to find out more about phishing attacks, how they work, why they work, and that’s certainly a very good thing.

There is, however, one very fine point about the article that is even more important.

The author of the article chose to write (translated to English for this post):

One or more crackers are usually behind this sort of attack (please note that crackers have nothing in common with hackers).

Many thanks to the reporter who wrote this part. As a long-time “UNIX hacker”, I am grateful to the writer who originally thought of making this clarification. I appreciate the editor’s good will that allowed this small but vastly important detail to reach the press. I extend my thanks to the layout designer who decided to reserve frontpage space for this article, and its accompanying clarification that “crackers” are not the same sort of people like “hackers”.

It’s amazing!

Blog at WordPress.com.