Annotation of parser3/www/htdocs/index.html, revision 1.55
1.42 paf 1: @USE
2: t.p
1.15 paf 3:
4: @autoz[]
5: $request:charset[windows-1251]
6: $response:charset[windows-1251]
7: $response:content-type[$.value[text/html]$.charset[$response:charset]]
8:
1.51 paf 9: @postprocess[body]
1.55 ! paf 10: #=$env:HTTP_TEST=<br>
! 11: #=$env:REDIRECT_HTTP_TEST=<br>
! 12: #<hr>
1.51 paf 13: $body
14: <hr>
15: OK
1.37 paf 16:
1.15 paf 17: @main[]
1.51 paf 18: #^sqldefaults[]
1.49 paf 19: #^eval(2)
1.48 paf 20: #^tcrashlocaljunctionsv2[]
1.49 paf 21: #^tcrashlocaljunctions[]
1.50 paf 22: #^tjunctions[]
1.47 paf 23: #^replacetest[]
1.48 paf 24: #^matchoptionpp[]
1.46 paf 25: #^txdocxnodechild[]
1.44 paf 26: #^tclasses[]
1.43 paf 27: #$math:PI
28: #^b:method[]
1.42 paf 29: #^main[]
1.41 paf 30: #^errort[]
1.44 paf 31: #^tselectNumber[]
1.39 paf 32: #$result[hello]
1.36 paf 33: #^invaliddate2[]
34: #^process2[]
35: #^casehashtext[]
1.35 paf 36: #^subjvaltest[]
37: #^tableselect0[]
1.34 paf 38: #^memnotest1[]
1.33 paf 39: #^transparams[]
1.32 paf 40: #^voidparams[]
1.31 paf 41: #^rolls2[]
1.30 paf 42: #^cacheexpireschanging[]
1.29 paf 43: #^cacheexpiresfixed[]
44: #^dateoffsets[]
45: #^exceptionTypes[]
1.28 paf 46: #^roll2[]
1.27 paf 47: #^rolls[]
1.25 paf 48: #^exceptions1[]
1.22 paf 49: #^locate_by_expr[]
1.18 paf 50: #^method_junction_params{...}
1.17 paf 51: #^verifyCookie[paf]
1.37 paf 52: #^execlangs[]
1.16 paf 53: #$t[^tobjeresult[]]$t.a
54: #^xmlprobs[]
1.15 paf 55: #^doubleprobs[]
56: #^math:random(-10)
57: #^divnamestop[]
58: #^arrayclone[]
59: #^operator_tricks[]
60: #^xoutputrusattr[]
61: #^xdocset1[]
62: #^regexp3[]
63: #^exec2[]
64: #^tlock[]
65: #^xmloutattrwithoutvalue[]
66: #^precisionProblem[]
67: #^xpath[]
68: #^ttablesetlang[]
69: #^mail3[]
70: #^ttime[]
71: #^tupper[]
72: #^treplace[]
73: #^xslt2[]
74: #^tcache2[]
75: #$ORIGINS(1)
76: #$t[^table::set{a b} ^table::set{c d}]
77: #^ttaintuntaint[]
78: #^tappend2[]
79: #^badvsnprintf[]
80: #^badoracequoting[]
81: #^badconstructors[]
82: #^xloadwrongtable[]
83: #^xsetwrongtable[]
84: #^if($form:test){y}{n}
85: #^tablecolumnerror[]
86: #^roll[]
87: #^cookie2[]
88: #^tableset[]
89: #^math:PI.format{%.30f}
90: #^xchildren[]
91: #^thashforeach3[]
92: #^thashforeach2[]
93: #^thashforeach[]
94: #^thashdelete[]
95: #^connect[mysql://user:pass@cd.rinet.ru/db]{^void:sql{z} }
96: #^tappend[]
97: #^sappend[]
98: #^eval(10\3)<br>
99: #^tform[]
100: #^formattest[]
101: #^filelist[]
102: #^connect[mysql://user:pass@host]{ }
103: #^безнадёжна_попытка_поправить_непоправимое[]
104: #^tcache[]
105: #^thashfileexp[]
106: #^tcounter[]
107: #^tablehash[]
108: #j^hashfile[]
109: #^formclass[]
110: #^hren[]
111: #^domedit[]
112: #^domxslt[]
113: #^lsplit2[]
114: #^faceesize[]
115: #^imageresize[]
116: #^ifassignhash[]
117: #^tintdefault[]
118: #$response:status[404]
119: #^ifpasshash[]
120: #^movedir[]
121: #^replace[]
122: #^set[]
123: #^hash[]<hr>
124: #$t[^methresult[]] ->$t
125: #^terror[]
126: #^ssave[]
127: #^calendar[]
128: #^thash[]
129: #^tdef[]
130: #^ford[]
131: #^tif[]
132: #^image[]
133: #^mail2[]
134: #^cookie[]
135: #^response[]
136: #^regexp2[]
137: #^ttablerem[]
138: #^pcre[]
139: #^regexp[]<hr>
140: #^mail[]
141: #^exec[]
142: #^fori[]
143: #^tconnect[]
144: #^xslt[]
145: #^xml[]
146: #^header[]
1.53 paf 147: #^tablehasht[]
1.54 paf 148: #^datecreatestring[]
1.55 ! paf 149: ^mssqltypes1[]
1.54 paf 150:
151: @mssqltypes1[]
152: ^connect[odbc://DSN=nestle^;UID=nestle^;PWD=mbm32]{
1.55 ! paf 153: # ^string:sql{select { ts '1998-05-02 01:23:56.123' }}
! 154: # ^string:sql{select CAST({ ts '1998-05-02 01:23:56.123' }AS smalldatetime)}
! 155: # ^string:sql{select CAST({ts '2002-04-28 00:00:00.000'} AS smalldatetime)}
! 156: $t[^table::sql{select a from paf}]
! 157: ^t.count[]
1.54 paf 158: }
1.51 paf 159:
1.53 paf 160: @datecreatestring[]
1.54 paf 161: $d[^date::create[2002-04-33 01:03:04]]
1.53 paf 162: ^d.sql-string[]
1.52 paf 163:
164: @method[hash]
165: $hash.key
166: @mainZ[]
167: ^method[
168: $.key{code}
169: ]
170:
1.51 paf 171: @tablehasht[]
172: $t[^table::create{p
173: 1
174: 3
175: 2
176: 4}]
177:
178: $h[^t.hash[p]]
179:
180: =^h._count[]=
181:
182:
183: @sqldefaults[]
184: ^connect[mysql://mdm:4b833ljq@db-mysql/mdm]{
185: ^int:sql{select news_id from news where news_id=-1}[$.default{2}]<br>
186: ^string:sql{select news_id from news where news_id=-1}[$.default{2}]
187: }
1.48 paf 188:
189: @tcrashlocaljunctionsv2[]
190: $a[
191: $b{ $c[1] }
192: ]
193: $b
194: $c
195:
196: @tcrashlocaljunctions[]
197: $var[aaa]
198: ^if(1){
199: ^tcrashlocaljunctions1[]
200: }
201:
202: $j
203:
1.49 paf 204: @tcrashlocaljunctions1[][var]
205: $var[varvalue]
1.48 paf 206: $j{
207: $var
208: }
1.49 paf 209: $j
1.48 paf 210:
211: @tjunctions[][tl]
212: $t[^t::create[]]
213: ^tjunctionsi[]
214:
215: @tjunctionsi[][tl]
216: $tl[12345]
217: ^t.tjunctionsm[
218: $.key{
219: $tl
220: }
221: ]
1.46 paf 222:
1.47 paf 223: @replacetest[]
224: $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aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
244: aaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
245: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
1.46 paf 246: ]
247: ^s.match[b;g']{($match.prematch|$match.match|$match.postmatch)}
248:
1.44 paf 249:
250: @txdocxnodechild[]
251: $xdoc[^xdoc::set{<?xml version="1.0" encoding="windows-1251" ?><d/>}]
252: $xdoc.nodeName
253: ^xdoc.selectNumber[2*2]
1.45 paf 254: $xdoc:ELEMENT_NODE
1.44 paf 255:
256:
257: @tclasses[]
258: $t[^t::create[]]
259: ^t.method[]
260: <hr>
261: ^t.base_method[]
262:
1.40 paf 263:
264: @errort[]
1.42 paf 265: ^xdoc::create[a]
1.40 paf 266: #^throw[user;here;this]
267:
268: @tselectNumber[]
269: $d[^xdoc::set{<?xml version="1.0" encoding="windows-1251"?><d attr="привет" n="123"/>}]
270: ^d.selectString[string(d/@attr)]<br>
271: ^d.selectNumber[2*2]<br>
272: ^d.selectNumber[number(/d/@n)+1]<br>
273:
1.34 paf 274:
1.36 paf 275: @invaliddate2[]
276: $d[^date::create(1018946575/60/60)] ^d.sql-string[]
277:
278: @process2[]
279: ^^process{
280: ^process{
281: ^$a[^^if(0){^$.k[y]}{^$.k[^^hren[]n]}] ^$a.k
282: }
283: }
284:
1.35 paf 285: @casehashtext[]
286: $tt[1]
287: $tmp[
288: ^switch[$tt]{
289: ^case[1]{
290: $.aaa[123]
291: }
292: ^case[DEFAULT]{
293: $.bbb[456]
294: }
295: }
1.36 paf 296: shit!
1.35 paf 297: ]
1.36 paf 298: #$tmp
1.35 paf 299: $tmp.aaa
300:
301: @subjvaltest[]
302: $a12[val]
303: $b[12]
304: $a$b
305:
1.34 paf 306: @tableselect0[]
307: $person[^table::create{name height
308: paf 1.77
309: шохин 2.07
310: moko 1.77
311: }]
312: $nottoohigh[^person.select($person.height<2)]
313: ^nottoohigh.menu{$nottoohigh.name<br>}
1.32 paf 314:
315: @transparams[]
316: $idoc[^xdoc::create{<?xml version="1.0" ?><doc/>}]
317: $odoc[^idoc.transform[global.xsl;
318: $.param1['1']
319: $.param2['2']
320: ]]
321: <pre>^taint[^odoc.string[$.method[html]]]
322:
323: @memnotest1[]
324: ^for[i](0;4000){
325:
326: $xxxx[$i]
327: $xxxx
328:
329: }
330:
331: @memnotest1notes[]
332: одна итерация цикла:
333: [Mon Apr 8 20:12:02 2002] execution-------------------------|
1.35 paf 334: '469641+=28 wcodeframe -> 0 !optimize[3]''469669+=49 string от {} -> 0 optimize[3]'
1.32 paf 335: [Mon Apr 8 20:12:02 2002] 12:STRING__WRITE
336: [Mon Apr 8 20:12:02 2002] "|| "
337: [Mon Apr 8 20:12:02 2002] 12:WITH_ROOT
338: [Mon Apr 8 20:12:02 2002] 13:VALUE
339: [Mon Apr 8 20:12:02 2002] "xxxx" string
1.35 paf 340: [Mon Apr 8 20:12:02 2002] 14:CREATE_EWPOOL'469377+=24 wcodeframe -> 0 !optimize[1]''469401+=49 string -> 41 !optimize[7]'
1.32 paf 341: [Mon Apr 8 20:12:02 2002] 16:WITH_READ
342: [Mon Apr 8 20:12:02 2002] 17:VALUE
343: [Mon Apr 8 20:12:02 2002] "i" string
344: [Mon Apr 8 20:12:02 2002] 18:GET_ELEMENT
1.35 paf 345: [Mon Apr 8 20:12:02 2002] 17:WRITE_VALUE'469452+=40 MAX_NUMBER -> !~2 actual digits''469492+=49 -> 41 !'
346: [Mon Apr 8 20:12:02 2002] 16:REDUCE_EWPOOL'469541+=24 VString -> 0 optimize[5]'
1.32 paf 347: [Mon Apr 8 20:12:02 2002] 15:CONSTRUCT_VALUE
348: [Mon Apr 8 20:12:02 2002] 12:STRING__WRITE
349: [Mon Apr 8 20:12:02 2002] "| "
350: [Mon Apr 8 20:12:02 2002] 12:WITH_READ
351: [Mon Apr 8 20:12:02 2002] 13:VALUE
352: [Mon Apr 8 20:12:02 2002] "xxxx" string
353: [Mon Apr 8 20:12:02 2002] 14:GET_ELEMENT
354: [Mon Apr 8 20:12:02 2002] 13:WRITE_VALUE'469573+=41 string expand nothing for now'
355: [Mon Apr 8 20:12:02 2002] 12:STRING__WRITE
1.35 paf 356: [Mon Apr 8 20:12:02 2002] "||"'469617+=24 VString -> 0 !optimize[6]'
1.32 paf 357: [Mon Apr 8 20:12:02 2002] <-ja returned
358: [Mon Apr 8 20:12:02 2002] ja->
359:
360: 201/328=0.612804878049 %%optimized
361:
362: 1.
363: CREATE_*POOL
364: сделать
365: *POOL_POOLED+CODE
366: где
367: wwrapper
368: и(возможно) wcodeframe
369: +string
370: стековая переменная
371:
372: 2.
373: избавиться от обёртки при возврате результата process [см. тело _for]
374:
375: 3.
376: сделать callback для process, чтобы вынести invariants из _for & co.
377:
378: 4.
379: @todo склеить get_element и write_value (при вставлении? write_value)
380:
381: 5.
382: reduce_*pool -> вариант получить именно string, без VString обёртки [часто
383: обёртка сразу выбрасывается = не нужна]
384:
385: 6.
386: process вариант получить именно string, без VString обёртки [часто обёртка
387: сразу выбрасывается = не нужна]
388:
389: 7.
390: string head, убить 8 байт неправильной link
1.31 paf 391:
392: @voidparams[]
393: ^voidparamsm[$form:field]
394:
395: @voidparamsm[p]
396: ^p.int(123)
1.29 paf 397:
1.30 paf 398: @rolls2[]
399: $now[^date::now[]]
400: $d[^date::create($now.year;$now.month)] ^d.sql-string[]<br>
401: ^for[i](1;12){
402: ^d.roll[month](-1) ^d.sql-string[]<br>
403: }
404:
1.29 paf 405: @cacheexpireschanging[]
406: ^cache[$DB_HOME/keyключ][^date::now(+1)]{ ^rem{1 day}
407: ^cache[^date::now(+4/24/60/60)]
408: # ^cache(2)
1.30 paf 409: # ^cache(0)
1.29 paf 410: ^math:random(100)
411: }
412:
413:
414:
415: @cacheexpiresfixed[]
416: ^cache[$DB_HOME/keyключ][^date::now(+2/24/60/60)]{
417: ^math:random(100)
418: }
419:
420: @dateoffsets[]
421: $d[^date::create(^date::now[]+1/24/60)]
422: #$d[^date::now(+1/24/60)]
423: ^d.sql-string[]
424: #$d
1.26 paf 425:
1.28 paf 426: @exceptionTypes[]
427: # parser.compile ^test[} компиляция (непарная скобка, ...)
428: # parser.runtime ^if(0). параметры (больше/меньше, чем нужно, не тех типов, ...)
429: # number.zerodivision ^eval(1/0) ^eval(1%0)
430: # number.format ^eval(abc*5)
431: # file.missing ^file:delete[delme] not found
432: # file.access ^table::load[.] no rights
433: # image.format ^image::measure[index.html] not gif/jpg
434: # sql.connect ^connect[mysql://baduser:pass@host/db]{} not found/timeout
435: # sql.execute ^connect[mysql://okuser:pass@host/db]{^void:sql{select bad}} syntax error
436: # xml ^xdoc::create{<forgot?>} any error in xml/xslt libs
437: # smtp.connect not found/timeout
438: # smtp.execute communication error
439:
1.26 paf 440: @roll2[]
441: $d[^date::create(2002;4;2;2;2;3)] ^d.sql-string[]<br>
1.27 paf 442: ^d.roll[day](+365*3+1) ^d.sql-string[]<br>
1.26 paf 443:
1.25 paf 444:
445: @rolls[]
446: $d[^date::create(2002;4;4)]
447: ^d.sql-string[]<br>
448: ^for[i](1;7){
449: ^d.roll[day](-1)
450: ^d.sql-string[]<br>
451: }
452: <hr>
453: $d[^date::create(2002;3;28)]
454: ^d.sql-string[]<br>
455: ^for[i](1;7){
456: ^d.roll[day](+1)
457: ^d.sql-string[]<br>
458: }
459: <hr>
460: $d[^date::create(2002;12;3)]
461: ^d.sql-string[]<br>
462: ^for[i](1;14){
463: ^d.roll[day](-1)
464: ^d.sql-string[]<br>
465: }
466: <hr>
467: $d[^date::create(2002;10;19)]
468: ^d.sql-string[]<br>
469: ^for[i](1;14){
470: ^d.roll[day](+1)
471: ^d.sql-string[]<br>
472: }
473:
474:
475:
476:
477:
1.22 paf 478:
479: @exceptions1[]
480: ^try{
481: aaa
1.24 paf 482: ^throw[custom1;paf;is stupid]
1.22 paf 483: }{
1.24 paf 484: ^if($exception.type eq custom1){
1.28 paf 485: # $exception.handled(1)
486: ^throw[$exception]
1.24 paf 487: type=$exception.type<br>
488: source=$exception.source<br>
489: file=$exception.file<br>
490: lineno=$exception.lineno<br>
491: comment=$exception.comment<br>
492: }
1.22 paf 493: }
1.21 paf 494:
495: @locate_by_expr[]
496: $t[^table::create{a b
497: 1 nok
498: 2 ok
499: 3 nok
500: }]
501: ^if(^t.locate($t.a==2)){$t.b}{n}
1.17 paf 502:
503: @method_junction_params[param]
504: ^if($param is junction){junction}{ne junction}
505:
506: @verifyCookie[value]
507: ^if($cookie:dummyvote eq $value){
508: $result(1)
509: }{
510: $cookie:dummyvote[$value]
511: $result(0)
512: }
1.16 paf 513:
514: @execlangs[]
1.20 paf 515: $f[^file::exec[test.pl]]
1.36 paf 516: err:$f.stderr<br>
1.16 paf 517: ^process{$f.text}
518: #$c[^t.columns[]]
519: #^c.menu{
520: #* $c.column<br>
521: #}
1.36 paf 522: c:$t.c<br>
1.16 paf 523:
524: @tobjeresult[]
525: ^table::create{a
526: 12}
1.15 paf 527:
528: @xmlprobs[]
529: $xmlDataType[^xdoc::load[program.xml]]
530: #<pre>^taint[^xmlDataType.string[]]
531: $xmlDataTypes[^xmlDataType.select[programs/program[@id=4]/data]]
532: #=^xmlDataTypes._count[]=
533: =^xmlDataTypes.0.getAttribute[type-id]=
534:
535: @doubleprobs[]
536: $1(^math:radians(180))
537: $2($math:PI)
538: ^if(^1.format[%.10f]==^2.format[%.10f]){y;n}
539: ^if($1==$2){y;n}
540: ^if(^math:radians(180)==$math:PI){y;n}
541:
542:
543: @divnamestop[]
544: $a(10)
545: ^eval($a\3)
546:
547: @arrayclone[]
548: $t[^table::create{a b
549: 1 11
550: 2 22
551: }]
552: $c[^table::create[$t]]
553: ^c.append{2 33}
554: ^t.count[]
555: ^c.count[]
556:
557: @operator_tricks[]
558: ^if(1){$a[^t[]]}
559: $a!
560: $a($b)
561: ^if(1){y}{n}
562: $MAIN:a(^t[] eq OK)
563: #$MAIN:a(1)
564: ^if($a){y}{n}
565: #^if(1){y}{n}
566: $form:if
567: $a[$.n[1]]
568: $a.if
569:
570: @xoutputrusattr[]
571: $d[^xdoc::set{<?xml version="1.0" encoding="windows-1251"?><d attr="привет"/>}]
572: ^show_xdoc2[$d]
573:
574: @xdocset1[]
575: $d[^xdoc::set{<?xml version="1.0"?><d>=^taint[&]=</d>}]
576: ^show_xdoc2[$d]
577:
578: @regexp3[]
579: $s[abcАБВ]
580: ^if(^s.match[][i]){y}{n}
581:
582:
583: @exec2[]
584: $a[^file::exec[bin/t.cmd]]
585: <pre>^taint[$a.text]</pre>|$a.status|$a.stderr<hr>
586:
587:
588: @tlock[]
589: ^file:lock[lockfile]{
590: code
591: }
592:
593: @xmloutattrwithoutvalue[]
594: #$ORIGINS(1)
595: $doc[^xdoc::set{<?xml version="1.0"?><doc background="">zz</doc>}]
596: $doc[^doc.transform[global.xsl]]
597: =^taint[html][^doc.string[$.method[html]]]=
598:
599:
600:
601: @precisionProblem[]
602: $a[123456789012345678901234567890]
603: $b(^a.double[])
604: ^b.format{%.20E}
605: <hr>
606: ^eval(2*2)
607:
608: @xpath[]
609: $xdoc[^xdoc::set{<?xml version="1.0" encoding="windows-1251" ?>
610: <document><block><p>привет</p></block></document>
611: }]
612: #^show_xdoc2[$xdoc]
613: $node[^xdoc.selectSingle[/document/block/p]]
614: ^if(def $node){
615: ^if($node is string){
616: $node
617: }{
618: ^if($node is hash){
619: ^node._count[]
620: }{
621: $node.nodeType
622: }
623: }
624: #$node.firstChild.nodeValue
625: }{
626: node not found
627: }
628:
629:
630: @ttablesetlang[]
631: $a-tab-b[a b
632: 1 2]
633:
634: $t[^table::set{$a-tab-b}]
635: =$t.a=
636: <hr>
637:
638: $t[^table::set[nameless]{^taint[$a-tab-b]}]
639: =$t.0=
640: <hr>
641:
642: $t[^table::set{^untaint{^taint[$a-tab-b]}}]
643: =$t.a=
644:
645: #^t.append{1 2}
646:
647: @mail3[]
648: ^mail:send[
649: $.from[Александр Петросян <paf@design.ru>]
650: $.to[Александр Петросян <paf@design.ru>]
651: $.subject[проверка4]
652: $.body[
653: $.text[
654: $.content-type[$.value[text/plain] $.charset[windows-1251]]
655: $.body[проверка]
656: ]
657: $.attachment[
658: $.value[^file::load[text;index.html]]
659: $.file-name[привет всем.html]
660: ]
661: ]
662: ]
663:
664:
665: @ttime[]
666: $now[^date::now[]]
667: $now.hour:$now.minute
668:
669: @tupper[]
670: $t[abcABCабвАБВ]
671: $t<br>
672: ^t.upper[]
673:
674: @treplace[]
675: $copy-paste-clean[^table::set{a b
676: . _
677: , _
678: + _
679: & _
680: ? _
681: = _}]
682:
683: $cache_key[^taint[в.а,с+я]&был?тут=недавно.cache]
684: # почему-то этот replace роняет апач в 500 ошибку :(
685: #^cache_key.replace[$copy-paste-clean]
686: $test[abc]
687: ^test.save[$cache_key]saved<br>
688: $cache[^file:list[.;\.cache^$]]
689: ^file:delete[$cache_key]deleted($cache.name)<br>
690:
691:
692:
693: @xslt2[]
694: $xdoc[^xdoc::set{<?xml version="1.0" encoding="windows-1251" ?>
695: <document><block><p>привет</p></block></document>
696: }]
697: ^show_xdoc2[$xdoc]
698: ^show_xdoc2[^xdoc.transform[templates/_document.xslt]]
699: <hr>
700:
701:
702: @tcache2[]
703: ^cache[$DB_HOME/keyключ](2){
704: ^math:random(100)
705: }
706:
707: @ttaintuntaint[]
708: <!-- некий панковский заголовок с буковкой C в круглых скобках -->^taint[html][
709:
710: ]zz
711: <hr>
712: ^untaint[html]{1^taint[ ]2 3}
713:
714:
715: @tappend2[]
716: $t[^table::set{a b}]^t.append{1 2}$t.a
717:
718: @badvsnprintf[]
719: ^connect[zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz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G=RUSSIAN_AMERICA.CL8MSWIN1251&NLS_DATE_FORMAT=YYYY-MM-DD HH24:MI:SS]
725: ^connect[$SQL.connect-string]{
726: ^void:sql{delete from paf}
727: ^void:sql{insert into paf values (1, '$form:text')}
728: $paf[^table::sql{select * from paf}]
729: ^paf.menu{
730: $paf.id: ^untaint{$paf.block}<hr>
731:
732: }
733: <hr>
734:
735:
736: ^rem{
737: $news[^table::sql{select description from news}[$.limit(3)]]
738: ^news.menu{
739: ^untaint{$news.description}<hr>
740:
741: }
742: <hr>
743: }
744:
745: $tables[^table::sql{select table_name from user_tables}]
746: ^tables.menu{
747: $tables.table_name<br>
748: }
749:
750: }
751: <hr>
752: $env:PATH
753:
754: @badconstructors[]
755: $bred[^string::length[]]
756: $bred[^response::clear[]]
757: $bred[^int::int[]]
758:
759:
760: @xloadwrongtable[]
761: $constr[^xdoc::load[wrongtable.xml]]
762: ^show_xdoc2[$constr]
763:
764: @xsetwrongtable[]
765: $constr[^xdoc::set{<?xml version="1.0" encoding="windows-1251z" ?>
766: <block-list>^untaint[as-is]{$constructor}</block-list>}]
767:
768:
769: @tablecolumnerror[]
770: $t[^table::set{a}]
771: $t.$a
772:
773: @roll[]
774: #$date[^date::set(1970;1;2)]
775: #^date.roll[month](-1)
776: $date[^date::set(2038;1;1)]
777: ^date.roll[month](+1)
778: $date.year $date.month $date.day
779:
780: @cookie2[]
781: #=$cookie:clientType[$.value[test]]=<br>
782: =$cookie:clientType=<br>
783:
784:
785: @tableset[]
786: $a[^table::set{a
787: 1
788: 2}]
789: ^eval(100\$a)
790:
791:
792:
793: @zzz[]
794:
795:
796: $constructor[
797: <block1 name="main_srvr" type="0" label="Основное тело" />
798: <block2 name="main_srvr2" type="0" label="Основное тело" />
799: ]
800:
801: $constr[^xdoc::set{<?xml version="1.0" encoding="windows-1251" ?>
802: <block-list>^untaint[as-is]{$constructor}</block-list>}]
803:
804: $children[$constr.documentElement.childNodes]
805: ^if($children){
806: ^for[i](1;^children._count[]){
807: $node[$children.$i]
808: $node.nodeName<br>
809: }
810: }
811:
812:
813: @thashforeach3[]
814: $h[
815: $.a[1]
816: $.b[2]
817: ]
818: $c[^table::set{a
819: ^h.foreach[key;value]{$value
820: }}]
821: $c.a
822:
823: @thashforeach2[]
824: $h[
825: $.a[1]
826: $.b[2]
827: ]
828: $c[
829: ^h.foreach[key;value]{
830: $.$key[$value]
831: }
832: ]
833: $c.b
834:
835: @thashforeach[]
836: $h[
837: $.a[1]
838: $.b[2]
839: ]
840: ^h.foreach[key;value]{
841: $key=$value<br>
842: }
843:
844: @thashdelete[]
845: $h[$.a[1] $.b[2]]
846: was:<br>
847: count=^h._count[] <br>
848: b='$h.b' <br>
849:
850: ^h.delete[b]
851:
852: now:<br>
853: count=^h._count[] <br>
854: b='$h.b'
855:
856: @sappend[]
857: $test[123]
858: ^test.save[test]
859: ^test.save[append;test]
860:
861: @tappend[]
862: $test[^table::set{a b
863: a1 b1}]
864: ^test.save[test]
865: $test[^table::set{a b
866: a2 b2}]
867: ^test.save[append;test]
868:
869:
870: @tform[]
871: ^if(def $form:new_file){y}{n}
872: <form method="post" enctype="multipart/form-data">
873: <input type="file" name="new_file" />
874: <input type=submit>
875: </input>
876:
877: @formattest[]
878: $size(15.124)
879:
880: ^size.format{%.2f}
881:
882: @filelist[]
883: $html[^file:list[.;\.html^$]]
884: ^html.menu{
885: $html.name<br>
886: }
887: <hr>
888:
889: @безнадёжна_попытка_поправить_непоправимое[]
890: $dom_from_disk[^xdoc::load[input.xml]]
891: $dom_created_in_air[^xdoc::create[doc]]
892: ^dom_created_in_air.documentElement.appendChild[^dom_from_disk.documentElement.cloneNode(1)]
893: ^show_xdoc2[$dom_created_in_air]
894:
895:
896: @tcache[]
897: #^hashfile:clear[cache]
898: $code[^hashfile::open[$DB_HOME;cache]]
899: ^code.cache[key](2){
900: ^math:random(100)
901: # ^code.delete[]
902: }
903:
904: @thashfileexp[]
905: $hf[^hashfile::open[$DB_HOME;hashfile]]
906: $hf.paf[$.value[крут] $.expires(3)]
907: paf=$hf.paf
908: <hr>
909: ^hf.foreach[key;value]{
910: $key=$value<br>
911: }
912: <hr>
913: $hash[^hf.hash[]]
914: =$hash.paf=
915: <hr>
916:
917: @tcounter[]
918: ^tcounterone[$DB_HOME]
919: other root:
920: ^tcounterone[${DB_HOME}2]
921: again, first:
922: ^tcounterone[$DB_HOME]
923:
924: @tcounterone[DB_HOME]
925: $counter[^hashfile::open[$DB_HOME;counter]]
926: #^counter.clear[]
927: ^counter.transaction{
928: # $counter.value(10)
929: $counter.value($counter.value+1)
930: # ^counter.delete[value]
931: $counter.value
932: }
933: <hr>
934: ^rem{
935: $hash[^counter.hash[]]
936: =$hash.value=
937: <hr>
938: }
939:
940: @tablehash[]
941: $productList[^table::set{id name
942: 1 носки
943: 2 валенки
944: 3 ушанка
945: }]
946:
947: #скажем, у первого дилера
948: $firstPriceList[^table::set{id price
949: 1 0.3
950: 3 1000
951: }]
952:
953: $firstPriceHash[^firstPriceList.hash[id]]
954:
955: ^productList.menu{
956: продукт "$productList.name" | цена у first: $firstPriceHash.[$productList.id].price<br>
957: }
958:
959:
960: @hashfile[]
961: $hf[^hashfile::assign[hashfile]]
962: #$hf.paf[крут5]
963: paf=$hf.paf
964:
965: @formclass[]
966: ^$form:CLASS.a=$form:CLASS.a
967:
968: @domdata[]
969: ^if(1){
970: # $a{^hren[]}
971: }
972: $a
973: $xdoc[^xdoc::create[doc]]
974: $doc[$xdoc.documentElement]
975: $name[^doc.appendChild[^xdoc.createElement[name]]]
976: $text[^name.appendChild[^xdoc.createTextNode[петросян&coz]]]
977: ^untaint[as-is]{=$text.nodeValue=}
978:
979: @domedit[]
980: ^domdata[]
981: #$paf.nodeName<br>
982: #$doc.documentElement.nodeName<br>
983:
984: ^show_xnode1[$xdoc.documentElement;0;1]
985: <hr>
986: ^show_xdoc2[$xdoc]
987: <hr>
988:
989: @domxslt[]
990: ^domdata[]
991: ^show_xdoc2[^xdoc.transform[global.xsl;$.param1[123/]]]
992: <hr>
993:
994: @lsplit2[]
995: $path[/optics/]
996: $pathTable[^path.lsplit[/]]
997: ^pathTable.menu{
998: ^if(def $pathTable.piece){
999: =$pathTable.piece=
1000: }
1001: }
1002:
1003:
1004: @faceesize[]
1005: $k(2)
1006: $pict[^image::load[paf.gif]]
1007: $small[^image::create($pict.width/$k;$pict.height/$k)]
1008: ^small.copy[$pict](0;0;$pict.width;$pict.height;0;0;$small.width;$small.height;250)
1009: $response:body[^small.gif[]]
1010:
1011: @imageresize[]
1012: $k(2)
1013: $pict[^image::create(400*$k;200*$k)]
1014: $pict.line-width(2)
1015: ^pict.arc($pict.width/2;$pict.height/2;$pict.width-1;$pict.height-1;0;360;0x000000)
1016: ^pict.arc($pict.width/2;$pict.height/2;$pict.width-20;$pict.height-20;0+20;360-20;0xff0000)
1017: #^pict.arc($pict.width/2;$pict.height/2;$pict.width;$pict.height;0;360;0xff0000)
1018: ^pict.circle($pict.width/2;$pict.height/2;$pict.height/2-20;0x0000ff)
1019: ^pict.arc($pict.width/2;$pict.height/2;$pict.height-26;$pict.height-26;0+20;360-20;0xff0000)
1020: $response:body[^pict.gif[]]
1021:
1022: #$small[^image::create($pict.width/$k;$pict.height/$k)]
1023: #^small.copy[$pict](0;0;$pict.width;$pict.height;0;0)
1024: #^small.copy[$pict](0;0;$pict.width;$pict.height;0;0;$small.width;$small.height;0)
1025:
1026: #$response:body[^small.gif[]]
1027:
1028:
1029: @tintdefault[]
1030: #$abc[abc]
1031: $abc[33]
1032: ^abc.int[z]
1033: #^abc.int(123)
1034:
1035: @ifassignhash[]
1036: $h[^if(1){$.a(1);$.a(2)}]
1037: $h.a
1038:
1039: @ifpasshash[]
1040: $a[$.e[a]]
1041: $b[$.e[b]]
1042: ^ifpasshashdest[^if(1){$a;$b}]
1043: #$x[^if(1){$a}{$b}]
1044: #^ifpasshashdest[$x]
1045:
1046: @ifpasshashdest[p]
1047: $p.e
1048:
1049: @movedir[]
1050: ^file:move[a;deeper/a]
1051:
1052: @replace[]
1053: $a[12^;3]
1054: ^a.replace[^table::set{from to
1055: 2^; !
1056: }]
1057:
1058:
1059: @set[]
1060: ^setdata[]
1061: ^a.add[$b]
1062: add:$a.3<br>
1063:
1064: ^setdata[]
1065: ^a.sub[$b]
1066: sub2:$a.2<br>
1067: sub1:$a.1<br>
1068:
1069: ^setdata[]
1070: $c[^a.union[$b]]
1071: union3:$c.3<br>
1072: union2:$c.2<br>
1073:
1074: ^setdata[]
1075: $c[^a.intersection[$b]]
1076: intersection3:$c.3<br>
1077: intersection2:$c.2<br>
1078:
1079: ^setdata[]
1080: intersects:^if(^a.intersects[$b]){y;n}<br>
1081: intersects2:^if(^a.intersects[ ]){y;n}<br>
1082:
1083:
1084: <hr>
1085:
1086: @setdata[]
1087: $a[$.1[a1] $.2[a2]]
1088: $b[ $.2[b2] $.3[b3]]
1089:
1090:
1091: @hash[]
1092: $h[^hash::create[$._default[123]]]
1093: $h.paf[not kretin]
1094: $h.paf<br>
1095: =$h.that=<br>
1096:
1097: @methresult[]
1098: $result[^table::set{1}]
1099:
1100: @terror[]
1101: ^error[method z must be called with z]
1102:
1103: @syntax1[]
1104: #^a[^b]
1105:
1106: @syntax2[]
1107: #^a[
1108:
1109: @ssave[]
1110: $abc[abc]
1111: ^abc.save[abc]
1112:
1113: @calendar[]
1114: 2001;11:<br>
1115: $week_days[^date:calendar[rus](2001;11)]
1116: <pre>
1117: ^week_days.menu{^for[wday](0;7){^if($week_days.$wday){$week_days.$wday; ^; ^;} }<br>}
1118: </pre>
1119:
1120: @thash[]
1121: $table[^table::set{id name age
1122: 1 paf 278
1123: 2 пиф 234
1124: }]
1125: $hash[^table.hash[id;^table::set[nameless]{id
1126: name}]]
1127: $hash.2.id $hash.2.name $hash.2.age
1128:
1129: @tdef[]
1130: $s[0]
1131: if 0=^if($s){}{n}<br>
1132: if def 0=^if(def $s){y}{}<br>
1133: <hr>
1134:
1135: @ford[]
1136: ^for[i](0;5){$i}{($i)}
1137:
1138: @tif[]
1139: ^if[def]{y;n}
1140:
1141: @image[]
1142: $pict[^image::create(400;200)]
1143: ^pict.arc($pict.width/2;$pict.height/2;$pict.width-1;$pict.height-1;0;360;0x000000)
1144: ^pict.arc($pict.width/2;$pict.height/2;$pict.width-10;$pict.height-10;0+10;360-10;0xff0000)
1145: #^pict.arc($pict.width/2;$pict.height/2;$pict.width;$pict.height;0;360;0xff0000)
1146: ^pict.circle($pict.width/2;$pict.height/2;$pict.height/2-10;0x0000ff)
1147: ^pict.arc($pict.width/2;$pict.height/2;$pict.height-26;$pict.height-26;0+10;360-10;0xff0000)
1148: $response:body[^pict.gif[]]
1149:
1150:
1151:
1152: @mail2[]
1153: ^mail:send[
1154: $.content-type[$.value[text/plain] $.charset[windows-1251]]
1155: $.from[Александр Петросян <paf@design.ru>]
1156: $.to[Александр Петросян <paf@design.ru>]
1157: $.subject[проверка]
1158: $.body[проверка]
1159: ]
1160:
1161: @cookie[]
1162: $env:HTTP_COOKIE<br>
1163:
1164: #$cookie:переменная[test тест ТЕСТ2]
1165: =$cookie:переменная=<br>
1166: #$cookie:переменная2[test тест ТЕСТ3]
1167: =$cookie:переменная2=<br>
1168: =$cookie:CLASS.переменная2=<br>
1169:
1170: @response[]
1171: #^if($form:reload){
1172: $response:refresh[$.value[0] $.url[./t.html?uri=$env:SERVER_NAME]]
1173: #}
1174:
1175: @xslt[]
1176: ^xdata[]
1177: $transformed[^xdoc.transform[global.xsl;$.param1[123/]]]
1178: ^show_xdoc2[$transformed]
1179:
1180: @regexp2[]
1181: $s[ select]
1182: $s[^s.match[^^\s*][]{!}]
1183: $s
1184:
1185: @header[]
1186: $response:refresh[
1187: $.value[0]
1188: $.url[http://design.ru?a=^taint[123]]
1189: ]
1190:
1191: @ttablerem[]
1192: $table[^table::load[a.cfg]]
1193: ^table.menu{$table.a}
1194:
1195: @tconnect[]
1196: ^connect[mysql://test:test@paf/test?charset=cp1251_koi8&compress=1&timeout=1&named_pipe=1]{
1197: $tables[^table::sql{show tables}]
1198: #$cols[^tables.columns[]]
1199: #$cols.column
1200: ^tables.menu{
1201: $tables.[Tables_in_test]<br>
1202: }
1203: }
1204:
1205: @pcre[]
1206: $s[1 2]
1207: ^s.match[\s;ig]{!}
1208: #^s.match[\d;ig]{!}
1209:
1210:
1211: @regexp[]
1212: $s[abcАБВ]
1213: ^if(^s.match[б][i]){y}{n}
1214:
1215: @mail[]
1216: #$ORIGINS(1)
1217: ^mail:send[
1218: $.from[paf@design.ru]
1219: $.to[paf@design.ru]
1220: $.body[1
1221:
1222: 2
1223:
1224:
1225: 3]
1226: ]
1227:
1228: @exec[]
1229: $a[^file::exec[fc.exe;;a;b]]
1230: $a.status|$a.stderr<hr>
1231:
1232: @fori[][i]
1233: ^for[i](1;3){... =$i= ...}
1234:
1235: @xdata0[]
1236: #$response:content-type[$.value[text/html] $.charset[windows-1251]]
1237: $xdoc[^xdoc::set{<?xml version="1.0" encoding="windows-1251"?>
1238: <!--DOCTYPE people SYSTEM "D:\Y\parser3project\parser3\src\www\htdocs\people.dtd"-->
1239: <people>
1240: <man id="1" имя="word слово">
1241: <name>P«^;AF B</name>
1242: </man>
1243: <man id="2">
1244: <name>ПИФ^taint[&]</name>
1245: </man>
1246: </people>
1247: }]
1248:
1249: @xdata[]
1250: #$response:content-type[$.value[text/html] $.charset[windows-1251]]
1251: $xdoc[^xdoc::set{^process{<?xml version="1.0" encoding="windows-1251"?>
1252: <!--DOCTYPE people SYSTEM "D:\Y\parser3project\parser3\src\www\htdocs\people.dtd"-->
1253: <people>
1254: <man id="1" имя="word слово">
1255: <name>P«^;AF B</name>
1256: </man>
1257: <man id="2">
1258: <name>ПИФ^taint[&]</name>
1259: </man>
1260: </people>
1261: }}]
1262:
1263: @xml[]
1264: ^xdata[]
1265:
1266: ^show_xdoc2[$xdoc]<hr>
1267: #^show_xnode1[$xdoc]<hr>
1268: $people[^xdoc.select[*/man]]
1269: #^show1[]
1270: ^show_xnodes1[$people]<hr>
1271: #^people.0.owner.hren[]
1272:
1273: ^show_xnode1[^xdoc.selectSingle[*/man[2]/name];0;1]<hr>
1274:
1275: by id:
1276: ^show_xnode1[^xdoc.getElementById[1];0;1]
1277: <hr>
1278:
1279: @show1[array]
1280: ^for[i](0;^array._count[]-1){
1281: $x[$array.$i]
1282: $x.firstChild.nodeValue:
1283: $pattributes[$x.parentNode.attributes]
1284: ^if(^pattributes._count[]){
1285: $pattributes.id.name=$pattributes.id.nodeValue
1286: }
1287: <br>
1288: }
1289:
1290: @show_xnodes1[array][i]
1291: ^for[i](0;^array._count[]-1){
1292: ^show_xnode1[$array.$i;0;1]
1293: }
1294:
1295: @show_xnode1[x;level;single][l]
1296: ^if(def $x){
1297: ^for[l](0;$level-1){ ^; ^; ^; ^;}
1298: ^if($x.nodeType == $xnode:ELEMENT_NODE){
1299: <^;$x.nodeName
1300: $pairs[$x.attributes]
1301: ^if(def $pairs){
1302: $names[^pairs._keys[]]
1303: ^names.menu{ $names.key="$pairs.[$names.key].nodeValue"}
1304: }
1305: >^;
1306: }{
1307: [$x.nodeType]
1308: }
1309:
1310: ^if(def $x.nodeValue){$x.nodeValue}<br>
1311: ^show_xnode1[$x.firstChild]($level+1)
1312: ^if(!$single){
1313: ^show_xnode1[$x.nextSibling]($level)
1314: }
1315:
1316: ^if($x.nodeType == $xnode:ELEMENT_NODE){
1317: ^for[l](0;$level-1){ ^; ^; ^; ^;}<^;/$x.nodeName>^;<br>
1318: }
1319: }
1320:
1321: @show_xdoc2[xdoc]
1322: ^xdoc.save[out/save.xml;
1323: # $.encoding[utf-8]
1324: $.method[xml]
1325: ]
1326: $file[^xdoc.file[
1327: $.encoding[utf-8]
1328: $.method[html]
1329: ]]
1330: ^file.save[text;out/save_file.html]
1331: #$response:body[^xdoc.file[ $.media-type[text/paf] ]]
1332: <pre>^taint[html][^xdoc.string[
1333: $.method[html]
1334: # $.encoding[utF-8]
1335: # $.omit-xml-declaration[yes]
1336: # $.standalone[no]
1337: # -$.doctype-public[-//W3C//DTD XHTML]
1338: # -$.doctype-system[/a/b/c/]
1339: # $.indent[yes]
1340: # $.media-type[text/paf]
1341: ]]
1342: </pre>
E-mail: