わいえむねっと

Contents
Categories
Calendar
2026/06
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30
Monthly Archives
~2000/01
Recent Entries
RSS1.0
Templates
Information
Processed: 0.079 sec
Chashed: -
2007/04/18 Wed
愛用していた486世代Winキーなし98キーボードの『し』が効かなくなる。
『し』というか『D』というか。こちとらカナタイパーですので。
数日前に右SHIFTが効かなくなってどうしたものかと思いつつ騙し騙し使ってきましたけどこれはムリだ。
しかし、右SHIFTて意外に押してるものですね。失ってみてから気が付いた。人生そんなことばっかりだ。(うるさいよ)
とりあえず窓際に放置していた9801Rキーボードに差し替え。
キーボードマニアの間では定評のある名品ですが、メカニカルよりメンブレンの方が好きな人なので故障したキーボードと同じものを再入手したいところ。
ただ、Winキーなしメンブレンは98キーボードで最も耐久性が低いという話なので、完動品の入手はもはや絶望的なのか。
あー。
つーか、よく考えたらそろそろ使い始めてから10年目とかになってた気が。耐久性十分だろそれ。 豚角煮まんにしようかどうしようかと迷いつつも豚角煮まん。 無糖ブラックは3本。 会社の前で降りしきる雨を眺めながらカレーまんをかじっているところを今度は別の部署の部長に目撃される。 そして三日連続で雨に濡れての帰宅。
折り畳み傘を使うか否かのしきい値が高すぎだあんた。
2007/04/17 Tue
起きたら1時。え?日付変わる前に落ちてた?
このまま起きていようか迷って寝返りを打って二度寝して3時。
このまま起きていようか迷って寝返りを打って二度寝して5時。
らきすた見てsaku saku見て豚角煮まんを食べて出社っと。 委員会の仕事を適当にこなしながらぷいぷいぷー。
政治的な理由(?)で仕様が降りてこないのでこのままいくとゴールデンウィークは9連休になるみたいですよ?
健康に悪い。(なんでだ) 無糖ブラックは4本。 20時で最終退出って。
平和だな。
平和じゃないところが軒並み外にでているというのもあるけれど。
2007/04/16 Mon
まだまだ豚角煮まん。 無糖ブラックは3本。
ゴーヤコーヒーてのがあるらしい。
苦さと苦さのコラボレーション? 会社の前で突っ立っているところを他所の部署の部長に声をかけられカレーまんをくわえたまま振り返りふきだされる。
そんな社会人。5年目。
2007/04/15 Sun
好きなことしてるんだろ? いくら喰いたい。 ソケット数の制限とか。

Maximum Number of Sockets an Application Can Use
http://support.mi​crosoft.co​m/kb/111855/en-us
The maximum number of sockets that a Windows Sockets application can use is determined at compile time by the manifest constant FD_SETSIZE. To do this, from the Win32 SDK WINSOCK.H file:

This value is used in constructing the fd_set structures used in select(). The default value in WINSOCK.H is 64. If an application is designed to be capable of working with more than 64 sockets, define the manifest FD_SETSIZE in every source file before including WINSOCK.H. One way of doing this is to include the definition within the compiler options in the makefile, such as adding -DFD_SETSIZE=128 as an option to the compiler command line for Microsoft C.

64で足りなければFD_SETSIZEを増やせばいいじゃないと言っているけれど、MAXIMUM_WAIT_OBJECTSに関して同様の情報はなし。

WinNT.h
#define MAXIMUM_WAIT_OBJECTS 64 // Maximum number of wait objects

イベントで処理するためにはスレッドなりなんなりで階層化するしかないのか。
LinuxのFD_SETSIZEは、

sys/select.h
/* Get definition of needed basic types. */
#include <bits/types.h>

#define FD_SETSIZE __FD_SETSIZE

で、

bits/types.h
#include <bits/typesizes.h> /* Defines __*_T_TYPE macros. */

から、

bits/typesizes.h
#define __FD_SETSIZE 1024

と。glibc-2.3.4。
Windowsのデフォルトは小さすぎる。
2007/04/14 Sat
引用行のイタリックが読みにくすぎるのでborder-leftに。
ボックスをoverflow:autoに。
なんだかんだで朝に。 いくら喰いたい。 落ちているうちに配達員がきてた模様。不覚。 いくら喰いたい。
2007/04/13 Fri
2時。
寝ると見せかけてウィスキーをぐいー。 そして昨日と同じ電車でやっぱり豚角煮まんは食う。 航空関係の仕事をいくつかやってきたわけですが、ドキュメントが『かんせいとしょ』と呼ばれていたのは『完成図書』でなくて『管制図書』だったのでは。
とか今更のように気付く。 well-knownじゃないよ、ephemeralだよ。

The default dynamic port range for TCP/IP has changed in Windows Vista Enterprise
http://support.mi​crosoft.co​m/kb/929851/en-us
To conform with IANA port-assignment standards, the default dynamic port range for TCP/IP has changed from 1024-5000 to 49152-65535 in Windows Vista Enterprise.

Widnowsでは1024~5000がephemeralで、Vista Enterpriseだけ49152~65535。

How to reserve a range of ephemeral ports on a computer that is running Windows Server 2003 or Windows 2000 Server
http://support.mi​crosoft.co​m/kb/812873/en-us

設定は、

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters

にて変更可能と。

When you try to connect from TCP ports greater than 5000 you receive the error 'WSAENOBUFS (10055)'
http://support.mi​crosoft.co​m/kb/196271/en-us

試しに

#include <stdio.h>
#include <winsock2.h>

void main()
{
	WSADATA tWSAData;
	WSAStartup(MAKEWORD(2, 2), &tWSAData);

	sockaddr_in name;
	name.sin_family = AF_INET;
	name.sin_port = htons(5001);
	name.sin_addr.s_addr = INADDR_ANY;
	int namelen = sizeof(SOCKADDR);

	SOCKET s = socket(AF_INET, SOCK_STREAM, 0);
	bind(s, (SOCKADDR*)&name, namelen);
	listen(s, 1);

	for(;;)
	{
		sockaddr_in name;
		name.sin_family = AF_INET;
		name.sin_port = htons(5001);
		name.sin_addr.s_addr = inet_addr("127.0.0.1");
		int namelen = sizeof(SOCKADDR);

		if(connect(socket(AF_INET, SOCK_STREAM, 0), (SOCKADDR*)&name, namelen) == SOCKET_ERROR)
		{
			break;
		}
		accept(s, (SOCKADDR*)&name, &namelen);
		printf("%d\n", ntohs(name.sin_port));
	}
	printf("->%d\n", WSAGetLastError());
}

とかしてポートを食い潰してみると、確かにWSAENOBUFS。
Linuxでは、

ip-sysctl.txt
Defines the local port range that is used by TCP and UDP to
choose the local port. The first number is the first, the
second the last local port number. Default value depends on
amount of memory available on the system:
> 128Mb 32768-61000
< 128Mb 1024-4999 or even less.
This number defines number of active connections, which this
system can issue simultaneously to systems not supporting
TCP extensions (timestamps). With tcp_tw_recycle enabled
(i.e. by default) range 1024-4999 is enough to issue up to
2000 connections per second to systems supporting timestamps.

128MB以上メモリを積んでいたら32768~61000。

man 7 ip
ip_local_port_range
Contains two integers that define the default local port range allocated to sockets. Allocation starts with the first number and ends with the second number. Note that these should not conflict with the ports used by masquerading (although the case is handled). Also arbitrary choices may cause problems with some firewall packet filters that make assumptions about the local ports in use. First number should be at least >1024, better >4096 to avoid clashes with well known ports and to minimize firewall problems.

設定は、

/proc/sys/net/ipv4/ip_local_port_range

にて変更可能と。
同様にポートを食い潰してみるとEADDRNOTAVAIL。
ふむ。 無糖ブラックは3本。
2007/04/12 Thu
いつもの電車に間に合いそうにないなくても豚角煮まんは食う。 無糖ブラックは4本。 鮭とばをかじりながら書類の仕上げ
あと、たこわさ。
すごい酒が飲みたい。
そしてやっぱりカレーまん。
2007/04/11 Wed
珍しく本社に来てた同期が遠巻きにこっちを見ながら隣と何か話しているのでなんだと思ったら、

「あれって病気?」

とか聞こえてきて吹いたのが昨日の話。小坂那也です。(挨拶)
病気って。
そんなにか。
否定したら病的と言い直されました。
それなら可。(変わんねぇよ) 春特有の感覚。
そして豚角煮まん。 新人教育担当とmain関数の話になり、

・戻り型は省略するとintになったような
・return;だと不定値が返ったような
・mainは他の関数と扱いが違ったような
・CとC++でも違ったような

とか、ひどく記憶が曖昧だったので試してみてまとめ。
コンパイラはBCC5.5.1。
システムによってはそもそも戻り型がないものもあるとかなんとか。

 {return 0;}{return;}{}
Cvoid main()W8081  
int main()  W8070
main()  W8070
C++void main()E2467  
int main() E2292 
main() E2292 
void foo()E2467  
int foo() E2292W8070
foo() E2292W8070

警告 W8070 foo.c xxx: 関数は値を返すべき(関数 main )
警告 W8081 foo.c xxx: void 関数は値を返してはならない(関数 main )
エラー E2292 foo.cpp xxx: 関数は値を返すべき(関数 main() )
エラー E2467 foo.cpp xxx: 'main()' は値を返せない(関数 main() )
無糖ブラックは3本。
やるせない。
まだまだカレーまん。
2007/04/10 Tue
シャワーを浴びて。
もってけ!セーラーふくをmp3変換して。
TopTangentにコピーして。
TEPRAをカバンに詰め込んで。
豚角煮まんをくわえて。
出発だ。 引き続きメイクファイルをこねくり回す。
メンテしやすくしようと重複記述を極力減らすためにincludeを多用しているうちに自分にしかメンテできないシロモノになってきたので単純な構成に書き直す。
まぁ、こんなもんか。
一応まだこれが仕事だという自覚はあるようです。安心した! これはひどいシーケンスですね。 なんでXML::Simpleだけ4/7に更新されてるのっさ。

$ls -l /usr/local/lib/perl5/site_perl/5.8.6/XML
total 324
drwxr-xr-x    2 root     root         4096 Nov 30  2005 DOM
-r--r--r--    1 root     root       110674 Jul 26  2005 DOM.pm
-r--r--r--    1 root     root        12109 Nov  6  2004 DTDParser.pm
-r--r--r--    1 root     root        19968 Oct 22  2003 ESISParser.pm
drwxr-xr-x    2 root     root         4096 Nov 30  2005 Handler
-r-xr-xr-x    1 root     root        20698 May 13  2005 NamespaceSupport.pm
drwxr-xr-x    2 root     root         4096 Dec 31  2005 Parser
drwxr-xr-x    2 root     root         4096 Nov 30  2005 PatAct
-r--r--r--    1 root     root         2576 Oct 22  2003 Perl2SAX.pm
-r--r--r--    1 root     root         6065 Jun 20  2001 RegExp.pm
drwxr-xr-x    3 root     root         4096 Nov 30  2005 SAX
-r--r--r--    1 root     root         9239 Oct 25  2005 SAX.pm
-r--r--r--    1 root     root         6486 Oct 22  2003 SAX2Perl.pm
drwxr-xr-x    2 root     root         4096 Apr  7 03:37 Simple
-r--r--r--    1 root     root        91171 Oct 30 17:28 Simple.pm
無糖ブラックは4本。
2007/04/09 Mon
今週も豚角煮まんから始まる。
豚角煮まんから始まるミラクルだってあるよね。(ねぇよ)
歌詞を検索したら英訳の仕事をした普通の人の日記がでてきて吹いた。
きゅいん!って! 日がな一日makeの構成をこねくり回していたようなそんな日。
無糖ブラックは4本。 全社的に残業について規制が設けられる模様。
残業手当を割増にした上で時間を削減とかなんとか。はぁ。
体制を見直して負担のばらつきをどうにかすることを先に考えればいいのに。
そんなことより自主サービス残業を許可する制度をつくってくれと言いたい。というか次の面談で言う。 とりあえず定時退社をしてみる。
会社の前でカレーまんをかじりながら降りしきる雨を茫と眺める。
精神衛生上良くない。