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