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