Skip to content

Instantly share code, notes, and snippets.

@megascus
megascus / dbms_qopatch.GET_OPATCH_BUGS.xml
Created October 24, 2018 07:44
OPATCH_LIST Oracle Standard Edition Two 12.1.0.2.v13
<bugInfo>
<bugs xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<bug id="20033733">
<UId>FlexibleDataType-8548a492-5ffc-4b4d-8223-086ad9dc1770</UId>
<description>PART IMC HIT ORA 600 [KGL-HEAP-SIZE-EXCEEDED]</description>
</bug>
</bugs>
</bugInfo>
<bugInfo>
<bugs xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
@megascus
megascus / CloseableTest.java
Created July 6, 2017 04:20
AutoCloseableの実行順序
public class CloseableTest implements AutoCloseable {
public static void main(String[] args) {
try (CloseableTest test = new CloseableTest()) {
test.throwException();;
} catch (Exception e) {
System.out.println("catch exception");
System.out.println(e.getSuppressed()[0]); //close()メソッドの中で投げられた例外にcatch句でアクセスができる。
}
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadFactory;
public class UncaughtExceptionHandlerSample {
public static void main(String[] args) throws NoSuchFieldException, InterruptedException {
//Threadに設定する場合
@megascus
megascus / Test.java
Created May 7, 2017 15:18
diff InputStream and Reader
package test;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Files;
import java.nio.file.Paths;
import static java.nio.charset.StandardCharsets.*;
package test;
import java.io.BufferedWriter;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import static java.nio.charset.StandardCharsets.*;
public class CreateFile {
//source
public static void main(String... args) {
String str = "";
for(int i = 0;i < 100; i++) {
str += "hoge";
}
}
//decompile
@megascus
megascus / pom.xml
Created January 3, 2013 23:46
JavaEE6-Glassfish maven pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>JavaEEMaven</groupId>
<artifactId>JavaEEMaven</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>
@megascus
megascus / CharSetMain.java
Created October 16, 2012 14:55
使用出来る文字コード一覧
public class CharSetMain {
public static void main(String[] args) {
for (Charset cs : Charset.availableCharsets().values()) {
System.out.println(charsetToString(cs));
}
}
private static String charsetToString(Charset cs) {
return cs.name() + aliasesToString(cs);
}
@megascus
megascus / JoJo.java
Created August 12, 2012 11:30
素数の時にJoJo2(Java)
/**
*
* @author megascus
*/
public class JoJo {
public static void main(String[] args) {
for (int i = 1; i <= 100; i++) System.out.println(isPrime(i) ? "JoJo" : i);
}
@megascus
megascus / JoJo.java
Created August 12, 2012 01:31
素数の時にJoJo(Java)
/**
*
* @author megascus
*/
public class JoJo {
public static void main(String[] args) {
for (int i = 1; i <= 100; i++) {
System.out.println(isPrime(i) ? "JoJo" : i);
}