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
SendMode "Input" | |
SetWorkingDir(A_ScriptDir) | |
-::/ | |
w::l | |
e::u | |
r::, | |
t::. |
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
package sample0 | |
import org.kodein.di.Kodein | |
import org.kodein.di.generic.bind | |
import org.kodein.di.generic.instance | |
import org.kodein.di.generic.provider | |
import java.security.SecureRandom | |
import java.util.Random | |
fun main(args: Array<String>) { |
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.stream.Stream; | |
public class Zundoko { | |
public static void main(String args[]) { | |
StringBuilder sb = new StringBuilder(); | |
Stream<String> stream = Stream.generate(() -> Math.random() > 0.5 ? "ズン" : "ドコ"); | |
try { | |
stream.peek(s -> { | |
System.out.print(s); | |
sb.append(s); |
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
package org.example; | |
import org.apache.logging.log4j.LogManager; | |
import org.apache.logging.log4j.Logger; | |
public class SampleClass { | |
private static final Logger LOGGER = LogManager.getLogger(SampleClass.class); | |
void doSomething(String message) { | |
// Java8 & Log4j2として、ラムダを使うことでinfoか否かの判定をLog4j2に実施させる。 |
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
package org.example; | |
public class Calc { | |
int remainder(int dividend, int divisor) { | |
return dividend % divisor; | |
} | |
} |
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
package org.example; | |
import org.apache.commons.lang3.SystemUtils; | |
import java.util.Arrays; | |
public class Kantoka { | |
public static void main(String[] args) { | |
System.out.println("This is Kantoka"); | |
System.out.println(args.length); |
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
package org.example; | |
import javax.ws.rs.GET; | |
import javax.ws.rs.Path; | |
import javax.ws.rs.Produces; | |
import javax.ws.rs.core.MediaType; | |
@Path("/sample") | |
public class EndPoint { |
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
<?php | |
class BasicAuthComponent extends Component { | |
public function startup(Controller $controller) { | |
if (!isset($_SERVER['PHP_AUTH_USER']) || !isset($_SERVER['PHP_AUTH_PW']) || $_SERVER['PHP_AUTH_USER'] !== BASIC_USERID || $_SERVER['PHP_AUTH_PW'] !== BASIC_PASSWD) { | |
$controller->autoRender = false; | |
$controller->response->header('WWW-Authenticate: Basic realm="Please enter your ID and password"'); | |
$controller->response->statusCode(401); | |
$controller->response->send(); | |
$this->_stop("id / password Required"); | |
} |
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
class Fraction { | |
/** | |
* 値を素因数分解して返します。 | |
* 素数を x で連結する表記です。 | |
* 10 => 2x2x5x5 | |
* */ | |
static String factorize(long val) { | |
if(val == 1L){ | |
return "1"; | |
} |
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.io.BufferedReader; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.io.InputStreamReader; | |
import java.io.OutputStream; | |
public class Main { | |
public static void main(String[] args) throws Exception { | |
StringBuilder script = new StringBuilder(); |
NewerOlder