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