Saturday, October 29, 2011

Retro Posts from the Homebrew Blog

These are posts from my homebrew blog.  I eventually did setup an RSS feed, but I think using blogger is safer and more attractive.

Gusso
'OSD600'
All good things
Last editied by Gusso at 12:00 am on November 30, 1999I guess if all good things must come to end—they must also start somewhere too. This is Gus' blog and my repository for journaling throughout OSD600 this semester.


Email me:    
            School (amcrawfo@learn.senecacac.on.ca)

        
            Gmail (crawford.gus@gmail.com)
Licensing Hijinx
Last editied by Gusso at 3:13 pm on September 09, 2011Yesterday, we had an interesting discussion about different generic software licenses and how they constrict; either your software, you or people that might want to develop your work further.


I read two licenses:
::The Microsoft EULA for Windows XP
::The famous "GPL".


A few things struck me about the Microrsoft agreement:
a) You can own the rights to use software, but you are prohibited from using the software on any more than one of your own machines at one time.
b) You can use the software to provide a public service, but you cannot provide a commercial service or make money from it.


Likewise the GPL had some interesting points:
GPL was described by Mr. Humphrey in one sense (non prajoritively) as "viral". I have to agree with him. Because of the nature of "free" software it can become difficult to use open source components in a closed-source project. There is a whole section that deals with patents and court-ordered conditions. I'd imagine a team of people could write open-source software, and one of those members could say apply for a patent?
Let's Git'er Done!
Last editied by Gusso at 2:56 pm on September 27, 2011Well everyone's probably been more active on the blog than I have, I really enjoyed the last class and the lesson on git, which seems to be a powerful tool.


I have since signed up at git-hub and also found a helpful tutorial there.


I have downloaded the gladius source, did a custom build of node.js, and I'm busy trying to figure out what it's all about at the moment. I would like to make more freaquent, and shorter blog posts in the future.
My First Commit and GL Context
Last editied by Gusso at 8:01 pm on September 30, 2011First off, I have been taken aback by the power of GIT. It is the ultimate programming tool and I can't beleive I've only found out about it now.


I've been busy tracing through and fiding out more about how palidin (gladius) works and how the end-programmer will use paladin to create a game. I've been busy exploring through Alans demo game to try and get a perspective (https://github.com/alankligman/paladin-demo) on this as well, and I've submitted my first stab at solving issue 26 (https://github.com/alankligman/gladius/issues/26) and providing a WebGL context for gladius games to run in.


The original gladius (formerly paladin) can be found at GitHub : https://github.com/alankligman/gladius


And my fork and commits are available here: https://github.com/GUSCRAWFORD/gladius


As for the ugliness of blog, I actually already had a half broken blog that I want to use professionaly, as well as for a 'guinea-pig' of sorts for my open js library LOUI which you can find athttps://github.com/GUSCRAWFORD/LOUI
Object Oriented and Polymorphic JavaScript: Intro
Last editied by Gussoat 12:44 pm on October 04, 2011This is just a fun post about javascript and a fairly broad discussion of object-orientation. Throughout looking deeply at programmer's code in javascript recently, I've become surprised that I haven't seen more polymoriphic object design and implementation. Although JavaScript is functional in nature, and objects are changeable on the fly and everythings very free form, there is a lot to be said for object oriented principles, and if you get used to the way it works in js, you'll save yourself a lot of time and write simpler programs (in my limited experience).


I want to talk about object oriented javascript over more than one post, and for this post, I'm going to essentially describe writing a class in JavaScript, which as you will find out, isn't something you can actually do.


So how do you write a class? In classical objective languages, you write class Foo { .. } and you have a cookie cutter definition for the instance of an object. JS is actually similar, but just totally different. Let's start with an object. Animal. Lets give it a method and property.


In C++ or Java, you might write:
class Animal {
public:
    Animal(double weight) {
        // Constructor
        this.weight = weight;
    }


    double weight;
};


Let's write this class in JS:
Animal = function (weight) {
    // Constructor
    this.weight = weight;
};


You might be kind of mystified by this if you've never explored objective js before. It just looks like a function. A routine that takes an argument, stores it, and returns nothing. But that function, is the 'class' definition. Observe this line:
rover = new Animal();


This could be a pointer or reference assignment in a lot of languages, but it also holds in JavaScript. In fact, when you use the word 'new' in JavaScript before invoking any function, it's function scope will be returned as an object to the reference you assigned it to.