Annotation of parser3/src/www/htdocs/index.html, revision 1.463
1.399 parser 1: @main[]
1.463 ! paf 2: ^status[]
! 3: <hr>
1.462 paf 4: #^xchildren[]
5: #^thashforeach3[]
1.461 paf 6: #^thashforeach2[]
7: #^thashforeach[]
1.458 paf 8: #^thashdelete[]
1.456 paf 9: #^connect[mysql://user:pass@cd.rinet.ru/db]{^void:sql{z} }
1.454 paf 10: #^tappend[]
1.453 paf 11: #^sappend[]
1.452 paf 12: #^eval(10\3)<br>
1.450 paf 13: #^tform[]
1.448 paf 14: #^formattest[]
1.447 paf 15: #^filelist[]
1.443 paf 16: #^connect[mysql://user:pass@host]{ }
1.431 paf 17: #^безнадёжна_попытка_поправить_непоправимое[]
1.430 parser 18: #^tcache[]
1.460 paf 19: #^thashfileexp[]
1.457 paf 20: #^tcounter[]
1.423 parser 21: #^tablehash[]
1.443 paf 22: #j^hashfile[]
1.417 parser 23: #^formclass[]
1.415 parser 24: #^hren[]
1.446 paf 25: #^domedit[]
1.420 parser 26: #^domxslt[]
1.402 parser 27: #^lsplit2[]
1.401 parser 28: #^faceesize[]
1.445 paf 29: #^imageresize[]
1.399 parser 30: #^ifassignhash[]
31: #^tintdefault[]
32: #$response:status[404]
1.390 parser 33: #^ifpasshash[]
1.387 parser 34: #^movedir[]
35: #^replace[]
1.416 parser 36: #^set[]
1.385 parser 37: #^hash[]<hr>
1.384 parser 38: #$t[^methresult[]] ->$t
1.382 parser 39: #^terror[]
1.378 parser 40: #^ssave[]
1.377 parser 41: #^calendar[]
1.376 parser 42: #^thash[]
1.373 parser 43: #^tdef[]
1.375 parser 44: #^ford[]
1.371 parser 45: #^tif[]
1.383 parser 46: #^image[]
1.369 parser 47: #^mail2[]
1.413 parser 48: #^cookie[]
1.365 parser 49: #^response[]
1.364 parser 50: #^regexp2[]
51: #^ttablerem[]
52: #^pcre[]
53: #^regexp[]<hr>
54: #^mail[]
55: #^exec[]
56: #^fori[]
1.462 paf 57: ^tconnect[]
1.463 ! paf 58: ^xslt[]
1.395 parser 59: #^xml[]
1.364 parser 60: #^header[]
1.463 ! paf 61: <hr>
! 62: ^status[]
1.364 parser 63: OK
1.462 paf 64:
65: @status[]
66: $c[$status:sql.cache]
67: <table border=1>
68: <tr>
69: <td colspan=3>
70: sql.cache
71: </td>
72: </tr>
73: <td>url</td>
74: <td>time</td>
75: ^c.menu{
76: <tr>
77: <td>$c.url</td>
78: <td>$c.time</td>
79: </tr>
80: }
81: </table>
82:
1.463 ! paf 83: $c[$status:stylesheet.cache]
! 84: <table border=1>
! 85: <tr>
! 86: <td colspan=3>
! 87: stylesheet.cache
! 88: </td>
! 89: </tr>
! 90: <td>file</td>
! 91: <td>time</td>
! 92: ^c.menu{
! 93: <tr>
! 94: <td>$c.file</td>
! 95: <td>$c.time</td>
! 96: </tr>
! 97: }
! 98: </table>
! 99:
! 100:
1.462 paf 101: @xchildren[]
102: $constructor[
103: <block1 name="main_srvr" type="0" label="Основное тело" />
104: <block2 name="main_srvr2" type="0" label="Основное тело" />
105: ]
106:
107: $constr[^xdoc::set{<?xml version="1.0" encoding="windows-1251" ?>
108: <block-list>^untaint[as-is]{$constructor}</block-list>}]
109:
110: $children[$constr.documentElement.childNodes]
111: ^if($children){
112: ^for[i](1;^children._count[]){
113: $node[$children.$i]
114: $node.nodeName<br>
115: }
116: }
117:
1.461 paf 118:
119: @thashforeach3[]
120: $h[
121: $.a[1]
122: $.b[2]
123: ]
124: $c[^table::set{a
125: ^h.foreach[key;value]{$value
126: }}]
127: $c.a
128:
129: @thashforeach2[]
130: $h[
131: $.a[1]
132: $.b[2]
133: ]
134: $c[
135: ^h.foreach[key;value]{
136: $.$key[$value]
137: }
138: ]
139: $c.b
1.458 paf 140:
141: @thashforeach[]
142: $h[
143: $.a[1]
144: $.b[2]
145: ]
146: ^h.foreach[key;value]{
147: $key=$value<br>
148: }
1.457 paf 149:
150: @thashdelete[]
151: $h[$.a[1] $.b[2]]
152: was:<br>
153: count=^h._count[] <br>
154: b='$h.b' <br>
155:
156: ^h.delete[b]
157:
158: now:<br>
159: count=^h._count[] <br>
160: b='$h.b'
1.452 paf 161:
162: @sappend[]
163: $test[123]
164: ^test.save[test]
165: ^test.save[append;test]
166:
1.453 paf 167: @tappend[]
168: $test[^table::set{a b
169: a1 b1}]
170: ^test.save[test]
171: $test[^table::set{a b
172: a2 b2}]
173: ^test.save[append;test]
1.452 paf 174:
1.448 paf 175:
176: @tform[]
1.449 paf 177: ^if(def $form:new_file){y}{n}
178: <form method="post" enctype="multipart/form-data">
179: <input type="file" name="new_file" />
1.448 paf 180: <input type=submit>
181: </input>
1.447 paf 182:
183: @formattest[]
184: $size(15.124)
185:
186: ^size.format{%.2f}
1.446 paf 187:
188: @filelist[]
189: $html[^file:list[.;\.html^$]]
190: ^html.menu{
191: $html.name<br>
192: }
193: <hr>
1.431 paf 194:
195: @безнадёжна_попытка_поправить_непоправимое[]
196: $dom_from_disk[^xdoc::load[input.xml]]
197: $dom_created_in_air[^xdoc::create[doc]]
198: ^dom_created_in_air.documentElement.appendChild[^dom_from_disk.documentElement.cloneNode(1)]
199: ^show-xdoc2[$dom_created_in_air]
200:
1.426 parser 201:
1.428 parser 202: @tcache[]
203: #^hashfile:clear[cache]
1.459 paf 204: $code[^hashfile::open[$DB_HOME;cache]]
1.430 parser 205: ^code.cache[key](2){
206: ^math:random(100)
207: # ^code.delete[]
1.428 parser 208: }
209:
210:
1.426 parser 211: @thashfileexp[]
1.459 paf 212: $hf[^hashfile::open[$DB_HOME;hashfile]]
1.428 parser 213: $hf.paf[$.value[крут] $.expires(3)]
214: paf=$hf.paf
1.459 paf 215: <hr>
216: ^hf.foreach[key;value]{
217: $key=$value<br>
218: }
1.427 parser 219: <hr>
220: $hash[^hf.hash[]]
221: =$hash.paf=
222: <hr>
1.420 parser 223:
1.423 parser 224: @tcounter[]
1.440 paf 225: ^tcounterone[$DB_HOME]
226: #other root:
227: #^tcounterone[${DB_HOME}2]
1.437 paf 228: #again, first:
229: #^tcounterone[$DB_HOME]
1.432 paf 230:
231: @tcounterone[DB_HOME]
232: $counter[^hashfile::open[$DB_HOME;counter]]
1.440 paf 233: #^counter.clear[]
1.423 parser 234: ^counter.transaction{
235: # $counter.value(10)
236: $counter.value($counter.value+1)
237: # ^counter.delete[value]
238: $counter.value
239: }
1.424 parser 240: <hr>
1.432 paf 241: ^rem{
1.424 parser 242: $hash[^counter.hash[]]
1.425 parser 243: =$hash.value=
1.424 parser 244: <hr>
1.432 paf 245: }
1.423 parser 246:
247: @tablehash[]
248: $productList[^table::set{id name
249: 1 носки
250: 2 валенки
251: 3 ушанка
252: }]
253:
254: #скажем, у первого дилера
255: $firstPriceList[^table::set{id price
256: 1 0.3
257: 3 1000
258: }]
259:
260: $firstPriceHash[^firstPriceList.hash[id]]
261:
262: ^productList.menu{
263: продукт "$productList.name" | цена у first: $firstPriceHash.[$productList.id].price<br>
264: }
265:
266:
1.420 parser 267: @hashfile[]
268: $hf[^hashfile::assign[hashfile]]
1.423 parser 269: #$hf.paf[крут5]
1.420 parser 270: paf=$hf.paf
1.402 parser 271:
1.417 parser 272: @formclass[]
273: ^$form:CLASS.a=$form:CLASS.a
274:
1.406 parser 275: @domdata[]
1.418 parser 276: ^if(1){
1.422 parser 277: # $a{^hren[]}
1.418 parser 278: }
1.419 parser 279: $a
1.408 parser 280: $xdoc[^xdoc::create[doc]]
281: $doc[$xdoc.documentElement]
1.435 paf 282: $name[^doc.appendChild[^xdoc.createElement{name}]]
283: $text[^name.appendChild[^xdoc.createTextNode{петросян ^;co}]]
284: ^untaint[as-is]{=$text.nodeValue=}
1.406 parser 285:
286: @domedit[]
287: ^domdata[]
1.404 parser 288: #$paf.nodeName<br>
289: #$doc.documentElement.nodeName<br>
290:
1.406 parser 291: ^show-xnode1[$xdoc.documentElement;0;1]
292: <hr>
293: ^show-xdoc2[$xdoc]
1.411 parser 294: <hr>
1.406 parser 295:
296: @domxslt[]
297: ^domdata[]
1.405 parser 298: ^show-xdoc2[^xdoc.transform[global.xsl;$.param1[123/]]]
1.411 parser 299: <hr>
1.401 parser 300:
301: @lsplit2[]
302: $path[/optics/]
303: $pathTable[^path.lsplit[/]]
304: ^pathTable.menu{
305: ^if(def $pathTable.piece){
306: =$pathTable.piece=
307: }
308: }
309:
1.395 parser 310:
1.397 parser 311: @faceesize[]
312: $k(2)
313: $pict[^image::load[paf.gif]]
314: $small[^image::create($pict.width/$k;$pict.height/$k)]
1.398 parser 315: ^small.copy[$pict](0;0;$pict.width;$pict.height;0;0;$small.width;$small.height;250)
1.397 parser 316: $response:body[^small.gif[]]
317:
1.395 parser 318: @imageresize[]
319: $k(2)
320: $pict[^image::create(400*$k;200*$k)]
321: $pict.line-width(2)
1.444 paf 322: ^pict.arc($pict.width/2;$pict.height/2;$pict.width-1;$pict.height-1;0;360;0x000000)
323: ^pict.arc($pict.width/2;$pict.height/2;$pict.width-20;$pict.height-20;0+20;360-20;0xff0000)
1.395 parser 324: #^pict.arc($pict.width/2;$pict.height/2;$pict.width;$pict.height;0;360;0xff0000)
1.444 paf 325: ^pict.circle($pict.width/2;$pict.height/2;$pict.height/2-20;0x0000ff)
326: ^pict.arc($pict.width/2;$pict.height/2;$pict.height-26;$pict.height-26;0+20;360-20;0xff0000)
327: $response:body[^pict.gif[]]
1.395 parser 328:
1.443 paf 329: #$small[^image::create($pict.width/$k;$pict.height/$k)]
1.396 parser 330: #^small.copy[$pict](0;0;$pict.width;$pict.height;0;0)
1.443 paf 331: #^small.copy[$pict](0;0;$pict.width;$pict.height;0;0;$small.width;$small.height;0)
1.395 parser 332:
1.443 paf 333: #$response:body[^small.gif[]]
1.395 parser 334:
1.388 parser 335:
336: @tintdefault[]
337: #$abc[abc]
338: $abc[33]
339: ^abc.int[z]
340: #^abc.int(123)
1.390 parser 341:
342: @ifassignhash[]
343: $h[^if(1){$.a(1);$.a(2)}]
344: $h.a
1.387 parser 345:
346: @ifpasshash[]
347: $a[$.e[a]]
348: $b[$.e[b]]
1.389 parser 349: ^ifpasshashdest[^if(1){$a;$b}]
1.387 parser 350: #$x[^if(1){$a}{$b}]
351: #^ifpasshashdest[$x]
352:
353: @ifpasshashdest[p]
354: $p.e
355:
356: @movedir[]
357: ^file:move[a;deeper/a]
1.386 parser 358:
359: @replace[]
360: $a[12^;3]
361: ^a.replace[^table::set{from to
362: 2^; !
363: }]
364:
1.385 parser 365:
366: @set[]
367: ^setdata[]
368: ^a.add[$b]
369: add:$a.3<br>
370:
371: ^setdata[]
372: ^a.sub[$b]
373: sub2:$a.2<br>
374: sub1:$a.1<br>
375:
376: ^setdata[]
377: $c[^a.union[$b]]
378: union3:$c.3<br>
379: union2:$c.2<br>
380:
381: ^setdata[]
382: $c[^a.intersection[$b]]
383: intersection3:$c.3<br>
384: intersection2:$c.2<br>
385:
386: ^setdata[]
387: intersects:^if(^a.intersects[$b]){y;n}<br>
388: intersects2:^if(^a.intersects[ ]){y;n}<br>
389:
390:
391: <hr>
392:
393: @setdata[]
394: $a[$.1[a1] $.2[a2]]
395: $b[ $.2[b2] $.3[b3]]
396:
1.383 parser 397:
1.384 parser 398: @hash[]
399: $h[^hash::create[$._default[123]]]
400: $h.paf[not kretin]
401: $h.paf<br>
402: =$h.that=<br>
403:
404: @methresult[]
405: $result[^table::set{1}]
1.377 parser 406:
1.381 parser 407: @terror[]
408: ^error[method z must be called with z]
409:
1.380 parser 410: @syntax1[]
411: #^a[^b]
412:
413: @syntax2[]
1.381 parser 414: #^a[
1.379 parser 415:
1.377 parser 416: @ssave[]
417: $abc[abc]
418: ^abc.save[abc]
1.376 parser 419:
420: @calendar[]
421: 2001;11:<br>
422: $week_days[^date:calendar[rus](2001;11)]
423: <pre>
424: ^week_days.menu{^for[wday](0;7){^if($week_days.$wday){$week_days.$wday; ^; ^;} }<br>}
425: </pre>
1.372 parser 426:
1.375 parser 427: @thash[]
428: $table[^table::set{id name age
429: 1 paf 278
430: 2 пиф 234
431: }]
432: $hash[^table.hash[id;^table::set[nameless]{id
433: name}]]
434: $hash.2.id $hash.2.name $hash.2.age
435:
1.372 parser 436: @tdef[]
437: $s[0]
438: if 0=^if($s){}{n}<br>
439: if def 0=^if(def $s){y}{}<br>
440: <hr>
1.371 parser 441:
442: @ford[]
1.374 parser 443: ^for[i](0;5){$i}{($i)}
1.368 parser 444:
1.370 parser 445: @tif[]
446: ^if[def]{y;n}
447:
1.368 parser 448: @image[]
449: $pict[^image::create(400;200)]
1.379 parser 450: ^pict.arc($pict.width/2;$pict.height/2;$pict.width-1;$pict.height-1;0;360;0x000000)
451: ^pict.arc($pict.width/2;$pict.height/2;$pict.width-10;$pict.height-10;0+10;360-10;0xff0000)
452: #^pict.arc($pict.width/2;$pict.height/2;$pict.width;$pict.height;0;360;0xff0000)
453: ^pict.circle($pict.width/2;$pict.height/2;$pict.height/2-10;0x0000ff)
454: ^pict.arc($pict.width/2;$pict.height/2;$pict.height-26;$pict.height-26;0+10;360-10;0xff0000)
1.368 parser 455: $response:body[^pict.gif[]]
456:
457:
1.366 parser 458:
1.369 parser 459: @mail2[]
1.367 parser 460: ^mail:send[
1.369 parser 461: $.content-type[$.value[text/plain] $.charset[windows-1251]]
462: $.from[Александр Петросян <paf@design.ru>]
1.367 parser 463: $.to[Александр Петросян <paf@design.ru>]
1.369 parser 464: $.subject[проверка]
465: $.body[проверка]
1.367 parser 466: ]
467:
1.366 parser 468: @cookie[]
1.367 parser 469: $env:HTTP_COOKIE<br>
470:
471: #$cookie:переменная[test тест ТЕСТ2]
472: =$cookie:переменная=<br>
473: #$cookie:переменная2[test тест ТЕСТ3]
474: =$cookie:переменная2=<br>
1.412 parser 475: =$cookie:CLASS.переменная2=<br>
1.365 parser 476:
477: @response[]
478: #^if($form:reload){
479: $response:refresh[$.value[0] $.url[./t.html?uri=$env:SERVER_NAME]]
480: #}
1.364 parser 481:
482: @xslt[]
483: ^xdata[]
1.407 parser 484: $transformed[^xdoc.transform[global.xsl;$.param1[123/]]]
485: ^show-xdoc2[$transformed]
1.364 parser 486:
487: @regexp2[]
488: $s[ select]
489: $s[^s.match[^^\s*][]{!}]
490: $s
491:
492: @header[]
493: $response:refresh[
494: $.value[0]
495: $.url[http://design.ru?a=^taint[123]]
496: ]
497:
498: @ttablerem[]
499: $table[^table::load[a.cfg]]
500: ^table.menu{$table.a}
501:
502: @tconnect[]
503: ^connect[mysql://test:test@paf/test?charset=cp1251_koi8&compress=1&timeout=1&named_pipe=1]{
504: $tables[^table::sql{show tables}]
505: #$cols[^tables.columns[]]
506: #$cols.column
507: ^tables.menu{
508: $tables.[Tables_in_test]<br>
509: }
510: }
511:
512: @pcre[]
513: $s[1 2]
514: ^s.match[\s;ig]{!}
515: #^s.match[\d;ig]{!}
516:
517:
518: @regexp[]
519: $s[abcАБВ]
520: ^if(^s.match[б][i]){y}{n}
521:
522: @mail[]
523: #$ORIGINS(1)
524: ^mail:send[
525: $.from[paf@design.ru]
526: $.to[paf@design.ru]
527: $.body[1
528:
529: 2
530:
531:
532: 3]
533: ]
534:
535: @exec[]
1.370 parser 536: $a[^file::exec[fc.exe;;a;b]]
1.364 parser 537: $a.status|$a.stderr<hr>
538:
539: @fori[][i]
540: ^for[i](1;3){... =$i= ...}
541:
542: @xdata[]
543: #$response:content-type[$.value[text/html] $.charset[windows-1251]]
544: $xdoc[^xdoc::load[input.xml]]
545:
546: @xml[]
547: ^xdata[]
548:
549: ^show-xdoc2[$xdoc]<hr>
550: #^show-xnode1[$xdoc]<hr>
551: $people[^xdoc.select[*/man]]
552: #^show1[]
553: ^show-xnodes1[$people]<hr>
554: #^people.0.owner.hren[]
555:
1.393 parser 556: ^show-xnode1[^xdoc.selectSingle[*/man[2]/name];0;1]<hr>
1.364 parser 557:
558: by id:
559: ^show-xnode1[^xdoc.getElementById[1];0;1]
560: <hr>
561:
562: @show1[array]
563: ^for[i](0;^array._count[]-1){
564: $x[$array.$i]
565: $x.firstChild.nodeValue:
566: $pattributes[$x.parentNode.attributes]
567: ^if(^pattributes._count[]){
568: $pattributes.id.name=$pattributes.id.nodeValue
569: }
570: <br>
571: }
572:
573: @show-xnodes1[array][i]
574: ^for[i](0;^array._count[]-1){
575: ^show-xnode1[$array.$i;0;1]
576: }
577:
578: @show-xnode1[x;level;single][l]
579: ^if(def $x){
580: ^for[l](0;$level-1){ ^; ^; ^; ^;}
581: ^if($x.nodeType == $xnode:ELEMENT_NODE){
582: <^;$x.nodeName
583: $pairs[$x.attributes]
584: ^if(def $pairs){
585: $names[^pairs._keys[]]
586: ^names.menu{ $names.key="$pairs.[$names.key].nodeValue"}
587: }
588: >^;
589: }{
590: [$x.nodeType]
591: }
592:
593: ^if(def $x.nodeValue){$x.nodeValue}<br>
594: ^show-xnode1[$x.firstChild]($level+1)
595: ^if(!$single){
596: ^show-xnode1[$x.nextSibling]($level)
597: }
598:
599: ^if($x.nodeType == $xnode:ELEMENT_NODE){
600: ^for[l](0;$level-1){ ^; ^; ^; ^;}<^;/$x.nodeName>^;<br>
601: }
602: }
603:
604: @show-xdoc2[xdoc]
605: ^xdoc.save[save.xml;
606: # $.encoding[windows-1251]
607: $.method[xml]
608: ]
609: $file[^xdoc.file[
610: # $.encoding[windows-1251]
611: $.method[html]
612: ]]
613: ^file.save[text;save_file.html]
1.463 ! paf 614: <pre>^taint[^xdoc.string[]]
1.364 parser 615: # $.encoding[windows-1251]
1.413 parser 616: # $.method[html]
1.364 parser 617: #]]
1.413 parser 618: </pre>
1.435 paf 619:
E-mail: