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