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 myobj; | |
| (function() { | |
| var name = "my, oh, oh"; | |
| myobj = { | |
| getName: function() { | |
| return name; | |
| } | |
| }; | |
| }()); |
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 myarray; | |
| (function() { | |
| var astr = "[object Array]", | |
| toString = Object.prototype.toString; | |
| function isArray(a){ | |
| return toString.call(a) === astr; | |
| } |
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
| # http://icpc2010.honiden.nii.ac.jp/domestic-contest/problems#section_A | |
| # 1 | |
| # 5 | |
| # 0 0 | |
| # 0 1 | |
| # 0 2 | |
| # 0 3 | |
| class Kaku |
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
| MYAPP.utilities.array = (function () { | |
| var array_string = "[object Array]", | |
| ops = Object.prototype.toString, | |
| inArray = function (haystack, needle) { | |
| for (var i = 0, max = haystack.length; i < max; i += 1) { | |
| if (haystack[i] === needle) { | |
| return i; | |
| } | |
| } |
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
| class Maze | |
| def initialize(w,h,input) | |
| @len_map = Hash.new | |
| @len_map[[w-1,h-1]] = 1 | |
| make_fence(input) | |
| end | |
| def make_fence(input) | |
| lr, tb = [], [] | |
| input.each_with_index do |e,i| |
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
| # -*- encoding: UTF-8 -*- | |
| names = [ "切手を買う", "報告書を書く", "家賃を払う", "猫の餌を買う", "燃えないゴミを出す" | |
| ] | |
| description = "これは説明です。" * 20 | |
| 5.times do |n| | |
| Task.create(:name => names[n], :description => description, | |
| :due_date => (n - 2).days.from_now, :done => n.zero?) | |
| end | |
| 200.times do |n| |
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
| document.writeln("\nspike"); | |
| document.writeln("2012.11.27"); | |
| var Gadget = function () {}; | |
| Gadget.isShiny = function () { | |
| return "you bet"; | |
| }; | |
| Gadget.prototype.setPrice = function(price) { |
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 Gadget = (function() { | |
| var counter = 0, | |
| NewGadget; | |
| NewGadget = function () { | |
| counter += 1; | |
| }; | |
| NewGadget.prototype.getLastId = function () { |
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 obj = { | |
| value: 1, | |
| increment: function () { | |
| this.value += 1; | |
| return this; | |
| }, | |
| add: function (v) { | |
| this.value += v; | |
| return this; |
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 Function.prototype.method !== "function") { | |
| Function.prototype.method = function (name, implementation) { | |
| this.prototype[name] = implementation; | |
| return this; | |
| }; | |
| } | |
| var Person = function (name){ | |
| this.name = name; | |
| }. |