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