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