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
// fwatch1v.cpp : コンソール アプリケーションのエントリ ポイントを定義します。 | |
// | |
#include "stdafx.h" | |
// stdafx.hプリコンパイルヘッダでの定義は以下のとおり | |
// (XP SP2以降) | |
//#define _WIN32_WINNT 0x0502 | |
//#include <stdio.h> | |
//#include <locale.h> |
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 deflatesample; | |
import java.io.ByteArrayInputStream; | |
import java.io.ByteArrayOutputStream; | |
import java.io.InputStream; | |
import java.util.Iterator; | |
import java.util.zip.Deflater; | |
import java.util.zip.Inflater; | |
/** |
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 rsasample; | |
import java.io.ByteArrayOutputStream; | |
import java.math.BigInteger; | |
import java.security.Key; | |
import java.security.KeyFactory; | |
import java.security.KeyPair; | |
import java.security.KeyPairGenerator; | |
import java.security.interfaces.RSAPrivateKey; |
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
grant codeBase "http://localhost:8080/JideDockingViewAppletSample/-" { | |
permission java.awt.AWTPermission "accessEventQueue"; | |
permission java.awt.AWTPermission "setDropTarget"; | |
permission java.awt.AWTPermission "accessClipboard"; | |
permission java.awt.AWTPermission "acceptDropBetweenAccessControllerContexts"; | |
permission java.awt.AWTPermission "listenToAllAWTEvents"; | |
}; |
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 static void main(String[] args) throws Exception { | |
char[] password = "Hello, World!!".toCharArray(); | |
byte[] salt = new byte[] {1, 2, 3, 4, 5, 6, 7, 8}; | |
SecretKeyFactory factory = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA1"); | |
KeySpec spec = new PBEKeySpec(password, salt, 65536, 128); // キーは128Bit | |
SecretKey tmp = factory.generateSecret(spec); | |
byte[] digest = tmp.getEncoded(); | |
for (byte d : digest) { | |
System.out.print(String.format("%02x", d)); | |
} |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Security.Cryptography; | |
using System.IO; | |
namespace RSASample | |
{ | |
class Program |
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
select USERNAME | |
, profile | |
from DBA_USERS; | |
select * | |
from dba_profiles | |
where profile = 'DEFAULT' | |
and resource_name = 'PASSWORD_LIFE_TIME'; | |
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
/** | |
* 連続する数値から割り当てる色を算定する.<br> | |
* @param sequence シーケンス番号 | |
* @return 割り当てられた色 | |
*/ | |
protected Color makeColor(int sequence) { | |
int pos = sequence % 7; // 色相を7分割で1周 | |
int lev = sequence / 7; // 周数 | |
lev = lev % 4; // 4段階以上は暗くせず、最初に戻る. |
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 apachederbysample.types; | |
import java.io.Externalizable; | |
import java.io.IOException; | |
import java.io.ObjectInput; | |
import java.io.ObjectOutput; | |
/** | |
* ホストアドレスを保持するユーザー定義型. | |
* Externalizableを実装することでデータベースにデータを格納できるようにする. |
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 oracleinstest; | |
import java.sql.*; | |
import oracle.jdbc.pool.OracleDataSource; | |
public class OracleInsTest { | |
/** | |
* OracleのINSERT文でプライマリキーとしてシーケンスオブジェクトを使ったとき、 | |
* 生成されたキーの値をgetGeneratedKeysメソッドで取得するための方法. |