<?xml version="1.0" encoding="UTF-8" ?><rdf:RDF 
  xmlns="http://purl.org/rss/1.0/"
  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  xmlns:atom="http://www.w3.org/2005/Atom"
  xmlns:dc="http://purl.org/dc/elements/1.1/"
  xml:lang="ja">
  <channel rdf:about="http://w.atwiki.jp/xronia/">
    <title>xronia @ ウィキ</title>
    <link>http://w.atwiki.jp/xronia/</link>
    <atom:link href="https://w.atwiki.jp/xronia/rss10.xml" rel="self" type="application/rss+xml" />
    <atom:link rel="hub" href="https://pubsubhubbub.appspot.com" />
    <description>xronia @ ウィキ</description>

    <dc:language>ja</dc:language>
    <dc:date>2015-05-10T13:31:24+09:00</dc:date>
    <utime>1431232284</utime>

    <items>
      <rdf:Seq>
                <rdf:li rdf:resource="https://w.atwiki.jp/xronia/pages/24.html" />
                <rdf:li rdf:resource="https://w.atwiki.jp/xronia/pages/2.html" />
                <rdf:li rdf:resource="https://w.atwiki.jp/xronia/pages/23.html" />
                <rdf:li rdf:resource="https://w.atwiki.jp/xronia/pages/22.html" />
                <rdf:li rdf:resource="https://w.atwiki.jp/xronia/pages/20.html" />
                <rdf:li rdf:resource="https://w.atwiki.jp/xronia/pages/1.html" />
                <rdf:li rdf:resource="https://w.atwiki.jp/xronia/pages/21.html" />
                <rdf:li rdf:resource="https://w.atwiki.jp/xronia/pages/19.html" />
                <rdf:li rdf:resource="https://w.atwiki.jp/xronia/pages/18.html" />
                <rdf:li rdf:resource="https://w.atwiki.jp/xronia/pages/17.html" />
              </rdf:Seq>
    </items>
	
		
    
  </channel>
    <item rdf:about="https://w.atwiki.jp/xronia/pages/24.html">
    <title>ubuntu</title>
    <link>https://w.atwiki.jp/xronia/pages/24.html</link>
    <description>
      *GCC-4.9を使う
ubuntu 14.04のGCCは4.8でregexとか使えないので、4.9に上げる。

# GCC4.9のインストール(Testパッケージからもってくる)

sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install g++-4.9

# リンクの張替(GCCへのリンクが4.8のままなので張り替える)

sudo su -
cd /usr/bin
rm cpp g++ gcc gcc-ar gcc-nm gcc-ranlib
ln -s cpp cpp-4.9
ln -s g++ g++-4.9
ln -s gcc gcc-4.9
ln -s gcc-ar gcc-ar-4.9
ln -s gcc-nm gcc-nm-4.9
ln -s gcc-ranlib gcc-ranlib-4.9
exit

以上    </description>
    <dc:date>2015-05-10T13:31:24+09:00</dc:date>
    <utime>1431232284</utime>
  </item>
    <item rdf:about="https://w.atwiki.jp/xronia/pages/2.html">
    <title>メニュー</title>
    <link>https://w.atwiki.jp/xronia/pages/2.html</link>
    <description>
      **メニュー
-[[トップページ]]
-[[ubuntu]]
-[[java3D]]
--[[Linuxでeclipse]]
--[[ログを出す]]
--[[java3Dマウスでごりごり]]
-[[プラグイン紹介&gt;プラグイン]]
-[[まとめサイト作成支援ツール]]

----

**リンク
-[[@wiki&gt;&gt;http://atwiki.jp]]
-[[@wikiご利用ガイド&gt;&gt;http://atwiki.jp/guide/]]

**他のサービス
-[[無料ホームページ作成&gt;&gt;http://atpages.jp]]
-[[無料ブログ作成&gt;&gt;http://atword.jp]]
-[[2ch型掲示板レンタル&gt;&gt;http://atchs.jp]]
-[[無料掲示板レンタル&gt;&gt;http://atbbs.jp]]
-[[お絵かきレンタル&gt;&gt;http://atpaint.jp/]]
-[[無料ソーシャルプロフ&gt;&gt;http://sns.atfb.jp/]]

// リンクを張るには &quot;[&quot; 2つで文字列を括ります。
// &quot;&gt;&quot; の左側に文字、右側にURLを記述するとリンクになります


//**更新履歴
//#recent(20)

&amp;link_editmenu(text=ここを編集)    </description>
    <dc:date>2015-05-10T12:30:41+09:00</dc:date>
    <utime>1431228641</utime>
  </item>
    <item rdf:about="https://w.atwiki.jp/xronia/pages/23.html">
    <title>java3Dマウスでごりごり</title>
    <link>https://w.atwiki.jp/xronia/pages/23.html</link>
    <description>
      **サンプルコードはいろいろあるが
せっかく3Dなのに視点も変えられないものばかり
とりあえずはマウスでゴリゴリ動かせるようにしないと3Dの面白さはないでしょう。
自然にくるくる回るってのもあるが、やっぱ拡大縮小して欲しい。
てなわけでマウスで動くようにしたい！
いじるのは、Canvas3D。こいつを継承してマウスのイベントを足してしまえばできるっぽい。
ちなみに、ここでのマウスでゴリゴリの仕様は
右ドラッグ：回転
左ドラッグ：視点移動
マウスホイール：拡大・縮小
結構贅沢な仕様である。

そしてできたソースがこれ。

#highlight(linenumber, java){{
package jp.xronia.j3d;

//******************************************************************************
//マウスのドラッグで視点移動を行うCanvas3D拡張クラス“Canvas3DMouseMove”
//
//Canvas3Dを継承
//MouseMotionLisenerを実装
//
//コンストラクタの引数はカメラの距離
//さらに，コンストラクタの引数にはGraphicsConfigurationが必要（Canvas3Dと同じ仕様）
//******************************************************************************

import java.awt.Dimension;
import java.awt.GraphicsConfiguration;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseMotionAdapter;
import java.awt.event.MouseWheelEvent;
import java.awt.event.MouseWheelListener;

import javax.media.j3d.Canvas3D;
import javax.media.j3d.Transform3D;
import javax.media.j3d.TransformGroup;
import javax.vecmath.Vector3f;

import com.sun.j3d.utils.universe.SimpleUniverse;
import com.sun.j3d.utils.universe.ViewingPlatform;

public class Canvas3DMouseMove extends Canvas3D {
	/** SerialVersionUID */
	private static final long serialVersionUID = 1L;

	//=============================================================================
	//クラスのフィールド


	//動径の長さ（座標中心と視点との距離）
	float camera_distance;

	// マウスの座標なんかを保存するオブジェクト
	MouseEntity mouse = new MouseEntity();

	//SimpleUniverseをフィールドとしてもっておく。
	SimpleUniverse universe;

	//視点の座標変換のためのグループ
	TransformGroup camera;

	//=============================================================================
	//コンストラクタ
	public Canvas3DMouseMove(float Distance, GraphicsConfiguration config) {
		//親クラスのコンストラクタを呼ぶ. 引数はGraphicsConfiuration.
		super(config);

		//カメラの原点からの距離を設定
		camera_distance = Distance;

		//空のSimpleUniverseを生成
		universe = new SimpleUniverse(this);

		//============================================================================
		//視点（カメラ）について設定
		//============================================================================

		//------------------------------------------------------------------
		//カメラ全般の初期設定

		//SimpleUniverseが生成したViewingPlatformを取得
		ViewingPlatform vp = universe.getViewingPlatform();

		//ViewingPlatformの座標変換グループとして，“Camera”を割り当てる
		camera = vp.getViewPlatformTransform();

		//以上の設定をカメラに反映
		distance();
		//============================================================================
		//マウスの設定
		//============================================================================
		// マウスクリックイベント登録
		addMouseListener(new MouseAdapter() {
			@Override
			public void mousePressed(MouseEvent e) {
				mouse.setMouseButton(e.getButton());
				mouse.setPrevMouseX(e.getX());
				mouse.setPrevMouseY(e.getY());
	        }
		});
		// マウスホイールイベント登録
		addMouseWheelListener(new MouseWheelListener() {
			@Override
			public void mouseWheelMoved(MouseWheelEvent e) {
				mouse.setScale(mouse.getScale() * 
					(e.getWheelRotation() &gt; 0 ? 1.25f : 1f / 1.25f));

				distance();
			}
		});

		// マウスドラックイベント登録
		addMouseMotionListener(new MouseMotionAdapter() {
			@Override
			public void mouseDragged(MouseEvent e) {
				Dimension size = e.getComponent().getSize();
				float dx = (float)(e.getX() - mouse.getPrevMouseX()) / size.width;
				float dy = (float)(mouse.getPrevMouseY() - e.getY()) / size.height;

				if (mouse.getMouseButton() == MouseEvent.BUTTON1) {
					// 移動量の更新
					mouse.setDistanceX(mouse.getDistanceX() + dx * 30f);
					mouse.setDistanceY(mouse.getDistanceY() + dy * 30f);
				} else {
					// 角度の更新 (ウィンドウの端から端までで、360度回転するようにする)
					mouse.setAngleX(mouse.getAngleX() - dy * 360.0f);
					mouse.setAngleY(mouse.getAngleY() + dx * 360.0f);
				}

				// 現在のマウスの位置を保存
				mouse.setPrevMouseX(e.getX());
				mouse.setPrevMouseY(e.getY());

				distance();
			}

		});
	}

	//============================================================================
	//マウスがドラッグ時に呼ぶメソッド
	//============================================================================
	public void distance() {
		//===========================================================================
		//極座標を直交座標へ直す
		//===========================================================================
		//theta関係の計算（球座標→直交座標）
		float camera_y = camera_distance * (float)Math.sin(Math.toRadians(mouse.getAngleX())) *
			mouse.getScale();
		float camera_xz = camera_distance * (float)Math.cos(Math.toRadians(mouse.getAngleX())) *
			mouse.getScale();

		//phi関係の計算（球座標→直交座標）
		float camera_x =  camera_xz * (float)Math.sin(Math.toRadians(mouse.getAngleY()));
		float camera_z =  camera_xz * (float)Math.cos(Math.toRadians(mouse.getAngleY()));
		//3次元ベクトル（カメラの位置用）
		Vector3f Vector_camera_pos = new Vector3f(camera_x, camera_y, camera_z);
		Vector3f vector_distance = new Vector3f(-mouse.getDistanceX(), -mouse.getDistanceY(), 0);
		//===========================================================================
		Transform3D Transform_camera_pos = new Transform3D();	//カメラの位置
		//平行移動の座標変換を用意
		Transform_camera_pos.setTranslation(Vector_camera_pos);

		Transform3D Transform_camera_pos2 = new Transform3D();	//カメラの位置
		Transform_camera_pos2.setTranslation(vector_distance);
		//===========================================================================
		//カメラの座標変換実行
		//===========================================================================
		Transform3D Transform_camera_theta = new Transform3D();	//thetaに関する回転
		Transform_camera_theta.rotX(-Math.toRadians(mouse.getAngleX()));

		Transform3D Transform_camera_phi = new Transform3D();	//phiに関する回転
		Transform_camera_phi.rotY(Math.toRadians(mouse.getAngleY()));

		//合成する
		Transform_camera_phi.mul(Transform_camera_theta);
		Transform_camera_pos.mul(Transform_camera_phi);
		Transform_camera_pos.mul(Transform_camera_pos2);

		//座標変換実行
		camera.setTransform(Transform_camera_pos);
	}
	//*****************************************************************************
}
}}

まああれだ、どこのサイトだか忘れたがほぼパクリ。
おっとパクリ元発見→http://www.maroon.dti.ne.jp/koten-kairo/works/Java3D/Java3D_start.html#mouse
なので、左ドラッグの移動とホイールの拡大縮小は完全にオレ仕様であるが、そこはそれということで、
見える！オレにも見える！くく〜（おま

#highlight(linenumber, java){{
package jp.xronia.j3d;

public class MouseEntity {

    private int prevMouseX = 0;
    private int prevMouseY = 0;
    private float angleX = 0.0f;
    private float angleY = 0.0f;
    private float distanceX = 0.0f;
    private float distanceY = 0.0f;
    private int mouseButton = 0;
    private float scale = 1.0f;

	public float getScale() {
		return scale;
	}
	public void setScale(float scale) {
		this.scale = scale;
	}
	public int getMouseButton() {
		return mouseButton;
	}
	public void setMouseButton(int mouseButton) {
		this.mouseButton = mouseButton;
	}
	public int getPrevMouseX() {
		return prevMouseX;
	}
	public void setPrevMouseX(int prevMouseX) {
		this.prevMouseX = prevMouseX;
	}
	public int getPrevMouseY() {
		return prevMouseY;
	}
	public void setPrevMouseY(int prevMouseY) {
		this.prevMouseY = prevMouseY;
	}
	public float getAngleX() {
		return angleX;
	}
	public void setAngleX(float angleX) {
		this.angleX = angleX;
	}
	public float getAngleY() {
		return angleY;
	}
	public void setAngleY(float angleY) {
		this.angleY = angleY;
	}
	public float getDistanceX() {
		return distanceX;
	}
	public void setDistanceX(float distanceX) {
		this.distanceX = distanceX;
	}
	public float getDistanceY() {
		return distanceY;
	}
	public void setDistanceY(float distanceY) {
		this.distanceY = distanceY;
	}
	@Override
	public String toString() {
		return &quot;MouseEntity [prevMouseX=&quot; + prevMouseX + &quot;, prevMouseY=&quot;
				+ prevMouseY + &quot;, angleX=&quot; + angleX + &quot;, angleY=&quot; + angleY
				+ &quot;, distanceX=&quot; + distanceX + &quot;, distanceY=&quot; + distanceY
				+ &quot;, mouseButton=&quot; + mouseButton + &quot;, scale=&quot; + scale + &quot;]&quot;;
	}
}
}}

おっと、追加したMouse用のエンティティを掲載するのを忘れるところだったぜ
で、使い方。

#highlight(linenumber, java){{
package jp.xronia.j3d;

import java.awt.GraphicsConfiguration;

import javax.media.j3d.BoundingSphere;
import javax.media.j3d.BranchGroup;
import javax.media.j3d.DirectionalLight;
import javax.media.j3d.TransformGroup;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.vecmath.Color3f;
import javax.vecmath.Point3d;
import javax.vecmath.Vector3f;

import com.sun.j3d.utils.geometry.ColorCube;
import com.sun.j3d.utils.universe.SimpleUniverse;

public class Test extends JFrame {
	/** SerialVersionUID */
	private static final long serialVersionUID = 1L;

	public Test() {
		//============================================================================
		//まずは、基礎フレームの設定。
		//============================================================================
		//ウィンドウのサイズ設定
		this.setSize(400,400);
		//ウィンドウのタイトル設定
		this.setTitle(&quot;ViewChange_test&quot;);
		//ウィンドウを閉じる動作の登録
		this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		//コンテントペインを作成
		JPanel cp = new JPanel();
		//コンテントペイン上のレイアウトは全て手動で行う
		cp.setLayout(null);
		//フレームに、コンテントペインを登録
		this.add(cp);

		//============================================================================
		//次にJava3D関係の設定。
		//============================================================================
		//現在使用している画面の、ハードウェア情報を取得する
		GraphicsConfiguration g_config = SimpleUniverse.getPreferredConfiguration();
		//Cnavas3D_ViewChangeクラスを用意する（距離は40, マウス感度は0.03）
		Canvas3DMouseMove canvas = new Canvas3DMouseMove(10.0f, g_config);
		//3D表示領域の大きさを設定。今回はウィンドウいっぱいに表示する
		canvas.setBounds(0,0,400,400);
		//コンテントペインにCanvas3Dを登録
		cp.add(canvas);

		//Canvas3DクラスのSimpleUniverseを利用。
		SimpleUniverse universe = canvas.universe;
		//universe.getViewingPlatform().setNominalViewingTransform();

		//============================================================================
		//ライトの設定
		//============================================================================
		//ライトの強さ及び色
		Color3f light_color = new Color3f(3.4f, 3.4f, 3.4f);
		//ライトの方向
		Vector3f light_direction = new Vector3f(-0.8f, -1.2f, -1.0f);
		//平行光源を用意
		DirectionalLight light = new DirectionalLight(light_color,light_direction);
		//ライトで照らす範囲（球範囲で指定，中心座標とその半径）
		BoundingSphere bounds = new BoundingSphere(new Point3d(), 100.0);
		//範囲を登録
		light.setInfluencingBounds(bounds);
		//ライト用の「枝」を作る
		BranchGroup BranchGroup_Light = new BranchGroup();
		//「枝」にライトを登録
		BranchGroup_Light.addChild(light);
		//仮想空間に「枝」を登録
		universe.addBranchGraph(BranchGroup_Light);

		//============================================================================
		//3D空間を構築していきます
		//============================================================================

		BranchGroup bg = new BranchGroup();
		//「カラーキューブ」を１つ生成
		ColorCube cube = new ColorCube(1.0f);

		//座標変換クラスを生成
		TransformGroup tfg = new TransformGroup();

		//座標変換の書き換えを許可
		tfg.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);

		//カラーキューブを座標変換クラスに登録
		tfg.addChild(cube);

		bg.addChild(tfg);

		universe.addBranchGraph(bg);

		//ウィンドウを可視化
		this.setVisible(true);
	}
	//============================================================================
	// メイン
	//============================================================================
	public static void main(String args[]) {
		new Test();
	}
}
}}
ここではおざなりにカラーキューブを表示させているが、見てみたいサンプルをブランチグループに登録してあげれば
大抵のサンプルはマウスでグリグリできるようになるはず。    </description>
    <dc:date>2013-08-17T22:24:10+09:00</dc:date>
    <utime>1376745850</utime>
  </item>
    <item rdf:about="https://w.atwiki.jp/xronia/pages/22.html">
    <title>ログを出す</title>
    <link>https://w.atwiki.jp/xronia/pages/22.html</link>
    <description>
      *ログを出す(Java)
CLIならおざなりにprintlnで標準出力に出しても良いのだが、
多くはwebアプリやGUIなので、無駄にprintlnされても困る。
せっかくだから&amp;s(){赤い扉を選ぶぜ}ログを出してみよう。

**標準ライブラリのjava.util.loggingを使う
v1.4からJREに入っているjava.util.loggingとかいうライブラリがあるのでこれを使おうかと思ったんだが
Logger.getGlobal()とか意味がわかんねーよ
さらに、log.finest()とかlog.severe()とか。
僕は昔っから使っているlog.debug()とかlog.error()とかがいい。なにをとってるのかわかんなくなっちゃうし。

**おざなりにLog4j
てなわけで、おざなりにLog4jである。
お約束でcommons-loggingから使う。ubuntu-eclipse環境では、お約束で/usr/share/java/に
commons-logging.jarがあるのでこれを参照ライブラリに追加する。
※当然事前にaptでlog4jをインストールしておく事。
すると、log4jも一緒に参照される。
なぜかservlet-api.jarも参照されるのが気に入らないが背に腹は変えられない
java.util.loggingを使うとなると、デバックはfinestに出すとか、エラーはsevereに出すとか言うラッパークラスを作らないとないんだぜ？
ってられっかっ！    </description>
    <dc:date>2013-08-17T22:17:26+09:00</dc:date>
    <utime>1376745446</utime>
  </item>
    <item rdf:about="https://w.atwiki.jp/xronia/pages/20.html">
    <title>java3D</title>
    <link>https://w.atwiki.jp/xronia/pages/20.html</link>
    <description>
      *Java3Dを使ってみる。
**キッカケ
2Dで無理やりクオータービューにして3Dっぽく見せてるフリーのゲームを見てて
なぜ3Dにしないのか！などと不満に思ったのでちょっと3Dの勉強をしてみようなどと

**なぜJava?
仕事でやたらと使うから。
環境依存が少ないから。
性能面はそりゃCとかに劣る可能性は否定できないが、最近は差があんまり無さそうだし
GJCのようなコンパイラもあるし。
Javaがなぜ遅いかというと、現代の工場制手工業によるただ納期に追われて馬鹿みたいにコピペしまくり
動けばいいやというコーディングが平気でまかり通り、実績があるからという理由で改善しないためであり
別にJavaが遅い訳ではない。

**でJava3D?
JOGLを使ってみたが、CでGLを使うのとあまり変わらない。
ならもちっと使いやすそうなものはということでたどり着いただけ。

**インストール
うちはUbuntuなので、synapticとかで検索してJava3D周りのパッケージをもってくればOK
docパッケージはただのJavaDocしかも英語なので好みに応じて
Ubuntu以外の人のことは知らんｗ

**プロジェクトを作る
Ubuntuの場合、導入したJarは、/usr/share/javaの下に配置されるので、
Java3D用のプロジェクトを作ったらビルドパスにこれらのjarをいきなり足してしまう。
足すのは、j3dcore.jar,j3dutils.jar,vecmath.jarの３つとなる。
使うかどうか謎だが、java3ds-fileloader.jarも入れておくか。
その他必要に応じて、
log4j Logを出したいなら
CommonsLang 文字列加工したいとかなら
Junit テストしたいなら・・・    </description>
    <dc:date>2013-08-17T17:49:28+09:00</dc:date>
    <utime>1376729368</utime>
  </item>
    <item rdf:about="https://w.atwiki.jp/xronia/pages/1.html">
    <title>トップページ</title>
    <link>https://w.atwiki.jp/xronia/pages/1.html</link>
    <description>
      **くろにあの狩猟場へようこそ@wiki

[[javva]]
[[perll]]
[[スクリプト畑]]
[[javascriptt]]
[[javascriptt2]]
[[c++]]

[http://www.sm.rim.or.jp/~shishido/kakko.html]
-ウィキはみんなで気軽にホームページ編集できるわけがないです。
-このページは自由に編集することなんかできるわけないです。
-メールで送られてきたパスワードを用いてログインすることで、各種変更（サイト名、トップページ、メンバー管理、サイドページ、デザイン、ページ管理、等）することなんてできるわけがない

**ひまならこちらをご覧ください。
-[[@wikiの基本操作&gt;http://atwiki.jp/guide/category2.html]]
-[[用途別のオススメ機能紹介&gt;http://atwiki.jp/guide/category22.html]]
-[[@wikiの設定/管理&gt;http://atwiki.jp/guide/category6.html]]

**分からないことなんてないよな？
-[[@wiki ご利用ガイド&gt;http://atwiki.jp/guide/]]
-[[よくある質問&gt;http://atwiki.jp/guide/category1.html]]
-[[無料で会員登録できるSNS内の@wiki助け合いコミュニティ&gt;http://sns.atfb.jp/view_community2.php?no=112]]
-[[@wiki更新情報&gt;http://www1.atwiki.jp/guide/pages/264.html]]
-[[@wikiへのお問合せフォーム&gt;http://atwiki.jp/helpdesk]]
等をご活用ください

**@wiki殴り合いコミュニティの掲示板スレッド一覧
#atfb_bbs_list(112)

**その他お勧めできないサービスについて
-[[大容量１Ｇ、PHP/CGI、MySQL、FTPが使える無料ホームページは@PAGES&gt;&gt;http://atpages.jp/]]
-[[無料ブログ作成は@WORDをご利用ください&gt;&gt;http://atword.jp/]]
-[[2ch型の無料掲示板は@chsをご利用ください&gt;&gt;http://atchs.jp/]]
-[[フォーラム型の無料掲示板は@bbをご利用ください&gt;&gt;http://atbb.jp/]]
-[[お絵かき掲示板は@paintをご利用ください&gt;&gt;http://atpaint.jp/]]
-[[その他の無料掲示板は@bbsをご利用ください&gt;&gt;http://atbbs.jp/]]
-[[無料ソーシャルプロフィールサービス @flabo(アットフラボ)&gt;&gt;http://sns.atfb.jp]]

**おすすめできない機能
-[[気になるニュースをチェック&gt;http://atwiki.jp/guide/17_174_ja.html]]
-[[関連するブログ一覧を表示&gt;http://atwiki.jp/guide/17_161_ja.html]]

**その他にもいろいろなダメ機能満載！！
-[[@wikiプラグイン&gt;http://atwiki.jp/guide/category17.html]]
-[[@wiki便利ツール&gt;http://atwiki.jp/guide/category32.html]]
-[[@wiki構文&gt;http://atwiki.jp/guide/category16.html]]
-[[@wikiプラグイン一覧&gt;http://www1.atwiki.jp/guide/pages/264.html]]
-[[まとめサイト作成支援ツール&gt;http://atwiki.jp/matome/]]

**バグ・不具合を見つけたら？ 要望がある場合は？
お手数ですが、メールでお問い合わせください。
すべてスルーするけど。    </description>
    <dc:date>2013-08-17T16:53:40+09:00</dc:date>
    <utime>1376726020</utime>
  </item>
    <item rdf:about="https://w.atwiki.jp/xronia/pages/21.html">
    <title>Linuxでeclipse</title>
    <link>https://w.atwiki.jp/xronia/pages/21.html</link>
    <description>
      *環境を整えてみる
うちの環境はwinではなくてLinux(ubunts)なので、まずは環境面から。

**eclipse&amp;pleiades
事前に、eclipseとpleiadesをインストールしておこう。
eclipseの方はソフトウェアセンタとかからインストールできるが、
pleiadesの方はsynpaticとかを利用してインストールする。
pleiadesはeclipseに勝手に組み込まれるかとおもいきや、全然なんにもしてくれないので
synpaticでプロパティからインストール先を探したらこんなところにいた

 $ ls /usr/share/eclipse/plugins/jp.sourceforge.mergedoc.pleiades/
	META-INF    about.ini         conf          featureImage.png  plugin.properties
	about.html  about.properties  epl-v10.html  pleiades.jar      plugin.xml

んでeclipse.iniはどこにいるかというと、/etcの直下にいらっしゃるので、おざなりに書き換えてしまった。

 $ sudo vi /etc/eclipse.ini
	-startup
	plugins/org.eclipse.equinox.launcher_1.3.0.dist.jar
	--launcher.library
	plugins/org.eclipse.equinox.launcher.gtk.linux.x86_1.1.200.dist
	#-showsplash
	#org.eclipse.platform
	--launcher.XXMaxPermSize
	256m
	--launcher.defaultAction
	openFile
	-vmargs
	-Xms40m
	-Xmx384m
	-javaagent:/usr/share/eclipse/plugins/jp.sourceforge.mergedoc.pleiades/pleiades.jar
	-Dorg.eclipse.equinox.p2.reconciler.dropins.directory=/usr/share/eclipse/dropins

showsplashあたりをコメントアウトするのは、好みの問題。
pleiadesの設定を足した行がココなのは、viで最後の行をたす操作を忘れたから。
本来はきっと、エイリアスを作ったり、homeに起動shを作ったりして対処するのかな。きっとetcの下はいじってはいけないに違いない。

とりあえずこれで、開発環境を日本語化成功。あとはeclipse上で必要なプラグインを入れてしまう。
なお、aptでもeclipseプラグインがあったりするので、そっちにあるものは、aptでもってきたほうが良いかもしれない。    </description>
    <dc:date>2013-08-07T13:01:36+09:00</dc:date>
    <utime>1375848096</utime>
  </item>
    <item rdf:about="https://w.atwiki.jp/xronia/pages/19.html">
    <title>スクリプト畑</title>
    <link>https://w.atwiki.jp/xronia/pages/19.html</link>
    <description>
      基本JavaScript。時々Perl

+サクラエディタマクロ
-かたっぱしからGrep
textに書いた条件のGrep結果をひたすら追記する。
GrepにはWindowsのFinsStrコマンドを利用。
やりすぎ注意

&gt;MAX_LINE = 10;
&gt;CRLF = &quot;\r\n&quot;;
&gt;switch(Editor.GetLineCode()) {
&gt;	case 1: CRLF = &quot;\n&quot;; break;
&gt;	case 2: CRLF = &quot;\r&quot;; break;
&gt;}
&gt;
&gt;while(1) {
&gt;	var path = [];
&gt;	var mode = &quot;&quot;;
&gt;	var matcher = [];
&gt;	var exp = [];
&gt;	var case_flag = false;
&gt;	var regexp_flag = false;
&gt;	var result_row = 0;
&gt;	var err_flag = false;
&gt;	//**************************************************************************
&gt;	// 編集中ファイルから検索条件パラメータを取得する
&gt;	//**************************************************************************
&gt;	for(var i = 1; i &lt;= Editor.GetLineCount(0); i++) {	// 行をループ
&gt;		// 1行取得
&gt;		var str = Editor.GetLineStr(i);
&gt;		// 行頭と行末の余分なスペースをけずる
&gt;		str = str.replace(/^\s*(.*?)\s*?$/, &quot;$1&quot;);
&gt;		// コメント(#)を削る
&gt;		str = str.replace(/#.*$/, &quot;&quot;);
&gt;		if(str == null || str.length == 0) continue;
&gt;		// []で囲まれた文字の取得
&gt;		if(str.match(/^\[(\w+)\]$/)) {
&gt;			// []の中身の文字を英小文字で前後のスペースを削って取得
&gt;			mode = RegExp.$1.toLowerCase().replace(/^\s*(.*?)\s*?$/, &quot;$1&quot;)
&gt;			continue;
&gt;		}
&gt;		
&gt;		// []で囲まれていない場合
&gt;		switch(mode) {
&gt;		case &quot;&quot;      : break;	// まだ[]タグがないので放置して次へ
&gt;		case &quot;folder&quot;:
&gt;		case &quot;path&quot;  :
&gt;		case &quot;dir&quot;   : path.push(str); break;	// パス指定取得
&gt;		case &quot;expand&quot;:
&gt;		case &quot;exp&quot;   : exp.push(str);  break;	// 拡張子取得
&gt;		case &quot;find&quot;  :
&gt;		case &quot;search&quot;:
&gt;		case &quot;match&quot; : matcher.push(str); break;	// 検索文字列取得
&gt;		case &quot;hilow&quot; : case_flag = true;  break;	// 大文字小文字区別なし
&gt;		case &quot;regexp&quot;:
&gt;		case &quot;reg&quot;   : regexp_flag = true; break;	
&gt;		case &quot;result&quot;:								// 検索実施済み？
&gt;			if(result_row == 0) result_row = i;		// 場所を把握。
&gt;			break;
&gt;		default      : err_flag = true;   break;	// それ以外はエラー
&gt;		}
&gt;	}
&gt;	// 拡張子が指定されていないときのデフォルト
&gt;	if(exp.length == 0) exp.push(&quot;*&quot;);
&gt;
&gt;	// ファイルの末尾に移動
&gt;	Editor.GoFileEnd();
&gt;	
&gt;	if(path.length == 0 || matcher.length == 0 || err_flag) {
&gt;		// パラメータが足りない場合使い方を挿入してしまう。
&gt;		Editor.InsText(CRLF);
&gt;		Editor.InsText(&quot;[match]&quot; + CRLF + CRLF);
&gt;		Editor.InsText(&quot;# ここに検索文字を羅列する&quot; + CRLF + CRLF);
&gt;		Editor.InsText(&quot;[dir]&quot; + CRLF + CRLF);
&gt;		Editor.InsText(&quot;# ここに検索対象のパスを羅列する&quot; + CRLF + CRLF);
&gt;		Editor.InsText(&quot;[exp]&quot; + CRLF + CRLF);
&gt;		Editor.InsText(&quot;# ここに検索対象のファイルを羅列する&quot; + exp + CRLF + CRLF);
&gt;		Editor.InsText(&quot;#[hilow] # 大文字小文字を区別しない場合指定する&quot; + CRLF);
&gt;		break;
&gt;	}
&gt;	if(result_row &gt; 1) {
&gt;		var btn = Editor.YesNoBox(&quot;結果がすでに存在します。削除して上書きしますか？&quot;) 
&gt;		if(btn == null || btn == 0|| btn == 2 || btn == 3 || btn == 7) {
&gt;			break;
&gt;		}
&gt;		Editor.Jump(result_row - 1);
&gt;		Editor.GoLineTop(1);
&gt;		Editor.BeginSelect();
&gt;		Editor.GoFileEnd_Sel();
&gt;		Editor.Delete();
&gt;	}
&gt;	// Resultタグ出力
&gt;	Editor.InsText(CRLF + &quot;[Result]&quot; + CRLF);
&gt;	
&gt;	// 検索開始時のファイル最終位置を保存する。
&gt;	var result_row = Editor.GetLineCount(0);
&gt;
&gt;	//**************************************************************************
&gt;	// 検索本体
&gt;	//**************************************************************************
&gt;	for(var j = 0; j &lt; matcher.length; j++) { // 検索文字ループ
&gt;		// 検索文字列出力
&gt;		Editor.InsText(&quot;■■■■■■■■検索文字列：&quot; + matcher[j] + &quot;\t検索ファイルの拡張子:&quot; + exp.join(&quot;,&quot;));
&gt;		if(case_flag) Editor.InsText(&quot;\t大文字小文字を区別しない&quot;);
&gt;		Editor.InsText(CRLF);
&gt;		
&gt;		// 外部プログラム(windows標準コマンド利用)
&gt;		var exec = &quot;findstr /s /n /C:\&quot;&quot; + matcher[j] + &quot;\&quot;&quot;;
&gt;		if(case_flag) exec += &quot; /i&quot;		// 英大文字と英小文字を区別しない
&gt;		if(regexp_flag) exec += &quot; /r&quot;	// 正規表現
&gt;		// %Aはのfor文の結果
&gt;		exec += &quot; /D:&quot;+ path.join(&quot;;&quot;) + &quot; &quot; + exp.join(&quot; &quot;);
&gt;		
&gt;		// ファイルの末尾に移動(コマンド実行中にカーソルが手で移動できてしまうので)
&gt;		Editor.GoFileEnd();
&gt;		
&gt;		// 今の最終ファイル位置を保存
&gt;		var befor_editorline = Editor.GetLineCount(0);
&gt;
&gt;		Editor.ExecCommand(exec, 3); // 実行
&gt;		
&gt;		// ファイルの末尾に移動(コマンド実行中にカーソルが手で移動できてしまうので)
&gt;		Editor.GoFileEnd();
&gt;		// 最終ファイル位置が変わらないときはキャンセル
&gt;		if(befor_editorline == Editor.GetLineCount(0))	break;
&gt;	}
&gt;	break;
&gt;}

-FindStrの出力をタグファイルへ変換
↑の結果をタグジャンプできるように変換するスクリプト

&gt;MAX_LINE = 10;
&gt;CRLF = &quot;\r\n&quot;;
&gt;switch(Editor.GetLineCode()) {
&gt;	case 1: CRLF = &quot;\n&quot;; break;
&gt;	case 2: CRLF = &quot;\r&quot;; break;
&gt;}
&gt;
&gt;while(1) {
&gt;	// 今の位置取得
&gt;	var result_row = Editor.ExpandParameter(&quot;$y&quot;);
&gt;	//**************************************************************************
&gt;	// FindStrの出力方式を普通のGrep方式(タグジャンプ対応)に変換します。
&gt;	//**************************************************************************
&gt;	// 検索完了後の最終ファイル位置を保存する。
&gt;	var end_line = Editor.GetLineCount(0);
&gt;	// 記録していた位置へカーソル移動
&gt;	Editor.Jump(result_row);
&gt;	
&gt;	// FindStrの検索したパス。
&gt;	var path_str = &quot;&quot;;
&gt;	// FindStr実施行の正規表現
&gt;	var reFindStr  = new RegExp(&quot;^.+?findstr +?/s +?/n +?/C:.+? +?/D.+? .+$&quot;);
&gt;	// FindStrが出力する検索結果行
&gt;	var reResult = new RegExp(&quot;:(\\d+):\\s*&quot;);
&gt;
&gt;	while(1) {
&gt;		// 今の最終ファイル位置を保存
&gt;		var befor_editorline = Editor.GetLineCount(0);
&gt;		// 1行取得
&gt;		var str = Editor.GetLineStr(0);
&gt;		// 末尾の改行記号を削除
&gt;		str = str.replace(/[\r\n]+$/, &quot;&quot;);
&gt;		var del_flag = false;
&gt;		// 先頭にスペース２文字があるかつ、末尾が:の行がFindStrのパス出力。
&gt;		if(str.match(/^  (.*?):$/)) {
&gt;			path_str = RegExp.$1;	// パス取得
&gt;			del_flag = true;
&gt;		}
&gt;		// 改行のみの行か、FindStr実施行ならいらない行
&gt;		if(del_flag || str == null || str.length == 0 || reFindStr.exec(str) != null) {
&gt;			Editor.DeleteLine();	// この行はいらないので消す
&gt;			// 行削除済みなのでrowはカウントしたくないのでそのまま繰り返し
&gt;		} else {
&gt;			// 検索文字列行かを判別
&gt;			if(str.match(/^■■■■■■■■検索文字列：/)) {
&gt;				Editor.Down();	// 検索文字列行は残す
&gt;			} else {
&gt;				// それ以外は検索結果。
&gt;				Editor.DeleteLine();	// 一旦消す。
&gt;				// ファイル位置との区切り記号をタブ区切に(エクセル貼り付け用)
&gt;				str = str.replace(reResult, &quot;\t$1\t&quot;);
&gt;				// FindStrのパスを付加
&gt;				if(path_str != null &amp;&amp; path_str.length &gt; 0) Editor.InsText(path_str + &quot;\\&quot;);
&gt;				Editor.InsText(str + CRLF);	// 貼り付け治す
&gt;			}
&gt;			result_row++;	// 次の行へ
&gt;		}
&gt;		if(befor_editorline &lt; Editor.GetLineCount(0)) break;	// 暴走防止用
&gt;		if(Editor.GetLineCount(0) &lt;= result_row) break;	// 最終行なら終了
&gt;	}
&gt;	break;
&gt;}

-検索して一致した文字がある行を削除
目的不明・・・private methodを消すとかに使ったのか？

&gt;var start_line = 1;
&gt;var end_line = Editor.GetLineCount(0);	//論理行数を取得
&gt;CRLF = &quot;\r\n&quot;;
&gt;switch(Editor.GetLineCode()) {
&gt;	case 1: CRLF = &quot;\n&quot;; break;
&gt;	case 2: CRLF = &quot;\r&quot;; break;
&gt;}
&gt;
&gt;// 選択状態？
&gt;if(Editor.IsTextSelected != 0) {
&gt;	// 選択状態なら先頭行と末尾行を取得
&gt;	start_line = Editor.GetSelectLineFrom();
&gt;	end_line = Editor.GetSelectLineTo();
&gt;	// レイアウト行から論理行へ変換
&gt;	start_line = Editor.LayoutToLogicLineNum(start_line)
&gt;	end_line = Editor.LayoutToLogicLineNum(end_line)
&gt;}
&gt;
&gt;while(1) {
&gt;	var mth = Editor.InputBox(&quot;検索結果のある行を削除します。検索文字を指定してください&quot;, &quot;&quot;, 64);
&gt;	if(mth == null || mth == &quot;&quot;) break;
&gt;	var m = new RegExp(mth, &#039;i&#039;);
&gt;	Editor.Jump(start_line);
&gt;	for(var i = start_line; i &lt;= end_line; ) {	// 行をループ
&gt;		var str = Editor.GetLineStr(0);		// 1行取得
&gt;
&gt;		str = str.replace(/[\r\n]+$/, &quot;&quot;);
&gt;		if(str.match(m)) {	Editor.DeleteLine();	end_line--;	}
&gt;		else {	Editor. Down();	i++;	}
&gt;	}
&gt;	break;
&gt;}

+WSH(EXCELやCSVをADOで操作)
JOINができないのが痛い。。。

-C#のソースからnamespace/class/methodの一覧を作成(csv)する。
関数が現れた場所と、コメントのようなものも表になる。
エクセルにソース一覧を作っとかないとダメだし、SJIS以外はダメだが。

&gt;var path = &quot;C:\\Users\\takahara.kosuke\\Documents&quot;;
&gt;var file = &quot;PS全検索結果.xlsx&quot;;
&gt;var outfile_name = &quot;関数一覧.csv&quot;;
&gt;
&gt;// ブロックコメントの正規表現
&gt;var regComment = /\/\*.*\*\//g;
&gt;// メソッド名の正規表現
&gt;var regMethod  = /(([A-Za-z][0-9A-Za-z:\.\[\]]*\s+)+[A-Za-z][0-9A-Za-z:\[\]]*\s*)\(/;
&gt;
&gt;comment = &quot;&quot;;
&gt;line_buf = 0;
&gt;// CSVのダブルクオート処理
&gt;String.prototype.dqe = function() {
&gt;	var ret = &#039;&quot;&#039;;
&gt;	for(var i = 0; i &lt; this.length; i++) {
&gt;		var c = this.charAt(i);
&gt;		ret += c;
&gt;		if(c == &#039;&quot;&#039;) ret += c;
&gt;	}
&gt;	return ret + &#039;&quot;&#039;;
&gt;};
&gt;String.prototype.trim = function() {
&gt;	return this.replace(/^\s*(.*?)\s*$/g, &quot;$1&quot;);
&gt;};
&gt;// 一行コメントを削除する処理
&gt;String.prototype.lineCommentDelete = function() {
&gt;	var ret = this.replace(/#.*$/, &quot;&quot;).replace(/\/\/(.*)$/, &quot;&quot;);
&gt;	comment += RegExp.$1;
&gt;	// 予約語で始まるものは消す
&gt;	return ret.trim().replace(/^(this\.|(new|using|else|return|for|switch|while|if|do)\s).*$/g, &quot;&quot;);
&gt;};
&gt;String.prototype.tipMatch = function(reg) {
&gt;	var ret = {result: false, string : &quot;&quot;, note : &quot;&quot;};
&gt;	// コメントの中身を退避
&gt;	var arr = this.match(regComment);
&gt;	if(arr) {
&gt;		for(var i in arr) {
&gt;			comment += (&quot;&quot; + arr[i]).substr(2, arr[i].length - 4).trim();
&gt;		}
&gt;	}
&gt;	var str = this.replace(regComment, &quot;&quot;).trim();
&gt;	if(str.match(/^\/\*/)) {	// 間違ってコメントの中で止まってる。
&gt;		comment += RegExp.rightContext.trim();
&gt;		return ret;
&gt;	}
&gt;		
&gt;	str = str.replace(/^.*\}/g, &quot;&quot;).replace(/\{.*$/, &quot;&quot;).trim().replace(/^\[.*\]/, &quot;&quot;).trim();
&gt;	if(str.length &lt; 2) return ret;
&gt;
&gt;	var flag = str.match(reg);
&gt;	if(!flag) return ret;
&gt;	var str = RegExp.lastMatch + RegExp.rightContext;
&gt;	ret = {result: true, string: str.trim(), note: comment.replace(/^.*\}/g, &quot;&quot;).replace(/\{.*$/, &quot;&quot;).replace(/[=\/\*\-#]+/g, &quot;&quot;).trim()};
&gt;	comment = &quot;&quot;;
&gt;	return ret;
&gt;};
&gt;
&gt;//ADOパラメータ
&gt;var driver =  &quot;Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)&quot;
&gt;var readonry = true;
&gt;
&gt;//ファイルシステム取得
&gt;var fso =  new ActiveXObject(&quot;Scripting.FileSystemObject&quot;)
&gt;var log = fso.CreateTextFile(path +&quot;\\&quot;+outfile_name+&quot;.log&quot;, true);
&gt;
&gt;//ADOオブジェクト取得
&gt;var xls = new ActiveXObject(&quot;ADODB.Connection&quot;);
&gt;
&gt;//ADOでエクセルをオープン
&gt;xls.Open(&quot;Driver={&quot; + driver + &quot;}; DBQ=&quot; + path +&quot;\\&quot; + file + &quot;;ReadOnly=&quot; + (readonry ? 1: 0));
&gt;
&gt;// 出力ファイルをオープン
&gt;var outfile = fso.CreateTextFile(path +&quot;\\&quot; + outfile_name, true);
&gt;outfile.WriteLine(&quot;No,ソース,資源,資源タイプ,場所,コメント&quot;);
&gt;
&gt;var count = 0;
&gt;
&gt;// エクセルでSELECT
&gt;var sql = &quot;SELECT [ソース] AS Src FROM [ソース一覧$]&quot;;
&gt;var rs = xls.Execute(sql);
&gt;
&gt;// SELECT範囲でループ
&gt;for(; !rs.Eof; rs.MoveNext()) {
&gt;	var src = new String(rs(&quot;Src&quot;));
&gt;	if(src == null || src.length == 0) continue;
&gt;	// ソースを開く
&gt;	var frs = fso.OpenTextFile(src, 1);
&gt;	comment = &quot;&quot;;
&gt;	line_buf = 0;
&gt;	var line = 0;
&gt;	var buf = &quot;&quot;;
&gt;	// ソースの最後までループ
&gt;	while(!frs.AtEndOfStream) {
&gt;		line++;	// ソース内の行数
&gt;		// ソールから１行読みコメントっぽいところを削ってバッファに足す
&gt;		buf += frs.ReadLine().lineCommentDelete();
&gt;		if(buf.length &gt; 0 &amp;&amp; line_buf == 0) line_buf = line;
&gt;		// 末端記号(;)があるところは要らない
&gt;		if(buf.indexOf(&quot;;&quot;) &gt;= 0) {
&gt;			buf =&quot;&quot;;
&gt;			line_buf = 0;
&gt;			continue;
&gt;		}
&gt;		// ブロックの開始以外はバッファに足すだけ
&gt;		if(buf.indexOf(&quot;{&quot;) &lt; 0) continue;
&gt;		
&gt;		// メソッドっぽい
&gt;		var e = buf.tipMatch(regMethod);
&gt;		if(e.result) e.type = &quot;function&quot;;
&gt;		else {
&gt;		// クラスっぽい
&gt;			e = buf.tipMatch(/\s*class\s+\w+/);
&gt;			if(e.result) {
&gt;				e.string = e.string.replace(/\s*:.*$/, &quot;&quot;);
&gt;				e.type = &quot;class&quot;;
&gt;			} else {
&gt;				// ネームスペースっぽい
&gt;				e = buf.tipMatch(/\s*namespace\s+\w+/);
&gt;				if(e.result) e.type = &quot;namespace&quot;;
&gt;			}
&gt;		}
&gt;		if(e.result) {
&gt;			count++;
&gt;			outfile.WriteLine(
&gt;				[count, src.dqe(), e.string.dqe(), e.type, line_buf, e.note.dqe()].join(&quot;,&quot;));
&gt;		}
&gt;		buf = &quot;&quot;
&gt;		comment =&quot;&quot;;
&gt;		line_buf = 0;
&gt;	}
&gt;	// ソースを閉じる
&gt;	frs.Close();
&gt;	frs = null;
&gt;	
&gt;}
&gt;// Excel RecoadSetを閉じる
&gt;rs.Close();
&gt;rs = null;
&gt;
&gt;// Excel Adoを閉じる
&gt;xls.Close();
&gt;xls = null;
&gt;
&gt;// 出力先ファイルを閉じる
&gt;outfile.Close();
&gt;outfile = null;
&gt;
&gt;// FileSystemの解放
&gt;fso = null;
&gt;
&gt;var wsh = WScript.CreateObject(&quot;WScript.Shell&quot;)
&gt;wsh.Popup(&quot;完了しました&quot;, 5, outfile_name, 0 + 64)
&gt;wsh = null;

-使用パターン一覧を作る。
縦にGrep結果、横にパターン１・２・・・・みたいな表を作ってしまったのでこれをまとめるためのもの。
まあUNIONで集計してるだけだが。

&gt;String.prototype.dqe = function() {
&gt;	var ret = &#039;&quot;&#039;;
&gt;	for(var i = 0; i &lt; this.length; i++) {
&gt;		var c = this.charAt(i);
&gt;		ret += c;
&gt;		if(c == &#039;&quot;&#039;) ret += c;
&gt;	}
&gt;	return ret + &#039;&quot;&#039;;
&gt;}
&gt;
&gt;var output = &quot;GROUP.csv&quot;;
&gt;
&gt;//ADOパラメータ
&gt;var excel_driver =  &quot;Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)&quot;
&gt;var path = &quot;C:\\Users\\takahara.kosuke\\Documents&quot;;
&gt;var file = &quot;PS全検索結果.xlsx&quot;;
&gt;var csv_driver = &quot;Microsoft Text Driver (*.txt; *.csv)&quot;
&gt;var xls_readonry = true;
&gt;var csv_readonry = false;
&gt;
&gt;var sql;
&gt;var line;
&gt;var str;
&gt;var func = [];
&gt;
&gt;//ファイルシステム取得
&gt;var fso =  new ActiveXObject(&quot;Scripting.FileSystemObject&quot;)
&gt;var log = fso.CreateTextFile(path +&quot;\\wsh.log&quot;, true);
&gt;
&gt;//ADOオブジェクト取得
&gt;var xls = new ActiveXObject(&quot;ADODB.Connection&quot;);
&gt;var csv   = new ActiveXObject(&quot;ADODB.Connection&quot;);
&gt;
&gt;//ADOオープン
&gt;xls.Open(&quot;Driver={&quot; + excel_driver + &quot;}; DBQ=&quot; + path +&quot;\\&quot; + file + &quot;;ReadOnly=&quot; + (xls_readonry ? 1: 0));
&gt;csv.Open(&quot;Driver={&quot; + csv_driver + &quot;}; DBQ=&quot; + path + &quot;;ReadOnly=&quot; + (csv_readonry ? 0: 1));
&gt;
&gt;
&gt;sql = &quot;SELECT Top 1 *  FROM [計画修正のみ$]&quot;
&gt;var rs = xls.Execute(sql);
&gt;var max = 0;
&gt;var ar = [];
&gt;for(var i = 0;  i &lt; rs.Fields.Count; i++) {
&gt;	var name = new String(rs.Fields(i).Name);
&gt;	if(name.match(/^ﾊﾟﾀｰﾝ(\d+)$/)) {
&gt;		var m = parseInt(RegExp.$1);
&gt;		if(max &lt; m) max = m;
&gt;	}
&gt;}
&gt;rs.Close();
&gt;
&gt;var ws = fso.CreateTextFile(path +&quot;\\&quot; + output, true);
&gt;sql = &quot;&quot;;
&gt;for(var i = 0; i &lt; max; i++) {
&gt;	var type = &quot;分類&quot; + (i+1);
&gt;	var pattern = &quot;ﾊﾟﾀｰﾝ&quot; + (i+1);
&gt;	if(i&gt;0) sql += &quot; UNION &quot;;
&gt;	sql += &quot;SELECT [&quot; + type + &quot;] AS T, [&quot; + pattern + &quot;] AS P FROM [計画修正のみ$]&quot;;
&gt;//	sql += &quot;SELECT &quot;+i+&quot; AS N, [&quot; + type + &quot;] AS T, [&quot; + pattern + &quot;] AS U FROM [計画修正のみ$]&quot;;
&gt;// GROUP BY [&quot; + type + &quot;], [&quot; + pattern + &quot;]&quot;;
&gt;}
&gt;//sql += &quot; WHERE NOT(T = &#039;&#039; OR P = &#039;&#039; OR T = &#039;-&#039;  OR P = &#039;-&#039;)&quot;
&gt;sql += &quot; ORDER BY T ASC, P ASC&quot;;
&gt;
&gt;WScript.Echo(sql);
&gt;	rs = xls.Execute(sql);
&gt;	for(; !rs.Eof; rs.MoveNext()) {
&gt;		ws.WriteLine(&#039;&quot;&#039;+rs(&quot;T&quot;)+&#039;&quot;,&quot;&#039;+rs(&quot;P&quot;)+&#039;&quot;&#039;);
&gt;//		ws.WriteLine(rs(&quot;N&quot;)+&quot;,&quot;+rs(&quot;T&quot;)+&quot;,&quot;+rs(&quot;U&quot;));
&gt;	}
&gt;
&gt;
&gt;
&gt;rs.Close();
&gt;rs = null;
&gt;
&gt;ws.Close();
&gt;ws = null;
&gt;
&gt;xls.Close();
&gt;xls = null;
&gt;csv.Close();
&gt;csv = null;
&gt;
&gt;log.Close();
&gt;log = null;
&gt;fso = null;

-上の二つを集計してピポットで使えるようにする。
もうなんだ、一斉Grepに戻ってないか？

&gt;var output = &quot;サマリ.csv&quot;;
&gt;var path = &quot;C:\\Users\\takahara.kosuke\\Documents&quot;;
&gt;var file = &quot;PS全検索結果.xlsx&quot;;
&gt;
&gt;var wsh = WScript.CreateObject(&quot;WScript.Shell&quot;)
&gt;
&gt;// StringオブジェクトにCSVのダブルクオート処理を足す。
&gt;String.prototype.dqe = function() {
&gt;	var ret = &#039;&quot;&#039;;
&gt;	for(var i = 0; i &lt; this.length; i++) {
&gt;		var c = this.charAt(i);
&gt;		ret += c;
&gt;		if(c == &#039;&quot;&#039;) ret += c;
&gt;	}
&gt;	return ret + &#039;&quot;&#039;;
&gt;}
&gt;
&gt;//ADOパラメータ
&gt;var excel_driver =  &quot;Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)&quot;
&gt;var csv_driver = &quot;Microsoft Text Driver (*.txt; *.csv)&quot;
&gt;var readonry = true;
&gt;
&gt;var sql;
&gt;var l;
&gt;var func = [];
&gt;
&gt;//ファイルシステム取得
&gt;var fso =  new ActiveXObject(&quot;Scripting.FileSystemObject&quot;)
&gt;var log = fso.CreateTextFile(path +&quot;\\wsh.log&quot;, true);
&gt;
&gt;//ADOオブジェクト取得
&gt;var xls = new ActiveXObject(&quot;ADODB.Connection&quot;);
&gt;var rs;
&gt;
&gt;//ADOオープン
&gt;xls.Open(&quot;Driver={&quot; + excel_driver + &quot;}; DBQ=&quot; + path +&quot;\\&quot; + file + &quot;;ReadOnly=&quot; + (readonry ? 1: 0));
&gt;
&gt;// ソースの取得
&gt;sql = &quot;SELECT [ソース], [資源], [資源タイプ], [場所] FROM [資源一覧$]&quot;;
&gt;for(rs = xls.Execute(sql); !rs.Eof; rs.MoveNext()) {
&gt;	var src = rs(&quot;ソース&quot;);
&gt;	if(!(src in func)) func[src] = [];
&gt;	func[src].push({object: new String(rs(&quot;資源&quot;)), type: new String(rs(&quot;資源タイプ&quot;)), line: new String(rs(&quot;場所&quot;))});
&gt;}
&gt;rs.Close();
&gt;rs = null;
&gt;
&gt;//wsh.Popup(func[&quot;z:\\Hosen.PS\\Boundary\\WindowsUI.Logic\\PS\\KeikakuShusei\\KeikakuSelectSekoKashoLogic.cs&quot;][0],, 10, &quot;実行します&quot;, 1 + 64)
&gt;
&gt;// パターン番号取得
&gt;var pattern = [];
&gt;sql = &quot;SELECT [#] AS N, [分類] AS T, [ﾊﾟﾀｰﾝ] AS P FROM [使用パターン一覧$]&quot;;
&gt;for(rs = xls.Execute(sql); !rs.Eof; rs.MoveNext()) {
&gt;	pattern[rs(&quot;P&quot;)] = {
&gt;		&#039;No&#039;: parseInt(rs(&quot;N&quot;)),
&gt;		&#039;Type&#039; : new String(rs(&quot;T&quot;))
&gt;	}
&gt;}
&gt;
&gt;
&gt;// パターン数取得
&gt;sql = &quot;SELECT Top 1 *  FROM [計画修正のみ$]&quot;
&gt;rs = xls.Execute(sql);
&gt;var max = 0;
&gt;var ar = [];
&gt;for(var i = 0;  i &lt; rs.Fields.Count; i++) {
&gt;	var name = new String(rs.Fields(i).Name);
&gt;	if(name.match(/^ﾊﾟﾀｰﾝ(\d+)$/)) {
&gt;		var m = parseInt(RegExp.$1);
&gt;		if(max &lt; m) max = m;
&gt;	}
&gt;}
&gt;rs.Close();
&gt;rs = null;
&gt;
&gt;// 本体
&gt;sql = &quot;&quot;
&gt;for(var i = 0; i &lt; max; i++) {
&gt;	if(i &gt; 0) sql += &quot; UNION ALL &quot;;
&gt;	sql += &quot;SELECT [No], [フォルダ], [ソース], [行], [列], [コード],[ﾊﾟﾀｰﾝ&quot; + (i+1) + &quot;] AS P&quot;;
&gt;	sql += &quot; FROM [計画修正のみ$]&quot;
&gt;}
&gt;
&gt;var btn = wsh.Popup(sql, 10, &quot;実行します&quot;, 1 + 64)
&gt;if(btn == 1) {
&gt;
&gt;	var ws = fso.CreateTextFile(path +&quot;\\&quot; + output, true);
&gt;	ws.WriteLine(&quot;No,ソース,行,列,コード,分類No,分類,ﾊﾟﾀｰﾝ,クラス,クラス行,関数,関数行&quot;);
&gt;
&gt;	for(rs = xls.Execute(sql); !rs.Eof; rs.MoveNext()) {
&gt;		var ptn  = new String(rs(&quot;P&quot;));
&gt;		if(!ptn) continue;
&gt;		if(ptn.length &lt; 2) continue;
&gt;		
&gt;		l = parseInt(rs(&quot;行&quot;));
&gt;		var src  = new String(rs(&quot;ソース&quot;));
&gt;		var code = new String(rs(&quot;コード&quot;));
&gt;		var src_file = &quot;z:\\&quot; + rs(&quot;フォルダ&quot;) + &quot;\\&quot; + rs(&quot;ソース&quot;);
&gt;		var parm = {
&gt;			no: 0,
&gt;			type: &quot;-&quot;,
&gt;			function_t: {line: 0, str: &quot;&quot;},
&gt;			class_t:    {line: 0, str: &quot;&quot;}
&gt;		};
&gt;		if(ptn in pattern) {
&gt;			parm.no = pattern[ptn].No;
&gt;			parm.type = pattern[ptn].Type;
&gt;		}
&gt;		if(!parm.no) continue;
&gt;
&gt;		
&gt;		for(var j in func[src_file]) {
&gt;			if(func[src_file][j].line &gt; l) break;
&gt;			if(func[src_file][j].type == &quot;function&quot;) {
&gt;				parm.function_t.str   = func[src_file][j].object;
&gt;				parm.function_t.line  = func[src_file][j].line;
&gt;			} else
&gt;			if(func[src_file][j].type == &quot;class&quot;) {
&gt;				parm.class_t.str   = func[src_file][j].object;
&gt;				parm.class_t.line  = func[src_file][j].line;
&gt;			}
&gt;		}
&gt;		
&gt;		ws.WriteLine([
&gt;			rs(&quot;No&quot;), src.dqe(), l, rs(&quot;列&quot;), code.dqe(),
&gt;			parm.no, parm.type.dqe(), ptn.dqe(),
&gt;			parm.class_t.str.dqe(), parm.class_t.line,
&gt;			parm.function_t.str.dqe(), parm.function_t.line
&gt;			].join(&#039;,&#039;));
&gt;	}
&gt;	rs.Close();
&gt;	rs = null;
&gt;
&gt;	ws.Close();
&gt;	ws = null;
&gt;
&gt;	wsh.Popup(&quot;完了しました&quot;, 10, output, 0 + 64)
&gt;	wsh = null;
&gt;}
&gt;xls.Close();
&gt;xls = null;
&gt;
&gt;log.Close();
&gt;log = null;
&gt;fso = null;


-JOINができないので手動でJOIN
あほすぎるが・・・

&gt;var path = &quot;C:\\Users\\takahara.kosuke\\Documents&quot;;
&gt;var file = &quot;PS全検索結果.xlsx&quot;;
&gt;var outfile_name = &quot;クラス一覧.csv&quot;;
&gt;
&gt;comment = &quot;&quot;;
&gt;line_buf = 0;
&gt;// CSVのダブルクオート処理
&gt;String.prototype.dqe = function() {
&gt;	var ret = &#039;&quot;&#039;;
&gt;	for(var i = 0; i &lt; this.length; i++) {
&gt;		var c = this.charAt(i);
&gt;		ret += c;
&gt;		if(c == &#039;&quot;&#039;) ret += c;
&gt;	}
&gt;	return ret + &#039;&quot;&#039;;
&gt;};
&gt;String.prototype.trim = function() {
&gt;	return this.replace(/^\s*(.*?)\s*$/g, &quot;$1&quot;);
&gt;};
&gt;
&gt;//ADOパラメータ
&gt;var driver =  &quot;Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)&quot;
&gt;var readonry = true;
&gt;
&gt;//ファイルシステム取得
&gt;var fso =  new ActiveXObject(&quot;Scripting.FileSystemObject&quot;)
&gt;var log = fso.CreateTextFile(path +&quot;\\&quot;+outfile_name+&quot;.log&quot;, true);
&gt;
&gt;//ADOオブジェクト取得
&gt;var xls = new ActiveXObject(&quot;ADODB.Connection&quot;);
&gt;
&gt;//ADOでエクセルをオープン
&gt;xls.Open(&quot;Driver={&quot; + driver + &quot;}; DBQ=&quot; + path +&quot;\\&quot; + file + &quot;;ReadOnly=&quot; + (readonry ? 1: 0));
&gt;
&gt;// 出力ファイルをオープン
&gt;var outfile = fso.CreateTextFile(path +&quot;\\&quot; + outfile_name, true);
&gt;outfile.WriteLine(&quot;No,ソース,行,クラス,コメント&quot;);
&gt;
&gt;var count = 0;
&gt;
&gt;// エクセルでSELECT
&gt;var sql = &quot;SELECT [No],[クラス] FROM [クラス一覧$]&quot;;
&gt;var rs;
&gt;// Joinできれば一発なんだができないので。
&gt;// SELECT範囲でループ
&gt;for(rs = xls.Execute(sql); !rs.Eof; rs.MoveNext()) {
&gt;	var sql = &quot;SELECT [ソース], [場所], [コメント] FROM [資源一覧$]&quot;
&gt;		+ &quot; WHERE [資源タイプ] = &#039;class&#039; AND [資源] = &#039;&quot; + rs(&quot;クラス&quot;) + &quot;&#039;&quot;;
&gt;	var rss;
&gt;	for(rss = xls.Execute(sql); !rss.Eof; rss.MoveNext()) {
&gt;		outfile.WriteLine(
&gt;			[rs(&quot;No&quot;), String(rss(&quot;ソース&quot;)).dqe(), String(rs(&quot;クラス&quot;)).dqe(), rss(&quot;場所&quot;), String(rss(&quot;コメント&quot;)).dqe()].join(&quot;,&quot;));
&gt;	}
&gt;	rss.Close();
&gt;	rss = null;
&gt;}
&gt;// Excel RecoadSetを閉じる
&gt;rs.Close();
&gt;rs = null;
&gt;
&gt;// Excel Adoを閉じる
&gt;xls.Close();
&gt;xls = null;
&gt;
&gt;// 出力先ファイルを閉じる
&gt;outfile.Close();
&gt;outfile = null;
&gt;
&gt;// FileSystemの解放
&gt;fso = null;
&gt;
&gt;var wsh = WScript.CreateObject(&quot;WScript.Shell&quot;)
&gt;wsh.Popup(&quot;完了しました&quot;, 5, outfile_name, 0 + 64)
&gt;wsh = null;    </description>
    <dc:date>2013-04-03T17:03:28+09:00</dc:date>
    <utime>1364976208</utime>
  </item>
    <item rdf:about="https://w.atwiki.jp/xronia/pages/18.html">
    <title>c++</title>
    <link>https://w.atwiki.jp/xronia/pages/18.html</link>
    <description>
      [[page1]]
[[page2]]    </description>
    <dc:date>2011-11-11T15:45:48+09:00</dc:date>
    <utime>1320993948</utime>
  </item>
    <item rdf:about="https://w.atwiki.jp/xronia/pages/17.html">
    <title>javascriptt2</title>
    <link>https://w.atwiki.jp/xronia/pages/17.html</link>
    <description>
      &lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0 Transitional//EN&quot;&gt;
&lt;html lang=&quot;ja&quot;&gt;
&lt;head&gt;
	&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=shift_jis&quot;&gt;
	&lt;title&gt;ソース解析&lt;/title&gt;
&lt;script type=&quot;text/javascript&quot;&gt;&lt;!--

var doc = new Array();
var OpenClose = function (val) {
	this.openString  = &quot;(&quot;;
	this.closeString = &quot;)&quot;;
	this.val = val;
	this.matchString = &quot;&quot;;
	this.leftString  = &quot;&quot;;
	this.rightString = &quot;&quot;;
	this.leftIndex  = 0;
	this.rightIndex = 0;
	
	this.clear = function () {
		this.matchString = &quot;&quot;;
		this.leftString  = &quot;&quot;;
		this.rightString = &quot;&quot;;
		this.leftIndex  = 0;
		this.rightIndex = 0;
	}

	this.exec = function (val) {
		
		if(typeof(val) != &quot;undefined&quot;) this.val = val;
		this.clear();
		
		for(this.leftIndex = 0; this.leftIndex &lt; this.val.length; this.leftIndex++) {
			if (this.val.substr(this.leftIndex, this.openString.length)==this.openString) {
				this.rightIndex = this.leftIndex;
				var node = 1;
				while(node != 0) { // 括弧の終端探索
					this.rightIndex++;
					if(this.rightIndex &gt; this.val.length) return false;
					if(this.val.substr(this.rightIndex, this.openString.length ) == this.openString ) node++;
					if(this.val.substr(this.rightIndex, this.closeString.length) == this.closeString) node--;
				}
				this.leftString  = this.val.substr(0, this.leftIndex);
				this.matchString = this.val.substring(this.leftIndex + 1, this.rightIndex);
				this.rightString = this.val.substr(this.rightIndex + 1);
//	dbg(&quot;left:&quot;  + this.leftIndex);dbg(this.leftString);
//	txtDebug.innerHTML += &quot;match:&quot; + this.matchString + &quot;&lt;p&gt;&quot;;
//	txtDebug.innerHTML += &quot;right:&quot; + this.rightIndex  + &quot;&lt;BR&gt;&quot; + this.rightString + &quot;&lt;p&gt;&quot;;
				return true;
			}
		}

	}
}

function getText() {
	var l = new String(document.getElementById(&quot;txtSource&quot;).value);
	l = l.replace(/\/\*(.*?)\*\//g, &quot;&quot;);	// コメント
	l = l.replace(/(\/\/.*?)$/g, &quot;&quot;);		// コメント(C++)
	l = l.replace(/^[\t ]*/gm, &quot;\r&quot;);
	l = l.replace(/[\t ]*$/gm, &quot;\r&quot;);		// ブランク削除
	l = l.replace(/[\t ]*\\$/gm, &quot;\\\r&quot;);	// \crの前のブランクを消す

	l = l.replace(/\r+/g, &quot;\r&quot;);
	l = l.replace(/\\\r/g, &quot;&quot;);				// \cr を消す

	//	 インクルードを消す
	l = l.replace(/^#(include|undef)[^\r]*/gm, &quot;&quot;);
	//	#ifマクロの後ろに&quot;{&quot;をつける
	l = l.replace(/^(#if.*)$/gm, &quot;\r;\r$1\r{\r&quot;);
	//	#endifマクロを&quot;}&quot;に変換
	l = l.replace(/^(#endif.*$)/gm, &quot;\r;\r}\r&quot;);
	//	#elseマクロの前後に{}をつける
	l = l.replace(/^#else/gm, &quot;\r}\r;\r\#else\r{\r&quot;);

	l = l.replace(/#define(.*)$/gm, &quot;&quot;);

	//	if/while/until/switch/for特化
//	l = l.replace(/\r(if|while|until|switch|for|do)\s*($openclose)\s*([^\{](?:|if|while|until|switch|for|do)[^\}]*)/g,
//		&quot;\r$1$2{\r$3\r}\r&quot;);
	//	変数宣言を消す
	l = l.replace(/^\w+(?:\s+\w+)*(?:(?:\s*\*)?\s+(?:\*\s*)?)+[\w\[\]]+;/gm, &quot;&quot;);
	//	キャストを消す
//	l = l.replace(/(?:\*\s*)?\([\w\s\*&amp;]*\)\s*&amp;/g, &quot;&quot;);
	//	変数宣言+初期化
	l = l.replace(/^\w+\s+([\w\[\]]+\s*=\s*[\w\{\}]+\s*[\w\[\]]*\s*;)/gm, &quot;\r$1&quot;);
	l = l.replace(/(?:\*\s*)?\([\w\s\*&amp;]*\)\s*([\(&amp;a-zA-Z])/g, &quot;$1&quot;);

	l = l.replace(/^\}[\t ]*([^\r])/gm, &quot;\r}\r$1&quot;);
	l = l.replace(/[\r\n]/g, &quot;&quot;);
	// 行末文字で分割
	var s = new String();
	var ar = l.match(/[^\:\;\{\}]*[\:\;\{\}]/g);
	for(i = 0; i &lt; ar.length; i++) {
		var n = new String(ar[i]);
		n = n.replace(/^\s+/gm, &quot;&quot;);
		n = n.replace(/\s+$/gm, &quot;&quot;);	// ブランク削除
		n = n.replace(/^\;$/gm, &quot;&quot;);	// 先頭;の削除
		if(n.length != 0) s += n;
	}
	
	var r = new OpenClose();
	r.openString  = &quot;{&quot;;
	r.closeString = &quot;}&quot;;

	var i = 0;
	while(r.exec(s)){
		var func = new String(r.leftString);
		var str  = new String(r.matchString);
		s = new String(r.rightString);
//	txtDebug.innerHTML += &quot;&lt;p&gt;func=&quot;+func+&quot;&lt;p&gt;&quot;;
//	txtDebug.innerHTML += &quot;&lt;p&gt;str=&quot;+str+&quot;&lt;p&gt;&quot;;
//	txtDebug.innerHTML += &quot;&lt;p&gt;s=&quot;+s+&quot;&lt;p&gt;&quot;;
		var ar = func.match(/(\w+\s*)(\(.*\))/);
		if(!ar) continue;
		
		doc[i] = new Object();
		doc[i].symbol = ar[ar.length - 2];
		doc[i].func = func;
		doc[i].str  = str;
		i++;
	}
	
	document.getElementById(&quot;selFunction&quot;).innerText = &quot;&quot;;
	
	for(var i = 0; i &lt; doc.length; i++) {
		var e = document.createElement(&#039;option&#039;);
		// value オプションにiを設定
		e.setAttribute(&#039;value&#039;, i);
		// OPTION タグ内のテキスト設定
		e.appendChild(document.createTextNode(doc[i].symbol));
		// SELECT Listへ登録
		document.getElementById(&quot;selFunction&quot;).appendChild(e);
	}
//	txtDebug.innerHTML += lines.join(&quot;&lt;BR&gt;&quot;);
//alert(l);

}
function dbg(str) {
	document.getElementById(&quot;txtDebug&quot;).innerHTML += str + &#039;&lt;br&gt;&#039;;
}
function getFunction() {
	var index = parseInt(document.getElementById(&quot;selFunction&quot;).value);
	if(isNaN(index)) return;
	
	var dat = nest(doc[index].str);

	var win = window.open(&#039;&#039;, &#039;_blank&#039;, &#039;directories=no,location=no,menubar=no,status=no,toolbar=no,scrollbars=yes&#039;);
//	win.navigator.language = &#039;ja&#039;;
	win.document.title = doc[index].symbol + &#039; 詳細設計書(PAD)&#039;;
	
	var tbl     = win.document.createElement(&quot;TABLE&quot;);
	var tblBody = win.document.createElement(&quot;TBODY&quot;);

	var row = win.document.createElement(&quot;TR&quot;);
	for(var i = 0; i &lt; 100; i++) {
		var cell = win.document.createElement(&quot;TD&quot;);
		var cellText = win.document.createTextNode(i);//&quot;\u00a0&quot;);
		cell.appendChild(cellText);
		cell.width = 10;
		cell.style.fontSize = &#039;8pt&#039;;
		row.appendChild(cell);
	}
	tblBody.appendChild(row);

	var row = win.document.createElement(&quot;TR&quot;);

	var cell = win.document.createElement(&quot;TH&quot;);
	var cellText = win.document.createTextNode(doc[index].func);
	cell.appendChild(cellText);
	cell.colSpan = 20;
	cell.align = &#039;left&#039;;
	cell.width = 200;
	cell.style.borderWidth = &#039;2px&#039;;
	cell.style.borderStyle = &#039;solid&#039;;
	cell.style.borderColor = &#039;black&#039;;
	row.appendChild(cell);
	
	row.style.borderStyle = &#039;none&#039;
	tblBody.appendChild(row);

	viewLine(tblBody, 0);

	padView(dat, false, 0);
	
	viewLine(tblBody, 0);

	var row = win.document.createElement(&quot;TR&quot;);

	var cell = win.document.createElement(&quot;TH&quot;);
	var cellText = win.document.createTextNode(&#039;End of &#039; + doc[index].symbol);
	cell.appendChild(cellText);
	cell.colSpan = 20;
	cell.align = &#039;left&#039;;
	cell.width = 200;
	cell.style.borderWidth = &#039;2px&#039;;
	cell.style.borderStyle = &#039;solid&#039;;
	cell.style.borderColor = &#039;black&#039;;
	row.appendChild(cell);
	
	row.style.borderStyle = &#039;none&#039;
	tblBody.appendChild(row);

	tbl.appendChild(tblBody);
	tbl.setAttribute(&#039;CELLSPACING&#039;, 0);
	tbl.setAttribute(&#039;CELLPADDING&#039;, 0);
	win.document.body.appendChild(tbl);

	// ネスト解析処理
	function nest(str) {
		var datas = new Array();
		while(1) {
			var r = new OpenClose();
			r.openString  = &quot;{&quot;;
			r.closeString = &quot;}&quot;;
			if(r.exec(str)) {
				str = new String(r.rightString);
				addMethod(r.leftString);
				var dat = datas.pop();
				if(dat != null) {
					dat.obj = nest(r.matchString);
					datas.push(dat);
				}
			}
			else {
				addMethod(str);
				break;
			}
		}
		return datas;
		
		function addMethod(str) {
			while(1) {
				var r = new OpenClose();
				r.openString  = &quot;(&quot;;
				r.closeString = &quot;)&quot;;
				if(r.exec(str)) {
					addNomalMethod(r.leftString);
					var dat = datas.pop();
					if(dat != null) {
						dat.pram = new String(r.matchString);
						datas.push(dat);
					}
					str = new String(r.rightString);
				}
				else {
					addNomalMethod(str);
					return;
				}
			}
			
			function addNomalMethod(str) {
				var ar = str.match(/[^\:\;\{\}]*[\:\;\{\}]/g);
				var s = new String(RegExp.rightContext);
				if(ar) {
					for(var i = 0; i &lt; ar.length; i++) {
						addMain(new String(ar[i]));
					}
					addMain(s);
					return;
				}
				addMain(str);
				return;
				
				function addMain(str) {
					if(str.match(/^[\;\:\{\}]?$/)) return;
					var dat = new Object();
					dat.obj = false;
					dat.parm = false;
					dat.method = str;
					datas.push(dat);
				}
			}
		}
	}


	function padView(dat, flag, cel, row) {
		for(var i = 0; i &lt; dat.length; i++) {
			dbg(dat[i].method + &quot;:&quot; + dat[i].pram);
			
			if(i != 0) viewLine(tblBody, cel);
			
			if(!flag) row = win.document.createElement(&quot;TR&quot;);
			else {
				if(row.rowSpan) row.rowSpan += 2;
				else row.rowSpan = 2;
			}
			
			addLeft(row, i==0 ? 0 : cel, (i == 0 &amp;&amp; flag))
			// 本体
			var cell = win.document.createElement(&quot;TD&quot;);
			var s = new String(dat[i].method);
			if(dat[i].pram) s += &#039;(&#039; + dat[i].pram + &#039;)&#039;;
			var cellText = win.document.createTextNode(i+&quot;:&quot;+s);
			cell.appendChild(cellText);
			cell.align = &#039;left&#039;;
			cell.vAlign = &#039;top&#039;;
			cell.width = 100;
			cell.colSpan = 10;
			cell.style.borderWidth = &#039;1px&#039;;
			cell.style.borderStyle = &#039;solid&#039;;
			cell.style.borderColor = &#039;black&#039;;
			cell.style.fontSize = &#039;9pt&#039;;
			row.appendChild(cell);

			if(dat[i].obj) padView(dat[i].obj, true, cel+1, row);
//			dbg(&quot;row=&quot; + row.rowSpan + &quot; : cell=&quot;+cel);
			
			row.style.borderStyle = &#039;none&#039;
			tblBody.appendChild(row);
			
			flag = false;
		}
	}

	function viewLine(base, cel) {
		var row = win.document.createElement(&quot;TR&quot;);
		
		addLeft(row, cel);
		
		var cell = win.document.createElement(&quot;td&quot;);
		var cellText = win.document.createTextNode(&quot;\u00a0&quot;);
		cell.appendChild(cellText);
		cell.style.borderLeftWidth = &#039;1px&#039;;
		cell.style.borderLeftStyle = &#039;solid&#039;;
		cell.style.borderLeftColor = &#039;black&#039;;
		cell.style.fontSize = &#039;8pt&#039;;
		row.appendChild(cell);

		row.style.borderStyle = &#039;none&#039;
		base.appendChild(row);
	}
	
	function addLeft(row, cel, flag) {
		var cell = win.document.createElement(&quot;TD&quot;);
		var cellText = win.document.createTextNode(cel);//&quot;\u00a0&quot;);
		cell.appendChild(cellText);
		cell.width = cel*(100 + 10)+1;
		cell.colSpan = cel*(10+1)+1;
		cell.style.fontSize = &#039;8pt&#039;;
		if(flag) {	// 上位からの線を引く
			cell.style.borderTopWidth = &#039;1px&#039;;
			cell.style.borderTopStyle = &#039;solid&#039;;
			cell.style.borderTopColor = &#039;black&#039;;
		}
		row.appendChild(cell);
	}
}


//--&gt;&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;textarea cols=80 rows=5 id=&quot;txtSource&quot;&gt;
void luc0_blcdchg(
               UCHAR  mod_id ,         /* ｺｰﾙ元制御ID   700V10C000616*/
               UCHAR  fact_id          /* ｺｰﾙ元制御内ID 700V10C000616*/
                 )
{                                      /*                            */
    UCHAR       shlt_flg;              /* 退避情報ﾌﾗｸﾞ               */
    USHORT      lun;                   /*         600V00C000126 r008 */
    UCHAR       oth_ctl;               /* 他ｺﾝﾄﾛｰﾗ番号          r008 */
    UCHAR       trc_msg[3];            /* LU切り替えﾄﾚｰｽﾒｯｾｰｼﾞ  r002 */
    USHORT      lu_count;              /* 定義LUﾙｰﾌﾟｶｳﾝﾀ        r307 */
    UCHAR       own_inf;               /* 自CTL、自ｺｱ情報ﾌﾗｸﾞ        */
                                       /*                  DF800対応 */

#if defined (DF_HIGH)
                                       /*              800V30C007801 */
    char        trc_ret;               /* ｺﾝﾄﾛｰﾗ間通信ﾘﾀｰﾝ値         */
#endif                                 /*              800V30C007801 */
                                       /*                            */
    LUC_LMSET;                         /* 切り替え情報をLMに設定     */
    COM4_CP2_CL1(&amp;inmt_calc.luc_chgadr-&gt;shlt_flg,&amp;shlt_flg);
                                       /*              800V31C023504 */
                                       /* 退避情報ﾌﾗｸﾞ取得           */
#ifdef TRACEON
    luc0_blstrc(shlt_flg,mod_id,fact_id);
                                       /* 閉塞LU切り替え開始ﾄﾚｰｽ     */
                                       /*              700V10C000616 */
#endif
    if(shlt_flg == C_OFF){             /* 退避情報ﾌﾗｸﾞはOFF?         */
        COM4_CP2_LCN(&amp;luc0_luinf.lu_ctl[0],
                     &amp;inmt_calc.luc_chgadr-&gt;lu_ctl[0],
                     C_CONST_LU_SYSTEMMAX);
                                       /*              800V31C023504 */
                                       /* LU担当ｺﾝﾄﾛｰﾗ情報退避       */
                                       /*                       r202 */
        COM4_CP2_LC4(&amp;luc0_luinf.dir_ctl[0],
                     &amp;inmt_calc.luc_chgadr-&gt;dir_ctl[0]);
                                       /*              800V31C023504 */
                                       /* Dir担当ｺﾝﾄﾛｰﾗ情報退避      */
    }                                  /*                  DF800対応 */
    COM4_GET_DIR((inmt_ctltbl.ctlno^OTH_CTL),luc0_luinf.chg_dir);
                                       /* LU切替対象Dir設定     r008 */
    if(rcfr_systbl.ludef != NO_LUN){   /* LU定義あり            r008 */
        if(luc0_luinf.chg_dir == C_LUC_DIR0){
                                       /* DIR0切り替え          r008 */
            luc0_luinf.chg_dir = C_LUC_NODIR;
                                       /* 切替対象DIRｸﾘｱ        r008 */
            for(lun=0,lu_count=0;lu_count&lt;rcfr_systbl.ludef;lun++){
                                       /* LUN定義数分           r307 */
                if(rcfr_lusttbl.lust[lun] != C_RCF_LU_UNDEF){
                                       /* LU定義済み?           r307 */
                    lu_count++;        /* LU定義ｶｳﾝﾄｱｯﾌﾟ        r307 */
                    if(luc0_luinf.lu_dir[lun] == C_LUC_DIR0){
                                       /* LU管理Dir情報にDIR0?  r008 */
                        luc0_luinf.chg_dir = C_LUC_DIR0;
                                       /* 切替対象DIRにDIR0     r008 */
                        break;         /*                       r008 */
                    }                  /*                       r008 */
                }                      /*                       r307 */
            }                          /*                       r307 */
        }                              /*                       r008 */
        else if(luc0_luinf.chg_dir == C_LUC_DIR1){
                                       /* DIR1切り替え          r008 */
            luc0_luinf.chg_dir = C_LUC_NODIR;
                                       /* 切替対象DIRｸﾘｱ        r008 */
            for(lun=0,lu_count=0;lu_count&lt;rcfr_systbl.ludef;lun++){
                                       /* LUN定義数分           r307 */
                if(rcfr_lusttbl.lust[lun] != C_RCF_LU_UNDEF){
                                       /* LU定義済み?           r307 */
                    lu_count++;        /* LU定義ｶｳﾝﾄｱｯﾌﾟ        r307 */
                    if(luc0_luinf.lu_dir[lun] == C_LUC_DIR1){
                                       /* LU管理Dir情報にDIR1?  r008 */
                        luc0_luinf.chg_dir = C_LUC_DIR1;
                                       /* 切替対象DIRにDIR1     r008 */
                        break;         /*                       r008 */
                    }                  /*                       r008 */
                }                      /*                       r307 */
            }                          /*                       r307 */
        }                              /*                       r008 */
        else if(luc0_luinf.chg_dir == C_LUC_2DIR){
                                       /* DIR0,1切り替え        r008 */
            luc0_luinf.chg_dir = inmt_ctltbl.ctlno;
                                       /* 切替対象DIRに自ｺﾝﾄﾛｰﾗ番号  */
                                       /*                       r008 */
            oth_ctl = (UCHAR)(inmt_ctltbl.ctlno^OTH_CTL);
                                       /* 他ｺﾝﾄﾛｰﾗ番号          r008 */
            for(lun=0,lu_count=0;lu_count&lt;rcfr_systbl.ludef;lun++){
                                       /* LUN定義数分           r307 */
                if(rcfr_lusttbl.lust[lun] != C_RCF_LU_UNDEF){
                                       /* LU定義済み?           r307 */
                    lu_count++;        /* LU定義ｶｳﾝﾄｱｯﾌﾟ        r307 */
                    if(luc0_luinf.lu_dir[lun] == oth_ctl){
                                       /* LU管理Dir情報に他ｺﾝﾄﾛｰﾗ?   */
                                       /*                       r008 */
                        luc0_luinf.chg_dir = C_LUC_2DIR;
                                       /* 切替対象DIRにDIR0     r008 */
                        break;         /*                       r008 */
                    }                  /*                       r008 */
                }                      /*                       r307 */
            }                          /*                       r307 */
        }                              /*                       r008 */
        else                           /* 700V10C000616 QAC対策      */
        {                              /* 上記以外の場合             */
            ;                          /* NOP                        */
        }                              /*              700V10C000616 */
        
        if(luc0_luinf.chg_dir != C_LUC_NODIR){
                                       /* LU切替有り?           r008 */
            LUC_OWN_INF(own_inf);      /* 自CTL、自ｺｱ情報取得        */
                                       /*                  DF800対応 */
            COM4_CP2_LC1(&amp;own_inf,
                         &amp;inmt_calc.luc_mngtbladr-&gt;exeinf);
                                       /*              800V31C023504 */
                                       /* LU切替関数情報設定    r008 */
                                       /*                  DF800対応 */
            hscc_moveque_start(C_HS_CMDMV_MODE_CTL,
                               (UCHAR)(inmt_ctltbl.ctlno^OTH_CTL),
                               0,
                               0);
                                       /* ｺﾏﾝﾄﾞ以降開始    DF800対応 */
                                       /*              800V10C079001 */
            if(luc0_luinf.chg_dir == C_LUC_2DIR){
                                       /*                       r008 */
                luc0_luinf.dir_ctl[0] = inmt_ctltbl.ctlno;
                                       /* Dir担当CTL情報設定(ﾛｰｶﾙ)   */
                                       /*                       r008 */
                luc0_luinf.dir_ctl[1] = inmt_ctltbl.ctlno;
                                       /* Dir担当CTL情報設定(ﾛｰｶﾙ)   */
                                       /*                       r008 */
                for(lun=0,lu_count=0;lu_count&lt;rcfr_systbl.ludef;lun++){
                                       /* LUN定義数分           r307 */
                    if(rcfr_lusttbl.lust[lun] != C_RCF_LU_UNDEF){
                                       /* LU定義済み?           r307 */
                        lu_count++;    /* LU定義ｶｳﾝﾄｱｯﾌﾟ        r307 */
                        luc0_luinf.lu_ctl[lun] = inmt_ctltbl.ctlno;
                                       /* LU担当CTL情報設定(ﾛｰｶﾙ)    */
                    }                  /*                       r307 */
                }                      /*                       r307 */
            }                          /*                       r008 */
            else{                      /*                       r008 */
                luc0_luinf.dir_ctl[luc0_luinf.chg_dir]
                                   = inmt_ctltbl.ctlno;
                                       /* Dir担当CTL情報設定(ﾛｰｶﾙ)   */
                                       /*                       r008 */
                for(lun=0,lu_count=0;lu_count&lt;rcfr_systbl.ludef;lun++){
                                       /* LUN定義数分           r307 */
                    if(rcfr_lusttbl.lust[lun] != C_RCF_LU_UNDEF){
                                       /* LU定義済み?           r307 */
                        lu_count++;    /* LU定義ｶｳﾝﾄｱｯﾌﾟ        r307 */
                        if(luc0_luinf.lu_dir[lun]
                           == luc0_luinf.chg_dir){
                                       /* 切り替え対象のLUN?    r008 */
                            luc0_luinf.lu_ctl[lun] = inmt_ctltbl.ctlno;
                                       /* LU担当CTL情報設定(ﾛｰｶﾙ)    */
                        }              /*                       r008 */
                    }                  /*                       r307 */
                }                      /*                       r307 */
            }                          /*                       r008 */
            COM4_CP2_LC4(&amp;luc0_luinf.dir_ctl[0],
                         &amp;inmt_calc.luc_mngtbladr-&gt;dir_ctl[0]);
                                       /*              800V31C023504 */
                                       /* Dir担当CTL情報設定    r008 */
                                       /*                  DF800対応 */
            COM4_CP2_LCN(&amp;luc0_luinf.lu_ctl[0],
            &amp;inmt_calc.luc_mngtbladr-&gt;lu_ctl[0],C_CONST_LU_SYSTEMMAX);
                                       /*              800V31C023504 */
                                       /* LU担当CTL情報設定     r008 */
                                       /*                       r202 */
#if defined (DF_HIGH)
                                       /*              800V30C007801 */
            LUC_CTL_TRNS(C_PRO_LUC_RMRNRQ,0,C_PRO_LUC_NOTEXE,0,
                         C_PRO_SEND_ALL_CORE,trc_ret);
                                       /* ﾛｰｶﾙﾒﾓﾘ更新要求            */
                                       /*              800V30C007801 */
            if(trc_ret != C_OK)
            {
            }                          /* remark対応                 */
                                       /*              800V30C007801 */
#endif                                 /*              800V30C007801 */

            luc0_luinf.cache_inf = C_ON;
                                       /* ｷｬｯｼｭ切り替え実行情報ON    */
            rchs_luchg(C_RCH_MD_LC_LUCHG);
                                       /* ｷｬｯｼｭ切り替え処理          */
                                       /*                  削除 r004 */
            scp0_dirchg_rep(luc0_luinf.chg_dir);
                                       /* Dir切り替え終了報告        */
                                       /*                  DF800対応 */
                                       /* 800V10C039908              */
            /* DF800対応                                             */
            memset(&amp;luc0_dirctmpbmp,0,sizeof(luc0_dirctmpbmp));
            
            /**** 700V30C037436 **************************************/
            rcfa_tcabmpclr_luc(C_RCF_512DEL_DIR,
                               C_ON,
                               C_CONST_MP0,
                               luc0_luinf.chg_dir,
                               &amp;luc0_dirctmpbmp[0]);
                                       /* 構成制御TCA差分ﾋﾞｯﾄﾏｯﾌﾟｸﾘｱ */
                                       /* 関数コール                 */
                                       /* 通信発行ﾌﾗｸﾞ：ON           */
            /************************************** 700V30C037436 ****/
            
            /**** 700V35C007003 **************************************/
            rvmm_dirchg_init(C_RVM_LASTSBCHG_DIRCHG,
                             &amp;luc0_dirctmpbmp[0]);
                                       /* RVR管理・関数コール        */
            /************************************** 700V35C007003 ****/
                                       /*              800V10C039908 */

            hscc_moveque_end();        /* ｺﾏﾝﾄﾞ移行完了    DF800対応 */

            COM4_CP2_VC1(C_LUC_NOCTL,
                         &amp;inmt_calc.luc_mngtbladr-&gt;exeinf);
                                       /*              800V31C023504 */
                                       /* LU切り替え関数情報設定     */
            luc0_luinf.cache_inf = C_OFF;
                                       /* ｷｬｯｼｭ切り替え実行情報OFF   */
        }                              /*                       r008 */
    }                                  /*                       r008 */
    trc_msg[0] = &#039;B&#039;;                  /* LU切り替えﾄﾚｰｽﾒｯｾｰｼﾞ  r002 */
    trc_msg[1] = &#039;L&#039;;                  /* LU切り替えﾄﾚｰｽﾒｯｾｰｼﾞ  r002 */
    trc_msg[2] = &#039;C&#039;;                  /* LU切り替えﾄﾚｰｽﾒｯｾｰｼﾞ  r002 */
    luc0_dirfnc_trc(C_RCH_MD_LC_LUCHG, trc_msg, mod_id, fact_id);
                                       /* LU切替ﾄﾚｰｽ   700V10C000616 */
#ifdef TRACEON
    luc0_bletrc();                     /* 閉塞LU切り替え終了ﾄﾚｰｽ     */
#endif
}                                      /*                            */

&lt;/textarea&gt;&lt;br&gt;
&lt;input type=&quot;button&quot; name=&quot;btnSubmit&quot; value=&quot;解析&quot; onClick=&quot;getText();&quot;&gt;&lt;br&gt;
&lt;select id=&quot;selFunction&quot;&gt;&lt;/select&gt;
&lt;input type=&quot;button&quot; name=&quot;btnSubmit&quot; value=&quot;表示&quot; onClick=&quot;getFunction();&quot;&gt;&lt;br&gt;
&lt;br&gt;
&lt;div align=&quot;left&quot; id=&quot;txtSS&quot;&gt;
&lt;/div&gt;
&lt;div align=&quot;left&quot; id=&quot;txtDebug&quot;&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;    </description>
    <dc:date>2009-07-10T20:02:16+09:00</dc:date>
    <utime>1247223736</utime>
  </item>
  </rdf:RDF>
