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