vault backup: 2024-03-05 16:01:50

This commit is contained in:
2024-03-05 16:01:50 +00:00
parent 8ce640b4ba
commit 28ea6a0a9b
36 changed files with 314 additions and 89 deletions

View File

@@ -10,7 +10,7 @@ comment2.target=void\ storeUser(LibraryUser)
comment2.text=\n\ Appends\ a\ LibraryUser\ to\ the\ userList.\n
comment3.params=prefix\ length
comment3.target=java.lang.String\ generateUserID(java.lang.String,\ int)
comment3.text=\n\ Returns\ a\ random\ unique\ user\ ID\ by\ specifying\ \n\ @prefix\ -\ arbitrary\ alphanumeric\ prefix\n\ @length\ -\ length\ of\ numeric\ ID\n\ \n\ Example\:\ length\ \=\ 6,\ expected\ result\ should\ be\ under\ 999,999\ and\ above\ 99,999.\n\ If\ we\ just\ use\ 10^(length),\ this\ would\ generate\ any\ number\ under\ 1,000,000.\n\ This\ is\ an\ issue\ since\ any\ integers\ below\ 100,000\ can\ be\ used,\ which\ would\ be\ incorrect.\n\ By\ using\ the\ offset\ of\ a\ factor\ of\ 10\ below\ the\ desired\ length\ we\ can\ generate\ between\ 0\ and\ 899,999.\n\ After\ this,\ we\ can\ add\ 100,000\ back\ to\ the\ number\ to\ ensure\ a\ baseline\ length\ is\ maintained.\n\ \n\ Note\:\ I\ am\ aware\ that\ this\ is\ overengineered,\ and\ that\ several\ random\ integers\ of\ amount\ @length\ could\ be\ used,\ \n\ but\ this\ is\ considerably\ more\ efficient\ since\ there\ is\ no\ iteration\ involved\ in\ the\ creation\ of\ the\ ID.\ O(1)\n
comment3.text=\n\ Returns\ a\ random\ unique\ user\ ID\ by\ specifying\ \n\ @prefix\ -\ arbitrary\ alphanumeric\ prefix\n\ @length\ -\ length\ of\ numeric\ ID\n\ and\ returning\ a\ unique\ user\ id\n\ @uuid\ -\ a\ unique\ string\ starting\ with\ @prefix,\ and\ concat.\ with\ a\ random\ number\n\ \n\ Example\:\ length\ \=\ 6,\ expected\ result\ should\ be\ under\ 999,999\ and\ above\ 99,999.\n\ If\ we\ just\ use\ 10^(length),\ this\ would\ generate\ any\ number\ under\ 1,000,000.\n\ This\ is\ an\ issue\ since\ any\ integers\ below\ 100,000\ can\ be\ used,\ which\ would\ be\ incorrect.\n\ By\ using\ the\ offset\ of\ a\ factor\ of\ 10\ below\ the\ desired\ length\ we\ can\ generate\ between\ 0\ and\ 899,999.\n\ After\ this,\ we\ can\ add\ 100,000\ back\ to\ the\ number\ to\ ensure\ a\ baseline\ length\ is\ maintained.\n\ \n\ Note\:\ I\ am\ aware\ that\ this\ is\ overengineered,\ and\ that\ several\ random\ integers\ of\ amount\ @length\ could\ be\ used,\ \n\ but\ this\ is\ considerably\ more\ efficient\ since\ there\ is\ no\ iteration\ involved\ in\ the\ creation\ of\ the\ ID.\ O(1)\n
comment4.params=
comment4.target=void\ writeUserData()
comment4.text=\n\ A\ method\ to\ output\ all\ user\ data\ to\ a\ file\ using\ a\ fileDialog\ to\ specify\ file\ location.\n\ \n\ Note\:\ Potentially\ could\ implement\ the\ HashSet\ made\ for\ GenerateUserID\ to\ avoid\ unnecessary\ recursion.\n