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