Hacker Newsnew | past | comments | ask | show | jobs | submit | reconor's commentslogin

Using var to declare a variable later assigned to an anonymous function can help with managing larger JavaScript projects where scoping and data member access is important. Here is a pattern I tend to apply rather frequently, included is an example for a custom instance object, which would be created with 'new', and a Namespace object:

    var MyObject;
    (function() {
      var staticPrivateVariable;

      MyObject = function(opts) {
        // Do Initialization Stuff
      };

      MyObject.prototype.publicInstanceFunction = function(opts) {
        // Do instance stuff
      };
    })();

    
    var Namespace;
    (function() {
      var staticPrivateVariable;

      Namespace = function(opts) {
        // Do Initialization Stuff
      };
      Namespace.publicFunction = function(opts) {

      };

      function privateFunction(opts) { 
        // Do some private stuff
      }
    })();


First off, extreme kudos to the original developer, and to nerget.com for implementing the algorithm. I'm curious how the display seems to be able to maintain a sense of a gridspace inside of a single text "p" tag. I need to look into that a bit more.

Secondly, I couldn't resist playing around with this a bit. I added a few UI components - allowing the user to change the ascii characters used, the color of the text, removes the dialog box after a period of time, and binding the clear feature to the space bar. All of which I felt like made it a little more fun for me to play with in full-screen mode.

Here is a link to my modified version for fun: http://www.johnmick.net/fluids/


Awesome! I love how you kept the SICP quote intact; that is essential.


Your life is essentially a series of experiences unfolding in ways you are likely to never predict with any reasonable degree of accuracy.

Steve Job's graduation commencement speech touches on this idea of being unable to "connect the dots in your life" forward, one can only do it retrospectively. It is a keen observation and is certainly worth listening to: http://www.youtube.com/watch?v=D1R-jKKp3NA

Try and minimize the amount of time you let your mind spend regretting a decision you made in March and focus more on looking forward and taking the next positive step in your life.

You are only 20 and are bound to make many more decisions that you may consider to be a mistake in the short-term, but you have no idea how your life will ultimately unfold.

What you once considered to be a mistake could turn out to be a great decision, even if it only serves the purpose of teaching you some lessons to grow yourself further.

Kudos on your bravery to take a risk, I'm sorry to hear it isn't working out at the moment but I assure you it is totally within your domain of influence to change things around for yourself and realize new opportunities.

Just take it one step at a time and try and frame the experience as simply an opportunity to grow through a challenge.

I read edw519's comment and he is certainly right, we do care and things are never as bad as they may seem.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: