Showing posts with label 2012. Show all posts
Showing posts with label 2012. Show all posts

2012-02-29

Away From The Usual Word-Processor

If you ask someone to write an article or a report, chances are a word-processor (OpenOffice, Word, etc.) will be used. Of course they offer the WYSIWYG convenience of instant gratification. But there's a pitfall: formatting. This may not be a problem (especially for power-users) but for some, it's a nightmare to have to spend a lot of time tweaking it! I think this problem is common in academic institutions—people just differ in their preferences.

Mark-up language developers (e.g. HTML) have noticed this and separated the data and the formatting. Thus, CSS was invented (latest version is CSS3) just to take care of the formatting. A web writer just takes care of the content. Well, another typesetting mark-up language is LaTeX—all you need to do is write and the formatting becomes automatic. Admittedly, LaTeX beginners need to read a lot initially, but this pays-off later when all you worry about is the content.

Lifting from its website: “LaTeX ('X' pronounced as 'K') is a high-quality typesetting system; it includes features designed for the production of technical and scientific documentation. LaTeX is the de facto standard for the communication and publication of scientific documents.” The program can output many kinds of files, but what I use is PDF (readily viewed with many Document/PDF viewers, including Adobe® Reader).

There are many LaTeX documentations on-line and several tutorials are available. I made a TEX file (text file with a .tex at the end) below that incorporates a mini-tutorial. One can use this file because the notes are commented out (preceded by a '%' symbol). Download template.tex file...
% template.tex - LaTeX template source file
% Mini-tutorial incorporated as comments
%   uncomment, comment-out or modify as necessary
%   (my LaTeX program accepts all these commands; check your
%    LaTeX syntax & documentation if error messages appear.)
%
\documentclass[14pt, letterpaper, english]{extarticle}
% \documentclass[12pt, letterpaper, english]{article}
%   {article} only allows 10 (default), 11 and 12pt sizes
%   {extarticle} is used for larger fonts sizes
% alt classes: {book, letter, report, thesis ...}
% alt option: [twoside] = for 2-sided document (odd, even numbered page)
%
% Some packages here are default in Texmaker
%   (http://www.xm1math.net/texmaker/)
% In my computer (Ubuntu), installing texmaker automatically installs
% other required packages.  However, some computers need to have perl
% (http://strawberryperl.com/ for Windows) and TeX Live
% (http://www.tug.org/texlive/acquire-netinstall.html) installed.
%
\usepackage[utf8x]{inputenc}    % encoding
\usepackage{times}
\usepackage[letterpaper, top=2cm, bottom=2cm, left=2cm, right=2cm]{geometry}
%   comment-out to use the default page geometry/layout
%   alt option: [landscape]; [portrait] is default
\usepackage{mathptmx}     % scalable fonts (similar to {times}) in MATH mode
\usepackage{ucs}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{babel}              % formatting
\usepackage{graphicx}           % importing EPS graphics
\usepackage{ulem}               % use underline in text
% \usepackage{lscape}           % allow selective {landscape} environment
% \usepackage{multicol}         % uncomment if {multicolumn} command issued
% \usepackage{multirow}         % uncomment if {multirow} command issued
% \usepackage{fancyhdr}         % customize headers/footers
%   \pagestyle{fancy}           % used with {fancyhdr}
% \usepackage{setspace}         % change line spacing
% \usepackage{alltt}            % to use {verbatim} with commands enabled
% \usepackage{moreverb}         % uncomment if {listing} env is used
% \usepackage{wrapfig}          % wrap figures; caution: not a float
% \usepackage{natbib}           % alt bibliography package
%   \bibpunct{[}{]}{;}{s}{,}{,} % ancillary to {natbib}; alt to {s}: {n}, {a}
%
\usepackage[pdftex]{hyperref}   % allow hypertext
  \hypersetup{
    pdfauthor={NAME},
    pdftitle={PDF \LaTeX{}},
    colorlinks,
    pdfpagelayout={OneColumn}}
%     add {backref} if with bibliography backlinks
%
%
% \DeclareMathSizes{ds}{ts}{ss}{sss} % change font sizes in Math mode
%   {ds} must be the same size as the document font
%
\title{TITLE}
\author{NAME \\                   % \\ = newline character
\texttt{EMAIL}}                   % additional AUTHOR data
\date{\today}                     % insert DATE today
%
%
\begin{document}
\normalem                         % \emph{} = italicized, not underlined
%
% \maketitle                      % place TITLE data on document
% \thispagestyle{empty}           % suppress paging for this page only
% \tableofcontents                % insert TOC
%   \setcounter{tocdepth}{depth}  % set depth (default: 3)
% \listoffigures                  % insert list of figures
% \listoftables                   % insert list of tables
%
% DIVISIONS
%
% \division{header}               % syntax
% \division*{header}              %   div numbers omitted
%
% Divisions:
%   section, subsection, subsubsection  % class article, extarticle
%   Others:                             % other classes
%     part, chapter                     %   higher levels
%     paragraph, subparagraph           %   lower levels
%
% To include unnumbered entries in TOC (not included by default):
% \division*{header}                    % syntax; lines bunched together
% \addcontentsline{type}{section_level}{entry} % to reinstate a line in TOC
% \phantomsection                       % used to build links in TOC
%   Example:
%   \section*{Preface}                       % unnumbered section
%   \addcontentsline{toc}{section}{Preface}  % place at appropriate location
%     of section/figure/table in document in order for it
%     to be extracted in the correct order in the TOC.
%   \phantomsection
%
% ENVIRONMENTS
%
% \begin{ENVIRONMENT}                         % syntax
%   ...                                       % content
% \end{ENVIRONMENT}
%
% Environments:
%   abstract                                  % insert Document Abstract
%   flushleft, flushright, center             % Justification
%   singlespace, onehalfspace, doublespace    % Line spacing
%   landscape                                 % Page Orientation
%   quote (short quotes), quotation (longer quotes/more indent)
%   verse (poetry)                            % \\ to break a line
%   verbatim, alltt (verbatim + enabled commands)
%   listing (+ line numbers in verbatim; eg: \begin{listing}[step]{1st line})
%
% LIST STRUCTURES
%
% List environments      % can be nested up to depth = 4
% \begin{itemize}        % bulleted; \begin{enumerate} for ordered list
%   \item item 1
%   \item item 2
% \end{itemize}          % or \end{enumerate}
% \begin{description}    % similar to glossary
%   \item[entry] item 1
%   \item[entry] item 2
% \end{description}
%
% TABLE
%
% Table environments/commands:
%   \multicolumn{spanned columns}{format}{cell contents}  % syntax;
%              % used in merging columns
%              % if associated with {figure}, use {figure*} to span columns.
%   \multirow{spanned rows}{*}{cell contents}             % syntax
%              % used in merging rows
%   \setlength{\columnseprule}{1pt}  % place before environment
%              % to have a line width of 1pt, e.g. (default = 0pt)
%   \setlength{\columnsep}{20pt}     % place before environment
%              % to change default separation of 10pt to 20pt, e.g.
% Example:
% \begin{table}[htp]  % table = float; [htp] = where LaTeX will place table:
%                     % h = here, t = page top, b = page bottom
%   \begin{center}    % center justified
%     \caption{table-title}                    % Title of table
%     \label{table-label}                      % anchor/label
%     \begin{tabular}{| l | c | p{5cm} |}      % lcr = cell justification;
%          % | = vertical line visible; p{5cm} = width is 5 cm in this column
%       \hline                  % horizontal line visible; & = cell-separator
%       contents & contents & more content \\  % \\ = newline
%       \hline
%       \multirow{2}{*}{contents} & \multicolumn{2}{|c|}{more content} \\
%          % \hline omitted to avoid overlap due to the multicolumns/rows
%       & content & This is a wrapping sentence. \\
%       \hline
%     \end{tabular}                            % 3x3 table
%   \end{center}
% \end{table}
%
% FIGURE/GRAPHICS
%
% Example:
% \begin{figure}[htp]  % figure = float; h = here, t = top, b = bottom of page
%   \begin{center}                  % center justified
%     \includegraphics{image}       % image: EPS for latex command
%                                   % JPG, PNG, PDF for pdflatex command
%   \end{center}
%   \caption{caption text}          % optional caption
%   \label{image-label}             % optional anchor/label
%                      % use of label: text can reference it like so...
%                      % ... See figure~\ref{image-label} for reference...
%                      % alt: \pageref{}  % reference page (not figure)
% \end{figure}
%
% Wrap text around a figure:        % caution: not considered as float
% \begin{wrapfigure}{r}{40mm}       % {wrapfigure} replaces {figure}
%   ...                             % can run over a page break
% \end{wrapfigure}                  % check final document because of above
%
% FORMAT
%
% \emph{emphasis/italic}  \textbf{bold}           \texttt{teletype}
% \textsc{small caps}     \textsf{sans serif}     \textrm{serif}
% \uline{underline}       \uwave{wavy underline}  \sout{strike-out}
%
% - (hyphen)              -- (en-dash)             --- (em-dash)
% `single quotes'         ``double quotes'' or "  \\ (newline)
% \& (&)                  \% (%)                  \$ ($)
% \# (#)                  \{ \} ({})              \_ (_)
% ~ (nbsp)                \ldots (ellipsis)       \textbar (|)
% \textbackslash (\)      \textless (<)           \textgreater (>)
% \textregistered         \copyright              \pounds
% \LaTeX{}                \dag (dagger)           \`{a}
% \"{o}                   \^{o}                   \r{A}
% \'{e}                   \~{n}                   \.{o}
% \c{c}
%
% White space:
% \quad = font size       \qquad = double quad    % horizontal space
% \, = small space (1/6 quad)
% \: = medium space (2/9 quad)
% \; = large space (5/18 quad)
% \! = negative space (-1/6)
% \vspace{width}                         % vertical space
% Example:
% \vspace{\baselineskip}                 % vertical space between paragraphs
%
% Size:                                  % should be used rarely
% \tiny                   \scriptsize             \footnotesize
% \small                  \normalsize             \large
% \Large                  \LARGE                  \huge
% \Huge
%   % in case where size format continues, insert \normalsize
%   % so that succeeding text is back to default
%
% Other formatting commands:
% \newline              % or \\; breaks line
% \linebreak[number]    % breaks line + stretch line to the margin;
%                       % [number]: 0-4, with 4 as most insistent
%                       % seems LaTeX has final say
% \newpage              % ends current page
% \pagebreak[number]    % breaks current page
% \nopagebreak[number]  % stops automatic page break
% \clearpage            % ends page + pending floats will be printed
%
% NOTES
%
% \footnote{footnote text}   % insert footnote
% \thanks{title-footnote}    % insert footnote within \title
% \marginpar{marginal text}  % few characters (may overflow)
% \cite{name01}              % insert to mark bibliography reference, e.g.
%                            % alt: \citep, \citet, \citep*, \citet*
%
% CUSTOMIZE
%
% Headers/Footers:
%
% \fancyhead{}            \fancyfoot{}            % insert at the beginning
% \lhead[even page]{odd page} \lfoot[even page]{odd page}
% \chead[even page]{odd page} \cfoot[even page]{odd page}
% \rhead[even page]{odd page} \rfoot[even page]{odd page}
%                                   % put header/footer data within [] and {}
% Input data examples:
% \today = date today           \thepage = page number
% Example:
% \cfoot[\thepage]{\thepage}        % put page number in all pages (default)
%
% Redefining Counter styles:
%
% \renewcommand{\thefootnote}{\alph{footnote}}
%                              % redefine default \footnote to use lower case
% \renewcommand{\theenumi}{\Roman{enumi}}    % redefine enumerate 1st level
% \renewcommand{\labelenumi}{\theenumi}
% \renewcommand{\theenumii}{\Alph{enumii}}   % redefine the 2nd level
% \renewcommand{\labelenumii}{\theenumii}
% \renewcommand{\labelitemi}{symbol to use}  % redefine itemized labels
%                                        % alt: arabic, alph, roman, fnsymbol
%
% HYPERTEXT
%
% Hyperref:
% \href{URL}{linked text}                % similar to HREF in HTML
% \url{URL}                              % url is shown/linked
% \nolinkurl{URL}                        % url is shown and NOT linked
% \hyperbaseurl{URL}                     % set base url
% \hyperlink{id}{link to target text}    % link within document
% \hyperref[label]{linked text}          % similar to \hyperlink, \ref{label}
% \hyperimage{image-URL}{linked text}    % link to image-url
% \hypertarget{id}{anchor/target text}   % target text
%
% MATHEMATICS
%
% \begin{math}...\end{math}                 \(...\)   $...$    % text type
% \begin{displaymath}...\end{displaymath}   \[...\]   $$...$$  % displayed type
% \begin{equation}...\end{equation}      % alt to {displaymath}
%                                        % equation numbers printed
%
% Commands:
% \times                  \div                    \frac{}{}
% ^{} = power             _{} = index             \sqrt[]{}
% \left(...\right)              % scalable parentheses; (...) = non-scalable
% \mbox{}                       % put text in equations
%
% alt to \mbox{} (can be wrapped around equation):
% \mathrm{}               \mathit{}               \mathbf{}
% \mathsf{}               \mathtt{}               \mathcal{}  % (calligraphy)
%
% Predefined math text sizes:               % sizes decrease
% \displaystyle           \textstyle              \scriptstyle
% \scriptscriptstyle
% Example:
%   \frac{1}{\scriptstyle a_1...}           % denominator is smaller
%
% Matrix:
% $$ \left[                                 % scalable [
%   \begin{array}{ c c }                    % 2x2 matrix
%      1 & 2 \\                             % similar to {tabular} environment
%      3 & 4
%   \end{array} \right]                     % scalable ]
% $$
%
% Equation arrays:         % use for multi-line equations + equation numbers
% \begin{eqnarray}         % use {eqnarray*} to disable equation numbers
%   left expression & = & right expression 1 \\
%   & = & right expression 2 \nonumber \\   % \nonumber = no equation number
%   & = & right expression 3
% \end{eqnarray}
%
% BIBLIOGRAPHY
%
% \bibliographystyle{plain}                 % default linked bibliography
%   \bibliographystyle{plainnat}            % uncomment if {natbib} is used
%   latex makebst: command to make own bibliography style
% \bibliography{/PATH/to/the/bibliography/folder}
%
% Example of linked bibliography:  % placed in a BIB file in bibliography PATH
% @book{name01,                             % used in \cite{}
%   author    = "Surname, First Name",      % author
%   title     = "{T}itle",     % title; {T} = capitalized character (optional)
%   edition   = "Edition",                  % edition
%   year      = "2012",                     % year published
%   publisher = "Publisher Data",           % publisher
%   address   = "Address of Publisher"      % publisher address
% }                   % add other entries as necessary using the same pattern
%                     % entries should be separated by blank lines
%
% Example of embedded bibliography:
% \begin{thebibliography}{9}                % embedded in TEX file
%                                           % 9 = maximum number; alt: 99, 999
%   \bibitem{name01}                        % used in \cite{}
%   NAME,                                   % author
%   \emph{TITLE}.                           % title
%   Publisher Data,                         % publisher
%   Nth Edition,                            % edition
%   2012.                                   % year published
% \end{thebibliography}
%
% NOTES
%
% Save TEX files in own folders/directories, with referenced files.
% Running pdflatex in console:
%   $ cd /directory/where/TEX/file/resides
%   $ pdflatex file           # file.tex (.tex is dropped)
%           # that's enough for simple files
%           # large files with many references may require at least 2 passes
%           # check the text output if more passes are required
%           # files with bibliographies may require an additional command:
%   $ bibtex file             # usually issued second
%                             # bibliography file (file.bib) must be present
%                             # at '/PATH/to/the/bibliography/folder'
%   $ pdflatex file           # repeat command as necessary (maybe up to 2x)
%   A file.pdf will be generated in the directory
%
% If you prefer running latex in console:
% replace 'pdflatex' with 'latex', but a file.dvi is generated.
% To make a PDF file, issue the command:
%   $ dvipdf file.dvi file.pdf
%   A file.pdf will be generated in the directory
%
% For LaTeX developers: why not issue only ONE command,
%   and let the program do all these other repeated commands?
%
% Check: http://www.latex-project.org/, Google, etc. for more information.
%
% Start typing and let LaTeX do the formatting!
%%============================================================================%%

\LaTeX{} DOCUMENT

\end{document}
LaTeX is a good addition to the writer's arsenal. Let the writer write!

2012-02-18

Installing Ubuntu Via Internet

Installing or adding an operating system on a computer is very easy, as long as you have a working CD/DVD drive or bootable USB device, and the OS (in a CD/DVD or USB stick). What if you have a broken CD drive, non-bootable USB device, or perhaps a very old computer? One alternative is to install the OS (Ubuntu in this case) via the Internet. This is easy as long as the two computers (working PC = PC1, and the computer for installation = PC2) are in the same subnetwork (subnet). In this article, PC1 is a working desktop PC (dual boot with Windows XP and Ubuntu), while PC2 is a vintage Compaq Presario M2000 laptop with a problematic XP installation (pesky Windows behavior).

Ubuntu 11.10 desktop
In Ubuntu (or a similar Debian distribution), one can read its Netboot install page. On my part, I used the Windows version because many use it, and I have a Windows partition anyway just to put it into good use. This article is based from a work in Liberiangeek.net which came out after googling the topic. Because it was based on Ubuntu 10.04, I modified some things for this purpose. So someone who reads this material in the future must modify it because Ubuntu is a dynamic project—2 upgrades per year.

One indication that the 2 PCs are in the same subnet is that the Internet cable (connected to WiFi) is forked and wired in the router (although I guess the wireless devices are likewise in the same subnet). It's hard to explain here but one may go to the Subnetwork topic in Wikipedia to learn about subnets, and also to determine if the 2 computers you're using are in the same subnet.

Procedure


Create an Install folder (or any name you prefer) in the root directory, or at C:\. You should now have a folder C:\Install\. Download tftpd32 standard edition (installer) from tftpd32.jounin.net, and install it. In the installation options, choose Installation and Start as the type of install, and check all the checkboxes. Choose C:\Install\ as the installation directory before clicking Install.

Tftpd32 contents
Install contents
To fetch the needed files, it's convenient to use an FTP program and input archive.ubuntu.com as host. For me, I just went directly to the appropriate folder and downloaded the files to C:\Install\. When I did this installation, Oneiric was the latest stable release, so I entered /ubuntu/dists/oneiric/ main/installer-i386/ 20101020ubuntu72/images/ netboot/. This url will be obviously different in the future (even by a few days ahead). The article I was referencing mentioned that I only download pxelinux.0, pxelinux.cfg\ and ubuntu-installer\, but I downloaded all files and folders there.

Open C:\Install\Tftpd32\ and copy tftpd32.exe into C:\Install\. See image for the contents of the two folders (pxelinux.cfg\, Tftpd32\, ubuntu-installer\, pxelinux.0, and tftpd32.exe are required in C:\Install\).

Tftpd32
DHCP Settings
If it's not running, open C:\Install\tftpd32.exe. Click the Settings button below and select the DHCP tab. Configure the network settings (see figure). I noticed that the server interfaces are automatically set so they vary in different PCs. The tricky part here is that you input the appropriate numbers based on the Server interfaces. Determine which fields you increment and which you preserve. Then click OK.

The moment of truth: power on PC2 and don't forget to tap F10 before booting the system. This enters the PhoenixBIOS Setup Utility in my machine. In the Advanced menu, enter Boot-order and modify it to put Network Adaptor on top. Then input F10 to save and exit the setup. It will then boot via the network PXE. Follow the boot instructions, and in a few hours you'll have a working Ubuntu system. When the time comes for you to reboot the new OS, enter the BIOS utility again just to put things in order, meaning the boot from hard disk option must be on top. Save the settings and boot from the hard disk.

Because it's a fresh install, do the initial housekeeping so as to enjoy Ubuntu's full potential.

“One of the sayings in our country is Ubuntu — the essence of being human. Ubuntu speaks particularly about the fact that you can't exist as a human being in isolation. It speaks about our interconnectedness. You can't be human all by yourself, and when you have this quality — Ubuntu — you are known for your generosity. We think of ourselves far too frequently as just individuals, separated from one another, whereas you are connected and what you do affects the whole World. When you do well, it spreads out; it is for the whole of humanity.” (Archbishop Desmond Tutu)

2012-01-15

“We're Not Threats”

I checked my twitter timeline earlier and GMA News flashed: “Pope: Gay marriage a threat to humanity's future”. And then later a “married” gay couple answers the pope back, saying “We're not threats”.  Obviously the pope was referring to the phenomenon of gay marriage, but the couple was referring to their persons. There is a difference. Don't be misled by others—the Catechism mentions that homosexuals “must be accepted with respect, compassion, and sensitivity. Every sign of unjust discrimination in their regard should be avoided (CCC 2358).”

The Holy Family
In the Reuters report Gay marriage a threat to humanity's future — Pope, Pope Benedict said that gay marriage was one of several threats to the traditional family that undermined the future of humanity itself. While it is true that there are many assaults on the traditional family, a legalized gay marriage turns the institution itself inutile.
“Let marriage be held in honor among all, and let the marriage bed be undefiled; for God will judge the immoral and adulterous (Heb 13.4 RSV).”
For some, the family is just a partnership, and it is devoid of responsibility in rearing children, the natural consequence. To initiate a family, legitimate marriage is the prerequisite. “The family unit is fundamental for the educational process and for the development both of individuals and states; hence there is a need for policies which promote the family and aid social cohesion and dialogue (Reuters).”
“The fruitfulness of conjugal love extends to the fruits of the moral, spiritual, and supernatural life that parents hand on to their children by education. Parents are the principal and first educators of their children. In this sense the fundamental task of marriage and family is to be at the service of life (CCC 1653).”
The Pope is the prophet of our time, and unfortunately, no prophet is welcome in his time. He's not there to make life miserable, but to make it better if only everyone heeds.
“Do you not know that the unjust will not inherit the kingdom of God? Do not be deceived; neither fornicators nor idolaters nor adulterers nor boy prostitutes nor sodomites nor thieves nor the greedy nor drunkards nor slanderers nor robbers will inherit the kingdom of God. That is what some of you used to be; but now you have had yourselves washed, you were sanctified, you were justified in the name of the Lord Jesus Christ and in the Spirit of our God (1 Cor 6.9-11 NABRE).”
Folks, many of us fail, but there is redemption. It's never too late to change...


Reproductive Health Bill

I started to write something about this several months ago, and it was never finished; blame procrastination. Although I guess it's still in the news on occasion, especially when Sen. Defensor-Santiago delivered those pick-up lines, much better than Boy Pick-up™.

The controversial Reproductive Health (RH) bill is labeled as House Bill (HB) No. 4244 (in substitution of HB 96, 101, 513, 1160, 1520 and 3387). It is entitled The Responsible Parenthood, Reproductive Health and Population and Development Act of 2011. Section 1 says "The State recognizes and guarantees the exercise of the universal basic human right to reproductive health by all persons, particularly of parents, couples and women, consistent with their religious convictions, cultural beliefs and the demands of responsible parenthood..."

The way I see it, two issues are at the core of why the Church is against it. While we are the Church, there is a thing called the Magisterium—its teaching authority. The reader has to know that many groups who call themselves Christian teach that artificial contraception is okay. All the "churches" succumbed to the culture of death; only the Catholic Church remains standing. And when the Church teaches, the faithful listen. While the primary target of the pronouncements is the faithful, the message nonetheless is sowed on the entire human race, and it's profitable to heed her call.
  1. The bill incorporates artificial contraception; the Church naturally will oppose it. The church is entirely pro-life, and conception of new life is part of that. If conception gives new life, naturally any means that frustrates it is immoral. I agree, it's a hard doctrine, but it's the doctrine. [Read Humanæ Vitæ]
  2. The bill will use tax-payers' money to pay for the available contraceptives. If the bill passes, those against artificial contraception will, in effect, be buying them. While the church frowns upon the dissemination of contraceptives, it has to accept it because it's private funds that are used, and individuals are free to do things. At least it's not public funds.
“The fear of the LORD is the beginning of knowledge;
fools despise wisdom and instruction.” (Proverbs 1.7 RSV)