Emacs 24: file and path encoding trouble
I often work with tex files containing danish letters æ,ø,å. I would like emacs to use utf-8 encoding as default. However, being on a windows file system where file paths are not utf-8 encoded, this yields trouble when special letters are contained in the file path.
The remedy is to specify in the init.el (previously known as the “.emacs file”) the following lines
(set-language-environment 'utf-8) (setq default-file-name-coding-system 'iso-8859-15)
The first line tells emacs to use UTF-8 encoding for the files, the second tells emacs that the file path is encoded using ISO.
Personal reminder: on my Win7 Pro, init.el is located at c:\$USER\AppData\Roaming\.emacs.d\init.el
Kubuntu on an ibm thinkpad T42
Linux and old laptops. How does that work?
Recently I have been looking for a linux distro that runs sufficiently fast on my trusty thinkbad T42 (2373). Kubuntu 10.04LTS so far meets my needs, and in my opinion is superious compared to the Mepis distro.
Previously, I used Kubuntu 10.10, 11.04 and 11.10 but these distros dont run as smooth as the LTS one. As you can see from other posts, Ubuntu used to be installed on the thinkpad – up to 8.04. I find Kubuntu better fit for my needs, and in fact I find that the present Kubuntu outperforms the older Ubuntu in terms of userbility, speed and stability.
Besides the mandatory packages that comes with Kubuntu, I find the following tools useful:
Common tools
*) Filelight – a neat little program to locate those folders that take up too much HDD space.
*) Krusader – file manager.
*) emacs.
*) latex and auctex.
The digital photo trilogy
*) Digikam – to import and manage photos.
*) Gimp.
*) Photivo. An absolutely excellent Linux alternative to Adobe Lightroom.
Live: The Saloon Men
Live recording from the pub “Høvlen” at Christianshavn, October 18 2011
Eyjafjallajökull volcano links
Almost live measurements of earthquakes:
http://en.vedur.is/earthquakes-and-volcanism/earthquakes/myrdalsjokull/#view=map
Live webcam and thermograph of Eyjafjallajökull:
http://eldgos.mila.is/eyjafjallajokull-fra-thorolfsfelli/
Live webcam of Katla:
Pictures
Use the microphone input as a powerful tool for signal analysis
During work in the laboratory, I often find it convenient to characterise dynamical states of a setup by the fourier spectrum of an appropriate aquired signal. For example, you can determine the rpm of a motor from the sound emitted by the gearbox, etc. I have written a small Matlab code that reads and analyses signals send to your microphone input. An example of a recording signal is seen from the picture below. The signal is generated by me humming happily the note A to Oscar Danielson‘s “Norska gränsen”.
It is not the most elegant tool that the world has ever seen, but it works quite nice. If you change toe Sample signal lenth and/or Sample frequency, you need to restart the code by toggle twice. By the way – the two frequencies show is the most dominant, and half this value.
To use it, you should download these files and put them in your Matlab root/work folder.
readsoundgui.m
readsoundgui.fig
Be careful not to fry your mic input!!!!
Logitech Quickcam causes green screen in Skype – Ubuntu 8.10
I’ve just borrowed a Logitech Quickcam to use with skype under Ubuntu 8.10 (Intrepid Ibex). To my unpleasant surprise the camera did not work as-is, although it apparantly functions well with Cheese. What seems even worse is the apparant extend of this problem. After googling and following links, this page finally provided the correct answer: Make sure you have installed the video4linux driver libv4l-0
sudo aptitude install libv4l-0
Then open Skype with the command
LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so skype
or make an executable as described in the link.
No sound in Firefox flash, Ubuntu 8.10 (Intrepid Ibex)
Lack of sound in flash media (such as youtube) in Firefox seems to be a common problem for Ubuntu 8.10 users. Follow the link to this guide, which worked on my laptop, IBM T42-2373. In part 2, I chose MPLAYERPLUG-IN (option 2) and instead of editing the local settings, I edited
sudo gedit /etc/mplayerplug-in.conf
Hopefully It will do the same for others.
Matlab: Graphics with legends for TeX
See previous post.
Producing graphics for TeX documents is quite easy following the previous post. However, Matlab (7.2.0.232 (R2006a) and others) has a bug preventing the root command
set(0,'defaulttextinterpreter','latex')
to affect the font in the legend box. A workaround to enforce latex typesetting of the legend box is including the following to your plot command:
[L,Obj] = legend('legend entry 1','legend entry 2','etc...');
t = findobj(Obj,'Type','Text');
set(t,'Interpreter','latex');
Problem solved!
Note: On a Matlab running on a Windows platform, text with LaTeX-math does not print correct to neither paper nor pdf. I have not bothered to solve this, one workaround is to save the figure to an eps and print that.
Exporting graphics in Matlab
A common mistake by people using Matlab to produce graphics for reports, presentations etc. is the use of too small font size on figure axis. In the beginning of each Matlab session I run a script containing
path = 'e:/matlab_stuff';
cd(path)
display(' ')
display('Â Â working directory changed to')
display(['Â Â ',path])
format compact
set(0,'defaultaxesfontsize',18,'defaultaxeslinewidth',.7,...
'defaultlinelinewidth',.8,'defaultpatchlinewidth',.7,...
'defaulttextfontsize',18,'defaulttextinterpreter','latex',...
'defaultaxesfontname','century')
clear all
The first line sets the working directory to my preferred working directory. The interesting command is line 11: Here I specify the font size on figure axis and text. I’ve found that size 18 usually works fine, but this is up to personal preference. A piece of advice, though: I tend to forget that people older than 28 (say, a professor) has limited sight. Thus, use a BIGGER font than you thought!
The argument ‘defaulttextinterpreter’ produces text (axis labels, text) being typeset in LaTeX = beautiful! I still havent figured out how to enforce Latex interpretation of axes numbers, so for now this is done by setting defaultaxesfontname to century (this looks like Latex font the most).
Jeg er en nørd…
Både Kåre og Tjansson (se links) er nørder, og begge 92% af slagsen iflg. en online test. Jeg faldt for fristelsen og tog samme test som de (i hvert fald tjansson) linker til, egentlig mest fordi jeg ville have bekræftet at det nok ikke stod så galt til med mig. Tilsvarende stor var fristelsen så, da jeg efter endt test (og jeg mener faktisk at jeg svarede ærligt) havde følgende score:
Foruroligende! Aftenens planer er hermed erstattet af pizza, cola og computerspil iført tennissokker og grå, stumpede træningsbukser fra start-90erne.

