ciplogic.com
Live with grace. Write superb software.

Found this gem while reading the documentation from good ol' vim:

   What Vim calls true is anything that is not zero.  Zero is false.
        Note:
        Vim automatically converts a string to a number when it is looking for
        a number.  When using a string that doesn't start with a digit the
        resulting number is zero.  Thus look out for this:
                :if "true"
        The "true" will be interpreted as a zero, thus as false!

First language that I know of, where checking references to stuff actually return false.

Start Cygwin as an Administrator, and then run:

# ssh-host-config -y

Follow the instructions on the screen.

Finished.

Because in it I can alias things, for example:

1
2
alias idle='PYTHONPATH=`pwd` idle'
alias python='PYTHONPATH=`pwd` python'

This allows me to run python in a folder of my choice and having it instantly available in my python path.

Neat.

This is so I can have python modules in a decent hierarchy.

Do you know why you would name a configuration object „o”?

Because then you can write this:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
    /**
    Applies a new configuration object to the config of this YUI instance. This
    will merge new group/module definitions, and will also update the loader
    cache if necessary. Updating `Y.config` directly will not update the cache.
 
    @method applyConfig
    @param {Object} o the configuration object.
    @since 3.2.0
    **/
    applyConfig: function(o) {
 
        o = o || NOOP;
 
        var attr,
            name,
            // detail,
            config = this.config,

Personally I would have preferred:

1
    o= !o ?NOOP :o ; // note how many emotions are bundled in this code.

But it looks amazing anyway, that o=o is looking straight into my developer soul.

From here: https://github.com/yui/yui3/blob/master/src/yui/js/yui.js 

PS: Why else would someone name an object variable "o"?

Disqus Comments

comments powered by Disqus

Germanium

The one to rule them all. The browsers that is.

SharpKnight

SharpKnight is an Android chess game.

MagicGroup

MagicGroup is an eclipse plugin.