#Scala
#Installation (OSX à adapter)
-
download http://www.scala-lang.org/downloads
-
dézipper
-
Variables d'environnement :
sudo pico ~/.bash_profile
#Scala
#Installation (OSX à adapter)
download http://www.scala-lang.org/downloads
dézipper
Variables d'environnement :
sudo pico ~/.bash_profile
##The Singleton Pattern
class SantaClaus {
private static uniqueInstance : SantaClaus;
/// <reference path="d.ts/backbone-0.9.ts"/> | |
declare var $: any; | |
declare var _: any; | |
declare var Mustache: any; | |
module Earth { | |
export class Human extends Backbone.Model { |
##Template
<!-- ìci notre template -->
<script type="text/template" id="articles-collection-template">
<% _.each(articles, function(article) { %>
<h1><%= article.title %></h1>
<p><%= article.content %></p>
<% }); %>
/* --- quick starter --- */ | |
/// <reference path="../../ts/lib/bob.ts"/> | |
declare var $: any; | |
declare var Mustache: any; | |
//define human model | |
class Human extends Bob.Model {} |
var MustacheView = Backbone.View.extend({ | |
initialize : function (data) { | |
if(this.template) this.mustacheTemplate = this.template.html(); | |
this.data = data!==undefined ? data : []; | |
}, | |
render : function () { | |
var view = this; | |
var _render = function() { |
[].slice.apply(document.querySelectorAll("emmerdes")).forEach(function(item){item.innerHTML="QUE DU BONHEUR POUR 2013"}) |
Promise<String> promise = new Promise<String>("My batchTask as String Promise", new Batch() { | |
public String run() throws InterruptedException { | |
long duration=(long)(Math.random()*10); | |
System.out.println("Waiting for "+duration+" seconds for results."); | |
TimeUnit.SECONDS.sleep(duration); | |
System.out.println("Hello World by anonymous class"); | |
return "Hello World by Anonymous"; | |
} | |
}); |
{ | |
"cmd": ["/Users/k33g_org/Dropbox/golo/r0/bin/gologolo","$file"], | |
"selector": "source.golo", | |
"osx": | |
{ | |
"path": "/usr/local/bin:$PATH", | |
"env":{ | |
"JAVA_HOME":"/Library/Java/JavaVirtualMachines/ea.jdk1.8.0/" | |
} | |
} |
module glloq | |
function boite = -> DynamicObject(): | |
op(""): | |
value(0): | |
nbCailloux(0): | |
nbAllumettes(0): | |
define("alumette", |this| { | |
if this: op(): equals("+") { this: nbAllumettes(this: nbAllumettes() + this: value())} | |
if this: op(): equals("-") { this: nbAllumettes(this: nbAllumettes() - this: value())} |