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