May 2005 - Posts

beamer 中文书签的解决方法

  1. Use pdflatex directly:

    pdflatex filename.tex
    pdflatex filename.tex
    gbk2uni filename.out
    pdflatex filename.tex

  2. latex->dvips->ps2pdf:

    \documentclass[cjk,hyperref={dvips}]{beamer}

By bethoven @ TeX.NewSMTH
posted by wenyang with 0 Comments

Athena Printing

Answers to FAQ: take a look at http://web.mit.edu/answers/printing/.

  • sending a file to a printer: lpr -Pprintername filename
  • print several files at the same time: lpr -Pprinter file1 file2 file3 ...
  • check if the printer is working and to check if your file has been printed: lpq -Pprintername
  • check the complete list of printer locations, with their status and number of jobs: cview printers
  • remove their own printing job: lprm -Pprintername ## (where ## is the job number)
  • remove all jobs on that printer: lprm -Pprintername -
  • print PDF files directly: acroread -toPostScript < filename.pdf | lpr (add acro, if necessary)
  • print on both side of the paper: lpr -Pprintername2 ...
  • printer hardware problems, send mails to "hotline # mit.edu"
  • Printing SELECTED pages of a POSTSCRIPT file: psrev
  • print 2 pages of a ps file per printed page: psnup -2 filename.ps | lpr -Pajax
  • print 2 pages of a text file per printed page: enscript -2r -Pprinter filename

No quota for printing so far: The print quota system is not currently in service. Pages that you print will not count towards a print quota. However, the print servers do log printer usage, and abusing Athena print resources is a violation of the Athena Rules of Use.

posted by wenyang with 0 Comments

email backup report:

Last sent (5/22/2005):

webmail-sent:

All. Kept.

sent-mail:

2-100. #1 failed to sent. Don't know why.

100 Aug 18 To: Yang Wen         (677) 8/17 ITS meeting outline

Last sent (5/12/2005): (a few attachments, such as *.rar, are unable to sent; the attachments are deleted.)

CEE:

989 May 11 Tara Walor          (8491) [Cee-grads] F'05 Sloan Course Bidding Guidelines

CSSA:

681 May 11 Miao Ye             (4896) [CHN 2003] Career Panel Discussion: CSSA Memebers Experience

Badminton, ListAnime:

All, deleted

Soccer:

583 May  5 Xiaowei He          (1740) Friday 8:00pm-10:00pm Practice on Turf

Inbox03-04:

All. Kept.

 

 

posted by wenyang with 0 Comments

Run matlab in batch mode

Use option "-r MATLAB_command" to run matlab in batch mode.

Automatically run the specified MATLAB M-file, either commands supplied with MATLAB or your own M-files, immediately after MATLAB starts. This is also referred to as calling MATLAB in batch mode. Separate multiple commands with commas or semicolons (;). M-files must be on the MATLAB path or in the MATLAB startup directory. Do not include the pathname or a file extension.

Example: matlab -nojvm -nosplash -r MyCommand

Reference: MATLAB Documentation - Desktop Tools and Development Environment - Startup Options

We can now use "system" (need to include < cstdlib >) to call a shell-script, which in turn calls matlab to do something.

posted by wenyang with 0 Comments

How to FORWARD all the mails you already have in Athena (REDISTMAIL)

Yes, I managed to re-sent mails of my mit.edu mail box to another mail address, while keeping (hopefully) most mail header information unchanged. This is useful because (1) the mit mail box is too small (250M) if you don't want to delete your mails, and (2) we can use Gmail or whatever email accounts to backup and manage our email...

The following are the steps I used to send all the mails in a folder of my mit mail to Gmail.

(Assume '%' is the command prompt in Athena, and characters in bold face are the commands you have to input.)

  1. % pine (ENTER, of course...)
  2. In pine interface, goto Folder-Collection < OLD Mail MH >
  3. Press 'A' to add a new sub-folder, e.g., Badminton
  4. Enter an original folder in Folder-Collection < MIT Mail >, say Badminton_mit
  5. Press ';' and then 'A' to select all mails (You might have to enable this command in pine SETUP)
  6. Press 'A' and then 'S' to apply SAVE command to all the selected mails
  7. Press down-arrow to switch folder to < OLD Mail MH >, and type Badminton, then press ENTER.
    Now all the messages in current folder (Badminton_mit) have been copied to the < OLD Mail MH >.Badminton, and by default these messages are also marked as "deleted" with a 'D'.
  8. (Optional) If you don't want to delete all these messages, press 'A' and then '*' to apply FLAG command, and then press down-arrow three times to select the "Deleted" entry, and press 'X' twice to unmark all the delete-flags.
  9. Quit pine.
  10. Check the directory: ~/Mail/Badminton, your mails should be there (files named as consecutive numbers).
  11. % add consult (if you have not yet done so)
  12. % redistmail xxxx@gmail.com /mit/your_athena_username/Mail/Badminton/

It will pause appropriately when sending so as not to flood the mail hubs. So be patient if you have a long list of mails to send...

Note (5/10/2005):
  • Make sure you know what you are doing. Read the referenced article (see below) first.
  • In pine, you can create mh folders.
  • To forward future mails, use chpobox.
Reference:

The "redistmail" program is designed to forward the contents of a single mail folder to the given address. This uses the mh "dist" command, so the headers will not be modified; a single Resent-To: line will be added.

Syntax:
athena% add consult
athena% redistmail address@wherever.net foldername

Give the foldername as you would specify it to mh mail; i.e. inbox, or /var/tmp/mymail.

Flags: -h will display this help message.
-n will cause redistmail to tell you what it would do, but not
actually send any mail.

The redistmail process will use appropriate pauses when sending so as not to flood the mail hubs; please do not attempt to circumvent these pauses, lest the postmasters become cranky.

Note that this only works with mh folders, not RMAIL files or Netscape mail files or any other format.

Last updated: 10/25/99
http://web.mit.edu/answers/mail/mail_redistmail.html

(Provided by MIT IS&T Stock Answers)
posted by wenyang with 0 Comments

eject, screen, lftp ...

eject - eject removable media

When you umount /mnt/usb, sometimes the LED is still on, then you can try this

eject /mnt/usb

screen - screen manager with VT100/ANSI terminal emulation

SYNOPSIS
       screen [ -options ] [ cmd [ args ] ]
       screen -r [[pid.]tty[.host]]
       screen -r sessionowner/[[pid.]tty[.host]]

lftp -

To be continued ...

posted by wenyang with 0 Comments

General Exam is approaching...

Below is a list of courses for my general exam (oral part):

Course#        Course Name                                    Units
1.125   Web System Architecting: Building Web Services         12
1.130   Wavelets, Filter Banks and applications                12
1.203   Logistical & Transportation Planning Methods (UrbanOR) 12
1.222   Transportation Demand and Economics                    6
1.225   Transportation Flow Systems                            6
1.264   Database, Internet and System Integration Technologies 12

I met my advisor and discussed the question of who else should be members of my exam committee.

posted by wenyang with 0 Comments

[Script] run DynaMIT, check runtime

#!/bin/bash
echo '=== Running CorbaFreeDynaMIT from current directory ==='
STARTTime=`date`
echo 'Preparing to delete __* files in current directory and all sub directory'
ls __e*
if [ $? = 0 ]
then 
    echo -n "Really want to remove these files? (y/n):"
    read yesORno
    if [ $yesORno = y -o $yesORno = Y ]
        then
        echo 'find . -maxdepth 1 -name "__*" -exec rm -v {} \;'
        find . -maxdepth 1 -name "__e*" -exec rm -v {} \; && echo "Files removed."
    else
        echo "You did not choose 'y'. Continue without deleting"
    fi
fi
time ~/CorbaFreeDynaMIT/DynaMIT/DynaMIT dtaparam.dat
echo 'Script' $0 'started at: ' $STARTTime
echo -n 'Script' $0 'finished at: '&& date
echo 'Done.'

posted by wenyang with 0 Comments

nohup - run a command immune to hangups, with output to a non-tty

In bash, use

nohup ~/CorbaFreeDynaMIT/DynaMIT/DynaMIT dtaparam.dat 1>log_stdout 2>log_stderr &

 

posted by wenyang with 0 Comments

DynaMIT demo steps (By rama, 3/15)

1. Login as demo

2. Cd to 'irvine'.

3. Create another xterm for his directory:

xterm &

4. In one window, run:

./DynaMIT dtaparam.dat

[notice the ./]

5. Wait until DynaMIT starts reading socio-eco file. Then, in the other window, type:

./xdta -f xdta.ini

6. Click clock button first, in the control panel. Then choose density for color and thickness in the network view window. Expand/zoom the time horizon.

7. Make control panel window the active window (click on the top window bar).

8. Demo should run now on its own. Explain the basic DynaMIT functions and capabilities.

posted by wenyang with 0 Comments