After an update Gnome on my Ubuntu system started acting strange: windows with no borders, unable to focus any windows except the last one opened, unable to move windows around the screen even with the Alt+drag trick… Solution came from the Ubuntu forums. Open gconf-editor, browse to /desktop/gnome/applications/window_manager/ and change the current and default keys to /usr/bin/metacity instead of /usr/bin/compiz. The update must have changed from metacity back to compiz (desktop effects) but on my current setup compiz doesn’t start, probably some graphics driver issues again, so I was running the toolbar and desktop part of Gnome but no window manager.
You are currently browsing the Carl's notes weblog archives for May, 2008.
There were a few days when Matlab would freeze whenever I tried to open the plot tools or add a legend to a figure. It turned out that this was an OpenGL issue which I fixed by updating my fglrx graphics driver (I’m afraid I can’t remember the details). During that time I still wanted to edit figures but because the plot tools weren’t working I had to use the command line. This is possible but you need to know the handle of each object that you want to modify. The findall command is useful for this. Once you have the handle the get and set commands let you modify properties.
For example if I want to add some circle markers to a figure:
>> h = findall(gcf, 'type', 'line')
h =
159.0101
>> get(h)
DisplayName: ''
Annotation: [1x1 hg.Annotation]
Color: [0 0 1]
EraseMode: 'normal'
LineStyle: '-'
LineWidth: 0.5000
Marker: 'o'
MarkerSize: 6
MarkerEdgeColor: 'auto'
MarkerFaceColor: 'none'
XData: [1x19 double]
YData: [1x19 double]
ZData: [1x0 double]
BeingDeleted: 'off'
ButtonDownFcn: []
Children: [0x1 double]
Clipping: 'on'
CreateFcn: []
DeleteFcn: []
BusyAction: 'queue'
HandleVisibility: 'on'
HitTest: 'on'
Interruptible: 'on'
Selected: 'off'
SelectionHighlight: 'on'
Tag: ''
Type: 'line'
UIContextMenu: []
UserData: []
Visible: 'on'
Parent: 158.0101
XDataMode: 'manual'
XDataSource: ''
YDataSource: ''
ZDataSource: ''
>> set(h, 'Marker', 'o')
The MathWorks have documented all of this.
Reversing the elements of a vector in Matlab can be done with X(end:-1:1). The end keyword is also useful for accessing the last element of a vector instead of using size or length.
When I tried to print a figure or some code from the File > Print menu or by clicking the Print button, I got a popup saying There are no properly configured printers on the system. This is on a GNU/Linux system running CUPS. Strangely the print command worked fine from the command line.
There is apparently a CUPS related bug in Java. I applied a workaround and set all my printers to portrait orientation. This allowed me to print from other Java applications such as Netbeans but still not from the Matlab GUI.
In the end the problem was another CUPS related bug in Java which can be solved by commenting out a line in /etc/cups/cupsd.conf like this:
Listen localhost:631
#Listen /var/run/cups/cups.sock
The guy from the MathWorks support team was very helpful and patient. Here is the e-mail that helped me solve the problem, I hope he doesn’t mind me posting it here. Although only point 5 was required in my case the other items may be useful for others.
Read more…
Matlab exports figures as PDF files with very large borders. This can be magically fixed with a small Perl script called pdfcrop.
After installing WordPress I noticed the links weren’t working. To get permalinks (pretty links) to work with Apache you need to have mod_rewrite enabled and configured in a .htaccess file. WordPress can add the right lines but only if it has write access to the file. I did the following.
% cd blog % touch .htaccess % su % chgrp webfiles .htaccess % chmod 664 .htaccess
Then go back to the WordPress admin page, change and save the permalink options again. The .htaccess will be modified as required. This is all explained in the WordPress documentation.
In LaTeX documents figures must always have the caption field before the label field. Otherwise the references will be wrong. See this other blog for more.
Finally I’ve set up a place to jot down some of the things that I want to remember. I imagine this will mostly be solutions to computer related problems that seemed tricky to solve at the time. Maybe some items will be useful to others as well.