cut –help



$cat workethics.txt
Work ethics in QA Fashion

$cut -c1-5 workethics.txt
Work

$cut -c1 workethics.txt
W

$cut -f1 workethics.txt
Work ethics in QA Fashion

$cut -b1 workethics.txt
W

$cut -b2 workethics.txt
o

$cut -b0 workethics.txt
cut: fields and positions are numbered from 1
Try `cut --help' for more information.

cut - remove sections from each line of files
-c, --characters=LIST
-b, --bytes=LIST select only these bytes
select only these characters
$

Reference/Source :
Debian Manual for "cut" command.

Note: http://lowfatlinux.com/linux-columns-cut.html

octal dump.



$cat workethics.txt
Work ethics in QA Fashion$
$od workethics.txt
0000000 067527 065562 062440 064164 061551 020163 067151 050440
0000020 020101 060506 064163 067551 000156
0000031
$od -N 21 workethics.txt
0000000 067527 065562 062440 064164 061551 020163 067151 050440
0000020 020101 060506 000163
0000025
$od -N 22 workethics.txt
0000000 067527 065562 062440 064164 061551 020163 067151 050440
0000020 020101 060506 064163
0000026
$od -N 23 workethics.txt
0000000 067527 065562 062440 064164 061551 020163 067151 050440
0000020 020101 060506 064163 000151
0000027
$od -N 24 workethics.txt
0000000 067527 065562 062440 064164 061551 020163 067151 050440
0000020 020101 060506 064163 067551
0000030
$od -N 25 workethics.txt
0000000 067527 065562 062440 064164 061551 020163 067151 050440
0000020 020101 060506 064163 067551 000156
0000031
$
od - dump files in octal and other formats
-N, --read-bytes=BYTES
limit dump to BYTES input bytes

Write an unambiguous representation, octal bytes
by default, of FILE to standard output. With more
than one FILE argument, concatenate them in the
listed order to form the input. With no FILE, or when
FILE is -,read standard input.

Reference/Source :
Debian manual for command od.

gcov code coverage



$vi hey.c
$gcc -fprofile-arcs -ftest-coverage hey.c
$./a.out
Hey :)
$gcov hey.c
File 'hey.c'
Lines executed:100.00% of 3
hey.c:creating 'hey.c.gcov'

$cat hey.c.gcov
-: 0:Source:hey.c
-: 0:Graph:hey.gcno
-: 0:Data:hey.gcda
-: 0:Runs:1
-: 0:Programs:1
-: 1:#include
1: 2:main()
-: 3:{
1: 4:printf(" Hey :) \n");
1: 5:}
$



The ".gcov" files can be examined using a normal editor. The first
column is the number of times that the line is executed. A decimal
number indicates the number of times that the line of code executes, a
'-' means that it is no code is generated for the line, and "#####"
indicates the generated code was not executed at all. To the right of
the first ':' is line number the remainder of the line is the source
code.

Reference/Source :
http://sourceware.org/ml/systemtap/2006-q1/msg00056.html
http://gcc.gnu.org/onlinedocs/gcc/Invoking-Gcov.html#Invoking-Gcov

detex for tex.

detex – a filter to strip TeX commands from a .tex file.


$cat resume.tex
\documentclass[10pt,a4paper,twocolumn]{article}
\date{}
\usepackage{amsmath}
\setlength\topmargin{0in}
\setlength\headheight{0in}
\setlength\headsep{0in}
\setlength\oddsidemargin{0in}
\setlength\evensidemargin{0in}
\begin{document}
\title {\texttt{R\'{e}sum\'{e}}}
\maketitle
\section*{\texttt{IDEA}}
\texttt{Work for student community} \\

output after detex resume.tex | more


[10pt,a4paper,twocolumn]article

amsmath
0in
0in
0in
0in
0in

Resume

*IDEA
Work for student community
to help acquire knowledge.
*Experiance
*Project Member
GNU Source Installer
www.gnu.org/software/sourceinstall
GNU Source Installer is a source package manager for Unix-likes.
*February 2004 - March 2005
Scientific Assistant.
Division of Computing Sciences.

struct keyword and getopt_long

The  getopt() function parses the command-line arguments.  Its
arguments argc and argv are the argument count and
array as passed to the main() function on program invocation.
An element of argv that starts with  '-'  (and  is not  exactly
"-" or "--") is an option element.  The characters of this
element (aside from the initial '-') are option characters.
If getopt() is called repeatedly, it returns successively each
of the option characters  from each of the option elements.
longopts is a pointer to the first element of an array of struct option
declared in <getopt.h> as

           struct option {
               const char *name;
               int         has_arg;
               int        *flag;
               int         val;
           };

Example Code


static const struct option long_options[] =
{
{"domain", no_argument, 0, 'd'},
{"boot", no_argument, 0, 'b'},
{"file", required_argument, 0, 'F'},
{"fqdn", no_argument, 0, 'f'},
{"all-fqdns", no_argument, 0, 'A'},
{"help", no_argument, 0, 'h'},
{"long", no_argument, 0, 'f'},
{"short", no_argument, 0, 's'},
{"version", no_argument, 0, 'V'},
{"verbose", no_argument, 0, 'v'},
{"alias", no_argument, 0, 'a'},
{"ip-address", no_argument, 0, 'i'},
{"all-ip-addresses", no_argument, 0, 'I'},
{"nis", no_argument, 0, 'y'},
{"yp", no_argument, 0, 'y'},
{0, 0, 0, 0}
};

gtf . generalized timing formula



$gtf 1024 768 75

# 1024x768 @ 75.00 Hz (GTF) hsync: 60.15 kHz; pclk: 81.80 MHz
Modeline "1024x768_75.00" 81.80 1024 1080 1192 1360 768 769 772 802 -HSync +Vsync

$

Generalized Timing Formula is a standard by VESA which defines exact
parameters of the component video signal for analog VGA display
interface.

The parameters defined by the standard include horizontal blanking
(retrace) and vertical blanking intervals, horizontal frequency and
vertical frequency (collectively, pixel clock rate or video signal
bandwidth), and horizontal/vertical sync polarity. These parameters are
used by the XFree86 Modeline, for example. This standard is available from VESA for $350. [1]

The standard was adopted in 1999, and was superseded by the
Coordinated Video Timings specification in 2002.

Reference :
http://en.wikipedia.org/wiki/Generalized_Timing_Formula