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