Commons talk:Photo challenge/Archives/2024

Trouble running C# maintenance codes

Last 8 years administering Photo Challenge I was relying on C# codes written by User:Colin for automatically processing Photo Challenge pages. The codes:

went almost unchanged since they were written over a decade ago. They are meant to be run on your PC in Visual Studio. This month, the codes stopped compiling for me and so far I was not able to create voting pages or score last month results. I am very familiar with several dozen programing languages but not with C# and its external libraries management. As I am, fighting with this issue, maybe someone more familiar with Visual Studio and C# can also try to get those codes to compile and produce voting pages. Jarekt (talk) 03:06, 7 January 2024 (UTC)

Hi Jarekt. I can take a look. What version of Visual Studio or other tool are you using? -- Colin (talk) 18:56, 7 January 2024 (UTC)
I've taken the code above and used it to create the voting pages for January. I can also run the vote counting code but not sure what your current policy is on voters who have too few contributions or who voted incorrectly. Do you ask them to change their vote or something else? Anyway I don't see a problem with running the code. I am using the Visual Studio 2022 Community Edition that you can download from here. Perhaps you can try downloading that again (it just downloads a small bootstrapping web installer). I can email you the *.sln, *.csproj packages.config files that go with this, if that helps.
Here's the "errors" on the "2023 November Bicycles" voting:
https://commons.wikimedia.org/wiki/Special:Contributions/M&A gave Response status code does not indicate success: 404 (Not Found). (Note, that might be an issue with the '&' in their username. I may have to try to fix the code to handle them. But this user has enough contribs).
https://commons.wikimedia.org/wiki/Special:Contributions/Damianfossi has too few contributions
https://commons.wikimedia.org/wiki/Special:Contributions/efux voted wrongly: 1, 1
https://commons.wikimedia.org/wiki/Special:Contributions/Guysimard44 has too few contributions
https://commons.wikimedia.org/wiki/Special:Contributions/Inhigo has too few contributions
https://commons.wikimedia.org/wiki/Special:Contributions/M&A has too few contributions
https://commons.wikimedia.org/wiki/Special:Contributions/Nazarenav has too few contributions
https://commons.wikimedia.org/wiki/Special:Contributions/Любмир voted wrongly: 3, 3, 3, 3, 2, 2, 2
Here's the "errors" on the "2023 - November - Too many to count" voting:
https://commons.wikimedia.org/wiki/Special:Contributions/Любмир voted wrongly: 3, 3, 3, 3, 3, 3, 3
If you can deal with them, let me know when the voting is fixed up and I'll run the programs again and create the award pages. Or hopefully you have it resolved by then. -- Colin (talk) 21:47, 7 January 2024 (UTC)
@Colin: Could you please publish the .sln and packages.config files (the .sln is not that important) either on-wiki or in a source code repository such as https://gitlab.wikimedia.org/? It would allow anyone to run the program, not only Jarekt, now and in the future. I tried to look at the program, but I stopped when I saw the using HtmlAgilityPack; lines – without having the appropriate <PackageReference> or packages.config entry, I wouldn’t be able to run it. —Tacsipacsi (talk) 23:53, 7 January 2024 (UTC)
Colin Thanks for helping with this. I almost never ask people to fix the votes and just correct the issues I encounter. Each voting page does have the sentence: "Voters who voted for more than one 1st, 2nd or 3rd place will have those votes converted to Highly Commended praises. Other votes not complying with the requirements will be removed. In some cases users might be asked to correct their votes after voting ends." That explains what will happen. I also remove extra images from submission pages in case someone has more than 4 entries, by personally deciding which 4 are the best. I always try to explain what I did in edit summary which includes user name.
As for my Visual Studio, I had a very hard time getting some other VS compiler to work after it suddenly stopped working, I ended up installing and reinstalling several versions of VS multiple times until I got the other issues resolved but that left me with broken C# compiler. So presently, I have both VS 2022 (Microsoft Visual Studio Professional 2022 (2) (64-bit) Version 17.8.3) and VS 2019 running on my machine. My old .sln files would no longer open in VS 2022 so I tried to create project from scratch. I added HtmlAgilityPack through some sort "NuGet package controller", but I was getting errors "error CS0234: The type or namespace name 'Http' does not exist in the namespace 'System.Net' (are you missing an assembly reference?)". Adding "System.Net.Http" through NuGet did not solved the issue so I searched through discussion boards and some people thought that you no longer need to include it. I tried to comment it out but than I would get "error CS5001: Program does not contain a static 'Main' method suitable for an entry point" error. Whatever it means. I will work on resolving the above issues. I also think it would be good to have GitLab repository for the project, as Tacsipacsi suggested. --Jarekt (talk) 02:39, 8 January 2024 (UTC)
I'll see what I can do tonight. I should be able to update things so only .cs and a .csproj file are needed and I think those can be uploaded here. Now that I know you have 2022, I can use the latest project style that does away with packages.config.
FYI, I think the error you are getting are because references to libraries are done in (at least) two ways. There are the older style "assembly" references that you get when using the "Add Project References..." right-click menu, which launches the "Reference Manager". And there are new style "nuget" package references that you get using the "Manage NuGet Packages..." menu. I think the one you are missing is the former kind. But you also might have created the wrong project type when trying to recreate the project. It currently needs to be a .net framework console app, and you might have picked .net core console app.
I'll also have a go at updating it to .net core (it is currently .net framework). Then someone could build and run it on Windows, Linux or a Mac and you wouldn't need Visual Studio, just some command-line tools and a text editor (though you can still use Visual Studio) -- Colin (talk) 08:45, 8 January 2024 (UTC)

Jarekt Here are the files you will need to build the two programs. I suggest you put them into two brand new folders without any of the existing files. You only need the cs and the csproj files. When you open the csproj, Visual Studio will create an sln file for you (and offer to save it to disk when you close things). The csproj file no longer needs a separate packages.config and also doesn't need to list the source files being used -- it just assumes any file in the directory is part of the project.

I've modified the source of each so that you don't need to keep building it and running it in Visual Studio if you don't want to. Once you have built it (the output will go into a bin\Debug\net80 folder) then you could copy the contents of that into another folder on your PATH (for example, create C:\PhotoChallenge and stick it there and then add C:\PhotoChallenge to your PATH). Then you can run the script by supplying the name of the challenge on the command line. You will need to put the challenge name in double quotes so that it is interpreted by the program as one command line argument. For example voting.exe "A great challenge".

I hope this solves the problems you've been having. I've set the csproj files to use .net core 8.0 so you will need the latest version of Visual Studio 2022. Let me know if you have any problems. -- Colin (talk) 21:37, 8 January 2024 (UTC)

Btw, do you ever use Commons:Photo challenge/code/CreateVotingDuo.cs]? If you do I can fix it too. For now, I've removed mention of it from the Maintainer's Manual. -- Colin (talk) 21:44, 8 January 2024 (UTC)
Colin, those project files worked for me, and I like the new compile-once run-forever schema. I just created a run.bat text file with bin\Debug\net80\CountVoting.exe "2023 - November - Too many to count" to run it. Thanks again for your help. --Jarekt (talk) 05:05, 10 January 2024 (UTC)
Tacsipacsi do you want to try the new .csproj files to see if you can also get the code to compile? It would be nice to have more people able to run it. --Jarekt (talk) 05:08, 10 January 2024 (UTC)
I'm glad it is working for you now. Just be careful where you run the program, because if the various output files end up in the same folder as the CreateVoting.csproj or Voting.csproj, then the next time you open Visual Studio for those projects, it might think those files part of the project. I suspect no harm would come, as it wouldn't try to compile a .txt file, but it could be confusing. Better to have another folder for working in and link to the exe with e.g. ..\CreateVoting\bin\Debug\net80\CreateVoting.exe or similar. -- Colin (talk) 10:57, 10 January 2024 (UTC)

Feb 2024

Lunar/Lunisolar New Year is coming. :) RZuo (talk) 12:20, 10 January 2024 (UTC)

Photo challenge November results

Bicycles: EntriesVotesScores
Rank 1 2 3
image      
Title Through the flooded
street on a bicycle
Bicycle helihoisting Silvia Persico and Esmée
Peperkamp in Tourmalet
during TDFF 2023
Author Debanutosh Ibex73 Shougissime
Score 20 17 14

Congratulations to Debanutosh, Shougissime and Ibex73. -- Jarekt (talk) 05:12, 10 January 2024 (UTC)

2nd place is now nominated for deletion: Commons:Deletion requests/Files uploaded by Eliteextant. RZuo (talk) 12:08, 10 January 2024 (UTC)
At least, it should be removed from the contest. Images without full EXIF data should not be accepted in photo contests. Yann (talk) 12:16, 10 January 2024 (UTC)
It is always sad to lose wining images to deletion, although it is often necessary. I would be OK with requiring all contestants to have EXIF data, but only if there are some automatic ways to detect images that do not have them. Commons:Photo challenge/code/CreateVoting.cs is the source code used for creating voting pages and it already rejects files summited too early or too late, if someone knows how to add a test for EXIF we cold reject those too. --Jarekt (talk) 02:37, 12 January 2024 (UTC)
I am fully against demanding EXIF data for all entries - we have a lot of challenges where location is not relevant (food, tools etc.), but could reveal where an anonymous user is living and through this make him an easy target for harassment. Kritzolina (talk) 06:56, 12 January 2024 (UTC)
i would trust voters to exercise more caution when they vote. at least that's what i would do if i spot irregularities during voting.
a photo without exif, by an account without much other edits, is clearly suspicious. RZuo (talk) 09:25, 12 January 2024 (UTC)


Too many to count: EntriesVotesScores
Rank 1 2 3
image      
Title Henri-Chapelle American
Cemetery and Memorial
Pacific Sardines - Monterey
Bay Aquarium (California)
Eriophorum_scheuchzeri
in Vanoise National Park
Author Foeniz Changku88 Ibex73
Score 19 15 14

Congratulations to Foeniz, Changku88 and Ibex73. -- Jarekt (talk) 02:30, 12 January 2024 (UTC)

Thank you Foeniz (talk) 10:14, 12 January 2024 (UTC)

Photo challenge December results

Fossil fuel: EntriesVotesScores
Rank 1 2 3
image      
Title Gewinnung und Verbrennung Lusatian lignite briquette of the
Rekord brand from the former GDR
Feuerraum einer Dampflokomotive.
Топка паровоза IMG 5655WI
Author Mensch01 Lusi Lindwurm Kora27
Score 22 16 13

Congratulations to Mensch01, Lusi Lindwurm and Kora27. -- Jarekt (talk) 03:27, 22 February 2024 (UTC)

In a box: EntriesVotesScores
Rank 1 2 3
image      
Title Sweet collection in a box Escape artist Blown out quail eggs
in a cardboard box
Author Hgrobe Горбунова М.С. Ermell
Score 12 9 8

Congratulations to Hgrobe, Горбунова М.С. and Ermell. -- Jarekt (talk) 03:54, 22 February 2024 (UTC)

Photo challenge January results

Silos: EntriesVotesScores
Rank 1 2 3
image      
Title Garfield Grain Elevator and
Silos Garfield Washington USA
Feed silos in Hirschbrunn
near Burgebrach
Silos of the Hannoversche Portland
-Cementfabrik (abandoned in 1986)
Author DaveGinOly Ermell Hgrobe
Score 19 13 8
Masks: EntriesVotesScores
Rank 1 2 3
image      
Title Narrentag 2024 -
Elzacher Schuttig
Kirchseoner Perchtenlauf
- old winter parade
tradition in Bavaria.
Mask of type "Klaubauf"
Taken in Dublin, march 2014
Author Rainer Halama Würmchen-vom-Mölchlein Oncewerecolours
Score 13 13 10

Congratulations to DaveGinOly, Ermell and Hgrobe. -- Jarekt (talk) 01:40, 22 March 2024 (UTC) Congratulations to Rainer Halama, v and Oncewerecolours. -- Jarekt (talk) 01:59, 22 March 2024 (UTC)

Return to the project page "Photo challenge/Archives/2024".