Workaround for Emacs matlab-mode freeze

February 3, 2010

I’ve been using matlab-mode in Emacs for my scientific programming in Matlab for years. It is really an awesome little package, that I couldn’t live without.

However, lately Emacs has been freezing up completely on my Ubuntu 9.10 installation (using 100% of the CPU)  when editing comments (i.e. lines starting with a percent symbol) in matlab-mode.

I’m not sure about the exact circumstances when this happens—it doesn’t happen with all comments—but the same problem seems to occur in all versions of matlab.el from 2.2-3.3, so likely there is some inconsistency between matlab.el and new Emacs versions shipped with Ubuntu Linux. These problems started occurring sometime in 2009.

Freezes sometimes occur when:

  • using Esc-Q to use matlab-fill-paragraph
  • when manually inserting a ‘%’
  • when using M-J to use matlab-comment-line-break-function

As those are really essential functionalities, I’ve found that matlab-mode now is almost unusable.

Without spending too much time debugging the problem, I have been able to find a simple workaround. Over time I’ve noticed that freezes occur only when editing header comments, i.e. comments at the top of a file (technically where no uncommitted code lines are present between the point of action and the beginning of the file). In fact, in cases when a freeze has occurred I can kill and restart Emacs, insert some random code above point of action and repeat the same action (that before triggered the freeze) without problems. For now I’m using this as a workaround for the problem, while waiting for a fixed matlab.el to appear.


Google Web History

January 13, 2010

I haven’t blogged in a while. Time to make up for it.

It is interesting how my life nowadays almost completely runs through the veins of Google. Or should that be the other way around? Anything I do, at work or privately, day in and day out, is being logged by Google in one way or another. This is in all fairness with my permission of course. But it is a little scary if you think about it.

Google Search, Gmail, Reader, YouTube, Picasa, all store loads of information about me. It makes me wonder whether Google will eventually be perceived as the new Big Evil Empire, a Microsoft Big Brother. I think it’s just a question of when people will realize the danger, and start wanting their data back.

Unfortunately there aren’t really any good alternatives to Google’s awesome applications. So, if you want to experience the best of the web, it is difficult to avoid submitting your data to Google. Maybe it is not so bad having all of our personal data in the cloud? Time will tell.

Anyway, my top queries at Google Web History pretty much sums up what I have been doing in the last year. Pretty funny.

Enjoy, and Happy New Year!

Christmas holiday was fun too:


Google Wave

November 8, 2009

I just got access to Google Wave and I have invitations to share! Who wants to try it?


Numpty Physics Ubuntu package

August 2, 2008

I’ve made a Ubuntu deb package for the addictive 2D puzzle game Numpty Physics. Numpty Physics is a free and open sourced clone of the popular Windows game Crayon Physics, but allows more diverse painting objects. Here is a screenshot from the title screen:

To install on Ubuntu Hardy, add my PPA (Personal Package Archive) to you software sources list (System->Administration->Software sources)

deb http://ppa.launchpad.net/sonofjon/ubuntu hardy main
deb-src http://ppa.launchpad.net/sonofjon/ubuntu hardy main

and then install the package with the Synaptic package manager or simply by writing in the terminal

sudo apt-get update
sudo apt-get install numptyphysics

A Ubuntu Intrepid version is available through Per Hansen’s PPA:

deb http://ppa.launchpad.net/phobie/ubuntu intrepid main

Alternatively you can simply download the deb located here and install with your preferred method, for example in the terminal do:

sudo dpkg -i numptyphysics_0.2~svn20080701-0ubuntu1_i386.deb

or simply use the package installer (Gdebi).

This is the first program I have ever packaged for Ubuntu. I followed the excellent guide here. Please provide feedback if I got something wrong.

Deb packages for Numpty Physics are also available here, but they appear to be only for hand held devices at the moment.

You can download user submitted levels from here and store in ~/.numptyphysics, or you can draw your own levels with the built in level editor (press E to start it).

Hope you have fun with it!


Open source software: my first contribution

June 27, 2008

Today, I made my first ever contribution to the open source software community!  I’ve been a long-time user of Linux and I’ve come to like it so much that I don’t think I could ever go back to using a closed source software platform, such as Microsoft Windows.

Anyway, I’ve been eying the the open source community from a distance, wanting somehow to contribute back, and perhaps get involved with some interesting project. However, not having a whole lot of spare time on my hands and having limited programming skills, I haven’t quite gotten around to accomplish anything, until now.

Today, however, I finally made it happen. I ‘ve submitted some translations for an awesome open source media player. I feel quite proud of making this first step, and I am surprised how easy it was to get started. Just a quick on-line registration and then a few clicks later I was raving away doing translations. Hopefully I will be able to make further contributions now that I know how easy it is to get involved.


Angående krönikan “Kina, koldioxid och Solen”

June 20, 2008

I just signed up for a blog at wordpress.com to post an e-mail I sent to the generally brilliant economics analyst Jonas Lindmark at morningstar.se regarding a surprisingly misinformed post of his regarding the reality of climate change. Jonas’ post is in Swedish, and so is my reply.

Hej Jonas

Jag kan till viss del förstå din skepsis till klimathotet som det ibland utmålas eftersom jag också kan uppleva att media ofta överdriver hotet från klimatförändringar, precis som de tenderar att blåsa upp även andra nyheter (notera dock att jag inte läst DN artikeln), men att rada upp en hel lista med argument i kritik mot IPCC processen och dess slutsatser helt utan belägg (läs: utan referenser till publikationer i vetenskaplig litteratur) framstår som oprofessionellt. Internet flödar över av texter av mer eller mindre konspiratoriskt material (vem som helst kan numera tycka till på sin egen blogg!). Teorier som du nämner (t.ex. den om länken mellan kosmisk strålning och molnbildning) är ofta intressanta hypoteser, och kan verka troliga för ett otränat öga, saknar i många fall vetenskapliga belägg, eller bygger på utdatared litteratur.

Web-sidan www.realclimate.org ger svar på frågor angående många av de missuppfattningar du ger uttryck för. Detta är en mycket bättre källa till kritiskt granskad information än t.ex  Per Welanders blogg.

Jag har följt dina analyser på Morningstar i många år och alltid uppskattat din skarpa penna och förnuftiga resonemang, så jag är något förvånade över denna krönika. Vore det inte bättre om Morningstar höll sig till att publicera material av den typ som Morningstar kan bäst, dvs ekonomisk analys? Din kritik mot medias ibland snedvridna bild må vara berättigad, men fysiklektionerna kunde du kanske utelämnat åt kunnigare skribenter.

Med vänlig hälsning,

Andreas Jonsson