2008-01-01から1年間の記事一覧

getElementsByNameの罠

document.getElementsByName(hoge).valueとか打って、20分くらい頭抱えた。 結局document.getElementsByName(hoge)[0].value エレメントじゃなくてエレメンツって言ってるだけあって 返り値が配列だよ、っと。

表示用のDTOと、フォーム用のDTOは分けるべきである

表示用のDTOと、フォーム用のDTOは分ける

skypeの過去発言編集機能は、linux環境相手には通用しない

windowsから発言編集しても、linux相手には適応されない

eclipseではjarは作れない、たまに作れることもある

らしい 気が向いたら調べてみよう

windows native postgresが壊れた

膨大なデータに対してsql打ってたら返事がなくなった。 メニューのリロードや、サービスの停止、開始しても動く気配がない。 コマンドプロンプトから呼びかけても応じない。 時間もなかったし、データは残るので再インストールを試みた。 その際いろいろ…

outlookの返信、新規作成で固まる

Wordを起動し以下の手順を行ってみて下さい。 * メニュー「オプション」 * 編集と日本語入力タブ「日本語入力システムの設定」ボタンを押す * 辞書/学習タブ「参照」ボタンを押す * ファイル名の先頭に0などをつけて「開く」ボタンを押す http://q.hatena.ne…

IE7からIE6に戻す

スタンドアロンIEがクッキーを使えない為、 IE7からIE6に戻すことになた。 windows xp sp3を入れてからIE7にした場合、 IE7をアンインストールすればIE6に戻ることが出来る。 その際いろいろと影響が出る(各地でエラーが発生する)為、 復元ポイントを設定…

postgres8.0に、依存関係のあるpostgres8.1のdumpをrestoreするとエラーが出まくる

postgres8.1系のdumpファイルを8.0系のpostgresにrestoreしようとすると、 順番がバラバラにcreate文が走ってエラーしまくりの穴だらけになった。 依存関係が無い場合は大丈夫なんだろうけど、 依存しまくってるDBの場合は駄目らしい。 なるほど。

Windows XP SP2でSQL Serverのネットワークを有効にする場合は、ファイヤーウォールの設定が必要

SQL Server 2005でネットワーク接続を有効にするには?

Visual Studio + Subversion

C#

Visual Studio用クライアント「AnkhSVN」

incompatible with → 〜と非互換

compatible → 互換

S2TestCase

クラス S2TestCase

Project Euler 4

Project Euler Problem 4 A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 99.Find the largest palindrome made from the product of two 3-digit numbers. A palindro…

SQL server 2003でTEXT型の文字数を数える

TEXT型を一度nvarchar型(unicode)に変換し、LEN関数で数える SELECT LEN(CAST(text_colum AS nvarchar(4000))) FROM table_name SQL server 2005以降は、nvarcharの最大項目長が2Gまでだが、 SQL server 2003ではnvarcharの最大項目長が4000文字までとなっ…

FileDialogでファイルを開いたら、CurrentDirectryが変わっとるッス

C#

いつの間にかカレントディレクトリがアセンブリPATHからDialogで開いたPATHになっとる>< //カレントディレクトリを戻す openFileDialog1.RestoreDirectory = true; DialogResult ret = openFileDialog1.ShowDialog(); if (ret == DialogResult.OK) { //処…

Project Euler 3 補足

private static void getMaxPrimeFactor(long b) { long maxprime = 0; for(long i=0; i <= b;i++) { if(isPrimeNum(i) && b % i == 0) { if(maxprime <= i) { maxprime = i; } b = b / i; //ここは1だろJK i = 1; } } System.out.println(maxprime); }

Project Euler 3

Project Euler Problem 3 The prime factors of 13195 are 5, 7, 13 and 29. What is the largest prime factor of the number 600851475143 ? prime factors→素因数 13195の素因数は、5,7,13,29だ。 600851475143の素因数の中で一番大きな数は何だ。 jav…

素数を求めるプログラムをすぐに打ち込めなかった

Project Euler 3やろうとしたら、 素数を求めるプログラムがなかなか出てきませんでした。javaで最大の素数を取ってこようとする public static void main(String[] args) { getMaxPrimeNum(100); // 97 } private static void getMaxPrimeNum(int b) { int…

表における行を、タプル(tuple)

SQL

テーブルをタプルの集合としてみて論ずるとき,テーブルのことをリレーションという。 リレーショナル・データベースの概要より タプルじゃない・・かな?

副問い合わせテーブルはインデックスが無いから遅くなる

SQL

voice_artist(声優テーブル) id name charactor(キャラテーブル) charactor_id charactor_name fighting_power voice_artist_id SELECT a.id,a.name FROM artist AS a JOIN ( SELECT voice_artist_id, sum(fighting_power) AS sumpower FROM charactor G…

Project Euler 1

Project Euler If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.Find the sum of all the multiples of 3 or 5 below 1000. multiples→倍数 below 10→10未満 10未満の…

Project Euler 2

Project Euler Problem 2 Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be:1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...Find the sum of all the even-valued t…