Azərbaycan dili Bahasa Indonesia Bosanski Català Čeština Dansk Deutsch Eesti English Español Français Galego Hrvatski Italiano Latviešu Lietuvių Magyar Malti Mакедонски Nederlands Norsk Polski Português Português BR Românã Slovenčina Srpski Suomi Svenska Tiếng Việt Türkçe Ελληνικά Български Русский Українська Հայերեն ქართული ენა 中文
Subpage under development, new version coming soon!

Subject: »news XML Data Improvements

2007-02-14 05:34:02
The data is not useless.

See for example this match

The value given in timePossession tag for Charrúa Roots (my team) is 30642

This value represents possession (49%)... my part of the overall time played.

As you have noticed, if you sum all the values of the timePlaying tag of all the players of your team, you will get this same value (in my case, again 30642).

This means that the "Off. %" for each player of your team represents the weight of your player in the overall offensive (possessing) activity of your team. This is usefull data.

On the other hand, the sum of all the timeDefending tags of my players is 12152. The "Def. %" of each of my players represents their weight in the overall defensive activity of my team. This is also usefull data.

For example you can get from this data important information such as from what side of the field you where more frequently attacked.
2007-02-14 05:47:43
I said it is useless on its own.
In order for it to be useful you must have all other data and add it up.
So, in order to get the def % for my player X, I need to get from my DB the timeDefending for him and all the other players that played in that match. For that, I need to get the match data from DB, filter it to get the players of X's team and then do the above :S
VERY INEFFICIENT!!!
why isn't the data given as already calculated??
(edited)
2007-02-14 12:00:33
agree with Danny. This will cause an useless overload on the server due to the download action and, moreover, in this way sokker saves some space on DB but waste cpu just to show every time the calculation. IMHO this doesn't sounds right...
2007-02-14 17:14:10
Uhm, you already have to download each player if you're showing % for players anyway. Now you just have an extra step at the end - it's not server related...

UPDATE T_Match_PlayerData SET [Off] = ([Off] * 100 / " & TotalOff & "), Def = (Def * 100 / " & TotalDef & ") WHERE fk_Match_ID = " & Match_ID

Of course i have a running sum of TotalOff and TotalDef as i'm downloading players. If you don't do it in that run, you can always get TotalOff and TotalDef with simple SQL Sum expressions.

Yes, it's not optimal, giving the %'s would be nice, but lets not make up server overload comments when any good programming is gonna make a single run thru players to do this, and that single run was needed anyway.
2007-02-14 17:17:42
I have a question on TotalRank that's available in the Team section of the XML from league-xxx.php

That doesn't take into account position in the league, eh?

So to generate promotion table, you also have to go run thru and make sure that the team is in first place (for promotion / quali up) or in 5th-8th for relegation / quali down)?

Is there anywhere that rank in league is actually stored? Is it ALWAYS the case that order in the XML feed corresponds directly to rank in league (ie first place, second place, etc)?

Yes, i could go and compute it myself, but that'd take a pass thru each league that i'd rather not force my local machine to make :)
2007-02-14 20:48:50
Of course i have a running sum of TotalOff and TotalDef as i'm downloading players. If you don't do it in that run, you can always get TotalOff and TotalDef with simple SQL Sum expressions.

Simple enough IF you're using SQL... I'm using an object repository.
I've fixed it by including the TotalOff and TotalDef in the TeamStats for that match but it is still inefficient since there is no use for timePlaying or time Defending without the totals.
2007-02-14 21:06:15
I have a question on TotalRank that's available in the Team section of the XML from league-xxx.php
That doesn't take into account position in the league, eh?


Nope.

So to generate promotion table, you also have to go run thru and make sure that the team is in first place (for promotion / quali up) or in 5th-8th for relegation / quali down)?

Well, yes.

Is there anywhere that rank in league is actually stored? Is it ALWAYS the case that order in the XML feed corresponds directly to rank in league (ie first place, second place, etc)?

Seems to be like that, but I wouldn't rely on XML order.


rankTotal unveiled:

14 digits (if less it means that firsts == 0)
digit #s: meaning

1-2: points in league
3-4-5: goal difference + 500
6-7-8: goals in favour
9-10-11: matches won
12-13-14: 9 - position in league at the beggining of season (1st team has value 8, 2nd has 7, and so on).
2007-02-14 21:53:09
what i do on my site is download every team with his ranktotal and the relative league id, the order them sorting by ranktotal and league.
2007-02-15 16:48:02
That wouldn't do it tho, you need to get rank or you'll promote people in 2nd place who have more poitns than people in 1st place in other leagues...
2007-02-15 16:49:55
Seems to be like that, but I wouldn't rely on XML order.

So how would you get position in league? Actually look at the rank of all teams in the league? I could do that i guess by running thru the league in a single sweep after downloading all of the data once from the xml site, should be pretty easy actually (just order by league ID and do a counter until the league ID changes).
2007-02-15 17:42:31
sorry but you're wrong...
it depends on how many leagues you have....
Italy case:

A 1 (First Division)
B 4 (Second Division)
C 16 (Third Division)
D 64 (Fourth Division)
E 256 (Fifth Divsion)

In this case ONLY first classified of each league goes to the promotion match (excpet for the firse 25%, prometed directly) versus the last 4 classified on the upper division.
Check out my post.
Red numbers means direct promotion.
2007-02-15 17:58:22
i will try to explaining in other words:
1 - donwload xml of the legue
2 - store teamID and rankTotal
3 - sort the data you just stored by rankTotal

that's it... you will have the exact order of the league table

if you need the first two, select them with a limit of 2...

4 - store again the data (just the ones you need) in a different table
5 - if you need also the last 4 do the same as point 3 but with reverse order (ASC / DESC)
6 - store again the data (just the ones you need) in a different table
7 - go next league doing same you did with previous 6 points.
2007-02-15 19:07:18
So how would you get position in league? Actually look at the rank of all teams in the league? I could do that i guess by running thru the league in a single sweep after downloading all of the data once from the xml site, should be pretty easy actually (just order by league ID and do a counter until the league ID changes).

hmmm... I'd collect data league by league, taking rankTotal and when parsing each league, calculate the league position and store that value as well. It is not any extra downloading, just an extra processing step.
What was this for? National ranking?
2007-02-15 23:01:19
I did a promotion table (you can see my table in your country's sokker forum actually, i posted italy's), so to do it the way you say would be wrong, unless i'm missing a step you're not mentioning.

In your logic there you need to do something to make sure you get the bottom 4 for each league (or the top ONLY ONE for promotion), so you're missing something.

You can have 2 teams with a higher rank order from one league than someone else who won their league...

IE Team 1 has 28 points, team 2 has 27 points from League A

Team 3 is in first in League B with 25 points.

Rank order would put 1 and 2 before 3, so you'd have to check to see if anyone had promoted from League A or your logic will say that 1 and 2 promote, which is NOT correct.
(edited)
2007-02-15 23:03:45
How does sokker differentiate the tie breaker in league position when there's two teams with the same points, GD, and goals scored? Same as with promotion by using last year's position? Ie i can use ranking as the 4th sort if that's the case (points, GD, Goals, Ranking would be the sort).

In any case right now i'm using position in the XML unless that's shown to ever be wrong, then i'll do the extra pass thru the downloaded teams to store league rank that way instead of based on XML position.
(edited)
2007-02-16 01:26:16
How does sokker differentiate the tie breaker in league position when there's two teams with the same points, GD, and goals scored? Same as with promotion by using last year's position? Ie i can use ranking as the 4th sort if that's the case (points, GD, Goals, Ranking would be the sort).

Yes, last season position.