2012年11月2日金曜日

matlab: limitations for large/small numbers

Here are some limitations for large/small numbers in Matlab.
So it's about boundary and precision.
Examples below are results derived in Matlab R2007b (64bit) on Win7 x64 on Core i5 2500.
Just a list of examples; no summary or interpretation as of now.

**
>> help eps
will explain most of the following results
**

Large number limit

 

number:

>> realmax
ans =
  1.7977e+308

>> realmax+9.97e+291
ans =
  1.7977e+308

>> realmax+9.98e+291
ans =
  Inf

exp:

>> exp(709)
ans =
  8.2184e+307

>> exp(710)
ans =
  Inf

log:

>> log(realmax+9.97e+291)
ans =
  709.7827

>> log(realmax+9.98e+291)
ans =
  Inf

Small number limit


number:

>> realmin
ans =
  2.2251e-308

>> isequal(0,realmin)
ans =
     0

>> isequal(0,0+realmin)
ans =
     0

>> 1+realmin
ans =
     1

>> isequal(1,1+realmin)
ans =
     1

>> isequal(1,1+realmin*4.98e+291)
ans =
     1

>> isequal(1,1+realmin*4.99e+291)
ans =
     0

>> realmin*4.99e+291
ans =
  1.1103e-016

>> eps
ans =
  2.2204e-016

>> isequal(2,2+realmin*9.97e+291)
ans =
     1

>> isequal(2,2+realmin*9.98e+291)
ans =
     0

>> isequal(100,100+realmin*3.1e+293)
ans =
     1

>> isequal(100,100+realmin*3.2e+293)
ans =
     0

exp:

>> exp(-745)
ans =
  4.9407e-324

>> exp(-746)
ans =
     0

>> isequal(1,exp(realmin*4.98e+291))
ans =
     1

>> isequal(1,exp(realmin*4.99e+291))
ans =
     0

log:

>> log(realmin*1.0e-15)
ans =
 -742.8306

>> log(realmin*1.0e-16)
ans =
  -Inf

>> isequal(log(1),log(1+realmin*4.98e+291))
ans =
     1

>> isequal(log(1),log(1+realmin*4.99e+291))
ans =
     0

>> isequal(log(2),log(2+realmin*9.97e+291))
ans =
     1

>> isequal(log(2),log(2+realmin*9.98e+291))
ans =
     0

>> isequal(log(100),log(100+realmin*4.1e+294))
ans =
     1

>> isequal(log(100),log(100+realmin*4.2e+294))
ans =
     0

2012年10月23日火曜日

fb2k: 外観・UI設定の全体像

foobar2000 の外観やUI設定の全体像について.[執筆中, 2013/05/16]

概要

foobar2000 では,外観や UI を自分好みに高度にカスタマイズできる.細かい話は山ほどあるが,基本的な流れは次のとおり.
  1. UI 自体の種類を選ぶ
  2. 選んだ UI の設定方法に従って, レイアウトの変更や部品の追加(パネル,スプリッタ等)を行う.
  3. 各部品を設定していく.
UI 自体や部品は,標準で使えるか,あるいは foobar2000 へのプラグインとして配布されている.部品は UI element 系と UI extension 系とに分かれ,どちらが利用可能かは UI の種類で決まる.

参考



------------------------------------------------------------------
[foobar2000メモのトップに戻る]

fb2k: foobar2000 メモ

foobar2000 は windows 用のサウンドプレイヤー.
とてつもなくカスタマイズできる.
ASIO や WASAPI などもサポート可.

その設定ガイドを書いてみる.主に自分のメモ用.

情報自体は特に目新しくはなく,参考サイトにのっているものばかりではあるが,現状で自分の設定に必要だったもののまとめ.

まずは,日本の foobar2000 wiki に,
本体のインストール
基本操作等のチュートリアル
が述べられている.

[foobar2000 メモ トップに戻る]

参考:
hydrogen audio の foobar2000 wiki ページ
日本の foobar2000 wiki ページ
日本の foobar2000 wiki ページもう一つ
クラシックに特化したすごい設定

2012年10月2日火曜日

日常: 空耳(2)

東急線の空耳について先日述べたが,再び聞く機会があった.

ふと気づくと車内の電光掲示板に Yokohama Municipal Subway と表示されている.
身構えていると,果たしてアナウンスは
横浜 ミュニスィプゥ サブウェイ
Yokohama Municipal Subway
に聞こえた.そうとしか聞こえなかった.

この前の
Yokohama Minnesota Line
ラインはどこへ行った‥?


2012年9月29日土曜日

Win: Installing app up to vista onto 7

表向き Vista までしか対応してないアプリ等を 7 にインストールする

Applications supporting windows version up to vista are likely to work also on windows 7.
However, their installer sometimes prevent the apps from being installed onto 7.
Don't be disappointed, though, because this obstacle can often be removed.

See, for example, Logitech's v-uj16 web camera, used in Qcam Pro 4000. The software stack provided supports up to vista but not windows 7. On windows 7, the installer file (qc1051enu.exe or qc1051enu_x64.exe) shows a warning message and quits during the install. To avoid this,
1. Unpack the installer file (.exe) with some (de)archivers. 7zip worked for me.
2. Setup.ini will be found in the extracted files. 'MaxVersion' definition will be found in Setup.ini, in [OS32] section and [OS64] section.
[OS64]
MinVersion=5.2.3790
MinServicePack=0.0
MinVersionErrMsg=##ERROR_OS64_MAX##
MaxVersion=6.0.9000
MaxServicePack=0.0
MaxVersionErrMsg=##ERROR_OS64_MAX##
3. Change MaxVersion definition (by any text editor like notepad), like this:
MaxVersion=9.0.9000
4. Set Setup.exe's compatibility option (Right-Click -> Properties -> Compatibility) to Windows Vista (SP2).
5. Run Setup.exe in the extracted files. You may need to reboot then.
6. Manually install webcam's device driver from device manager. The driver can be found in the installer extracted files.

This procedure worked fine for my v-uj16 and windows7 x64.

~~~~

Windows Vista までサポートしていて,Windows 7 がサポートに入っていないアプリは,実は Windows 7 で動かせることが結構ある.

たとえば,ロジクールの v-uj16 というwebカメラがある(Qcam Pro 4000のカメラ)が,このソフトウェアスタックは Vista までしかサポートしていない.Windows 7 ではインストーラ(qc1051enu.exe または qc1051enu_x64.exe)が文句言って先に進ませてくれない.これを回避してインストールするには,
1. インストーラの .exe ファイルを解凍する.今回は 7zip で解凍した.
2. Setup.ini というファイルが出てくる.その中に 'MaxVersion' という定義がある([OS32]と[OS64]のセクションにある).こんな感じ:
[OS64]
MinVersion=5.2.3790
MinServicePack=0.0
MinVersionErrMsg=##ERROR_OS64_MAX##
MaxVersion=6.0.9000
MaxServicePack=0.0
MaxVersionErrMsg=##ERROR_OS64_MAX##
3. MaxVersion が Vista どまりになってるのが諸悪の根源だ.メモ帳などのテキストエディタでこうしてしまえ:
MaxVersion=9.0.9000
4. 解凍して出てきた Setup.exe の互換性オプションを Windows Vista (SP2) にする.右クリック→プロパティ→互換性のところ.
5. Setup.exe を実行.必要なら再起動する.
6. ウェブカメラのドライバを,デバイスマネージャから手動でインストールする.ドライバは,先ほどインストーラを解凍して出てきた中にある.

私の場合はこれでできました.v-uj16 が windows7 x64 上で無事に稼動.

日常: 空耳

東急目黒線が日吉に到着するときのアナウンス(乗り換え案内)が

横浜ミネソタライン
Yokohama Minnesota Line

に聞こえた.そうとしか聞こえなかった.

横浜市営地下鉄は

The Yokohama Municipal Subway

らしいが,ミネソタにしか聞こえなかった.

後日もう一度聞いてみた

2012年9月6日木曜日

Win: SFTP server

It will be convinient to be able to get my files easily, securely and (almost) direcly from my home computer behind the router at home. 1) An always-on internet connection, 2) DDNS service, 3) a router capable of port-maping, and 4) a secure file server service can achieve such convinience. I already have 1)-3), so I was searching for 4). For this purpose, SFTP server is one of the suitable solutions.

Though there are many FTP/FTPS servers running on windows, SFTP servers especially those not being a part of SSH servers are less found (see wikipedia).
Core FTP/SFTP server just worked fine.
A TIP: if you are using Core SFTP server on double-byte environment, say Japanese windows, it may be necessary to set appropriate charset on CLIENT. For example, FileZilla worked fine by setting Site Manager -> Charset -> Use custom charset: shift-jis
2012.9.7: For my particular operation, FileZilla hung up; WinSCP worked. It was just a simple folder transfer ...

ルータの背後のホームコンピュータからどうやってファイルをセキュアかつ可能な限り高速に取り出そうかと思っていたが,Core FTP/SFTP server というのがうまく動いてくれた.ルータからポートマッピングで 22 番ポートを背後のマシンに飛ばしている.実は,windows 用 SFTP サーバの手ごろな実装はそんなに多くないようだ.クライアントは山ほどあるのにね.
コツ:例えばサーバが日本語 windows で走っていて,クライアントに FileZilla を使っているなら,FileZilla 側で,「サーバの Charset が shift-jis だ」と指定する.これで問題なく日本語ファイル名扱えました.
2012.9.7 追記:ある操作をしようとしたら,FileZillaがはんぐった.WinSCPでできた.普通にフォルダを転送しようとしただけ.