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