UHC Apps | Competition Hosting

Talk about official or unofficial competitions. Feel free to host your own!
Post Reply
User avatar
caledonianblues
Master Hunter
Posts: 9725
Joined: September 27th, 2012, 11:01 pm
Location: London, UK
Contact:

Re: UHC Apps | Competition Generator

Post by caledonianblues »

JackRbbt wrote:However, can you consider to add another column in the table, containing the reserve where the kill or shot was made? I know, you can get it from scoresheet, but wouldn't be nice to see it "at once"?
No, unfortunately not. This would require an N+1 query to get the reserve for each record, which would not be efficient. For the value it would add to the table, I would consider it to be more trouble (and resources) than the return warrants.
User avatar
HooCairs
Champion Hunter
Posts: 23416
Joined: March 4th, 2011, 7:30 pm
Location: Switzerland
Contact:

Re: UHC Apps | Competition Generator

Post by HooCairs »

Great addition! Just one big piece of amazing work. :)
My Youtube theHunter Wiki
Spoiler:
Image
User avatar
DarkHunterXX
Scout
Posts: 490
Joined: June 3rd, 2013, 1:08 pm
Location: Netherlands
Contact:

Re: UHC Apps | Competition Generator

Post by DarkHunterXX »

Absolutely awesome work David!
But i don't really get the thing about N+1 query, i looked up on the internet but doesn't really make sense to me that much. Can you explain it?

Another thing i noticed:
When downloading a excel sheet from a (any) season , all data get stored in the first column.
This should be displayed better in my opinion.
Me as a starter programming student did this a few weeks back aswell, so for you it will be easy i quess ;)

But other than that: beautifull :)
Photographer of the world, and playing this awesome game ;) :D Youtube: https://www.youtube.com/channel/UCJDOkC ... Gz49JctvnA
User avatar
caledonianblues
Master Hunter
Posts: 9725
Joined: September 27th, 2012, 11:01 pm
Location: London, UK
Contact:

Re: UHC Apps | Competition Generator

Post by caledonianblues »

DarkHunterXX wrote:But i don't really get the thing about N+1 query, i looked up on the internet but doesn't really make sense to me that much. Can you explain it?
An N+1 query is essentially where you perform an initial query, then one additional query for each record in the result set. In this case, an API call returns the personal best data for a user, for one season. The array contains information, but not the reserve ID for the harvest. In order to get that, another API call has to be made. So if there are 80 records in the first array, when you iterate that array, another 80 API calls would have to be made to obtain the relevant information (in this case, the reserve ID for each harvest). If you were querying the database directly, assuming it was relational, you would solve this problem by using a SQL join. Unfortunately when you only have access to the data via an API and the function does not return the required data, the only solution is to live without it, or carry out N+1 API calls. This is horribly inefficient and would add significant overhead to the process. For that reason, even though it was a very good suggestion, it's not feasible.
DarkHunterXX wrote:Another thing i noticed:
When downloading a excel sheet from a (any) season , all data get stored in the first column.
This should be displayed better in my opinion.
Me as a starter programming student did this a few weeks back aswell, so for you it will be easy i quess ;)
When I download any season and open the CSV file in Excel, it displays properly. I looked on the server and can see that you downloaded seasons 14 and 21. The CSV files are stored on the server for 24 hours after being generated, and when I download those files (exact same files you downloaded) and open them, they also open fine. What are you using to open the files? Just to clarify, this is what it looks like for me when I download one of my seasons and open the file in Excel.

Image

Is anyone else experiencing this problem when opening a downloaded file?
User avatar
DarkHunterXX
Scout
Posts: 490
Joined: June 3rd, 2013, 1:08 pm
Location: Netherlands
Contact:

Re: UHC Apps | Competition Generator

Post by DarkHunterXX »

That makes things clear about the N+1 query's thanks, i always use Innerjoin for query's myself :)
About the Excel file:
I use Excel 2016 to open them, it looks like this.
Image

Edit: I started up my laptop , i get the same result when trying it on my laptop.
Photographer of the world, and playing this awesome game ;) :D Youtube: https://www.youtube.com/channel/UCJDOkC ... Gz49JctvnA
User avatar
caledonianblues
Master Hunter
Posts: 9725
Joined: September 27th, 2012, 11:01 pm
Location: London, UK
Contact:

Re: UHC Apps | Competition Generator

Post by caledonianblues »

DarkHunterXX wrote:That makes things clear about the N+1 query's thanks, i always use Innerjoin for query's myself :)
Well, inner joins only work if there are records that have matching values in both tables. But yes, a join would solve the problem here if we were querying a database.
DarkHunterXX wrote:About the Excel file:
I use Excel 2016 to open them, it looks like this.]
For some reason something is putting double quotes around some of the data. That is not what those files look like on the server, so I think it's something to do with the way you've got Excel configured. Maybe you're importing the file and specifying field types?
User avatar
DarkHunterXX
Scout
Posts: 490
Joined: June 3rd, 2013, 1:08 pm
Location: Netherlands
Contact:

Re: UHC Apps | Competition Generator

Post by DarkHunterXX »

For some reason something is putting double quotes around some of the data. That is not what those files look like on the server, so I think it's something to do with the way you've got Excel configured. Maybe you're importing the file and specifying field types?
I think it has something to do with my excel indeed.
when opening it on my phone it works totally fine.

I can now just open excel and import it from there, that will work fine.
Photographer of the world, and playing this awesome game ;) :D Youtube: https://www.youtube.com/channel/UCJDOkC ... Gz49JctvnA
User avatar
JackRbbt
Trophy Hunter
Posts: 6483
Joined: October 30th, 2012, 1:21 pm
Location: Constanta, Romania / Westville, South Africa
Contact:

Re: UHC Apps | Competition Generator

Post by JackRbbt »

Double quote around text field, in CSV files, is a normal thing. Imported CSV files format is determined by "List separator" field, from Windows "Regional settings". To avoid any kind of conflicts or misinterpretations of CSV content, if list separator is anything else than comma (most likely that's DarkHunter's problem, for most European countries, default list separator is ";"), just add a first line in CSV file, containing "sep=," (quote marks included!). Now, that can be done manually, using any text editor, or directly from David's code (i'm sorry my friend, some more programming work for you to do! ;) ).

Original file:
Image

Edited CSV file (working right, independent of "Regional settings"):
Image
Spoiler:


Image
User avatar
caledonianblues
Master Hunter
Posts: 9725
Joined: September 27th, 2012, 11:01 pm
Location: London, UK
Contact:

Re: UHC Apps | Competition Generator

Post by caledonianblues »

JackRbbt wrote:Double quote around text field, in CSV files, is a normal thing.
Actually it's not. RFC 4180 clearly states, any field may be quoted, but it's only required if one of the fields contains one or more of the delimiting characters. I guess if you live in a part of the world where a comma is used to denote a decimal point, or the default field delimiter is not a comma, then Excel (or Windows) might be configured to automatically apply double quotes. I specifically chose not to add double quotes to the field data because, well frankly, I think it looks awful once you open it in Excel.

If it's a problem for too many people then I will look to implement a fix
User avatar
caledonianblues
Master Hunter
Posts: 9725
Joined: September 27th, 2012, 11:01 pm
Location: London, UK
Contact:

Re: UHC Apps | Competition Generator

Post by caledonianblues »

A vast amount of the UHC functionality will currently not be working due to the game server issues. This will affect many pages, including account creation, the dashboard, competition submissions, etc. Please be patient. Hopefully the issue will be resolved soon.
Post Reply

Return to “Competitions”

Who is online

Users browsing this forum: Fletchette, fon_Belkrofft_DK, xOEDragonx and 1 guest