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
| #include <stdio.h> | |
| int main(int argc, char** argv) { | |
| //関数定義の前に関数利用のコードがあるとコンパイルエラー. | |
| hoge(); | |
| } | |
| void hoge() { | |
| puts("hoge"); | |
| } |
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
| TestCase("Applicative style on jQuery Deferred", { | |
| setUp: function() { | |
| Function.prototype.$ = function() { | |
| return $.when.apply($, arguments) | |
| .then(this.bind(null)); | |
| }; | |
| Function.prototype.$$ = function(obj) { | |
| var f = this; | |
| return function() { | |
| return $.when.apply($, arguments) |
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
| FileUploadForm = function(form) { | |
| this.form = form; | |
| form.find("input[type=file]").change(this._handleFileInputChanged.bind(this)); | |
| this.changeCallback = $.Callbacks(); | |
| this.disposeCallback = $.Callbacks(); | |
| } | |
| FileUploadForm.prototype = { | |
| form: undefined, |
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
| fizzbuzz xs = | |
| let fb x | |
| -- fb x 以下のブロックになるので、fb x よりも深いインデントが無いとエラー | |
| | 0 == mod x 15 = "FizzBuzz" | |
| | 0 == mod x 5 = "Buzz" | |
| | 0 == mod x 3 = "Fizz" | |
| | otherwise = show x | |
| in [ fb x | x <- xs ] | |
| fizzbuzz'' xs = |
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
| primenumber :: Int -> [Int] | |
| primenumber x | |
| | 1 > x = error "argument 0 must be >0." | |
| | 1 == x = [] | |
| primenumber x = sieve [2..x] | |
| where | |
| s = (sqrt . fromIntegral) x | |
| sieve :: [Int] -> [Int] | |
| sieve (x:[]) = x : [] | |
| sieve all@(x:xs) |
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
| isPrime :: Int -> Bool | |
| isPrime 1 = False | |
| -- 約数リストを作成し、それが1,xのみである(それ以外の約数リストがnull)かどうかを判定して返却 | |
| -- | |
| -- lazy evaluation(怠惰な評価)で、最初の約数がリストに入れられた時点で | |
| -- null評価されFalseを返すことを期待しているが、そうなのか? | |
| -- | |
| isPrime x = null [f| f<-[2..x-1], 0 == mod x f] | |
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
| last' :: [a] -> a | |
| last' (x:[]) = x | |
| last' (x:xs) = last' xs |
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
| javascript:(function(){var%20entries=document.getElementById('entries').querySelectorAll('.entry');var%20sites={};for(var%20i=0,n=entries.length;i%20%3C%20n;i++){var%20entry=entries[i];var%20site=entry.querySelector('.entry-source-title').innerHTML;var%20title=entry.querySelector('.entry-title').innerHTML;var%20url=entry.querySelector('.entry-original').href;var%20date=entry.querySelector('.entry-date').innerHTML;if(!sites[site]){sites[site]=[];}sites[site].push({title:title,url:url,date:date});}var%20dl=document.createElement('dl');for(var%20site%20in%20sites){var%20entries=sites[site];var%20table=document.createElement('table');for(var%20i=0,n=entries.length;i%20%3C%20n;i++){var%20entry=entries[i];var%20tr=document.createElement('tr');var%20span=document.createElement('span');span.innerHTML=entry.date;var%20td=document.createElement('td');td.setAttribute('style','width:100px;');td.appendChild(span);tr.appendChild(td);var%20a=document.createElement('a');a.href=entry.url;a.target=%22_blank%22;a.innerHTML=entr |
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
| HTML 4.01 Strict DTD | |
| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" | |
| "http://www.w3.org/TR/html4/strict.dtd"> | |
| HTML 4.01 Transitional DTD | |
| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" | |
| "http://www.w3.org/TR/html4/loose.dtd"> |
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
| Option Explicit | |
| Const UTIL_URL = "https://raw.github.com/gist/1274775/Util.wsc" | |
| 'Const UTIL_URL = "C:\work\Util.wsc" | |
| Sub test1() | |
| Dim Util As Object | |
| Dim list As Variant | |
| list = Array("もみじ", "あかね", "きんむぎ") |
NewerOlder