Search This Blog

Wednesday, September 26, 2007

Perl Tutorial Sites

Perl = Practical Extraction and Report Language

http://www.tizag.com/perlT/index.php


Monday, September 10, 2007

File repository setup

I have been using SVN (subversion) to manage my document file repository. SVN is being utilized more widely than CVS. With the repository in my Linux box, accessing the SVN repository from Windows on my PC was not an easy task.

There are several ways to use ssh (secure shell) to connect a remote host from Windows: Cygwin, openssh for windows, CopSSH, and PuTTY. PuTTY is popular since it is free of charge and can be easily incorporated with any other Windows software. Using a private ssh-key, PuTTY allows very easy access to remote hosts, providing a reasonable GUI as good as other ssh programs for Windows such as TortoiseSVN.

TortoiseSVN is also free software, providing all the SVN features under Windows. It works with Windows Explorer (Firefox also works fine with it!) to locate the remote repository through an ssh protocol authenticated by the private key stored in PuTTY.

One of practical ways of using SVN is:
1) Visit the repository to locate a directory of tasks;
2) Check out the directory to a local directory (This can be done to Windows or Linux. In Linux, KEDSVN provides an excellent GUI);
3) Work with files in the directory;
4) Once done, commit the files updated to the directory, which will be remotely transmitted and stored in the repository, and
5) Delete the local directory to avoid any confusion with older versions.

Any jobs not completed in your office can be easily retrieved from anywhere in the world. If the previous directory is not deleted, then the 'update' option can be used to partially overwrite and/or add files to the local directory by retrieving the most updated files from the repository.

Thursday, August 23, 2007

subequation numbering in LaTex

\begin{subequations}\label{E0116}
\begin{eqnarray}
u &\simeq& \gamma_0 y \\
v &\simeq& v_w\left(x\right)
\end{eqnarray}
\end{subequations}

Wednesday, August 22, 2007

/newcommand

\documentclass[letterpaper]{article}

\newcommand{\tcol}[1]{\textcolor{blue}{#1}}

\begin{document}

A \tcol{command} usually begins with a backslash.

\end{document}

==================
General Usage
==================

\newcommand{cmd}[args]{definition}
\newcommand{cmd}[args][default]{definition}
\renewcommand{cmd}[args]{definition}
\renewcommand{cmd}[args][default]{definition}


These commands define (or redefine) a command.

cmd
A command name beginning with a \. For \newcommand it must not be already defined and must not begin with \end; for \renewcommand it must already be defined.
args
An integer from 1 to 9 denoting the number of arguments of the command being defined. The default is for the command to have no arguments.
def
If this optional parameter is present, it means that the command's first argument is optional. The default value of the optional argument is def.
definition
The text to be substituted for every occurrence of cmd; a parameter of the form #n in cmd is replaced by the text of the nth argument when this substitution takes place.

Wednesday, August 15, 2007

Ubuntu CJK Chinese Japanese Korean Input Guide

source http://www.mrbass.org/linux/ubuntu/scim/

sudo apt-get install uim anthy scim-gtk2-immodule scim-uim scim-chinese scim-hangul scim-tables-zh scim-tables-ja scim-tables-ko

sudo touch /etc/X11/Xsession.d/74custom-scim_startup

sudo chmod 646 /etc/X11/Xsession.d/74custom-scim_startup

echo 'export XMODIFIERS="@im=SCIM"' >> /etc/X11/Xsession.d/74custom-scim_startup

echo 'export GTK_IM_MODULE="scim"' >> /etc/X11/Xsession.d/74custom-scim_startup

echo 'export XIM_PROGRAM="scim -d"' >> /etc/X11/Xsession.d/74custom-scim_startup

echo 'export QT_IM_MODULE="scim"' >> /etc/X11/Xsession.d/74custom-scim_startup

sudo chmod 644 /etc/X11/Xsession.d/74custom-scim_startup


sudo touch ~/.kde/Autostart/startscim

echo "#!/bin/sh" >> ~/.kde/Autostart/startscim

echo "scim -d" >> ~/.kde/Autostart/startscim

sudo chmod 745 ~/.kde/Autostart/startscim




Press CTRL-SPACE to bring up SCIM input methods.


Thursday, August 9, 2007

Projector configuration with Ubuntu

I had a trouble with Ubuntu in terms of using a projector due to resolution. Modifying xorg.conf might be a little dangerous. The following command led me to configure a projector using the 1024x768 mode.


sudo dpkg-reconfigure -phigh xserver-xorg

Tuesday, August 7, 2007

pdftk tools

Merge Two or More PDFs into a New Document
pdftk 1.pdf 2.pdf 3.pdf cat output 123.pdf

or (Using Handles):
pdftk A=1.pdf B=2.pdf cat A B output 12.pdf

or (Using Wildcards):
pdftk *.pdf cat output combined.pdf

Split Select Pages from Multiple PDFs into a New Document
pdftk A=one.pdf B=two.pdf cat A1-7 B1-5 A8 output combined.pdf

Encrypt a PDF using 128-Bit Strength (the Default) and Withhold All Permissions (the Default)
pdftk mydoc.pdf output mydoc.128.pdf owner_pw foopass

Same as Above, Except a Password is Required to Open the PDF
pdftk mydoc.pdf output mydoc.128.pdf owner_pw foo user_pw baz

Same as Above, Except Printing is Allowed (after the PDF is Open)
pdftk mydoc.pdf output mydoc.128.pdf owner_pw foo user_pw baz allow printing

Decrypt a PDF
pdftk secured.pdf input_pw foopass output unsecured.pdf

Join Two Files, One of Which is Encrypted (the Output is Not Encrypted)
pdftk A=secured.pdf mydoc.pdf input_pw A=foopass cat output combined.pdf

Uncompress PDF Page Streams for Editing the PDF Code in a Text Editor
pdftk mydoc.pdf output mydoc.clear.pdf uncompress

Repair a PDF's Corrupted XREF Table and Stream Lengths (If Possible)
pdftk broken.pdf output fixed.pdf

Burst a Single PDF Document into Single Pages and Report its Data to doc_data.txt
pdftk mydoc.pdf burst

Report on PDF Document Metadata, Bookmarks and Page Labels
pdftk mydoc.pdf dump_data output report.txt

Labels