Timeline for Review of reservoir sampling
Current License: CC BY-SA 3.0
10 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Sep 7, 2013 at 7:38 | history | edited | 200_success | CC BY-SA 3.0 |
Only need to import java.util.Random from java.util.*
|
Sep 6, 2013 at 7:13 | comment | added | 200_success | About the type-erasure workaround… you don't have to pass the class explicitly. I've amended the code to use reflection to determine the array type. | |
Sep 6, 2013 at 7:10 | history | edited | 200_success | CC BY-SA 3.0 |
Improved type erasure workaround: don't need to pass the class explicitly
|
Sep 5, 2013 at 9:57 | history | edited | 200_success | CC BY-SA 3.0 |
Added comment explaining type erasure workaround
|
Sep 5, 2013 at 9:51 | comment | added | Somjit Nag | Thank you for the edit , and also for the code.. I'm learning a lot from it, Especially in the type-erasure part. Thanks a lot. | |
Sep 5, 2013 at 9:41 | history | edited | 200_success | CC BY-SA 3.0 |
Suppress compiler warning, as suggested by @SomjitNag
|
Sep 5, 2013 at 9:26 | vote | accept | Somjit Nag | ||
Sep 5, 2013 at 9:14 | comment | added | 200_success |
You may have to code to an ugly API, but that shouldn't stop you from having pretty code behind it. Just plop the contents of my main() into your test1() .
|
|
Sep 5, 2013 at 9:06 | comment | added | Somjit Nag | Thanks a lot for your time to review and post a sample of improvement. will keep these in mind the next time i write a code. This time however , the actual code for which i wrote this , the api for it demanded a single static method for the random extraction and subsequent printout. Hence to keep things similar , i made it all a bit "procedural". | |
Sep 5, 2013 at 7:54 | history | answered | 200_success | CC BY-SA 3.0 |