opyate
coding until dawn since 1995.

Javascript Breadcrumbs, or YouAreHere script

I refrained from calling this "breadcrumbs" because "breadcrumbs" is the trail you took to get where you are (Remember Hansel and Grettle?). YouAreHere shows your location on the site regardless of how you got there. I don't want to re-implement your browser's history feature, or the Back button - I just want to show you where you are on a page.

Assumptions

This script assumes you use the following convention for your site:

/a/index.html
/b/index.html

instead of:

/a.html
/b.html

Thus, you should have a "landing page" configured like index.php or index.html which is what a client would see when going to a directory on your server. The script chops the landing page string off the URL string to make the script easier. This make this script "index-based" I guess.

Will it work on an old browser?

Compatibility, Javascript String methods:

This script should be Javascript1.0 compatible and run on ancient browsers. Please let me know if you find any other pitfalls.

I also thoroughly tested document.getElementById and document.all when it comes to updating the YouAreHere tag on the client side. Note document.layers is implemented but untested.

Download

Download version 0.1: youarehere-0.1.js (7911 bytes)

Under development: I'm adding an array for the user of the script to specify "nice names" instead of the directory names, and I'm also toying with doing something usefull with anchors in the URL string.

DB Bean Creator for Java and MySQL/PostgresQL

When you have finished designing your database, you start to code the beans to interface with it. Making changes to the DB means making changes to the beans. This is time consuming and costly.

The DB Bean Creator looks at your database (PostgresQL and MySQL are currently supported) and creates all the beans on the fly.

Hibernate does this too, but is too hard-core and bloated for my liking. When I developed the original script early 2002, I doubt Hibernate was around.

What to do

Basically, create an HTML page with the following form (ignore the class attribs, and put your own defaults in).

The servlet should be compiled and put in a servlet container (like Tomcat).

Also, put this into your app. It's some oooold DB persistance stuff someone devved years ago. It hasn't been updated since 2001, but I modified it a little to fit my script.

When you submit the form, the servlet will spew out bean code, and/or create the sources as specified.

All of it

dbbeancreator.tar.gz (23,778 bytes)

Happy coding. I hope this shaves hours off your dev time too :-) Now you can get the DB schema perfect, and adapt the code on the run.

Future developments:

  • Tag libraries to utilise the beans
  • JUnit tests cases to keep management happy
  • Get the servlet to work with newer/better persistance libraries

WebTV

This project failed miserably. Imagine a modern-day MPEG being decoded by a 25MHz 386 PC. Painfull. Well, that exactly what this project does for the modern computer (1.7GHz Pentium M).

Basically, I tried to emulate a video monitor by drawing web-based pixels on the screen. A pixel can be either:

  • a DIV tag
  • an IMG tag with a 1x1 GIF, and you'd need 256 individual GIFs for this (or more)
  • a SPAN tag containing a character with HTML code 9606 which yields a little square like this: ▆

The aim was to convert an MPEG movie into a Javascript array so that anyone with a Javascript web browser can watch a clip from anywhere. They wouldn't need any plugins.

Before I came to that part I did some tests on the WebTV. I tried to write random arrays to the WebTV to see how fast it can draw. Here are the findings for a tv with 7 548 pixels:

Anyway, the tv can be seen here happily drawing random pixels [EDIT: this doesn't work on IE]. Maybe the code can be optimised some more, or the Javascript engine for Firefox 1.0.2 can use a bit of tweaking, in my case. Either way, on to the next project for now.

WebHelper

Some intranet applications (and some unintuitive web applications) can be confusing at times regarding navigation and how to get a task done. Training can be expensive.

WebHelper is a tool with which you can pre-record mouse movements, clicks, and the related help-text.

Imagine going to a page with a workflow you're unfamiliar with. You click the WebHelper icon in the corner, and the page comes to life: a white section appears at the bottom or top of the page, and it populates with text as the cursor takes on a life on it's own and shows you where the first button is which you have to press. Or something like that. It's kinda like that utility with which you can create an AVI movie of a session. In this case it will be Javascript-based, and no costly and time-consuming movie downloads.

Latest News on WebHelper

I have the engine ready with which mouse movements and clicks can be recorded. Currently working on the event engine.