Annotation of parser3/www/htdocs/index.html, revision 1.78
1.61 paf 1: #@USE
2: #t.p
1.15 paf 3:
1.72 paf 4: @auto[filespec]
5: $selffilespec[$filespec]
1.63 paf 6: #$form:here
1.15 paf 7: $request:charset[windows-1251]
8: $response:charset[windows-1251]
9: $response:content-type[$.value[text/html]$.charset[$response:charset]]
10:
1.60 paf 11: #@postprocess[body]
12: #<b>$body</b>
13: #$result[123]
1.37 paf 14:
1.15 paf 15: @main[]
1.72 paf 16: #$a(123)
17: #^a.format[%.10u]
1.71 paf 18: #$result[111]
1.70 paf 19: #^f[a]
1.61 paf 20: #^connect[mysql://mdm:4b833ljq@db-mysql/mdm]{
21: # ^int:sql{select news_id from news where news_id=-1}[$.default{2}]<br>
22: # ^string:sql{select news_id from news where news_id=-1}[$.default{2}]
23: #}
1.49 paf 24: #^eval(2)
1.48 paf 25: #^tcrashlocaljunctionsv2[]
1.49 paf 26: #^tcrashlocaljunctions[]
1.50 paf 27: #^tjunctions[]
1.47 paf 28: #^replacetest[]
1.48 paf 29: #^matchoptionpp[]
1.46 paf 30: #^txdocxnodechild[]
1.44 paf 31: #^tclasses[]
1.43 paf 32: #$math:PI
33: #^b:method[]
1.42 paf 34: #^main[]
1.41 paf 35: #^errort[]
1.44 paf 36: #^tselectNumber[]
1.39 paf 37: #$result[hello]
1.36 paf 38: #^invaliddate2[]
39: #^process2[]
40: #^casehashtext[]
1.35 paf 41: #^subjvaltest[]
42: #^tableselect0[]
1.34 paf 43: #^memnotest1[]
1.33 paf 44: #^transparams[]
1.32 paf 45: #^voidparams[]
1.31 paf 46: #^rolls2[]
1.30 paf 47: #^cacheexpireschanging[]
1.29 paf 48: #^cacheexpiresfixed[]
49: #^dateoffsets[]
50: #^exceptionTypes[]
1.28 paf 51: #^roll2[]
1.27 paf 52: #^rolls[]
1.25 paf 53: #^exceptions1[]
1.22 paf 54: #^locate_by_expr[]
1.18 paf 55: #^method_junction_params{...}
1.17 paf 56: #^verifyCookie[paf]
1.37 paf 57: #^execlangs[]
1.16 paf 58: #$t[^tobjeresult[]]$t.a
59: #^xmlprobs[]
1.15 paf 60: #^doubleprobs[]
61: #^math:random(-10)
62: #^divnamestop[]
63: #^arrayclone[]
64: #^operator_tricks[]
65: #^xoutputrusattr[]
66: #^xdocset1[]
67: #^regexp3[]
68: #^exec2[]
69: #^tlock[]
70: #^xmloutattrwithoutvalue[]
71: #^precisionProblem[]
72: #^xpath[]
73: #^ttablesetlang[]
74: #^mail3[]
75: #^ttime[]
76: #^tupper[]
77: #^treplace[]
78: #^xslt2[]
79: #^tcache2[]
80: #$ORIGINS(1)
81: #$t[^table::set{a b} ^table::set{c d}]
82: #^ttaintuntaint[]
83: #^tappend2[]
84: #^badvsnprintf[]
85: #^badoracequoting[]
86: #^badconstructors[]
87: #^xloadwrongtable[]
88: #^xsetwrongtable[]
89: #^if($form:test){y}{n}
90: #^tablecolumnerror[]
91: #^roll[]
92: #^cookie2[]
93: #^tableset[]
94: #^math:PI.format{%.30f}
95: #^xchildren[]
96: #^thashforeach3[]
97: #^thashforeach2[]
98: #^thashforeach[]
99: #^thashdelete[]
100: #^connect[mysql://user:pass@cd.rinet.ru/db]{^void:sql{z} }
101: #^tappend[]
102: #^sappend[]
103: #^eval(10\3)<br>
104: #^tform[]
105: #^formattest[]
106: #^filelist[]
107: #^connect[mysql://user:pass@host]{ }
108: #^безнадёжна_попытка_поправить_непоправимое[]
109: #^tcache[]
110: #^thashfileexp[]
111: #^tcounter[]
112: #^tablehash[]
113: #j^hashfile[]
114: #^formclass[]
115: #^hren[]
116: #^domedit[]
117: #^domxslt[]
118: #^lsplit2[]
119: #^faceesize[]
120: #^imageresize[]
121: #^ifassignhash[]
122: #^tintdefault[]
123: #$response:status[404]
124: #^ifpasshash[]
125: #^movedir[]
126: #^replace[]
127: #^set[]
128: #^hash[]<hr>
129: #$t[^methresult[]] ->$t
130: #^terror[]
131: #^ssave[]
132: #^calendar[]
133: #^thash[]
134: #^tdef[]
135: #^ford[]
136: #^tif[]
137: #^image[]
138: #^mail2[]
139: #^cookie[]
140: #^response[]
141: #^regexp2[]
142: #^ttablerem[]
143: #^pcre[]
144: #^regexp[]<hr>
145: #^mail[]
146: #^exec[]
147: #^fori[]
148: #^tconnect[]
149: #^xslt[]
150: #^xml[]
151: #^header[]
1.53 paf 152: #^tablehasht[]
1.54 paf 153: #^datecreatestring[]
1.56 paf 154: #^mssqltypes1[]
155: #^badthrows[]
1.57 paf 156: #^xmlspace[]
157: #^counter[main.counter]
158: #^xpath2[]
159: #^callindirect[]
160: #^junctionprob[]
1.59 paf 161: #^datecreatestring2[]
162: #^tstoredproc[]
163: #^tstoredproc2[]
164: #^forkeys[]
1.60 paf 165: #^pngsize[]
1.61 paf 166: #^checkList[]
1.63 paf 167: #^datetest[]
1.65 paf 168: #^tserge[]
1.69 paf 169: #^envt[]
1.67 paf 170: #^selectt[]
171: #^select2[]
172: #^selectSingle2[]
173: #^selectString2[]
174: #^selectNumber2[]
175: #^selectBool2[]
176: #^xdoccreate[]
177: #^xdoccreatetag[]
1.70 paf 178: #^xdocload[]
1.67 paf 179: #^xdocstring[]
180: #^xdocsave[]
1.68 paf 181: #^div[]
182: #^datecreatestring3[]
1.73 paf 183: #^tfilespec[]
1.77 paf 184: #^tcrypt[]
1.74 paf 185: #^cryptdocsample[]
1.75 paf 186: #^sendtests[]
1.78 ! paf 187: #^tnormalize[]
! 188: ^xmltransformbyxdoc[]
1.77 paf 189: <hr>
1.74 paf 190: OK
1.78 ! paf 191:
! 192: @xmltransformbyxdoc[]
! 193: $xdoc[^xdoc::set{^process{<?xml version="1.0" encoding="windows-1251"?>
! 194: <!--DOCTYPE people SYSTEM "D:\Y\parser3project\parser3\src\www\htdocs\people.dtd"-->
! 195: <people>
! 196: <man id="1" имя="word слово">
! 197: <name>1 2</name>
! 198: </man>
! 199: </people>
! 200: }}]
! 201: $sheet[^xdoc::create{<?xml version="1.0"?>
! 202: <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
! 203: <!--<xsl:output doctype-public ="-//W3C//DTD XHTML" indent="yes"/>-->
! 204:
! 205: <xsl:param name="param1">defparam1</xsl:param>
! 206: <xsl:param name="param2">defparam2</xsl:param>
! 207:
! 208: <xsl:template match="doc">
! 209: param1=<xsl:value-of select="^$param1"/><br/>
! 210: param2=<xsl:value-of select="^$param2"/><br/>
! 211:
! 212: test return <something background=""/>
! 213: </xsl:template>
! 214:
! 215: <xsl:template name="test">
! 216: test return2
! 217: </xsl:template>
! 218:
! 219: <xsl:template match="people">
! 220: <html>
! 221: <head>z</head>
! 222: para1=<xsl:copy-of select="^$param1"/>
! 223: <xsl:apply-templates/>
! 224: <hr/>
! 225: <xsl:call-template name="test"/>
! 226: </html>
! 227: </xsl:template>
! 228:
! 229: <xsl:template match="name">
! 230: <b><xsl:value-of select="."/></b>
! 231: </xsl:template>
! 232: </xsl:stylesheet>
! 233: }]
! 234:
! 235:
! 236: $xdoc[^xdoc.transform[$sheet]]
! 237: $string[^xdoc.string[$.method[html]]]
! 238: ^string.save[a]
! 239: ^untaint[html]{$string}
! 240:
! 241:
1.77 paf 242:
243: @tnormalize[]
244: #s состоит из 1000 фрагментов
245: $s[^for[i](0;999){фрагмент }]
246: #это займет много ресурсов
247: ^s.match[фраг][g]{перга}
248: #это займет меньше ресурсов
249: #$normalized[^s.normalize[]]
250: #^normalized.match[фраг][g]{перга}
1.74 paf 251:
252: @sendtests[]
253: #^text[]
254: #^html[]
255: #^text-n-html[]
256: #^file[]
257: #^text-n-file[]
258: ^text-n-html-n-file[]
259: #^backwardcomp[]
260:
261: @backwardcomp[]
262: ^mail:send[
263: $.from[paf]
264: $.to[paf]
265: $.body[this is text value]
266: ]
267:
268: @text[]
269: ^mail:send[
270: $.from[paf]
271: $.to[paf]
272: $.text[
273: $.value[this is text value]
274: ]
275: ]
276:
277: @html[]
278: ^mail:send[
279: $.from[paf]
280: $.to[paf]
281: $.html{this is <b>html</b> value ^taint[<] 10}
282: ]
283:
284: @text-n-html[]
285: ^mail:send[
286: $.from[paf]
287: $.to[paf]
288: $.text[
289: $.value[this is text value]
290: ]
291: $.html[
292: $.value{this is <b>html</b> value ^taint[<] 10}
293: ]
294: ]
295:
296: @file[]
297: ^mail:send[
298: $.from[paf]
299: $.to[paf]
300: $.file[^file::load[binary;image.jpg]]
301: ]
302:
303: @text-n-file[]
304: ^mail:send[
305: $.from[paf]
306: $.to[paf]
307: $.text[
308: $.value[this is text value]
309: ]
310: $.file[^file::load[binary;image.jpg]]
311: ]
312:
313: @text-n-html-n-file[]
314: ^mail:send[
315: $.from[paf]
316: $.to[paf]
317: $.text[
318: $.value[this is text value]
319: ]
320: $.html[
321: $.COntent-type[$.value[text/html]$.charset[windows-1251xx]]
322: $.value{this is <b>html</b> value ^taint[<] 10}
323: ]
324: $.file[^file::load[binary;image.jpg]]
325: ]
326:
327:
328:
329: @md5salt[]
330: 1234
331:
332: @cryptdocsample[]
333: $users[^table::create{name password
334: alice ***
335: bob ***
336: }]
337:
338: $htpasswd[^table::create[nameless]{}]
339: ^users.menu{
340: ^htpasswd.append{$users.name:^math:crypt[$users.password;^$apr1^$^md5salt[]]}
341: }
342:
343: ^htpasswd.save[nameless;.htpasswd-parser-test]
344:
1.73 paf 345:
346: @tcrypt[]
1.76 paf 347: #^math:crypt[123;^$apr1^$1234567890abcdef]<br>
348: ^math:crypt[123;^$apr1^$]<br>
1.72 paf 349:
350: @tfilespec[]
351: src=$selffilespec<br>
352: dirname=^file:dirname[$selffilespec]<br>
353: basename=^file:basename[$selffilespec]<br>
354: justname=^file:justname[$selffilespec]<br>
355: justext=^file:justext[$selffilespec]<br>
1.68 paf 356:
357: @datecreatestring3[]
358: $new_after[^date::now(-3)]
359: $articles[^table::create{id title last_update
360: 1 привет 2002-07-03}]
361: ^articles.menu{
362: $last_update[^date::create[$articles.last_update]]
363: <a href=${articles.id}.html>$articles.title</a>
364: ^if($last_update > $new_after){новая}
365: <br>
366: }
1.67 paf 367:
368: @div[]
369: $var(5)
370: ^var.inc(7)
371: ^var.dec(3)
372: ^var.div(4)
373: ^var.mul(2)
374: $var
375:
376:
377: @xdocsave[]
378: $document[^xdoc::create{<?xml version="1.0" encoding="windows-1251" ?>
379: <document>
380: строка1<br/>
381: строка2<br/>
382: </document>}]
383: ^document.save[test.xml]
384:
385: @xdocstring[]
386: $document[^xdoc::create{<?xml version="1.0" encoding="windows-1251" ?>
387: <document>
388: строка1<br/>
389: строка2<br/>
390: </document>}]
391: ^document.string[
392: $.method[html]
393: ]
394:
395:
396: @xdocload[]
397: $document[^xdoc::load[article.xml]]
398: $response:body[^document.file[$.media-type[text/xml]]]
399:
400:
401: @xdoccreatetag[]
402: $document[^xdoc::create[document]]
403: $paraNode[^document.createElement[para]]
404: $dummy[^document.documentElement.appendChild[$paraNode]]
405: $response:body[^document.file[$.media-type[text/xml]]]
406:
407:
408: @xdoccreate[]
409: $document[^xdoc::create{<?xml version="1.0" encoding="windows-1251" ?>
410: <document>
411: текст
412: </document>}]
413: $response:body[^document.file[$.media-type[text/xml]]]
414:
415: @selectBool2[]
416: $d[^xdoc::set{<?xml version="1.0" encoding="windows-1251"?>
417: <t attr="привет" n="123"/>}]
418: ^if(^d.selectBool[/t/@n > 10]){
419: /t/@n больше 10
420: }{
421: не больше
422: }
423:
424:
425: @selectNumber2[]
426: $d[^xdoc::set{<?xml version="1.0" encoding="windows-1251"?>
427: <t attr="привет" n="123"/>}]
428: ^d.selectNumber[number(/t/@n)+1]<br>
429: ^d.selectNumber[2*2]<br>
430:
431:
432: @selectString2[]
433: $d[^xdoc::set{<?xml version="1.0" encoding="windows-1251"?>
434: <t attr="привет" n="123"/>}]
435: # результат=привет
436: ^d.selectString[string(t/@attr)]
437:
438:
439: @selectSingle2[]
440: $d[^xdoc::set{<?xml version="1.0" encoding="windows-1251"?>
441: <t attr="привет" n="123"/>}]
442: # результат=один элемент "t"
443: $element[^d.selectSingle[t]]
444: # результат=2 (количество атрибутов <t>)
445: Количество атрибутов: ^element.attributes._count[]<br>
446: # результат=не существует (нет <x>)
447: ^if(^d.select[x]){
448: x существует
449: }{
450: x не существует
451: }
452:
453: @select2[]
454: $d[^xdoc::set{<?xml version="1.0" encoding="windows-1251"?><t attr="привет" n="123"/>}]
455: # результат: список из одного элемента "t"
456: $list[^d.select[t]]
457: # результат: 2 = количество атрибутов <t>
458: ^list.0.attributes._count[]<br>
459: ^for[i](0;$list-1){
460: $attr[$list.$i]
461: $attr.nodeName = $attr.nodeType<br>
462: }
463:
464:
465: @selectt[]
466: $d[^xdoc::set{<?xml version="1.0" encoding="windows-1251"?><t attr="привет" n="123"/>}]
467: $list[^d.select[t]]
468: ^list.0.attributes._count[]
1.65 paf 469:
470: @envt[]
1.66 paf 471: $f[^file::exec[showenv.cmd;
472: $.bad[value]
473: $.CGI_good[value]
474: ]]
1.65 paf 475: $f.status<br>
476: $f.stderr<br>
477: <pre>$f.text</pre>
478:
1.63 paf 479:
480: @tserge[]
1.64 paf 481: ^if(" 09 "){y}
1.61 paf 482:
483: @datetest[]
484: $f[^file::stat[some.zip]]
485: Размер в байтах: $f.size<br>
486: Год создания: $f.cdate.year<br>
487: $now[^date::now[]]
488: $DAYS_CONSIDERED_NEW(3)
489: Статус: ^if($f.mdate >= $now-$DAYS_CONSIDERED_NEW){новый;старый}
490:
1.60 paf 491:
492: @checkList[]
493: ...^oneOf[a;a,b,c]...<br>
494: #...^oneOf[a;ax,b,c]...<br>
495: ...^oneWord[word]...<br>
496: #...^oneWord[wo rd]...<br>
497:
498:
499: @oneOf[s;list][t] выдаёт строку, если строка она есть в списке(разделенном запятыми)
500: $t[^list.lsplit[,]]
501: ^if(!^t.locate[piece;$s]){^throw[user;$s;unknown]}
502: $result[$s]
503:
504: @oneWord[s]
505: ^if(^s.match[\W]){^throw[user.data;$s;not word]}{$s}
1.59 paf 506:
507: @pngsize[]
508: $i[^image::measure[test.png]]
509: ^i.html[]
510:
511:
512: @forkeys[]
513: $text[^form:fields.foreach[key;val]{$key=$val
514: }]
515: ^text.save[ttt.txt]
516: =$text=
517:
518:
519: @tstoredproc2[]
520: ^connect[odbc://DSN=nestle^;UID=nestle^;PWD=mbm32]{
521: ^void:sql{exec pafvoid}
522: }
523:
524: @tstoredproc[]
525: ^connect[odbc://DSN=nestle^;UID=nestle^;PWD=mbm32]{
526: $t[^table::sql{exec pafproc}]
527: # $t[^table::sql{{call pafproc}}]
528: $c[^t.columns[]]
529: ^c.menu{$c.column}[<br>]
530: }
1.57 paf 531:
532: @datecreatestring2[]
1.58 paf 533: <table border=1>
534: ^datecreatestring2show[2000]
535: ^datecreatestring2show[2000-02]
1.59 paf 536: ^datecreatestring2show[2000-2-03]
1.58 paf 537: ^datecreatestring2show[2000-02-03 15]
538: ^datecreatestring2show[2000-02-03 15:30]
539: ^datecreatestring2show[2000-02-03 15:30:04]
540: ^datecreatestring2show[2000-02-03 15:30:04 hren]
541: ^datecreatestring2show[15:30]
542: ^datecreatestring2show[15:30:05]
543: ^datecreatestring2show[15:30:05 hren]
544: </table>
545:
546: @datecreatestring2show[s]
547: $date[^date::create[$s]]
548: <tr>
549: <td>$s</td><td align=right>^date.sql-string[]</td>
550: </tr>
551:
1.57 paf 552:
553: @junctionprob[][l]
554: $l[123]
555: $a{$l}
556: ^junctionprobnested[$a]
557: @junctionprobnested[p]
558: $p
559:
560:
561: @callindirecttarget[]
562: callindirecttarget called
563: @callindirect[]
564: $f[$callindirecttarget]
565: ^f[]
566:
567: @xpath2[]
568: $xdoc[^xdoc::create{<?xml version="1.0" encoding="windows-1251"?>
569: <doc>
570: <field-list>
571: <field name="aa"/>
572: <field name="bb"/>
573: </field-list>
574: </doc>
575: }]
576:
577: #^xdoc.string[]
578:
579: $fieldList[^xdoc.selectSingle[/doc/field-list]]
580: #^fieldList.childNodes._count[]
581: $fields[^fieldList.select[field]]
582: #^fields._count[]
583: ^fields.foreach[k;node]{
584: $node.nodeName<br>
585: }
586: @counter[filespec][f;s]
587: ^file:lock[$filespec]{
588: $f[^file::load[text;$filespec]]
589: $s[^eval($f.text+1)]
590: ^s.save[$filespec]
591: }
592: $s
1.56 paf 593:
594: @xmlspace[]
595: $xdoc[^xdoc::set{^process{<?xml version="1.0" encoding="windows-1251"?>
596: <!--DOCTYPE people SYSTEM "D:\Y\parser3project\parser3\src\www\htdocs\people.dtd"-->
597: <people>
598: <man id="1" имя="word слово">
599: <name>1 2</name>
600: </man>
601: </people>
602: }}]
603: $xdoc[^xdoc.transform[global.xsl]]
604: $string[^xdoc.string[$.method[html]]]
605: ^string.save[a]
606: ^untaint[html]{$string}
607:
608: @badthrows[]
609: #^throw[a;b;]
610: ^throw[a;]
1.54 paf 611:
612: @mssqltypes1[]
613: ^connect[odbc://DSN=nestle^;UID=nestle^;PWD=mbm32]{
1.55 paf 614: # ^string:sql{select { ts '1998-05-02 01:23:56.123' }}
615: # ^string:sql{select CAST({ ts '1998-05-02 01:23:56.123' }AS smalldatetime)}
616: # ^string:sql{select CAST({ts '2002-04-28 00:00:00.000'} AS smalldatetime)}
617: $t[^table::sql{select a from paf}]
618: ^t.count[]
1.54 paf 619: }
1.51 paf 620:
1.53 paf 621: @datecreatestring[]
1.54 paf 622: $d[^date::create[2002-04-33 01:03:04]]
1.53 paf 623: ^d.sql-string[]
1.52 paf 624:
625: @method[hash]
626: $hash.key
627: @mainZ[]
628: ^method[
629: $.key{code}
630: ]
631:
1.51 paf 632: @tablehasht[]
633: $t[^table::create{p
634: 1
635: 3
636: 2
637: 4}]
638:
639: $h[^t.hash[p]]
640:
641: =^h._count[]=
642:
643:
644: @sqldefaults[]
645: ^connect[mysql://mdm:4b833ljq@db-mysql/mdm]{
646: ^int:sql{select news_id from news where news_id=-1}[$.default{2}]<br>
647: ^string:sql{select news_id from news where news_id=-1}[$.default{2}]
648: }
1.60 paf 649: =======
650: <hr>
651: OK
652: >>>>>>> 1.50
1.48 paf 653:
654: @tcrashlocaljunctionsv2[]
655: $a[
656: $b{ $c[1] }
657: ]
658: $b
659: $c
660:
661: @tcrashlocaljunctions[]
662: $var[aaa]
663: ^if(1){
664: ^tcrashlocaljunctions1[]
665: }
666:
667: $j
668:
1.49 paf 669: @tcrashlocaljunctions1[][var]
670: $var[varvalue]
1.48 paf 671: $j{
672: $var
673: }
1.49 paf 674: $j
1.48 paf 675:
676: @tjunctions[][tl]
677: $t[^t::create[]]
678: ^tjunctionsi[]
679:
680: @tjunctionsi[][tl]
681: $tl[12345]
682: ^t.tjunctionsm[
683: $.key{
684: $tl
685: }
686: ]
1.46 paf 687:
1.47 paf 688: @replacetest[]
689: $b[b]
690: $s[
691: aaaaaaaaaa${b}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
692: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa${b}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
693: ]
694: ^s.replace[^table::create{from to
695: ba !_}]
696:
697:
1.46 paf 698: @matchoptionpp[]
1.47 paf 699: #$ORIGINS(1)
1.46 paf 700: $s[
701: aaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
1.47 paf 702: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
703: aaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
704: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
705: aaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
706: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
707: aaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
708: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
709: aaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
710: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
1.46 paf 711: ]
712: ^s.match[b;g']{($match.prematch|$match.match|$match.postmatch)}
713:
1.44 paf 714:
715: @txdocxnodechild[]
716: $xdoc[^xdoc::set{<?xml version="1.0" encoding="windows-1251" ?><d/>}]
717: $xdoc.nodeName
718: ^xdoc.selectNumber[2*2]
1.45 paf 719: $xdoc:ELEMENT_NODE
1.44 paf 720:
721:
722: @tclasses[]
723: $t[^t::create[]]
724: ^t.method[]
725: <hr>
726: ^t.base_method[]
727:
1.40 paf 728:
729: @errort[]
1.42 paf 730: ^xdoc::create[a]
1.40 paf 731: #^throw[user;here;this]
732:
733: @tselectNumber[]
734: $d[^xdoc::set{<?xml version="1.0" encoding="windows-1251"?><d attr="привет" n="123"/>}]
735: ^d.selectString[string(d/@attr)]<br>
736: ^d.selectNumber[2*2]<br>
737: ^d.selectNumber[number(/d/@n)+1]<br>
738:
1.34 paf 739:
1.36 paf 740: @invaliddate2[]
741: $d[^date::create(1018946575/60/60)] ^d.sql-string[]
742:
743: @process2[]
744: ^^process{
745: ^process{
746: ^$a[^^if(0){^$.k[y]}{^$.k[^^hren[]n]}] ^$a.k
747: }
748: }
749:
1.35 paf 750: @casehashtext[]
751: $tt[1]
752: $tmp[
753: ^switch[$tt]{
754: ^case[1]{
755: $.aaa[123]
756: }
757: ^case[DEFAULT]{
758: $.bbb[456]
759: }
760: }
1.36 paf 761: shit!
1.35 paf 762: ]
1.36 paf 763: #$tmp
1.35 paf 764: $tmp.aaa
765:
766: @subjvaltest[]
767: $a12[val]
768: $b[12]
769: $a$b
770:
1.34 paf 771: @tableselect0[]
772: $person[^table::create{name height
773: paf 1.77
774: шохин 2.07
775: moko 1.77
776: }]
777: $nottoohigh[^person.select($person.height<2)]
778: ^nottoohigh.menu{$nottoohigh.name<br>}
1.32 paf 779:
780: @transparams[]
781: $idoc[^xdoc::create{<?xml version="1.0" ?><doc/>}]
782: $odoc[^idoc.transform[global.xsl;
783: $.param1['1']
784: $.param2['2']
785: ]]
786: <pre>^taint[^odoc.string[$.method[html]]]
787:
788: @memnotest1[]
789: ^for[i](0;4000){
790:
791: $xxxx[$i]
792: $xxxx
793:
794: }
795:
796: @memnotest1notes[]
797: одна итерация цикла:
798: [Mon Apr 8 20:12:02 2002] execution-------------------------|
1.35 paf 799: '469641+=28 wcodeframe -> 0 !optimize[3]''469669+=49 string от {} -> 0 optimize[3]'
1.32 paf 800: [Mon Apr 8 20:12:02 2002] 12:STRING__WRITE
801: [Mon Apr 8 20:12:02 2002] "|| "
802: [Mon Apr 8 20:12:02 2002] 12:WITH_ROOT
803: [Mon Apr 8 20:12:02 2002] 13:VALUE
804: [Mon Apr 8 20:12:02 2002] "xxxx" string
1.35 paf 805: [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 806: [Mon Apr 8 20:12:02 2002] 16:WITH_READ
807: [Mon Apr 8 20:12:02 2002] 17:VALUE
808: [Mon Apr 8 20:12:02 2002] "i" string
809: [Mon Apr 8 20:12:02 2002] 18:GET_ELEMENT
1.35 paf 810: [Mon Apr 8 20:12:02 2002] 17:WRITE_VALUE'469452+=40 MAX_NUMBER -> !~2 actual digits''469492+=49 -> 41 !'
811: [Mon Apr 8 20:12:02 2002] 16:REDUCE_EWPOOL'469541+=24 VString -> 0 optimize[5]'
1.32 paf 812: [Mon Apr 8 20:12:02 2002] 15:CONSTRUCT_VALUE
813: [Mon Apr 8 20:12:02 2002] 12:STRING__WRITE
814: [Mon Apr 8 20:12:02 2002] "| "
815: [Mon Apr 8 20:12:02 2002] 12:WITH_READ
816: [Mon Apr 8 20:12:02 2002] 13:VALUE
817: [Mon Apr 8 20:12:02 2002] "xxxx" string
818: [Mon Apr 8 20:12:02 2002] 14:GET_ELEMENT
819: [Mon Apr 8 20:12:02 2002] 13:WRITE_VALUE'469573+=41 string expand nothing for now'
820: [Mon Apr 8 20:12:02 2002] 12:STRING__WRITE
1.35 paf 821: [Mon Apr 8 20:12:02 2002] "||"'469617+=24 VString -> 0 !optimize[6]'
1.32 paf 822: [Mon Apr 8 20:12:02 2002] <-ja returned
823: [Mon Apr 8 20:12:02 2002] ja->
824:
825: 201/328=0.612804878049 %%optimized
826:
827: 1.
828: CREATE_*POOL
829: сделать
830: *POOL_POOLED+CODE
831: где
832: wwrapper
833: и(возможно) wcodeframe
834: +string
835: стековая переменная
836:
837: 2.
838: избавиться от обёртки при возврате результата process [см. тело _for]
839:
840: 3.
841: сделать callback для process, чтобы вынести invariants из _for & co.
842:
843: 4.
844: @todo склеить get_element и write_value (при вставлении? write_value)
845:
846: 5.
847: reduce_*pool -> вариант получить именно string, без VString обёртки [часто
848: обёртка сразу выбрасывается = не нужна]
849:
850: 6.
851: process вариант получить именно string, без VString обёртки [часто обёртка
852: сразу выбрасывается = не нужна]
853:
854: 7.
855: string head, убить 8 байт неправильной link
1.31 paf 856:
857: @voidparams[]
858: ^voidparamsm[$form:field]
859:
860: @voidparamsm[p]
861: ^p.int(123)
1.29 paf 862:
1.30 paf 863: @rolls2[]
864: $now[^date::now[]]
865: $d[^date::create($now.year;$now.month)] ^d.sql-string[]<br>
866: ^for[i](1;12){
867: ^d.roll[month](-1) ^d.sql-string[]<br>
868: }
869:
1.29 paf 870: @cacheexpireschanging[]
871: ^cache[$DB_HOME/keyключ][^date::now(+1)]{ ^rem{1 day}
872: ^cache[^date::now(+4/24/60/60)]
873: # ^cache(2)
1.30 paf 874: # ^cache(0)
1.29 paf 875: ^math:random(100)
876: }
877:
878:
879:
880: @cacheexpiresfixed[]
881: ^cache[$DB_HOME/keyключ][^date::now(+2/24/60/60)]{
882: ^math:random(100)
883: }
884:
885: @dateoffsets[]
886: $d[^date::create(^date::now[]+1/24/60)]
887: #$d[^date::now(+1/24/60)]
888: ^d.sql-string[]
889: #$d
1.26 paf 890:
1.28 paf 891: @exceptionTypes[]
892: # parser.compile ^test[} компиляция (непарная скобка, ...)
893: # parser.runtime ^if(0). параметры (больше/меньше, чем нужно, не тех типов, ...)
894: # number.zerodivision ^eval(1/0) ^eval(1%0)
895: # number.format ^eval(abc*5)
896: # file.missing ^file:delete[delme] not found
897: # file.access ^table::load[.] no rights
898: # image.format ^image::measure[index.html] not gif/jpg
899: # sql.connect ^connect[mysql://baduser:pass@host/db]{} not found/timeout
900: # sql.execute ^connect[mysql://okuser:pass@host/db]{^void:sql{select bad}} syntax error
901: # xml ^xdoc::create{<forgot?>} any error in xml/xslt libs
902: # smtp.connect not found/timeout
903: # smtp.execute communication error
904:
1.26 paf 905: @roll2[]
906: $d[^date::create(2002;4;2;2;2;3)] ^d.sql-string[]<br>
1.27 paf 907: ^d.roll[day](+365*3+1) ^d.sql-string[]<br>
1.26 paf 908:
1.25 paf 909:
910: @rolls[]
911: $d[^date::create(2002;4;4)]
912: ^d.sql-string[]<br>
913: ^for[i](1;7){
914: ^d.roll[day](-1)
915: ^d.sql-string[]<br>
916: }
917: <hr>
918: $d[^date::create(2002;3;28)]
919: ^d.sql-string[]<br>
920: ^for[i](1;7){
921: ^d.roll[day](+1)
922: ^d.sql-string[]<br>
923: }
924: <hr>
925: $d[^date::create(2002;12;3)]
926: ^d.sql-string[]<br>
927: ^for[i](1;14){
928: ^d.roll[day](-1)
929: ^d.sql-string[]<br>
930: }
931: <hr>
932: $d[^date::create(2002;10;19)]
933: ^d.sql-string[]<br>
934: ^for[i](1;14){
935: ^d.roll[day](+1)
936: ^d.sql-string[]<br>
937: }
938:
939:
940:
941:
942:
1.22 paf 943:
944: @exceptions1[]
945: ^try{
946: aaa
1.24 paf 947: ^throw[custom1;paf;is stupid]
1.22 paf 948: }{
1.24 paf 949: ^if($exception.type eq custom1){
1.28 paf 950: # $exception.handled(1)
951: ^throw[$exception]
1.24 paf 952: type=$exception.type<br>
953: source=$exception.source<br>
954: file=$exception.file<br>
955: lineno=$exception.lineno<br>
956: comment=$exception.comment<br>
957: }
1.22 paf 958: }
1.21 paf 959:
960: @locate_by_expr[]
961: $t[^table::create{a b
962: 1 nok
963: 2 ok
964: 3 nok
965: }]
966: ^if(^t.locate($t.a==2)){$t.b}{n}
1.17 paf 967:
968: @method_junction_params[param]
969: ^if($param is junction){junction}{ne junction}
970:
971: @verifyCookie[value]
972: ^if($cookie:dummyvote eq $value){
973: $result(1)
974: }{
975: $cookie:dummyvote[$value]
976: $result(0)
977: }
1.16 paf 978:
979: @execlangs[]
1.20 paf 980: $f[^file::exec[test.pl]]
1.36 paf 981: err:$f.stderr<br>
1.16 paf 982: ^process{$f.text}
983: #$c[^t.columns[]]
984: #^c.menu{
985: #* $c.column<br>
986: #}
1.36 paf 987: c:$t.c<br>
1.16 paf 988:
989: @tobjeresult[]
990: ^table::create{a
991: 12}
1.15 paf 992:
993: @xmlprobs[]
994: $xmlDataType[^xdoc::load[program.xml]]
995: #<pre>^taint[^xmlDataType.string[]]
996: $xmlDataTypes[^xmlDataType.select[programs/program[@id=4]/data]]
997: #=^xmlDataTypes._count[]=
998: =^xmlDataTypes.0.getAttribute[type-id]=
999:
1000: @doubleprobs[]
1001: $1(^math:radians(180))
1002: $2($math:PI)
1003: ^if(^1.format[%.10f]==^2.format[%.10f]){y;n}
1004: ^if($1==$2){y;n}
1005: ^if(^math:radians(180)==$math:PI){y;n}
1006:
1007:
1008: @divnamestop[]
1009: $a(10)
1010: ^eval($a\3)
1011:
1012: @arrayclone[]
1013: $t[^table::create{a b
1014: 1 11
1015: 2 22
1016: }]
1017: $c[^table::create[$t]]
1018: ^c.append{2 33}
1019: ^t.count[]
1020: ^c.count[]
1021:
1022: @operator_tricks[]
1023: ^if(1){$a[^t[]]}
1024: $a!
1025: $a($b)
1026: ^if(1){y}{n}
1027: $MAIN:a(^t[] eq OK)
1028: #$MAIN:a(1)
1029: ^if($a){y}{n}
1030: #^if(1){y}{n}
1031: $form:if
1032: $a[$.n[1]]
1033: $a.if
1034:
1035: @xoutputrusattr[]
1036: $d[^xdoc::set{<?xml version="1.0" encoding="windows-1251"?><d attr="привет"/>}]
1037: ^show_xdoc2[$d]
1038:
1039: @xdocset1[]
1040: $d[^xdoc::set{<?xml version="1.0"?><d>=^taint[&]=</d>}]
1041: ^show_xdoc2[$d]
1042:
1043: @regexp3[]
1044: $s[abcАБВ]
1045: ^if(^s.match[][i]){y}{n}
1046:
1047:
1048: @exec2[]
1049: $a[^file::exec[bin/t.cmd]]
1050: <pre>^taint[$a.text]</pre>|$a.status|$a.stderr<hr>
1051:
1052:
1053: @tlock[]
1054: ^file:lock[lockfile]{
1055: code
1056: }
1057:
1058: @xmloutattrwithoutvalue[]
1059: #$ORIGINS(1)
1060: $doc[^xdoc::set{<?xml version="1.0"?><doc background="">zz</doc>}]
1061: $doc[^doc.transform[global.xsl]]
1062: =^taint[html][^doc.string[$.method[html]]]=
1063:
1064:
1065:
1066: @precisionProblem[]
1067: $a[123456789012345678901234567890]
1068: $b(^a.double[])
1069: ^b.format{%.20E}
1070: <hr>
1071: ^eval(2*2)
1072:
1073: @xpath[]
1074: $xdoc[^xdoc::set{<?xml version="1.0" encoding="windows-1251" ?>
1075: <document><block><p>привет</p></block></document>
1076: }]
1077: #^show_xdoc2[$xdoc]
1078: $node[^xdoc.selectSingle[/document/block/p]]
1079: ^if(def $node){
1080: ^if($node is string){
1081: $node
1082: }{
1083: ^if($node is hash){
1084: ^node._count[]
1085: }{
1086: $node.nodeType
1087: }
1088: }
1089: #$node.firstChild.nodeValue
1090: }{
1091: node not found
1092: }
1093:
1094:
1095: @ttablesetlang[]
1096: $a-tab-b[a b
1097: 1 2]
1098:
1099: $t[^table::set{$a-tab-b}]
1100: =$t.a=
1101: <hr>
1102:
1103: $t[^table::set[nameless]{^taint[$a-tab-b]}]
1104: =$t.0=
1105: <hr>
1106:
1107: $t[^table::set{^untaint{^taint[$a-tab-b]}}]
1108: =$t.a=
1109:
1110: #^t.append{1 2}
1111:
1112: @mail3[]
1113: ^mail:send[
1114: $.from[Александр Петросян <paf@design.ru>]
1115: $.to[Александр Петросян <paf@design.ru>]
1116: $.subject[проверка4]
1117: $.body[
1118: $.text[
1119: $.content-type[$.value[text/plain] $.charset[windows-1251]]
1120: $.body[проверка]
1121: ]
1122: $.attachment[
1123: $.value[^file::load[text;index.html]]
1124: $.file-name[привет всем.html]
1125: ]
1126: ]
1127: ]
1128:
1129:
1130: @ttime[]
1131: $now[^date::now[]]
1132: $now.hour:$now.minute
1133:
1134: @tupper[]
1135: $t[abcABCабвАБВ]
1136: $t<br>
1137: ^t.upper[]
1138:
1139: @treplace[]
1140: $copy-paste-clean[^table::set{a b
1141: . _
1142: , _
1143: + _
1144: & _
1145: ? _
1146: = _}]
1147:
1148: $cache_key[^taint[в.а,с+я]&был?тут=недавно.cache]
1149: # почему-то этот replace роняет апач в 500 ошибку :(
1150: #^cache_key.replace[$copy-paste-clean]
1151: $test[abc]
1152: ^test.save[$cache_key]saved<br>
1153: $cache[^file:list[.;\.cache^$]]
1154: ^file:delete[$cache_key]deleted($cache.name)<br>
1155:
1156:
1157:
1158: @xslt2[]
1159: $xdoc[^xdoc::set{<?xml version="1.0" encoding="windows-1251" ?>
1160: <document><block><p>привет</p></block></document>
1161: }]
1162: ^show_xdoc2[$xdoc]
1163: ^show_xdoc2[^xdoc.transform[templates/_document.xslt]]
1164: <hr>
1165:
1166:
1167: @tcache2[]
1168: ^cache[$DB_HOME/keyключ](2){
1169: ^math:random(100)
1170: }
1171:
1172: @ttaintuntaint[]
1173: <!-- некий панковский заголовок с буковкой C в круглых скобках -->^taint[html][
1174:
1175: ]zz
1176: <hr>
1177: ^untaint[html]{1^taint[ ]2 3}
1178:
1179:
1180: @tappend2[]
1181: $t[^table::set{a b}]^t.append{1 2}$t.a
1182:
1183: @badvsnprintf[]
1184: ^connect[zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz]{
1185: }
1186:
1187:
1188: @badoracequoting[]
1189: $SQL.connect-string[oracle://webspb:webpwd@mts?NLS_LANG=RUSSIAN_AMERICA.CL8MSWIN1251&NLS_DATE_FORMAT=YYYY-MM-DD HH24:MI:SS]
1190: ^connect[$SQL.connect-string]{
1191: ^void:sql{delete from paf}
1192: ^void:sql{insert into paf values (1, '$form:text')}
1193: $paf[^table::sql{select * from paf}]
1194: ^paf.menu{
1195: $paf.id: ^untaint{$paf.block}<hr>
1196:
1197: }
1198: <hr>
1199:
1200:
1201: ^rem{
1202: $news[^table::sql{select description from news}[$.limit(3)]]
1203: ^news.menu{
1204: ^untaint{$news.description}<hr>
1205:
1206: }
1207: <hr>
1208: }
1209:
1210: $tables[^table::sql{select table_name from user_tables}]
1211: ^tables.menu{
1212: $tables.table_name<br>
1213: }
1214:
1215: }
1216: <hr>
1217: $env:PATH
1218:
1219: @badconstructors[]
1220: $bred[^string::length[]]
1221: $bred[^response::clear[]]
1222: $bred[^int::int[]]
1223:
1224:
1225: @xloadwrongtable[]
1226: $constr[^xdoc::load[wrongtable.xml]]
1227: ^show_xdoc2[$constr]
1228:
1229: @xsetwrongtable[]
1230: $constr[^xdoc::set{<?xml version="1.0" encoding="windows-1251z" ?>
1231: <block-list>^untaint[as-is]{$constructor}</block-list>}]
1232:
1233:
1234: @tablecolumnerror[]
1235: $t[^table::set{a}]
1236: $t.$a
1237:
1238: @roll[]
1239: #$date[^date::set(1970;1;2)]
1240: #^date.roll[month](-1)
1241: $date[^date::set(2038;1;1)]
1242: ^date.roll[month](+1)
1243: $date.year $date.month $date.day
1244:
1245: @cookie2[]
1246: #=$cookie:clientType[$.value[test]]=<br>
1247: =$cookie:clientType=<br>
1248:
1249:
1250: @tableset[]
1251: $a[^table::set{a
1252: 1
1253: 2}]
1254: ^eval(100\$a)
1255:
1256:
1257:
1258: @zzz[]
1259:
1260:
1261: $constructor[
1262: <block1 name="main_srvr" type="0" label="Основное тело" />
1263: <block2 name="main_srvr2" type="0" label="Основное тело" />
1264: ]
1265:
1266: $constr[^xdoc::set{<?xml version="1.0" encoding="windows-1251" ?>
1267: <block-list>^untaint[as-is]{$constructor}</block-list>}]
1268:
1269: $children[$constr.documentElement.childNodes]
1270: ^if($children){
1271: ^for[i](1;^children._count[]){
1272: $node[$children.$i]
1273: $node.nodeName<br>
1274: }
1275: }
1276:
1277:
1278: @thashforeach3[]
1279: $h[
1280: $.a[1]
1281: $.b[2]
1282: ]
1283: $c[^table::set{a
1284: ^h.foreach[key;value]{$value
1285: }}]
1286: $c.a
1287:
1288: @thashforeach2[]
1289: $h[
1290: $.a[1]
1291: $.b[2]
1292: ]
1293: $c[
1294: ^h.foreach[key;value]{
1295: $.$key[$value]
1296: }
1297: ]
1298: $c.b
1299:
1300: @thashforeach[]
1301: $h[
1302: $.a[1]
1303: $.b[2]
1304: ]
1305: ^h.foreach[key;value]{
1306: $key=$value<br>
1307: }
1308:
1309: @thashdelete[]
1310: $h[$.a[1] $.b[2]]
1311: was:<br>
1312: count=^h._count[] <br>
1313: b='$h.b' <br>
1314:
1315: ^h.delete[b]
1316:
1317: now:<br>
1318: count=^h._count[] <br>
1319: b='$h.b'
1320:
1321: @sappend[]
1322: $test[123]
1323: ^test.save[test]
1324: ^test.save[append;test]
1325:
1326: @tappend[]
1327: $test[^table::set{a b
1328: a1 b1}]
1329: ^test.save[test]
1330: $test[^table::set{a b
1331: a2 b2}]
1332: ^test.save[append;test]
1333:
1334:
1335: @tform[]
1336: ^if(def $form:new_file){y}{n}
1337: <form method="post" enctype="multipart/form-data">
1338: <input type="file" name="new_file" />
1339: <input type=submit>
1340: </input>
1341:
1342: @formattest[]
1343: $size(15.124)
1344:
1345: ^size.format{%.2f}
1346:
1347: @filelist[]
1348: $html[^file:list[.;\.html^$]]
1349: ^html.menu{
1350: $html.name<br>
1351: }
1352: <hr>
1353:
1354: @безнадёжна_попытка_поправить_непоправимое[]
1355: $dom_from_disk[^xdoc::load[input.xml]]
1356: $dom_created_in_air[^xdoc::create[doc]]
1357: ^dom_created_in_air.documentElement.appendChild[^dom_from_disk.documentElement.cloneNode(1)]
1358: ^show_xdoc2[$dom_created_in_air]
1359:
1360:
1361: @tcache[]
1362: #^hashfile:clear[cache]
1363: $code[^hashfile::open[$DB_HOME;cache]]
1364: ^code.cache[key](2){
1365: ^math:random(100)
1366: # ^code.delete[]
1367: }
1368:
1369: @thashfileexp[]
1370: $hf[^hashfile::open[$DB_HOME;hashfile]]
1371: $hf.paf[$.value[крут] $.expires(3)]
1372: paf=$hf.paf
1373: <hr>
1374: ^hf.foreach[key;value]{
1375: $key=$value<br>
1376: }
1377: <hr>
1378: $hash[^hf.hash[]]
1379: =$hash.paf=
1380: <hr>
1381:
1382: @tcounter[]
1383: ^tcounterone[$DB_HOME]
1384: other root:
1385: ^tcounterone[${DB_HOME}2]
1386: again, first:
1387: ^tcounterone[$DB_HOME]
1388:
1389: @tcounterone[DB_HOME]
1390: $counter[^hashfile::open[$DB_HOME;counter]]
1391: #^counter.clear[]
1392: ^counter.transaction{
1393: # $counter.value(10)
1394: $counter.value($counter.value+1)
1395: # ^counter.delete[value]
1396: $counter.value
1397: }
1398: <hr>
1399: ^rem{
1400: $hash[^counter.hash[]]
1401: =$hash.value=
1402: <hr>
1403: }
1404:
1405: @tablehash[]
1406: $productList[^table::set{id name
1407: 1 носки
1408: 2 валенки
1409: 3 ушанка
1410: }]
1411:
1412: #скажем, у первого дилера
1413: $firstPriceList[^table::set{id price
1414: 1 0.3
1415: 3 1000
1416: }]
1417:
1418: $firstPriceHash[^firstPriceList.hash[id]]
1419:
1420: ^productList.menu{
1421: продукт "$productList.name" | цена у first: $firstPriceHash.[$productList.id].price<br>
1422: }
1423:
1424:
1425: @hashfile[]
1426: $hf[^hashfile::assign[hashfile]]
1427: #$hf.paf[крут5]
1428: paf=$hf.paf
1429:
1430: @formclass[]
1431: ^$form:CLASS.a=$form:CLASS.a
1432:
1433: @domdata[]
1434: ^if(1){
1435: # $a{^hren[]}
1436: }
1437: $a
1438: $xdoc[^xdoc::create[doc]]
1439: $doc[$xdoc.documentElement]
1440: $name[^doc.appendChild[^xdoc.createElement[name]]]
1441: $text[^name.appendChild[^xdoc.createTextNode[петросян&coz]]]
1442: ^untaint[as-is]{=$text.nodeValue=}
1443:
1444: @domedit[]
1445: ^domdata[]
1446: #$paf.nodeName<br>
1447: #$doc.documentElement.nodeName<br>
1448:
1449: ^show_xnode1[$xdoc.documentElement;0;1]
1450: <hr>
1451: ^show_xdoc2[$xdoc]
1452: <hr>
1453:
1454: @domxslt[]
1455: ^domdata[]
1456: ^show_xdoc2[^xdoc.transform[global.xsl;$.param1[123/]]]
1457: <hr>
1458:
1459: @lsplit2[]
1460: $path[/optics/]
1461: $pathTable[^path.lsplit[/]]
1462: ^pathTable.menu{
1463: ^if(def $pathTable.piece){
1464: =$pathTable.piece=
1465: }
1466: }
1467:
1468:
1469: @faceesize[]
1470: $k(2)
1471: $pict[^image::load[paf.gif]]
1472: $small[^image::create($pict.width/$k;$pict.height/$k)]
1473: ^small.copy[$pict](0;0;$pict.width;$pict.height;0;0;$small.width;$small.height;250)
1474: $response:body[^small.gif[]]
1475:
1476: @imageresize[]
1477: $k(2)
1478: $pict[^image::create(400*$k;200*$k)]
1479: $pict.line-width(2)
1480: ^pict.arc($pict.width/2;$pict.height/2;$pict.width-1;$pict.height-1;0;360;0x000000)
1481: ^pict.arc($pict.width/2;$pict.height/2;$pict.width-20;$pict.height-20;0+20;360-20;0xff0000)
1482: #^pict.arc($pict.width/2;$pict.height/2;$pict.width;$pict.height;0;360;0xff0000)
1483: ^pict.circle($pict.width/2;$pict.height/2;$pict.height/2-20;0x0000ff)
1484: ^pict.arc($pict.width/2;$pict.height/2;$pict.height-26;$pict.height-26;0+20;360-20;0xff0000)
1485: $response:body[^pict.gif[]]
1486:
1487: #$small[^image::create($pict.width/$k;$pict.height/$k)]
1488: #^small.copy[$pict](0;0;$pict.width;$pict.height;0;0)
1489: #^small.copy[$pict](0;0;$pict.width;$pict.height;0;0;$small.width;$small.height;0)
1490:
1491: #$response:body[^small.gif[]]
1492:
1493:
1494: @tintdefault[]
1495: #$abc[abc]
1496: $abc[33]
1497: ^abc.int[z]
1498: #^abc.int(123)
1499:
1500: @ifassignhash[]
1501: $h[^if(1){$.a(1);$.a(2)}]
1502: $h.a
1503:
1504: @ifpasshash[]
1505: $a[$.e[a]]
1506: $b[$.e[b]]
1507: ^ifpasshashdest[^if(1){$a;$b}]
1508: #$x[^if(1){$a}{$b}]
1509: #^ifpasshashdest[$x]
1510:
1511: @ifpasshashdest[p]
1512: $p.e
1513:
1514: @movedir[]
1515: ^file:move[a;deeper/a]
1516:
1517: @replace[]
1518: $a[12^;3]
1519: ^a.replace[^table::set{from to
1520: 2^; !
1521: }]
1522:
1523:
1524: @set[]
1525: ^setdata[]
1526: ^a.add[$b]
1527: add:$a.3<br>
1528:
1529: ^setdata[]
1530: ^a.sub[$b]
1531: sub2:$a.2<br>
1532: sub1:$a.1<br>
1533:
1534: ^setdata[]
1535: $c[^a.union[$b]]
1536: union3:$c.3<br>
1537: union2:$c.2<br>
1538:
1539: ^setdata[]
1540: $c[^a.intersection[$b]]
1541: intersection3:$c.3<br>
1542: intersection2:$c.2<br>
1543:
1544: ^setdata[]
1545: intersects:^if(^a.intersects[$b]){y;n}<br>
1546: intersects2:^if(^a.intersects[ ]){y;n}<br>
1547:
1548:
1549: <hr>
1550:
1551: @setdata[]
1552: $a[$.1[a1] $.2[a2]]
1553: $b[ $.2[b2] $.3[b3]]
1554:
1555:
1556: @hash[]
1557: $h[^hash::create[$._default[123]]]
1558: $h.paf[not kretin]
1559: $h.paf<br>
1560: =$h.that=<br>
1561:
1562: @methresult[]
1563: $result[^table::set{1}]
1564:
1565: @terror[]
1566: ^error[method z must be called with z]
1567:
1568: @syntax1[]
1569: #^a[^b]
1570:
1571: @syntax2[]
1572: #^a[
1573:
1574: @ssave[]
1575: $abc[abc]
1576: ^abc.save[abc]
1577:
1578: @calendar[]
1579: 2001;11:<br>
1580: $week_days[^date:calendar[rus](2001;11)]
1581: <pre>
1582: ^week_days.menu{^for[wday](0;7){^if($week_days.$wday){$week_days.$wday; ^; ^;} }<br>}
1583: </pre>
1584:
1585: @thash[]
1586: $table[^table::set{id name age
1587: 1 paf 278
1588: 2 пиф 234
1589: }]
1590: $hash[^table.hash[id;^table::set[nameless]{id
1591: name}]]
1592: $hash.2.id $hash.2.name $hash.2.age
1593:
1594: @tdef[]
1595: $s[0]
1596: if 0=^if($s){}{n}<br>
1597: if def 0=^if(def $s){y}{}<br>
1598: <hr>
1599:
1600: @ford[]
1601: ^for[i](0;5){$i}{($i)}
1602:
1603: @tif[]
1604: ^if[def]{y;n}
1605:
1606: @image[]
1607: $pict[^image::create(400;200)]
1608: ^pict.arc($pict.width/2;$pict.height/2;$pict.width-1;$pict.height-1;0;360;0x000000)
1609: ^pict.arc($pict.width/2;$pict.height/2;$pict.width-10;$pict.height-10;0+10;360-10;0xff0000)
1610: #^pict.arc($pict.width/2;$pict.height/2;$pict.width;$pict.height;0;360;0xff0000)
1611: ^pict.circle($pict.width/2;$pict.height/2;$pict.height/2-10;0x0000ff)
1612: ^pict.arc($pict.width/2;$pict.height/2;$pict.height-26;$pict.height-26;0+10;360-10;0xff0000)
1613: $response:body[^pict.gif[]]
1614:
1615:
1616:
1617: @mail2[]
1618: ^mail:send[
1619: $.content-type[$.value[text/plain] $.charset[windows-1251]]
1620: $.from[Александр Петросян <paf@design.ru>]
1621: $.to[Александр Петросян <paf@design.ru>]
1622: $.subject[проверка]
1623: $.body[проверка]
1624: ]
1625:
1626: @cookie[]
1627: $env:HTTP_COOKIE<br>
1628:
1629: #$cookie:переменная[test тест ТЕСТ2]
1630: =$cookie:переменная=<br>
1631: #$cookie:переменная2[test тест ТЕСТ3]
1632: =$cookie:переменная2=<br>
1633: =$cookie:CLASS.переменная2=<br>
1634:
1635: @response[]
1636: #^if($form:reload){
1637: $response:refresh[$.value[0] $.url[./t.html?uri=$env:SERVER_NAME]]
1638: #}
1639:
1640: @xslt[]
1641: ^xdata[]
1642: $transformed[^xdoc.transform[global.xsl;$.param1[123/]]]
1643: ^show_xdoc2[$transformed]
1644:
1645: @regexp2[]
1646: $s[ select]
1647: $s[^s.match[^^\s*][]{!}]
1648: $s
1649:
1650: @header[]
1651: $response:refresh[
1652: $.value[0]
1653: $.url[http://design.ru?a=^taint[123]]
1654: ]
1655:
1656: @ttablerem[]
1657: $table[^table::load[a.cfg]]
1658: ^table.menu{$table.a}
1659:
1660: @tconnect[]
1661: ^connect[mysql://test:test@paf/test?charset=cp1251_koi8&compress=1&timeout=1&named_pipe=1]{
1662: $tables[^table::sql{show tables}]
1663: #$cols[^tables.columns[]]
1664: #$cols.column
1665: ^tables.menu{
1666: $tables.[Tables_in_test]<br>
1667: }
1668: }
1669:
1670: @pcre[]
1671: $s[1 2]
1672: ^s.match[\s;ig]{!}
1673: #^s.match[\d;ig]{!}
1674:
1675:
1676: @regexp[]
1677: $s[abcАБВ]
1678: ^if(^s.match[б][i]){y}{n}
1679:
1680: @mail[]
1681: #$ORIGINS(1)
1682: ^mail:send[
1683: $.from[paf@design.ru]
1684: $.to[paf@design.ru]
1685: $.body[1
1686:
1687: 2
1688:
1689:
1690: 3]
1691: ]
1692:
1693: @exec[]
1694: $a[^file::exec[fc.exe;;a;b]]
1695: $a.status|$a.stderr<hr>
1696:
1697: @fori[][i]
1698: ^for[i](1;3){... =$i= ...}
1699:
1700: @xdata0[]
1701: #$response:content-type[$.value[text/html] $.charset[windows-1251]]
1702: $xdoc[^xdoc::set{<?xml version="1.0" encoding="windows-1251"?>
1703: <!--DOCTYPE people SYSTEM "D:\Y\parser3project\parser3\src\www\htdocs\people.dtd"-->
1704: <people>
1705: <man id="1" имя="word слово">
1706: <name>P«^;AF B</name>
1707: </man>
1708: <man id="2">
1709: <name>ПИФ^taint[&]</name>
1710: </man>
1711: </people>
1712: }]
1713:
1714: @xdata[]
1715: #$response:content-type[$.value[text/html] $.charset[windows-1251]]
1716: $xdoc[^xdoc::set{^process{<?xml version="1.0" encoding="windows-1251"?>
1717: <!--DOCTYPE people SYSTEM "D:\Y\parser3project\parser3\src\www\htdocs\people.dtd"-->
1718: <people>
1719: <man id="1" имя="word слово">
1720: <name>P«^;AF B</name>
1721: </man>
1722: <man id="2">
1723: <name>ПИФ^taint[&]</name>
1724: </man>
1725: </people>
1726: }}]
1727:
1728: @xml[]
1729: ^xdata[]
1730:
1731: ^show_xdoc2[$xdoc]<hr>
1732: #^show_xnode1[$xdoc]<hr>
1733: $people[^xdoc.select[*/man]]
1734: #^show1[]
1735: ^show_xnodes1[$people]<hr>
1736: #^people.0.owner.hren[]
1737:
1738: ^show_xnode1[^xdoc.selectSingle[*/man[2]/name];0;1]<hr>
1739:
1740: by id:
1741: ^show_xnode1[^xdoc.getElementById[1];0;1]
1742: <hr>
1743:
1744: @show1[array]
1745: ^for[i](0;^array._count[]-1){
1746: $x[$array.$i]
1747: $x.firstChild.nodeValue:
1748: $pattributes[$x.parentNode.attributes]
1749: ^if(^pattributes._count[]){
1750: $pattributes.id.name=$pattributes.id.nodeValue
1751: }
1752: <br>
1753: }
1754:
1755: @show_xnodes1[array][i]
1756: ^for[i](0;^array._count[]-1){
1757: ^show_xnode1[$array.$i;0;1]
1758: }
1759:
1760: @show_xnode1[x;level;single][l]
1761: ^if(def $x){
1762: ^for[l](0;$level-1){ ^; ^; ^; ^;}
1763: ^if($x.nodeType == $xnode:ELEMENT_NODE){
1764: <^;$x.nodeName
1765: $pairs[$x.attributes]
1766: ^if(def $pairs){
1767: $names[^pairs._keys[]]
1768: ^names.menu{ $names.key="$pairs.[$names.key].nodeValue"}
1769: }
1770: >^;
1771: }{
1772: [$x.nodeType]
1773: }
1774:
1775: ^if(def $x.nodeValue){$x.nodeValue}<br>
1776: ^show_xnode1[$x.firstChild]($level+1)
1777: ^if(!$single){
1778: ^show_xnode1[$x.nextSibling]($level)
1779: }
1780:
1781: ^if($x.nodeType == $xnode:ELEMENT_NODE){
1782: ^for[l](0;$level-1){ ^; ^; ^; ^;}<^;/$x.nodeName>^;<br>
1783: }
1784: }
1785:
1786: @show_xdoc2[xdoc]
1787: ^xdoc.save[out/save.xml;
1788: # $.encoding[utf-8]
1789: $.method[xml]
1790: ]
1791: $file[^xdoc.file[
1792: $.encoding[utf-8]
1793: $.method[html]
1794: ]]
1795: ^file.save[text;out/save_file.html]
1796: #$response:body[^xdoc.file[ $.media-type[text/paf] ]]
1797: <pre>^taint[html][^xdoc.string[
1798: $.method[html]
1799: # $.encoding[utF-8]
1800: # $.omit-xml-declaration[yes]
1801: # $.standalone[no]
1802: # -$.doctype-public[-//W3C//DTD XHTML]
1803: # -$.doctype-system[/a/b/c/]
1804: # $.indent[yes]
1805: # $.media-type[text/paf]
1806: ]]
1807: </pre>
E-mail: