sources.htm 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <!doctype html public "-//w3c//dtd html 4.0 transitional//en">
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  5. <meta name="GENERATOR" content="Mozilla/4.77 [en] (Win95; U) [Netscape]">
  6. <meta name="Author" content="Daniel Green">
  7. <meta name="resource-type" content="document">
  8. <meta name="distribution" content="global">
  9. <meta name="Description" content="Random useful source code">
  10. <meta name="KeyWords" content="free source code, R-Tree, skiplist, quaternion, intersection test, C++, class library">
  11. <title>Free Source Code</title>
  12. </head>
  13. <body text="#000000" bgcolor="#D8D0C8" link="#0000EE" vlink="#551A8B" alink="#FF0000" background="../slssmall.jpg" nosave>
  14. <center><b><font size=+3>Free Source Code</font></b></center>
  15. <p><font size=+1>Here are a few useful bits of free source code. You're
  16. completely free to use them for any purpose whatsoever. All I ask is that
  17. if you find one to be particularly valuable, then consider sending a brief
  18. thank you note to the email address in the code comments. Enjoy.</font>
  19. <ul>
  20. <li>
  21. <font size=+1><a href="#Java Code">Java Code</a></font></li>
  22. <li>
  23. <font size=+1><a href="#C & C++ Code">C &amp; C++</a></font></li>
  24. </ul>
  25. <hr WIDTH="100%">
  26. <center><a NAME="Java Code"></a><b><font size=+2>Java Code</font></b></center>
  27. <p><font color="#000000"><font size=+1>The links following each Java implementation
  28. show HTML versions of the code with syntax highlighting which were generated
  29. using the <a href="#java2html">Java to HTML</a> utility below. The simpliest
  30. way to download one as a .java file is to view the page and copy &amp;
  31. paste the text from your browser into a .java file.</font></font>
  32. <p><font color="#CC0000"><font size=+1>JarLoader</font></font>
  33. <p><font size=+1>Java class able to load all the jar files in a given directory
  34. containing classes of a given type. It can also be set to continuously
  35. track that directory for new jar files that are added later.</font>
  36. <p><font size=+1>&nbsp;&nbsp;&nbsp; </font><a href="JarLoader.java.html">View
  37. the code</a>
  38. <p><font color="#CC0000"><font size=+1>Component Dependency Handler</font></font>
  39. <p><font size=+1>A small Java GUI utility class. Ever pull your hair out
  40. tracking down why some GUI component is not enabled or disabled when it
  41. should be? Or visible or invisible, etc? Sometimes the rules for knowing
  42. under exactly which combinations of application state should affect a given
  43. component can get quite complicated, and creating listeners with complex
  44. if/else blocks often result which need constant fixing. Well, there's a
  45. better way to manage all those state changing rules. Rather than trying
  46. to figure out all the possible components that might be affected by a given
  47. component state change and trying to set their states directly, you can
  48. create dependency graphs that describe which components are dependent on
  49. which others and then enforce those dependencies through the use of the
  50. ComponentDependencyHandler class. An object of this class represents all
  51. the dependencies of one component's particular state upon one or more other
  52. components. See the description and example code in the source file for
  53. details.</font>
  54. <blockquote><a href="ComponentDependencyHandler.java.html">View the code</a></blockquote>
  55. <font color="#CC0000"><font size=+1>Infinite Binary Tree</font></font>
  56. <p><font size=+1>Here is a good Java example of one important way to create
  57. JTrees. This a tiny Java test program has some surprizingly interesting
  58. behavior. It creates a JTree with an infinite number of internal nodes
  59. and no leaf nodes! Each internal node is labeled with a unique positive
  60. integer such that every positive number can be found if you know where
  61. to look. The basic concept demonstrated is use of the TreeModel class to
  62. display hierarchically structured information that may be huge or expensive
  63. to access--for example, data in a database.</font>
  64. <blockquote><a href="InfiniteBinaryTree.java.html">View the code</a></blockquote>
  65. <a NAME="java2html"></a><font color="#CC0000"><font size=+1>java2html</font></font>
  66. <p><font size=+1>You can find lots of converters by the same name with
  67. a quick Google search on the term "java2html" but most are way more complex
  68. than needed. I weeded through dozens and found this lettle gem which was
  69. small but effective. I did expand on it a bit and think it's quite useful.
  70. Click the following link to see the result of running java2hml.java on
  71. itself.</font>
  72. <blockquote><a href="java2html.java.html">View the code</a></blockquote>
  73. <font color="#CC0000"><font size=+1>Stack Method Extractor</font></font>
  74. <p><font size=+1>This simple yet clever utility contains a static method
  75. which returns the full name of the method a given number of stack frames
  76. above the calling method Click following link to see the code. It's magic.</font>
  77. <blockquote><a href="StackMethodExtractor.java.html">View the code</a></blockquote>
  78. <hr WIDTH="100%">
  79. <center><a NAME="C & C++ Code"></a><b><font size=+2>C &amp; C++ Code</font></b></center>
  80. <p><font color="#CC0000"><font size=+1>R-Trees</font></font>
  81. <p><font size=+1>Straight "C" implementation of Tony Gutman's R-Tree method,
  82. R-Trees provide Log(n) speed rectangular indexing into multi-dimensional
  83. data. Based on his original implementation, I've brought it up to date
  84. with ANCI specifications and added a nice improvment based on sphere volumes.</font>
  85. <p><font size=+1>&nbsp;&nbsp;&nbsp; </font><a href="RTree.zip">Download
  86. R-Tree code</a>
  87. <p><font color="#CC0000"><font size=+1>Skiplists</font></font>
  88. <p><font color="#000000"><font size=+1>Skiplists are fast associative collections
  89. invented by William Pugh. Key/Value pairs are added to skiplist containers
  90. and can then values looked up extremely quickly by key. The implementation
  91. is based on a fairly generic one originally in "C" by Bruno Grossniklaus
  92. which I converted into a C++ class library.</font></font>
  93. <p><font color="#000000"><font size=+1>&nbsp;&nbsp;&nbsp; </font><a href="SkipList.zip">Download
  94. SkipList code</a></font>
  95. <p><font color="#CC0000"><font size=+1>Quaternions</font></font>
  96. <p><font size=+1>Implementation of a simple C++ quaternion class called
  97. "Squat". Popularized by a seminal paper by Ken Shoemake, a quaternion represents
  98. a rotation about an axis.&nbsp; Squats can be concatenated together via
  99. the </font><b><tt><font size=+2>*</font></tt></b><font size=+1> and </font><b><tt><font size=+2>*=</font></tt></b><font size=+1>
  100. operators and converted back and forth between transformation matrices.
  101. Implementation also includes a wonderful 3D vector macro library by Don
  102. Hatch.</font>
  103. <p>&nbsp;&nbsp;&nbsp; <a href="squat.zip">Download Squat code</a>
  104. <p><font color="#CC0000"><font size=+1>Polygon-Cube Intersection Testing</font></font>
  105. <p><font size=+1>"C" implementation of an extremely fast and robust polygon-cube
  106. intersection test by Don Hatch and myself as published in Graphics Gems
  107. V. Very useful for collision detection and view frustum visibility checking.</font>
  108. <p>&nbsp;&nbsp;&nbsp; <a href="README.TXT">View the readme file</a>
  109. <br>&nbsp;&nbsp;&nbsp; <a href="pcube.zip">Download PCube code</a>
  110. <br>&nbsp;
  111. <br>&nbsp;
  112. <br>
  113. <br>
  114. <center>
  115. <p><a href="../index.htm">Back to the Superliminal home page.</a></center>
  116. </body>
  117. </html>