Tuesday, September 20, 2005

Punnix Version 1.2.0

--------------------------------------------------------------------
PUNNIX Version 1.2.0, or a song of Linux

-Thomas Jay Cubb
Note: All puns are intended, but may not be indented!
-------------------------------------------------------------------
Trapped behind closed gates, windows
I was looking for a way out
Of the morass of proprietary property.
‘Cos I was buried by the hefty software bills.
I wondered, why should I
be a slave to that GUI ?

Proprietary software and operating systems place restrictions on your use of them. You might have bought it but it's still not yours! You are not free to use it like you would want to or tailor it to your requirements.
GUI, usually pronounced as “gooey”, is to be pronounced as “guy” here for both rhyme and meaning.


And then in an epiphany,
The flightless angel Tux,
(Or perhaps it was a friendly gnome?)
He showed me the way to a universe
Of Enlightenment,
Home of users (e)X-Windows.

GNOME, which stands for GNU Network Object Model Environment, is a desktop environment usually bundled with Linux. A gnome is also a magical being that guards treasure (how true!!).
Epiphany is a web-browser for GNOME.

Tux is the name of the Linux mascot – that cute penguin.
`The X Window System’, commonly referred to as just `X’, is (generally) the graphical environment for Linux.
Enlightenment is a window-manager for X.
The magic-mantra
say perforce
Floss! Open Source!
Lilo! Behold
A free GNU world unfold.
A la Ali Baba
I could not but gawk
At the unhidden treasures
That I now could mount!
How blind I had been
Not to have before these perls seen.

With Open Source software, the source code is open for you to use and modify.
FLOSS (Free/Libre/Open Source Software) is a term that covers both open source and free software. The author urges you to floss your PC!

LILO (LInux Loader), is a boot-loader that loads Linux for you. LILO has pretty much been replaced by GRUB (GRand Unified Boot-loader).
GNU stands for “GNU’s Not Unix”. Such acronyms are called recronyms.
gawk is a pattern-scanning tool.
mounting is how you access resources in Linux. You mount things, use them, and unmount them.
perl (Practical Extraction and Reporting Language) is a powerful scripting language that comes along with Linux.

It was as if
I was Bourne again.
No more rodent-fatigue that lingers
I have discovered use for my fingers!
etc.

bash (Bourne Again SHell) is a command-shell, the command-line prompt of which is where you enter commands. Oh yes, there used to be a Bourne shell too!

/etc is the directory where configuration details are usually stored.
***ROOT ALMIGHTY***

When I’m at the command line
Computer, obey the command mine.
For I am the Mandrake root,
I’ll slash all I want
Or backslash as is wont.
I might be mad as a Red Hatter
But in my kernel is a
A smouldering Caldera
Of raw, unbridled power.

Mandrake, Red Hat and Caldera are distributions of Linux.

root is the name of the super-user (user with administrative privileges) in Linux.
Mandrake-root is a narcotic/hallucinogen supposed to have magical powers. Indeed, Mandrake-root can make you mad as a hatter!
Slash (‘/’) and backslash(‘\’) are important keyboard characters for a command-line user.
The kernel is the heart of the operating system – that pumps life-blood into your PC, so to speak.
A caldera is a large crater at the top of a volcano.

I am Root Almighty,
God of the process-tree.
The world of demons, I am init.
Full control,
no holds barred.

To say that the root or super user is accorded God-status in Linux is by no means an exaggeration. If you are root, then you are all-powerful.

Processes are programs which are being run. Linux organizes the processes as a tree.
daemons are processes that operate in the background and provide services.
init is the very first process that is started when Linux boots. init starts the rest of the processes, including daemons.

I will tweak,
As is my custom,
till they squeak.

I wave the two-pronged fork
Children brought by the fabled stork
Ampersand when I kill
Become orphans or zombies.

Processes have a life of their own. forking is the method by which new processes are created, nay, born.
The new processes are called child-processes of the parent-process (what else!)
According to an old wives’ tale, storks bring children.
You can make any process run in the background by adding an ampersand (‘&’) when calling it. You can kill a process too. What is born must die! Orphans are child-processes whose parents have been killed and zombies are processes that are undead. Creepy?!

*** END OF ROOT ALMIGHTY***

Welcome to the free world!

Where you will no longer be told where to start.
Or commanded to issue the salute three-fingered
Even when it’s the OS that erred.
No longer be treated like minnows
Get to know more than that best Win knows.
No need for that software toss
Head or tail
More or less
I have made my choice.

The three-fingered salute is the dreaded Ctrl-Alt-Del key combination that one is forced to press in order to reboot a PC. Also called the `Vulcan nerve pinch’.

head is a program that shows the beginning of a file while tail shows the ending of a file.
more and less are programs that display a file one screen at a time. They are more or less the same. Except that less has more functionality!!! Yeah, you read that right.

If you have drunk the milk of the GNU
You will crave nothing Moo!

A gnu is also a large African antelope with a head resembling that of an ox.


- Thomas Jay Cubb

------------------------------------------------------------------------------------------------
CHANGE HISTORY

Version 1.2.0
1.Integrated man-pages inside the poem.
2.Added "floss!" line in poem
3.Changed and added some documentation
4.Moved "tweaking" para into "Root Almighty" section
5.Obfuscated proprietary-software bashing.

Version 1.1.0
1.Documentation "Punnix man-pages" added.
2.Line 3, Proprietary `propriety’ changed to Proprietary `property’
3.Line 5, ‘I wondered’ added
4.Line 17, Free ‘new’ world changed to Free ‘GNU’ world.
5.Line 22, how ‘stupid’ changed to how `blind’
6.Line 23, Not to have this before seen changed to ‘Not to have before these perls seen’
7.Line 24, `I’ changed to `It’ Had been a typo.
8.Couple of lines deleted (“I have…the key”)

Version 1.0.0
1.Initial version

------------------------------------------------------------------------------------------------

LICENSE

You may freely distribute copies of this post. But please retain this license message and do not modify the contents of the post. Please feel free to quote this in full or in part, anywhere you will. The author reserves the right to be identified as the creator of this poem and any part of it thereof. You can contribute to the evolution of this work by writing in with comments. Please do so!

-Thomas Jay Cubb,
Author

------------------------------------------------------------------------------------------------

Tuesday, September 06, 2005

C++ Name Origin

Rick Mascitti was the person who coined the term "C++". Before he did so, C++ was called C With Classes by Bjarne Stroustrup.

Some interesting quips can be found at
http://en.wikipedia.org/wiki/List_of_computer_term_etymologies#C and
http://en.wikipedia.org/wiki/C_Plus_Plus#History_of_the_name_.22C.2B.2B.22

I've also heard rumours that Java was called (likely in a lighter vein) "C++ --" !!
:-)

Monday, August 29, 2005

Copy-Paste and x-Handedness

The de facto key-combination for copy-pasting, the programmer's butter-knife, for most people is Ctrl-C (for Copy), Ctrl-V (for Paste). In fact, it is possible that you are conditioned to hear Ctrl-C, Ctrl-V as "Copy, Paste". This is the combination advertised on most Edit menus nowadays (along with Ctrl-X for Cut).

However, coming from a DOS/Unix shell background, I used to find it difficult to press Ctrl-C for Copy because it had negative connotations for me. It used to be (and still is) the keys to press to cancel a running command in a console.

FYI, the same things can be done using
Ctrl-Insert = Copy
Shift-Insert = Paste
Shift-Delete = Cut

I thought this made good sense.
Copy? okay, it's a control insert with no display-change.
Cut? shift into the buffer after deleting it from the display
Paste? Shift out the thing in the buffer and insert it here

Ergonomically, this is in fact better if you do a lot of selecting with the shift-cursor key combinations. You could do everything with your right hand.

So why should it have changed? In this age of GUIs, most people do their selecting with the mouse (with their right hand) and could do the copying/cutting and pasting with their left hand! Personally, I am against selecting stuff with the mouse coz it's more strenuous.

Why Ctrl-C,X,V then? Physical proximity is the only rationale, no logic as in the former case. C for Copy, so get the others nearby.

Or was it because "X" looks like a scissors and you use it to cut! So get the others nearby?

You wish!

Friday, August 26, 2005

Dream Word

This one is from my archives. Written in July 1997, this article is about what I felt (then) would have been cool features to have in a word-processor. Many have since been implemented and are standard features now. Many of the points are still valid though.

O, LORD PC! COULD I WRITE A LETTER ON YOU? . . . PLEASE!

Auto-Scroller tab

User keeps his mouse on the tab and the document keeps scrolling automatically. User can suspend by moving the mouse away or by pressing, say, Ctrl-V. It is very important to have an alternate key. Pressing another key, say PgUp or PgDn while in auto-scroller could bring another function.

Advanced OLE : Drag and select

User should be able to choose objects and text with a special drag. Maybe the concept of a right-button drag should be introduced.

Make-It-Fit!

Selected text or advanced OLE could be made to fit in a specified number of pages or a region created by special dragging.

Fonts

Super-scripting and sub-scripting should be available easily. Say by pressing a special key combination, say, Ctrl-Alt-F

Toolbars

Rather than themewise arrangement, a global toolbar with most universally and commonly used options should also be there. Themewise arrangement should also be there. Switching of toolbars must be simpler. Also, the program should keep a log of menu-items most used by the user and automatically place them on the toolbar.

Typo-Quikorrect!


Interchanging of letters to form words which do not exist can be easily identified. So why not correct it as well? But before correcting, program should go through the proper authorization channels. Flash it on the status bar whereupon the user can press a key to confirm. If the user does not press the key, he must be allowed to continue typing. No alarm-bells ringing! If the program is so particular that its message be heard, keep it in the error-bin, the user at the end of his session may or may not click the error-bin, a dialog box should open with various errors highlighted. User can then edit out unwanted corrections, press a confirmation key and lo, everything set right.

Equation format

All the word-processors can have a common format for scripting the equation. Type the numbers with codes, like, say, `^= for `raised to= etc. Drag it, block it and presto, encryption disappears and you have a well written equation on your hands. Neat! Wonder why it has not been implemented as of yet.

Menus

Arrangement of menu items should be more coherent and uniform. As far as possible, items common to all the word-processors must be grouped under menus with same or equivalent names.AUniformity by itself is no good.@ Jot it down! It=s a quote and what=s more, it is quotable! The logical arrangement of menu-items is a must-must.

WOFIWOG experience: Eh, what's that?

All in all, a WOFIWOG (What yOu Feel Is What yOu Get) experience is what all of us are searching for. Currently, what we are getting seems to be more of WIFIWYG.You guessed it right! Yes, a What I Feel Is What You Get experience, the I in the acronym standing for the PC and the You for you of course! (Who else? Did I really need to tell you that?) Got that Bill? Thank you!

Heron - Born Flightless?

The Heron Language is being developed by Christopher Diggins. Heavily influenced by C++. In search of a killer-app...
http://www.heron-language.com/

Some interesting concepts, but syntax seems to be somewhat cryptic with lots of `?' s in the code. The designer's site is at http://www.cdiggins.com/

Tuesday, August 09, 2005

Behaviour of typeid

code snippet to illustrate behaviour of typeid

struct
{
int side;
}square1;

struct
{
int side;
}square2;


int main(int argc, char *argv[])
{
if(typeid(square1)==typeid(square2))
printf("Same.");
else
printf("Different.");
}