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