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
CREATE OR REPLACE PACKAGE WKD_PKG AS | |
/* | |
営業日パッケージ | |
※土曜、日曜が営業日の場合は、IS_WORKDAYを直す | |
※国民の祝日が営業日の場合は、休日テーブルを直す | |
-- 休日テーブル(祝祭日、お盆とか、都民の日とかも) | |
create table holidays ( | |
holiday date, |
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
CREATE OR REPLACE FUNCTION hanzen(str in VARCHAR2) RETURN VARCHAR2 | |
/* | |
全角のアルファベット、数字を半角にして、半角カナを全角にして、他の記号もいい感じにする | |
*/ | |
IS | |
tmp varchar2(2000); | |
BEGIN | |
tmp := alnum2han(han2zen(str)); | |
tmp := translate( | |
tmp, |
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
CREATE OR REPLACE FUNCTION alnum2han(str in VARCHAR2) RETURN VARCHAR2 | |
/* | |
全角のアルファベット、数字を半角にする | |
*/ | |
IS | |
tmp varchar2(2000); | |
BEGIN | |
tmp := translate( | |
str, | |
'1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz', |
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
/* Oracle用 ISBNパッケージ | |
10桁と13桁のISBNを相互に変換する。チェックデジットの計算もできる。 | |
http://www.isbn-center.jp/ | |
$Id: pkg_isbn.sql,v 1.5 2005/11/07 02:12:27 ymo Exp $ | |
*/ | |
CREATE OR REPLACE PACKAGE ISBN_PKG AS | |
/* | |
|| 入力されたISBNをチェックデジットを付けたりいろいろする。 |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
"""flickr.pyの利用サンプル。 http://code.google.com/p/flickrpy/ | |
Flickrから指定したユーザの全ての写真を取得してローカルディスクに保存する。 | |
もしかすると無料アカウントでは最大200件に制限されているのかもしれない。 | |
自分の写真をダウンロードするために作ったので、他人の写真でも使えるかどうかは未確認。 | |
2010-08-24 サイズは固定だとダメっぽいので最大サイズをダウンロードするように変更。 | |
flickr.pyのisadminがどうこうというエラーが出たら、エラー行をコメントアウトすればOK。 | |
""" |
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
/** | |
* ユーザ認証管理パッケージ | |
* テーブルUSER_AUTHとパッケージAUTH_PKGで構成される。 | |
* ユーザIDとパスワードはMD5ダイジェストとして格納される。 | |
* Oracle9i以降専用!! | |
* | |
* ユーザIDの管理(あるユーザIDは誰か?など)は当パッケージを利用するシステムの責任 | |
* ユーザIDを登録(REGIST_USER)、削除(DROP)、パスワード認証(AUTHENTICATE)などを管理する | |
* | |
* クラス:ユーザIDのクラス。ユーザIDはクラス内でユニークである必要がある。 |
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
,******************************************** | |
, カンマで始まる行はコメント行 | |
,******************************************** | |
,カンマで区切って、作成場所、タイトル,パス,作業ディレクトリ,引数1,引数2,引数3,...の順に書いておくと | |
,作成場所(デスクトップなど)にショートカットを作る | |
,作成場所に指定できるのは次のものだけ | |
, AllUsersDesktop | |
, AllUsersStartMenu |
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
'##################################################### | |
' ショートカット作成スクリプト | |
' 設定ファイル複数受付版 | |
'##################################################### | |
Const FOR_READING = 1 | |
Const COL_FOLDER = 0 | |
Const COL_SUB_FOLDER = 1 | |
Const COL_TITLE = 2 | |
Const COL_PATH = 3 | |
Const COL_WORK = 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
class Config(DefaultConfig): | |
"""MoinMoinのカスタム認証スクリプトmyauth.loginを使うようにwikiconfig.py | |
で認証方法を指定。 | |
""" | |
from MoinMoin.auth import moin_session,myauth | |
auth = [myauth.login, moin_session] | |
#MoinMoin内のPreferenceを自動的に作成する | |
user_autocreate = True |
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
-- PostgreSQLのルールシステムを使った論理削除の例 | |
-- 削除フラグと削除日時を保持するフィールドを持ったテーブルを作成 | |
CREATE TABLE a( | |
id serial PRIMARY KEY, | |
value text, | |
deleted boolean DEFAULT False, | |
deleted_on timestamp DEFAULT 'infinity' | |
); | |
-- DELETEが実行されたら代わりに削除フラグを立てて削除日時をセットするルール | |
CREATE RULE a_delete_rule AS ON DELETE TO a |