Open main menu

User talk:Johnuniq

Logo of Wikidata

Welcome to Wikidata, Johnuniq!

Wikidata is a free knowledge base that you can edit! It can be read and edited by humans and machines alike and you can go to any item page now and add to this ever-growing database!

Need some help getting started? Here are some pages you can familiarize yourself with:

  • Introduction – An introduction to the project.
  • Wikidata tours – Interactive tutorials to show you how Wikidata works.
  • Community portal – The portal for community members.
  • User options – including the 'Babel' extension, to set your language preferences.
  • Contents – The main help page for editing and using the site.
  • Project chat – Discussions about the project.
  • Tools – A collection of user-developed tools to allow for easier completion of some tasks.

Please remember to sign your messages on talk pages by typing four tildes (~~~~); this will automatically insert your username and the date.

If you have any questions, please ask me on my talk page. If you want to try out editing, you can use the sandbox to try. Once again, welcome, and I hope you quickly feel comfortable here, and become an active editor for Wikidata.

Best regards! Liuxinyu970226 (talk) 10:35, 20 May 2017 (UTC)

NotesEdit

Cycling raceEdit

Hey, you seem to be a bit better than I with programming, so I ask you if you have an idea. In the module Cycling race, I created a function listofstagesclassification. I have the only problem that the order of the columns is not correct. The array "winners" has a defined order, but at line 5923 when I create the table columns, then the order of the element is not defined (which is normal in LUA according to be search). I read many things on internet, but still can't make it works. So I am looking for something like what is commented at line 5935. Any idea? Psemdel (talk) 20:20, 14 March 2019 (UTC)

Hi Psemdel. I would be glad to have a look but can't do that for a few hours. I can normally fix Lua but I know very little about cycling. It would help me if there were a sandbox somewhere (or a talk page example) showing what happens now. Add a comment saying what should happen. At any rate I'll look a little later. Johnuniq (talk) 23:39, 14 March 2019 (UTC)
No stress, it is not emergent. And even if it was, we are all volonteers here, so take your time. It has actually nothing to do with cycling, it is a problem of sorting of array.

The lines near 5924 are:

	for ii, v in pairs(winners) do
		if v.QID then
			columntable[v.QID]={key=ii, name=v.name, jersey='',bg_color='', used=false}
			for ii=1,(#stages+1) do
				columntable[v.QID][ii]={}
				columntable[v.QID][ii][1]={}
				columntable[v.QID][ii][2]={} --first stage
				columntable[v.QID][ii][3]={} --number of stages consecutive
			end
		end
	end

I would replace that with:

	for ii, v in ipairs(winners) do
		if v.QID then
			local t = {key=ii, name=v.name, jersey='', bg_color='', used=false}
			for ii = 1, #stages+1 do
				t[ii] = { {}, {}, {} }  -- ?, first stage, number of stages consecutive
			end
			columntable[v.QID] = t
		end
	end

Currently, the test if v.QID then is not needed because (I think) v.QID is always a string. I used ipairs not pairs.

You are right.

I haven't worked out what the code does yet so I'm not sure exactly what is needed. I will look some more but would like an example where I can see what the code does, even if it's not yet correct. Johnuniq (talk) 07:05, 15 March 2019 (UTC)

Yes sorry I am not always very clear.
I had some more time and I have edited Module:Cycling race for what I think is wanted. Please check carefully because I'm not sure what the code is trying to do. Johnuniq (talk) 09:36, 15 March 2019 (UTC)
If I believe the talk page of the module, it seems to work perfectly fine. Thank you very much! I think it is one of the last functions needed for this module. The end of a long journey...hopefully. Psemdel (talk) 20:14, 15 March 2019 (UTC)
Return to the user page of "Johnuniq".