[Windows]wofstreamで日本語文字化け

2chの「★初心者にVisual C++を教えるスレ★ Part3」より発掘
wofstreamでロケールエラーのため日本語が出力できない
Visual Studio 2005でも再現した

名無しさんありがとう

749 名前:デフォルトの名無しさん :03/01/23 15:51
    >719
    wofstream test("out_test1.txt");
    の代わりに、
    wofstream test;
    test.imbue( locale("jpn") );
    test.open("out_test1.txt");
    とすると動く。

    ・Cロケールなcodecvtがつくられる際に、コンストラクタで
    setlocale(LC_ALL, "C");が実行される
    ・VCのimbueには致命的な欠陥があるのか、
    コンストラクタでつくられたCロケールなcodecvtを(imbue時に)
    作り直したりしないので、openして作りなおさせる必要がある。

[Windows]Windows XP SP3 をインストールした後Windows Updateに失敗する
Microsoftサポートオンラインより
Windows XP SP3 をインストールした後、Windows UpdateMicrosoft Update、または自動更新で更新プログラムが正常にインストールされない」

Automatic Updateサービスの登録情報が壊れるのかな?

対策まとめ
1. net stop wuauserv
2. regsvr32 %windir%\system32\wups2.dll
3. net start wuauserv

[etc]すごいハイボールの作り方
ネタフルより
(1)グラスに氷を一杯に入れ冷やす
 グラスから少し氷が溢れるくらいたっぷりと。
(2)ウイスキーを注ぎ10回転
 ウイスキー1:ソーダ3くらい。ウイスキーを注いだ後、マドラーでグルグルと10回転
(3)冷えたソーダを加え炭酸が逃げないようマドラーで1回転
(4)口まで氷を足す

[FreeBSD]WPAの設定
ぽっぺん日記@karashi.orgより

/boot/loader.conf

if_[IF名]_load="YES"
wlan_wep_load="YES"
wlan_tkip_load="YES"
wlan_ccmp_load="YES"
wlan_xauth_load="YES"
wlan_acl_load="YES"

/etc/rc.conf

ifconfig_[IF名]="WPA DHCP"

/etc/wpa_supplicant.conf

network={
        ssid="ほげ"
        scan_ssid=1
        key_mgmt=WPA-PSK
        psk="ふが"
}

FreeBSDのverup手順

時々忘れるのでverup手順メモ

    1. make buildworld
    2. make buildkernel KERNCONF=ほげほげ
    3. make installkernel KERNCONF=ほげほげ
    4. reboot
    5. mergemaster -p
    6. make installworld
    7. mergemaster -siva
    8. mergemaster -sivr
    9. reboot
  • KERNCONFはオプションで
  • メジャーverupでなければmergemasterは省ける(場合もある)

ThinkpadのTrackPointを使う

xorgのマウスデバイスは/etc/psm0を指定する。
さらにmousedは起動しない(起動しているとpsm0が使えない。sysmouseを使うとTrackPointのイベントを拾わない)

/etc/X11/xorg.conf
Section "InputDevice"
Identifier "Mouse1"
あたりに以下を追加

    Option "Emulate3Buttons"
    Option "EmulateWheel" "true"
    Option "EmulateWheelTimeOut" "200"
    Option "EmulateWheelButton" "2"
    Option "EmulateInertia" "50"
    Option "XAxisMapping"  "6 7"
    Option "ZAxisMapping"  "4 5"

また、FirefoxではTrackPointの左右スクロールで「進む」「戻る」の動作になってしまうので、その対策も必要

mousewheel.horizscroll.withcontrolkey.action = 3;
mousewheel.horizscroll.withcontrolkey.numlines = 1;
mousewheel.horizscroll.withcontrolkey.sysnumlines = true;

mousewheel.horizscroll.withnokey.action = 0;
mousewheel.horizscroll.withnokey.numlines = 1;
mousewheel.horizscroll.withnokey.sysnumlines = true;

mousewheel.horizscroll.withshiftkey.action = 1;
mousewheel.horizscroll.withshiftkey.numlines = 1;
mousewheel.horizscroll.withshiftkey.sysnumlines = true;