Archive for the ‘Web’ Category

October 31, 2007 0

Playing a Wav File with a IE CSS Expression

By Levi Senft in Web

Earlier today at Humaniz we were making fun of evil web practices like background sounds and I got the idea of playing a sound in IE using CSS expressions, which are in general another evil practice, although sometimes necessary. After I got this bad boy working in IE I thought I would make it cross [...]

Tags: , ,

October 27, 2007 0

HTML Canvas – Random Lines

By Levi Senft in Web

This is very much the kind of demo you would expect to find in 90s game programming books. The random line generator. It draws randomly colored lines in with random coordinates. Here is the code: 1 <!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN” “http://www.w3.org/TR/html4/loose.dtd”> 2 <html> 3 <head> 4 <title>Random Lines</title> 5 <meta http-equiv=”Content-Type” content=”text/html; [...]

October 12, 2007 2

#include for JavaScript Source Files Using Prototype

By Levi Senft in Web

I’ve seen many posts over the years asking if there is a javascript equivalent to the cc++ #include command, or Java’s import command for including source files. Today I decided to whip one up using Prototype. Check out the demo here. Here is my HTML page. The code for the include statement is embedded at [...]

October 6, 2007 1

Generating a Sine Table With JavaScript

By Levi Senft in Web

I was looking at a C tutorial on Drexel University’s site when I saw an example for generating a sine table. I decided to try adapting this little program to JavaScript. I ended up creating a rudimentary table object to render the data in a HTML table with a caption and header. The calculations use [...]

September 22, 2007 3

JavaScript Include

By Levi Senft in Web

A few months ago at Humaniz we were working on a user interface project for an existing ASP.NET application. As a short cut, some of our developers use PHP includes when building templates to cut down down on the amount of duplicated code during the early stages of development. The client’s developers wanted to take [...]

July 13, 2007 0

Updated CGI Script Troubleshooting

By Levi Senft in Web

I wanted a larger view area for the CGI troubleshooting script. This throws the output into a text area that fills the entire browser window. #!/usr/bin/perl print “Content-type: text/htmlnn”; print “”; print “”; print “”; system (“python MyPythonScript.py 2>&1n”); print”"; print “”; exit();

Tags: , , ,

May 20, 2007 0

Refreshing /etc/hosts on OS X

By Levi Senft in Web

On most UNIX/Linux systems I’ve used changes to /etc/hosts are real time. In OS X you most reload the hosts file. This can be done with a single command rather than rebooting your machine. sudo niload -v -m hosts . < /etc/hosts

Tags: , , , ,

May 16, 2007 0

A PERL Script for Troubleshooting CGI Scripts

By Levi Senft in Web

I started working on a Python program that is hosted on GoDaddy. Much to my dismay GoDaddy doesn’t provide shell logins. I was testing the scripts on my machine, but I don’t have the mysql library installed. When I started to write the database portion of the script I wrote this PERL CGI script to [...]

Tags: , , ,

April 23, 2007 0

Syntax Highlighting for Online Code Snippets

By Levi Senft in Web

Dream Projection’s syntax highlighter script transforms source code in a <textarea> tag to colored code with line numbers. http://www.dreamprojections.com/syntaxhighlighter/

Tags: ,