object oriented programming

Class Definition Related


div.entry h2.title, div.entry h1.title
{ padding-bottom: 22px; background-color: #4e9258 ; font-family: serif; font-size:150%;}

Object-oriented programming (OOP) is a programming paradigm
that uses "objects" – data structures consisting of data fields and
methods together with their interactions – to design applications
and computer programs

Reference/Source: http://en.wikipedia.org/wiki/Object-oriented_programming


Code Exposition


p.first{ color: blue; }
p.second{ color: red; }
<html>
<body>
<p>This is a normal paragraph.</p>

<p class="first">This is a paragraph that uses the p.first CSS code ! </p>
<p class="second">This is a paragraph that uses the p.second CSS code!</p>
...

Reference/Source:
http://www.tizag.com/cssT/class.php

Related Research

Actually, every OOP language should be concurrent in nature.
As previously stated, OOP attempts to model objects found in
the real world, and in the real world many of these objects con-
currently exist and communicate with one another. In the 'ideal'
environment (sort of a virtual machine), every object would have
its own processor as well as its own memory space, allowing
maximum concurrency at all times. Inherently concurrent obje-
cts could even have multiple processors assigned to them.

CONCURRENCY IN CONVENTIONAL OOP LANGUAGES
C-Based Languages. C++ [Str86, WP88] and Objective-C
[Cox86] do not include any constructs for handling concur-
rency. However, since they are extensions of C [KR78], they
can do anything that C can do. Although C itself does not
support concurrency, any extension to C could most likely
be implemented in a C-based OOP language. Additionally,
any scheme in which C is allowed to make a call to the
operating system to start (spawn) a new process could also
be accomplished from a C-based OOP language. Eiffel
[Mey88] does not include any form of concurrency, but they
are reportedly making an effort in this direction.

Lisp-Based Languages. Similar to C-based languages, CLOS
[BDG88, Kee89, Moo89] (an extension of Common Lisp
[Ste84]), does not include any  constructs for handling concurrency
and, unfortunately, Common Lisp does not support concurrency
in any form either. However, as Lisp is a form of functional
programming (which is based on the lambda calculus), some
form of concurrency is possible. In pure functional programming,
a program may be expressed as a single function call, with the
arguments to the function themselves being function calls; the
arguments to these functions can in turn be function calls, etc.
Since the value returned by a pure function is determined solely
by the arguments passed to it, implementations can be devised
which allow for all of the arguments

which are function calls to be executed in parallel. The arguments
of these function calls which are themselves functions can then be
executed in parallel, and so on. This is sometimes referred to as
divide and conquer in that a program is divided up into concurrent
subprograms (the arguments which are function  calls) which can
then be conquered (solved) by again using the divide and conquer
 scheme [Pey87].

Reference/Source:
CONCURRENCY & OBJECT-ORIENTED PROGRAMMING
Michael L. Nelson, Major, USAF
Department of Computer Science
Naval Postgraduate School
Monterey, CA 93943

gcc limits and -Wformat



#include <stdio.h>
#include <limits.h>
int main (void)
{
unsigned long ul = LONG_MAX;
short int si = SHRT_MIN;
printf ("%d\n", ul);
printf ("%s\n", si);
return 0;
}


$gcc printme.c
$./a.out
-1
Segmentation fault
$gcc printme.c -Wformat
printme.c: In function ‘main’:
printme.c:7: warning: format ‘%d’ expects type ‘int’, but argument 2 has type ‘long unsigned int’
printme.c:8: warning: format ‘%s’ expects type ‘char *’, but argument 2 has type ‘int’
$

The <limits.h> header shall define various symbolic names.
The names represent various limits on resources that the
implementation imposes on applications.

about "-Wformat"
Check calls to printf and scanf, etc., to make sure that the
arguments supplied have types appropriate to the format
string specified, and that the conversions specified in the
format string make sense
 
Reference/Source:
The Definitive Guide to GCC Second Edition
William von Hagen
http://www.opengroup.org/onlinepubs/009695399/basedefs/limits.h.html
http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html

gcc options.



$gcc hello.c -o hello
$du -h hello
8.0K hello
$gcc -pg hello.c -o hello
$du -h hello
8.0K hello
$ls -l hello
-rwxr-xr-x 1 7417 Nov 2 05:46 hello
$rm hello
$gcc hello.c -o hello
$ls -l hello
-rwxr-xr-x 1 6593 Nov 2 05:47 hello
$
some content supressed.

The gcc compiler accepts both single-letter options, such as
-o, and multiletter options, such as -ansi. Because it accepts both
types of options you cannot group multiple single-letter options
together as you may be used to doing in many GNU and Unix
/Linux programs. For example, the multiletter option -pg is not
the same as the two single-letter options -p -g. The -pg option
creates extra code in the final binary that outputs profile information
for the GNU code profiler, gprof. On the other hand, the -p -g options
generate extra code in the resulting binary that produces profiling
information for use by the prof code profiler (-p) and causes gcc to
generate debugging information using the operating system’s normal
format (-g).


Reference/Source:
The Definitive Guide to GCC Second Edition
William von Hagen

Languages

There are three types of languages:
1. Imperative.
2. Functional.
3. Logical.

In computer science, imperative programming is a programming
paradigm that describes computation in terms of statements that
change a program state. In much the same way that imperative
mood in natural languages expresses commands to take action,
imperative programs define sequences of commands for the
computer to perform.

In computer science, functional programming is a programming
paradigm that treats computation as the evaluation of mathematical
functions and avoids state and mutable data. It emphasizes the
application of functions, in contrast to the imperative programming
style, which emphasizes changes in state.[1] Functional programming
has its roots in lambda calculus, a formal system developed in the
1930s to investigate function definition, function application, and
recursion. Many functional programming languages can be viewed as
elaborations on the lambda calculus.[1]

Logic programming languages, of which PROLOG (programming
in logic) is the best known, state a program as a set of logical
relations (e.g., a grandparent is the parent of a parent of someone).
Such languages are similar to the SQL database language. A
program is executed by an “inference engine” that answers a query
by searching these relations systematically to make inferences
that will answer a query. PROLOG has been used extensively in
natural language processing and other AI programs.


Reference/Source:
http://en.wikipedia.org/wiki/Imperative_programming
http://en.wikipedia.org/wiki/Functional_programming
http://www.britannica.com/EBchecked/topic/130670/computer-programming-language/248126/Declarative-languages?anchor=ref849840

find command part 1



$cat 1
$
$cat 2
$
$find
.
./2
./1
$find .
.
./2
./1
$ls
1 2
$find . -print
.
./2
./1
$find -print
.
./2
./1
$find -name 1
./1
$

The find command is used to locate files on a Unix
or Linux system. find will search any set of director-
ies you specify for files that match the supplied se-
arch criteria. You can search for files by name, owner,
group, type, permissions, date, and other criteria.
The search is recursive in that it will search all subd-
irectories too.
The syntax looks like this:
find where-to-look criteria what-to-do
explanation for -print switch follows…
-print True; print the full file name on the standard
output, followed by a newline.
Refernece/Source :
http://content.hccfl.edu/pollock/unix/findcmd.htm
Debian manual for find command.

Package: findutils
Homepage: http://savannah.gnu.org/projects/findutils/
Maintainer: Andreas Metzler <ametzler@debian.org>

Yauap . simple audio player



$yauap physics.mp3/Joy\ of\ science/Joy\ of\ Science.18.The\ Bohr\ Atom.mp3
yauap 0.2.4 (C) 2006-2008 Sascha Sommer
loading url file:///home/jeffrin/Music/physics.mp3/Joy of science/Joy of Science.18.The Bohr Atom.mp3
Cannot connect to server socket err = No such file or directory
Cannot connect to server socket
jack server is not running or cannot be started
title=The Bohr Atom
artist=Audio Books
album=The Joy Of Science
track-number=18
genre=Speech
container-format=ID3 tag
samplerate=22050
channels=1
length=1802475
title=The Bohr Atom
artist=Audio Books
album=The Joy Of Science
track-number=18
genre=Speech
container-format=ID3 tag
audio-codec=MPEG 2 Audio, Layer 3 (MP3)
samplerate=22050
channels=1
length=1802475
title=The Bohr Atom
artist=Audio Books
album=The Joy Of Science
track-number=18
genre=Speech
container-format=ID3 tag
audio-codec=MPEG 2 Audio, Layer 3 (MP3)
bitrate=32000
channel-mode=mono
samplerate=22050
channels=1
length=1802475
title=The Bohr Atom
artist=Audio Books
album=The Joy Of Science
track-number=18
genre=Speech
container-format=ID3 tag
audio-codec=MPEG 2 Audio, Layer 3 (MP3)
bitrate=32000
channel-mode=mono
layer=3
mode=mono
emphasis=none
samplerate=22050
channels=1
length=1802475
Time: 0:00:06.779 / 0:30:02.475

$

Yauap is a simple commandline audio player based
on the GStreamer multimedia framework. It also ex-
poses a DBus interface which allows other applicatio-
ns to use Yauap as a playback backend for audio files
and streams.
Reference/Source:
Debian documentation.

media gateway control protocol

Network Internals


switch (mi->mgcp_type) {

case MGCP_REQUEST:
if(mi->is_duplicate){
/* Duplicate is ignored */
ms->req_dup_num++;
}
else {
ms->open_req_num++;
}
break;

Actions to be taken for MGCP commands.
If “mi->is_duplicate” is a non-zero value,
then the packet is ignored, otherwise a ty-
pical value is incremented to count of a
newer request.
Above Explanation May Not Be Accurate.
GNU Free Documentation License.
The Media Gateway Control Protocol is an
architecture for controlling media gateways
on Internet Protocol (IP) networks and the p-
ublic switched telephone network (PSTN).
A Media gateway is a translation device or
service that converts digital media streams
between disparate telecommunications net-
works such as PSTN, SS7, Next Generation
Networks (2G, 2.5G and 3G radio access ne-
tworks) or PBX.
Reference/Source :
http://en.wikipedia.org/wiki/Media_Gateway_Control_Protocol
http://en.wikipedia.org/wiki/Media_gateway

www.ivarch.com/programs/pv.shtml


if (opts->argc size = sb.st_size;
return;
}
stat, fstat, lstat - get file status
stat() stats the file pointed to by path and fills in buf.
fstat() is identical to stat(), except that the file to be
stat-ed is specified by the file descriptor fd.
Reference/Source :
Linux Programmer's Manual.

pv (Pipe Viewer) can be inserted into any normal
pipeline between two processes to give a visual
indication of how quickly data is passing through,
how long it has taken, how near to completion it
is, and an estimate of how long it will be until
completion.
Reference/Source:
Debian APT

kern.log part 1



$cut -d ' ' -f6-20 /var/log/kern.log
[22293.016178] kjournald starting. Commit interval 5 seconds
[22293.016218] EXT3-fs warning: maximal mount count reached, running e2fsck is recommended
[22293.016635] EXT3 FS on sdb2, internal journal
[22293.016647] EXT3-fs: mounted filesystem with ordered data mode.
$

The First field shown above is a timestamp.
The kernel ring buffer is not really a log file per se,
but rather an area in the running kernel you can
query for kernel bootup messages via the dmesg utility

Reference/Source :
https://help.ubuntu.com/community/LinuxLogFiles

Related Reading :
http://www.linuxjournal.com/article/6060