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
function getPicture(){ | |
navigator.camera.getPicture(function(data){ | |
// success handler | |
alert('success'); | |
}, function(){ | |
// error handler | |
alert('error'); | |
}, { | |
// options | |
quality: 50 |
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
#include <stdio.h> | |
#include <time.h> | |
int main(void) | |
{ | |
time_t now; | |
struct tm *ts; | |
int year; | |
char buf[80]; | |
// Get the current time |
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 express = require('express'); | |
var app = module.exports = express.createServer(); | |
var store = new (require('connect').session.MemoryStore)(); | |
app.configure(function(){ | |
app.set('views', __dirname + '/view'); | |
app.set('view options', { layout : false, filename : __dirname + '/view/index.jade' }); | |
app.set('view engine', 'jade'); | |
app.use(express.static(__dirname + '/static')); | |
app.use(express.bodyParser()); | |
app.use(express.cookieParser()); |
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
#include <stdlib.h> | |
#include <stdio.h> | |
#include <math.h> | |
#include <time.h> | |
struct node { | |
int value; | |
struct node *next; | |
}; |
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 express = require('express'); | |
var app = module.exports = express.createServer(); | |
var store = new (require('connect').session.MemoryStore)(); | |
app.configure(function(){ | |
app.set('views', __dirname + '/view'); | |
app.set('view options', { layout : false, filename : __dirname + '/view/index.jade' }); | |
app.set('view engine', 'jade'); | |
app.use(express.static(__dirname + '/static')); | |
app.use(express.bodyParser()); | |
app.use(express.cookieParser()); |
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
$(function(){ | |
var socket = io.connect('http://localhost/'); | |
socket.on('hello', function(message){ | |
$('body').append('<p>'+message+'</p>'); | |
}); | |
$('body').append('<button id="send">全員に送る</button>'); | |
$('#send').click(function(e){ | |
socket.emit('message', 'hello!! '+new Date().toLocaleString()); | |
}); | |
}); |
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
!!! 5 | |
html(lang='ja') | |
head | |
title hello | |
script(type = 'text/javascript', src = '/socket.io/socket.io.js') | |
script(type = 'text/javascript', src = '/jquery-1.6.2.min.js') | |
script(type = 'text/javascript', src = '/hello.js') | |
body | |
div hello!!! |
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 tests = { | |
'フォローを削除できる' : function(test) { | |
var searching_user = user_dao.find({ email : 'a@example.com' }, [], {}); | |
searching_user.on('end', function(users){ | |
var searching_node = node_dao.find({ value : 'a' }, [], {}); | |
searching_node.on('end', function(nodes){ | |
var inserting_node = user_dao.add_node(users[0]._id, { node_id : nodes[0]._id }); | |
inserting_node.on('end', function(){ | |
var remove_node = user_dao.remove_node(users[0]._id, nodes[0]._id); | |
remove_node.on('end', 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
require 'rubygems' | |
require 'mechanize' | |
agent = Mechanize.new | |
agent.follow_meta_refresh = true | |
page = agent.get('https://vu8.sfc.keio.ac.jp/sfc-sfs/') | |
form = page.forms.first | |
form['u_login'] = ARGV[0] | |
form.add_field!("u_pass", ARGV[1]) | |
agent.submit(form) |
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.net.*; | |
import java.io.*; | |
import java.util.*; | |
import javax.xml.parsers.*; | |
import org.xml.sax.*; | |
import org.xml.sax.helpers.*; | |
import java.io.*; | |
public class Twitter extends DefaultHandler { | |
public Boolean is_tweet = false; |
OlderNewer