pypentago-devel Mailing List for python pentago (Page 2)
Status: Pre-Alpha
Brought to you by:
segfaulthunter
You can subscribe to this list here.
| 2007 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(56) |
Jun
(38) |
Jul
(9) |
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Hardik M. <har...@gm...> - 2008-06-04 05:49:29
|
Hi, yes. I thought something like this but I didn't see any advantage so committed the simple structure we had before and its manager. If we need more complicated queries more often we will implement this. regards, Hardik On Wed, Jun 4, 2008 at 3:16 AM, J. Kovacs <ko...@fr...> wrote: > > After I have set up this annoying many-to-many relations > > So are you saying you would rather have > > Games ---- Games_to_Players ------- Players > > as the table structure? > > It seems like it would be more complicated, but I can see why you might > want to do that. > > If you think that is better then go ahead. > > > > > ------------------------------------------------------------------------- > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services for > just about anything Open Source. > http://sourceforge.net/services/buy/index.php > _______________________________________________ > Pypentago-devel mailing list > Pyp...@li... > https://lists.sourceforge.net/lists/listinfo/pypentago-devel > |
|
From: J. K. <ko...@fr...> - 2008-06-04 01:15:57
|
> After I have set up this annoying many-to-many relations So are you saying you would rather have Games ---- Games_to_Players ------- Players as the table structure? It seems like it would be more complicated, but I can see why you might want to do that. If you think that is better then go ahead. |
|
From: Hardik M. <har...@gm...> - 2008-06-03 20:35:57
|
Hi, I have committed the game_history bindings with queries I thought useful. If you miss a specific query please tell me I will implement it. I did not implement cascade delete yet. If we want it is not so difficult. regards, Hardik |
|
From: Hardik M. <har...@gm...> - 2008-06-03 20:35:54
|
Hi, I have committed the game_history bindings with queries I thought useful. If you miss a specific query please tell me I will implement it. I did not implement cascade delete yet. If we want it is not so difficult. regards, Hardik |
|
From: Hardik M. <har...@gm...> - 2008-06-03 18:56:46
|
Hi guys, Unit tests are actually meant to test a small, independent component. You should in no case write unit tests for a huge software project (these tests are called functional tests ) but divide that project into small independent (this is more important) components and test the behavior of those components. Apart from providing the safety-net while refactoring, writing first the unit tests and then developing the corresponding component improves the design of your project because you automatically modularize your project. Anyway, this is just my opinion. If we can refactor the code without unit tests, it would be good to avoid the overhead. regards, Hardik On Tue, Jun 3, 2008 at 6:59 PM, J. Kovacs <ko...@fr...> wrote: > I can see both sides of it. > > Unit testing is good and would be very professional. Plus it would be a > good chance for me to learn more about PyUnit and unit testing in general. > > but... > > It does also seem like a lot of extra work and perhaps overkill for this > sized project. > > Sorry I did not break the tie. > > > BTW, > http://svn.browsershots.org/trunk/devtools/pep8/pep8.py > is a source code checker to validate a file is in PEP8 format.(i think) > No idea if it works well or not, just a thought. > > > > > > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Pypentago-devel mailing list > Pyp...@li... > https://lists.sourceforge.net/lists/listinfo/pypentago-devel > |
|
From: Hardik M. <har...@gm...> - 2008-06-03 18:48:35
|
Hi J. Kovacs. The direction in which you are thinking is completely right. After I have set up this annoying many-to-many relations between GameHistory and Players, I wanted to ask you this question about How you would like to use GameHistoryManager, if we would create one. While your arguments are completely right as far as the storing the GameHistory or in your words, the functionality of report_game() method goes. But I have a few questions 1. Are we going to need queries like how many games a given player won or 2. With which player has a given player won maximum games ? 3. Or as simple as which games were played by a given player (can be as p1 as well p2) ? If we are going to need these queries it would be good to have a Manager class for GameHistory. Moreover you can create GameLogger class which calls the save_game method of GameHistoryManager class. I want to give the general interface to all the tables so the interface can be extended at anytime to implement more queries or other functionality. Yesterday, I was sick and today I had to work. So only now I am able to work on the GameHistory table. But if everything goes well, I will be able to commit at least the initial version tonight. You are in no way stepping on my toes, so feel free to create the GameLogger class. Though if it should be in GameManager module or not is a question. If it would be Java I would say no, because it has more to do with Game logic than database. regards, Hardik On Tue, Jun 3, 2008 at 8:02 PM, J. Kovacs <ko...@fr...> wrote: > Hi all, > > Does it make sense to create a GameHistoryManager.py file kind of like the > PlayerManager? > > > I'm wondering if that is where the Game Logging code will go. > > I picture at the end of the game, the server, after detecting the win > condition calls a "report_game" method; not sure if my format is correct > there. > > If I'm right, the GameHistoryManager.report_game() method > would have a couple goals: > > #1 - Log the game > Log the Game into the game history table. > > #2 - Update the current_rating of both players > Get previous game history for player 1 > Build it into a list L > Pass list to glicko2 function > rc = RatingCalculator() #create the rating calculator object > result = rc.CalculateNewRating( L, current_volatility, current_RD) > #I think the Glicko code is close to working, if given proper input. > Use returned list to save the new rating of the player back to Players > table (probably using PlayerManager, right?) > Repeat for player 2 > > > Well, just wanted to get my thoughts down here. > (I think the above makes the 2 public methods of Glicko2.py obsolete) > > > Lets create a Gna Task if GameHistoryManager.py makes sense. > Maybe I am just rushing things, if so, then disregard. > > I will be happy to work on something like that if it makes sense. > Florian and I discussed doing a GameLog class, but Maybe it makes more > sense in the /db/GameHistoryManager file. If there are no objections, I > will begin working on this; however, if I am stepping on your toes > Hardik, let me know and I will hold off and work on glicko-cleanup > instead. > > Let me know. > Thanks for your continued good communication. > > Kovacs > > > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Pypentago-devel mailing list > Pyp...@li... > https://lists.sourceforge.net/lists/listinfo/pypentago-devel > |
|
From: J. K. <ko...@fr...> - 2008-06-03 18:06:16
|
Have a read at: http://kovacs.wordpress.com/2008/06/01/pentago-permission-letter/ sound okay? Too lengthy? Remove the part about client/server? (i.e. PyPentago) |
|
From: J. K. <ko...@fr...> - 2008-06-03 18:02:54
|
Hi all,
Does it make sense to create a GameHistoryManager.py file kind of like the
PlayerManager?
I'm wondering if that is where the Game Logging code will go.
I picture at the end of the game, the server, after detecting the win
condition calls a "report_game" method; not sure if my format is correct
there.
If I'm right, the GameHistoryManager.report_game() method
would have a couple goals:
#1 - Log the game
Log the Game into the game history table.
#2 - Update the current_rating of both players
Get previous game history for player 1
Build it into a list L
Pass list to glicko2 function
rc = RatingCalculator() #create the rating calculator object
result = rc.CalculateNewRating( L, current_volatility, current_RD)
#I think the Glicko code is close to working, if given proper input.
Use returned list to save the new rating of the player back to Players
table (probably using PlayerManager, right?)
Repeat for player 2
Well, just wanted to get my thoughts down here.
(I think the above makes the 2 public methods of Glicko2.py obsolete)
Lets create a Gna Task if GameHistoryManager.py makes sense.
Maybe I am just rushing things, if so, then disregard.
I will be happy to work on something like that if it makes sense.
Florian and I discussed doing a GameLog class, but Maybe it makes more
sense in the /db/GameHistoryManager file. If there are no objections, I
will begin working on this; however, if I am stepping on your toes
Hardik, let me know and I will hold off and work on glicko-cleanup
instead.
Let me know.
Thanks for your continued good communication.
Kovacs
|
|
From: J. K. <ko...@fr...> - 2008-06-03 17:00:16
|
I can see both sides of it. Unit testing is good and would be very professional. Plus it would be a good chance for me to learn more about PyUnit and unit testing in general. but... It does also seem like a lot of extra work and perhaps overkill for this sized project. Sorry I did not break the tie. BTW, http://svn.browsershots.org/trunk/devtools/pep8/pep8.py is a source code checker to validate a file is in PEP8 format.(i think) No idea if it works well or not, just a thought. |
|
From: Florian M. <flo...@ai...> - 2008-06-03 12:06:09
|
Hardik Mehta wrote: > Hi, > > I think converting itself using regex is not a big deal, but in this process > you may break something, e.g a similarly named variable and because we don't > have unittest coverage, there is no guarantee that everything is working as > it was before the style change. > > I don't have much idea about the code in other modules than db, but if you > think something may get broken after the style change you can develop unit > tests to test those parts before the change and the tests should pass after > the change. This is sort of a guarantee that you will not break anything. > > regards, > Hardik I think unittest are a bit over the top as the current features are easily testable by just playing a test game and watching for exceptions. Florian Mayer |
|
From: Hardik M. <har...@gm...> - 2008-06-03 11:59:28
|
Hi, I think converting itself using regex is not a big deal, but in this process you may break something, e.g a similarly named variable and because we don't have unittest coverage, there is no guarantee that everything is working as it was before the style change. I don't have much idea about the code in other modules than db, but if you think something may get broken after the style change you can develop unit tests to test those parts before the change and the tests should pass after the change. This is sort of a guarantee that you will not break anything. regards, Hardik On Mon, Jun 2, 2008 at 10:03 PM, Florian Mayer <flo...@ai...> wrote: > I have just converted server/connection.py into PEP8 style for your > review: http://paste.pocoo.org/show/60142/ > I am not completely sure if this is better anymore, maybe I just need to > get used to it. > > Florian Mayer > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Pypentago-devel mailing list > Pyp...@li... > https://lists.sourceforge.net/lists/listinfo/pypentago-devel > |
|
From: Florian M. <flo...@ai...> - 2008-06-02 18:04:05
|
I have just converted server/connection.py into PEP8 style for your review: http://paste.pocoo.org/show/60142/ I am not completely sure if this is better anymore, maybe I just need to get used to it. Florian Mayer |
|
From: Florian M. <flo...@ai...> - 2008-06-02 17:52:58
|
J. Kovacs wrote: > I think I like PEP8 because of its standard-python-ness. > > Seems like it would be pretty major to go through and convert it all to > PEP8, but I'm willing to work on that if it will help out. I do not think it is so hard to do with the possibilities regex and search&replace offer to us. I think it would take me a day or two to convert the whole source, but that's only an estimate. > There will be a lot of problems, and it will probably break our existing > (working playable) version for awhile until all the bugs get worked out. > Am I wrong about the amount of effort involved? I hope you are. I will think about if it is worth the effort, but I think most modules(especially the server) will be converted pretty fast. Florian Mayer |
|
From: J. K. <ko...@fr...> - 2008-06-02 17:05:14
|
> So I added the winner_id in a way that it will be p1_id or p2_id or > None(empty) in case of a draw. I think you will agree with this. Yes, good idea! > Now I have some other questions about the GameHistory table. > > I think that the rating, RD and volatility of both the players you store > in > GameHistory table are the values at the time of creation of the > GameHistory > e.g. when they were playing the game. They will not change with the > player's > current rating, RD and volatility. > > Am I right ? You are correct. |
|
From: J. K. <ko...@fr...> - 2008-06-02 17:05:01
|
I think I like PEP8 because of its standard-python-ness. Seems like it would be pretty major to go through and convert it all to PEP8, but I'm willing to work on that if it will help out. There will be a lot of problems, and it will probably break our existing (working playable) version for awhile until all the bugs get worked out. Am I wrong about the amount of effort involved? |
|
From: Florian M. <flo...@ai...> - 2008-06-02 15:35:29
|
Hello. I have been thinking that maybe we should introduce a code style convention, so the source code is easier to read due to being uniform. On the other hand, it may be better if every one can use his own style so it is easier to develop for him. If we agree on making a convention, there are three proposals that are possible. One would be PEP8, the Python styleguide, compatibility and the other two would be adapting the style of the modules we are using, namely Twisted or wxPython. I think PEP8 has several advantages beside being the official Python style. The first is, because our external modules are *not* compatible to PEP8 we would never fall into naming issues overwriting their methods, of course this cannot be applied to class names, as they are the same in every of those three. The other would be that every Python developer should be able to read our code pretty well, as most of them have read the PEP8. Also I think the style is really clear and easy to read, but that is just my opinion. In this style, methods and functions have the same convention, but it is easy to tell from those two because methods have self as their first attribute. The Twisted style is the one I am using at the moment, because I somehow got used to it. There is not much difference between it and the PEP8, besides the convention for the method names. The advantage would be that the code looks uniform to the Twisted methods that we import, but then it does not fit the wxPython ones either. I personally like to name functions PEP8 style when using this, thus it is methodName but function_name, but this is subject to changes. Last and, for me, least the wxPython style. It is in fact C++ style as wxWidgets is C++ and wxPython is just a wrapper for it, thus not changing the naming convention. I like it least because with it it is hard to tell whether something is a class, method or function. It is actually pretty near to the Java style, something you might like. Just look at the code samples below to see which one you like best. If you do not like the idea of a code style convention, feel free to say that too. [1] PEP8: http://paste.pocoo.org/show/59160/ [2] Twisted: http://paste.pocoo.org/show/60063/ [3] wxPython: http://paste.pocoo.org/show/60064/ |
|
From: Florian M. <flo...@ai...> - 2008-06-02 14:36:33
|
I have found out that wxPython 2.8 is available for Debian based systems trough backports in experimental. You can get it here: http://packages.debian.org/experimental/python-wxgtk2.8 As I do not have a Debian based system, I cannot say how stable this version is. Best regards, Florian Mayer |
|
From: Florian M. <flo...@ai...> - 2008-06-02 12:06:44
|
I have just enabled so that the reply to header is modified to point at the list, because of the high amount of replies that are made directly to the sender. >From now on, all the time you click "Reply" for a mail to the mailing list, it will go to it too, be sure to not post anything confidential or personal that way. Best regards, Florian Mayer |
|
From: Hardik M. <har...@gm...> - 2008-06-02 12:02:10
|
> > I meant Kovacs not responding to the list but rather directly to you, > that's what I meant. It's frustrating seeing you quoting Kovacs, while > not seeing his mail. > Sorry if I did not make clear what I meant. This is because we don't have the reply-to property set for the list. Naturally somebody replies and the reply goes to sender and not the list. No offenses I was just surprised to see that how a discussion about db design can be private On Mon, Jun 2, 2008 at 3:59 PM, Florian Mayer <flo...@ai...> wrote: > Hardik Mehta wrote: > > > Hi > > > > > > Please keep all the discussion to the *Sorceforge* mailing list. And > >> >> please keep the discussion *to* the mailing list, not fork them into > >> >> rivate responses, if not necessary. > > > > > > > > > where do you see here private discussion ? Did I ask anybody for a > date or > > > something ? > I meant Kovacs not responding to the list but rather directly to you, > that's what I meant. It's frustrating seeing you quoting Kovacs, while > not seeing his mail. > Sorry if I did not make clear what I meant. > > Florian Mayer > > PS: Argh I am a jerk, now I did the same thing. Sorry :) > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Pypentago-devel mailing list > Pyp...@li... > https://lists.sourceforge.net/lists/listinfo/pypentago-devel > |
|
From: Florian M. <flo...@ai...> - 2008-06-02 12:00:35
|
Hardik Mehta wrote: > > Hi > > > > Please keep all the discussion to the *Sorceforge* mailing list. And >> >> please keep the discussion *to* the mailing list, not fork them into >> >> rivate responses, if not necessary. > > > > > > where do you see here private discussion ? Did I ask anybody for a date or > > something ? I meant Kovacs not responding to the list but rather directly to you, that's what I meant. It's frustrating seeing you quoting Kovacs, while not seeing his mail. Sorry if I did not make clear what I meant. Florian Mayer PS: Argh I am a jerk, now I did the same thing. Sorry :) |
|
From: Hardik M. <har...@gm...> - 2008-06-02 11:55:10
|
Hi Please keep all the discussion to the *Sorceforge* mailing list. And > please keep the discussion *to* the mailing list, not fork them into > rivate responses, if not necessary. where do you see here private discussion ? Did I ask anybody for a date or something ? > > As soon as I get response from Gna! on why I can't send to the mailing > list and I fix it, we'll reactivate the Gna! one, until then I will > disable it to avoid confusion. Disable the list, as I see both the list are working for me. I post to both the list to make sure everybody gets it. I am not sure who is reading which list.. regards, Hardik > > Florian Mayer > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Pypentago-devel mailing list > Pyp...@li... > https://lists.sourceforge.net/lists/listinfo/pypentago-devel > |
|
From: Florian M. <flo...@ai...> - 2008-06-02 11:21:04
|
Hardik Mehta wrote: >> Good question. >> I was going to assume that the winner of the game was always p1. >> But I think I like your direction better. A new field for "winner_id" or >> something? > > > Hi the idea of p1_id being the winner_id is good, saves a field but what > about the condition when it is a draw ? > > So I added the winner_id in a way that it will be p1_id or p2_id or > None(empty) in case of a draw. I think you will agree with this. > > Now I have some other questions about the GameHistory table. > > I think that the rating, RD and volatility of both the players you store in > GameHistory table are the values at the time of creation of the GameHistory > e.g. when they were playing the game. They will not change with the player's > current rating, RD and volatility. > > Am I right ? > > And yes, there will be Foreign keys p1_id and p2_id and also the winner_id. > > > > > > > >> >> >>> 3. I added real_name to the Player structure instead of adding firstname >> Sounds good! >> >> >> >>> 4. Are we not going to need an Email id for the registration process ? If >>> yes, should I add it ? >> Yes, yes! >> >> >> (We have not actually discussed this, but maybe we just all assumed email >> address would be in there.) >> >> In fact, maybe we should look at another open source DB structure and make >> sure we aren't forgetting other fields needed in the Players table. >> >> A "player_avatar" image blob also sounds potentially useful... >> >> Thanks, >> >> Kovacs >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > > > ------------------------------------------------------------------------ > > _______________________________________________ > Pypentago-devel mailing list > Pyp...@li... > https://lists.sourceforge.net/lists/listinfo/pypentago-devel Please keep all the discussion to the *Sorceforge* mailing list. And please keep the discussion *to* the mailing list, not fork them into private responses, if not necessary. As soon as I get response from Gna! on why I can't send to the mailing list and I fix it, we'll reactivate the Gna! one, until then I will disable it to avoid confusion. Florian Mayer |
|
From: Hardik M. <har...@gm...> - 2008-06-01 21:07:44
|
> > Good question. > I was going to assume that the winner of the game was always p1. > But I think I like your direction better. A new field for "winner_id" or > something? Hi the idea of p1_id being the winner_id is good, saves a field but what about the condition when it is a draw ? So I added the winner_id in a way that it will be p1_id or p2_id or None(empty) in case of a draw. I think you will agree with this. Now I have some other questions about the GameHistory table. I think that the rating, RD and volatility of both the players you store in GameHistory table are the values at the time of creation of the GameHistory e.g. when they were playing the game. They will not change with the player's current rating, RD and volatility. Am I right ? And yes, there will be Foreign keys p1_id and p2_id and also the winner_id. > > > > > 3. I added real_name to the Player structure instead of adding firstname > > Sounds good! > > > > > 4. Are we not going to need an Email id for the registration process ? If > > yes, should I add it ? > > Yes, yes! > > > (We have not actually discussed this, but maybe we just all assumed email > address would be in there.) > > In fact, maybe we should look at another open source DB structure and make > sure we aren't forgetting other fields needed in the Players table. > > A "player_avatar" image blob also sounds potentially useful... > > Thanks, > > Kovacs > > > > > > > > > > > > > > > |
|
From: Hardik M. <har...@gm...> - 2008-05-31 22:54:18
|
Hi guys, I committed the part of db code that is working only for players table yet, but for GameHistory , most of the code can be used as boiler plate. You may find my coding style bad (it is Java in python syntax) so feel free to correct. I also added a small unittest, so if you refactor make sure that the unittest passes. regards, Hardik |
|
From: J. K. <ko...@fr...> - 2008-05-30 22:33:14
|
> 1. What is the pgn_string field in GameHistory for if it is not the > player_name of the winner I would like to store all the moves of the game in string format in that field. The field would use the PGN (portable game notation) that we agreed upon a ways back in the mailing list, which I think was: For example, a chess game can be represented in PGN format: such as: 1. e4 c5 2. Nf3 d6 3. Bb5+ Bd7 ......... [potentially long string, but for us it will be much shorter!] So, for a pypentago PGN, once the game is over, we might have a full string 1. a1,al b1,ar 2. b1,dl d2,dr ........ That is what I intended the gamehistory.pgn_string field for. > 2. If the above field is not the player_id of the winner, Shouldn't it be > there in the game history somewhere ? Good question. I was going to assume that the winner of the game was always p1. But I think I like your direction better. A new field for "winner_id" or something? > 3. I added real_name to the Player structure instead of adding firstname Sounds good! > 4. Are we not going to need an Email id for the registration process ? If > yes, should I add it ? Yes, yes! (We have not actually discussed this, but maybe we just all assumed email address would be in there.) In fact, maybe we should look at another open source DB structure and make sure we aren't forgetting other fields needed in the Players table. A "player_avatar" image blob also sounds potentially useful... Thanks, Kovacs |