Monthly Archives: June 2007

Using LaTeX

It is no secret that I’m a fan of \LaTeX.

Here is a good (if not the best) tutorial:

Here are a few examples of math(I can only show inline math in this blog so this stuff won’t look right in the post, but LaTeX has other equation typesetting features. Check the above link for more info):

  1. Integrals $\int_{-\infty}^{\infty}f(x)dx = 2$ becomes \int_{-\infty}^{\infty}f(x)dx = 2
  2. Fractions $\frac{x+1}{x+2}$ becomes \frac{x+1}{x+2}
  3. Superscripts, subscripts, etc $\sum_{n=0}^{N}2n + 1$ becomes \sum_{n=0}^{N}2n + 1

As an example of other math formatting you would do:


\prod_{x = 2}^{10}2x+1


Note that when you don’t typeset math inline with text, you omit the $ symbol and instead wrap the equation inside a \begin{equation}..\end{equation} pair.

Using AMShellWrapper for Wrapping Command Line Tools

I have found that AMShellWrapper is very nice for wrapping Command Line Tools. For an example on how to use it, see Andreas Mayer’s code. You might also find my cocoagcalc source code useful.

The key part of using AMShellWrapper is to implement the protocol:

@protocol AMShellWrapperController
// implement this protocol to control your AMShellWrapper object:

- (void)appendOutput:(NSString *)output;
// output from stdout

- (void)appendError:(NSString *)error;
// output from stderr

- (void)processStarted:(id)sender;
// This method is a callback which your controller can use to do other initialization
// when a process is launched.

- (void)processFinished:(id)sender withTerminationStatus:(int)resultCode;
// This method is a callback which your controller can use to do other cleanup
// when a process is halted.

// AMShellWrapper posts a AMShellWrapperProcessFinishedNotification when a process finished.
// The userInfo of the notification contains the corresponding NSTask ((NSTask *), key @"task")
// and the result code ((NSNumber *), key @"resultCode")
// ! notification removed since it prevented the task from getting deallocated


Preview of upcoming articles

How to use AMShellWrapper, maybe some Gnuplot things, additional Ruby tutorials?


All my readers, thanks for tuning in. I am swamped with work this summer, so I don’t have a chance to post as frequently as before. I will post from time to time.

Apple Design Awards winners for 2007

Here is the list. After the hohum keynote, something positive.

Making Gantt charts on Mac OS X

Here is a Java application(freeware) for doing so.

“Must read” article for C++ programmers looking at ObjC

See the article(and get the link here):