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