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