Skip to content

Instantly share code, notes, and snippets.

View seraphy's full-sized avatar

seraphy seraphy

View GitHub Profile
@seraphy
seraphy / Windows
Created January 4, 2012 11:18
データベース「orclutf8」の構築手順
[[WindowsでのOracle11gR2データベースの構築手順]]
-- 現時点では、スクリプトの実行あたりが不完全なので注意 --
参考資料:
http://docs.oracle.com/cd/E16338_01/server.112/b56301/toc.htm
[1. 環境変数の設定]
管理者権限でコマンドプロンプトを空き、以下の環境変数を設定する。
@seraphy
seraphy / TableColumnDefLib.cs
Created January 5, 2012 12:51
C#4.0でのXMLの書き出し、LinqToXMLを使った読み込み、およびコマンド引数のワイルドカード展開などメモ
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Xml;
using System.Xml.Linq;
namespace TableColumnDefLib
{
@seraphy
seraphy / gist:1626644
Created January 17, 2012 13:34
ASP.NET4 Ajax UpdatePanelの非同期Load完了後のjavascriptでのハンドリング
// http://msdn.microsoft.com/en-us/library/bb398976.aspx
// http://msdn.microsoft.com/en-us/library/bb397499.aspx
// http://msdn.microsoft.com/ja-jp/magazine/cc163413.aspx
var pageReqMgr = Sys.WebForms.PageRequestManager.getInstance();
// 非同期通信完了後の処理
pageReqMgr.add_pageLoaded(function (sender, args) {
var updatedPanels = args.get_panelsUpdated();
if (updatedPanels.length > 0) {
@seraphy
seraphy / ComboBox2.js
Created January 31, 2012 02:32
ExtJSの拡張コンポーネント
// IE6~9で、コンボボックスが二回目のドロップダウンで画面左上に張り付くバグ対応版
// http://www.sencha.com/forum/showthread.php?154412-Combo-Box-options-appears-in-Top-Left-Corner-in-IE-9
Ext.define('Ext.ux.form.field.ComboBox2', {
extend: 'Ext.form.field.ComboBox',
alias: 'widget.combobox2',
requires: ['Ext.form.field.ComboBox'],
alternateClassName: ['Ext.form.ComboBox2', 'Ext.form.ComboBox2'],
/**
* Override of alignment issue where dropdown appears in the top-left corner of the page.
@seraphy
seraphy / extjs_nestmodel_example.js
Created February 7, 2012 00:49
ExtJS4のネストしたモデルの扱い方メモ
// データ定義
var testdata = [
{
name: 'name1',
value: 123,
dates: [
{
date: '1a',
note: '1aa'
},
@seraphy
seraphy / odptest.cs
Created March 9, 2012 10:06
ODP.NET/C# を使ってストアどプロシージャに一時BLOBデータを渡し方、およびユーザー定義型での受け渡し方のサンプル
create TYPE ATTACHED_FILE IS object(
FILE_NAME NVARCHAR2(256),
content blob
);
/
CREATE OR REPLACE package ODP_BLOB_TEST
is
type ATTACHED_FILES is table of ATTACHED_FILE index by BINARY_INTEGER;
@seraphy
seraphy / gist:2105194
Created March 19, 2012 09:33
Oracle11gR2 で、SELECT文のIN句のパラメータに配列データを渡し、その結果をカーソルとして受け取るサンプル.
using System;
using System.Configuration;
using System.Data;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Oracle.DataAccess.Client;
using Oracle.DataAccess.Types;
namespace odptest
@seraphy
seraphy / DeflateSample.java
Created July 4, 2012 16:44
Deflate/Inflateの使い方サンプル
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;
/**
@seraphy
seraphy / .java.policy
Created July 6, 2012 05:58
JIDEのDocking FrameworkをJAppletで使う場合の設定例
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";
};
@seraphy
seraphy / PBKDF2WithHmacSHA1.java
Created July 8, 2012 17:47
C#とJAVA間で同じキーとなるパスワード ベースのキー派生機能 (PBKDF2) を実装する方法
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));
}