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
| <!DOCTYPE html> | |
| <html lang="ja"> | |
| <head> | |
| <title>ZeroClipboard.js TEST</title> | |
| <meta charset="UTF-8" /> | |
| <style type="text/css"> | |
| section { | |
| margin:1em auto; | |
| font-size:16px; | |
| } |
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
| window.URL = window.URL || window.webkitURL; | |
| var blob = new Blob(['self.onmessage = function(event) {var counter = 0 ; for (var i = 0, len = event.data; i < len; i++) {counter++;} self.postMessage(counter)};']); | |
| var objectURL = window.URL.createObjectURL(blob); | |
| var worker = new Worker(objectURL); | |
| worker.onmessage = function(event) { | |
| console.log(event.data); | |
| window.URL.revokeObjectURL(blob); |
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
| package { | |
| import flash.display.Sprite; | |
| import flash.display.Stage; | |
| import flash.events.Event; | |
| import flash.events.MouseEvent; | |
| public class PencilTool extends Sprite { | |
| private var canvas:Sprite = null; |
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
| public final class MutexCounter { | |
| private static final int NUM_LOAD = 10000; | |
| private Object mutex = new Object(); | |
| private int count = 0; | |
| private static class Worker implements Runnable { | |
| private MutexCounter counter = null; | |
| public Worker(MutexCounter counter) { | |
| this.counter = counter; |
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
| public final class SynchronizedCounter { | |
| private static final int NUM_LOAD = 10000; | |
| private int count = 0; | |
| private static class Worker implements Runnable { | |
| private SynchronizedCounter counter = null; | |
| public Worker(SynchronizedCounter counter) { | |
| this.counter = counter; | |
| } |
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
| import java.util.concurrent.atomic.*; | |
| public final class AtomicThread { | |
| private static final int NUM_LOAD = 100000; | |
| private AtomicInteger count = new AtomicInteger(); | |
| private static class Worker implements Runnable { | |
| private AtomicThread counter = null; | |
| public Worker(AtomicThread counter) { |
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
| import java.util.*; | |
| import java.io.*; | |
| import java.net.*; | |
| public final class ChatServer { | |
| private static final int LISTEN_PORT = 9999; | |
| private static final String TERMINAL_MESSAGE = "quit"; | |
| private static final int BUFFER_SIZE = 4096; |
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
| import java.io.*; | |
| import java.net.*; | |
| public final class ChatClient { | |
| private static final String SERVER_HOST = "localhost"; | |
| private static final String TERMINAL_MESSAGE = "quit"; | |
| private static final int BUFFER_SIZE = 4096; | |
| public static void main(String[] args) { | |
| if (args.length < 1) { |
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
| import java.util.*; | |
| import java.io.*; | |
| import java.net.*; | |
| public final class SocketServer { | |
| private static final int LISTEN_PORT = 9999; | |
| private static final int TIMEOUT = 60000; //ms | |
| public static void main(String[] args) { |
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
| import java.io.*; | |
| import java.net.*; | |
| public final class SocketClient { | |
| private static final String SERVER_HOST = "localhost"; | |
| private static final int SERVER_PORT = 9999; | |
| public static void main(String[] args) { | |
| if (args.length < 1) { | |
| System.err.println("Require at least 1 argument !!"); |