The Lab @ onesandzeros.biz

This is where I store my experiments and notes on web and application development in PHP, JavaScript, Flash/ActionScrip, MySQL and other programming languages and environments.

I've only just gotten all of this up and I'm already getting requests to put articles here with code snippets and explanations for implementing these ditties in your own code. So, I'll start working on that right away. For now, please be patient. I can only write so fast.

Get Your User Agent String

Here is what your browser tells me website about itself:

  • User-agent: CCBot/1.0 (+http://www.commoncrawl.org/bot.html)
  • Referer: came here directly
  • Your IP: 38.107.191.96

JavaScript Experiments

Fly-out Dictionary/Spell Check

This one is kinda cool. It makes use of my little AJAX class that I call, "XHR" (short for XMLHTTPRequest) (what I firmly believe AJAX should be called, but that's another story). It also uses my JavaScript library of random yet useful functions.

Press of the enter key, a list of some of the most closely matching words for the one you're typing will appear in a drop-down thing below the text field. The words are called up from a 130,000 word dictionary in a MySQL table based on the soundex code for the word you type. Then, before display, the words are sorted by the Levenshtein value. This makes the words most similar to the word typed appear toward the top of the list.

Dynamic Tables in JavaScript

This is just a simple experiment in building and modifying HTML tables in JavaScript. Pretty simple. It uses a few experimental libaries I've built. Tinker with it.

Image light box in JavaScript

This experiment pops up an image over the main page and makes it go away when you click on it.

Drag and Drop Experiment in JavaScript

The three boxes can be dragged around freely or under restriction. Kinda groovy. I adapted some code I found around the Internet to be more OOPy and to work better with my own libraries.

Regular Expressions Testing

I wrote a handy little page that allows you to test your regular expressions with ease.

If you do any sort of parsing of reasonable amounts of data, you will probably benefit from regular expressions. Whether you're using PHP, JavaScript, ActionScript, C, or whatever, you can rapidly bust apart and search through chunks of text using regular expressions. Simple "regex" code can tear through and organize strings of data so easily, if you haven't been using regex, you'll kick yourself for not doing it sooner.

Flash and ActionScript (coming soon...)

Interactive Flash Grass Plushy Grass!

This was a prototype for a friend's Yoga group in southeast Michigan. "Brush" your mouse over the grass to see it work. Each blade is a unique and individual entity that responds to the mouse as it moves by. Try different settings to rearrange the gass blades. Resize your browser window to stretch out the blades from left to right. Fun. Neat.

Flash and Actionscript particles Particles

This little experiment was originally intended to be used on a client's site. It was the engine that drove the sparks when a metal plate was cut out of the page. It worked very well, so I made it more modular and object oriented.

Flash directional cursor follower Flash Cursor Direction Geometry Demo

I'm not sure exactly how I wound up writing this experiment, but I think it has something to do with the repulsive dots demo (if it isn't up right now, it will be soon). Basically, geometry formulae for distance and direction make the pointy thing rotate in the direcion of the movement of the mouse cursor.

Complimentary nuts in Flash Complimentary Nuts

Have some complimentary nuts. They're delicious and friendly and a bunch of ass-kissers. This serves no other purpose than to be silly. I recorded voices for the nuts, but haven't taken the time to apply them. It's much cuter when you hear their voices.

Customizable loader Flash spinner Loader Spinny Thing

This is a quick and easy and easy-to-customize preloader or wait spinner. You can use any SWF or image you like to put inside the spinner. You can adjust the spin rate, as well. Kinda fun.

Customizable Thermometer in Flash Flash Fundraising Thermometer

I did this for my buddy, Dan. He's trying to get a dollar from a million people. He wanted a dynamic thermometer to show no his website where he stood in his quest for a million dollars. Stop by his website and give him a buck. Then maybe he'll pay me for making his thermometer. I kid.

Random Quotes

Coming soon...

Solution Graphics