Главная страница


ru.linux

 
 - RU.LINUX ---------------------------------------------------------------------
 From : Kirill Frolov                        2:5030/827.2   26 Mar 2004  09:09:15
 To : Alexander V Butenko
 Subject : Re: linux sucks
 -------------------------------------------------------------------------------- 
 
 
 On Tue, 23 Mar 04 08:20:53 +0300, Alexander V Butenko wrote:
 
  AVB>>> а ты пробовал памяти поставить нужно количество? У меня 256 рамы и я
  AVB>>> вполне даволен. 
  KF>>   f() {
  KF>>         f();
  KF>>         ....
  KF>>   }
  KF>>   Думаешь хватит?
  AVB> продемонстрируй кусок кода в данном приложении подобный вышенаписанному.
 sub graphprint($$$) {
 # {{{ print node and all of it's childs recursive
 my ($prefix, $parent, $node)=@_;
 
 my $addr=fidoize($node); 
 print "$prefix ";
 if (exists $graph{$node}->{mark}) {
   print "[CIRCULAR $addr]\n"; #  ^ $parent\n"; # debug
   $circular++;
 
 } else {
 print "$addr (", scalar(keys(%{$graph{$node}->{child}})), ")\n";
 $graph{$node}->{mark}=1;
 
 > ^^^^^^^^^^^^ можно попробовать убрать эту строчку
 
 my @childs = keys(%{$graph{$node}->{child}});
 @childs = grep {$_ ne $parent} @childs;
 # @childs = sort { sortbyaddr($main::a, $main::b) } @childs;
 @childs = sort { sortbylinks($main::a, $main::b) } @childs;
 
 my $last = pop @childs;
 $prefix=~y/+`-/|  /;
 local $prefixa = $prefix;
 sub _childprint(&) {
   if ($parent ne $_) { 
    print "$prefixa |\n";  &{$_[0]};
   }   
 }
 map { _childprint {graphprint("$prefix +-", $node, $_)} } @childs;
 
 > ^^^^^ нетрудно видеть, что "обрубание хвоста" рекурсии не получается
 
 map { _childprint {graphprint("$prefix `-", $node, $_)} } ($last);
 
 }
 # print node recursive }}}
 }
 Выводит картинку вида:
 
 Distribution tree of the following newsgroups on pc.zxlink:
 fido7.ru.vim
 
 In the period up to the present day.
 Processed 14 messages (0 filtered out).
 
 NODE  (links count):
 
  2:5020/4441 (4)
  |
  +- 2:5020/52 (3)
  |  |
  |  +- 2:450/160 (2)
  |  |  |
  |  |  `- 2:450/256 (1)
  |  |
  |  `- 2:5030/966 (2)
  |     |
  |     `- 2:5030/566 (1)
  |
  +- 2:5030/115 (3)
  |  |
  |  +- 2:5020/545 (2)
  |  |  |
  |  |  `- 2:5015/10 (2)
  |  |     |
  |  |     `- 2:5015/19 (1)
  |  |
  |  `- 2:5030/1115 (2)
  |     |
  |     `- 2:5030/536 (2)
  |        |
  |        `- 2:5030/1123 (2)
  |           |
  |           `- 2:5030/827.2 (2)
  |              |
  |              `- pc.zxlink (1)
  |
  +- 2:5020/12000 (2)
  |  |
  |  `- 2:5020/77 (1)
  |
  `- 2:5020/400 (1)
 
 Total 18 nodes in path.
 Newsgroup distribution list, sorted by address:
 
 NODE   (messages):
 
 [...пингвины..сожрали...]
 
 Total 194 nodes.
 (обязательно залью на CPAN в раздел News)
  AVB> Жду 2 дня. Иначе ставлю тебя в глобальный килфайл.
  AVB> запарил своими ``умными'' высказываниями. 
 
   А что, рекурсивные алгоритмы уже отменили?
 --- [ZX]
  * Origin: 0D00 1E54 41D1 9753 3F41 40F7 4BBA 050B 30E8 0E4E (2:5030/827.2)
 
 

Вернуться к списку тем, сортированных по: возрастание даты  уменьшение даты  тема  автор 

 Тема:    Автор:    Дата:  
 linux sucks   Kirill Frolov   19 Mar 2004 11:21:10 
 Re: linux sucks   Alexander V Butenko   22 Mar 2004 09:10:38 
 Re: linux sucks   Kirill Frolov   23 Mar 2004 06:45:00 
 Re: linux sucks   Alexander V Butenko   23 Mar 2004 09:20:53 
 Re: linux sucks   Kirill Frolov   26 Mar 2004 09:09:15 
Архивное /ru.linux/3833590e33a4.html, оценка 1 из 5, голосов 10
Яндекс.Метрика
Valid HTML 4.01 Transitional