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