Tuesday, May 15, 2007

External Command in VIM

  1. ':shell' or ':sh' to go into shell, once you finish. use 'exit' to go back to vim.
  2. Can also use ':! command' to run command in vim.
  3. Use ':r file.txt' to insert file.txt into the file you are editing.

Sunday, May 13, 2007

Joining PDFs the Ghostscript way

To use Ghostscript to combine PDF files, type something like the following:

gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=finished.pdf file1.pdf file2.pdf

Unless you're very familiar with Ghostscript, that string of commands won't mean much to you. Here's a quick breakdown:

  • gs -- starts the Ghostscript program
  • -dBATCH -- once Ghostscript processes the PDF files, it should exit. If you don't include this option, Ghostscript will just keep running
  • -dNOPAUSE -- forces Ghostscript to process each page without pausing for user interaction
  • -q -- stops Ghostscript from displaying messages while it works
  • -sDEVICE=pdfwrite -- tells Ghostscript to use its built-in PDF writer to process the files
  • -sOutputFile=finished.pdf -- tells Ghostscript to save the combined PDF file with the name that you specified

Transform limited spectrum

From RP photonics:

In ultrafast optics, the transform limit (or Fourier limit, Fourier transform limit) is usually understood as the minimum pulse duration which is possible for a given optical spectrum of a pulse. A pulse at this limit is called transform-limited. This condition of being at the transform limit is close to (although not exactly identical with) the condition of a frequency-independent spectral phase (which leads to the maximum possible peak power), and basically implies that the time-bandwidth product is at its minimum and that there is no chirp.

Many mode-locked lasers, particularly soliton lasers, are able to generate close to transform-limited pulses. Processes such as dispersion or optical nonlinearities can cause chirp and thus can lead away from the transform limit. Non-transform-limited pulses may be brought to the transform limit (and thus temporally compressed) by modifying their spectral phase, e.g. by applying a proper amount of dispersion or a pulse shaper. This is called dispersion compensation. For not too broad spectra, compensation of second-order dispersion is often sufficient, while very broad spectra may require compensation also of higher-order dispersion in order to get close to the transform limit.

Using and Porting GNU Fortran

System Intrinsic (function)

System(Command)

System: INTEGER(KIND=1) function.

Command: CHARACTER; scalar; INTENT(IN).

Intrinsic groups: badu77.

Description:

Passes the command Command to a shell (see system(3)). Returns the value returned by system(3), presumably 0 if the shell command succeeded. Note that which shell is used to invoke the command is system-dependent and environment-dependent.

Due to the side effects performed by this intrinsic, the function form is not recommended. However, the function form can be valid in cases where the actual side effects performed by the call are unimportant to the application.

For example, on a UNIX system, `SAME = SYSTEM('cmp a b')' does not perform any side effects likely to be important to the program, so the programmer would not care if the actual system call (and invocation of cmp) was optimized away in a situation where the return value could be determined otherwise, or was not actually needed (`SAME' not actually referenced after the sample assignment statement).