Author Topic: Question for the regulars  (Read 13226 times)

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Question for the regulars
« Reply #30 on: December 03, 2009, 05:16:20 PM »
There's actually nothing central. It's a little weird, but I started very bottom up with the whole thing.

Each module has the core library (dll) and unit tests (exe). The unit tests get run automatically when you build the module solutions.  Failed tests get treated like compile errors. You can set the unit tests to be the startup binary I you want something to run.

For an error console dig in to ui.controls. It has a few custom controls already.  It also has a "testbed" that should auto detect new controls and let you play with them.

For the console itself:

1. Different categories of console output will exist.  So there should be a way to enable/disable console categories from displaying.
2. Different colors should be possible for text. I'm not sure yet what I'll use it for though. Maybe different categories are different colors.
3. I rebuilt a MFC console for something at work. I replaced a cEdit box for the text with a CList box. That was the secret for making it fast.  Not sure what that means fir .net though.
4. Not sure how familiar you are with unit testing. But it's especially important to figure out how to test ui controls. You can test that categories can be turned on/off for instance. Let me know if you need help figuring out the unit testing framework.
5. The console itself should be a control, not a form. It should "fill" it's parent container, though. Let me know if you need help figuring out how to do that.

...

I'll try to give you write access to the svn tonight.

Offline dragonlordged

  • Bot Neophyte
  • *
  • Posts: 18
    • View Profile
Question for the regulars
« Reply #31 on: December 03, 2009, 05:28:54 PM »
Just a quick question. What's UI.Winforms? If I remember, I couldn't even get it to compile. I'll take a look at UI.Controls.

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Question for the regulars
« Reply #32 on: December 03, 2009, 06:21:42 PM »
Winforms is a dumping ground of various attempts at core darwinbots windows and forms. Like the sim opts in db2.

It just needs a good critical pass over it to see what's worth keeping and what needs more work. It's ignorable for the moment.

Offline OSSP

  • Bot Neophyte
  • *
  • Posts: 2
    • View Profile
Question for the regulars
« Reply #33 on: December 06, 2009, 08:27:16 PM »
UI controls compiles and runs for me, but yes, the UIwinforms doesn't seem to compile when you open it (Missing symbol "Gl" and missing library "Tao").

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Question for the regulars
« Reply #34 on: December 06, 2009, 09:39:08 PM »
As I said, uiwinforms is a dumping ground of different things.  It's not surprising it might not compile (if you install Tao on your machine, you might be able to get it to compile).  It's entirely ignorable for the moment.

Offline dragonlordged

  • Bot Neophyte
  • *
  • Posts: 18
    • View Profile
Question for the regulars
« Reply #35 on: December 07, 2009, 09:24:21 PM »
Numsgil, I'm going to start adding some of the stuff you've told me and the stuff I can figure out about the code in as comments, because I have had no luck figuring out how this project works and therefore can't really figure out how to add to it. I'm thinking that by adding more comments at least I can help out anyone who wants to contribute later.

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Question for the regulars
« Reply #36 on: December 07, 2009, 09:31:25 PM »
Sure, sounds like a plan.

...

Not sure if you've ever played with a project that was unit tested like this, but one of the ideas of unit tests is that they are "living documentation" about how to use the code they test.  There isn't really a "program" to run, so traditional methods of wrapping your head around a code base don't really work here.  Trying to think of it in a "top down" manner won't really work.  You have to think about things in a far more modular way.

Speaking of unit tests, if the way in which an individual class should be used isn't immediately clear, consider writing a "use case" unit test as a "living comment".

That said, there is a picture which describes how modules are supposed to fit together that might help things make sense.  You can find it here.  UI.Controls isn't listed, but basically it'll be a sub module of UI.WinForms.
« Last Edit: December 07, 2009, 09:32:10 PM by Numsgil »

Offline dragonlordged

  • Bot Neophyte
  • *
  • Posts: 18
    • View Profile
Question for the regulars
« Reply #37 on: December 07, 2009, 09:53:18 PM »
That image is quite useful, but I still think several of the modules could do with commenting in their code at least at the top which simply describes what they are supposed to do or what they're for. I mean, just looking at the repository, you'd think that Core is the only folder you need to look in and that all the others just make libraries that add on to the functionality of Core, but that's obviously (to me now) not the case. As a beginning contributor, I have little idea of what to add to and how to add it without more documentation than is available.

From my personal experience, while unit testing is an incredibly useful supplement to documentation and comments, it's not enough on its own.

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Question for the regulars
« Reply #38 on: December 07, 2009, 10:19:29 PM »
No, you're right. The code itself could do with some documenting, particularly at a high level. If you want to add a high level file describing the modules and what ( you think) they do, it could go in that same documentation folder. I'll fill in any gaps or errors if you post an initial draft to that folder.

Mostly I've been doing my best to limit how much of other modules you need to understand to be productive.  I don't want the code to grow to the point where the only way to make changes in one part is to understand how it fits in the whole.

Offline dragonlordged

  • Bot Neophyte
  • *
  • Posts: 18
    • View Profile
Question for the regulars
« Reply #39 on: December 07, 2009, 10:29:01 PM »
Okay, I'll start to work on that later tonight. The only one that I can't begin to understand yet is the Azimuth module. Can you give me a brief rundown so I can get a picture in my head before I start running through the code?

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Question for the regulars
« Reply #40 on: December 07, 2009, 11:08:01 PM »
Azimuth is a math library.  It's like a tool box.  Each folder is a group of related tools in the toolbox.  DenseLinearAlgebra has tools for dense linear algebra.  Polynomials has tools for finding roots of polynomials.  Etc.

The core workhorse of the whole thing is the Scalar structure.  It's a wrapper around either float or double (depending on what the user compiles with), and allows me to do things like a == 0 with a clear conscience.  It also overrides ToString() so that it only outputs significant digits, and I'm working on adding a counter so I can easily count the number of FLOPs a complex operation does.  Pretty much everything builds on top of Scalar.  It's also a horribly ugly structure, but I think that's just the nature of the beast for something like that.

Offline dragonlordged

  • Bot Neophyte
  • *
  • Posts: 18
    • View Profile
Question for the regulars
« Reply #41 on: December 09, 2009, 02:01:32 PM »
Numsgil, I added README files to most folders in the Modules folder, describing what (I think) they do. I also added a few other READMEs to help repository navigation. See what you think and tell me if I got anything wrong.

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Question for the regulars
« Reply #42 on: December 09, 2009, 02:19:39 PM »
Mostly correct.  UI.Controls will probably remain a separate module from UI.Winforms because .NET form designers prefer custom controls to exist in external libs instead of in the same lib.

Also I've been following the convention of using About This Folder.txt instead of README.txt because I,, at least, tend to ignore READMEs because they're almost never useful.  Whereas "About this folder" tells you that the file contains information about the current folder, so you can decide whether or not it's worth your time to read.  But minor point all in all.

I'll try to go back through and expand them out a bit later today or tomorrow.

Offline dragonlordged

  • Bot Neophyte
  • *
  • Posts: 18
    • View Profile
Question for the regulars
« Reply #43 on: December 09, 2009, 03:30:27 PM »
I suppose so. I'll go change that around shortly.

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Question for the regulars
« Reply #44 on: December 29, 2009, 03:55:40 AM »
Quote from: dragonlordged
So when I run the BuildAll scripts, I get a 'Visual Studio 9 cannot be found' error. I've tried reinstalling Visual Studio, but had no luck. I believe I have all the dependencies installed correctly. Any ideas?

I fixed the problem with this now, btw.  Windows 7/Vista used spaces instead of tabs as deliminators.  Made the whole thing a huge pain but I've fixed it and I've tested it on my new Windows 7 64 bit laptop with C# express.