May 24, 2007
Wisss
No Comments
What a pity not to have much time to work on Wisss these weeks. But not working very much on it doesn’t mean that I don’t think to the project. I’ve stopped hopping to be ready to publish Wisss in the Acceleo farm 1.0 that’s why I must comit my big refactoring soon, even if it doesn’t work yet.
These days, I was thinking about workflow. Should classes provides “operators” like UML to define the actions you can make on an object (and thus provide an “action” menu like in Plone) ? I wanted to add for the first major version, or after, a workflow metamodel and this term of action was too restrictive to my mind. I’ve discussed with my colleague Régis (”The official egroupware workflow maintainer”
) to highlight notions and problems relative to workflow. It appears that classes should have operators which are invoked by workflow activities. I won’t explain each detail since a model is better than a long speech, so I will published the metamodel as soon as it’s done.
One of the biggest problems is the role and acl management. In a workflow, each activities is related to role to define who can see or change a state of the process. In my first try, I had included acl rules in the model, what I don’t want anymore (because it’s heavy and not enough flexible). The choice seems to tend to define roles in the model and set groups, users, roles’ rights and affectation of groups and users to roles in the administration part of the generated web application. I may change my mind and any ideas is welcome :-p
I’ve not yet talked about the problem of multiple edition (or any activities launch by more than one user at the same time) but it’s something which must be solved in the PHP code or in database, as soon as I can implement a kind of reliable mutex, so it’s a bit far from my concern for now.
May 3, 2007
Poker
No Comments
I’ve started to write a software to assist players when playing real parties. It aims to calculate probabilities when 2 or more players get all-in as we can see on TV. It will also manage a timer and the differents levels for the blinds.
I’ve not yet published the source but it’ll happen soon, I wait to have a first command line calculator which works. The main problem will be optimization.
In order to wait, I will explain the big lines of the algorithm.
I’ve left conditionnal probabilities for now since it seems awfull to write and really complex in term of calculation. What I forgot to say is that it shoult compute the result in real time (less thant 10 sec I would say).
My approach has been to compute all combinations of 5, 2 and 1 cards and to store it in files. Thus, when 2 players get all-in, I iterate on the 2 millions hands of 5 cards, add their 2 cards hand and compare which one win. A counter for each player is managed to know at the end of the iteration, what are the probabilities.
The first problem is to find quickly what is the kind of a hand (card high, pair, …) et next to find if a hand is better than another. To find the kind of the 7 cards hand, I start to check from the better combination (Royal Flush) to the worth. I choose this solution because you go less deep in each algorithm when it’s not validated. Beginning to check for pair will more often returns true without excluding to have a better hand, so you need to check for the better kind of hand. Now, it’s also right for some kinds of hands when you start from the higher. If your 7 cards don’t make a Royal Flush, they can be a Flush or Straight, but if they aren’t a neither a Flush nor a Straight, it can’t be a Royal Flush. It’s not a big problem to reverse the checks, so I will make my choice later.
The second problem is to compare two kinds of hand. For a human, it’s easy and quick to know that a Full House Ace on Ten is better than a Straight Ace High but for a computer, it requires a lot of comparison. That’s why I try to find the better binary representation of a hand to make a comparison between bits. That’s the problem I’m currently working on.
For now, the code is in Python, but I may switch to C++ if I can’t get real time computation. I’ve not yet run a computation so I’ve no idea if my way is good.
Any advice or interest are welcome 
May 3, 2007
Wisss
No Comments
With the release of Acceleo 2.0 and planet Acceleo, it’s time to open a new blog to write about my free projects, specially Wisss, a generator based on Acceleo/EMF/GMF/Eclipse to build PHP application.
Wisss stands for “Webapp is stupid, simple and secure” and we can consider that it provides three different subprojects. Wisss provides a metamodel wich defines what a web application is and allows to create a model quickly. It also provides a generator for Acceleo which generates the PHP and MySQL code corresponding to the model. Finally, it provides a MDE oriented PHP framework.
I’ve already made a first prototype but I’ve decided to restart from scratch as I better understand pittfalls of MDE and Acceleo. I want to make it easier and more flexible. Till now,Wisss is not yet ready to be tested, but it’ll be soon. I wait to have something useable before comitting all my changes.
You can see videos of the first prototype (creation of a blog engine) :
model creation
Site setup