Bug 94490 - [HELPAUTHORING] If you create a page with a large number of paragraphs that appear duplicate IDs
Summary: [HELPAUTHORING] If you create a page with a large number of paragraphs that a...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Documentation (show other bugs)
Version:
(earliest affected)
5.1.0.0.alpha0+ Master
Hardware: Other All
: medium trivial
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: HelpAuthoring-Extension
  Show dependency treegraph
 
Reported: 2015-09-24 14:22 UTC by tagezi
Modified: 2015-10-05 10:56 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description tagezi 2015-09-24 14:22:45 UTC
If a person makes a single paragraph in a minute, this method of producing a random ID is very good. But, if a person make many paragraphs without appropriation of IDs, during a saving all paragraphs get IDs. It is less than a minute. So the part that changes is the last three digits for this case.

It also proves the mathematical statistics. There is beautiful example in wikipedia: https://en.wikipedia.org/wiki/Birthday_problem

For this case, 50% is achieved already at 6 paragraphs.

I put a trivial because it is very easy to get round.

PS: This can be done as follows: Delete the first part of the year ("20"), it will be repeated another 100 years :) and to add one more random.
Comment 1 Yousuf Philips (jay) (retired) 2015-09-25 10:13:13 UTC
Yes during the saving process, it assigns all missing paragraphs with IDs within a split second and the only part of the id that is changing is the random number part that is looking for a random number in 100.

Here is that random id code

ID = ReplaceAll(Date,"/:. \","") + ReplaceAll(Time,"/:. \AMP","") + Int(Rnd * 100)

I was thinking the same to either add another random number to the end, or alternatively do a random number of 10000 rather than 100.
Comment 2 Yousuf Philips (jay) (retired) 2015-09-25 11:21:44 UTC
Another alternative fix is

Int(Rnd * 100) + ReplaceAll(Date,"/:. \","") + ReplaceAll(Time,"/:. \AMP","") + Int(Rnd * 100)
Comment 3 Yousuf Philips (jay) (retired) 2015-09-30 20:35:10 UTC
Patch using a random of 10k has been submitted. Preferred this option over the fix in comment 2 so paragraphs already created in the help authoring tool will still follow the same id scheme.

https://gerrit.libreoffice.org/19045