Monday, November 17, 2014

Changes Weekend 11/14 to 11/16

Java:

  • Fixed the problems I was having with getting different counts in different Pythagorean Triples algorithms run on the same data set.  What I realized was that the non-hash algorithms would count a Pythagorean Triple for each valid C value if there was more than one, while the hashed algorithm would not.  For example, in the set {3,4,5,5}, the O(n3) algorithms would find 2 triples in this set, while the hashed algorithm would find one.  To remedy this, I set the O(n3) algorithms to break once a C value had been found.
  • Created a program that tests the average run times for various implementations of the Pythagorean Triples program with n=1000
  • Timings:
    Strategy UMD solution: 115 ms.
    Strategy UMD solution with Math.pow: 984 ms.
    Strategy UMD solution with pre-squared array: 78 ms.
    Strategy pre-squared with hash: 6 ms.
  • The accuracy of this measurement could probably be improved if I had used something more accurate than System.currentTimeMillis(), but as it is it illustrates how much faster using a hash is than any other implementation.

Web Design:

  • I made a website over the weekend: tommywiseau.github.io
  • It's a tribute to the movie The Room, written and directed by Tommy Wiseau
  • It's essentially like a soundboard, but for videos.  Left clicking one of the video buttons will play the video, and right clicking will toggle looping on the video.
  • If you click Tommy Wiseau's face in the top left, it plays a recording of one of the many times Tommy Wiseau laughs awkwardly.
  • If you don't like hearing bad words, make sure to click the "toggle NSFW" button!
  • Additionally, if you want to be taken on a magical cinematic experience, press the "Play all" button.

1 comment:

  1. Wow! This is a fantastic post, Mr. Hirschberg! On the Java side, you are taking time to investigate deeply the inner workings of a problem. You are getting to know it really well. Your ability to take a problem apart and put it back together like this will serve you in lots of ways in the future.

    On the web design side, you have provided Jack, Dylan and me with our case study as we begin to learn about multimedia in HTML5. I hope you don't mind if we come to you with questions once we get this far.

    ReplyDelete