ByteCode.News
Submit RSS Atom Podcast Sign in

Back to the channels

#java

  1. cheeser except there are no bots allowed here.
  2. cheeser but yeah. it looks like the web part is busted.
  3. NeXeN one could have their client message a bot that's in no channel, the entire time, to keep a log then
  4. * NeXeN shrugs. not difficult technically. i dunno about the bot tho, probably some cloudflareups
  5. cheeser or just have your client log it like i have for decades.
  6. NeXeN hey i need to do some research
  7. cheeser the bot's web interface is fucked because it uses an old dropwizard and the logging libraries don't work with it. i don't wanna fix because i'm actively (as in, in another tab in my terminal) replacing that UI as we speak.
  8. NeXeN cool, i wanna see it
  9. cheeser the UI itself is "done." i just have to fix the oauth stuff that's there.
  10. cheeser then probably the UI could use a new skin
  11. NeXeN what is the fe? vaadin or react/vue/angular ?
  12. NeXeN or just vanilla cheese(r)
  13. * NeXeN suddenly gets a craving for cheese cake
  14. dreamreal There ARE logs for #java, just not through javabot for now
  15. cheeser freemarker. 0ld sk00l
  16. cheeser it's going to be quarkus/qute, though.
  17. sbalmos cheeser: What was it before Freemarker? I forget what it was called, and I used to work with it too.
  18. sbalmos Wicket! It just came to me
  19. jreicher cheeser: do you prefer freemarker over mustache? Or did mustache just not do enough?
  20. NeXeN cheeser: hey you know.....if something works it works....if you're confident in it then it's a good target
  21. cheeser jreicher: this UI code is *old* :)
  22. NeXeN legacy isn't a four letter word, it's a track record
  23. NeXeN i will have to say i have used vaadin and it's pretty good. it's not the best in the world for everything but it makes dashboards, consoles, and various apps that fit a standard format (content sites) that makes it easy to spin up stuff knowing nothing but java. it's a little like swing/javafx so those skills kinda port over
  24. NeXeN no need to know any front end or js, and you can get typesafe all the way up and down
  25. hassoon 'morning
  26. jreicher I hope not. I'm on my third glass of wine.
  27. Para You can get your daily dose of natrium by drinking 45,5 kilograms of wine.
  28. nimaje But you would overshoot your daily dose of sugar by a factor of 4 or something, I don't think thats a good idea
  29. jreicher I'll try it and let you know
  30. Para Hmm, maybe do lots of cardio to offset the carbs?
  31. Para I think something like 160 hours should do it.
  32. jreicher There's carbs in wine?!
  33. Para Well it sure ain't protein.
  34. jreicher I know. I drink white russians for that.
  35. dreamreal ~69
  36. javabot dreamreal, 69 is the expected class file format version number of class files emitted when compiling targeting Java 25, which is expected to be released in September 2025. Nice!
  37. ernimril hmmm, a bit out of date
  38. pr070cal hi guys i need some help
  39. pr070cal ive made an arraylist that take an array of objects
  40. pr070cal i write the objects into the array ("", "", "", "", "")
  41. pr070cal then i add the array to the arraylist arrList.add(values)
  42. pr070cal when i print value[0] after ive written to it i can see it has the correct value
  43. pr070cal if i print this System.out.println((((Object[])arrlist.get(i))[0]));
  44. pr070cal the value is always the same the last element i set it to for all 991 of them ?
  45. pr070cal https://www.irccloud.com/pastebin/4J0RxuUB/
  46. nevet Snippet | IRCCloud
  47. pr070cal it prints
  48. pr070cal MLK-USDT
  49. pr070cal MLK-USDT
  50. pr070cal MLK-USDT
  51. pr070cal MLK-USDT
  52. pr070cal MLK-USDT
  53. pr070cal MLK-USDT
  54. pr070cal 900 times
  55. pr070cal but System.out.println(values[0]);
  56. pr070cal outputs
  57. NeXeN ok, first off. use a pastebin if you're going to paste
  58. pr070cal https://www.irccloud.com/pastebin/9nWmL9dO/
  59. nevet Snippet | IRCCloud
  60. NeXeN i look up and you've posted 50 lines
  61. pr070cal do you know what is going wrong here
  62. jreicher pr070cal: to begin with I would recommend not using casts, as a general rule. It stops the compiler telling you about your mistakes.
  63. jreicher What happens if you remove the cast?
  64. pr070cal it says it must be resolved as an object
  65. pr070cal they are all stings though
  66. jreicher Exact error please
  67. pr070cal the last one is just repeated over and over again
  68. jreicher I think we need to talk about precisely what the error means, which depends on knowing its exact wording, so if you could provide that...
  69. pr070cal i added after this arrlist.add(i, values);
  70. pr070cal System.out.println((((Object[])arrlist.get(i))[0]));
  71. pr070cal and it prints al the correct variables
  72. jreicher The error please
  73. jreicher After you've removed the cast
  74. jreicher You should not use casts
  75. NeXeN ok the values array look
  76. NeXeN where is it defined? somewhere outside the loop?
  77. NeXeN you don't need toString() on a getString() btw since it's already string. but now look at this line, arrlist.add(i, values); ?
  78. NeXeN you're adding the exact same values array refrence to the list on every iteration
  79. NeXeN at the end of the loop, every single index in arrlist points to the same memory address
  80. NeXeN like jreicher pointed out the complex and unsafe casting
  81. pr070cal but i increments
  82. pr070cal i just added that in to make sure it iterates
  83. pr070cal i was using add()
  84. pr070cal it all works if i print the value straight after i set it
  85. pr070cal its only after the for loop when i check the array
  86. nimaje and where do you *set* values? (set not modify)
  87. NeXeN if you instantiate values inside the loop it will work
  88. jreicher pr070cal: have you removed the cast, and if you have an error, what is it?
  89. NeXeN String[] values = new String[1]; or something
  90. jreicher There might still be other problems, but a compiler error is the easiest one to solve, because the compiler is helping.
  91. NeXeN System.out.println(((String[]) arrlist.get(i))[0]) then i think, is what you will ...hold on did i miss a parens?
  92. nimaje (but why would you even have that as an array if you only care about one element from it?)
  93. NeXeN yeah, but my point is that's why it's printing the same thing 900 times
  94. NeXeN you're simply just assigning the same reference over and over
  95. NeXeN pr070cal: what is this for, what are you trying to accomplish? are you avoiding using an ArrayList ?
  96. pr070cal i had to add this inside the loop Object[] values = {"","","","","","","","","",""};
  97. pr070cal thanks guys
  98. pr070cal i would have never have thought it a reference to the array[]
  99. NeXeN yeah but you can do better
  100. nimaje where would you have expected the copy? And why Object[] when all you store in there are Strings?
  101. pr070cal i have doubles too
  102. pr070cal and integers
  103. pr070cal why doesnt it store the values into the arraylist
  104. pr070cal i mean if it has to set a pointer
  105. pr070cal why doesnt it just add the value in there
  106. nimaje the value is a reference to the array `values` you pass it
  107. nimaje and you probably want to write a record or a class instead of hammering your data into an Object[]
  108. NeXeN yeah a custom record would save you headaches
  109. NeXeN you can group mixed types in a record
  110. NeXeN ok, so this is how i would build a record if i had those various data types and i wanted to decompose a json object and create a record for type safe use, which is what you seem to be trying to do: https://paste.linux.chat/?cdc263ea989c545c#GtRBn6EfmKM3bENmW6ux7WUR88hsv79V2US3kiKC6dYD
  111. javabot NeXeN's title: "Linux.Chat PrivateBin"