ByteCode.News
Submit RSS Atom Sign in

Back to the channels

#java

  1. * zorone joined #java
  2. * michele joined #java
  3. * Ragnor joined #java
  4. * ash_2026 joined #java
  5. * NeXeN joined #java
  6. * NeXeN joined #java
  7. * deavmi joined #java
  8. * sponkz joined #java
  9. * NeXeN joined #java
  10. * Afterglow joined #java
  11. * Nitrousoxide joined #java
  12. * meyou joined #java
  13. * NeXeN joined #java
  14. * marcel joined #java
  15. * NeXeN joined #java
  16. * stfstfm_ joined #java
  17. * stfstfm joined #java
  18. * stewi joined #java
  19. * NeXeN joined #java
  20. * jbosmans joined #java
  21. * NeXeN joined #java
  22. * Aedil joined #java
  23. * NeXeN joined #java
  24. * mitch0 joined #java
  25. * NeXeN joined #java
  26. * Afroboy joined #java
  27. * johnjay joined #java
  28. * johnjay joined #java
  29. * NeXeN joined #java
  30. * Afroboy joined #java
  31. * jreicher joined #java
  32. * sponkz joined #java
  33. * Square joined #java
  34. * NeXeN joined #java
  35. Square If you have a DB test using H2 (I assume?), is there some easy trick to connect to the in memory h2?
  36. NeXeN yeah it's like the connection string lemme look it up
  37. * polarian joined #java
  38. NeXeN jdbc:h2:mem:whateverdb;
  39. NeXeN DB_CLOSE_DELAY=-1 is advised unless you want the result to be wiped when the connection is closed
  40. NeXeN oh DB_CLOSE_ON_EXIT=false too of course
  41. NeXeN https://www.h2database.com/html/features.html#in_memory_databases
  42. nevet Features
  43. * NeXeN joined #java
  44. Square NeXeN, sure that is available just like that? I thought you had to throw in some spring properties to make h2 accessible?
  45. * ash_2026 joined #java
  46. NeXeN there is a cool web based console too
  47. NeXeN gotta enable it in the app props
  48. NeXeN only thing i've ever had issue with is spring security might add a security filter chain
  49. NeXeN https://docs.spring.io/spring-boot/how-to/data-access.html
  50. NeXeN add your url, username, pool size, etc
  51. * NeXeN joined #java
  52. * SJrX joined #java
  53. * jreicher joined #java
  54. * NeXeN joined #java
  55. * jreicher joined #java
  56. * michele joined #java
  57. * michele joined #java
  58. * kcomhnall joined #java
  59. * MikeBux joined #java
  60. dreamreal Square: ...
  61. Square dreamreal, wdym? Have I just revealed I am dumb?
  62. dreamreal Why would you say that? I don't think yo're dumb, but... I mean... wanting access to an H2 in-memory database isn't the worst idea ever, you're trying to examine running state, but suggests there's a lot of cleaner ways to work out whatever you're trying to do
  63. Square I found a way from a SO post. You start a server in @BeforeAll and then you can connect to that given you set *thread* breakpoint.
  64. dreamreal so you're trying to examine *test* state?
  65. Square yes. Atm I'm debugging a Criteria api query and sorta need the db to test stuff. Together with "hibernate.show-sql=true"
  66. dreamreal Right. You should do whatever you need to do to do your own thing, but *my* 100% unasked-for advice would have been, had you asked: 1) don't use in-memory for H2, 2) use testcontainers and not H2 in the first place, 3) don't use criteria
  67. dreamreal java development is not hard, when it *is* hard you're doing it wrong
  68. dreamreal again, this is unasked-for advice and I expect it to be treated as such
  69. * jreicher joined #java
  70. kcomhnall so, jetbrains is introducing "Database access for AI agents" in IntelliJ 2026.1 and I'm wondering if this feature is turned on by default if I have a jetbrains account or do I need to do something to enable it?
  71. kcomhnall I don't want it so... I'm kind of hesitant about the upgrade.
  72. jreicher dreamreal: what makes you say java development is not hard? I'm not disagreeing, but I'm curious about your certainty.
  73. dreamreal jreicher: java is *simple*. understanding is hard. You can make things hard by not understanding them, but that's because your *expression* is wrong.
  74. dreamreal Java does some things really poorly: unsigned types being missing is a *drag*. But those things typically have relatively limited scope - they're important, but most of us don't care until we actually hit something where we're going "hey wait this IS a limit, how what aaaaaagh"
  75. dreamreal I run into limits like that ALL THE TIME... but I work with images that are 4G+ in size
  76. dreamreal (I'm spending a pretty decent amount of time going "how what aaaaaaagh")
  77. jreicher I'm not sure anyone who has had to content with compiler errors related to wildcards would accept that Java is simple...
  78. jreicher ^content^contend
  79. dreamreal even so, that's understanding the type system
  80. jreicher Yes, but I'm not sure it's simple. As I said I'm just curious about your certainty.
  81. dreamreal kcomhnall: you could always just turn off AI
  82. dreamreal I don't see anything especially related to IDEA and databases and AI
  83. kcomhnall dreamreal: right, and not seeing anything where? It's in the what's new section. Link also : https://www.jetbrains.com/idea/whatsnew/?utm_medium=link&utm_campaign=IU&utm_source=product&utm_content=2025.3
  84. javabot kcomhnall's title: "What's New in IntelliJ IDEA"
  85. nevet What's New in IntelliJ IDEA
  86. dreamreal jreicher: well, it's not an absolute, of course, but honestly, I've worked in systems that require a lot more understanding than java does, to get stuff done
  87. dreamreal it's a relatively constrained language, that's getting slightly fewer constraints as time goes on
  88. jreicher Maybe constrained for an OO language. But I've always believed that OO is inherently difficult.
  89. jreicher For example I don't think OO should be anyone's first language.
  90. dreamreal jreicher: well, yeah, but that's because OO is more how we think than machines
  91. dreamreal kcomhnall: It looks like it's just an ability to access the database via the properties, nothing much different than working with your code
  92. Square dreamreal, I agree Criteria API might get create complex queries that are hard to debug. But it's a good idea.
  93. Square ...on paper
  94. dreamreal Square: criteria are a great idea done really poorly with a very heavy implementation
  95. Square oh ok?
  96. dreamreal I mean, you contort your *compilation* to make them work thanks to metadata
  97. kcomhnall dreamreal: ugggh... I don't have AI help with my code... just some autocomplete features I assume are built-in to my code editor. But okay.
  98. dreamreal kcomhnall: then it wouldn't affect you
  99. kcomhnall dreamreal: cool
  100. dreamreal although autocomplete is AI too :D
  101. dreamreal I wish people would stop conflating AI with LLMs
  102. kcomhnall eh...
  103. dreamreal kcomhnall: eh what
  104. jreicher dreamreal: actually I think OO is a "god's eye view". Humans think either pure imperative or pure functional, IMO
  105. dreamreal jreicher: really? What can you do with a doorknob?
  106. jreicher I turn it. But I do NOT then visualise what happens with the other objects in the door.
  107. dreamreal I mean, humans DO think differently, I have a fundamentally different perceptive model than most humans do
  108. dreamreal why do you turn it? Is it a turning doorknob?
  109. Square Do you guys use some requirement tool where you're at? I'm not sure I'd count JIRA as a requirement tool. =D
  110. dreamreal Don't you push it first? I mean, doorknob. Or pull it?
  111. dreamreal Square: I mostly annoy my co-workers.
  112. jreicher Maybe, but that's neither here not there. Whatever I do to the doorknob will be related to simple outcomes. That's imperative thinking. There's no object collaboration there.
  113. dreamreal (I really do: I use humor a lot in working with people, to help offset how annoying I am.)
  114. Square dreamreal, I'm honestly curious. I feel wee lacking one.
  115. dreamreal jreicher: you don't think about the doorknob structure, sure. Why would you? It is what it does.
  116. jreicher Which is why OO is difficult. For the system builder, the structure is exposed.
  117. dreamreal Square: I don't have a good answer for you, I don't think jira would be one either. It'd track requirements humans enter, not enforce them or "be a tool for it"
  118. dreamreal jreicher: but a programmer DOES need to understand the context of the doorknob
  119. jreicher Imperative is sequenced. Functional is composed. OO is collaboration, which IMO is the most difficult by far.
  120. dreamreal okay
  121. dreamreal I mean, that's fine, what can I say?
  122. jreicher Well, either you think I'm wrong characterising OO as collaboration, or you think collaboration is simple. I'm curious which it is?
  123. dreamreal For me? Probably the latter
  124. dreamreal I think everything works in context and systems, so OO feels like just an expression
  125. jreicher Interesting. Do you also feel concurrency is simple?
  126. dreamreal sure! The coordination isn't, but concurrency itself is
  127. Square To me OO mostly feels like a way to organize code. Wo having SOLID principles in my head.
  128. dreamreal programming as a career for me is very much a continuous revelation of "ahhhhh, of course"
  129. jreicher Square: I agree with that, but I feel it's another way of saying it's not simple. It's a bit like editing writing.
  130. dreamreal editig writing is simple, too :D
  131. kcomhnall I've associated OO as just thinking of everything as an object having state and behavior. simple
  132. jreicher dreamreal: well at least you're consistent. :p
  133. * Candle joined #java
  134. jreicher kcomhnall: that is simple when considering an object in isolation. How it responds to a population of objects, less so (MO)
  135. Square Like Haskell has "structs/records". Association between these structs and functions that operate on them becomes a discipline thing.
  136. jreicher ^MO^IMO
  137. jreicher Square: it makes a big difference that the objects in Haskell are immutable. The interaction between them cannot lead to state change.
  138. kcomhnall jreicher: sounds like you're referring to interfaces.
  139. * kcomhnall getting distracted and should probably get back on task
  140. Square jreicher, Amen to that
  141. jreicher If you'll excuse the stretch, it's a bit like the "simple" rules of game of life leading to surprising outcomes. The lifcycle of a single cell is simple. The lifecycle of a population... nope
  142. dreamreal jreicher: I do a lot with conway too :D
  143. dreamreal I thought about putting conway into nevet but the usage would be none and it would add no functionality whatsoever
  144. dreamreal that's a good point, though: who here uses wolfram alpha?
  145. kcomhnall Conway's game of life was a fun project. did that using Javascript though...
  146. dreamreal kcomhnall: I've done it with a lot of languages in different variants
  147. jreicher dreamreal: whenever my local software can't do what i need. But only then.
  148. dreamreal jreicher: you use alpha?
  149. Square I feel OO sort of disregard functional dependencies. It's more important to talk about functions than properties.
  150. kcomhnall my group mates were impressed I added testing to the project. they were like "did we have to do that" heh...no but I'm not gonna not do it because it wasn't a requirement.
  151. jreicher Before I discover Emacs calc I probably used it more. But even before that my main go-to was gnuplot, even when I wasn't plotting anything.
  152. dreamreal kcomhnall: I drive my team crazy with tests :D
  153. jreicher Drop the last two words and it's still true? :p
  154. dreamreal jreicher: you use it only for the maths?
  155. dreamreal well, yeah
  156. jreicher Is there anything else?
  157. dreamreal I'm fundamentally annoying
  158. dreamreal jreicher: in ALPHA? Gosh, yes
  159. dreamreal it's *really* good at that
  160. jreicher Let me see.
  161. dreamreal unless they've removed features!
  162. jreicher I asked it "what is the ideal temperature for serving chaource" and it gave me some kind of weather report.
  163. dreamreal that's because weather's probably relevant for ...
  164. dreamreal alpha's fundamentally interesting because it relies on some really complex applications of conway
  165. dreamreal I can't even begin to describe it the way they do
  166. dreamreal "basically we seed it with like a number, yeah, dude, and then it tells us the question that leads to the answer to life, the universe, and everything, and then one thing leads to another and..."
  167. jreicher You mean he put "a new kind of science" into practice?!
  168. dreamreal yeah
  169. dreamreal so they say, at least
  170. dreamreal I loved that book, it's on my shelf right now
  171. jreicher I had no idea. Props for putting his mouth where his money is.
  172. dreamreal that and godel, escher, bach are right by each other
  173. jreicher I would suggest you leaf through Heijenoort. It might change your perspective on the other books. And for the better.
  174. dreamreal Which other books?
  175. dreamreal (Not familiar with heijenoort - url?)
  176. jreicher From Frege to Godel
  177. jreicher One of the most extraordinary books I have encountered in my life. Peerless.
  178. dreamreal ooh. That looks interesting and mindbending. Now I gotta consider.
  179. dreamreal Reading books on maths is something I enjoyed more when I was younger, though
  180. jreicher "The Undecidable" by Martin Davis, is almost in the same league, but not quite. Still excellent for CS people.
  181. jreicher You won't regret having a copy of Heijenoort. Even if you refer to it a few times a year for the rest of your life, you will get something from it.
  182. jreicher Reading Godel's paper on undecidability was an interesting experience for me because I did CS before logic. So when I got to his list of 45 functions I realised I was looking at a computer program.
  183. jreicher (without a computer)
  184. dreamreal see, that would be an interesting observation for me
  185. dreamreal what does a computer have to do with it?
  186. jreicher That's easy to explain, but I would like to quote Godel directly. Let me grab the book.
  187. whaley what's a computer, but a second hand deviiiiice
  188. jreicher "Note added 28 August 1963. In consequence of later advances, in particular of the fact that due to A.M. Turing's work a precise and unquestionably adequate definition of the general notion of formal system can now be given, a completely general version of Theorems Vi and Xi is now possible."
  189. jreicher What Godel means by that is the conception of a computing machine defines what constitutes a formal system.
  190. jreicher Said another way, a proof is formal if it can be checked by a computer. So our definition of a computer is fundamental.
  191. dreamreal I don't see the difference, though: the simulation theorem is unprovable except by implication, because if we were in a program, it could indeed act exactly like this. How is this NOT a program? We call it an open system because we don't know the inputs, but that's about it.
  192. jreicher This is not about our experience, but about what we consider validity to be,
  193. dreamreal I don't see where that boundary is, though
  194. dreamreal I mean, I do, but it feels very artificial to me
  195. dreamreal we walk from place to place but define "a race" as when we go quickly between THESE two places at THIS specific time
  196. dreamreal but we still move about, how are those different except from artificial constraints
  197. * NeXeN joined #java
  198. * NeXeN joined #java
  199. * Tenchi joined #java
  200. * kcomhnall joined #java
  201. deebo has anyone added something like an annotation of @PleaseDontUseInREstApi for method scopes that would very loudly warn at run time via some mechanism if called from a place where it shouldn't be
  202. dreamreal no but this sounds like your chance to change the world!
  203. deebo like project level static analysis rules? preferrably without too much coding effort to add
  204. dreamreal I mean, you could do it with AOP, too
  205. dreamreal modulith, maybe?
  206. deebo i'm refactoring some stuff that used to do var universe = loadUniverse(); return universe.filter(pk -> pk.eqeuals(request.id));
  207. deebo i want to very loudly complain in logs/ci/cd if someone does this again
  208. dreamreal deprecate it?
  209. deebo loading full object graphs etc is very useful for some background work and tests, but most people don't realize the effect it has on api latency overall
  210. dreamreal Why not put it only in tests, then?
  211. dreamreal instead of SAYING "don't do this," make it so they can't
  212. * NeXeN_ joined #java
  213. * sponkz joined #java
  214. Bombe Yeah, subtlety is lost on some people. Make it illegal!
  215. Para One could create a @Landmine annotation and use aspect weaving to break any path which hits that.
  216. Para ...or how about @Microtransaction("$ 1.99") which would look up credit cards from env and bill you for daring to use that.
  217. * NeXeN_ joined #java
  218. * onu joined #java
  219. * GreenResponse joined #java
  220. deebo i shall proxy all calls to the method and System.exit(1) if target has annotation
  221. Square I was under the impression you could get a spring boot up and running in no time with sensible defaults for db etc
  222. Square like a h2 db
  223. deebo you can also just use the testcontainers jdbc driver if lazy
  224. Square i never tried testcontainers. Is it docker based?
  225. * NeXeN joined #java
  226. DoofusCanadensis yes
  227. * jamezp joined #java
  228. dreamreal Square: what does "no time" mean? I mean, it'd take about 3 minutes with initializr
  229. dreamreal and it has sensible defaults but you still need a DB somewhere
  230. dreamreal What are you wanting to do? All of this is remarkably low effort, it's not "no time" but that's because "no time" has an actual meaning and doing anything in the real world takes *some time*
  231. Square dreamreal, never heard of initializr. Looks simple enough
  232. dreamreal if you're spending more than five minutes getting a db *working* you're actually needing to learn what to do, because it's really easy: testcontainers is a thing (if you have OCI) - provide the dependency, set up the JDBC URL to include the tc prefix, done
  233. dreamreal but spring will fall back to h2 by default for you
  234. dreamreal there's rocket science and, well, rocket surgery, and then there's this
  235. Square i feel I'm not in a situation where I have the time to get into testcontainers, so I'd prefer the 2026 crazy easy approach.
  236. dreamreal I thought the testcontainers thing was the 2024 crazy easy approach myself
  237. Square i was under the impression @SpringBootApplication wo much else would do the job
  238. Square ...and some "-starter" dependendencies
  239. dreamreal The default is to use H2 inmemory unless they've changed it
  240. dreamreal but that's inherently limiting in a lot of ways
  241. * NeXeN joined #java
  242. Square finally. I had added more annotations than I needed (before I remember the importance of having the right "starter" dependencies on the CP)
  243. dreamreal Someone really should try to write a book on spring.
  244. * NeXeN joined #java
  245. DoofusCanadensis do you know any writers?
  246. dreamreal One or two.
  247. DoofusCanadensis cool
  248. DoofusCanadensis ~books
  249. javabot Some good java books are listed at https://javachannel.org/java-books/. Also see ~general books
  250. Square I thought internet replaced books?
  251. * NeXeN joined #java
  252. Square ...wait, AI replaced books.
  253. dreamreal no, the internet and the AIs use books to train their datasets
  254. DoofusCanadensis nah, I've read some spring books... they're good
  255. dreamreal so the books still have value, plus books have authors with whom you can actually converse
  256. dreamreal unless you're a doofus, then they're like "dang, go away"
  257. Square i was mostly kidding
  258. dreamreal ~poe
  259. javabot Poe's Law states that "without a winking smiley or other blatant display of humor, it is utterly impossible to parody a Creationist in such a way that someone won't mistake it for the genuine article." Swap creationism for ANY extremist POV. Corollary: don't use sarcasm (or HUMOR) without being obvious about it.
  260. DoofusCanadensis I resemble that remark
  261. * NeXeN joined #java
  262. cheeser /3
  263. * michele joined #java
  264. DoofusCanadensis /4
  265. * michele joined #java
  266. Square ngl, just tried JPA criteria api with "window functions" and it seems to work.
  267. Square ...I'm impressed
  268. dreamreal why?
  269. dreamreal I mean, that's good
  270. dreamreal but why is it impressive?
  271. * NeXeN joined #java
  272. * NeXeN_ joined #java
  273. * NeXeN joined #java
  274. Square dreamreal, 1) I didnt know they had solved the group-wise max problem in SQL. 2) Can't ask for much more than working support in both h2 and hibernate.
  275. * NeXeN joined #java
  276. * stfstfm_ joined #java
  277. dreamreal That's good, but I'd have hoped those were baseline expectations :D
  278. dreamreal like "ooo, this is cool, this compiler works for simple inputs!" is... sort of not "cool," it's "what compilers should be doing"
  279. * raj joined #java
  280. * NeXeN joined #java
  281. * NeXeN_ joined #java
  282. * TomyWork joined #java
  283. Square dreamreal, My expectations on "corporate software tools" are really low.
  284. DoofusCanadensis that's weird
  285. Square .../java world
  286. * stfstfm joined #java
  287. dreamreal Square: that's interesting. Why would they be corporate software tools if they didn't work? Like, java's been around for 28 years... if it didn't work... why?
  288. * polarian joined #java
  289. * s3 joined #java
  290. * stfstfm_ joined #java
  291. Square dreamreal, Base functionality has worked, but there's always been lots of lose ends and half baked stuff. I'm referring to eco system stuff. Spring, Maven, hibernate, dbs, "Industry leading libraries" etc.
  292. Square Some of it is probably because of good reasons. Too expensive to change, no active maintainers, etc.
  293. * stfstfm joined #java
  294. * stfstfm__9374 joined #java
  295. * metalmaniac joined #java
  296. cheeser dreamreal: 30 years!
  297. dreamreal My first expeience with Java would have been 1998 - no, you know, you're right
  298. dreamreal I first encountered it around 1997, with 1.1, and it'd been out for a bit before that
  299. cheeser of course I am. ;)
  300. cheeser 1995
  301. deavmi happy bday cheeser
  302. deavmi I didn't read the backlog. I will assume you turned 30, ;)
  303. cheeser for the 3rd time! it's one of my favorite things to do.
  304. * stfstfm joined #java
  305. * rvalue joined #java
  306. * stfstfm_ joined #java
  307. * stfstfm_ joined #java
  308. * stfstfm joined #java
  309. * ultralan joined #java
  310. * sponkz joined #java
  311. * stfstfm_ joined #java
  312. * rvalue- joined #java
  313. * stfstfm joined #java
  314. * NeXeN_ joined #java
  315. * zorone joined #java
  316. * zorone joined #java
  317. * jbosmans joined #java
  318. * metalmaniac joined #java
  319. * jbosmans joined #java
  320. * NeXeN_ joined #java
  321. * zorone_ joined #java
  322. * henbruas_ joined #java
  323. * zorone_ joined #java
  324. * NeXeN_ joined #java
  325. * zorone_ joined #java
  326. * jreicher joined #java
  327. * mindCrime joined #java
  328. * NeXeN joined #java
  329. * LFK4 joined #java
  330. * Exagone313 joined #java
  331. * SJrX- joined #java
  332. * Cyp_ joined #java
  333. * JoelJoel joined #java
  334. * Disco joined #java
  335. * handicra- joined #java
  336. * gjvc joined #java
  337. * sponkz joined #java
  338. * sponkz joined #java
  339. * P1RATEZ joined #java