Absolute vs relative paths

posted by Knut Torgersen
May 13

In your web programming you can either use relative or absolute paths to, say, pictures and other items you want to make accessible to the public.

Relative path: The root of your path is assumed to be / regardless of location. An address will look like: /images/mypic.jpg. Easy to maintain and code is trans-web portable. You can also address items relative to your current subdirectory. If, for instance, your index.html resides in the /example/ directory, you can address the /images/ folder like this: ../images/mypic.jpg

Absolute path: The root of your pat is your (or any other, for that matter) domain that then contain the file structure. This means that you prefix every (relative) address with your domain name. An address will look like: http://www.mydomain.com/images/mypic.jpg

Personally, I try avoiding at least the extreme version of relative addressing in my private webs, as they may turn up confusing or even non-functional. I therefore take the extra time to make sure all of my paths are fully absolute. Boring to enter, but 100% foolproof. Foolproof works well for me. Very well, in fact…


May 13

The MediaWiki is the wiki flavour used by THE wiki of them all: Wikipedia. It is not all that difficult to set up, but it is not equally easy to configure. The procedure for changing the upper left hand corner logo image turned out to deviate from descriptions and not behave completely by the book (as in the manual).

First of all, create an image that is 135 by 135 pixels. I used PNG, but both GIF and JPG should do. Put this image in a suitable place on the wiki. The relative paths /, /images/ and /skins/common/images/ are suggested places, so I put mine in /images. See this link for a discussion on relative vs permanent links.

Now, locate (still relative) /LocalSettings.php and open it in your favourite editor. Do a sweep for $wgLogo just to be certain it does not exist.  When satisfied, add it near the end somewhere where it seems more or less logical to put it. I made a new comment line (starts with the hash, #) below $wgDiff3 and below the comment added the proper $wgLogo line.

First, I tried as suggested to enter the relative path to my PNG, but that only made a white, empty space appear. I moved the file around and did not at all getting the results expected. I then rechecked the official MediaWiki manual and discovered that paths can be both relative and absolute. I then entered the absolute path to the image, saved, refreshed the page in the browser – and there it was.


Luxand Blink!

posted by Knut Torgersen
May 11

Just in case you wonder if there is a way to log in without typing your password. Yes – there is. Either you buy a Lenovo with fingerprint scanner (that does not work very well from what I have heard) – or you can finally use that webcam you bought for something useful: Install Luxand Blink! and log in using your face.

Here is the link: http://www.luxand.com/blink/


Synergy/Synergy+

posted by Knut Torgersen
Apr 20

Synergy (the original) and Synergy+ (the error-correcting fork) is in essential the same application, so in the below Synergy and Synergy+ mostly refers to the same product. If in doubt, assume I am talking about Synergy+.

The Synergy application is an ingenious piece of work that make it easy to swap between different computers, as long as the involved PCs have their own monitor. From one keyboard and one mouse you can control an entire range of PCs – spanning operating systems and networks. There are packages available for Linux, (BSD), Mac OS-X and Windows.

When setting up for the first time, dedicate one PC to be the “server” and install the rest as “clients”. The “server” is typically the one PC with mouse and keyboard connected. On this PC you must describe your environment, either by hand-editing your synergy.sgc or by (on Windows and some flavours of Linux) using a graphical tool. Note that you must configure both the way in and the way out of a computer. If you have computers A, B and C and they are ordered in that order on your desk, you must both say that A is left of B and B is right of A for the mouse to return to your original screen.

As the configuration language is in a well-thought-through structure, you can among other things decide if screensavers should be turned on simultaneously on all computers or not. You can also map keys if needed.

For a syntax highlighter for the Notepad++ highlighter, go here.



Click link to access file

userDefineLang.xml


Right-click in Excel fails

posted by Knut Torgersen
Apr 16

I got the following problem handed over to me today: “When right-clicking the sheet itself to do operations on a cell, Excel suddenly fails to show the menu.” Some desperate minutes later (about 40 of them) I found at least a workaround:

Close Excel if it is running. Delete the following key in the registry:

HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Excel\Options

Reopen Excel and test if it works now. The Options folder recreates itself with a minimum set of contents, and Excel seems to be working well after this.


Mar 23

If you have to update your Linux and you are behind a proxy, you can do the following:

export yourproxyserver:port

from your command line. After you have issued that command, you are free to use yum (or whatever web command you need) as usual.

For a more permanent solution, put this in /etc/profile.d and every user on your system can benefit from it.


Google Earth – My places

posted by Knut Torgersen
Feb 28

I’ve got this idea that I should set up backups of everything on my computers. Everything worth saving, that is. So, next on my mental list was My places in Google Earth. But where the heck are the files for this feature?? Here they are:

  • WinXP:   C:\Documents and Settings\<User>\Application Data\Google\GoogleEarth\myplaces.kml
  • VISTA:   C:\Users\<User>\AppData\Roaming\Google\GoogleEarth\myplaces.kml
  • Win7:     C:\users\<User>\appData\LocalLow\Google\GoogleEarth\myplaces.kml
Happy backup’ing!


If you cannot get that d@mn log file to shrink, here’s a neat trick I learned from Christian Arheim:

  1. Make a backup of the files. MS Backup will do if you do not have anything else or if you are in a hurry.
  2. Open MS SQL Enterprise Manager
  3. Open the tree on the left hand side to reveal the database owning the offending log file
  4. Right-click it and select Properties
  5. In the left-hand-side of the window appearing, select Options
  6. To the right, locate Recovery model and select Simple (and – important – make a note of what it was)
  7. Select OK
  8. Right-click the database again and this time select TasksShrinkFiles
  9. In the window appearing select File type to be Log and select OK
  10. After shinking finishes, you must now reset the recovery model. Do this:
  11. Right-click database and select Properties
  12. In the left-hand-side of the window appearing, select Options
  13. To the right, locate Recovery model and select what noted it to be in #5 above. You forgot to write it down? You FAIL!
  14. Select OK

The log should now be down to an absolute minimum for this database.


Done

posted by Knut Torgersen
Jan 1

My ISP finished migrating me only a few minutes after 2200 30 December. But due to the “speed of the Internet” all DNS records involved did not update until only a few hours ago. And of course, I’m one of the last to get access to my own site. I got a new user registration while I had no way of accessing my own site….! Nice.

But – everything works just fine, I did not have to change anything – and thank you to MyWebhost for their perfect migration. They have affordable plans and an excellent customer service!