Tuesday, March 26, 2013

Growl for Emacs

There are several packages for Emacs which let you send notifications to Growl but afaik none which implements sending notifications over the wire, implementing GNTP (Growl Notification Protocol). Given that it's not very hard to implement I put together an implementation. It's not very complete, it has no encryption, lacks error handling, it just does what I need, register notifications with icons and sending them.

Monday, March 18, 2013

uuurgh

That was too much LaTeX last night. I dreamt of writing a book on compilers or so and whenever I wrote GNU it had to be with spaces in between and a stylized ©. When I printed it out I found many places where I had to correct it, and the font for GNU was ugly.

Sunday, March 17, 2013

org-mode

I have just fallen in love with this emacs mode. I'm already using it to bring a little bit more structure into my live. I use it to manage information on some websites, my finances, TODO lists at work. I even bought the printed org manual. At the moment I'm working on a small project for university, a mix of text and code. When writing papers etc. mixing code with text usually is problematic, it's too wide, formatting stinks, code is usually copied from file but and must be manually copied formatted etc. when you change it. With org-mode you simply include the source code in your org file along with all the text and when you're done you simply export it as a LaTeX file. All in one place and easy to navigate.


org-mode best mode

Wednesday, March 13, 2013

Procrastination - With shaving tips

This is an old post which I never published. I still shave with a DE razor but switched to Merkur 37C, Tabac shaving soap and a 100 pack of Astra platinum. For more information I recommend visiting /r/wicked_edge

I shave, as does probably everybody else and as I'm male I'm mostly concerned about my facial hair. I started out by using an oldish Braun Micron electric shaver from my father. It served me well until I had to join the army. Army, so I thought, means going outside, camping and an electric shaver without batteries would simply be of no use in the woods. Hence I switched to wet shaving and got a Wilkinsons Protector 3 from my mother as a gift. Back then it was top of the line and I like the design. I used it with various shaving foams and gels, but it was always difficult to clean, the hair stuck between the blades. Luckily every recruit gets a welcome package with a Gillette Mach 3, which was far easier to clean, the only downside was that the handle wasn't as nice.

Years passed and somehow I heard about straight razors, safety razors and using shaving soap and a badger brush instead of canned gel. I talked to my dad about it, about wanting to buy a straight edge razor but they're kinda expensive. He then decided to gift me a used Dovo 500 & a badger brush for my birthday. It didn't quite work out, as either the blade is too dull or I was just to afraid & untalented. But I made use of the brush. Being completely inexperienced I started out with Wilkinsons shaving soap in a black bowl. It being in a bowl made it the obvious choice, and compared to the other bowl options It was cheap & available in supermarkets. It was difficult for me to build up lather but it didn't matter much as I always shaved immediately after showering. I was happy to have gotten rid of expensive canned goo. I still keep the last can around for travelling or an "emergency". Then my shop stopped selling the soap and I had to try the next best option: The Palmolive shaving stick. I cut bits of it into the used Wilkinson bowl and build up "lather" in it. Later I found out I don't strictly need soap if I shave immediately after showering and don't dry my face, yay even more money saved.

More time passes and a thread, on a forum I frequent, talks about shaving. There's one guy who's into safety razors or double edged blades because they're so cheap. He said he pays about 0,20 USD per blade when buying em in bulk. As I was chronically short on money the "cheap blades" didn't leave my head. So I did some research, tried to find out a good & cheap beginners safety razor model, but it's always came down to a ~30€ investment. Finally in the week after Easter I decided to go ahead and used my Amazon gift certificate to buy a Merkur 23C. The retailer didn't have blades and as I wanted to pay just once for shipping I decided to buy them at a drugstore, a mistake. They only had Wilkinsons (seriously, last Saturday I've visited 3 of the biggest drugstore chains in Germany and only one shop had a 2nd brand) which sells at 3.95€ for 10 blades, making it ~0.40€ per blade. Anyways, my first shave with a safety razor. I expected to get many cuts & a bloody face, but somehow it worked out, not one cut. Some areas don't weren't as smooth as I wanted, esp. my chin line and the neck (which was never smooth unless I went against the grain which I hardly ever do), but hey it's cheaper and feels better (not the shave but using the razor).

This week I had an exam, so I was procrastinating more than usual and did more research on how to get a better shave, better equipment, where to get the cheap blades (buy them in bulk on eg. http://connaughtshaving.com/) and how to shave better. Watching videos I always wondered how they get the lather to be so thick, mine usually sucks in comparison and I never got a 2nd serve out of it, never. Wanting to improve it, I went shopping on Saturday, went to five different shops too look for a bowl/mug, derby blades, tabac shaving soap and a new aftershave. I settled on a müsli bowl, tabac shaving cream and Old Spice. No luck on finding a Turkish shop which sells Derby blades. After I had gotten home and eaten the kumpir, I immediately went to use my new equipment. Wow what a change a) the creme smells, palmolive doesn't b) palmolive hardly lathered - tabac did great c) going against the grain didn't work at all but at least I was able to get three servings out of the creme.

So my current setup is as follows:


  • Tabac shaving creme (~4.50 €), Palmolive shaving stick (~0.80 €), Gillette shaving gel (backup)
  • Merkur 23C (~30 €), Gillette Mach 3 (backup)
  • Wilkinson Blades (10 for 3.95 €)
  • Balea Badger Brush (~8 €)
  • Generic ceramic müsli bowl (1.50 €)

total: 30 + 4 + 8 + 0.8 = ~43 € for a starter kit. Seems expensive to me, but keep in mind that running costs are very low afterwards (unless you become a shaving fanatic, buying more razors and esp. more brushes, damn things can cost up to ~200 €). It's just soap + blades, compared to a system razor, where you would have to buy soap anyways, it's ~30 € for a 12 pack of system blades vs ~7 € for 100 blades which last about 10 months. What you save in blades can be invested into different soaps (scents) or a higher grade brush (30-50 €). The general recommendation is to buy a badger brush, they're more pricey than synthetic, but seem to be worth it.

Since Saturday I've worked on my lathering technique and improved to so much that I even got two servings out of the Palmolive stick yay

Wednesday, March 06, 2013

rcirc + growl + convos on windows

How to growl with rcirc to get notified about convos:
Being annoyed about missing a convo with rcirc, I decided to get emacs to play a sound when somebody says something in a convo. Playing a sound with emacs is easy (play-sound '(sound "c:/path/file.wav")). Then I remembered that's to oldschool, I need to use growl. So here's my setup:


Ingredients

  1. Growl for Windows
  2. todochiku
  3. some elisp code

First install growler. Then because it disables M-x while it runs, we'll edit the config file c:/Documents and Settings/<USERNAME>/Local Settings/Application Data/Growl/2.0.0.0/user.config. Look for Alt+X and replace it with a combo you won't need, like Alt+Z.


Then install todochiku and configure it, specifically change the todochiku-command to c:/Programm Files/Growl for Windows/growlnotify.exe or whereever you installed growl. If you want icons get it from EmacsWiki: To Do Chi Ku and customize the todochiku-icons-directory to wherever you unpacked the icons.
Congratulations, you can now growl from within Emacs with (growl "Emacs here" "growling is a go").

The last step is to add some more code to get notified about hidden convos. The code below does that and redefines the hook that already comes with todochiku to include the text that mentions your nick.


(defun growl-convo-rcirc-print-hook (process sender response target text)
  (when (and (string= sender target)
             (not (string= (rcirc-nick process) sender))
             (not (string= (rcirc-server-name process) sender))
             (not (memq (rcirc-get-buffer process target t)
                        (rcirc-visible-buffers))))
    (todochiku-message "IRC convo" (format "<%s> %s" sender text) 'social)))
(add-hook 'rcirc-print-hooks 'growl-convo-rcirc-print-hook)

(defun growl-rcirc-print-hook (process sender response target text)
  (when (and (rcirc-channel-p target)
             (string-match (rcirc-nick process) text)
             (not (string= (rcirc-nick process) sender))
             (not (string= (rcirc-server-name process) sender)))
    (todochiku-message (format "IRC mention" target)
        (format "%s <%s> %s" target sender text)
        'social)))

Tuesday, March 05, 2013

Magic: The Gathering Sands of Time

Back in 1996 I somehow came upon Magic: The Gathering, and started to play with a limited budget due to being a 9th grader. To be honest, imho I sucked at it, I was a newbie but even when I stopped playing I still sucked. One reason I sucked was that in tourneys I got anxious, sweaty, heart racing & tunnel vision, that makes playing harder and loosing tougher. Playing M:TG wasn't good for my health nor my budget and two years later I decided that it's simply to expensive (you had to keep buying the latest sets to play in tourneys) and sold off all cards but one deck and three cards where I liked the artwork & and signed card.


Despite the stress, it was enjoyable and I still consider it to be a good game overall. I even play twice a year in a booster draft. What I love about the game is that it kinda is like Nomic, a game about rules. You start with a fixed set of rules and via the cards extend these. You can play and win in a plain way, simply deal enough damage with spells or creatures to kill your opponents. Or you extend the rules, twist & abuse them. That's what I liked (apart from rushing out as many creatures as fast as possible). One so called combo I came up with (and happens to be the reason for this post) is Equisands (not my deck, it has cards which didn't exist in 1997). The core of this deck is the card "Sands of Time", once in game it removes a phase from the game and replaces it with a similar rule. By it's own the card seems stupid but it changed the game in that block fundamentally. Because the removed "untap" phase was central to a another game mechanic of "phasing" (prior to your untap phase cards with "phasing" would leave the game until your next untap phase). The Sands removed that, cards could still phase out via other mechanics but they would never ever enter the game again and "Equipoise" phased out everything your opponent had more of then you. I am so proud of that combo because I came up with it on my own, nobody else I played with used that combo. I don't claim to be the first world wide, but in that circle of friends I was. Sadly I don't I ever won with it, I didn't have enough cards nor the money to buy them and I didn't understand yet that sacrificing cards/lifepoints can be good strategy too. But I was proud of my "invention" and it defined M:TG for me.

Monday, March 04, 2013

Music & Literature

Today I received a LP in my mail, the limited edition 12" vinyl from Melt Yourself Down. When I heard their song "Fix My Live" on BBC6 I knew I had to have that song, so I went to their site and ordered the LP and with it came free downloads for both their songs. Had I bothered to read their site, I could have found out that the mp3s where actually free and I wouldn't have this LP which I can't use because my record player is broken. Yet I'm happy to have this great piece of music and to have supported a independent band.


In literature news: I've managed to read five books last month which is a new record for me. That's probably more than I have read in the last two years and one of them was even a manual (for org-mode)! One was about the history of Lockheed-Martin, their lobbying and "golden" toilet seats. The last three were about Expat live in Estonia: Vello Vikervaars "Marrying into Eastern Europe" and Justin Petrones "My Estonia" 1 & 2. Then this Friday being out of books to read I followed the "recommendation" of Justin and bought A. H. Tammsaares five part epic "Truth and Justice" (in German). That was a bit of an effort as they weren't available on Amazon. In the end I had to buy them from four different antiquity dealers and got the impression that I've bought the last ones.