This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (typeof Object.create !== 'function') { | |
Object.create = function (o) { | |
function F() {} | |
F.prototype = o; | |
return new F(); | |
}; | |
} | |
newObject = Object.create(oldObject); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// deeper into the pie | |
var pie_stuff = pie.items; | |
var pie_sectors = pie_stuff[1]; | |
var sector1 = pie_sectors[0]; | |
// within some DOM element, I attached .hover() and added, | |
sector1.animate({scale: [1, 1, this.cx, this.cy]}, 500, "bounce").attr({"fill": off_color}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// consider this simple function | |
var calc_total = function(a,b,c) { | |
return (this + a + b + c); | |
} | |
calc_total.call(1,2,3,4,5); // result is 10. 1 is treated as this, and 2,3,4 as a,b,c. 5 is ignored. | |
var calc_total2 = function(a,b,c) { | |
return (this + a + b + c); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var koolcharts = {}; | |
// maybe you have a buncha functions | |
koolcharts.fn = {}; | |
// let's add a draw function | |
koolcharts.fn.draw = function() { | |
alert("I'm too young to draw"); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Dojo - Hello World!</title> | |
<link href="dojo1.5/dojo/resources/dojo.css"> | |
<script src="dojo1.5/dojo/dojo.js" type="text/javascript"></script> | |
</head> | |
<body> | |
<div id="hello">Hello Dojo!</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// A simple generic server for local testing | |
// point to local node libraries folder | |
require.paths.push('/usr/local/lib/node/'); | |
var static = require('node-static'); | |
var myfolder = 'dojo'; // change this if needed | |
var port = 8123; // change this if needed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Dojo - Namespaces!</title> | |
<link href="dojo1.5/dojo/resources/dojo.css"> | |
<script src="dojo1.5/dojo/dojo.js" type="text/javascript"></script> | |
</head> | |
<body> | |
<div id="hello">Hello Dojo!</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dojo.provide("kenny.calculator"); | |
kenny.calculator.sum = function(x,y) { | |
return x+y; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server: http://localhost:9123 | |
load: | |
- myproject/js/external/jquery-1.3.2.js | |
- myproject/js/internal/myapp.js | |
- jstd/myapp/*.js |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SumTwo | |
{ | |
public static void main(String[] args) | |
{ | |
int a = 4; | |
int b = 5; | |
int result = a + b; | |
System.out.println(result); |