Skip to content

Instantly share code, notes, and snippets.

@kuwalab
kuwalab / CopyFile.kt
Created April 3, 2015 22:52
CopyFile
package tips.t002
import java.nio.file.Files
import java.nio.file.Paths
fun main(args: Array<String>) {
val srcFile = Paths.get("res/test.zip")
val destFile = Paths.get("res/dest.zip")
Files.newInputStream(srcFile).use { ins ->
Files.newOutputStream(destFile).use { os ->
package tips.t001
import java.io.BufferedWriter
import java.io.IOException
import java.nio.charset.StandardCharsets
import java.nio.file.Files
import java.nio.file.Paths
fun main(args: Array<String>) {
var outputPath = Paths.get("outputText.txt")
package poi
import java.io.FileInputStream
import java.io.IOException
import java.nio.file.Files
import java.nio.file.Paths
import org.apache.poi.ss.usermodel.Sheet
import org.apache.poi.ss.usermodel.Cell
import org.apache.poi.ss.usermodel.Row
import org.apache.poi.ss.usermodel.Workbook
@kuwalab
kuwalab / web.xml
Created July 20, 2014 05:34
Java EE 7 web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.1" xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd">
</web-app>
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>ファイルのアイコン表示</title>
<link rel="stylesheet" href="../css/fileTypeIcon.css">
</head>
<body>
<h1>ファイルのアイコン表示</h1>
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>ほげ</title>
</head>
<body>
/sに全角のスペースを含む? <span id="test"></span>
<script>
<!DOCTYPE html lang="ja">
<html>
<head>
<meta charset="utf-8">
<title>カスタム要素</title>
</head>
<body>
<x-foo></x-foo><br>
<x-foo></x-foo>
<script>
package com.example;
import java.math.BigDecimal;
import java.math.MathContext;
import java.math.RoundingMode;
public class BigDecimalTest {
public static void main(String... args) {
print(new BigDecimal(1));
print(new BigDecimal(1.12));
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
id="serv" version="3.0">
<jsp-config>
<jsp-property-group>
<url-pattern>*.jsp</url-pattern>
<el-ignored>false</el-ignored>
@kuwalab
kuwalab / index.html
Last active January 2, 2016 02:19
HTML5 template
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>ほげ</title>
<link rel="stylesheet" href="">
</head>
<body>