vim-like ctrl+v enter in Emacs

Suppose you have a list like this

foo, bar, baz, quux

in your Emacs buffer, but you’d rather have one element per line like this

foo
bar
baz
quux

What to do? In vim this is easy:

:%s/,/^M/g

where ^M is inserted using

Ctrl+v

But what to do in Emacs? Turns out it’s just as easy but different (who would have thought …): You can insert the newline character in your replace-string or something other using the keyboard command

C-q C-j

C-q is somewhat like Ctrl-v in vim and C-j is Enter. Easy as pi, yeah!

See also the page Newline Representations ^M ^J ^L about related issues with newline in Emacs.

Posted in Tools | Tagged , | Leave a comment

More Free Introductory Category Theory Video Lectures

Recently I discovered another Youtube Channel with some lectures on Category Theory. They cover only some of the basics with examples drawn mostly from topology and I do not know if the series will continue any time soon. Anyway, it’s nice to see that there are more and more resources for learning the basics of Category Theory online.

Posted in Mathematics | Tagged | Leave a comment

Speeding up the startup time of Mac OS’s Terminal.app

Terminal.app is very important to me as I use a lot of console based programs, so it’s very annoying if I have to wait a few seconds for it to start up. Recently, I stumbled across a helpful blog post (Speed Up a Slow Terminal by Clearing Log Files) that explains an easy way of combatting the slow startup of Terminal.app. I decided to take this a bit further and added to root’s crontab (using the command sudo crontab -e) the following line

@hourly rm -f /private/var/log/asl/*.asl

This cleans up the mysterious .asl log files Terminal.app produces and everything has been fine so far.

Posted in Tools | Leave a comment

Development environment for the STM32F4DISCOVERY board on Mac OS

This is just a quick post with information on how to get up and running with a development environment for the STM32F4DISCOVERY evaluation board which is a cheap and fun way to get started with developing software for ARM microcontrollers.

First, you need to install the development toolchain. I use devkitARM. See the installation instructions for more information.

Then, you will want to install openocd, a program that lets you upload software to the development board via USB. I assume that you have homebrew installed, so I will use that to install the build requirements for openocd:

brew install libtool automake libusb libftdi

Now get the latest sources for openocd (and no, the open-ocd package that is in homebrew will not cut it because it’s an older version that lacks support for the Discovery board):

git clone git://openocd.git.sourceforge.net/gitroot/openocd/openocd

… and build openocd

cd openocd
./bootstrap
./configure --enable-maintainer-mode --prefix=/opt/local --enable-stlink
make

Install in a reasonable place at your own discretion.

Posted in Electronics, Tools | Tagged , | Leave a comment

Thunderbird line breaking behaviour

Because I keep forgetting which options to set to force Thunderbird to send and display line breaks instead of flowed plain text emails that may or may not come out right at the other end (usually those emails exhibit unsightly long lines which among other things might make quoting from some MUAs a PITA), here’s a reminder mostly to myself.

Set

  • mailnews.display.disable_format_flowed_support to true and
  • mailnews.send_plaintext_flowed to false.

For more details see http://arapulido.com/2009/12/01/enabling-line-wrapping-in-thunderbird.

Posted in Tools | Leave a comment

IMAP Push with Dovecot and K-9 Mail on Android

Having had the unfortunate experience that K-9 Mail on Android set to polling mail every 10 minutes almost caused my telephone to burn a hole in my jeans pocket I investigated the IMAP push functionality. Luckily there’s already an informative article by a fellow faced with nearly the same problem that describes how to set up a sane configuration for IMAP push using Dovecot 2. That’s all good and well, but I was still running Dovecot 1.2 on my Debian stable system. Consequently I needed to upgrade to Dovecot 2 to make the best of the situation. Luckily, this did not prove to be too big of a problem. Just add the apropriate URL from http://wiki.dovecot.org/PrebuiltBinaries to your /etc/apt/sources.list and do what the error messages and/or warnings upon restarting the newly installed Dovecot imapd tell you (i.e., create a fresh config file that’s in line with the new options and defaults of Dovecot 2.0). So far everything works well, keeping my fingers crossed.

Posted in Tools | Tagged , , | Leave a comment

Snippets for LaTeX + Emacs users

I’ve been using Emacs to edit LaTeX for some time now, mostly resorting to AUCTeX’s keyboard commands to insert fonts, environments and some other stuff that I need in some documents. But I’m also a big fan of yasnippet, the de facto standard for inserting more or less complex templates and, well, snippets of text into an Emacs buffer. Just now I discovered that some people have already started quite a nice collection of templates ranging from fonts to matrices to whole document skeletons for LaTeX over at github. If you are not a user of AUCTeX yet and find keyboard commands hard to deal with, perhaps this could make your day. And if you are not already using Emacs, the only true text editor for complex editing duties (for quick edits, config files, editing on remote computers, etc. I still use vim religiously), then here’s another reason to switch. ;-)

BTW, the yasnippet documentation is very enlightening. For instance, I did not know that you can use the power of ELisp in your snippets to do quite amazing things automatically.

Posted in Tools | Tagged , , | Leave a comment

Some resources on functional programming, types, logic, etc.

If you’ve got some time to kill I’d suggest heading over to Edsko de Vries’ presentations page where he’s collected a few slides and some notes on topics ranging from linear and separation logic to proof theoretical basics and category theory useful for functional programmers. Chances are that there will not be very much new knowledge here depending on your background but I found some of it enjoyable and useful in case I want to look something up but cannot be bothered to grab a book from the shelf and find what I am looking for myself.

Posted in Haskell, Mathematics, TCS | Leave a comment

VST plugins on Mac OS X

There’s actually a free (as in beer) software for Mac OS X that hosts VST plugins compiled for Windows (it uses WINE under the hood). It is the editor software for the V-Machine, a rack unit that can host VST plugins. You can download it from the manufacturer’s website. MIDI input works out of the box, but there is no way to configure the audio output, so you have to use Mac OS’s own “Audio MIDI Setup” application to select the default destination. By using SoundFlower you can effictively integrate VFX and thus the Windows VST plugins into the DAW of your choice. All without a Windows installation and without paying any extra money. Enjoy the free VST plugins out there. I know I will. ;-)

Posted in Uncategorized | 1 Comment

MacBook Pro graphics card switching tool

After a good two months of being annoyed by a burning hot MacBook Pro with short battery life, I discovered gfxCardStatus, a menu bar application that lets you choose between the integrated and discrete graphics card manually or based on whether a power adapter is plugged in. It’s free and very useful. Nicely done!

Posted in Tools | Leave a comment