Archive for October, 2005



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
Click here to view the below code as plain text
CODE:

function changeColor(targ)

{

 myColor = new Color(targ);

 myColor.setRGB(Math.random()*0xffffff);

}

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.
Click here to view the below code as plain text
CODE:

require ‘digest/sha1′

# ... then later on ...

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 [...]

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.com2. The path to the page: /example/page.asp3. The QueryString: name=Bob
So how do you find it all [...]

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 [...]

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 [...]

This article will tell you how to write text on an existing PNG image using PHP using PHP's image manipulation functions. The image functions require the GD library to be installed. This article is fairly basic, however some more detail on the basic functions used is included in the article, "write text on a dynamically [...]

Generate a Month Calendar In PHP

This article shows you how to display a calendar for a given month, mainly using PHP's date() function.
The date() function
The date() function displays the date in your desired format, at a given time. It works by accepting one or two parameters, the first is a string with the format, the letters in the string tell [...]




About

You are currently browsing the DiscoMoose weblog archives for October, 2005.

Longer entries are truncated. Click the headline of an entry to read it in its entirety.

Categories

Categories