2004年02月26日

Linux HD増設

買ったその日にピンを曲げてしまって使用不能だったプライマリIDEコネクタを強引に曲げ戻してコネクタ接続できたのでHD増設してみる。
増設するのは先日FATが飛んだのか読み込み不能になったWindowsマシンに付いてた120GHD。
Windowsマシンでフォーマットしたときに異常な音を立ててたけど気にしない。


rootでログイン

/sbin/fdisk /dev/hda
d でNTFS削除
n で領域作成開始
p で基本領域に指定
領域番号は1
最初シリンダ 1
終点シリンダ 15017(最大値)

コマンド (m でヘルプ): p

Disk /dev/hda: 123.5 GB, 123522416640 bytes
255 heads, 63 sectors/track, 15017 cylinders
Units = シリンダ数 of 16065 * 512 = 8225280 bytes

デバイス ブート 始点 終点 ブロック ID システム
/dev/hda1 1 15017 120624021 83 Linux

w で保存

領域テーブルは交換されました!

ioctl() を呼び出して領域テーブルを再読込みします。
ディスクを同期させます。


フォーマット
mkfs -t ext2 /dev/hda1

mke2fs 1.34 (25-Jul-2003)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
15089664 inodes, 30156005 blocks
1507800 blocks (5.00%) reserved for the super user
First data block=0
921 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872

Writing inode tables: done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 25 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.

"Linux HD増設"の続きを読む

2004年02月24日

マウント

HDのマウント
mount -t ext2 /dev/hdd1 /home/share/smb

ディレクトリのマウント
mount -o /src /tgt

マウント解除
umount /src

2004年02月20日

yum

更新チェック
yum check-update

インストール済みチェック
yum list installed

2004年02月18日

テスト

DSC00017.JPG
テスト

みちる

DSC00006.JPG
みちる

2004年02月09日

SashForm

中身のWidgetのサイズ設定


topSash.setWeights(new int[]{90,10});

パーセントで指定

2004年02月04日

スクロールバー

Eclipse本家から

// this button is always 400 x 400. Scrollbars appear if the window is resized to be
// too small to show part of the button
ScrolledComposite c1 = new ScrolledComposite(shell, SWT.H_SCROLL | SWT.V_SCROLL);
Button b1 = new Button(c1, SWT.PUSH);
b1.setText("fixed size button");
b1.setSize(400, 400);
c1.setContent(b1);

// this button has a minimum size of 400 x 400. If the window is resized to be big
// enough to show more than 400 x 400, the button will grow in size. If the window
// is made too small to show 400 x 400, scrollbars will appear.
ScrolledComposite c2 = new ScrolledComposite(shell, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
Button b2 = new Button(c2, SWT.PUSH);
b2.setText("expanding button");
c2.setContent(b2);
c2.setExpandHorizontal(true);
c2.setExpandVertical(true);
c2.setMinWidth(400);
c2.setMinHeight(400);

例1
Minとか指定せず中身のサイズのみ指定すると中身のサイズ以下の時にスクロールバー
中身はそれ以上に広がらない

例2
Minを指定するとそれ以下の時スクロールバーがでる

			c2.setExpandHorizontal(true);
c2.setExpandVertical(true);

を指定すると指定した方向のが幅いっぱいまで広がる
縦横両方Expandに設定するときは中身のサイズを指定しなくてもいいけどExpand指定しないときは中身のサイズを指定してやらないと表示されない(サイズが特定できないためっぽい)


表示位置設定

topSash.setOrigin(0,0);

window作成テンプレート

変更済みだけどSWTサンプル集から


public class ViewerMain {
public static void main(String[] args) {
ViewerMain main = new ViewerMain();
}
private ViewerMain() {
display = new Display();
shell = new Shell(display);
shell.setText("タイトル");
shell.setLayout(new FillLayout());
shell.setSize(800,600);
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
}
}

display.dispose();
}
}

Shellスタイルは
BORDER 枠が立体的になる
CLOSE 閉じるボタン。無いと困る
MIN 最小化ボタン
MAX 最大化ボタン
NO_TRIM 何も無し
RESIZE リサイズを可能にする
TITLE タイトルバー

以下たぶん子ウインドウの動作の違い
親に指定すると枠が黒い線、立体的ではない
APPLICATION_MODAL
MODELESS
PRIMARY_MODAL
SYSTEM_MODAL

基本スタイルに
SHELL_TRIM CLOSE | TITLE | MIN | MAX | RESIZE
DIALOG_TRIM TITLE | CLOSE | BORDER
がある。スタイルを指定しなければたぶんSHELL_TRIM が設定。

2004年02月その他のエントリー