parser

Написать ответ на текущее сообщение

 

 
   команды управления поиском

Ответ

tezro 02.05.2009 22:56 / 02.05.2009 23:37

Вот код:
###############################################################################
@main[]
^rusage[]
^method[]
^rusage[]
#end @main[]



###############################################################################
@method[][t1;t2]
$t1[^table::create{value	option
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
1	not null}]

$t2[^table::create{value	option
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
0	null
1	not null}]

^for[i](1;10){
	^select[
		$.options[$t1]
		$.selected[1]
	]
	^select[
		$.options[$t2]
		$.selected[1]
	]
}
#end @method[]



###############################################################################
@select[hash]
$result[
	<select>
		^hash.options.menu{
			<option value="$hash.options.value"^if($hash.options.value eq $hash.selected || ^hash.options.value.double(0) == ^hash.selected.double(1)){ selected="selected"}>
				$hash.options.option
			</option>
		}
	</select>
]
#end @select[]



###############################################################################
@rusage[comment][v;now;prefix;message;line;usec]
$v[$status:rusage]
$now[^date::now[]]
$usec(^v.tv_usec.double[])
$prefix[[^now.sql-string[].^usec.format[%06.0f]] $env:REMOTE_ADDR - $comment>]
$message[clean($v.utime)	read($v.stime)	memory($v.maxrss)	readCount($v.ReadOperationCount)	writeCount($v.WriteOperationCount)	peak($v.PeakPagefileUsage)	3($request:uri)]
$line[$prefix $message ^#0A]
^line.save[append;/rusage.log]
$result[]
#end @rusage[]
Вот лог:
[2009-05-02 22:54:12.308336] 1.1.1.1 - > clean(0.004889)	read(0.014667)	memory(39712)	readCount()	writeCount()	peak()	3(/test/)  
[2009-05-02 22:54:12.321358] 1.1.1.1 - > clean(0.022389)	read(0.016791)	memory(39712)	readCount()	writeCount()	peak()	3(/test/)