Main | November 2005 »

October 31, 2005

Google Currency Conversion

Google has a currency conversion feature built in to its search, all you have to do is search for 100 GBP in USD, for example, to convert £100 (UK Pounds Sterling) to US Dollars. If you don't know the acronym for the currency you're converting to then don't worry as you can also do conversions with a search like 100 USD in Czech money, if you were planning a trip to the Czech Republic.

Search within a site with Google

Google lets you narrow your search down to within a specific website, or to within a specific TLD (for example .gov).

You can do this by using the site: command in your search, for example:

  • java site:sun.com - searches for java on sites with the domain name sun.com (this includes subdomains, like java.sun.com)
  • java site:java.sun.com - more specific; searches for java on sites with the domain name java.sun.com.
  • copyright site:gov - searches all US government sites (domain names ending in .gov) for the term copyright.

Technorati Tags: , , ,

October 30, 2005

Kill a Process from the Windows Command Line

To terminate a process from the command line of windows, use the taskkill command:
When you know the name of the image to stop:
taskkill /IM notepad.exe
Or when you know the process ID, eg 784:
taskkill /PID 784
For more usage variants, type taskkill /?

NB: some of this information about what processes are running can be obtained by the tasklist command.

List all processes with the command line

To view all the currently running processes in windows from the command line, you can use the command 'tasklist'. The output will look something like this:
F:\>tasklist

Image Name               PID Session Name     Session#    Mem Usage
===================== ====== ================ ======== ============
System Idle Process        0 Console                 0         16 K
System                     4 Console                 0         52 K
smss.exe                 592 Console                 0        108 K
csrss.exe                648 Console                 0      5,868 K
winlogon.exe             680 Console                 0      2,632 K
services.exe             724 Console                 0      2,376 K
(...)

Technorati Tags: , , ,

Use Google to define words

You can use google to find definitions of words rather than looking them up in an online dictionary.
To do this, search for "define:" followed by the word (without quotes) you want to find the meaning of.
For example: "define:potato".

Del.icio.us system: tags

Delicious has some system tags for you to use. These are automatically applied to any files of the matching type. They are really just shortcuts to be able to search for more than one filetype at once. The tag "system:media:audio" includes
  • *.mp3 tagged as "system:filetype:mp3"
  • *.wav tagged as "system:filetype:wav"
The tag "system:media:video" includes
  • *.mpg tagged as "system:filetype:mpg"
  • *.mpeg tagged as "system:filetype:mpeg"
  • *.avi tagged as "system:filetype:avi"
  • *.wmv tagged as "system:filetype:wmv"
  • *.mov tagged as "system:filetype:mov"
The tag "system:media:image" includes:
  • *.jpg as "system:filetype:jpg"
  • *.jpeg as "system:filetype:jpeg"
  • *.gif as "system:filetype:gif"
  • *.png as "system:filetype:png"
The tag "system:media:document" includes:
  • *.pdf as "system:filetype:pdf"
  • *.doc as "system:filetype:doc"

For example:
http://del.icio.us/tag/system:media:audio+indie
http://del.icio.us/tag/system:media:image+nasa

October 24, 2005

How to Control the Mouse Pointer Without a Mouse in Windows XP

If you want to control your mouse pointer with the keyboard, Windows XP provides a way:

Press Alt+Left Shift+Num Lock all at once and a prompt will appear telling you that you have activated mousekeys, select ok then you can control the mouse with the numpad.

The controls are:
1,2,3,4,6,7,8,9 = move the mouse
5 = mouse button click
+ = double click
insert = hold down mouse button
delete = release mouse button (after holding it down with insert)
/, * or - = select which mouse button the above controls will click (left, both or right respectively)
numlock = disable mousekeys

How to use PHP in pages with a .html extension (or any other)

To be able to use php code on a page with an extension other than .php, you need a server which supports .htaccess files.
To add an extension to be parsed for php, create or edit a file called .htaccess (with the dot first) containing the following line:
AddType application/x-httpd-php .html .moo .htm
This tells the server to check for php code and execute it in files with extensions .html, .moo or .htm.

How to Access a Page in Google's Cache

Normally the format of a URL in Google's cache is:
http://google.com/search?q=cache:xxxxx:yyyyy
Where xxxxx is a hash of the URL and yyyyy is the address itself.
You can access the cache of specific URL by omitting the hash part and simply using the url:
http://google.com/search?q=cache:xxxxx
For example:
http://google.com/search?q=cache:google.com

This is also possible without editing the url, by searching google for "cache:google.com"

To highlight terms within the cache'd page, add them on to the end of the search query, for example: "cache:google.com news" will highlight the word "News"

How to View del.icio.us Bookmarks by Filetype

You can use special tags to restrict bookmarks to certain file extensions, for example pdf or mov.
To do this, search for the tag "system:filetype:pdf", or enter the URL:
http://del.icio.us/tag/system:filetype:pdf
You can filter these by more tags too:
http://del.icio.us/tag/system:filetype:pdf+php

eXeem's Future is Doubtful

Slyck, a file-sharing news site, published an article discussing eXeem, noting that its website - www.exeem.com - is currently offline. In it they interview SuprNova's Sloncek (who had been doing public relations work for them around the time when he took SuprNova offline). Sloncek revealed that the company behind it have produced version 1.0 but they have also moved on to other projects.

It's not too bad a thing anyway - eXeem was never anything special, even when you ignore the not-too-bad-adware. It still amazes me that a file-sharing application was created with any built in adware, Cydoor none the less, when users still had bad tastes left from KaZaA and the like.

Source: Slyck News - eXeem Future in Doubt

October 21, 2005

Find free images for your website

About.com has plublished a top ten of websites where you can get royalty free images for use on your blog (or other personal website). The top one of which is Stock.XCHNG. Followed in second place by Flickr, which allows you to browse other people's photos which are licensed under creative commons licenses (which give you permission to re-use the images in certain conditions, such as not-for-profit use).

Source: Top 10 Places to Find Free Images For Your Blogs [About.com]

Create A Torrent: Maketorrent + Jmstacey

Simple guide to creating a torrent using MakeTorrent and the JMStacey.net tracker.
Update: since this article was written, the JMStacey tracker has gone offline, however the majority of content in the article still applies, just the tracker won't work.

Tools used:
MakeTorrent v2.0 RC1
BitTornado-0.1.4
Public Tracker at http://www.jmstacey.net/tracker/

Step 1:
Download and install the tools listed above and sign up (create an account to upload torrents if it lets you) at any public tracker (for a list see http://trackers.thebeehive.me.uk/).
Find the item you wish to distribute and, if you can, make a copy of it - this preserves your version incase something goes wrong later on.

Step 2:
Start MakeTorrent, it should have placed a shortcut to it in the Programs section of your start menu.
a) I like to use "Classic" mode, so switch to that
b) Click on the "(dir)" button, then browse to the directory which you are wanting to distribute. If you want to torrent a single file then click the (file) button instead and select that file. When you have browsed to the directory or file you want to torrent, press the ok button and it will fill in the path in the "Filename or Pathname" box in MakeTorrent.


Step 2 is shown here:
step 2

Step 3:
a) Double check the directory displayed in the box is the right one.
b) Now you need to find the announce URL for the tracker which you are using, this usually ends in "/annouce" or "/annouce.php" A good place to look for this is the Upload page of the tracker's website. On the tracker I am using in this example, the announce URL is displayed at the top of the Upload page, and is:
http://www.jmstacey.net/tracker/announce.php
c) When you find this URL, copy it to the clipboard and paste it in the box marked "Tracker:" in MakeTorrent
You can leave the other settings as they are until you learn more about bittorrent and want to do more with it.

Step 3 is shown below:
Step 3

Step 4:
a) Make sure that the files in the folder are not being used (eg you're not playing one of the mp3s in winamp), it doesn't like that.
b) Click the "Create .torrent" button at the bottom right of the MakeTorrent window.
c) It will then prompt you for a directory to save the .torrent file in, choose somewhere you'll remember and press "Save."
d) It opens a popup with two progress bars, the top one is the progress of the file it is currently working on, the one below it is the overall progress. When the overall progress bar reaches the end, it will allow you to click "Finish" so do so.
e) You have now made your .torrent file! Close MakeTorrent.

Step 4 is shown below:
Step 4

Step 5:
a) Now you have made the .torrent file, but it's no use just being on your computer, you need to upload it to the tracker you're using. To do this, go to the Upload page on the tracker's website.
b) There should be a box for the torrent file you are uploading, click on the browse button next to the box and browse to the .torrent file you have created, select it and click "Open" in the popup box. It should then put the path to that file in the text box.
c) Fill in any other fields the tracker asks for on the upload form, for example the tracker I am using asks for name, description and type. I filled each in with fairly informative information about the album I am torrenting and chose the correct type (music).
d) Click on the submit button to upload the file to the tracker. In this example the button is labeled "Do It!"

Step 5 is shown here:
Step 5

Step 6:
a) Now that you've uploaded your .torrent file to the tracker (errors will hopefully be self explanatory and rare) you have to start seeding it. Open your bittorrent client - this example uses BitTornado, you can open this by finding the folder it created in the start menu on installing it. BitTornado opens a box asking you to select a .torrent file, if your client doesn't do this you can either browse to the file in Windows Explorer, then right click on it and choose "Open With" -> (choose your torrent program) or look for a button on your client to add the torrent.
If the dialogue box was displayed browse to your torrent and press "Open"
b) Now BitTornado asks where you want to save the files to. As we already have the files we must browse to that folder - make sure that you select the same folder as you used to make the torrent! When you've selected that folder in the browser, click "Ok."
BitTornado then inspects all the files in the torrent, decides that you have the full versions of all of them and displays a download window, but showing the download as complete. There's a button showing "finish" but don't click this until you're sure that other people have the whole file and are seeding it.

Step 7:
You're now seeding your torrent file. An optional mode on BitTornado and some other clients is the "SUPER-SEED" mode. This can help to distribute files more evenly amongst the people downloading from you, which can help to distribute the file quicker. You should only use this if you are the only seeder, you can switch this on by selecting "SUPER-SEED" from the "Settings for" list box near the bottom left of the download window.

Thanks for following this guide through.

Disclaimer: This article is for informational purposes only and no files were actually distributed to other people creating it. Sharing files that you don't own the rights to is illegal.

Only Download Certain Files Using Azureus

Guide to selecting specific files to download in Azureus.

Tools used: Azureus 2.1.0.2

Ever find a torrent with a lot of files when you only wanted a few of them. Azureus offers a way to only download the ones you want, and this guide is to tell you how to do so. Note that this doesn't work when the all files are compressed into a single .rar or .zip file

Step 1: Install Azureus if you haven't done so, and load your torrent into it as normal, selecting where you want to save it. When it's done allocating then start the torrent

Step 2: In the "My Torrents" tab, double click on the name of the torrent so that it opens a new tab with the details of that torrent. Alternatively you can right click on it and select "Show details," as shown below:
Step   2

Step 3: In the torrent details tab, choose the "File" section by clicking on it as shown below:
Step   3

Step 4: Now you are shown a view of each file in the torrent and what bits of each file have been downloaded. If you don't get this view then make sure that the torrent is downloading and not queued or stopped. Then select the files that you don't want to download, you can hold down the control and/or shift keys to select more than one.

Step 5: When you've selected them all, right click on one of the ones you've selected and in the right click menu select Set Priority then Do not download. This is shown below:
Step   5

Step 6: Then just leave it to download, note that if it had already started downloading bits of those files then it will continue to, so you might end up getting some of them anyway. When it has finished, it will still appear in the downloading (top) part of the "My Torrents" tab, but it will not be downloading anything. You should go back to the files view to make sure that all the files you wanted have been downloaded correctly then seed until you've uploaded enough before removing the torrent.

Step 7: It still created the files on your hard-disk, and telling it not to download them does not delete them, so you'll have to go and do that now - make sure you delete the right ones :)

Thanks for following this guide through.

Disclaimer: This article is for informational purposes only and no files were shared while creating it. Sharing files that you don't own the rights to is illegal.

Create A Torrent With Maketorrent + PunkHC

Guide to creating a torrent using MakeTorrent v2.1 and PunkHC Tracker.

Tools used:
MakeTorrent v2.1
BitTornado-0.3.3
PunkHC tracker at http://punkhc.dyndns.org

Note: This guide is essentially the same as the create a torrent using MakeTorrent and the JMStacey.net tracker, except this features updated versions of the software involved and the tracker interface is slightly different.

Step 1:
Download and install the tools listed above and sign up (create an account to upload torrents) at the PunkHC tracker.
Find the item you wish to distribute and, if you can, make a copy of it - this preserves your version incase something goes wrong later on.

Step 2:
Start MakeTorrent, it should have placed a shortcut to it in the Programs section of your start menu.
a) I like to use "Classic" mode, so switch to that
b) Click on the "(dir)" button, then browse to the directory which you are wanting to distribute. If you want to torrent a single file then click the (file) button instead and select that file. When you have browsed to the directory or file you want to torrent, press the ok button and it will fill in the path in the "Filename or Pathname" box in MakeTorrent.


Step 2 is shown here:
step 2

Step 3:
a) Double check the directory displayed in the box is the right one.
b) Now you have to find the announce URL of the tracker, this is displayed at the top of the "Upload" page, and unless it has changed is it:
http://punkhc.dyndns.org/announce.php
c) When you find this URL, copy it to the clipboard and paste it in the box marked "Tracker:" in MakeTorrent
You can leave the other settings as they are until you learn more about bittorrent and want to do more with it.

Step 3 is shown below:
Step 3

Step 4:
a) Make sure that the files in the folder are not being used (eg you're not playing one of the mp3s in winamp), it doesn't like that.
b) Click the "Create .torrent now!" button near the bottom right of the MakeTorrent window.
c) It will then prompt you for a directory to save the .torrent file in, choose somewhere you'll remember and press "Save."
d) It opens a popup with two progress bars, the top one is the progress of the file it is currently working on, the one below it is the overall progress. When the overall progress bar reaches the end, it will allow you to click "Finish" so do so.
e) You have now made your .torrent file! Close MakeTorrent.

Step 4 is shown below:
Step 4

Step 5:
a) Now you have made the .torrent file, but it's no use just being on your computer, you need to upload it to the tracker you're using. To do this, go to the Upload page on the tracker's website. on the PunkHC Tracker, this is: http://punkhc.dyndns.org/upload.php
b) The "Torrent file" box is to select the torrent file you are uploading, click on the browse button next to the box and browse to the .torrent file you have created, select it and click "Open" in the popup box. It should then put the path to that file in the text box.
c) Fill in the "Torrent name" field with an informative name and the "Description" field with - for example - a track listing, information about the artist, quality of the rip, etc. Then select the correct type for the torrent.
d) Click on the "Do it!" button to upload the torrent file to the tracker.

Step 5 is shown here:
Step 5

Step 6:
a) Now that you've uploaded your .torrent file to the tracker (errors will hopefully be self explanatory and rare) you have to start seeding it. Open your bittorrent client - this example uses BitTornado, you can open this by finding the folder it created in the start menu on installing it. BitTornado opens a box asking you to select a .torrent file, if your client doesn't do this you can either browse to the file in Windows Explorer, then right click on it and choose "Open With" -> (choose your torrent program) or look for a button on your client to add the torrent.
If the dialogue box was displayed browse to your torrent and press "Open"
b) Now BitTornado asks where you want to save the files to. As we already have the files we must browse to that folder - make sure that you select the same folder as you used to make the torrent! When you've selected that folder in the browser, click "Ok."
BitTornado then inspects all the files in the torrent, decides that you have the full versions of all of them and displays a download window, but showing the download as complete. There's a button showing "finish" but don't click this until you're sure that other people have the whole file and are seeding it.

Step 7:
You're now seeding your torrent file. An optional mode on BitTornado and some other clients is the "SUPER-SEED" mode. This can help to distribute files more evenly amongst the people downloading from you, which can help to distribute the file quicker. You should only use this if you are the only seeder, you can switch this on by selecting "SUPER-SEED" from the "Settings for" list box near the bottom left of the download window.

Now that you have created a .torrent you're gonna want to tell people about it, right? Well due to the nature of the PunkHC tracker, you must link people to the tracker site so they can register before they are able to download from the torrent. This means it is not suitable for sites such as suprnova. However this is possible on forum style sites, such as punktorrents.com.

To submit your torrent on punktorrents.com:

A) Go to punktorrents.com in your browser and login or signup if you have yet to do so. Navigate to the correct forum, this will either be Punk, Ska, Hardcore, Local Bands or Videos within the Downloads category.

B) When you are in the correct forum, press the "New Topic" button:
New Topic

C) Fill in the fields it presents to you:
Topic Title: Should be the name of the album you're posting with maybe the year or quality/format, keep it short and descriptive.
Topic Description: Any additional information or comments you have can go here.
Enter Your Post: This is the main post text, here it is always appreciated if you put some information about what your torrent. You should explain how the tracker works to people viewing your post, as I have done below:

For example:
Bouncing Souls - Anchors Aweigh
Tracklist:
01 - Apartment 5F
02 - Anchors Aweigh
(...)

Quality: 192kpbs mp3
This torrent is on the PunkHC tracker, which requires you to sign up before you can download to help prevent leeching. If you haven't signed up, go to http://punkhc.dyndns.org to do so then download the torrent from the tracker.
Link to torrent on tracker: [url=http://punkhc.dyndns.org/details.php?id=197&hit=1]http://punkhc.dyndns.org/details.php?id=197&hit=1[/url]

I also like to ask people to say thanks for downloading and request they don't leech. Also if you are distributing a group release which came with a .nfo file, you could simply paste that in this box, although enclose it in [ code]..[/code] brackets to keep the formatting.

That's all the fields that have to be filled out, although you can choose a post icon if you want.

D) There is a box to attach a file to your post, however do not attach the .torrent file as the PunkHC tracker requires that people download it from their site.

E) Check what you've entered above, and click on "Post New Topic" at the bottom.

That's it! You can keep an eye on your thread for problems and people requiring reseeds, etc. Thanks for contributing!

Thanks for following this guide through.

Disclaimer: This article is for informational purposes only and no files were actually distributed to other people creating it. Sharing files that you don't own the rights to is illegal.

Create a .torrent using Azureus and PunkHC Tracker

Guide to creating a torrent using Azureus BitTorrent Client and the PunkHC tracker by Llyenn.

Tools Needed

Azureus

Latest version of Java

Step 1:
Download and install the stuff above and sign up at the PunkHC tracker Step 2:

Open Azureus (its probably already open cause you are a leeching fool). Go up to File -> Create a Torrent.

user posted image

Step 3:

You will now be looking at a screen like this…

user posted image

Put the address of PunkHC’s tracker in the Announce URL box. The URL is http://punkhc.dyndns.org/announce.php. Shouldn’t need to add Multi-Tracker info to the torrent, add hashes is up to you. Comment Box put whatever your little heart desires in there. Now, the important thing is to make sure you choose directory and click next.

NOTE: You are probably wondering about the blue text and why I didn’t mention it. I am now so stop worrying about it. At this screen or the next for that matter you can simply pop over to Explorer [or linux shells too (not OSX known issue for 2.1.0.4)] and drag and drop the folder over to the Azureus window. I want to show you the long way first, then you can take shortcuts.

Step 4:

user posted image

You will then get this window…click Browse or drag and drop and it will fill it in. If you dragged and dropped on the previous screen this field will already be filled. After clicking Browse….

user posted image

Familiar yes, I know. Browse to your Album that you are sharing (you must’ev done well in Kindergarten). For this example we are going to share a great L.L. Cool J album (don’t tell anyone please). Select the album and hit OK.

Step 5:

user posted image

Almost finished! The File dialog will tell you where it is putting torrent file. For example mine is going on my desktop. (Blocked out my name in case you were wondering)Now we click Finish.

Step 6:

user posted image

The little progress meter will…umm…progress across the screen. It will ignore files that don’t need to go with it (folder.ini, thumbs.db, etc. It will then say file saved when it is finished and the Cancel button on the left will turn into Close. Click it. Do it. Come on Do it.

Step 7:

Now open up Firefox, or Mozilla, or Opera (or IE if you’re still using it, sigh). Go to PunkHC, login, and click on upload.

user posted image

That is the screen when you start. Click Browse and navigate to you torrent file. Type in a descriptive torrent name, Artist – Album – Release Group (if any). Type a brief description about the band, album, whatever. Type…self explanatory, if you can’t find it on the list, it don’t belong on the board. When finished it should look somewhat like…

user posted image

When yours looks like mine, click DO IT! You have now successfully posted your torrent on PunkHC. And there is only one step left, to seed it

Step 8:

Go back to Azureus. Go to Open -> .torrent file for seeding. This is VERY IMPORTANT (depending on your settings anyways). If you have default save set up, meaning everything when downloaded automatically goes into one folder (like mine does) it will look for the files that you are now seeding in that directory. For example my stuff comes into L:Incoming. My Music is in L:MusicGenreArtistAlbum. Follow me. Now when you open the .torrent file in the manner I have instructed, you can show it where the files are…so that way your music stays where it belongs. It will check the file in the top pane, takes a few minutes, and then it will move to the bottom pane and it will be seeding. You are now cool. Go have a cookie or something. Any questions? PM me on Punk HC or at Punk Torrents

Additional Notes:

You may most definitely want to put this up on Punk Torrents. Go there. Register if you haven’t, and go into the applicable forum and post a topic. Be sure to include Artist, Album, Track Listing, Bitrate. And at the bottom put a link to PunkHC, or even directly to the page itself, BUT DON’T POST THE TORRENT.

When seeding a file for the first time, it is beneficial to SUPER SEED, you can do this by going to View->Configuration, Queue, Seeding and clikcing the Super-Seed box. Don't forget to save.

Thanks to Llyenn from punktorrents.com for writing this guide!

Java Lesson 1 - Your First Program

This guide describes how you can create your first Java program, using notepad and the command line. There's also a video summary of the tutorial.

Firstly, to create a Java program you need to install a few things:

  • The Java SDK (aka JDK) from Sun
  • Something to create plain text files with, we'll use notepad for now.
To obtain the JDK, you must go to Sun's Java page and download the J2SE JDK from the download page, make sure you get the latest version of the JDK, at the time of writing this is the "JDK 5.0 Update 2" which is the second item on the page. Sun also provide install instructions to help you get the JDK set up correctly. To compile and run Java programs in the same way as we do, you'll need to follow part 5, "Update the PATH variable (Optional)."

 

1. Assuming that you have installed that correctly (if you have any problems then please ask for help in our forum), start notepad or your desired text editor and enter the following code:

public class HelloWorld
{
public static void main(String[] args)
{
System.out.println("Hello World!");
}
}

It's not terribly important that you understand what the code does just now, as the main emphasis of this lesson is on compiling and running your code, what the code does will be explained in a future lesson.

2. Save that file as HelloWorld.java (the filename is important) and start the command prompt (usually done by selecting start->run, entering "cmd" then pressing ok).

3. At the command prompt, browse to the directory where you saved your program using the command cd "directory name" to change directories (to change drives, type the letter of the drive followed by a colon, for example E: to change to the E: drive).

4. When you've made it to the folder, type:
javac HelloWorld.java
to compile your code. If you recieve an error message similar to "'javac' is not recognized as an internal or external command, operable program or batch file." then ensure that you have followed instruction number 5 in the JDK install instructions.

If your program compiles successfully then you won't recieve any output but you will notice that a new file has appeared in the same directory as HelloWorld.java - this one being called HelloWorld.class which is your compiled program.

5. Now you are ready to run the program! At the command prompt again, type:
java HelloWorld
(note that this time you type java, without the c, and no file extension). You should notice the output "Hello World!" in the cmd window.

Phew, that's the first lesson over - in this lesson you've seen how to create, compile and run a program in Java using just notepad and a command prompt (there are less tedious ways to do it as we shall see, but it is helpful to know that it is possible this way).

This lesson is demonstrated in a flash video: Lesson 1 (370KB)

Summary

  • You can create a java program in any text editor, as long as you save it as plain text
  • To compile a java program from the command line, type javac FileName.java
  • javac.exe is the program which compiles java code.
  • To run a java program from the command line, type java FileName

How to Add an UrbanDictionary Quick Search in Firefox

One of the most useful features of Firefox is it's "Quick Searches." You might not know about them, so say you wanted to search Google, instead of typing in www.google.com in the adress bar then typing in your search string, eg pie, you can simply type "google pie" in the address bar and Firefox will skip straight to the results. Sure there's that custom search box at the top right, but I can never be bothered moving my mouse all the way over there and clicking the icon to change it.

There are more quick searches already defined in Firefox, for example dict searches dictionary.com (you can see them all by looking in Bookmarks->Quick Searches). This guide will tell you how to add one for an alternative dictionary site, UrbanDictionary.com.

This way goes through the whole process, so you know how to create quick searches for other sites, there are shortcuts you can make which become apparent once you realise how it works.

Step 1
First, go to www.UrbanDictionary.com in Firefox. There's a search box at the top right, so type monkey in that and hit Search. The page changes to the search results for monkey, it's defined as "One of the three primary ingredients of a good game," but that's not important. What you're now interested in is the address bar, which now shows the url http://www.urbandictionary.com/define.php?term=monkey&r=f.

Step 2
What you now want to do is, in the menu bar at the top of the screen, choose Bookmarks->Bookmark This Page. Shorten the name to UrbanDictionary and select to save it in the Quick Searches directory (if this is not showing you may have to press the down arrow next to the "Create In" list of folders).

Step 3
In the menu bar, go toBookmarks->Quick Searches->UrbanDictionary, right click on it then choose "Properties." The properties of the bookmark open in a small window, look at the URL in the Location field: it should say http://www.urbandictionary.com/define.php?term=monkey&r=f. To create the Quick Search, we need to change this to a general search, so edit the URL to say http://www.urbandictionary.com/define.php?term=%s&r=f. What we've done is changed monkey for %s. In the "Keyword" field, enter the term you want to use to activate the search, for example I'm using udict, then enter a description if you wish. The bookmark's properties should now look something like this:
Image Hosted by ImageShack.us
Hit the Ok button.

Step 4
That's it, now you can test it by typing udict pie in the address bar. The UrbanDictionary definition for pie should then load. If that doesn't happen then try checking you've gone through everything correctly.

Update
Since this article was written, the UrbanDictionary quick search has been included with Firefox, with the usage slang [word]. Also, an earlier version of this article was linked from the UrbanDictionary "in the press" page, which was kinda neat. :) This article is being left on the site as it still provides the theory behind adding a Quick Search and so may still prove useful to someone.

How To Open .rar Files, also including .r00, r01, etc

.rar files are archives, like zip files. You can open them using a program called WinRAR, available in the downloads section of rarlab.com. For Mac/Linux users, there's a command line tool also available from that site. You can then install WinRAR and decompress the archive to get the files inside. OS X Users OS X users can also try the application UnRarX to extract rar files. (Thanks to Scubs for mentioning this!)

How to Rip a CD to Ogg Format using dBpowerAMP

This guide tells you how to rip a CD to Ogg Vorbis Format using the dBpowerAMP Music Converter.

Step 1.
Download and install dBpowerAMP.
Next we need to download the Ogg plugin for it so browse to the Codec Central section of the dBpowerAMP site and click to download on the Ogg Vorbis codec (which is listed in the "Popular Codecs" section) This part of Step 1 is shown in this image:

choose the ogg plugin from codec central
Clicking that takes you to a page with three Ogg codecs. You probably want the Standard codec, which is the top one so click on its download link:
select the standard ogg codec
When you've downloaded that, install it and proceed to the next step.

Step 2.
Now that you've installed dBpowerAMP, you need to put your CD in the drive and start the CD Converter. You can launch it from the Start Menu by selecting "dMC Audio CD Input" from the "dBpowerAMP Music Converter" folder.
(A) When you start it, it should display a list of the tracks on the CD, if it does not fill in the titles automatically then you can press the "freedb" button on the toolbar and it will try to retrieve the CD's information from the internet.
(B) Next, click on the options button to configure some settings.
freedb and options buttons

Step 3.
In the options, click on the "set" button in the second row down (called "File Creation"):
options
This will pop up a new window which allows you to set how you want the files to be ripped as. The default is [artist] - [track], so if that's what you want then leave it at that, but I like track numbers so I changed it (in the text box at the top) to [track number xx] - [artist] - [track]. This means that it will rip to files with names:
01 - ArtistName - Track1.ogg
02 - ArtistName - Track2.ogg
And so on. You can play around with it to have it make folders and use the album name too as the examples in the window show.
change filenames
When you have the name you want, press the Ok buttons to exit that window and the options one.

Step 4.
(A) If you like you can change the track names by selecting them and pressing the F2 button.
(B) When you're ready, right click on the "rip" button. This opens up a dialog to change settings for this rip:
rename tracks then right click on the rip button

Step 5.
In the settings, click on the drop down list at the top, next to "Convert files to" and choose "Ogg Vorbis":
select the ogg codec
NB. Changing the settings here is only for the current rip, if you want to keep them more permanently then you can change them in the options window we used in Step 3.
(A) By default, it saves ripped tracks to the folder called C:\Converted Music, so if you want to change this then click on the browse button to the right of the folder name and browse to a new directory.
(B) Now you're ready to rip the CD! Review the settings and press the "Convert>>" button in the bottom right to start it ripping.
change folder and convert

Step 6.
dBpowerAMP will now rip the CD, you should see a window similar to the one below:
converting tracks
When it is done, it will either wait for you to press the "Finished" button or just return to the CD track list screen, which means it's done and you can access the Ogg files in the folder you set it to save to in step 5.

Conclusion
Thanks for following this guide through, hopefully you will have found it helpful!

How to Speed Up Firefox

This tip tells you how to speed up Firefox's displaying of pages, what it does is show you how to configure Firefox to make simultaneous requests for content on a page, rather than performing them one at a time. 1. Type about:config into the address bar and press enter. This displays a list of settings which you are able to edit. At the top of the settings window there is a filter box: when you enter text in it, Firefox will only show the settings which match the text you entered.
Image

2. In the filter box, type:
network.http.pipelining

Firefox will now show settings matching this name. We need to change the value (shown in the 4th column of the about:config screen) of network.http.pipelining to true, which we can achieve by right clicking on it and selecting "Toggle" or by double clicking on the row. When changed, the row becomes emboldened.
Image

3. We need to toggle the value of network.http.proxy.pipelining to true. Do this in the same way as in part 2: by entering network.http.proxy.pipelining in the filter, then right clicking on it and choosing "Toggle."

4. Next, we need to change the value of an integer setting which controls how many requests firefox makes to the web server simultaneously. You can play around with the value, but for now we'll just set it to 10.

As before, enter
network.http.pipelining.maxrequests
in the filter box and find that setting in the list below. When you find it, right click on the setting and choose "Modify."
Image
Firefox will then open an input box, allowing you to type a new value in so enter 10 and press ok.
Image

5. Last, we need to create a new setting, assigning a name and value. To do this, right click anywhere in the about:config window and select "New->Integer"
Image

Firefox will open an input box asking what you want to name the setting. In this, enter
nglayout.initialpaint.delay
And press ok.
Image
Next it will open an input box asking for the value, enter 0 in this and press ok:
Image
You can verify that the setting has been added with the correct value by entering it into the filter and checking it appears in the list.

Conclusion
That's it! You should notice a difference when surfing if you have a reasonably fast connection.

If you want to reset any of these back to their default values, you can do this by right clicking on the setting and choosing "Reset." The setting will then revert to normal text rather than bold and the value will be reset to the default.

October 19, 2005

Do you have to register to access a website?

Is there a long and tedious form which you don't want to fill out, or do you not want to give them your email address? Here's a few tips for those situations.

BugMeNot
The website www.bugmenot.com allows users to submit and retrieve logins for various websites which require you to sign up. If you go there and type in the address of a website, then BugMeNot will tell you if somone has submitted a working login and password for that site which you can then use, avoiding registration completely. To supplement the web site, there is a Firefox extension to open BugMeNot in a popup window and check the site you're browsing.

If BugMeNot doesn't have a working password for the site, there are some ways you can protect your privacy when registering.

Mailinator
Mailinator gives you a disposable email address for sites which ask for your email so they can activate your account but you don't want to give them your real one, perhaps because you don't want their spam. When you go to the Mailinator site, they generate a random email address for you, eg edwdcxsactlonx@mailinator.com. You can then enter this email into signup pages. When they send you the confirmation email you can login to that mailbox through the Mailinator site to check for activation codes then forget about that email address forever.

Some alternatives to Mailinator are: http://pookmail.com/ and http://www.spamgourmet.com/.

Gmail
Google's free email service, Gmail offers a neat trick which can help you to filter and block spam, when asked to enter your email address to sign up for a site, enter username+sitename@gmail.com where username is your gmail address and sitename is something to recognise the site by. For example if your email address was jim123@gmail.com and you were registering on this site, you could use jim123+vdhri@gmail.com. Then if we sell your address to companies which procceed spam you (we would't though, we're nice!) then you can easily filter the spam as well as identify the source. Note that this trick doesn't always work, as many sites which validate email addresses won't allow you to put a + in your address.

How to Find Files With Google

This article details how to use Google to find files to download, some types of file which are easily found with this technique are eBooks and mp3s.

The Method
The idea behind this is to find directory indexes, ie lists of files in a directory which you can then click on to download. With a bit of refinement it is possible to specify which types of files you would like to view and strip out ones which are of no use.

Finding eBooks
To search for eBooks, we note that they are usually of the type .chm or .pdf (also they might be contained in a .zip file). So to search for eBooks, you can type:
-inurl:htm -inurl:html intitle:"index of" +("/ebooks"|"/books") +(chm|pdf|zip)
Which performs this Google search.
The parts of it:
  • -inurl:htm and -inurl:html - These tell Google to
    ignore pages with "htm" or "html" in the title. This is because
    directory listings are usually obtained through accessing the directory
    without specifying a page.
  • intitle:"index of" - It is common for web servers to
    set the title of a directory list as "Index of /directory" so we
    exploit this by searching specifically for it
  • +("/ebooks"|"/book") - Here we're looking for directories which are either called books or ebooks.
  • +(chm|pdf|zip) - This is where we tell it that we're looking for files of common eBook types (chm, pdf and zip).

It is also possible to filter it more, for example by specifying a keyword of the subject you're looking for books on:
-inurl:htm -inurl:html intitle:"index of" +("/ebooks"|"/books") +(chm|pdf|zip) linux
Will do this Google search and find you Linux eBooks!

Not all the sites you find will still be working as some may have
been removed or changed since Google last looked at them so it may take
a few tries to find a good selection.

Finding Music
It is also possible to use this technique to search for music files as follows:
-inurl:htm -inurl:html intitle:"index of" mp3
This searches Google for mp3s in directory listings, as above.

It is again possible to search for other file types, such as ogg or wma, and specify artists. For example:
-inurl:htm -inurl:html intitle:"index of" ogg "daft punk"
Which performs this Google search.

Note: It may not be legal to view directories or download files when you do not have permission to do so. It can be a useful technique but use at your own risk.

Download java mobile phone games from your web space

To transfer java games from your computer to your phone without the use of a USB cable can be achieved by uploading the game files on to your webspace and using your phone's WAP capabilities to download them from there. Here's a rough guide describing how to do that.

1) Get MyGame.jar (for example) file
2) Use JADMaker to create a MyGame.jad file if you dont have one (some phones need this)
3) Add MIME types in the directory:
Create a .htaccess file containing these four lines:

AddType application/java-archive                      jar
AddType text/vnd.sun.j2me.app-descriptor   jad
AddType text/vnd.wap.wml                          wml
AddType text/vnd.wap.wmlscript                        wmls

(the wml and wmls types aren't really relevant here though).

4) Upload .htaccess, MyGame.jar and MyGame.jad to a directory of your webserver.

Then you can go to that url using your phone's WAP capability and download the game :)

If you are getting "Item Not Supported" errors then make sure you've done step 3 properly (I was getting them on my sony-ericsson T630 before I did that)

Random Colors in Flash

Want to set something to a random colour in Macromedia Flash? Once upon a time I did, and I found this code which did the trick.

Call changeColor(<target>) to set the color of <target> to a random one

function changeColor(targ)
{
 myColor = new Color(targ);
 myColor.setRGB(Math.random()*0xffffff);
}

How to enable the Fast Reply box by default on Invision Power Board

This article contains a Flash video (193kB) demonstrating how a user can enable the fast reply box by default on Invision Power Board.

How to find the SHA1 hash of a string in Ruby

To find the SHA1 hash of a string, first include the library 'digest/sha1' then use the code below, where 'password' is the string we're computing the hash of.

require 'digest/sha1'
# ...
password = "blah"
sha1_pass = Digest::SHA1.hexdigest(password)

How to use the QueryString in ASP

This article tells you how to pass variables to an ASP page using the QueryString, and how to access them from that page.

Have you ever seen a URL which looked like "www.example.com/page.asp?mode=1&style=red"? Well, this page is being passed variables and their values through the QueryString, here the variables "mode" and "style" are being passed, with values "1" and "red" respectively. The question mark indicates the start of the query string and the ampersand, &, symbol seperates variable=value assignments.

The page is then able to read these variables and react according to them, for example to display them to the user.

Passing a QueryString to a page
There are two ways to pass a QueryString to a page, the first is to enter it manually, for example:
<a href="page.asp?mode=1">Mode 1</a>
The above HTML creates a link to a page passing the variable mode with the value "1".

An alternative, and perhaps more useful, way is to use HTML forms. The main thing to remember with forms is that you need to use the GET method to send information via the QueryString, for example:
<form method="GET" action="page.asp">
Please enter your name: <input type="text" name="username" />
<input type="submit" value="submit" />
</form>
This code displays a simple HTML form with a text box and a submit button. When the user enters their name and presses submit, the information in the name box is passed to a page called "page.asp" (specified in the form's action attribute) via the QueryString. So, if I entered "mooseh" and pressed submit, the form will call page.asp?username=mooseh. Remember that "username" was what we entered as the text input's name attribute.

Accessing a QueryString element in ASP
In ASP, all the information passed via the QueryString is held in the Request.QueryString collection. To access an item, type Request.QueryString("varName"), where varName is the name of the variable in the QueryString.

To demonstrate, let's create page.asp to process the information from the form above:
<%@language="VBScript"%>
<% If Request.QueryString("username") "" Then
     Response.Write "Hello, " & Request.QueryString("username")
   Else
     Response.Write "You did not enter a name."
   End If
%>
So now, me typing in mooseh and pressing submit will generate the reply "Hello, mooseh".

Listing the contents of Request.QueryString
Should you wish to find out everything that's in the QueryString, you can do so with the following code which displays the variables next to their values in a table:
<%@language="VBScript"%>
<table border="1">
<tr><th>variable</th> <th>value</th></tr>
<%
Dim variable
For Each variable in Request.QueryString
  Response.Write "<tr><td>" & variable & "</td>"
  Response.Write "<td>" & Request.QueryString(variable) & "</td></tr>"
Next
%>
</table>

Conclusion
This article showed you how to pass information between pages with the QueryString, and a use which allows you to add some increased interactivity. There are a lot of other uses, for example selecting which section of a site to display based on a variable in the QueryString, and processing form data.

How to Find the Current URL in ASP

The full URL to a page comes in three parts: The domain name, the path to the file then the filename, and the QueryString. For example, take the URL http://www.example.com/example/page.asp?name=Bob. The three parts of this are:

1. The domain name: www.example.com
2. The path to the page: /example/page.asp
3. The QueryString: name=Bob

So how do you find it all out with your own scripts?

Well the following code should do it:

<%@language="VBScript"%>
<%
  Dim strDomain, strPath, strQueryString, strURL
  ' find out the domain:
  strDomain = Request.ServerVariables("HTTP_HOST")
  ' find out the path to the current file:
  strPath = Request.ServerVariables("URL")
  ' find out the QueryString:
  strQueryString = Request.ServerVariables("QUERY_STRING")
  ' put it all together:
  strURL = "http://" & strDomain & strPath & "?" & strQueryString
  Response.Write "The current URL is: " & strURL
%>

Find a visitor's IP Address in ASP

Do you want to know the IP address of a visitor? This can be useful for many reasons, such as tracking site usage or blocking access to specific people. Here's how you can find it.

In an ASP page, within the ASP tags, <% ... %>, you can retrieve the IP address of a user through the ServerVariables collection of the Request object. To do this, you use the code Request.ServerVariables("REMOTE_ADDR").

Display The IP Address
So, if you want to display the IP Address to the user then the following page will suffice:
<%@language="VBScript"%>
<%
Response.Write "Hello! Your IP Address is: " & Request.ServerVariables("REMOTE_ADDR")
%>

Exploring Request.ServerVariables
You might be wondering what other information you can get from Request.ServerVariables, well you can find out with the following script which displays all the variables in it along with their values if set, in a HTML table:
<%@language="VBScript"%>
<table border="1">
<tr><th>Variable</th><th>Value</th></tr>
<%
Dim variable
For Each variable In Request.ServerVariables
   Response.Write "<tr><td>" & variable & "</td>"
   Response.Write "<td>" & Request.ServerVariables(variable) & "</td></tr>"
Next
%>
</table>

Finally, the following code works harder to find the true IP of the user by checking for proxies:
Function UserIP()
 ' This returns the True IP of the client calling the requested page
 ' Checks to see if HTTP_X_FORWARDED_FOR has a value then the client is operating via a proxy
 UserIP = Request.ServerVariables ( "HTTP_X_FORWARDED_FOR" )
 If UserIP = "" Then
     UserIP = Request.ServerVariables ( "REMOTE_ADDR" )
 End if
End Function

Write text on a dynamically generated image using PHP

This tutorial will tell you how to write text to a blank dynamically generated PNG image in PHP. This is fairly simple, so it will just be the first step in a series of tutorials dealing with images in PHP. The image functions require the GD library to be installed.

The code we're using and the output is below, and below that is an explanation of what the code does.
<?
// create an image with width 100px, height 20px
$image = imagecreate(100, 20);

// create a red colour for the background
// as it is the first call to imagecolorallocate(), this fills the background automatically
$red_background = imagecolorallocate($image, 255, 0, 0);
// create a black colour for writing on the image
$black = imagecolorallocate($image, 0