Category Archives: Windows

FreeMind のファイル(.mm) を一括検索するツール


FreeMind の内部の文字を検索するツールを作りました。昔は ozFreeMindSearcher 0.9.0 RC3 というツールが公開されていたらしいのですが、今はダウンロードできないということで、作ってしまいました。職場で活用されています。

肝心のソースはgithubに上げております。

FreeMindSearcher

2012/05/06 時点での機能

指定されたディレクトリ以下にある、拡張子が”.mm”のファイルをすべて取得して、その中の単語を検索する→単語が見つかった場合、そのノードとファイル名、ディレクトリ名をDataGridView に出力する、といった単純なものです。

AND 検索 、OR 検索 はできません。

アプリケーションだけほしい人は、release フォルダの中の FreeMindSearcher.exe を持っていってください。 動かすには .Net Framework 2.0 が必要です。 32bit アプリケーション です。

やっていることの説明

FreeMind のファイルを見るとわかるのですが、形式は XML になっていて、それぞれのノードは node タグ になっています。そして、テキスト部分は TEXT 属性 なので、TEXT 属性 を検索するようにします。ただし、TEXT 属性の値は HTMLエンコード (漢字5文字ぐらいでなんか言い方があったはず) されていますので、検索前に検索文字列を HTMLエンコード しています。

Search ボタン をクリックすると、まず、検索する語句がHTMLエンコードされます。 次に、getMMFiles が指定ディレクトリ以下のマインドマップのファイルパスを再帰的に取得します。最後に searchFile がファイルの中を 検索して、ヒットしたものを DataGridView に出力します。searchFile は単一のファイルについての処理なので、一つ一つのファイルについて searchFile を実行しています。

処理部分のコード

Visual C++ 2005 で作りましたが、 Windows でしか使えないので少し後悔しています。

きれいじゃないのは本人が一番よく分かっています。

DataGridView に表示するところは、HTMLのデコードをしなくても表示されました。自動でデコードされるんでしょうか。 DataGridView の各種プロパティなどは結構手を抜いています。


Expand Partition size (Windows XP)


You can expand or erase a partition size in Windows XP with normally installed software.

But only non-system and NTFS partition with continuous blank space in the disk (or with distanced blank space in dynamic disk).

Well then, 1st, type “diskpart” and press enter in command prompt, and you can see “DISKPART>”. Type “list volume”, and you can see partitions used in your machine, then remember the volume number which you want to extend. 2nd, type “select volume N”(N is the volume number which you remembered). 3rd, type “extend” and press enter, then the volume extended to full size as much as it can be.

If you type “extend size=700″ and press enter, the volume will extend to 700 mega bytes.

This command cannot renounce. So be careful when you use it.


How to Manipulate Field Objects in Crystal Reports


To manipulate objects in Report Designer, you may wonder how to get it done. Once you understand it, it’s a straightforward process, but getting to that point can be challenging. I tried doing it with VB.NET:

It involves some intricate work like casting (type conversion) to make properties accessible.

It seems that DirectCast is less resource-intensive than CType. You can find information about C# in the following page:

Reference: Crystal Reports

While it appears that you can’t vertically align text in the middle in Crystal Reports, this method might allow fine adjustments through the Location setting of the field.