Annotation of parser3/www/htdocs/index.html, revision 1.31

1.15      paf         1: #@USE
                      2: #z/t.p
                      3: 
                      4: @autoz[]
                      5: $request:charset[windows-1251]
                      6: $response:charset[windows-1251]
                      7: $response:content-type[$.value[text/html]$.charset[$response:charset]]
                      8: 
                      9: @main[]
1.31    ! paf        10: ^voidparams[]
        !            11: #^rolls2[]
1.30      paf        12: #^cacheexpireschanging[]
1.29      paf        13: #^cacheexpiresfixed[]
                     14: #^dateoffsets[]
                     15: #^exceptionTypes[]
1.28      paf        16: #^roll2[]
1.27      paf        17: #^rolls[]
1.25      paf        18: #^exceptions1[]
1.22      paf        19: #^locate_by_expr[]
1.18      paf        20: #^method_junction_params{...}
1.17      paf        21: #^verifyCookie[paf]
1.21      paf        22: #^execlangs[]
1.16      paf        23: #$t[^tobjeresult[]]$t.a
                     24: #^xmlprobs[]
1.15      paf        25: #^doubleprobs[]
                     26: #^math:random(-10)
                     27: #^divnamestop[]
                     28: #^arrayclone[]
                     29: #^operator_tricks[]
                     30: #^xoutputrusattr[]
                     31: #^xdocset1[]
                     32: #^regexp3[]
                     33: #^exec2[]
                     34: #^tlock[]
                     35: #^xmloutattrwithoutvalue[]
                     36: #^precisionProblem[]
                     37: #^xpath[]
                     38: #^ttablesetlang[]
                     39: #^mail3[]
                     40: #^ttime[]
                     41: #^tupper[]
                     42: #^treplace[]
                     43: #^xslt2[]
                     44: #^tcache2[]
                     45: #$ORIGINS(1)
                     46: #$t[^table::set{a b} ^table::set{c d}]
                     47: #^ttaintuntaint[]
                     48: #^tappend2[]
                     49: #^badvsnprintf[]
                     50: #^badoracequoting[]
                     51: #^badconstructors[]
                     52: #^xloadwrongtable[]
                     53: #^xsetwrongtable[]
                     54: #^if($form:test){y}{n}
                     55: #^tablecolumnerror[]
                     56: #^roll[]
                     57: #^cookie2[]
                     58: #^tableset[]
                     59: #^math:PI.format{%.30f}
                     60: #^xchildren[]
                     61: #^thashforeach3[]
                     62: #^thashforeach2[]
                     63: #^thashforeach[]
                     64: #^thashdelete[]
                     65: #^connect[mysql://user:pass@cd.rinet.ru/db]{^void:sql{z} }
                     66: #^tappend[]
                     67: #^sappend[]
                     68: #^eval(10\3)<br>
                     69: #^tform[]
                     70: #^formattest[]
                     71: #^filelist[]
                     72: #^connect[mysql://user:pass@host]{ }
                     73: #^безнадёжна_попытка_поправить_непоправимое[]
                     74: #^tcache[]
                     75: #^thashfileexp[]
                     76: #^tcounter[]
                     77: #^tablehash[]
                     78: #j^hashfile[]
                     79: #^formclass[]
                     80: #^hren[]
                     81: #^domedit[]
                     82: #^domxslt[]
                     83: #^lsplit2[]
                     84: #^faceesize[]
                     85: #^imageresize[]
                     86: #^ifassignhash[]
                     87: #^tintdefault[]
                     88: #$response:status[404]
                     89: #^ifpasshash[]
                     90: #^movedir[]
                     91: #^replace[]
                     92: #^set[]
                     93: #^hash[]<hr>
                     94: #$t[^methresult[]] ->$t
                     95: #^terror[]
                     96: #^ssave[]
                     97: #^calendar[]
                     98: #^thash[]
                     99: #^tdef[]
                    100: #^ford[]
                    101: #^tif[]
                    102: #^image[]
                    103: #^mail2[]
                    104: #^cookie[]
                    105: #^response[]
                    106: #^regexp2[]
                    107: #^ttablerem[]
                    108: #^pcre[]
                    109: #^regexp[]<hr>
                    110: #^mail[]
                    111: #^exec[]
                    112: #^fori[]
                    113: #^tconnect[]
                    114: #^xslt[]
                    115: #^xml[]
                    116: #^header[]
                    117: <hr>
                    118: OK
1.31    ! paf       119: 
        !           120: @voidparams[]
        !           121: ^voidparamsm[$form:field]
        !           122: 
        !           123: @voidparamsm[p]
        !           124: ^p.int(123)
1.29      paf       125: 
1.30      paf       126: @rolls2[]
                    127: $now[^date::now[]]
                    128: $d[^date::create($now.year;$now.month)] ^d.sql-string[]<br>
                    129: ^for[i](1;12){
                    130:        ^d.roll[month](-1) ^d.sql-string[]<br>
                    131: }
                    132: 
1.29      paf       133: @cacheexpireschanging[]
                    134: ^cache[$DB_HOME/keyключ][^date::now(+1)]{ ^rem{1 day}
                    135:     ^cache[^date::now(+4/24/60/60)]
                    136: #    ^cache(2)
1.30      paf       137: #    ^cache(0)
1.29      paf       138:        ^math:random(100)
                    139: }
                    140: 
                    141: 
                    142: 
                    143: @cacheexpiresfixed[]
                    144: ^cache[$DB_HOME/keyключ][^date::now(+2/24/60/60)]{
                    145:        ^math:random(100)
                    146: }
                    147: 
                    148: @dateoffsets[]
                    149: $d[^date::create(^date::now[]+1/24/60)]
                    150: #$d[^date::now(+1/24/60)]
                    151: ^d.sql-string[]
                    152: #$d
1.26      paf       153: 
1.28      paf       154: @exceptionTypes[]
                    155: #    parser.compile       ^test[}                компиляция (непарная скобка, ...)
                    156: #    parser.runtime       ^if(0).                параметры (больше/меньше, чем нужно, не тех типов, ...)
                    157: #    number.zerodivision  ^eval(1/0) ^eval(1%0)
                    158: #    number.format        ^eval(abc*5)
                    159: #    file.missing         ^file:delete[delme]                       not found
                    160: #    file.access          ^table::load[.]                       no rights
                    161: #    image.format         ^image::measure[index.html]                        not gif/jpg
                    162: #    sql.connect          ^connect[mysql://baduser:pass@host/db]{}                       not found/timeout
                    163: #    sql.execute          ^connect[mysql://okuser:pass@host/db]{^void:sql{select bad}}                       syntax error
                    164: #    xml                  ^xdoc::create{<forgot?>}                       any error in xml/xslt libs
                    165: #    smtp.connect                                not found/timeout
                    166: #    smtp.execute                                communication error
                    167: 
1.26      paf       168: @roll2[]
                    169: $d[^date::create(2002;4;2;2;2;3)] ^d.sql-string[]<br>
1.27      paf       170: ^d.roll[day](+365*3+1) ^d.sql-string[]<br>
1.26      paf       171: 
1.25      paf       172: 
                    173: @rolls[]
                    174: $d[^date::create(2002;4;4)]
                    175: ^d.sql-string[]<br>
                    176: ^for[i](1;7){
                    177: ^d.roll[day](-1)
                    178: ^d.sql-string[]<br>
                    179: }
                    180: <hr>
                    181: $d[^date::create(2002;3;28)]
                    182: ^d.sql-string[]<br>
                    183: ^for[i](1;7){
                    184: ^d.roll[day](+1)
                    185: ^d.sql-string[]<br>
                    186: }
                    187: <hr>
                    188: $d[^date::create(2002;12;3)]
                    189: ^d.sql-string[]<br>
                    190: ^for[i](1;14){
                    191: ^d.roll[day](-1)
                    192: ^d.sql-string[]<br>
                    193: }
                    194: <hr>
                    195: $d[^date::create(2002;10;19)]
                    196: ^d.sql-string[]<br>
                    197: ^for[i](1;14){
                    198: ^d.roll[day](+1)
                    199: ^d.sql-string[]<br>
                    200: }
                    201: 
                    202: 
                    203: 
                    204: 
                    205: 
1.22      paf       206: 
                    207: @exceptions1[]
                    208: ^try{
                    209:        aaa
1.24      paf       210:        ^throw[custom1;paf;is stupid]
1.22      paf       211: }{
1.24      paf       212:        ^if($exception.type eq custom1){
1.28      paf       213: #              $exception.handled(1)
                    214:        ^throw[$exception]
1.24      paf       215:                type=$exception.type<br>
                    216:            source=$exception.source<br>
                    217:            file=$exception.file<br>
                    218:            lineno=$exception.lineno<br>
                    219:        comment=$exception.comment<br>
                    220:        }
1.22      paf       221: }
1.21      paf       222: 
                    223: @locate_by_expr[]
                    224: $t[^table::create{a    b
                    225: 1      nok
                    226: 2      ok
                    227: 3      nok
                    228: }]
                    229: ^if(^t.locate($t.a==2)){$t.b}{n}
1.17      paf       230: 
                    231: @method_junction_params[param]
                    232: ^if($param is junction){junction}{ne junction}
                    233: 
                    234: @verifyCookie[value] 
                    235: ^if($cookie:dummyvote eq $value){ 
                    236:        $result(1) 
                    237: }{ 
                    238:        $cookie:dummyvote[$value] 
                    239:        $result(0) 
                    240: }
1.16      paf       241: 
                    242: @execlangs[]
1.20      paf       243: $f[^file::exec[test.pl]]
1.16      paf       244: ^process{$f.text}
                    245: #$c[^t.columns[]]
                    246: #^c.menu{
                    247: #* $c.column<br>
                    248: #}
                    249: =$t.c=
                    250: 
                    251: @tobjeresult[]
                    252: ^table::create{a
                    253: 12}
1.15      paf       254: 
                    255: @xmlprobs[]
                    256: $xmlDataType[^xdoc::load[program.xml]]
                    257: #<pre>^taint[^xmlDataType.string[]]
                    258: $xmlDataTypes[^xmlDataType.select[programs/program[@id=4]/data]]
                    259: #=^xmlDataTypes._count[]=
                    260: =^xmlDataTypes.0.getAttribute[type-id]=
                    261: 
                    262: @doubleprobs[]
                    263: $1(^math:radians(180))
                    264: $2($math:PI)
                    265: ^if(^1.format[%.10f]==^2.format[%.10f]){y;n}
                    266: ^if($1==$2){y;n}
                    267: ^if(^math:radians(180)==$math:PI){y;n}
                    268: 
                    269: 
                    270: @divnamestop[]
                    271: $a(10)
                    272: ^eval($a\3)
                    273: 
                    274: @arrayclone[]
                    275: $t[^table::create{a    b
                    276: 1      11
                    277: 2      22
                    278: }]
                    279: $c[^table::create[$t]]
                    280: ^c.append{2    33}
                    281: ^t.count[]
                    282: ^c.count[]
                    283: 
                    284: @operator_tricks[]
                    285: ^if(1){$a[^t[]]}
                    286: $a!
                    287: $a($b)
                    288: ^if(1){y}{n}
                    289: $MAIN:a(^t[] eq OK)
                    290: #$MAIN:a(1)
                    291: ^if($a){y}{n}
                    292: #^if(1){y}{n}
                    293: $form:if
                    294: $a[$.n[1]]
                    295: $a.if
                    296: 
                    297: @xoutputrusattr[]
                    298: $d[^xdoc::set{<?xml version="1.0" encoding="windows-1251"?><d attr="привет"/>}]
                    299: ^show_xdoc2[$d]
                    300: 
                    301: @xdocset1[]
                    302: $d[^xdoc::set{<?xml version="1.0"?><d>=^taint[&]=</d>}]
                    303: ^show_xdoc2[$d]
                    304: 
                    305: @regexp3[]
                    306: $s[abcАБВ]
                    307: ^if(^s.match[][i]){y}{n}
                    308: 
                    309: 
                    310: @exec2[]
                    311: $a[^file::exec[bin/t.cmd]]
                    312: <pre>^taint[$a.text]</pre>|$a.status|$a.stderr<hr>
                    313: 
                    314: 
                    315: @tlock[]
                    316: ^file:lock[lockfile]{
                    317:        code
                    318: }
                    319: 
                    320: @xmloutattrwithoutvalue[]
                    321: #$ORIGINS(1)
                    322: $doc[^xdoc::set{<?xml version="1.0"?><doc background="">zz</doc>}]
                    323: $doc[^doc.transform[global.xsl]]
                    324: =^taint[html][^doc.string[$.method[html]]]=
                    325: 
                    326: 
                    327: 
                    328: @precisionProblem[]
                    329: $a[123456789012345678901234567890]
                    330: $b(^a.double[])
                    331: ^b.format{%.20E}
                    332: <hr>
                    333: ^eval(2*2)
                    334: 
                    335: @xpath[]
                    336: $xdoc[^xdoc::set{<?xml version="1.0" encoding="windows-1251" ?>
                    337: <document><block><p>привет</p></block></document>
                    338: }]
                    339: #^show_xdoc2[$xdoc]
                    340: $node[^xdoc.selectSingle[/document/block/p]]
                    341: ^if(def $node){
                    342:        ^if($node is string){
                    343:                $node
                    344:        }{
                    345:        ^if($node is hash){
                    346:                ^node._count[]
                    347:        }{
                    348:                $node.nodeType
                    349:        }
                    350:        }
                    351: #$node.firstChild.nodeValue
                    352: }{
                    353:        node not found
                    354: }
                    355: 
                    356: 
                    357: @ttablesetlang[]
                    358: $a-tab-b[a     b
                    359: 1      2]
                    360: 
                    361: $t[^table::set{$a-tab-b}]
                    362: =$t.a=
                    363: <hr>
                    364: 
                    365: $t[^table::set[nameless]{^taint[$a-tab-b]}]
                    366: =$t.0=
                    367: <hr>
                    368: 
                    369: $t[^table::set{^untaint{^taint[$a-tab-b]}}]
                    370: =$t.a=
                    371: 
                    372: #^t.append{1   2}
                    373: 
                    374: @mail3[]
                    375: ^mail:send[
                    376:        $.from[Александр Петросян <paf@design.ru>]
                    377:        $.to[Александр Петросян <paf@design.ru>]
                    378:        $.subject[проверка4]
                    379:        $.body[
                    380:                $.text[
                    381:                        $.content-type[$.value[text/plain] $.charset[windows-1251]]
                    382:                        $.body[проверка]
                    383:                ]
                    384:                $.attachment[
                    385:                        $.value[^file::load[text;index.html]]
                    386:                        $.file-name[привет всем.html]                   
                    387:                ]
                    388:        ]
                    389: ]
                    390: 
                    391: 
                    392: @ttime[]
                    393: $now[^date::now[]]
                    394: $now.hour:$now.minute
                    395: 
                    396: @tupper[]
                    397: $t[abcABCабвАБВ]
                    398: $t<br>
                    399: ^t.upper[]
                    400: 
                    401: @treplace[]
                    402: $copy-paste-clean[^table::set{a b
                    403: .      _
                    404: ,      _
                    405: +      _
                    406: &      _
                    407: ?      _
                    408: =      _}]
                    409: 
                    410: $cache_key[^taint[в.а,с+я]&был?тут=недавно.cache]
                    411: # почему-то этот replace роняет апач в 500 ошибку :(
                    412: #^cache_key.replace[$copy-paste-clean]
                    413: $test[abc]
                    414: ^test.save[$cache_key]saved<br>
                    415: $cache[^file:list[.;\.cache^$]]
                    416: ^file:delete[$cache_key]deleted($cache.name)<br>
                    417: 
                    418: 
                    419: 
                    420: @xslt2[]
                    421: $xdoc[^xdoc::set{<?xml version="1.0" encoding="windows-1251" ?>
                    422: <document><block><p>привет</p></block></document>
                    423: }]
                    424: ^show_xdoc2[$xdoc]
                    425: ^show_xdoc2[^xdoc.transform[templates/_document.xslt]]
                    426: <hr>
                    427: 
                    428: 
                    429: @tcache2[]
                    430: ^cache[$DB_HOME/keyключ](2){
                    431:        ^math:random(100)
                    432: }
                    433: 
                    434: @ttaintuntaint[]
                    435: <!-- некий панковский заголовок с буковкой C в круглых скобках -->^taint[html][
                    436: 
                    437: ]zz
                    438: <hr>
                    439: ^untaint[html]{1^taint[  ]2  3}
                    440: 
                    441: 
                    442: @tappend2[]
                    443: $t[^table::set{a       b}]^t.append{1  2}$t.a
                    444: 
                    445: @badvsnprintf[]
                    446: ^connect[zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz]{
                    447: }
                    448: 
                    449: 
                    450: @badoracequoting[]
                    451: $SQL.connect-string[oracle://webspb:webpwd@mts?NLS_LANG=RUSSIAN_AMERICA.CL8MSWIN1251&NLS_DATE_FORMAT=YYYY-MM-DD HH24:MI:SS]
                    452: ^connect[$SQL.connect-string]{
                    453: ^void:sql{delete from paf}
                    454: ^void:sql{insert into paf values (1, '$form:text')}
                    455: $paf[^table::sql{select * from paf}]
                    456: ^paf.menu{
                    457:        $paf.id: ^untaint{$paf.block}<hr>
                    458: 
                    459: }
                    460: <hr>
                    461: 
                    462: 
                    463: ^rem{
                    464: $news[^table::sql{select description from news}[$.limit(3)]]
                    465: ^news.menu{
                    466:        ^untaint{$news.description}<hr>
                    467: 
                    468: }
                    469: <hr>
                    470: }
                    471: 
                    472: $tables[^table::sql{select table_name from user_tables}]
                    473: ^tables.menu{
                    474: $tables.table_name<br>
                    475: }
                    476: 
                    477: }
                    478: <hr>
                    479: $env:PATH
                    480: 
                    481: @badconstructors[]
                    482: $bred[^string::length[]]
                    483: $bred[^response::clear[]]
                    484: $bred[^int::int[]]
                    485: 
                    486: 
                    487: @xloadwrongtable[]
                    488: $constr[^xdoc::load[wrongtable.xml]]
                    489: ^show_xdoc2[$constr]
                    490: 
                    491: @xsetwrongtable[]
                    492: $constr[^xdoc::set{<?xml version="1.0" encoding="windows-1251z" ?>
                    493: <block-list>^untaint[as-is]{$constructor}</block-list>}]
                    494: 
                    495: 
                    496: @tablecolumnerror[]
                    497: $t[^table::set{a}]
                    498: $t.$a
                    499: 
                    500: @roll[]
                    501: #$date[^date::set(1970;1;2)]
                    502: #^date.roll[month](-1)
                    503: $date[^date::set(2038;1;1)]
                    504: ^date.roll[month](+1)
                    505: $date.year  $date.month  $date.day
                    506: 
                    507: @cookie2[]
                    508: #=$cookie:clientType[$.value[test]]=<br>
                    509: =$cookie:clientType=<br>
                    510: 
                    511: 
                    512: @tableset[]
                    513: $a[^table::set{a
                    514: 1
                    515: 2}]
                    516: ^eval(100\$a)
                    517: 
                    518: 
                    519: 
                    520: @zzz[]
                    521: 
                    522: 
                    523: $constructor[
                    524: <block1 name="main_srvr" type="0" label="Основное тело" />
                    525: <block2 name="main_srvr2" type="0" label="Основное тело" />
                    526: ]
                    527: 
                    528: $constr[^xdoc::set{<?xml version="1.0" encoding="windows-1251" ?>
                    529: <block-list>^untaint[as-is]{$constructor}</block-list>}]
                    530: 
                    531: $children[$constr.documentElement.childNodes]
                    532: ^if($children){
                    533: ^for[i](1;^children._count[]){
                    534:        $node[$children.$i]
                    535:        $node.nodeName<br>
                    536: }
                    537: }
                    538:    
                    539: 
                    540: @thashforeach3[]
                    541: $h[
                    542:        $.a[1] 
                    543:        $.b[2]
                    544: ]
                    545: $c[^table::set{a
                    546: ^h.foreach[key;value]{$value
                    547: }}]
                    548: $c.a
                    549: 
                    550: @thashforeach2[]
                    551: $h[
                    552:        $.a[1] 
                    553:        $.b[2]
                    554: ]
                    555: $c[
                    556: ^h.foreach[key;value]{
                    557:        $.$key[$value]
                    558: }
                    559: ]
                    560: $c.b
                    561: 
                    562: @thashforeach[]
                    563: $h[
                    564:        $.a[1] 
                    565:        $.b[2]
                    566: ]
                    567: ^h.foreach[key;value]{
                    568:        $key=$value<br>
                    569: }
                    570: 
                    571: @thashdelete[]
                    572: $h[$.a[1] $.b[2]]
                    573: was:<br>
                    574: count=^h._count[] <br>
                    575: b='$h.b' <br>
                    576: 
                    577: ^h.delete[b] 
                    578: 
                    579: now:<br>
                    580: count=^h._count[] <br>
                    581: b='$h.b' 
                    582: 
                    583: @sappend[]
                    584: $test[123]
                    585: ^test.save[test]
                    586: ^test.save[append;test]
                    587: 
                    588: @tappend[]
                    589: $test[^table::set{a    b
                    590: a1     b1}]
                    591: ^test.save[test]
                    592: $test[^table::set{a    b
                    593: a2     b2}]
                    594: ^test.save[append;test]
                    595: 
                    596: 
                    597: @tform[]
                    598: ^if(def $form:new_file){y}{n}
                    599: <form method="post" enctype="multipart/form-data">
                    600: <input type="file" name="new_file" />
                    601: <input type=submit>
                    602: </input>
                    603: 
                    604: @formattest[]
                    605: $size(15.124)
                    606: 
                    607: ^size.format{%.2f}
                    608: 
                    609: @filelist[]
                    610: $html[^file:list[.;\.html^$]]
                    611: ^html.menu{
                    612:        $html.name<br>
                    613: }
                    614: <hr>
                    615: 
                    616: @безнадёжна_попытка_поправить_непоправимое[]
                    617: $dom_from_disk[^xdoc::load[input.xml]]
                    618: $dom_created_in_air[^xdoc::create[doc]]
                    619: ^dom_created_in_air.documentElement.appendChild[^dom_from_disk.documentElement.cloneNode(1)]
                    620: ^show_xdoc2[$dom_created_in_air]
                    621: 
                    622: 
                    623: @tcache[]
                    624: #^hashfile:clear[cache]
                    625: $code[^hashfile::open[$DB_HOME;cache]]
                    626: ^code.cache[key](2){
                    627:        ^math:random(100)
                    628: #      ^code.delete[]
                    629: }
                    630: 
                    631: @thashfileexp[]
                    632: $hf[^hashfile::open[$DB_HOME;hashfile]]
                    633: $hf.paf[$.value[крут] $.expires(3)]
                    634: paf=$hf.paf
                    635: <hr>
                    636: ^hf.foreach[key;value]{
                    637:        $key=$value<br>
                    638: }
                    639: <hr>
                    640: $hash[^hf.hash[]]
                    641: =$hash.paf=
                    642: <hr>
                    643: 
                    644: @tcounter[]
                    645: ^tcounterone[$DB_HOME]
                    646: other root:
                    647: ^tcounterone[${DB_HOME}2]
                    648: again, first:
                    649: ^tcounterone[$DB_HOME]
                    650: 
                    651: @tcounterone[DB_HOME]
                    652: $counter[^hashfile::open[$DB_HOME;counter]]
                    653: #^counter.clear[]
                    654: ^counter.transaction{
                    655: #      $counter.value(10)
                    656:        $counter.value($counter.value+1)
                    657: #      ^counter.delete[value]
                    658:        $counter.value
                    659: }
                    660: <hr>
                    661: ^rem{
                    662: $hash[^counter.hash[]]
                    663: =$hash.value=
                    664: <hr>
                    665: }
                    666: 
                    667: @tablehash[]
                    668: $productList[^table::set{id    name
                    669: 1      носки
                    670: 2      валенки
                    671: 3      ушанка
                    672: }]
                    673: 
                    674: #скажем, у первого дилера
                    675: $firstPriceList[^table::set{id price
                    676: 1      0.3
                    677: 3      1000
                    678: }]
                    679: 
                    680: $firstPriceHash[^firstPriceList.hash[id]]
                    681: 
                    682: ^productList.menu{
                    683:     продукт "$productList.name" | цена у first: $firstPriceHash.[$productList.id].price<br>
                    684: }
                    685: 
                    686: 
                    687: @hashfile[]
                    688: $hf[^hashfile::assign[hashfile]]
                    689: #$hf.paf[крут5]
                    690: paf=$hf.paf
                    691: 
                    692: @formclass[]
                    693: ^$form:CLASS.a=$form:CLASS.a
                    694: 
                    695: @domdata[]
                    696: ^if(1){
                    697: #      $a{^hren[]}
                    698: }
                    699: $a
                    700: $xdoc[^xdoc::create[doc]]
                    701: $doc[$xdoc.documentElement]
                    702: $name[^doc.appendChild[^xdoc.createElement[name]]]
                    703: $text[^name.appendChild[^xdoc.createTextNode[петросян&coz]]]
                    704: ^untaint[as-is]{=$text.nodeValue=}
                    705: 
                    706: @domedit[]
                    707: ^domdata[]
                    708: #$paf.nodeName<br>
                    709: #$doc.documentElement.nodeName<br>
                    710: 
                    711: ^show_xnode1[$xdoc.documentElement;0;1]
                    712: <hr>
                    713: ^show_xdoc2[$xdoc]
                    714: <hr>
                    715: 
                    716: @domxslt[]
                    717: ^domdata[]
                    718: ^show_xdoc2[^xdoc.transform[global.xsl;$.param1[123/]]]
                    719: <hr>
                    720: 
                    721: @lsplit2[]
                    722: $path[/optics/]
                    723: $pathTable[^path.lsplit[/]]
                    724: ^pathTable.menu{
                    725:        ^if(def $pathTable.piece){
                    726:                =$pathTable.piece=
                    727:        }
                    728: }
                    729: 
                    730: 
                    731: @faceesize[]
                    732: $k(2)
                    733: $pict[^image::load[paf.gif]]
                    734: $small[^image::create($pict.width/$k;$pict.height/$k)]
                    735: ^small.copy[$pict](0;0;$pict.width;$pict.height;0;0;$small.width;$small.height;250)
                    736: $response:body[^small.gif[]]
                    737: 
                    738: @imageresize[]
                    739: $k(2)
                    740: $pict[^image::create(400*$k;200*$k)]
                    741: $pict.line-width(2)
                    742: ^pict.arc($pict.width/2;$pict.height/2;$pict.width-1;$pict.height-1;0;360;0x000000)
                    743: ^pict.arc($pict.width/2;$pict.height/2;$pict.width-20;$pict.height-20;0+20;360-20;0xff0000)
                    744: #^pict.arc($pict.width/2;$pict.height/2;$pict.width;$pict.height;0;360;0xff0000)
                    745: ^pict.circle($pict.width/2;$pict.height/2;$pict.height/2-20;0x0000ff)
                    746: ^pict.arc($pict.width/2;$pict.height/2;$pict.height-26;$pict.height-26;0+20;360-20;0xff0000)
                    747: $response:body[^pict.gif[]]
                    748: 
                    749: #$small[^image::create($pict.width/$k;$pict.height/$k)]
                    750: #^small.copy[$pict](0;0;$pict.width;$pict.height;0;0)
                    751: #^small.copy[$pict](0;0;$pict.width;$pict.height;0;0;$small.width;$small.height;0)
                    752: 
                    753: #$response:body[^small.gif[]]
                    754: 
                    755: 
                    756: @tintdefault[]
                    757: #$abc[abc]
                    758: $abc[33]
                    759: ^abc.int[z]
                    760: #^abc.int(123)
                    761: 
                    762: @ifassignhash[]
                    763: $h[^if(1){$.a(1);$.a(2)}]
                    764: $h.a
                    765: 
                    766: @ifpasshash[]
                    767: $a[$.e[a]]
                    768: $b[$.e[b]]
                    769: ^ifpasshashdest[^if(1){$a;$b}]
                    770: #$x[^if(1){$a}{$b}]
                    771: #^ifpasshashdest[$x]
                    772: 
                    773: @ifpasshashdest[p]
                    774: $p.e
                    775: 
                    776: @movedir[]
                    777: ^file:move[a;deeper/a]
                    778: 
                    779: @replace[]
                    780: $a[12^;3]
                    781: ^a.replace[^table::set{from    to
                    782: 2^;    !
                    783: }]
                    784: 
                    785: 
                    786: @set[]
                    787: ^setdata[]
                    788: ^a.add[$b]
                    789: add:$a.3<br>
                    790: 
                    791: ^setdata[]
                    792: ^a.sub[$b]
                    793: sub2:$a.2<br>
                    794: sub1:$a.1<br>
                    795: 
                    796: ^setdata[]
                    797: $c[^a.union[$b]]
                    798: union3:$c.3<br>
                    799: union2:$c.2<br>
                    800: 
                    801: ^setdata[]
                    802: $c[^a.intersection[$b]]
                    803: intersection3:$c.3<br>
                    804: intersection2:$c.2<br>
                    805: 
                    806: ^setdata[]
                    807: intersects:^if(^a.intersects[$b]){y;n}<br>
                    808: intersects2:^if(^a.intersects[ ]){y;n}<br>
                    809: 
                    810: 
                    811: <hr>
                    812: 
                    813: @setdata[]
                    814: $a[$.1[a1] $.2[a2]]
                    815: $b[        $.2[b2] $.3[b3]]
                    816: 
                    817: 
                    818: @hash[]
                    819: $h[^hash::create[$._default[123]]]
                    820: $h.paf[not kretin]
                    821: $h.paf<br>
                    822: =$h.that=<br>
                    823: 
                    824: @methresult[]
                    825: $result[^table::set{1}]
                    826: 
                    827: @terror[]
                    828: ^error[method z must be called with z]
                    829: 
                    830: @syntax1[]
                    831: #^a[^b]
                    832: 
                    833: @syntax2[]
                    834: #^a[
                    835: 
                    836: @ssave[]
                    837: $abc[abc]
                    838: ^abc.save[abc]
                    839: 
                    840: @calendar[]
                    841: 2001;11:<br>
                    842: $week_days[^date:calendar[rus](2001;11)]
                    843: <pre>
                    844: ^week_days.menu{^for[wday](0;7){^if($week_days.$wday){$week_days.$wday;&nbsp^;&nbsp^;} }<br>}
                    845: </pre>
                    846: 
                    847: @thash[]
                    848: $table[^table::set{id  name    age
                    849: 1      paf     278
                    850: 2      пиф     234
                    851: }]
                    852: $hash[^table.hash[id;^table::set[nameless]{id
                    853: name}]]
                    854: $hash.2.id $hash.2.name $hash.2.age
                    855: 
                    856: @tdef[]
                    857: $s[0]
                    858: if 0=^if($s){}{n}<br>
                    859: if def 0=^if(def $s){y}{}<br>
                    860: <hr>
                    861: 
                    862: @ford[]
                    863: ^for[i](0;5){$i}{($i)}
                    864: 
                    865: @tif[]
                    866: ^if[def]{y;n}
                    867: 
                    868: @image[]
                    869: $pict[^image::create(400;200)]
                    870: ^pict.arc($pict.width/2;$pict.height/2;$pict.width-1;$pict.height-1;0;360;0x000000)
                    871: ^pict.arc($pict.width/2;$pict.height/2;$pict.width-10;$pict.height-10;0+10;360-10;0xff0000)
                    872: #^pict.arc($pict.width/2;$pict.height/2;$pict.width;$pict.height;0;360;0xff0000)
                    873: ^pict.circle($pict.width/2;$pict.height/2;$pict.height/2-10;0x0000ff)
                    874: ^pict.arc($pict.width/2;$pict.height/2;$pict.height-26;$pict.height-26;0+10;360-10;0xff0000)
                    875: $response:body[^pict.gif[]]
                    876: 
                    877: 
                    878: 
                    879: @mail2[]
                    880: ^mail:send[
                    881:        $.content-type[$.value[text/plain] $.charset[windows-1251]]
                    882:        $.from[Александр Петросян <paf@design.ru>]
                    883:        $.to[Александр Петросян <paf@design.ru>]
                    884:        $.subject[проверка]
                    885:        $.body[проверка]
                    886: ]
                    887: 
                    888: @cookie[]
                    889: $env:HTTP_COOKIE<br>
                    890: 
                    891: #$cookie:переменная[test тест ТЕСТ2]
                    892: =$cookie:переменная=<br>
                    893: #$cookie:переменная2[test тест ТЕСТ3]
                    894: =$cookie:переменная2=<br>
                    895: =$cookie:CLASS.переменная2=<br>
                    896: 
                    897: @response[]
                    898: #^if($form:reload){
                    899:        $response:refresh[$.value[0] $.url[./t.html?uri=$env:SERVER_NAME]]
                    900: #}
                    901: 
                    902: @xslt[]
                    903: ^xdata[]
                    904: $transformed[^xdoc.transform[global.xsl;$.param1[123/]]]
                    905: ^show_xdoc2[$transformed]
                    906: 
                    907: @regexp2[]
                    908: $s[  select]
                    909: $s[^s.match[^^\s*][]{!}]
                    910: $s
                    911: 
                    912: @header[]
                    913: $response:refresh[
                    914:        $.value[0]
                    915:        $.url[http://design.ru?a=^taint[123]]
                    916: ]
                    917: 
                    918: @ttablerem[]
                    919: $table[^table::load[a.cfg]]
                    920: ^table.menu{$table.a}
                    921: 
                    922: @tconnect[]
                    923: ^connect[mysql://test:test@paf/test?charset=cp1251_koi8&compress=1&timeout=1&named_pipe=1]{
                    924: $tables[^table::sql{show tables}]
                    925: #$cols[^tables.columns[]]
                    926: #$cols.column
                    927: ^tables.menu{
                    928:        $tables.[Tables_in_test]<br>
                    929: }
                    930: }
                    931: 
                    932: @pcre[]
                    933: $s[1 2]
                    934: ^s.match[\s;ig]{!}
                    935: #^s.match[\d;ig]{!}
                    936: 
                    937: 
                    938: @regexp[]
                    939: $s[abcАБВ]
                    940: ^if(^s.match[б][i]){y}{n}
                    941: 
                    942: @mail[]
                    943: #$ORIGINS(1)
                    944: ^mail:send[
                    945:        $.from[paf@design.ru]
                    946:        $.to[paf@design.ru]
                    947:        $.body[1
                    948:        
                    949:        2
                    950:        
                    951:        
                    952:                3]
                    953: ]
                    954: 
                    955: @exec[]
                    956: $a[^file::exec[fc.exe;;a;b]]
                    957: $a.status|$a.stderr<hr>
                    958: 
                    959: @fori[][i]
                    960: ^for[i](1;3){... =$i= ...}
                    961: 
                    962: @xdata0[]
                    963: #$response:content-type[$.value[text/html] $.charset[windows-1251]]
                    964: $xdoc[^xdoc::set{<?xml version="1.0" encoding="windows-1251"?>
                    965: <!--DOCTYPE people SYSTEM "D:\Y\parser3project\parser3\src\www\htdocs\people.dtd"-->
                    966: <people>
                    967:        <man id="1" имя="word слово">
                    968:                <name>P&#171^;AF        B</name>
                    969:        </man>
                    970:                <man id="2">
                    971:                        <name>ПИФ^taint[&]</name>
                    972:                </man>
                    973: </people>
                    974: }]
                    975: 
                    976: @xdata[]
                    977: #$response:content-type[$.value[text/html] $.charset[windows-1251]]
                    978: $xdoc[^xdoc::set{^process{<?xml version="1.0" encoding="windows-1251"?>
                    979: <!--DOCTYPE people SYSTEM "D:\Y\parser3project\parser3\src\www\htdocs\people.dtd"-->
                    980: <people>
                    981:        <man id="1" имя="word слово">
                    982:                <name>P&#171^;AF        B</name>
                    983:        </man>
                    984:                <man id="2">
                    985:             <name>ПИФ^taint[&]</name>
                    986:                </man>
                    987: </people>
                    988: }}]
                    989: 
                    990: @xml[]
                    991: ^xdata[]
                    992: 
                    993: ^show_xdoc2[$xdoc]<hr>
                    994: #^show_xnode1[$xdoc]<hr>
                    995: $people[^xdoc.select[*/man]]
                    996: #^show1[]
                    997: ^show_xnodes1[$people]<hr>
                    998: #^people.0.owner.hren[]
                    999: 
                   1000: ^show_xnode1[^xdoc.selectSingle[*/man[2]/name];0;1]<hr>
                   1001: 
                   1002: by id:
                   1003: ^show_xnode1[^xdoc.getElementById[1];0;1]
                   1004: <hr>
                   1005: 
                   1006: @show1[array]
                   1007: ^for[i](0;^array._count[]-1){
                   1008:     $x[$array.$i]
                   1009:        $x.firstChild.nodeValue: 
                   1010:                $pattributes[$x.parentNode.attributes]
                   1011:                ^if(^pattributes._count[]){
                   1012:                        $pattributes.id.name=$pattributes.id.nodeValue
                   1013:                }
                   1014:        <br>
                   1015: }
                   1016:        
                   1017: @show_xnodes1[array][i]
                   1018: ^for[i](0;^array._count[]-1){
                   1019:        ^show_xnode1[$array.$i;0;1]
                   1020: }
                   1021: 
                   1022: @show_xnode1[x;level;single][l]
                   1023: ^if(def $x){
                   1024:     ^for[l](0;$level-1){&nbsp^;&nbsp^;&nbsp^;&nbsp^;}
                   1025:     ^if($x.nodeType == $xnode:ELEMENT_NODE){
                   1026:        &lt^;$x.nodeName
                   1027:            $pairs[$x.attributes]
                   1028:            ^if(def $pairs){
                   1029:                $names[^pairs._keys[]]
                   1030:                ^names.menu{ $names.key="$pairs.[$names.key].nodeValue"}
                   1031:            }
                   1032:            &gt^;
                   1033:     }{
                   1034:        [$x.nodeType]
                   1035:     }
                   1036:     
                   1037:     ^if(def $x.nodeValue){$x.nodeValue}<br>
                   1038:     ^show_xnode1[$x.firstChild]($level+1)
                   1039:     ^if(!$single){
                   1040:            ^show_xnode1[$x.nextSibling]($level)
                   1041:     }
                   1042: 
                   1043:     ^if($x.nodeType == $xnode:ELEMENT_NODE){
                   1044:     ^for[l](0;$level-1){&nbsp^;&nbsp^;&nbsp^;&nbsp^;}&lt^;/$x.nodeName&gt^;<br>
                   1045:     }
                   1046: }
                   1047: 
                   1048: @show_xdoc2[xdoc]
                   1049: ^xdoc.save[out/save.xml;
                   1050: #      $.encoding[utf-8]
                   1051:        $.method[xml]
                   1052: ]
                   1053: $file[^xdoc.file[
                   1054:        $.encoding[utf-8]
                   1055:        $.method[html]
                   1056: ]]
                   1057: ^file.save[text;out/save_file.html]
                   1058: #$response:body[^xdoc.file[    $.media-type[text/paf]  ]]
                   1059: <pre>^taint[html][^xdoc.string[
                   1060:        $.method[html]
                   1061: #      $.encoding[utF-8]
                   1062: #      $.omit-xml-declaration[yes]
                   1063: #      $.standalone[no]
                   1064: #      -$.doctype-public[-//W3C//DTD XHTML]
                   1065: #      -$.doctype-system[/a/b/c/]
                   1066: #      $.indent[yes]
                   1067: #      $.media-type[text/paf]
                   1068: ]]
                   1069: </pre>

E-mail: