August 24, 2008 by atchieu
This is a little put together from all over the place. Hopefully this is all you need to know about installing Fink and Fink Commander on Mac OS X.
Basically, Fink allows you to use Linux type programs (GUIs and command line) native in OS X. I am not going to dive into all the gory detail of what Fink is and is not, I am just going to get it to work. Fink gives you a command line tool to install these programs (much like apt-get for Ubuntu/Debian). Fink Commander is the GUI for Fink.
From my previous journal entry:
Today I have taken the actions to get my Fink installation going. Here are the steps taken so far:
First I had to do a community update of X11 (for Leopard) to fix some bugs Apple will PROBABLY release an official update soon, but I can’t but I can’t wait that long! I updated X11 to version 2.1.1. Goto this website.
Apparently it is MUCH better to install Fink by source. More information can be found here. You can follow the directions in the web page given. There is a little bit of a problem… you will probably have to add the path /sw/bin to your PATH variable at some point. I am not sure if Fink automatically does this or not. You can do so by adding it to .bashrc or .bash profile… I think. I also ran the selfupdate and the update (but of course there is nothing to update).
One should note that Fink is self-containted in the /sw/ directory. If you ever want to remove it and all the programs that were installed via Fink, just delete that directory!
The only commands you will ever need to know:
- fink list NAMEOFSOFTWARE, scans the available packages and lists those that match your query
- fink install NAMEOFSOFTWARE, installs the package
- fink update-all, updates all binary and source packages. You might run into a problem: see this or this
- fink selfupdate, updates the binary or source version of Fink
If you don’t want to remember these, install Fink Commander. This is the GUI interface and is pretty good. The only thing it wont do is the update-all. So if you have a lot of “outdated” packages run update-all. This will take FOREVER because you will need to build things from source if you installed Fink from source.
Virtual Packages?
From the Fink website: “packages with names like system-perl are placeholder packages. These do not contain actual files, but merely serve as a mechanism for fink to know about programs that have been installed manually outside of fink.
Starting with the 10.3 distribution, most placeholders aren’t even real packages that you can install and remove. Instead, they are “Virtual Packages”, package data structures generated by the fink program itself in response to a pre-configured list of manually installed programs. For each virtual package, fink checks for certain files in certain locations, and if they are found, considers that virtual package “installed”.”
Tags: fink, fink commander
Posted in OS X | Leave a Comment »
August 22, 2008 by atchieu
Although the GUI for Xfig is a little outdated, in my opinion it is the best software to use for academic vector-based diagrams. It allows the use of LaTeX equations in conjunction with the figure.

Screenshot of Xfig in action!
What I prefer is to make a .pdf of the figure through pdflatex and then include the image to the document of interest. The directions parallel the following website:
http://graphics.stanford.edu/lab/howto/xfig_latex.html
When adding LaTeX expressions to a figure use the $…$ to switch to math mode when necessary. Make sure you set the flag on the text to “Special Text” using the “Text Flags” menu on the bottom. Then export the figure from Xfig using the “Combined PS LaTeX (PS and LaTeX part)” to the default name.
Create a driver file (e.g., this case my default export name was fig1 thus I use fig1.tex) containing something like:
\documentclass{article}
\usepackage{epsfig}
\usepackage{color}
\setlength{\textwidth}{100cm}
\setlength{\textheight}{100cm}
\begin{document}
\pagestyle{empty}
\input{fig1.pstex_t}
\end{document}
Then run:
latex fig1.tex
dvips -E fig1.dvi -o fig1.eps
epstopdf fig1.eps
Note that you can change the name “fig1.eps” to anything that you want. I have included the driver file in the path ~\Work\TEX\driver\fig1.tex. There is something wrong with my version the Xfig export so when you export just export it to the name that the file is saved as (e.g. do not enter a new filename). Then change the driver file appropriately.
Some key notes about using Xfig.
- It’s always tough to figure out what scale you should draw these things on especially since the units on the border don’t mean all that much. My rule of thumb is to put down an arrow using the “polyline” function and then judge your sizes from then on.
- I find it impossible to pan side to side, this will get all your nerves. Zooming in and out is a pain too.
- Get a mouse. The middle mouse click is so useful.
- Xfig does not make good “3D” drawings (to my knowledge). Does anyone know an alternative?

Example of what you can do with Xfig! This is a diagram I made for my research.
Tags: latex, pdflatex, xfig
Posted in Graphics, Linux / Unix | Leave a Comment »
August 7, 2008 by atchieu
In an attempt to merge PDF files from chapters of a book I started a google search of the methods to do this. There are several ways to do this but the easiest way (for OS X) is to use the JoinPDF. It seems simple enough and it does splitting for you too!
Other methods exist, but are a little more complicated. I assume that taking the Imagemagick route isn’t all too painful though…
For Windows tryout PDFMerge.
Tags: PDF, PDF merge, PDF split
Posted in OS X, School, Windows | Leave a Comment »
August 1, 2008 by atchieu
I actually had to use it today because I really couldn’t make out an image on the screen of an equation about Bessel’s functions on Wikipedia. To use this feature make sure it is turned on by going to Preferences > Keyboard & Mouse > Mouse and check the box that belongs to “Zoom using scroll wheel while holding.” Now you can zoom in and out by using the scroll button on your mouse (or trackpad).

The prefernece pane where you find the zooming function.
Posted in OS X | Leave a Comment »
July 30, 2008 by atchieu
Nearly everyone who uses OS X knows that one department where the OS is lacking is in the realm of IP printing and IP printing support. For most of us in an academic infrastructure, this is usually how we connect to our printers. But when you look at the configuration of such a printer, you are either only left with a handful of options or you have to follow a maze to find options. But luckily, the underlying printing system is managed by CUPS (Common Unix Printing System). Depending on your version of cups you can easily access all your printers, queues, and options in one convenient place… in your web browser! CUPS has a nice user interface that can be accessed in your web browser by typing the following into your web browser of choice
http://localhost:631
Check it out, it is pretty neat. It’s a nice and tidy place for all your printing needs… now if only OS X could just capture this and translate it into their Preferences pane.

Screenshot of the web interface for CUPS 1.3.x.
Tags: CUPS, IP printing, printing
Posted in OS X, School | Leave a Comment »
July 29, 2008 by atchieu
Here is some help in having some two-way syncing between your calendars in Google Calendar, iCal, Thunderbird, and Microsoft Outlook. Saves me from writing a whole bunch!
Sync Calendars
Unfortunately, Address Book cannot be synced with your Google Contacts unless you have an iPhone (lame)… here is the link to that anyway.
Sync Address Book
Tags: iCal, syncing
Posted in OS X, Windows | Leave a Comment »
July 25, 2008 by atchieu
This is a stupid post but I am just putting it here because I will forget how to fix this in the near future. So the problem with the contour function is that if you want to fill all the contours, it never fills the contour at the lowest limit in which you are interested in, i.e. it will leave an image with a disgusting white splotch where it should really be dark blue.

Look at that ugly white. This is because 'contour' doesn't know any better!
A quick fix to this is to set the background of an image as the color that the white areas are supposed to be. To do this, you should run the following lines:
[contours, h_w] = contour(x, y, w, w_level, line_color);
% Here is a nice fix to fill the last contour on a filled plot
set(gca, ‘Color’, [0 0 .5]); % Set background color of “axes”
set(h_w, ‘Fill’, ‘on’); % Set contour filling on
set(gcf, ‘InvertHardCopy’, ‘off’); % Prints background color when printing
Of course, if you change the default color scheme from jet to something else, you will need to change the ‘Color’ accordingly. You should have a resultant picture like this.

Ah, much better.
This is just really a temporary fix, someone should really dive into the code and fix this!
Tags: contour, MATLAB
Posted in School, Software | Leave a Comment »
July 24, 2008 by atchieu
I use this a lot for research. I have a series of images in a postscript type format (e.g. EPS or PDF) and then I want to turn the time series of data into an animation. For this i use ImageMagick because it is a really nice command line tool for Unix operating systems to do batch type operations. You can even pipe it to C code! (Make sure you have it installed because it is not usually distributed with a bare Linux OS)
To do a simple conversion of images to an animated GIF we invoke the following
>convert -verbose -delay 20 -loop 0 -density 200 *.pdf output.gif
and we get a nice GIF file. This takes the files named *.pdf in the order that they are listed and makes a GIF out of them with a 20 hundreths of a second delay between each frame. The -loop 0 flag makes it loop indefinitely. You can put 3 in there to loop 3 times etc. The -density 200 flag specifies a DPI of 200 for the image. This is only really used when converting postscript images.

Animation of flow over a cylinder (vorticity) made from MATLAB + ImageMagick.
Tags: animation, gif, imagemagick
Posted in School, Utility, Video, Web | Leave a Comment »
July 24, 2008 by atchieu
MATLAB and Compiz do not mix (I am using Ubuntu 8.04). If you just installed MATLAB, in all likelihood MATLAB shows a window with nothing in it. For some reason MATLAB does not use the right JAVA toolbox or something along those lines. So we have to edit the launch file to do this. So add
export MATLAB_JAVA=/usr/lib/jvm/java-6-sun/jre/
to the /PATHTOMATLAB/bin/matlab lauch file so that it looks something like this:
#!/bin/sh
export MATLAB_JAVA=/usr/lib/jvm/java-6-sun/jre
#
# Name:
# matlab script file for invoking MATLAB
#
# …
MATLAB should run much better. In my experience, it is much better than the export AWT_TOOLKIT==MToolkit trick. MATLAB will still be fickle with Compiz in place (well, anything will be fickle with Compiz running). The best solution, if you use MATLAB a lot, is to just not use Compiz or any other eye candy.

Compiz and MATLAB 2007 running at the same time!?!
Tags: compiz, MATLAB
Posted in Linux / Unix, Programming, School, Ubuntu | Leave a Comment »
July 23, 2008 by atchieu
Check the ~/.Trash/ and the ~/.local/share/Trash/files/ (Ubuntu 8.04) directories and see if the files are there. Most likely you are having a problem with permissions, but I’ve had issues where the permissions are perfectly okay but somehow the OS will still not let you empty the trash! To force an empty type
sudo rm -rf FILES
Be careful with this command because it is VERY unforgiving! Trust me. You should really alias a check to make sure that it asks you whether not you want to remove the file (e.g. in your .bashrc).
Tags: trash
Posted in Linux / Unix | Leave a Comment »