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