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