Archive for June, 2006

PrimoPDF

In the past, I used to manually set up the tool chain for PDF production on Windows.

Basically, this requires the installation of Ghostscript and a PS printer driver that prints to a RedMon port. The trick is to configure the PS printer driver so that it embeds Type 42 fonts. And I also need to have pdftk to set the document security and then stuff…

Well, that was indeed the past. :P These days I get lazy and just use the free (as in beer) product PrimoPDF. So far, I find it does everything right, but I still manually remove the Ghostscript 8.50 that is bundled in its installer (remove the gs subdirectory) and let it use the most current version on my computer.

Combined with the ability to split and join PDFs using pdftk, that’s a pretty good basic setup for everyday PDF production at a low low cost of zero dollars. I am all thankful!

Update: Many of you reminded me that I should really mention PDFCreator in this post as well. I agree. Both of them are great!

Comments (3)

Selecting Objects in Ipe

If you have ever wondered why there is a circle when you click to select objects in Ipe, well, hmm, that means you may want to read Section 4.2 of the manual, which explains the selection model in Ipe. :P

Basically, when the mouse button goes down, Ipe computes a list of objects that hits the circle, sorts the objects by proximity, and selects the first object by default. To cycle between the objects in this list, press the Space bar without releasing the mouse button. Note that the size of the circle is controlled by “select distance” in the Preference dialog.

It’s a great time-saver if you use Ipe for complicated figures.

Together with the ability to quickly zoom in Ipe using the wheel, selecting objects in Ipe should be a breeze.

Comments

Relative to Slide

A and B are working on a PowerPoint talk together.

A: Is the picture at the center?
B: Hmm, move it to the right, just a little bit.

To avoid this conversation, note that there is a toggling option Draw->Align or Distribute->Relative to Slide. Enable it and select the picture. Now you can use Align Center and Align Middle to achieve the same effect. Just remember to disable it after you are done.

I put this option on the drawing toolbar because in my use I toggle this option very frequently.

Comments

A Short Note on Ergonomics

A lot people around me have Repetitive Strain Injury (RSI), and it seems to me that they are constantly in search of that “ergonomic keyboard”, or that “ergonomic mouse”, or that “ergonomic something”.

Now I honestly do not know if such devices exist, but I do have an observation when it comes to preventing / treating RSI: our lives practically demand the Strain, and therefore, it seems wiser to deal with the Repetitiveness.

Here is the punchline: buy a bunch of keyboards and pointing devices, each different in their design. Then rotate between them once every two weeks or so.

This rotation scheme has served me very well. I can only hope it works for you. I am not a therapist.

The crucial point to note is that these devices should be as different from each other as possible so that they strain your muscles somewhat differently. For instance, if you just go out and buy ten optical mouses, that probably won’t work very well. Perhaps rotating between just one trackball and one mouse will serve you better.

I conjecture that this “strain your body differently” principle is what some therapists are solely relying on, whether they are consciously doing so or not.

One of my friends, regardless of how “ergonomic” her keyboard is, still needs to go see her therapist once in a couple months. And every time she sees her therapist, the therapist’s recommendation always results in a change. Maybe the mouse is different this time, maybe the keyboard tray’s height will be adjusted. For the first few weeks after the session, the change “works”. But the problem will manifest itself again afterwards, so she goes see her therapist… and the cycle repeats.

Note that I am not arguing that no device is “more ergonomic” than the others. For example, I actually believe if you want to stick to one keyboard in your whole life, you want to stick with Kinesis Contoured.

But really, the ThinkPlus USB Keyboard with UltraNav is also very nice. Now, throw in a 3M vertical mouse and a very simple Logitech trackball. Together with the keyboard and mouse that you already have, you have just built a very cool equipment pool.

Finally, I note that this rotation model should work very well if you have a lab or research group that can pool the equipment budget.

P.S. As for chairs, I don’t have the money to buy a couple fancy chairs. Since I don’t use air conditioning much, I like Aeron best. I just keep adjusting my Aeron during the day before I get fatigue in a pose. I know some people say Leap or Freedom or something else is better, but who’s going to buy it for me? :P

Comments

Why R1C1?

In this post I mentioned that I prefer the R1C1 style most of the time when I am using Excel. One of the reasons is formula visual consistency.

First a bit of notation. From now on I will refer to a cell as “|ref|” where “ref” is its location in the R1C1 style. For example, the cell to the right of the home cell will be |R2C1|. A reference by itself will not be decorated. So you want to read |R2C1| as “the cell at R2C1″.

In Excel’s notation, a reference is absolute if the row and column are specified as fixed number. For example, R17C3 always refer to the cell at row 17 and column 3. Always.

But in many copy and paste operations, we usually want relative references. Suppose we start with an empty sheet and put the number 42 in |R1C1| and the number 7 in |R1C2|.

Then, in|R2C1|, type = and then press the up arrow. Excel will show =R[-1]C in the formula bar. This means “= the cell in the same column and one row above”. The number in the square bracket is the offset, and an offset of zero can be omitted.

Now copy |R2C1| to |R2C2| by copy and paste. Notice that the formula in |R2C2| is still =R[-1]C.

To toggle the formula view, press Ctrl-`. It’s a good shortcut to remember.

This is what you should see, roughly:

42	7
=R[-1]C	=R[-1]C

Now, in the A1 style:

42	7
=A1	=B1

It’s hard to settle on which one is more visually pleasant, but I think very few people will argue the A1 style is more visually consistent, even in a small example like ours.

P.S. While we are at the topic of relative vs. absolute references, another shortcut to remember is the function key F4. It cycles among the four possible combinations of relative and absolute references. Go to |R2C1|, press F2 to modify the content, and press F4 four times to cycle.

It’s a very handy shortcut if you use it well. For example, I confess that I have trouble counting rows and columns. So if I have to refer to a cell far away, I usually enter its absolute reference, say R42C18, and then press F4 three times to convert it to the relative reference, which will be R[40]C[17] if the current cell is |R2C1|.

Comments

LaTeX Source Specials

As I have hinted in this post about pdfopen, it is possible to do some sort of round-trip LaTeX editing with the right tools. There are two directions to make the round-trip complete.

The forward jump is editor-to-previewer: given the current cursor location in the editor, jump to the corresponding paragraph in the previewer. The backward jump is symmetrical. The magic behind this is called “source specials”.

While it sounds somewhat like a Chinese dish with special sauces, it really isn’t. :P Instead, when you generate the DVI file, you ask latex to tag the DVI file with “source specials”. Imagine each word in the DVI file is tagged with the source filename and the line number of the word.

The forward jump is to ask the previewer to display the location that is right after the editor’s cursor location (filename and line number). The backward jump is to ask the editor to put the cursor closest to the current location in the previewer (usually the location of a double-click).

Let’s get to the example. I will show how to get round-tripping to work in Windows using MiKTeX distribution 2.4 and GNU Emacs. Other configurations are similar.

(Round-tripping between LaTeX and PDF is similar in principle, but the tools are not very mature yet. I will save this for a later post.)

  • Install the AUC TeX package into Emacs.
  • To enable tagging in latex, invoke it with the --src-specials option. Say the primary LaTeX source is main.tex, AUC TeX invokes it this way, :
    latex --src-specials \nonstopmode\input{main.tex}
  • To do the forward jump with YAP (the DVI previewer in MiKTeX), say when the cursor is on line 65 of hetero.tex, AUC TeX will execute:
    yap -1 -s65hetero.tex main.dvi
  • To enable the backward search, install the gnuserv package. Google can help you locate many links, like this and the rest.
  • Assuming you have gnuclientw installed on your path, in YAP, go to View->Options->Inverse Search. Inside Program combo, you should see “GNU Emacs (Single Instance)”. Example command line:
    gnuclientw.exe -F +%l "%f"
  • Note that installing gnuclientw addresses the problem in this comment. In general, you rarely want to invoke emacs directly. Use gnuclientw instead.

Have fun!

Comments (9)

Theory Seminar 2006-06-02

Siu-Wing Cheng
Associate Professor
Department of Computer Science
The Hong Kong University of Science and Technology

WEH 7220
2006-06-02 15:30

Sampling and Meshing a Surface with Guaranteed Topology and Geometry

This paper presents an algorithm for sampling and triangulating a smooth surface $\Sigma\subset \mathbb{R}3$. The only assumption we make is that the input surface representation is amenable to certain types of computations, namely computations of the intersection points of a line and $\Sigma$,computations of the {\em critical points} of some height functions defined on $\Sigma$ and its intersection with a plane, and computations of some {\em silhouette points}. The output triangulation is guaranteed to be homeomorphic to $\Sigma$. The algorithm also ensures bounded aspect ratio, size optimality, and smoothness of the output triangulation.

Comments