[#8257] Re: Smalltalk [Re: design patterns] — 助田 雅紀 <masaki.suketa@...>

助田です。

11 messages 1998/06/09
[#8259] Re: Smalltalk [Re: design patterns] — KIMURA Koichi <kkimura@...> 1998/06/10

[#8262] TkGrid do not exist? — Hiramatu Yoshifumi <hiramatu@...>

平松です。

26 messages 1998/06/10
[#8266] Re: TkGrid do not exist? — matz@... (Yukihiro Matsumoto) 1998/06/10

まつもと ゆきひろです

[#8269] Re: TkGrid do not exist? — NAGAI Hidetoshi <nagai@...> 1998/06/10

永井@知能.九工大です.

[#8271] Re: TkGrid do not exist? — NAGAI Hidetoshi <nagai@...> 1998/06/10

永井@知能.九工大です.

[#8375] new MethodIndex — keiju@... (Keiju ISHITSUKA)

けいじゅ@日本ラショナルソフトウェアです.

21 messages 1998/06/16
[#8447] new MethodIndex — TEI meiki <tei@...> 1998/06/20

こんにちは、鄭です。

[#8448] new MethodIndex — TEI meiki <tei@...> 1998/06/20

再び、鄭です。_o_

[#8418] how to use delegate — gotoken@... (GOTO Kentaro)

ごとけんです

18 messages 1998/06/18
[#8419] Re: how to use delegate — matz@... (Yukihiro Matsumoto) 1998/06/19

まつもと ゆきひろです

[#8420] Re: how to use delegate — gotoken@... (GOTO Kentaro) 1998/06/19

ごとけんです

[#8421] Re: how to use delegate — matz@... (Yukihiro Matsumoto) 1998/06/19

まつもと ゆきひろです

[#8521] hash sort — "Kazuhiro Yoshida" <s95l980@...>

もりきゅうです。

34 messages 1998/06/26
[#8523] hash sort — gotoken@... (GOTO Kentaro) 1998/06/26

ごとけんです

[#8533] Re: hash sort — WATANABE Hirofumi <watanabe@...> 1998/06/26

わたなべです.

[#8534] Re: hash sort — gotoken@... (GOTO Kentaro) 1998/06/26

ごとけんです

[#8536] Re: hash sort — Sinichiro Dezawa <dezawa@...> 1998/06/26

出沢です

[#8538] Re: hash sort — gotoken@... (GOTO Kentaro) 1998/06/26

ごとけんです

[#8539] Re: hash sort — TAKAHASHI Masayoshi <maki@...> 1998/06/26

高橋です。

[#8541] Re: hash sort — gotoken@... (GOTO Kentaro) 1998/06/26

ごとけんです

[#8546] Re: hash sort — Tadayoshi Funaba <tadf@...> 1998/06/26

ふなばです。

[ruby-list:8205] Re: Web Counter

From: Wada Hiroshi <hiroshiw@...>
Date: 1998-06-05 10:51:39 UTC
List: ruby-list #8205
和田です。

In message "[ruby-list:8202] Re: Web Counter"
    on 98/06/05, akira yamada / やまだあきら <akira@linux.or.jp> writes:

>  scount = sprintf("%0{leng}d", sleng) if leng

なるほど。今回の場合は、

   scount = sprintf("%0#{leng}d",count.to_s) if leng

にしました。

>  カウンタ値を保持しているファイルをロックして
>    カウンタ値を読み取って
>    インクリメントして
>    新しいカウンタ値を書き戻して
>  ロックを解放して
>  イメージの生成と
>  イメージの送出
>
>のように順番を変えた方がよいのではないかと思うです. 

半分寝ながら作っていたので、気が付きませんでした。

早速修正しました。

-- 
ネットワーク応用通信研究所
和田  寛 < hiroshiw@netlab.co.jp >

#! /usr/local/bin/ruby

# 表示桁数
leng = 6

# カウントを保存するファイル
countfile = "/home/hiroshiw/.num"

file = open(countfile)
count = file.gets().to_i
file.close

newcount = count + 1
file = open(countfile,"w")
file.flock(File::LOCK_EX)
printf file,newcount.to_s
file.close

require "GD"
# require "cgi-lib"

print "Content-type: image/gif\n\n"

scount = sprintf("%0#{leng}d",count.to_s) if leng

font = GD::Font.new("Giant")

im = GD::Image.new(font.width * scount.to_s.size ,font.height)
white = im.colorAllocate(255,255,255)
black = im.colorAllocate(0,0,0)
bule  = im.colorAllocate(0,0,255)
im.string(font, 0, 0, scount, bule)
im.interlace
im.gif STDOUT

In This Thread