Chat Logs

  1. acidjnknvm, extract that one method, and it's fine
  2. * Fiji_ joined #java
  3. * Nnnavd joined #java
  4. * ChaiTRex joined #java
  5. jreicheracidjnk: I'm not sure syntax is your problem there. Why are you flatmapping onto a lambda that produces a stream?
  6. * m joined #java
  7. * jamezp joined #java
  8. * Odyss3us joined #java
  9. * ForeverDreaming joined #java
  10. * michele joined #java
  11. * stfstfm joined #java
  12. * ferdna joined #java
  13. * stfstfm joined #java
  14. * domicron6 joined #java
  15. * Gaz7051122720067 joined #java
  16. * rvalue joined #java
  17. * kusanagi joined #java
  18. * taylan joined #java
  19. * Afroboy joined #java
  20. * leppard joined #java
  21. * mindCrime joined #java
  22. * Maxxed joined #java
  23. * stfstfm joined #java
  24. * yeahitsme joined #java
  25. * jwisbell35 joined #java
  26. * acidjnk joined #java
  27. * leppard joined #java
  28. * Skynx joined #java
  29. * MikeBux joined #java
  30. * leppard joined #java
  31. * airaqi joined #java
  32. * airaqi joined #java
  33. * erbium joined #java
  34. acidjnkthe logic is correct jreicher, but it shows that readability is not good enough yet, although I also did not provide all the context. I ended up making this utility method, surprised that it did not exist in the core API yet. It's like zip, but cartesian instead of pair-wise: https://pastebin.com/UxGdLa8t
  35. * stfstfm joined #java
  36. * Betal joined #java
  37. dreamrealacidjnk: what id this trying to do?
  38. * stfstfm joined #java
  39. acidjnkWhat I'm using it for is a JUnit DynamicTest and @TestFactory. I have a list of first arguments, a list of second arguments, and need to call a parameterized test with all possible combinations. Some JUnit library has a @Cartesian annotation or something like that with similar effect.
  40. ParaCartesian product as a stream assumes extrapolating a two-dimensional result from a sequence. That's not very generalizable -> no method in API.
  41. ParaAs a group of operations that's zip + reduce, though. I don't think n-stream zipper exists in core API either.
  42. Para(per dimension)
  43. dreamrealpara's right, I actually use a set of nested values in a methodsource to do it: for(var v1 :setOfV1s) { for(var v2: setofV2) { ... compose set here } }
  44. Parathis guy's done a pretty good zipping gatherer https://www.morling.dev/blog/zipping-gatherer/
  45. javabotPara's title: "A Zipping Gatherer - Gunnar Morling"
  46. ParaHm, I think I've seen this SO post before :) https://stackoverflow.com/questions/17640754/zipping-streams-using-jdk8-with-lambda-java-util-stream-streams-zip
  47. javabotPara's title: "functional programming - Zipping streams using JDK8 with lambda (java.util.stream.Streams.zip) - Stack Overflow"
  48. acidjnkjOOλ has something similar, but as two calls. It has a crossjoin to create the tuples, and then it's just mapping to a BiFunction. I was considering to just use that as a library.
  49. * dreamreal shrugs. Do what works for you.
  50. acidjnkwhen you can use methodsource, @CartesianTest would also work: https://junit-pioneer.org/docs/cartesian-product/ Mine can't use method source, because it is abstract, and I need the elements defined by the corresponding implementations.
  51. nevetCartesian Product of Parameters
  52. dreamrealoooo I need to look at that, I've been doing it manually
  53. dreamrealI keep thinking junit's just not all that flexible, people keep adding it.
  54. dreamrealoh, of course, that's not junit proper, that's why
  55. acidjnkyes. I looked at all sorts of alternatives before I resorted to @TestFactory
  56. * GreenResponse joined #java
  57. * leppard joined #java
  58. jreicheracidjnk: I never said the logic was wrong. I'm asking why you've chosen to implement it using this combination of operations.
  59. * sonOfRa_ joined #java
  60. * jamezp joined #java
  61. * ForeverDreaming joined #java
  62. acidjnkReasonable question, but from the question itself I concluded: Ok, it's not obvious that I want to call a method with all possible combinations of the elements from the two sources.
  63. * Afroboy joined #java
  64. * mindCrime joined #java
  65. * metalmaniac joined #java
  66. * Anaphaxeton joined #java
  67. * leppard|2 joined #java
  68. * Fiji_ joined #java
  69. * ChaiTRex joined #java
  70. * WizJin joined #java
  71. * ferdna joined #java
  72. * stfstfm joined #java
  73. * acidsys joined #java
  74. * acidsys joined #java
  75. * hwpplayer1 joined #java
  76. * Anaphaxaway joined #java
  77. * Ragnor joined #java
  78. * domicron joined #java
  79. * stfstfm_ joined #java
  80. * hwpplayer1 joined #java
  81. * jbosmans joined #java
  82. * sonOfRa joined #java
  83. * domicron1 joined #java
  84. * monkeyPlus joined #java
  85. * ernimril joined #java
  86. * metalmaniac joined #java
  87. * acidjnk_new joined #java
  88. * jreicher joined #java
  89. * jamezp joined #java
  90. * Fiji_ joined #java
  91. * Odyss3us joined #java