Few wallpapers – animals

These are few of wallpapers I posted previously on my old site… Hope you’ll like some!

bird.jpg butterfly1.jpg butterfly2.jpg
chipmunk.jpg curiouskitten.jpg fox.jpg
lazy_cat_01.jpg lazy_cat_02.jpg puppy.jpg
wolf.jpg young_owls.jpg

…and few that are either Corel Painter illustrations, or filtered in Photoshop:

ill-ara.jpg ill-bear.jpg ill-bird1.jpg
ill-bird2.jpg ill-deer.jpg ill-duck.jpg
ill-gepard1.jpg ill-gepard2.jpg ill-tiger.jpg

And last but not least – one (un)likely to be funny “Take it easy!” wallpaper:

takeiteasy.jpg

My fave Douglas Adams quotes

text in italic is by Douglas Adams, [comments in brackets] are mine…
this is basically just one madness I wrote for my old site as “Abouts…” page, based on the Hitch Hiker’s Guide to the Galaxy books 🙂

About the universe

In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move.

[Then came the great-potatoes… and everyone’s been happy – fries for free, toenails bitting for free… you name it. Oh yeah, those were happier days.]

In those days spirits were brave, the stakes were high, men were real men, women were real women and small furry creatures from Alpha Centauri were real small furry creatures from Alpha Centauri.

It is a mistake to think you can solve any major problems just with potatoes.

[But then… All of a sudden, someone wanted a ketchup on his/her fries, and there was a big shivering. And so, people were created, and this made lotsa people really angry… especially those left out in the creation, but also those created – each of them envied the other group. To stop all this fuzz, they made them do the ketchup, and some other goods, mainly required by the too-many-hands creatures. But this made people even more sad, and the sadness spread even further…]

– “Simple. I got very bored and depressed, so I went and plugged myself in to its external computer feed. I talked to the computer at great length and explained my view of the Universe to it,” – said Marvin.
– “And what happened?” – pressed Ford.
– “It committed suicide,” – said Marvin and stalked off…

About the world today…

[Wasn’t the history of universe depressing enough???]

Human beings, who are almost unique in having the ability to learn from the experience of others, are also remarkable for their apparent disinclination to do so.

He hoped and prayed that there wasn’t an afterlife. Then he realized there was a contradiction involved here and merely hoped that there wasn’t an afterlife.

You can get first 3 books of HHGTG here.

How to prevent dialog from closing on Enter/Escape in MFC

Implicit behaviour of dialogs in MFC is, that the dialog closes when user presses <Enter> (equivalent to pressing “OK” button) or <Escape> (“Cancel” button).

To prevent this, you have to override dialog class’ PreTranslateMessage() function, and use the following code to “translate” the <Enter> and <Escape> keys to <Tab> key:

BOOL CMyDialog::PreTranslateMessage(MSG* pMsg)
{
    if (pMsg->message == WM_KEYDOWN)
    {
        if ((pMsg->wParam == VK_RETURN) || (pMsg->wParam == VK_ESCAPE))
            pMsg->wParam = VK_TAB;
    }
    return CDialog::PreTranslateMessage(pMsg);
}

Complete Dante Alighieri’s Divine Comedy in PDF – 3 books

Bit earlier than promised, I’ve finished the Paradiso, so I bring you complete Dante Alighieri’s Divine Comedy in PDF for free download, as 3 separate eBooks – Inferno, Purgatorio, and Paradiso. If you’ve already downloaded the first 2 parts, feel free to re-download them, as the final versions are extended, with few mistakes corrected, plus with an enhanced layout.

Continue reading

Get rid of page number on 1st page of ToC in LaTeX!

LaTeX, or more generally TeX, is undoubtly the best typesetting tool available, and what’s more, it’s for free (for Windows users – check out MiKTeX!). Yet, there are few things that should work in a certain “obvious” way, yet they don’t (fortunately, there’s very few of them).

One of them is quite a surprising thing – pagestyle{empty} command does not affect first page of the table of contents. Yet, all the other pages of ToC it does! The same holds for list of figures and list of tables.
This is quite an annoyance, especially if you put ToC at the beginning of the document, and want to have all the pages, before the real contents starts, without the page numbering.

So, how to get rid of the page number on the first page of table of contents in LaTeX? You have to dig into the header and footer setting for this.

First thing is to use fancyhdr package – put usepackage{fancyhdr} command anywhere before the begin{document}.

Second, right before issuing the tableofcontents command, redefine the “plain page style” to an empty one, like this:

fancypagestyle{plain}
{
    fancyhead{}
    fancyfoot{}
}	% clear header and footer of plain page because of ToC

And after the ToC, just get back to the “classical” plain page style (this is important – even if you use your “fancy” page style, each page containing first page of chapter is “plain”, unless you redefine this behaviour), like this:

fancypagestyle{plain}
{
    fancyhead{}
    fancyfoot[C]{thepage}
}	% re-define plain page after the ToC

This block has to be “on a new page” – either after you issue newpage or cleardoublepage command, or after your first chapter{...} command.

File and folder access management in Apache

Restricting to localhost Access Only

To restrict access globally, all you have to do is to restrict access in httpd.conf in Apache’s conf directory.

First, locate the Directory settings for your htdocs directory (under Windows it’s e.g. C:/Apache2/htdocs, C:/Program Files/xampp/htdocs, etc., under Linux it’s e.g. /usr/htdocs, /usr/local/htdocs, /usr/local/www/htdocs, /usr/share/htdocs, etc.).

Then, you have to edit the Order subsection as follows (comments left out for readability):

<Directory "htdocs_path">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All</directory>

Order deny,allow
Deny from all
Allow from localhost
</Directory>

Note: Order of the Deny and Allow lines is important! – just guessing, but I think that Apache simply applies the rules one after another, and the output of last rule that applies to the IP is used.

It can be also sometimes useful to disallow overrides of settings; if needed, simply change AllowOverride All to AllowOverride None, to disallow override of settings using .htaccess files.

See Apache documentation for complete list of options; just like with Options, it’s recommended to list the settings explicitely in AllowOverride to know what exactly is allowed.

Restricting Access to Certain Files

Great example of how to do this is contained in the httpd.conf itself, but many people seem to somehow miss it there, so here it is:

# The following lines prevent .htaccess and .htpasswd files
# from being viewed by Web clients.
<FilesMatch "^\.ht">
Order allow,deny
Deny from all
</FilesMatch>

Of course, don’t forget to restart Apache after each edit of httpd.conf file, so it reloads the settings. Good luck!

Network patch for Linux systems under VMWare

If you’re experiencing problems with networking under Linux in VMWare (e.g. loosing connection after switching out and back in the virtual machine, after Pause-Resume, or after your host (A)DSL connection “restarts”), try the following simple patch (tested on FC4 and Ubuntu; you can always simply revert the changes to get to where you were).

Continue reading

How to install VMWare Tools on Ubuntu/Debian

VMWare Tools are ready-to-install or ready-to-compile on most of the supported guest systems; on Ubuntu/Debian, you have to do a bit more to be able to compile them, since the system doesn’t come with necessary headers and tools.

Continue reading