セッションで紹介したいろいろ。
なにか質問があれば @sada_h に。
| require 'base64' | |
| require 'mime/types' | |
| def print_usage | |
| puts <<EOS | |
| b64e2.rb encode file to base64(data URL Scheme). | |
| b64e2.rb make "base64" directory and write encoded file. | |
| usage |
セッションで紹介したいろいろ。
なにか質問があれば @sada_h に。
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
| <title>JSP Page</title> | |
| <script src="http://code.jquery.com/jquery-1.8.2.min.js"></script> | |
| <script> | |
| $(function(){ | |
| var host = "ws://localhost:8080/WebApplication3/echo"; | |
| var socket = new WebSocket(host); |
| /* | |
| * To change this template, choose Tools | Templates | |
| * and open the template in the editor. | |
| */ | |
| package websocket.sample; | |
| import javax.websocket.Session; | |
| import javax.websocket.WebSocketEndpoint; | |
| import javax.websocket.WebSocketMessage; |
| index_by (rails) | |
| group_by | |
| <!doctype html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>Document</title> | |
| <script src="http://code.jquery.com/jquery-1.8.2.min.js"></script> | |
| <script> | |
| $(function(){ | |
| var host = "ws://localhost:8888/"; | |
| var socket = new WebSocket(host); |
| import java.io.IOException; | |
| import java.util.Collections; | |
| import java.util.HashSet; | |
| import java.util.Set; | |
| import javax.websocket.Session; | |
| import javax.websocket.WebSocketClose; | |
| import javax.websocket.WebSocketEndpoint; | |
| import javax.websocket.WebSocketMessage; | |
| import javax.websocket.WebSocketOpen; |
| var ws = require("websocket.io"); | |
| var server = ws.listen(8888, | |
| function () { | |
| console.log("ws start"); | |
| } | |
| ); | |
| server.on("connection", | |
| function(socket) { | |
| socket.on("message", |
| <%- # 空行が表示されない(rails) -%> | |
| <% # 空行が表示される(rails) %> |
| // (1..100).to_a.each_slice(15){|a| p a} を Java で書いてみたらこんなんになっちゃったんだけど。 | |
| // これは僕のJava力が低下し過ぎているせいか…? | |
| // この書き方だとListでも配列でもあんまりかわんない。 | |
| // なんか、自分の書き方が間違ってる気がすごくするけど、かっこいいコードが思いつかなかった。 | |
| import java.util.List; | |
| import java.util.ArrayList; | |
| public class A{ | |
| public static void main(String args[]){ | |
| List<Integer> ary = new ArrayList<Integer>(); |