General


General08 Jun 2006 07:13 pm

Just a test post to see how quickly Google will pick up indexing a random Coppermine photo gallery from my blog to another domain.

General05 Jun 2006 09:31 am

An amazing illusion! And the last sentence is so true…
If your eyes follow the movement of the rotating pink dot, you will only
see one color, pink.

However. if you stare at the black “+” in the center, the moving dot turns
to green.
Now, concentrate on the black “+” in the center of the picture. After a
short period, all the pink dots will slowly disappear, and you will only
see a green dot rotating.
It’s amazing how our brain works. There really is no green dot, and the
pink ones really don’t disappear. This should be proof enough, we don’t
always see what we think we see.

Optical Illussion

General24 Apr 2006 02:12 pm

Opening a directory is just like opening a file. Though you will probably need to follow the full server path or symlinks to get to the directory you want. Suppose you want to open the "docs" directory, which on your server has the path "/home/username/www/docs/". You would do it like this:

CODE:
  1. opendir(IMD, "/home/username/www/docs/") || die("Cannot open directory");

Like a file we can make that path a variable and use it instead:

CODE:
  1. $getdir="/home/username/www/docs/";
  2. opendir(IMD, $dirtoget) || die("Cannot open directory");

Now that it is open, we will want to read in the contents.

Read the Contents

The contents of the directory will be the file name of each file in the directory, including "." and ".." in the list. You'll want to toss those two out if you want just the files themselves. To read the directory, we can read the contents into an array and use the array:

CODE:
  1. @thefiles= readdir(IMD);

Use the handle you assigned to your directory in the readdir command. In our case, it is IMD. Now the contents of the images directory are in the @thefiles array.

Close the Directory

CODE:
  1. closedir(IMD);

The whole bit from open to close looks like this:

CODE:
  1. $getdir="/home/username/www/docs/";
  2. opendir(IMD, $dirtoget) || die("Cannot open directory");
  3. @thefiles= readdir(IMD);
  4. closedir(IMD);

You can use this to list the files in a directory, though not elegant as using regular expressions, it will will serve.

CODE:
  1. #!/usr/bin/perl
  2.  
  3. $getdir="/home/username/www/docs/";
  4. opendir(IMD, $dirtoget) || die("Cannot open directory");
  5. @thefiles= readdir(IMD);
  6. closedir(IMD);
  7.  
  8. print "Content-type: text/html\n\n";
  9. print "<html><body>";
  10.  
  11. foreach $f (@thefiles)
  12. {
  13.   unless ( ($f eq ".") || ($f eq "..") )
  14.   {
  15.    print "$f<br />";
  16.   }
  17. }
  18.  
  19. print "</body></html>";

This can be used as an easy way if displaying multiple items like images instead of writing a bunch of HTML code for each image, especially if their are a lot of files, handy if you are lazy or it happens to be Tuesday.

General03 Apr 2006 01:49 am

Cronicles of my adventures trying to get Windows Xp Pro X64 running and integrated periphials workong on my Acer Aspire 5003 WLCI laptop.

 First stumbling block - integrated wifi card... by default it's not recognized - 64bit drivers needed - 80211g.zip

SiSM760GX integrated 3D graphics controller with 64MB shared RAM - X64 drivers - agp121.zip

General01 Apr 2006 02:16 pm

Couldn't resist pulling a prank on members on one of our forums... Zoanthids are one of the most abundantly found and a big favorite coral for hobbyists to collect and propogate in captivity.

Ban of Zoanthid coral

A quick 'borrow' of CNN's current page and a little editing and viola, enough to stir up a little panic.

Next Page »


Nationwide Building Society - Loans - Fast Loans - Web Advertising - Magazine Subscriptions
X10 Home Security|Dakar's Photos
Listed on BlogShares