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
<button id="listKeio" onclick=getFromWikipedia()>List</button> | |
<div id="listOfKeio"></div> | |
<script type="text/javascript"> | |
function jsonFlickrFeed(json) { | |
var e = document.getElementById('listOfKeio'); | |
var i = 0; | |
while(i < json.items.length){ | |
var photo = json.items[i]; | |
var imageURL = photo.media.m; | |
var imgTag = '<img src="' + imageURL + '">'; |
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
<div id="map" style="width:300px;height:300px"></div> | |
<input id="addrArea" value="慶應義塾大学湘南藤沢キャンパス" type="text"> | |
<input value="OK" onclick="geocode()" type="button"> | |
<div id="resArea"></div> | |
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script> | |
<script type="text/javascript"> | |
// 地図の中心を決める | |
var latlng = new google.maps.LatLng(35.388276, 139.427348); | |
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 storage = sessionStorage | |
var now = new Date(); | |
var keyName = "2012f-11-1-3-lastvisited"; | |
document.write("現在時刻は" + now + "です。<br>"); | |
var lastvisited = storage.getItem(keyName); | |
document.write(buildMessage(lastvisited) + "<br>"); | |
storage.setItem(keyName, now); | |
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){ | |
char* name = "World"; | |
if(argc > 1){ | |
name = argv[1]; | |
} | |
printf("Hello, %s!\n", name); | |
return 0; | |
} |
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> | |
void printArray(int* arr, int length){ | |
int i; | |
for(i = 0; i < length; i++){ | |
printf("%d", arr[i]); | |
if(i + 1 < length){ | |
printf(","); | |
} | |
} |
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 CustonException < StandardError | |
end | |
class CustonError < StandardError | |
end | |
def error_source(exception=true) | |
raise CustonException.new("Exception from error_source") if exception | |
raise CustonError.new("Error from error_source") | |
end |
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
body { background-color: #DDDDDD; font: 30px sans-serif; } |
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://geoapi.heartrails.com/api.html を使うサンプル。 |
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
source 'https://rubygems.org' | |
gem 'rdf' | |
gem 'rdf-json' | |
gem 'rdf-turtle' |
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
Accumulator | |
attr_reader :result | |
def initialize | |
@result = 0 | |
end | |
def add(a, b) | |
return @result += a + b |