Saturday, November 22, 2008

Exporting Simulink models to eps or other formats

To export Simulink models/block diagrams to eps or other image formats is easy. First, open your model. Next, use the print function to export to other formats (note the letter 's' that must precede the model name, which is entered without the '.mdl' postfix):
print -s<modelname> -d<xxx> -r<resolution> <filename.xxx>
For example, to export simmodel.mdl to eps with a resolution of 300 dpi, type
print -ssimmodel -deps -r300 simmodel.eps
The file simmodel.eps will be created in the directory where the command is entered.

For more information about image formats and print options, type
help print
Enjoy!

Friday, November 14, 2008

Adding difficult code snippets to your blog

It is sometimes difficult to add code snippets your blog, for example using Blogger/Blogspot. Code involving xml or html tags might get parsed if you simply try to use the <pre> tag. A simple solution is to copy and paste your code snippet into this website, which transforms it to "readable" code. You may then enclose the resulting code in <pre> tags as usual.

For example, when I needed to write <pre> in the previous paragraph, I went to the above website, entered <pre>, and got &lt;pre&gt; back in return, which I simply copy and pasted back into the Blogger editor.

Touchpad not working after upgrading to Ubuntu Intrepid

If you find that your laptop touchpad is not working after upgrading to Ubuntu 8.10 Intrepid, it may be that your SHMConfig is not enabled.  The official instructions are to open a terminal and enter the following command:
gksudo gedit /etc/hal/fdi/policy/shmconfig.fdi
Then put this into the file (which was empty in my case):
<?xml version="1.0" encoding="ISO-8859-1"?>
<deviceinfo version="0.2">
<device>
<match key="input.x11_driver" string="synaptics">
<merge key="input.x11_options.SHMConfig" type="string">True</merge>
</match>
</device>
</deviceinfo>
After a reboot, your touchpad is hopefully working again. Also, you should have a Touchpad entry in the System menu: System -> Preferences -> Touchpad

Friday, September 12, 2008

Rip and shrink copy-protected DVDs

When you buy a DVD movie at the shop you would like the opportunity to back it up. However, due to the built-in copy protection, this might not be a simple task if you do not have Ubuntu with k9copy and K3b installed.

k9copy is able to break the copy protection and make a DVD image which you can burn to DVD using the burning application K3b (or other DVD burning software). Because ordinary DVDs are dual-layer (8.9 GB), the size of their content exceeds the capacity of cheap, single-layer recordable DVDs (4.4 GB). Luckily, k9copy can also shrink the DVD image to fit on a single-layer DVD. The quality loss is most of the time negligible but if you worry about this, the software gives you an option to only copy parts of the DVD content, e.g., only the movie itself without extra material.

Naturally, if you have those expensive burnable dual-layer DVDs, you can copy the entire DVD without any loss of quality.

To install, do
sudo apt-get install k9copy k3b 
or to get all the recommended packages, do
sudo apt-get install k9copy k3b k3b-i18n libk3b3-extracodecs movixmaker-2 normalize-audio libgtk2-gladexml-perl flac 

Windows users:
Download DVDDecrypter, DVDShrink, and Imgburn (see below). DVDDecrypter removes the copy protection and let you copy the DVD to your hard drive. You may then use DVDShrink to shrink the DVD copy to fit on a single-layer DVD. Apparently it is possible to use DVDShrink for the entire operation (both copy and shrink) but in my experience you should use DVDDecrypter for the copying, and DVDShrink for the shrinking. The shrinked DVD folder or image file can be burnt to a burnable DVD using DVDDecrypter or ImgBurn.

Downloads:
DVDDecrypter 3.5.4.0
DVDShrink 3.2
ImgBurn 2.4.2.0

You can find more video-related applications, troubleshooting, and guides at Doom9. They claim that DVDDecrypter may have trouble ripping new DVDs with structural protection. If you experience problems, you may try DVDFab HD Decrypter 5.0.9.0, however, I have no experience with this program. You might also consider switching to Ubuntu or other Linux distributions!

Enjoy ripping!

Tuesday, July 15, 2008

Get things done with Gnome Do


Gnome Do is a quicklauncher for Linux. Although the name implies it is a Gnome application, it apparently works just as well in XFCE4 or KDE. Similar to the search feature of Opera (which remembers visited websites and content), Do allows you to quickly search for items in your desktop environment and perform useful actions on those items. Do is inspired by Quicksilver and GNOME Launch Box.

You launch Do with Super+Space. Then, if you want to send an email to John, simply type "email john." If you want to listen to Radiohead, type "play radiohead." Also, Do is able to learn from your previous actions. Therefore, if you for example use the Opera web browser often, typing "o" in Do will launch it.

Ubuntu 8.04 Hardy installation instructions:

1. Add the Gnome Do PPA Repository to your sources list.

deb http://ppa.launchpad.net/do-core/ubuntu hardy main
deb-src http://ppa.launchpad.net/do-core/ubuntu hardy main
2. In Synaptic Package Manager, search for 'gnome-do' or install it from the terminal:
sudo aptitude update && sudo aptitude install gnome-do

More information about this nice, fast, and lightweight application can be found at the Gnome Do wiki.