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