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