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