Results 1 to 7 of 7
  1. #1
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,306
    Rep Power
    25

    Default Cleaning out the closet

    Hi all,

    I've written dozens of utilities over the years. Some were controls to enhance missing features in AWT, some to help with various projects. Most were written while I was learning Java and OOP. Many features were added in an Ad hoc fashion to solve a current problem. They look like they were: Put together with wire and bandages and glue.
    I'd like to share them so I've uploaded some of them to a site and have a link page: All files on my Google site
    You'll find my email address in the Help for some of the executeable jar files.

    Since I'm as lazy as the next guy, I've only minimally documented these programs, just enough to refresh my memory on how to use them.

    If anyone would take some of them and add a Swing frontend, I'd appreciate it. GUI is not my thing.

    There are some programs that may be useful to other at-home developers. I'll try to describe them a few at a time.

    SearchFiles -
    I have a dial-up connection. Doing searches online is often slow and painful. I have downloaded several sites to my PC that I want to be able to search. For example a forum used by sailboat owners that discussed maintenance problems and solutions. Some of these sites have 1000s of records. The site search is often simple and not complete. So I wrote my own.
    Also I have the java Tutorial and API documents on my PC that I can search.

    My search has some boolean logic for the search arg. It returns a page to the browser with links to the found pages. I've also changed the search page that is refered to by some of the downloaded html pages to use an applet version of the search program. So if I'm reading the Java tutorial and want to find all references to say DocumentListener, I can go to the seach page, do a search of the tutorial pages and then look at the results all in the browser. Those on hi-speed direct connections wouldn't see a use for this. It might be useful if you only want to search the Tutorial pages, and not the whole site. Another feature is that the links from the Tutorial to the API doc can be satisfied on my PC by using my HTTPServer as a proxy server. My server has a "redirect" table that will intercept outgoing GETs for a site and satisfy them from a local file. Another feature that I never got finished was the FileIndex file. Searching 80K files took too long, so I wrote a scan program that read the files one time and create an index file with keywords and references to where they occured. The Search program would use the index to find the files vs actually reading the files. Its a "work in progress".

    If there's any interest, I'll post more.

    Norm

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,306
    Rep Power
    25

    Default ExecuteJava and JarServer

    Some more stuff:

    ExecuteJava -
    This program executes other java programs in a single JVM. It uses a ClassLoader to implement the classpath and a Security Manager to keep System.exit() from killing the JVM.
    My previous PC had a 300Mhz processor and 64M RAM. Loading a java program took seconds. If I was using more than one program they each required load time and used space. So I wrote a program to allow more than one java program to execute in the same JVM. It saved jvm startup time and hopefully used less system resources by sharing the same jvm. I have yet to see one program interfer with another. The jar file and my .ini file are in the index page mentioned above.
    The source is in a zip file: ExecuteJavaSource.zip on the page mentioned above.



    JarServer -
    I've downloaded dozens of websites so that I could search them when not connected to the internet. (I traveled on a sailboat for 6 months of the year and wifi has its limits). Some of these websites are of interest to other sailors and I wanted to be able to share them with the simplest interface. I could zip the files and give the zip file to the other sailor, but would require that he have a unzip program, know how to use it, how to find the files when unzipped and know which page was the starting page to open the site. Too complicated for many PC users.
    My idea was to put all the files into a jar file with an HTTP server and search. The user would open the jar file, it starts the server, starts the user's browser with a URL back to its server and when the browser did a GET to the URL, it would display the start page for the site. The rest of the session would appear to the user as if he were connected to the internet, ie links would issue GETs to the server and it would return the requested page, etc.
    I gave several copies of these jar files to friends and found that they worked first time on a Mac. With Windows, I often had to fiddle something to get them to work.
    The source is in a zip file: JarServerSource.zip on the page mentioned above.

    Norm

  3. #3
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,306
    Rep Power
    25

    Default

    Still more stuff:

    CheckClassRefs.jar - Searches jar file contents starting with the Main-Class: class for referenced classes and further referenced classes to insure that all referenced classes are in the jar file. Also lists unreferenced class files.

    CkClasspath.jar - This program will read a class file, get its package path and checks if the class file can be found on the classpath.

    CmprFolders.jar - Compares the contents of two folders/subfolders and will copy selected files from one to the other. Windows only. I use this to backup my java source files.

    FindClass.jar - Searches the classpath for a class or package. Paths can be added to the classpath it searches.

    FindConnectSpeed.jar - Times the reading of a file from a site. I've uploaded some 100K files to different sites to use with this program.
    GetURLText.jar

    ShowClassInfo.jar - Read a class file and display its methods.

    Norm

  4. #4
    serjant's Avatar
    serjant is offline Senior Member
    Join Date
    Jun 2008
    Location
    Ukraine,Zaporozhye
    Posts
    487
    Rep Power
    7

    Default

    Very nice,i tried almost all of them,i liked very much the Search application.Adorable!!!

    Were Gui applications made with AWT?I assume that yes,according to their appearance at the first glance.

  5. #5
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,306
    Rep Power
    25

    Default

    Yes, these are all AWT. Many written when Swing was first coming and was VERY slow on my slow computer. So I wrote my own controls. Once a program is working, I rarely go back to update it.
    As I said before, I don't worry much about GUI.

  6. #6
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,306
    Rep Power
    25

    Default

    About the last of the stuff:

    HTTPServer -
    I copied and enhanced this server and have found it very useful in learning how a server works.
    There are 4 files listed on the site referenced above. The following page tells more about it:
    Norm's HTTP Server


    GPSDevComm.zip & WayPointAppsSource.zip -
    These files contain the working program and its source. These programs were developed to manage the waypoints I've collected over the years while sailing in various location. They can upload and download waypoints to the ICOM GPS and some Garmin GPSs. They can convert waypoint files from one format to another to allow you to view them in different navigation software.

    Norm

  7. #7
    presh4u Guest

Similar Threads

  1. code for cleaning variables?
    By Ak-Emm in forum New To Java
    Replies: 13
    Last Post: 08-22-2008, 02:40 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •