This file contains 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
package com.example.mysocialintent.test; | |
import android.app.Activity; | |
import android.content.Intent; | |
import android.test.ActivityInstrumentationTestCase2; | |
import com.example.mysocialintent.MainActivity; | |
import com.example.mysocialintent.libs.MySocialIntent; | |
This file contains 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
import java.util.*; | |
class EnumPractice{ | |
private enum singleton{ | |
INSTANCE; | |
public void show(){ | |
System.out.println("enum show"); | |
} | |
} |
This file contains 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 a = (function(){ | |
return 100; | |
}()); | |
var b = { | |
o: (function(){ | |
var local = 100; | |
return local * 2; | |
}()) | |
}; |
This file contains 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
describe('decorator', function() { | |
// body... | |
it('singleton1', function(done) { | |
var Car = function(){ | |
var instance = this; | |
this.a = 100; | |
Car = function(){ | |
return instance; | |
}; | |
}; |
This file contains 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
describe('iterator', function() { | |
it('test', function() { | |
var Iter = function(data){ | |
this.index = 0; | |
this.data = data; | |
}; | |
Iter.prototype = { | |
next: function(){ | |
var elem = this.data[this.index]; | |
this.index += 1; |
This file contains 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
describe('design pattern', function () { | |
var testData = null; | |
it('observer', function(){ | |
var Observer = function(){ | |
this.subscribers = []; | |
}; | |
Observer.prototype = { | |
publish: function(data){ | |
var i = 0, | |
len = this.subscribers.length; |
This file contains 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
$(document).ready(function() { | |
var models = { | |
name: ko.observable("name") | |
}; | |
ko.applyBindings(models); | |
setTimeout(function(){ | |
models.name("HAHAHA"); | |
}, 2000); | |
}); |
This file contains 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
$(document).ready(function() { | |
var models = { | |
names: ko.observableArray([ | |
{"name": "name1"}, | |
{"name": "name2"} | |
]) | |
}; | |
ko.applyBindings(models); | |
setTimeout(function(){ |
This file contains 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 lang="en-US" ng-app="game"> | |
<head> | |
<meta charset="UTF-8"> | |
<script type="text/javascript" src="js/vendor/jquery-1.8.0.min.js"></script> | |
<script type="text/javascript" src="js/angular.js"></script> | |
<script type="text/javascript" src="js/objects.js"></script> | |
<script type="text/javascript" src="js/index.js"></script> | |
<script type="text/javascript" src="js/event.js"></script> | |
<script type="text/javascript" src="js/map.js"></script> |
OlderNewer