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