Open Source Creative Code Frameworks

What follows is a list of open-source creative code frameworks which can be used to develop your own projects.


Language: Processing, Java



Open Frameworks
Language: C++



Cinder
Language: C++



PyGame
Language: Python



PolyCode
Language: C++



NodeBox
Language: Python




Field
Language: Python

Want more? Check out http://hackingforartists.com/


"Set Fire" to the Processing.js Rain using Popcorn.js


Set Fire to the Processing.js rain with this little project made with Processing.js and Popcorn.js. All you have to do is press play on the YouTube link, and when Adele sings the chorus, the raindrops turn to "fire".

What's That Programming Language?

Test your knowledge of coding languages with "What's That Programming Language". Warning: This is very hard. :)

http://wtpl.heroku.com/

Makey Makey : An Invention Kit for Everyone


MaKey MaKey: An Invention Kit for Everyone

Alligator Clip two objects to the MaKey MaKey board. For example, you and an apple. When you touch the apple, you make a connection, and MaKey MaKey sends the computer a keyboard message. The computer just thinks MaKey MaKey is a regular keyboard (or mouse). Therefore it works with all programs and webpages, because all programs and webpages take keyboard and mouse input.


The back of the board has hookups for 6 keyboard keys, and mouse control. It also has the open hardware logo, a link for help getting started, and an area for using the board in Arduino mode.

http://makeymakey.com/
on kickstarter: http://www.kickstarter.com/projects/joylabs/makey-makey-an-invention-kit-for-everyone

A GameBoy Color emulator written in JavaScript and uses HTML5




This is a GameBoy Color emulator written in JavaScript. This page takes advantage of modern browser capabilities like HTML5 and JIT engines to provide a desktop emulator experience right inside a webpage without the use of plugins
You can either select a game from a list, or drag and drop a .gb or .gbc file into the emulator.


The Toolbox. A collection of the best time-saving apps, tools, and widgets from around the web.

TheToolBox.cc

Setting up Processing with Eclipse

For this tutorial, we will be using the Eclipse 4.1.0 SDK (download), and Processing 2 Alpha (download). Follow this tutorial on on Processing.org that steps you through this process: Processing in Eclipse.
Using Processing from Eclipse gives you access to Processing as a class, allowing you to code in Java and create native Java applications.

Link Dump Monday!

Do the FizzBuzz problem with CSS
http://dabblet.com/gist/2628265

I only know PHP. How do I write a Web application in Python?
http://me.veekun.com/blog/2012/05/05/python-faq-webdev/

Create a beautiful and professional resume in minutes
http://www.resumonk.com/

Codeable Objects is a library for Processing that enables novice coders, designers and artists to rapidly design, customize and construct an artifact using geometric computation using geometric computation and digital fabrication
http://hlt.media.mit.edu/?p=2254

CSS Cheat Sheet
http://www.pxleyes.com/blog/wp-content/uploads/2010/03/css-cheatsheet-portrait.pdf

Using CSS 3d to make every website into 3d
http://www.edankwan.com/lab/3dit

Quine Computing
http://en.wikipedia.org/wiki/Quine_(computing)

RayTraced Checkerboard done with a single line of Javascript (Demo!!)
http://www.p01.org/releases/128b_raytraced_checkboard/128b.htm

Flipboard-inspired Javascript library to emulate turning pages
http://tympanus.net/codrops/2012/05/07/experimental-page-layout-inspired-by-flipboard/

Ascii Text Generator in Javascript
http://www.patorjk.com/software/taag/

Make old-school lakes with the Javascript "Lake" library
http://alligator.github.com/lake.js/

Creative Javascript Frameworks and Resources

There are many JavaScript frameworks developed for your use. Typically a framework is produced with a specific use-case in mind, so before utilizing one for your own project, it helps to understand the intentions of the framework beforehand as it will make it much easier to integrate into your own work.

Frameworks




Popcorn.js - HTML5 Media Framework: http://popcornjs.org/

Three.js - A WebGL Framework: http://mrdoob.github.com/three.js/


Createjs - A suite of javascript libraries for rich HTML5 content creation: http://createjs.com/

Batman.js - a microframework: http://batmanjs.org/

Agility.js - a microframework CMS: http://agilityjs.com/

Deck.js - a presentation framework for slideshows: http://imakewebthings.github.com/deck.js/

Sprite3D.js - a framework for 3D sprites : http://minimal.be/lab/Sprite3D/


Blogs and Resources

Creative JS - Creative uses for Javascript: http://creativejs.com/
StackOverflow Javascript Questions/Answers: http://stackoverflow.com/questions/tagged/javascript

Link Dump Monday

CODE HERO, a videogame with a coding game-mechanic
http://primerlabs.com/codehero

0x10c, a "hard sci-fi" game where players code their own 16bit CPU for their in-game space ship.
http://0x10c.com/

Github adds future syntax-support for 0x10c code
http://www.theverge.com/2012/4/11/2940765/github-0x10c-code-support-minecraft-notch

Blog post on using github as a development tool by Randall Degges
http://rdegges.com/successful-github-development

"A baseline for Front-End Development" by Rebecca Murphey
http://rmurphey.com/blog/2012/04/12/a-baseline-for-front-end-developers/

Meteor - a "ultra-sleek" javascript framework and toolset for building modern websites.
http://www.meteor.com/main

TMUX tutorial on how to accomplish pair-programming on a single file through the terminal (advanced)
http://reefpoints.dockyard.com/ruby/2012/04/10/tmux-for-fun-and-profit.html

25 Best-Practice Javascript tutorials for beginners
http://net.tutsplus.com/tutorials/javascript-ajax/24-javascript-best-practices-for-beginners/

Setting up Git and a Webserver

How to set up your username and email for GIT
$ git config --global user.name "Gabriel Dunne"
$ git config --global user.email "my@email.com"

Serves the current directory at http://localhost:8000
python -m SimpleHTTPServer

Functional Programming with Javascript

To introduce ourselves to functional programming with Javascript, we must first examine what functional programming means. It's another paradigm of programming, just as is Object Oriented Programming. Functional programming means your code is "stateless", and emphasizes that use of functions. Programming in a functional style can also be accomplished in languages that aren't specifically designed for functional programming, just as programming with OOP can be accomplished in languages that aren't built upon OOP concepts. Javascript, for example, is a functional language, but it is possible to execute a sort of quasi-OOP method which mimics how things are done in Java or C/C++.

Although most people are familiar with Javascript as a language native to the web, it can be utilized for many purposes, for web applications, server-side processing, and local, standalone applications.

Javascript is a non-strict, non-typed language, meaning that we don't define strings, characters, ints, and floats as separate variable types. We declare everything as a "var" or a "function".

A good starting point is understanding how functions can be assigned to variables:
var addition = function(num1, num2) {
    return num1 + num2;
}
var addMe = addition(50, 20); // addMe gets set to "70"
console.log(addMe); // log to the console to check

Notice how "addition" is defined as a "var", and it is a function. We can use Javascript's built-in "typeof" operator to see what kind of var "addition" is after defining it.

console.log(typeof addMe); // returns "number"
console.log(typeof addition); // returns "function"

We can also pass functions as parameters to other functions.
var myEvent = function(value, callback) {
    callback(value);
}
var myCallback = function(input) {
    console.log(input + " World");
}
myEvent("hello", myCallback); // will print "hello world" to the console.

To further our knowledge of functional programming with Javascript, read this excellent series of articles published by Dominic Charley-Roy originally posted in March 2012.
A Gentle Introduction to Functional Programming
A Gentle Introduction to Functional Programming (Part 2)

Another introduction written by Srirangan
Functional Programming in Javascript

Stackoverflow is an excellent resource for getting language-specific questions answered, and just learning in general
Stackoverflow questions tagged with Javascript

Mozilla's Javascript Reference
Javascript Reference

For reference of Javascript in relation to the HTML DOM
W3Schools

Drawing Graphics With HTML5

This post will get us familiar with drawing to an HTML Canvas element.
<!DOCTYPE html>
<html> 
    <body> 

        <!-- canvas DOM element -->
        <canvas id="myCanvas" width="500" height="400"></canvas>

        <!-- embedded javascript that comes after the element -->
        <script language="javascript"> 
        
        // get the canvas object from the DOM
        var canvas = document.getElementById("myCanvas");

        // check to see if the browser supports the canvas context
        if (canvas && canvas.getContext){

            // get the canvas context and assign it to 'c' for ease of use
            var c = canvas.getContext('2d');

            // set fill color
            c.fillStyle = "#dddddd";
            // create a filled rectangle
            c.fillRect(0, 0, 500, 400);

            // set stroke style
            c.strokeStyle = "rgb(150, 0, 255)";
            // start path
            c.beginPath();
            // draw some curves
            c.arc(100, 100, 50, 0, Math.PI / 2);
            c.arc(200, 200, 50, Math.PI, Math.PI / 2);
            // close the path
            c.closePath();
            // stroke the path
            c.stroke();
            // circle
            c.strokeStyle = "rgb(255, 0, 0)";

            // start a new path
            c.beginPath();
            // draw curve
            c.arc(300, 300, 50, 0, Math.PI * 2);
            // set fill style
            c.fillStyle = "#232323";
            // stroke path
            c.stroke();
            // fill path
            c.fill();


            // lines
            c.beginPath();
            c.moveTo(0, 0);
            c.lineTo(100, 100);
            c.moveTo(30, 40);
            c.lineTo(340, 340);
            c.stroke();
        } 
        </script> 
    </body>
</html>

Example HTML5 Canvas Template to get started:
HTML5 Canvas Cheat Sheet via http://www.nihilogic.dk/labs/

The Web Art of Rafaël Rozendaal


Rafaël Rozendaal is a visual artist who uses the internet as his canvas. His artistic practice consists of websites, installations, drawings, writings and lectures. Spread out over a vast network of domain names, he attracts a large online audience of over 15 million visits per year.

His work researches the screen as a pictorial space, reverse engineering reality into condensed bits, in a space somewhere between animated cartoons and paintings. His installations involve moving light and reflections, taking online works and transforming them into spatial experiences.

Most of his work is done in Flash, but it would be very possible to create similar web art/mini games with HTML Canvas and/or Processing.js

http://www.newrafael.com

Visualize the DOM in 3D with the Firefox Web Inspector

In Firefox 11, there is a new part to the Web Developer tools that allows you visualize a web page DOM tree in 3D. The tool allows you to see all the elements of the page as three dimensional blocks that you can explore. When we view the web page in 3D, we visually see these relationships making it easier to understand how the DOM works.



The DOM stands for Document Object Model, which is represents the objects in markup language, such as HTML. It is also refered to as a document "tree", as elements in HTML are nested inside eachother, creating parent/sibling relationships. Since the DOM is essentially a tree-like representation of a document, this tool layers each node based on the nesting in the tree, creating stacks of elements, each having a corresponding depth and being textured according to the webpage rendering itself.

To use the 3D Web Inspector:

1. Open Firefox (we're using version 11 for this tutorial)
2. Go to the URL of your choice.
3. In Firefox, go to Tools > Web Developer > Inspect
4. Click "3D" on the bottom right.
5. ?????
6. Profit!

We can experiment with the 3D inspector in mind. Go to this url http://www.dev-kitchen.com/ff3d/ and enable the 3D inspector to get a Minecraft-esqe blocky landscape.

Video example:



So, how is a web page made?


As we use the 3D web inspector, we can see that a web page is essentially made up of square "elements", all nested inside eachother that have attributes, or styles (written in CSS). These elements are types of HTML Tags that are used for layout. As we browse through the source of web pages on the internet, we see that the majority of layout elements are <DIV> and <SPAN>. They are both considered container elements, meaning you can put content inside them, and they can nest inside eachother, and they (and whatever is inside them) can have their own visual style.

The <div> tag acts as a divider, and is used to block out areas of the website. It is considered a BLOCK element.

The <span> is similar, but it is meant to span sections of text. It is considered an INLINE element.

As an example, let's say you wanted a block filled with content that is placed somewhere specific on your page. You would define the block with a <div>.

<div>
Some text inside the div
</div>

Notice that to create a <div>, we place the content inside, and then end the tag with a forward slash, like </div>.

Next, we can use the <span> element to assign styles to specific areas of text.

<div>
Some <span>text</span> inside the div
</div>

Now, there's no attributes associated with these elements yet, but they might look like this when we add a "style" attribute. Let's make the <div>'s text blue, and the <span> red.

<div style="color:blue">
Some <span style="color:red">red text</span> inside the div
</div>

When we assign style attributes to tags, there are a few things to remember:

1. The attributes must be in the starting tag -- not the ending tag.
2. You can have any number of attributes in a tag.

The "style" attribute can have multiple styles. Styles that are included in the tag as above are written as inline CSS, and there are a huge amount of attributes and rules that apply. If you inspect a website, you can see all the styles listed in the Web Inspector to give you ideas. You can change anything from the color, to the font, to the margin, padding, line height, background image and color, and much much more!

Website Structure


An HTML document structure is written as follows:

<!DOCTYPE html>
<html>
<head>
</head>
<body>

<div style="color:blue">
Some <span style="color:red">red text</span> inside the div
</div>

</body>
</html>

We then save this file as .html, and now an HTML document.

Notice the <!DOCTYPE html> at the top of the document. This specifies to the browser that it's HTML. Any elements you add in the <body> tag will be rendered. We use the <head> area to specify things that are not visible to the user, such as javascript and CSS style sheets.

What's next?

As you inspect websites, you will see that they are using embedded CSS in Style Sheets. In order to utilize style sheets, we use another attribute in our elements, such as "classes" and "id"s, which we will get to shortly as we experiment with the DOM.