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