FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Some kind of formatter error

 
Post new topic   Reply to topic     Forum Index -> Descent
View previous topic :: View next topic  
Author Message
raup-tier



Joined: 12 Jul 2008
Posts: 15
Location: Germany

PostPosted: Sat Jul 12, 2008 1:14 pm    Post subject: Some kind of formatter error Reply with quote

hi,

i got some annoying error, if the code contains something like this:
foreach( key, value ; map ){
...stuff...
}

every time i open such code, descent goes up to 100% cpu usage...if i wait a litte all four cores are under full load o.O

this happend to me when is used:
Linux/Eclipse3.3 descent 5.2
Linux/Eclipse3.4 descent 5.2, descent 5.3
Win/Eclipse3.4 descent 5.2

any ideas?
Back to top
View user's profile Send private message
asterite



Joined: 01 Jun 2006
Posts: 235
Location: Buenos Aires, Argentina

PostPosted: Sat Jul 12, 2008 3:52 pm    Post subject: Reply with quote

Can you try with the latest nightly build and see what happens?

http://downloads.dsource.org/projects/descent/

Also, if you can attach the source code for the whole module, it would help me find the error faster.
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
raup-tier



Joined: 12 Jul 2008
Posts: 15
Location: Germany

PostPosted: Sun Jul 13, 2008 4:49 am    Post subject: Reply with quote

here is the code
i used the night build, same error..


Code:

module ComplexCluster;


import tango.stdc.complex;
import tango.io.Stdout;

/**
 * Authors:
 * Arne Simon => email::arne_simon@gmx.de
 */
class ComplexCluster {
  public :

    cdouble[ char[] ] _oldActivations;
    cdouble[ char[] ] _activations;
    cdouble[ char[] ][ char[] ] _connections;
    bool[ char[] ] _senses;
    bool[ char[] ] _actions;
    bool[ char[] ] _targets;

    this() { }

    void activaite( cfloat[ char[] ] pattern ) {
      foreach( char[] name, cfloat activation; pattern ) {
        _activations[ name ] = activation;
      }
    }

    void activaite( char[] z, cfloat a ) {
      _activations[ z ] = a;
    }

    /**
     * Schreibt die Verbindungs-Matrix in den Standart Outpur Stream.
     *
     */
    void printMatrix() {
      Stdout.newline();
      Stdout( "           " );
      foreach( end; _activations.keys ) {
        Stdout.format( " {,8} ", end );
      }
      Stdout.newline();

      foreach( char[] end; _activations.keys ) {
        Stdout.format( " {,8}  ", end );
        foreach( char[] start; _activations.keys ) {
          if( end in _connections && start in _connections[ end ] )
            Stdout.format( "| {,6:f4}+{,6:f4} ",
                _connections[ end ][ start ].re,
                _connections[ end ][ start ].im );
        }
        Stdout( "|" ).newline();
      }
      Stdout.newline();
    }

    void printActivations() {
      uint counter = 0;

      Stdout.newline();
      foreach( char[] name, cdouble activation; _activations ) {
        Stdout.format( " [ {,8} :{,6:f3}+{,6:f3} ] ", name, activation.re,
            activation.im );

        if( ++ counter % 7 == 0 )
          Stdout.newline();
      }
      Stdout.newline();
    }

    ~this() { }

    void init() {

    }

    void good() {

    }

    void bad() {

    }

    bool isSynchron() {
      return true;
    }
   
    void connect( char[] start, char[] end, cfloat i ) {
      if( ! ( start in _activations ) )
        _activations[ start ] = 0+0i;

      if( ! ( end in _activations ) )
        _activations[ end ] = 0+0i;

      _connections[ end ][ start ] = i;
    }

    void pulse() {
      printActivations();

      while( ! isSynchron() ) {
        foreach( name, activation; _activations ) {
          _oldActivations[ name ] = activation;
        }

        foreach( end, starts; _connections ) {
          _activations[ end ] = 0+0i;
          foreach( start, weight; starts ) {
            _activations[ end ] += weight * _oldActivations[ start ];
          }

         // _activations[ end ] = cexp( - _activations[ end ] );
        }

        printActivations();
      }
    }
}
Back to top
View user's profile Send private message
asterite



Joined: 01 Jun 2006
Posts: 235
Location: Buenos Aires, Argentina

PostPosted: Sun Jul 13, 2008 11:23 am    Post subject: Reply with quote

Thanks, raup-tier! I've found a (very silly) bug which lead to an infinitive recursion. I just uploaded a new nightly build which fixes it. Can you try to see if it happens now?
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
raup-tier



Joined: 12 Jul 2008
Posts: 15
Location: Germany

PostPosted: Sun Jul 13, 2008 12:07 pm    Post subject: Reply with quote

*fg* works fine now. Very Happy
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Descent All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group