digitalFilament.net

Code Snippettes

 

I can't make any claim regarding the functionality of a given piece of code. Use at your own risk. If you do something stupid, don't whine at me.

On the other had, if you have a question about some code drop me a note.

 

perl || java || javaScript|| c/c++/c# || pascal

 

Perl

My favorite language.

I have finally reached a point where I am comfortable programming in perl. Now, when I approach a problem I don't wonder 'if' I can solve the problem with perl, just how. Then again I have a fairly high standard for 'comfortable'. I have been programming in perl for more than 12yrs. I know I don't know everything, but I do know where to find the answers to my own questions.

 

Java

I am fairly new to Java. I have been around it for years, fixing buggy code and installing it into web sites, but I have never really learned enough to code something useful in the language. That is changing.

 

JavaScript

With JavaScript, I think it is easier just to show you the working code snipettes, then you can look at the source and see what is happening. I have more than a few book on DHTML and JavaScript, so some of this code comes from those sources, while some of it is mine, the rest I found on the net.

A word on copyrights.
A lot of people will 'copyright' their javaScript. I don't. US Copyright law basically states that code/software can not be copyrighted, if a function can be created by any reasonably skilled programmer. For example: How many people have written date stamps? Thousands! I have 3 or 4 of my own that I wrote from scratch to do some weird little formatting trick. Another example, is the rotating images script below. I wrote it to moves 9 images at once, linking a rolling image to the correct alt tag and url. Can I copyright my code? 'No.' If you have half of a brain, you could have written any of this code yourself, but the point is to SAVE time and effort. Take this code. Learn from it. Use it! Send me a note when you get it running.

Image Stuff:

Games:

Utils:

 

C/C++/C##

C was the second language I learned in college. Since then I have taken classes in C++. After I learned a bit of Java, I have started coding C## in the Visual Studio.net ENV.

 

Pascal

The first language I learned in my college programming sequence

Does anybody actually use this language any more?!??

I suppose what is most amusing was what we programmed in college. Criuse Missle Guidence software. One of the grad students had a grant to work on guidence software. Of course, this became 'needed' knowledge. So we, the coding noephytes, read in altitude maps, converted them into binary representations, and massaged the data. The result was usable map, just pick you low-level flight path based upon the output map.

I looked around for my old code. I think it has disappeared somewhere in all of the moves and code purges since college. It still might turn up, but who really needs code from an entry level programming course... Maybe, entry level programmers? We all started there once upon a time.

I found some code buried in the back of my closet on a couple of floppies during my last data purge. No promises as to quality or actualy usefulness.

Pascal Plus Data Structures, Algorithms, and Advanced Programming All of the below code comes from Pascal Plus Data Structures, Algorithms, and Advanced Programming. The code is actually from an older version of the book, but it should work the same. To be totally accurate I have two copies. The 1991 version and the 1995 version, which is the cover you see here. 2 classes, 2 books. Yes, I had to take a full year of Pascal, before I was allowed to learn anything useful, like C.

 

 

__END__