From ntoll at ntoll.org Mon Oct 1 18:49:09 2007 From: ntoll at ntoll.org (Nicholas H.Tollervey) Date: Mon, 01 Oct 2007 23:49:09 +0100 Subject: [Aiml-programr-developers] New graphmaster "node" class completed Message-ID: <47017965.3090108@ntoll.org> Guys, Just a heads up to say that in my "play" branch I've "finished" a version of the node class that lies at the heart of the graphmaster algorithm. It passes a pretty comprehensive test suite and is based upon my code in Program#. It is also extensively commented and running "rdoc node.rb" will get you some pretty documentation. Take a look and let me know what you think (check out the unit tests to see how it is used - as it only has two public methods this shouldn't be hard!). As I always mention, I speak Ruby with a strong "C" accent so style and Rubyism guidance would be helpful. Also, I'm waiting on Mauro to check with the original authors before uploading the new website. Any news on this? If not, I can't see any harm in going with it until such time (if at all) we get a negative from them. Best wishes, Nicholas From mauro at cicio.org Tue Oct 2 16:12:08 2007 From: mauro at cicio.org (mauro at cicio.org) Date: Tue, 2 Oct 2007 22:12:08 +0200 Subject: [Aiml-programr-developers] New graphmaster "node" class completed In-Reply-To: <47017965.3090108@ntoll.org> References: <47017965.3090108@ntoll.org> Message-ID: Hi Nicholas, Sorry, I missed this mail. I shouuld have freed some time now. I should be able to devote a full day per week to pR. I am very keen to get to the Rails plugin asap. As soon (soon!) as I have seen your Node class, I'll come back to you. Regarding the website. OK from the old team (Loris is now member of pR2 too, I still hope to have Sara and Giorgio on board as well). Ciao, Mauro On 02/10/2007, Nicholas H.Tollervey wrote: > Guys, > > Just a heads up to say that in my "play" branch I've "finished" a > version of the node class that lies at the heart of the graphmaster > algorithm. It passes a pretty comprehensive test suite and is based upon > my code in Program#. It is also extensively commented and running "rdoc > node.rb" will get you some pretty documentation. > > Take a look and let me know what you think (check out the unit tests to > see how it is used - as it only has two public methods this shouldn't be > hard!). As I always mention, I speak Ruby with a strong "C" accent so > style and Rubyism guidance would be helpful. > > Also, I'm waiting on Mauro to check with the original authors before > uploading the new website. Any news on this? If not, I can't see any > harm in going with it until such time (if at all) we get a negative from > them. > > Best wishes, > > Nicholas > _______________________________________________ > Aiml-programr-developers mailing list > Aiml-programr-developers at rubyforge.org > http://rubyforge.org/mailman/listinfo/aiml-programr-developers > From ntoll at ntoll.org Wed Oct 3 03:37:23 2007 From: ntoll at ntoll.org (Nicholas H.Tollervey) Date: Wed, 03 Oct 2007 08:37:23 +0100 Subject: [Aiml-programr-developers] New graphmaster "node" class completed In-Reply-To: References: <47017965.3090108@ntoll.org> Message-ID: <470346B3.6010908@ntoll.org> Mauro, Regarding the first two points (Ruby indentation / 80 column rule): no problem, go for it (what exactly are the ruby indentation rules? where might I find them? I thought I was following them?). Coding "style" rules are fine with me... it helps keep the code consistent and readable. Regarding comments: :-P I always comment first and then code. Helps me remember what I'm supposed to be doing! Also, as the Node class is (only slightly) conceptually abstract yet essential to the correct workings of a bot so I wanted to make sure anyone reading the code would have no doubt how it works. My usual commenting style is much more terse and I definitely subscribe to the self-commenting code school of thought. Nevertheless, when working from a detailed specification (like the AIML standard) I usually include relevant details in the class documentation so it shows up in things like rdoc. Concerning editors: on anything but Windows I use VI (vim) because thats what I've always used, its always there and I'm a "real man". Joking aside, vim is just so much better than VS. VS tries to be helpful but always seems to end up getting in the way - for example, by reformatting my nicely indented HTML into gobble-de-gook, hiding build tasks / setting behind dialogs and endless "user friendly" GUIs (give me rake any day) and insisting on doing an auto-complete on everything (although this can be switched off). vim does exactly what it says and :!irb is so useful to try stuff out... etc... For me vim does one thing and does it well - can't ask for much more than that. (Knowing my luck, you're an emacs user :-P ) Looking forward to your response! Nicholas. mauro at cicio.org wrote: > Hi, > > I checked out your sources and went through it very quickly. > when I will study it, I'll reformat it following two guidelines: > > 1 - ruby indentation > 2 - 80 columns rule > > Do you see problems in adapting to this rules? > I think that it would help if I write my comments on the code rubisms > directly into the file. > Where do you prefer my version to be put then? In play/nicholas? > Where? Or in play/mauro? > > Another thing: it helps to read the code not to have too many comments > (a good code is self commenting, Martin Fowler even suggests that > commenting might be "dangerous"). > Whould you mind if we add the comments when the program is stable, > possibly even in external files? > > BTW Which editor do you use? Some of the above might sound crazy is > you come from a VisualStudio background ... (I know that you are a > Linux user, but I think you where saying that you are forced to work > with MS stuff, right?) > > Ciao, > Mauro > > On 02/10/2007, mauro at cicio.org wrote: > >> Hi Nicholas, >> >> Sorry, I missed this mail. >> I shouuld have freed some time now. I should be able to devote a full >> day per week to pR. I am very keen to get to the Rails plugin asap. >> >> As soon (soon!) as I have seen your Node class, I'll come back to you. >> >> Regarding the website. OK from the old team (Loris is now member of >> pR2 too, I still hope to have Sara and Giorgio on board as well). >> >> Ciao, >> Mauro >> >> On 02/10/2007, Nicholas H.Tollervey wrote: >> >>> Guys, >>> >>> Just a heads up to say that in my "play" branch I've "finished" a >>> version of the node class that lies at the heart of the graphmaster >>> algorithm. It passes a pretty comprehensive test suite and is based upon >>> my code in Program#. It is also extensively commented and running "rdoc >>> node.rb" will get you some pretty documentation. >>> >>> Take a look and let me know what you think (check out the unit tests to >>> see how it is used - as it only has two public methods this shouldn't be >>> hard!). As I always mention, I speak Ruby with a strong "C" accent so >>> style and Rubyism guidance would be helpful. >>> >>> Also, I'm waiting on Mauro to check with the original authors before >>> uploading the new website. Any news on this? If not, I can't see any >>> harm in going with it until such time (if at all) we get a negative from >>> them. >>> >>> Best wishes, >>> >>> Nicholas >>> _______________________________________________ >>> Aiml-programr-developers mailing list >>> Aiml-programr-developers at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/aiml-programr-developers >>> >>> > > From ntoll at ntoll.org Wed Oct 3 09:29:28 2007 From: ntoll at ntoll.org (Nicholas H.Tollervey) Date: Wed, 03 Oct 2007 14:29:28 +0100 Subject: [Aiml-programr-developers] New graphmaster "node" class completed Message-ID: <47039938.6030907@ntoll.org> Mauro, Forgot to mention, make edits / changes in my play branch. When / if we're happy with it we can merge into trunk and integrate. In the meantime, I want to check the AIML tag handling classes against the unit tests and modify as required. Best wishes, Nicholas From mauro at cicio.org Thu Oct 4 16:37:52 2007 From: mauro at cicio.org (mauro at cicio.org) Date: Thu, 4 Oct 2007 22:37:52 +0200 Subject: [Aiml-programr-developers] New graphmaster "node" class completed In-Reply-To: <470346B3.6010908@ntoll.org> References: <47017965.3090108@ntoll.org> <470346B3.6010908@ntoll.org> Message-ID: Hi Nicholas, > Regarding the first two points (Ruby indentation / 80 column rule): no > problem, go for it (what exactly are the ruby indentation rules? where > might I find them? I thought I was following them?). > what exactly are the ruby indentation rules? Simple: 2 spaces (not the C/C++ 4). > where might I find them? I don't remember, I read them about 7 years ago and always respected since. Anyway: the generated code (e.g. Rails) respects all of them. > I thought I was following them? Yes, I think so too: I just modified the 4 to 2. > Coding "style" > rules are fine with me... it helps keep the code consistent and readable. I agree. In each lang, I stick to the main stream of that lang. > Regarding comments: :-P I always comment first and then code. Helps me > remember what I'm supposed to be doing! This is fine. Not a reason -per se- to keep the comments once the coding is done :-) I find them annoying, considering that your code is very clear, but is not a big deal. > Also, as the Node class is (only > slightly) conceptually abstract yet essential to the correct workings of > a bot so I wanted to make sure anyone reading the code would have no > doubt how it works. Good point. I was referring to things like: # @children to contain the child nodes from this node @children = Hash.new() I suspect that if somebody needs a comment to understand what the @children of a Node class are, then s/he is reading the wrong literature ;-) > My usual commenting style is much more terse and I > definitely subscribe to the self-commenting code school of thought. Great! > Nevertheless, when working from a detailed specification (like the AIML > standard) I usually include relevant details in the class documentation > so it shows up in things like rdoc. I completely agree on this. I have never looked into it, but I think that Ruby has a mechanism to merge the comment file and the code file on the fly. Of course this is only for the class comment. > Concerning editors: on anything but Windows I use VI (vim) Me too! Now I wanted to begin doing some real work myself! What I did is to rewrite your class up to the add_category method. Nothing new from the functional point of view, only style. At the add_category I stopped, in order to prepare a few comments and open a discussion on style, OO, programming. I have created a parallel file (play/nicholas/graphmaster/lib/node_mc.rb) where I also attempt a "defence" of the equivalent method in the old implementation. Using this technique (processing ourr code, like we where lawyers), is supposed to help us in becoming better programmers. Of course this kind of detailed work is very "expensive", so if you are not into this kind of things (I think you both are!), tell me and I drop my coach attitude :-) Very interesting is the point 5 in the file. I left it open for you to have the first word on it. I really hope you like the game (and have time to play it), Ciao, Mauro From mauro at cicio.org Thu Oct 4 16:43:46 2007 From: mauro at cicio.org (mauro at cicio.org) Date: Thu, 4 Oct 2007 22:43:46 +0200 Subject: [Aiml-programr-developers] New graphmaster "node" class completed In-Reply-To: <47039938.6030907@ntoll.org> References: <47039938.6030907@ntoll.org> Message-ID: A topic aside. I am not very keen in signing my code (I hardly feel there is anything original in it), but I understand that this point of view is not shared by everybody. If signing files i s important to you, than probably we should come up with a rule, for instance: - A separate files with Credits - Who creates the first edition of a file has his name on it - The last Editor of a file has his name on it - We have the core contributors name in all the files - We have the names in the licence file only - ... other ideas Your opinion? Mauro From ntoll at ntoll.org Thu Oct 4 17:11:21 2007 From: ntoll at ntoll.org (Nicholas H.Tollervey) Date: Thu, 04 Oct 2007 22:11:21 +0100 Subject: [Aiml-programr-developers] New graphmaster "node" class completed In-Reply-To: References: <47017965.3090108@ntoll.org> <470346B3.6010908@ntoll.org> Message-ID: <470556F9.4050204@ntoll.org> Mauro, All sounds good to me. I like the idea of comparing old/new... that way we can be certain that the code in the lib has earned its place... also I like the opportunity to learn. :-) I'll take an in-depth look at your new file / comments tomorrow during lunch and will reply in depth very soon. As I think I mentioned in a previous email, I'm intentionally not looking at the "current" node class so we can do an untainted compare and contrast. However, I've obviously quickly skimmed through your new file. I'm really going to enjoy this! Some quick points: I agree with using the metaphors as it makes the code easier to understand - a good thing. Also, seeing how you've refactored my clunky Ruby is certainly an eye opener. Coming from C# (where there is no obvious equivalent) just using the Array.shift method makes things a whole lot easier. In addition, I like how "unless" is used to get rid of pesky if...else. Finally, I think it important that we include some means of referencing the origin of a template in the graphmaster as this is extraordinarily useful when debugging AIML (see the "source" argument in my add_category method). Best wishes, Nicholas mauro at cicio.org wrote: > Hi Nicholas, > > >> Regarding the first two points (Ruby indentation / 80 column rule): no >> problem, go for it (what exactly are the ruby indentation rules? where >> might I find them? I thought I was following them?). >> > > >> what exactly are the ruby indentation rules? >> > Simple: 2 spaces (not the C/C++ 4). > > >> where might I find them? >> > I don't remember, I read them about 7 years ago and always respected since. > Anyway: the generated code (e.g. Rails) respects all of them. > > >> I thought I was following them? >> > Yes, I think so too: I just modified the 4 to 2. > > >> Coding "style" >> rules are fine with me... it helps keep the code consistent and readable. >> > > I agree. In each lang, I stick to the main stream of that lang. > > >> Regarding comments: :-P I always comment first and then code. Helps me >> remember what I'm supposed to be doing! >> > > This is fine. Not a reason -per se- to keep the comments once the > coding is done :-) I find them annoying, considering that your code > is very clear, but is not a big deal. > > >> Also, as the Node class is (only >> slightly) conceptually abstract yet essential to the correct workings of >> a bot so I wanted to make sure anyone reading the code would have no >> doubt how it works. >> > > Good point. > > I was referring to things like: > # @children to contain the child nodes from this node > @children = Hash.new() > > I suspect that if somebody needs a comment to understand what the > @children of a Node class are, then s/he is reading the wrong > literature ;-) > > >> My usual commenting style is much more terse and I >> definitely subscribe to the self-commenting code school of thought. >> > > Great! > > >> Nevertheless, when working from a detailed specification (like the AIML >> standard) I usually include relevant details in the class documentation >> so it shows up in things like rdoc. >> > > I completely agree on this. I have never looked into it, but I think > that Ruby has a mechanism to merge the comment file and the code file > on the fly. > Of course this is only for the class comment. > > >> Concerning editors: on anything but Windows I use VI (vim) >> > > Me too! > > Now I wanted to begin doing some real work myself! > What I did is to rewrite your class up to the add_category method. > Nothing new from the functional point of view, only style. > At the add_category I stopped, in order to prepare a few comments and > open a discussion on style, OO, programming. > I have created a parallel file (play/nicholas/graphmaster/lib/node_mc.rb) > where I also attempt a "defence" of the equivalent method in the old > implementation. Using this technique (processing ourr code, like we > where lawyers), is supposed to help us in becoming better programmers. > > Of course this kind of detailed work is very "expensive", so if you > are not into this kind of things (I think you both are!), tell me and > I drop my coach attitude :-) > Very interesting is the point 5 in the file. I left it open for you to > have the first word on it. I really hope you like the game (and have > time to play it), > > Ciao, > Mauro > > From ntoll at ntoll.org Thu Oct 4 17:39:29 2007 From: ntoll at ntoll.org (Nicholas H.Tollervey) Date: Thu, 04 Oct 2007 22:39:29 +0100 Subject: [Aiml-programr-developers] New graphmaster "node" class completed In-Reply-To: References: <47039938.6030907@ntoll.org> Message-ID: <47055D91.7090505@ntoll.org> Guys, An Authors.txt file (or something similar) with our names, broadly what we do/did and a reference to a means of contacting us would be useful. E.g: John Smith (http://jsmith.com/contact) - I wrote and maintain the foo module and contributed to / refactored the bar class with Fred. My motivation is simply so third parties / new joiners with queries would know who to ask for particular things. Signing individual files is not really important - finding out who does/did what and why in a project certainly saves time (I speak from personal experience here :-) ...) Also, we need to decide on a license (GPL2/3?) - might I suggest we include a License.txt file containing appropriate information? Best wishes, Nicholas mauro at cicio.org wrote: > A topic aside. > I am not very keen in signing my code (I hardly feel there is anything > original in it), but I understand that this point of view is not > shared by everybody. > If signing files i s important to you, than probably we should come up > with a rule, for instance: > - A separate files with Credits > - Who creates the first edition of a file has his name on it > - The last Editor of a file has his name on it > - We have the core contributors name in all the files > - We have the names in the licence file only > - ... other ideas > > Your opinion? > > Mauro > _______________________________________________ > Aiml-programr-developers mailing list > Aiml-programr-developers at rubyforge.org > http://rubyforge.org/mailman/listinfo/aiml-programr-developers > > From mauro at cicio.org Fri Oct 5 03:38:52 2007 From: mauro at cicio.org (mauro at cicio.org) Date: Fri, 5 Oct 2007 09:38:52 +0200 Subject: [Aiml-programr-developers] New graphmaster "node" class completed In-Reply-To: <47055D91.7090505@ntoll.org> References: <47039938.6030907@ntoll.org> <47055D91.7090505@ntoll.org> Message-ID: About the licence, I am not an expert. I can only say that I prefer the 'F' over the 'O' in FOSS. I have spend a couple of days with Richard Stallman in one of his visits to Italy (I was the guy who can speak English...), and it was good to be even more committed for the 'F'. Which are the main differences between 2 and 3? Ciao, Mauro On 04/10/2007, Nicholas H.Tollervey wrote: > Guys, > > An Authors.txt file (or something similar) with our names, broadly what > we do/did and a reference to a means of contacting us would be useful. E.g: > > John Smith (http://jsmith.com/contact) - I wrote and maintain the foo > module and contributed to / refactored the bar class with Fred. > > My motivation is simply so third parties / new joiners with queries > would know who to ask for particular things. Signing individual files is > not really important - finding out who does/did what and why in a > project certainly saves time (I speak from personal experience here :-) ...) > > Also, we need to decide on a license (GPL2/3?) - might I suggest we > include a License.txt file containing appropriate information? > > Best wishes, > > Nicholas > > mauro at cicio.org wrote: > > A topic aside. > > I am not very keen in signing my code (I hardly feel there is anything > > original in it), but I understand that this point of view is not > > shared by everybody. > > If signing files i s important to you, than probably we should come up > > with a rule, for instance: > > - A separate files with Credits > > - Who creates the first edition of a file has his name on it > > - The last Editor of a file has his name on it > > - We have the core contributors name in all the files > > - We have the names in the licence file only > > - ... other ideas > > > > Your opinion? > > > > Mauro > > _______________________________________________ > > Aiml-programr-developers mailing list > > Aiml-programr-developers at rubyforge.org > > http://rubyforge.org/mailman/listinfo/aiml-programr-developers > > > > > > From mauro at cicio.org Fri Oct 5 04:37:18 2007 From: mauro at cicio.org (mauro at cicio.org) Date: Fri, 5 Oct 2007 10:37:18 +0200 Subject: [Aiml-programr-developers] New graphmaster "node" class completed In-Reply-To: <470556F9.4050204@ntoll.org> References: <47017965.3090108@ntoll.org> <470346B3.6010908@ntoll.org> <470556F9.4050204@ntoll.org> Message-ID: Micholas, > All sounds good to me. I like the idea of comparing old/new... that way > we can be certain that the code in the lib has earned its place... also > I like the opportunity to learn. :-) Me too! Honestly: I am very happy to have this pR coming back to life. The previous version was too much oriented to get the bare minimum to work (for Tiresia), and too little attention was therefore paied to my best love: clean design and good coding :-) Very happy to have professional developers to discuss this topics with. > I'll take an in-depth look at your new file / comments tomorrow during > lunch and will reply in depth very soon. Fine, > As I think I mentioned in a previous email, I'm intentionally not > looking at the "current" node class so we can do an untainted compare > and contrast. Good idea. Honestly, I don't even remember the old one.I think I have never seen some parts of it. But learning by contrast is a good thing for all of us, I fully agree. > However, I've obviously quickly skimmed through your new > file. I'm really going to enjoy this! :-) > Some quick points: I agree with using the metaphors as it makes the code > easier to understand - a good thing. Good... me too, as you know, even if sometimes I am lazy in looking for the good metaphores and I end up using "getters and setters" whic, of course, is better than a bad metaphore. > Also, seeing how you've refactored > my clunky Ruby is certainly an eye opener. Your Ruby is good, man! I have seen much worse code in a lot of plugins. Obviously you are a very good programmer, with an eye for neat code. My refactoring is only there because it is the fastest way to show some ideas on how we can take advantage of Ruby's features to develop a more concise, still very expressive, style. > Coming from C# (where there > is no obvious equivalent) just using the Array.shift method makes things > a whole lot easier. In addition, I like how "unless" is used to get rid > of pesky if...else. I am very glad of this. If you like this things, our collaboration will be very easy. > Finally, I think it important that we include some > means of referencing the origin of a template in the graphmaster as this > is extraordinarily useful when debugging AIML (see the "source" argument > in my add_category method). Right. Is there a class we might invent, that wraps all theis divverent parameters, so that the meaning of this class will make the code more readable? I mean: CleverName.source Ciao, Mauro From ntoll at ntoll.org Mon Oct 22 16:44:33 2007 From: ntoll at ntoll.org (Nicholas H.Tollervey) Date: Mon, 22 Oct 2007 21:44:33 +0100 Subject: [Aiml-programr-developers] New graphmaster "node" class completed In-Reply-To: References: <47017965.3090108@ntoll.org> <470346B3.6010908@ntoll.org> <470556F9.4050204@ntoll.org> Message-ID: <471D0BB1.6040508@ntoll.org> Guys, I've integrated Mauro's code back into my node class. Please take a look and comment. Now, I want to "refactor" what is currently the "evaluate" method now that I know about array.shift, other Rubyisms and guards. That we have a pretty extensive suite of tests should make this quite a lot of fun as stuff gets broken and put back together again. Nevertheless, I'd be interested to know how I might refactor "if...then" flow out of the evaluate method in an attempt to make the thing more Rubyesque (what a lovely word!) but I won't peek at the current version (as I'm determined to think this through and learn by doing rather than copying). Anyway, I'll be in touch very soon when I've had time to get something done (1-2 days). Best wishes, Nicholas mauro at cicio.org wrote: > Micholas, > > >> All sounds good to me. I like the idea of comparing old/new... that way >> we can be certain that the code in the lib has earned its place... also >> I like the opportunity to learn. :-) >> > > Me too! Honestly: I am very happy to have this pR coming back to life. > The previous version was too much oriented to get the bare minimum to > work (for Tiresia), and too little attention was therefore paied to my > best love: clean design and good coding :-) > Very happy to have professional developers to discuss this topics with. > > >> I'll take an in-depth look at your new file / comments tomorrow during >> lunch and will reply in depth very soon. >> > > Fine, > > >> As I think I mentioned in a previous email, I'm intentionally not >> looking at the "current" node class so we can do an untainted compare >> and contrast. >> > > Good idea. Honestly, I don't even remember the old one.I think I have > never seen some parts of it. But learning by contrast is a good thing > for all of us, I fully agree. > > >> However, I've obviously quickly skimmed through your new >> file. I'm really going to enjoy this! >> > > :-) > > >> Some quick points: I agree with using the metaphors as it makes the code >> easier to understand - a good thing. >> > > Good... me too, as you know, even if sometimes I am lazy in looking > for the good metaphores and I end up using "getters and setters" whic, > of course, is better than a bad metaphore. > > >> Also, seeing how you've refactored >> my clunky Ruby is certainly an eye opener. >> > > Your Ruby is good, man! I have seen much worse code in a lot of plugins. > Obviously you are a very good programmer, with an eye for neat code. > My refactoring is only there because it is the fastest way to show > some ideas on how we can take advantage of Ruby's features to develop > a more concise, still very expressive, style. > > >> Coming from C# (where there >> is no obvious equivalent) just using the Array.shift method makes things >> a whole lot easier. In addition, I like how "unless" is used to get rid >> of pesky if...else. >> > > I am very glad of this. If you like this things, our collaboration > will be very easy. > > >> Finally, I think it important that we include some >> means of referencing the origin of a template in the graphmaster as this >> is extraordinarily useful when debugging AIML (see the "source" argument >> in my add_category method). >> > > Right. Is there a class we might invent, that wraps all theis > divverent parameters, so that the meaning of this class will make the > code more readable? > I mean: CleverName.source > > Ciao, > Mauro > >