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