先頭からいくつかの文字を検索する

clock March 21, 2008 05:00 by author
System.String クラスの IndexOf メソッドを使用すると、先頭から文字を検索することができます。 これとは別で IndexOfAny メソッドというメソッドがあります。 IndexOfAny メソッドは Char 型の配列を指定し、その配列内に存在する文字のいずれかがヒットした最初のインデックス値を返します。 [More]

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


[C#,VB,JAVA]Excel を起動または終了する

clock March 18, 2008 01:08 by author
Excel アプリケーションは、Excel.Application のインスタンスを生成し、Visible を true に設定することで表示されます。 終了させる場合は Quit メソッドを使用しますが、その後に System.Runtime.InteropServices.Marshal クラスの ReleaseComObject メソッドを使用して、COM オブジェクトを解放しなければなりません。 [More]

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


JAVA Servlet、JSP + Oracle9i - JDBC、テーブル構造リスト一覧表示

clock March 4, 2008 22:51 by author
テーブル構造リスト一覧表示 ・各テーブルのテーブル構造リスト一覧を表示するには、次のようにする。 [More]

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


SMTP メール送信、javax.mail、MimeMessage [JAVA Servlet、JSP 基礎編 ]

clock March 4, 2008 22:18 by author
SMTP メール送信 mail.jar、activation.jar を使用して、メール送信を行ってみた。 例の S-JIS の扱いが変わったため、MS932 では ? になるコードはないのだが、 メールサーバによっては MS932 ではうまく表示できない。 よって、メールは iso-2022-jp を使うしかない。 この場合、「-」、「~」などが ? になってしまう。 replace で半角コードに置き換える手しかないように思う [More]

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


【C#,VB,StringFormat】指定の書式の文字列に変換する

clock January 28, 2008 04:44 by author
指定の書式の文字列に変換するには、System.String クラスの Format メソッドを使用します。 Format メソッドにはいくつかのオーバーロードがあり、書式設定する項目がいくつでも渡すことができます。 また、リテラル文字と混在させても安全に処理できるように、{ } 内で展開することもできます。 C#     // 指定した書式設定を使用して文字列を取得する     string stPrompt = string.Format("{0:00000}", 123); ... [More]

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


[C#,VB,Java]文字列の一部をバイト単位で取り出す (LeftB, MidB, RightB)

clock January 27, 2008 12:40 by author
旧システムなどの外部連携のために、テーブルに格納するデータにバイト制限をかける場合があります。 良くあるのが、半角を 1 バイト、全角を 2 バイトでカウントして規定の長さに収めるなどです。System.String クラスの Substring メソッドでは、文字単位でしか指定ができません。 というよりは、半角または全角という概念は消滅しつつあります。 (Unicode や UTF-8 の文字コードを参照) [More]

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


[C#,VB.Net,Java]StringBuilder で高速に文字列を処理する

clock January 27, 2008 12:24 by author
なるべく高速に文字列を処理するには、StringBuilder クラスを使用します。 頻繁に文字列に対して処理が発生する場合に使用すると効果的です。 ある程度、使用するサイズが決まっている場合は Capacity プロパティに値をセットしておきます。 Capacity プロパティは現在の Length より低い値に設定すると ArgumentOutOfRangeException が発生します。 その他、StringBuilder クラスのメンバには、String クラスと同じようなものが多数存在します。 詳しくは、String クラスの Tips をご覧ください。 [More]

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


Super CSV v1.15 - free jar

clock January 27, 2008 07:47 by author
We are very excited to present yet another release of Super CSV, version 1.15. Super CSV is a free CSV reader writer with a wealth of features suit all your CSV needs. This release is a "maturity release" -- with focus on improving robustness and speed over introducing new features. High... [More]

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


[How To] [Java] Swingで丸い(円形)のボタンを作成

clock November 1, 2007 00:49 by author
Swingで丸い(円形)のボタンを作成 円形のボタンを作成するには、次のようにします。 1.描画メソッド(paintComponent())を円を描くものに置き換える 2.円の内側をクリックしたときだけボタンが反応するよう設定する [More]

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


[How To][C#,Vb.Net,vb6,j#]ADO.NET で SQL Server に接続する

clock October 24, 2007 23:26 by author
ADO.NET で SQL Server に接続するには、System.Data.SqlClient.SqlConnection クラスの Open メソッドを使用します。 接続先や方法は、接続文字列と呼ばれる情報によって Open メソッドよりも前に指定しておく必要があります。 この接続文字列は、System.Data.SqlClient.SqlConnection クラスの ConnectionString プロパティにて指定します。 接続文字列は、一連のキーワードに対する値のペアをセミコロンで区切った形で指定されます。 通常は Windows 認証で接続を... [More]

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


[How To] 新しい Excel ブックを追加する

clock October 24, 2007 09:52 by author
新しく Excel ブックを追加するには、Excel.Workbooks インターフェイスを実装したオブジェクトから Add メソッドを使用します。 COM オブジェクトを扱うことになります。 必ず、COM オブジェクトの参照カウントを解放する をご覧ください。 C#     // Excel.Application の新しいインスタンスを生成する     Excel.Application xlApplication = new Excel.Application();   &... [More]

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


[How To] [Java] メール受信クライアント

clock October 23, 2007 01:27 by author
telnetと同じような操作をjavaで実現するプログラムです。 import java.net.*; import java.io.*; public class pop3 {  final int POP3_PORT = 110;  final String crlf = "\r\n";  BufferedReader iPop3 = null;  BufferedWriter oPop3 = null;  Socket pop = null;  public vo... [More]

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


iBATIS一覧

clock October 16, 2007 22:26 by author
iBATIS一覧   iBATIS は O/Rマッピングツールといわれるフレームワークのひとつ。 Apache プロジェクトで開発されている。 特徴  O/R マッピングツールであるが、Hibernate 等と違うのは SQL がそのまま使えること。 インストール  次のダウンロードサイトなどから ibatis-x.x.x.xxx.zip (最新版) を取得して、 適当なフォルダに展開する。 iBATIS - apache.org Java 版 .NET 版 出てきたファイルを... [More]

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


Java Tips

clock October 12, 2007 06:10 by author
コンパイル時に「未チェックまたは安全ではありません」という警告が出る(エラーではないので実行はできるようです) これは,Java5.0からは,型チェックが厳しくなったためです. 例えばCollectionクラスの1つであるVectorでは,宣言時に格納するオブジェクトの型を指定できるようになっています. このように格納するオブジェクトの方を指定してやれば警告が消えます. java.util.Vector; public class Hoge{ public static void main(String [] args) { Vector<String> strArr... [More]

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


Java Tips

clock October 12, 2007 06:10 by author
コンパイル時に「未チェックまたは安全ではありません」という警告が出る(エラーではないので実行はできるようです) これは,Java5.0からは,型チェックが厳しくなったためです. 例えばCollectionクラスの1つであるVectorでは,宣言時に格納するオブジェクトの型を指定できるようになっています. このように格納するオブジェクトの方を指定してやれば警告が消えます. java.util.Vector; public class Hoge{ public static void main(String [] args) { Vector<String> strArr... [More]

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


Search

Calendar

<<  January 2009  >>
SuMoTuWeThFrSa
28293031123
45678910
11121314151617
18192021222324
25262728293031
1234567

Archive

Tags

Categories


Blogroll

    Disclaimer

    The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

    © Copyright 2009

    Sign in