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