Labels
About Me
Thursday, December 2, 2010
How to Print non-contiguous pages in Leopard's Preview
Open your multi-page PDF in Preview, hold down the Command key, and click on each page you’d like to print. With more than one page selected, the File - Print menu item changes to read File - Print Selected Pages. Choose that, or just press Command-P, and you’ll print the selected pages.
This trick proves really useful when printing Web pages. When I want to print something from the Web, I always first print it to a PDF, to see how it’s going to look, because some Web sites don’t print well at all. But once you’re in Preview, there’s no access to the Print dialog; if you click the Print button, the print job starts. By using the Command-click trick, you can choose exactly which of the site’s pages you’d like to print, right from Preview.
But what if you want to print just one page from the Web site? You might think you could Command-click on that one page and select Print…but that won’t work. With just one page selected, Preview will revert to printing the entire document. If you had access to the Print dialog, this wouldn’t be a problem…but because you printed to a PDF, you don’t.
The solution? Hold down Command and click on every page except the one you want to print, then hit Command-Delete. This will delete the selected pages, leaving just the one page you want to print. Please note that if you’re doing this on a file you’ve saved, you do not want to save the changes you’ve made—if you do, the pages you deleted will be gone for good! (But really, in the case of a saved document, you should just use the Print dialog to specify the one page you want to print.)
So the next time you need to print a non-contiguous range of pages—or just one page from a Web site—in Preview, use the Command key to get the (print) job done.
Sources:http://www.macworld.com/article/137760/2008/12/printsomepages.html by Rob Griffiths
Tuesday, July 20, 2010
How To Config the Default Settings for VI editor
2. config your settings in this file
And you are good to go
Monday, July 19, 2010
Procedures and Functions
Multiple Plots on a Page
Plots can be ganged on the display or page in the horizontal and/or vertical directions using the system variable field
- The first element of the vector contains the number of empty sectors remaining on the page. The display is erased if this field is zero when a new plot is begun.
- The second element of the vector contains the number of plots per page in the horizontal direction.
- The third element contains the number of plots per page in the vertical direction.
- The fourth element contains the number of plots stacked in the Z dimension.
- The fifth element controls the order in which plots are drawn. Set the fifth element equal to zero to make plots from left to right (column major), and top to bottom. Set the fifth element equal to one to make plots from top to bottom, left to right (row major).
Omitting any of the five elements from the vector is the same as setting that element equal to zero.
For example, to set up IDL to stack two plots vertically on each page, use the following statement:
!P.MULTI = [0, 1, 2]
Note that the first element,
!P.MULTI = [0, 2, 2]
To reset to the default of one plot per page, set the value of
!P.MULTI = 0

This figure shows four plots in a single window. For details, inspect the batch file plot09
in the examples/doc
subdirectory of the IDL distribution. Note the following features of the plots in the figure:
- The plot in the upper left has grid-style tick marks. This is accomplished by setting the TICKLEN keyword equal to 1.0
- The plot in the upper right has outward-facing tick marks. This is accomplished by setting the TICKLEN keyword to a negative value.
- The plot in the lower left corner has different axes on left and right, top and bottom. This is accomplished by drawing the top and right axes separately, using the AXIS procedure.
- The plot in the lower right uses no default axes at all. The centered axes are drawn with calls to the AXIS procedure.
LSD journal
Date | Content | Before | After | Comments |
---|---|---|---|---|
xx/xx/2008 | CREATED | |||
07/19/2010 | stast.pro | width mod (2*dw) | width mod fix(2*dw) | dw has to be integer or half integer |
07/20/2010 | stast.prowght.pro | if width mod fix(2*dw) ne 0 then begin width = width/fix(2*dw)+1)*fix(2*dw) endif | quot = fix(width/(2*dw)) width = quot*2.*dw | width and dw are better to be float type |
11/08/2010 | lsd.pro | combined all the pieces into one | ||
11/30/2010 | lsd.pro | contain no routine to exclude the lines in the gap of two orders | yes |
Wednesday, August 5, 2009
[SHELL]Setting Environment Variables
ref: https://www.ccs.uky.edu/docs/cluster/env.html
There are two styles of shells on most UNIX (and Linux) systems:
Those derived from the original bourne shell (sh) which include bash, ksh etc. and those derived from the C shell which include csh, tsch, etc. The difficulty for many beginners is that these two families of shells support different syntax for setting variables in the environment along with different control flow commands.
You can find which shell you are using by typing:
echo $SHELL at the prompt
Under sh or bash, you set an environment variable as follows:
PATH= $PATH:$HOME/bin
export PATH
The first line sets the PATH environment variable. These two commands can be combined into a single line as follows:
PATH= $PATH:$HOME/bin; export PATH
The semicolon allows multiple commands to be issued on the same command line. Normally, this command would be placed in the .profile file located in your home directory. The .profile file is read when the sh, bash, orksh shell starts. It acts as an initialization file where you can set all kinds of environment variables, change behaviors of the shells, etc. The bash shell will also read a .bshrc resource file in your home directory if it exists. This .bshrc file is for commands that only the bash shell understands. A similar .bash_profile file can also be used for bash-only startup commands. If these files don't exist in your home directory, then the system uses some system-wide files in the /etc/profile. If you set these environment variables for bash in the .profile file, then they will be inherited by any shells that you start (spawn) from this shell including c shells. The "set", "env" or "printenv" command will display all of your current environment variables. You may need to pipe this command through less or more(e.g env | less) to see all of the variables
Assuming that the did not find mpif90 when you type it at the command prompt,
[ccs@agt-login ccs]$ mpif90
bash: mpif90: command not found
You can verify the existence of the command, by executing whereis mpif90 or locate mpif90 at the command prompt,
[ccs@agt-login ccs]$ whereis mpif90
mpif90: /opt/mpich-1.2.4/bin/mpif90
Once you find the path for mpif90 you can add it to the PATH environment variable so that the shell automatically finds the command when you type it next time at the shell. This can be done by either creating .profile or.bshrc or modifying the PATH variable in the already existing .bash_profile file
Append /opt/mpich-1.2.4/bin to the end of the PATH environment variable.
PATH=$PATH:$HOME/bin:/opt/mpich-1.2.4/bin
export PATH
Now we switch to the C shell side of things. The syntax to set an enviroment variables in the csh (and tcsh) is different.
setenv PATH $PATH:$HOME/bin
The "setenv" command will display the environment variables. These commands could be placed in a .cshrc file in your home directory that is read whenever a c shell starts. The .login file is read after the .cshrc file when this is a login script.
Assuming that the did not find mpif90 when you type it at the command prompt,
[ccs@agt-login ccs]$ mpif90
bash: mpif90: command not found
You can verify the existence of the command, by executing whereis mpif90 or locate mpif90 at the command prompt,
[ccs@agt-login ccs]$ whereis mpif90
mpif90: /opt/mpich-1.2.4/bin/mpif90
Once you find the path for mpif90 you can add it to the PATH environment variable so that the shell automatically finds the command when you type it next time at the shell. This can be done by modifying the PATHvariable in the .cshrc file. (You need to create if .cshrc file doesnt exist)
Append /opt/mpich-1.2.4/bin to the end of the PATH environment variable.
setenv PATH $PATH:$HOME/bin:/opt/mpich-1.2.4/bin
Wednesday, July 22, 2009
[VI] find and replace
?txt (backward searching)
/\
Get rid of the highlighting after search:
:set nohlsearch
Enable highlighting searching:
:set hlsearch
Find the replace:
:s/word/replacement/ ( once )
:s/word/replacement/g ( all at once on a single line )
:.,.+Ns/word/replacement/g ( all at once on the current line and
the next N lines )
:%s/word/replacement/g ( all at once the whole text )
:s/word/replacement/cg ( you need confirm whether or not to
replace )
:s/word/replacement/gi ( case insensitive )
:set ic ( case insensitive )
:set noic ( case sensitive )
:%
ref: http://www.linux.ie/articles/tutorials/vi2.php