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 sys | |
import math | |
import random | |
debug = False | |
if debug: fo = open("random10.txt", "r") | |
def read(): | |
if debug: |
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 sys | |
import math | |
import random | |
import time | |
debug = False | |
if debug: fo = open("./2ndSample2.txt", "r") | |
if debug: foOut = open("./2ndSample2out.txt", "r") | |
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.util.Arrays; | |
import java.util.HashMap; | |
import java.util.Map; | |
import java.util.Scanner; | |
import java.util.stream.Stream; | |
public class Main { | |
private boolean debug = true; | |
static public class Node { |
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.util.Arrays; | |
import java.util.Random; | |
/** | |
* Reinforcement Learning Sample | |
* Monte Carlo Version. | |
* Based on(https://gist.github.com/Hiromi-Ayase/3e88a34c80ec496b70a765b9a907bc69) | |
* | |
*/ |
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
public void sampleCodingErroAction(String hex, CodingErrorAction actionOnMalformedInput, CodingErrorAction actionOnUnmappableCharacter){ | |
ByteBuffer buff = ByteBuffer.allocate(hex.length()/2); | |
for (int i = 0; i < hex.length(); i+=2) { | |
buff.put((byte)Integer.parseInt(hex.substring(i, i+2), 16)); | |
} | |
buff.rewind(); | |
Charset cs = Charset.forName("shift-jis"); | |
CharBuffer cb = null; | |
try { | |
cb = cs.newDecoder() |
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.util.regex.Matcher; | |
import java.util.regex.Pattern; | |
public class RegExpTest2 { | |
private static String str = "xfooxxxxxxfoo"; | |
private static int LIMIT = 9; | |
private static long[] arrGreedy = new long[LIMIT]; | |
private static long[] arrReluctant = new long[LIMIT]; | |
private static long[] arrPossessive = new long[LIMIT]; |
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.util.regex.Matcher; | |
import java.util.regex.Pattern; | |
public class RegExpTest1 { | |
private static String str = "xfooxxxxxxfoo"; | |
private static int max = 10000000; | |
public static void main(String args[]){ | |
runGreedy(); |
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 javax.naming.Context; | |
import javax.naming.InitialContext; | |
import javax.naming.NameClassPair; | |
import javax.naming.NamingEnumeration; | |
import javax.naming.NamingException; | |
import java.util.Hashtable; | |
import com.sun.jndi.fscontext.RefFSContext; | |
class JNDIFileLookup { | |
public static void main(String[] args) { |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script language="javascript"> | |
var radius = 150; | |
var center_x = 200; | |
var center_y = 150; | |
function draw_polygon(){ |
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 javax.ws.rs.DefaultValue; | |
import javax.ws.rs.GET; | |
import javax.ws.rs.Path; | |
import javax.ws.rs.PathParam; | |
import javax.ws.rs.Produces; | |
import javax.ws.rs.QueryParam; | |
import javax.ws.rs.core.MediaType; | |
@Path("sample/{samplePathParam}") | |
public class Main { |
NewerOlder