Two Plus Two Newer Archives  

Go Back   Two Plus Two Newer Archives > Internet Gambling > Software
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #81  
Old 08-01-2007, 05:53 PM
OrcaDK OrcaDK is offline
Senior Member
 
Join Date: Nov 2004
Location: MTH
Posts: 1,496
Default Re: Poker Hand XML

[ QUOTE ]
@OrcaDK
The choice to express card values as a string which may contain more than one card, is makes the xml easier to read for humans, and when parsing the xml is also fairly trivial.

But you do have a point with regards to XPath expressions, so, and to satisfy that I think every card should be expressed like so

<cards (other attributes...)>
<card value="a" suit="h" >
<card value="9" suit="c" >
</cards>

[/ QUOTE ]

While it may be more readable for humans, I really don't think that's an issue. We're not making a standard for humans to read this XML after all, are we?

The meaning for this standard would be for us to write hand parsers which all parsed the hand histories into the XML format directly, thus making it a lot easier for people to create hand history displayers, either web or application based.

The only ones who would really read the XML are the developers, and they wouldn't care much about the readability (within reason, of course).

I'm not sure splitting up the suit is necessary, after all Ac is not the same as Ah, they're two different cards. But on this point I'm open for discussion [img]/images/graemlins/smile.gif[/img]
Reply With Quote
  #82  
Old 08-01-2007, 06:01 PM
bengele bengele is offline
Senior Member
 
Join Date: Dec 2004
Posts: 200
Default Re: Poker Hand XML

[ QUOTE ]
I'm not sure splitting up the suit is necessary, after all Ac is not the same as Ah, they're two different cards. But on this point I'm open for discussion [img]/images/graemlins/smile.gif[/img]

[/ QUOTE ]

I think that you could argue that in razz Ac and Ah are equal.
Reply With Quote
  #83  
Old 08-01-2007, 06:10 PM
OrcaDK OrcaDK is offline
Senior Member
 
Join Date: Nov 2004
Location: MTH
Posts: 1,496
Default Re: Poker Hand XML

[ QUOTE ]
[ QUOTE ]
I'm not sure splitting up the suit is necessary, after all Ac is not the same as Ah, they're two different cards. But on this point I'm open for discussion [img]/images/graemlins/smile.gif[/img]

[/ QUOTE ]

I think that you could argue that in razz Ac and Ah are equal.

[/ QUOTE ]

Value-wise yes, but they're still individual cards of the deck.
Reply With Quote
  #84  
Old 08-01-2007, 06:11 PM
MuppetBingo MuppetBingo is offline
Member
 
Join Date: Apr 2007
Posts: 31
Default Re: Poker Hand XML

Here's another pass,

* put <antes> block back in
* made the cards-block more explicit, with a <card> per card (as OrcaDK suggested)
* removed playerId and mucked attributes on <cards>, and moved them to <hand>
* made new <deal> block with open-attribute and playerId-attribute, to make showdown <cards> more consistent. The name deal is a bit awkward, but it expresses that one or more cards has been handed to a player or the community, and that the cards are either open or closed.

Version 1.3
<font class="small">Code:</font><hr /><pre>
&lt;?xml version="1.0"?&gt;
&lt;pokerhand id="11082740019" timestamp="2007-07-31 11:21:43"&gt;
&lt;context&gt;
&lt;location online="true"&gt;
&lt;room name="Absolute Poker"/&gt;
&lt;table id="562102981" name="Denmark Dr." seats="10"/&gt;
&lt;/location&gt;
&lt;!-- betting-types=nolimit, potlimit or limit --&gt;
&lt;game type="texasholdem" format="tournament" bettingtype="nolimit" currency="USD"&gt;
&lt;!-- only use either tournament or cashgame tag --&gt;
&lt;tournament buyin="10" vig="1" id="56210298"/&gt;
&lt;!-- we need both stakes and max buyin I guess? --&gt;
&lt;cashgame maxbuyin="400" bigblind="2"/&gt;
&lt;/game&gt;
&lt;players&gt;
&lt;!-- active is required, every active player takes part in this hand, ie. pays ante and recieves cards --&gt;
&lt;player id="MuppetBingo" stack="1500" seat="1" active="true"/&gt;
&lt;player id="KermitIsGreen" stack="1500" seat="4" active="true"/&gt;
&lt;player id="Animal" stack="1500" seat="5" active="true"/&gt;
&lt;/players&gt;
&lt;/context&gt;
&lt;rounds&gt;
&lt;!-- antes is optional --&gt;
&lt;antes&gt;
&lt;ante playerId="MuppetBingo" amount="2"/&gt;
&lt;ante playerId="KermitIsGreen" amount="2"/&gt;
&lt;ante playerId="Animal" amount="2"/&gt;
&lt;/antes&gt;
&lt;!-- a round is a deal of cards followed by a sequence of player actions --&gt;
&lt;!-- possible round types are "preflop", "flop","turn", "river" --&gt;
&lt;round id="preflop"&gt;
&lt;!-- in 7 card stud deal will be a sequence of &lt;cards&gt; for each player, in texas-style games it will only contain 1 element --&gt;
&lt;deals&gt;
&lt;!-- open means whether the cards are visible to all. In stud there can be open non-community cards --&gt;
&lt;deal playerId="MuppetBingo" open="false"&gt;
&lt;cards&gt;
&lt;card value="a" suit="c"/&gt;
&lt;card value="a" suit="d"/&gt;
&lt;/cards&gt;
&lt;/deal&gt;
&lt;/deals&gt;
&lt;!-- actions can be &lt;bet&gt; &lt;call&gt; , &lt;fold&gt; --&gt;
&lt;actions&gt;
&lt;!-- amount is optional, --&gt;
&lt;!-- forced is optional and if omitted, will default to "false" --&gt;
&lt;!-- possible types=bet, call, check or fold. --&gt;
&lt;!-- name is optional, possible values = straddle, smallblind and bigblind --&gt;
&lt;action type="bet" playerId="MuppetBingo" forced="true" name="smallblind" amount="10"/&gt;
&lt;action type="bet" playerId="KermitIsGreen" forced="true" name="bigblind" amount="20"/&gt;
&lt;action type="bet" playerId="Animal" forced="false" name="straddle" amount="40"/&gt;
&lt;action type="bet" playerId="MuppetBingo" amount="10"/&gt;
&lt;action type="bet" playerId="KermitIsGreen" amount="30"/&gt;
&lt;action type="call" playerId="Animal" amount="30"/&gt;
&lt;action type="call" playerId="MuppetBIngo" amount="20"/&gt;
&lt;/actions&gt;
&lt;/round&gt;
&lt;round id="flop"&gt;
&lt;deals&gt;
&lt;!-- playerId is optional, and if not present it means the cards are community cards --&gt;
&lt;deal open="true"&gt;
&lt;cards&gt;
&lt;card value="7" suit="c"/&gt;
&lt;card value="2" suit="s"/&gt;
&lt;card value="q" suit="h"/&gt;
&lt;/cards&gt;
&lt;/deal&gt;
&lt;/deals&gt;
&lt;actions&gt;
&lt;action type="check" playerId="MuppetBingo"/&gt;
&lt;action type="bet" playerId="KermitIsGreen" amount="50"/&gt;
&lt;action type="fold" playerId="Animal"/&gt;
&lt;action type="call" playerId="MuppetBIngo" amount="50"/&gt;
&lt;/actions&gt;
&lt;/round&gt;
&lt;round id="turn"&gt;
&lt;deals&gt;
&lt;deal open="true"&gt;
&lt;cards&gt;
&lt;card value="9" suit="h"/&gt;
&lt;/cards&gt;
&lt;/deal&gt;
&lt;/deals&gt;
&lt;actions&gt;
&lt;action type="check" playerId="MuppetBingo"/&gt;
&lt;action type="check" playerId="KermitIsGreen"/&gt;
&lt;/actions&gt;
&lt;/round&gt;
&lt;round id="river"&gt;
&lt;deals&gt;
&lt;deal open="true"&gt;
&lt;cards&gt;
&lt;card value="k" suit="c"/&gt;
&lt;/cards&gt;
&lt;/deal&gt;
&lt;/deals&gt;
&lt;actions&gt;
&lt;action type="check" playerId="MuppetBingo"/&gt;
&lt;action type="check" playerId="KermitIsGreen"/&gt;
&lt;/actions&gt;
&lt;/round&gt;
&lt;/rounds&gt;
&lt;result&gt;
&lt;hands&gt;
&lt;!-- mucked attribute is optional and has default value="false", cards is optional --&gt;
&lt;hand playerId="MuppetBingo" mucked="false"&gt;
&lt;cards&gt;
&lt;card value="a" suit="c"/&gt;
&lt;card value="a" suit="d"/&gt;
&lt;/cards&gt;
&lt;/hand&gt;
&lt;hand playerId="KermitIsGreen" mucked="false"&gt;
&lt;cards&gt;
&lt;card value="a" suit="s"/&gt;
&lt;card value="k" suit="s"/&gt;
&lt;/cards&gt;
&lt;/hand&gt;
&lt;hand playerId="Animal" mucked="true"/&gt;
&lt;/hands&gt;
&lt;!-- rake is optional --&gt;
&lt;pots value="278.5" rake="1.5"&gt;
&lt;pot number="1" value="278.5"&gt;
&lt;winners&gt;
&lt;!-- for split pots, this will contain multiple winners --&gt;
&lt;winner playerId="MuppetBingo" amount="278.5"&gt;
&lt;hand&gt;
&lt;cards&gt;
&lt;card value="a" suit="c"/&gt;
&lt;card value="a" suit="d"/&gt;
&lt;card value="q" suit="h"/&gt;
&lt;card value="k" suit="c"/&gt;
&lt;card value="9" suit="h"/&gt;
&lt;/cards&gt;
&lt;/hand&gt;
&lt;/winner&gt;
&lt;/winners&gt;
&lt;/pot&gt;
&lt;/pots&gt;
&lt;/result&gt;
&lt;/pokerhand&gt;
</pre><hr />
Reply With Quote
  #85  
Old 08-01-2007, 06:16 PM
Shoe Lace Shoe Lace is offline
Senior Member
 
Join Date: Sep 2004
Posts: 585
Default Re: Poker Hand XML

[ QUOTE ]
I think every card should be expressed like so
&lt;cards (other attributes...)&gt;
&lt;card value="a" suit="h" &gt;
&lt;card value="9" suit="c" &gt;
&lt;/cards&gt;


[/ QUOTE ]

As a developer of a web parsing script what would you rather do:

Find an attribute which is stored as "Ac Ah". Split it by a common delimiter (in our case a space char), and replace the suit letter with a link to an image. Amount of cards do not require extra work.

or...

Find an element that contains x amount of child elements. Loop through x child elements and read their values + any extra data associated with them through attributes. Finally, reconstruct the results to display them in a format that's commonly accepted (Flop: Ah Kc Jc).
Reply With Quote
  #86  
Old 08-01-2007, 06:20 PM
MuppetBingo MuppetBingo is offline
Member
 
Join Date: Apr 2007
Posts: 31
Default Re: Poker Hand XML

[ QUOTE ]

I'm not sure splitting up the suit is necessary, after all Ac is not the same as Ah, they're two different cards. But on this point I'm open for discussion [img]/images/graemlins/smile.gif[/img]


[/ QUOTE ]

Well while we're making a seperate &lt;card&gt; per card, we might as well, but that's not a big issue for me either.
Reply With Quote
  #87  
Old 08-01-2007, 06:21 PM
OrcaDK OrcaDK is offline
Senior Member
 
Join Date: Nov 2004
Location: MTH
Posts: 1,496
Default Re: Poker Hand XML

[ QUOTE ]
[ QUOTE ]
I think every card should be expressed like so
&lt;cards (other attributes...)&gt;
&lt;card value="a" suit="h" &gt;
&lt;card value="9" suit="c" &gt;
&lt;/cards&gt;


[/ QUOTE ]

As a developer of a web parsing script what would you rather do:

Find an attribute which is stored as "Ac Ah". Split it by a common delimiter (in our case a space char), and replace the suit letter with a link to an image. Amount of cards do not require extra work.

or...

Find an element that contains x amount of child elements. Loop through x child elements and read their values + any extra data associated with them through attributes. Finally, reconstruct the results to display them in a format that's commonly accepted (Flop: Ah Kc Jc).

[/ QUOTE ]

I really don't think it makes much difference. The primary difference being that you would have to write custom code to do the splitting, instead of simply using native XML functions to retrieve all card elements and loop them - just like you would loop the split array.

With that not being an issue, will you not agree with me that for querying, splitting up the cards is a lot more efficient?
Reply With Quote
  #88  
Old 08-01-2007, 07:01 PM
Shoe Lace Shoe Lace is offline
Senior Member
 
Join Date: Sep 2004
Posts: 585
Default Re: Poker Hand XML

[ QUOTE ]
With that not being an issue, will you not agree with me that for querying, splitting up the cards is a lot more efficient?

[/ QUOTE ]

It's unlikely it would be much more efficient. Let's face it, no matter what you do some code is going to have to be executed to parse it.

You might as well use the format that's easier to read and uses up less space.
Reply With Quote
  #89  
Old 08-01-2007, 07:08 PM
OrcaDK OrcaDK is offline
Senior Member
 
Join Date: Nov 2004
Location: MTH
Posts: 1,496
Default Re: Poker Hand XML

[ QUOTE ]
[ QUOTE ]
With that not being an issue, will you not agree with me that for querying, splitting up the cards is a lot more efficient?

[/ QUOTE ]

It's unlikely it would be much more efficient. Let's face it, no matter what you do some code is going to have to be executed to parse it.

You might as well use the format that's easier to read and uses up less space.

[/ QUOTE ]

So you're saying that querying a database containing all cards in a single column in the form "Ac 8c 9h" is just as simple as normalizing the database, splitting the cards into their own table, each to their own row, and thus enabling a much more efficient data storage, as well as allowing a much greater querying capability? That is exactly what this discussion is about, in database related format.

&lt;hand cards="Ac 8d 9h" /&gt;

&lt;hand&gt;
&lt;card value="Ac"/&gt;
&lt;card value="8d"/&gt;
&lt;card value="9h"/&gt;
&lt;/hand&gt;

Please write me an XPath expression that selects these hand elements if they contain the card "8d".

Also, please write me an XSD and DTD validation scheme for these elements as well. Validation is the number one most important element if any XML standard is to be made, and if a functional and fast validation cannot be made, the standard is worthless.

There are so many advantages to the splitting of the cards. I can see no other advantages of concatenation other than making it more human readable, but proposing that as an argument is inherently flawed since the primary reason for creating a standardized XML format is to make machine based interchangeability more easy, not the make it more readable by humans.
Reply With Quote
  #90  
Old 08-01-2007, 07:27 PM
Shoe Lace Shoe Lace is offline
Senior Member
 
Join Date: Sep 2004
Posts: 585
Default Re: Poker Hand XML

I will answer your questions with 1 simple question:
In both examples which data type will the "8d" validate to?

[ QUOTE ]
the primary reason for creating a standardized XML format is to make machine based interchangeability more easy, not the make it more readable by humans.

[/ QUOTE ]

This I agree with. Which makes me wonder why some of the examples posted here have like half a dozen nested elements and includes information that the hand analyzer should be in charge of.

To me a hand history is a way to store a hand, nothing else. It's telling a story. The hand analyzer should be the tool that fills in the details and allows us to investigate the story piece by piece.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 03:59 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.