• cheeser
  • ernimril
  • joed
  • kinabalu
  • lunk
  • ojacobson
  • r0bby
  • ThaDon
  • ricky_clarkson
  • topriddy

« 2019-07-17


2019-07-19 »

Nick Message Date
LearnAllTheTime [LearnAllTheTime!~LearnAllT@2600:1700:e560:21e0::70a] has joined ##java [12:16]
macroprep [macroprep!] has joined ##java [12:17]
Markow [Markow!~ejm@] has joined ##java [12:17]
unixcat [unixcat!hyperreal@unaffiliated/serieux] has joined ##java [12:19]
djhworld [djhworld!~djhworld@] has joined ##java [12:39]
indistylo [indistylo!~aruns_@] has joined ##java [12:45]
Lengsdorfer [Lengsdorfer!~Lengsdorf@unaffiliated/lengsdorfer] has joined ##java [12:55]
karab44 [karab44!~karab44@unaffiliated/karab44] has joined ##java [12:57]
impermanence [impermanence!62a4a7df@gateway/web/cgi-irc/] has joined ##java [12:58]
indistylo [indistylo!~aruns_@2401:4900:2501:c0e6:f925:62c3:5d41:2548] has joined ##java [01:02]
Jantz [Jantz!] has joined ##java [01:03]
slosh [slosh!~slosh@] has joined ##java [01:11]
exonity01 [exonity01!uid364582@gateway/web/] has joined ##java [01:11]
sauvin [sauvin!sauvin@about/linux/staff/sauvin] has joined ##java [01:21]
Jantz hello im a newb and was wanting to know if anyone can help, i just updated Java and im getting this error when trying to run a simple program, Unable to locate executable for jre1.8.0_211?? [01:31]
DiabloD3 [DiabloD3!] has joined ##java [01:39]
v01d4lph4 [v01d4lph4!~v01d4lph4@] has joined ##java [01:42]
immibis [immibis!] has joined ##java [01:43]
kgrimes2_ [kgrimes2_!] has joined ##java [01:46]
Diablo-D3 [Diablo-D3!] has joined ##java [01:49]
masber [masber!815e0f98@] has joined ##java [01:53]
petsc [petsc!~petsc@] has joined ##java [01:54]
masber hi, I have a very weird issue with hk2/jersey/tomcat and Im a worry about it because I have no idea because it may be related to a bigger issue I have. I would like to contact the both hk2 and jersey mail lists or any sort of repository where I can ask questions, any idea? [01:55]
rwheadon [rwheadon!] has joined ##java [01:57]
Diablo-D3 [Diablo-D3!] has joined ##java [01:59]
indistylo [indistylo!~aruns_@] has joined ##java [02:00]
Jantz [Jantz!] has joined ##java [02:01]
palasso [palasso!~palasso@unaffiliated/palasso] has joined ##java [02:11]
sbeex [sbeex!~sbeex@] has joined ##java [02:22]
sunrunner20_ [sunrunner20_!~sunrunner@unaffiliated/sunrunner20] has joined ##java [02:22]
acidjnk [acidjnk!] has joined ##java [02:39]
paws_ [paws_!uid89121@gateway/web/] has joined ##java [02:46]
rnat [rnat!uid73555@gateway/web/] has joined ##java [02:47]
nutzz [nutzz!9fb60104@] has joined ##java [02:57]
nutzz Is there any quicker way to test the jstl, rather than restarting the server? [02:58]
fstd_ [fstd_!~fstd@unaffiliated/fisted] has joined ##java [03:01]
sauvin [sauvin!sauvin@about/linux/staff/sauvin] has joined ##java [03:06]
dpl [dpl!~dpl@] has joined ##java [03:07]
puppy_za [puppy_za!uid277586@gateway/web/] has joined ##java [03:08]
sbeex [sbeex!~sbeex@] has joined ##java [03:18]
ovalseven8 [ovalseven8!~ovalseven@unaffiliated/ovalseven8] has joined ##java [03:20]
ovalseven8 When a synchronized method throws an exception, is the lock/monitor free for other threads then? [03:21]
yawkat yes [03:22]
enoq [enoq!] has joined ##java [03:25]
bitwinery [bitwinery!] has joined ##java [03:26]
hypc [hypc!~Thunderbi@] has joined ##java [03:56]
emx [emx!] has joined ##java [04:11]
emx I run my application with That results in the trustAnchors parameter must be non-empty. says that the truststore is empty, not found or could not be opened. keytool -list -v does list what I expect and the process of the JWM has the same privileges as the user running [04:13]
emx keytool. What could be the reason for that exception? [04:13]
emx emx's title: "java - Error - trustAnchors parameter must be non-empty - Stack Overflow" [04:13]
Jantz [Jantz!] has joined ##java [04:16]
emx One weird thing I just noticed: shows me that the trustStore is read and interpreted correctly (that is I see the CN value) but the report says the type is JKS and not PKCS12...? [04:18]
themsay [themsay!~themsay@] has joined ##java [04:20]
DiabloD3 [DiabloD3!] has joined ##java [04:20]
Diablo-D3 [Diablo-D3!] has joined ##java [04:30]
AugustusCaesar24 [AugustusCaesar24!] has joined ##java [04:32]
rwheadon [rwheadon!] has joined ##java [04:38]
progart [progart!~kamee@] has joined ##java [04:38]
xa0s_ [xa0s_!xa0s@] has joined ##java [04:38]
Diablo-D3 [Diablo-D3!] has joined ##java [04:40]
mitch0 do you have any certs imported? [04:42]
mitch0 emx: [04:42]
mitch0 mitch0's title: "java - InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty - Stack Overflow" [04:42]
mitch0 (also, consider converting the trustStore to pkcs12 just to get rid of the warnings) [04:43]
HumanG33k [HumanG33k!~HumanG33k@] has joined ##java [04:46]
emx mitch0, The weird thing is that the keystore is PKCS12: keytool -genkeypair -alias foobar -keyalg RSA -keysize 2048 -storetype PKCS12 -keystore foobar.p12 -validity 9999 [04:47]
emx I check out that page [04:47]
emx mitch0, the only certificate in the keystore is the self-signed one. [04:49]
emx I did not import any certificats into the JVM's trust-store. [04:49]
Me4502 [Me4502!~quassel@unaffiliated/me4502] has joined ##java [04:53]
led_dark_1 [led_dark_1!~Thunderbi@] has joined ##java [04:55]
v01d4lph4 [v01d4lph4!~v01d4lph4@] has joined ##java [05:04]
learningc [learningc!] has joined ##java [05:04]
Gazooo [Gazooo!~Gazooo@] has joined ##java [05:07]
progart [progart!~kamee@] has joined ##java [05:22]
themsay [themsay!~themsay@] has joined ##java [05:24]
norkle [norkle!] has joined ##java [05:27]
Nicmavr [Nicmavr!~Nicmavr@unaffiliated/nicmavr] has joined ##java [05:28]
themsay [themsay!~themsay@] has joined ##java [05:28]
hojang [hojang!hojang@nat/redhat/x-usibkxtjxyuhihhv] has joined ##java [05:34]
KidBeta [KidBeta!~Kidbeta@hpavc/kidbeta] has joined ##java [05:35]
VegetarianFalcon [VegetarianFalcon!uid258908@gateway/web/] has joined ##java [05:40]
hussam [hussam!uid193284@gateway/web/] has joined ##java [05:43]
martiansoul [martiansoul!6f5d7832@] has joined ##java [05:44]
martiansoul my messages are not routing to the dead letter queue after failing a certain number of times. [05:44]
martiansoul This is my queue configurations: [05:46]
ovalseven8 [ovalseven8!~ovalseven@unaffiliated/ovalseven8] has joined ##java [05:48]
ovalseven8 When creating a library for Android. Does it make sense to use Akka for that or is it too heavyweight/incompatible for Android as a library? So, is Akka more for the end-user or also for library development? [05:49]
dreamreal ovalseven8: ask #android-dev? This is ##java. [05:54]
ovalseven8 [ovalseven8!~ovalseven@unaffiliated/ovalseven8] has joined ##java [05:59]
masuberu [masuberu!] has joined ##java [06:08]
Jantz [Jantz!] has joined ##java [06:12]
dob1 [dob1!~dob1@unaffiliated/dob1] has joined ##java [06:16]
dob1 hi, I know it's a bit OT but I try to ask. I have a java process that run an executable jar, like java -jar somejar.jar , I want to kill this process but just the one that is running this executable jar, not something like killall java [06:17]
dob1 (linux) [06:17]
ricky_clarkson ps aux | grep somejar [06:17]
ricky_clarkson kill just the PID that contains that in its command [06:17]
dob1 I have to extract the pid from this? [06:17]
yawkat or use htop. [06:18]
masuberu hi, I have a jersey app and eclipse complains about this line `return Response.status(response.getStatus()).entity(response.readEntity(String.class)).build();` saying `Potential resource leak: 'response' may not be closed at this location` why is there a risk if I am calling readEntity which closes the connection? [06:18]
dob1 I am trying ps aux |grep somejar |cut -f 2 [06:18]
dob1 but it doesn't work [06:18]
sonOfRa dob1: that may result in getting the pid for the process running ps [06:19]
sonOfRa use pgrep [06:19]
mniip [mniip!~mniip@freenode/staff/mniip] has joined ##java [06:19]
yawkat masuberu: presumably because eclipse doesnt know. [06:19]
yawkat thats why it says "may". [06:20]
dob1 sonOfRa, I don't find it with pgrep [06:21]
mbooth dob1: "pgrep java" will give all PIDs for java processes [06:22]
mbooth dob1: Don't forget you can get the PID of the last command with $! [06:22]
mbooth So you do "java -jar ... &" [06:22]
mbooth Then you can do "kill $!" [06:22]
yawkat yea thats much better if youre doing it programatically [06:23]
dob1 mbooth, but I am at the starting point, I don't want the pgrep java [06:23]
yawkat dont just grep the process list [06:23]
yawkat trying [06:23]
yawkat What are you trying to do? [06:23]
dob1 I wanna try pgrep filejar.jar [06:23]
hojang [hojang!hojang@nat/redhat/x-lvyvifcbqcbhdabc] has joined ##java [06:23]
yawkat why do you want to kill that jvm? why not just use systemd? [06:23]
v01d4lph4 [v01d4lph4!~v01d4lph4@] has joined ##java [06:24]
dob1 yawkat, I didn't want to create a unit for it [06:24]
yawkat why not? [06:24]
sonOfRa A unit for something like that is what, 2 lines? [06:24]
KidBeta [KidBeta!~Kidbeta@hpavc/kidbeta] has joined ##java [06:24]
dob1 yawkat, I know ho to create system unit, this will be user unit [06:25]
dob1 *how to [06:25]
sonOfRa put it mkdir -p ~/.config/systemd/user [06:25]
yawkat anyway, even if you dont want to create a unit, you should just make a pid file [06:25]
progart [progart!~kamee@] has joined ##java [06:25]
sonOfRa put the unit in that folder, and then systemctl --user start unit [06:25]
dob1 ok I can create a system unit that runs this command with my user, but keep all in my home [06:26]
dob1 ok I got it, I have to read a bit :) [06:26]
dob1 it's the best way [06:26]
sonOfRa If you want to start the unit on login, use enable. If you want to start it on *startup*, also use enable, but also enable lingering for your user's session [06:27]
dob1 no, for sure I don't want this [06:27]
dob1 what I need really is a a restart: "kill the last one and start a new one" [06:28]
dob1 *really need [06:28]
mbooth dob1: Why won't "kill $!" work for you? [06:29]
conan [conan!] has joined ##java [06:29]
dob1 mbooth, the problem is that this is a console program that runs on a remote server, sometimes I lost connections to this server and I have problem to reattach my session [06:31]
dob1 so it's not so important, I can just restart it and get the console output again [06:31]
mbooth dob1: What? What aren't you using screen or tmux? [06:32]
dob1 I know you are going to say this :) [06:32]
mbooth Teaching you how to use tmux is out-of-scope of this channel, but it's dead easy :-) [06:33]
dob1 I run tmux but on the my linux box and I have several sessions, one of them is the one attached to the remote server. But when I lost connection this just return to my linux home console [06:33]
KidBeta screen sounds like it would work [06:33]
dob1 I don't know how to do this, I tried running screen inside this tmux session, but it was a bad result [06:33]
dob1 and running a tmux inside another tmux doesn't feel a good idea [06:34]
yawkat what is the application youre running? [06:35]
mbooth dob1: Well you run tmux on the remote host, so you can reattach the session after logging in [06:35]
KidBeta you need to reattach the screen session once you reconnect [06:36]
mbooth dob1: You just need to hit the command prefix twice to control the nested session, IIRC [06:36]
mbooth (If you also run tmux locally like me) [06:36]
dob1 I want to keep tmux locally, some of my window is this remote connection (ssh), the there I will run screen, right? [06:37]
KidBeta ssh to the box and run screen yeah [06:37]
mbooth Yeah [06:37]
KidBeta then when the connection dies you reattach (you max have to use -x or -X iirc) [06:38]
dob1 or screenie? [06:38]
dob1 ok I will try, thanks for all the hints [06:40]
KidBeta so [06:40]
KidBeta ssh -> run screen -> do crap in screen -> connection dies -> ssh again -> run screen -x [06:41]
dreamreal tmux is better than screen, though [06:41]
mbooth tmux to the tmax [06:42]
dob1 KidBeta, yes, but I am inside a tmux window and I do this. I think the time I tried this I go some problems with the shortcut of screen and tmux together [06:42]
dreamreal heh [06:43]
dreamreal um [06:43]
KidBeta does tmux let you reattach if the session dies? [06:43]
mbooth Yes [06:43]
KidBeta you learn something new every day [06:43]
mbooth It's almost identical in operation to screen [06:43]
dreamreal it's just better [06:43]
KidBeta ive been meaning to use tmux more [06:43]
rruizt [rruizt!] has joined ##java [06:50]
Diablo-D3 [Diablo-D3!] has joined ##java [06:51]
ricky_clarkson I've used screen for so long, no idea how I'd benefit from tmux. [06:52]
sonOfRa If you're just using it for "disowning" processes, you won't. [06:53]
sonOfRa tmux is a lot nicer if you actually use it as a, well, terminal multiplexer [06:53]
ricky_clarkson Mostly for reconnecting to irssi, but sometimes for running multiple terminals, splitting vertically, horizontally, etc. [06:54]
KidBeta ricky_clarkson: lol thats exactly what i use screen for too [06:56]
dob1 tmux has a status bar too that you can configure [06:57]
dob1 (and the clock :) [06:57]
KidBeta ive been looking at uses tmux with fzf, bat and rg to try and do some code review stuff. [06:58]
ricky_clarkson $ date [06:58]
dob1 with the clock I mean ctrl b t [06:58]
macroprep_ [macroprep_!] has joined ##java [06:59]
earthy ricky_clarkson: the main difference between tmux and screen is that tmux decouples the concept of a window set from the concept of a session [06:59]
earthy where you can attach multiple tmux clients to the same session and see the exact same window in each session, screen only has a shared window set [07:00]
earthy (you can also add a new session to a window set in tmux) [07:00]
earthy note: the naming might not correspond to tmux's docs. :) [07:01]
Diablo-D3 [Diablo-D3!] has joined ##java [07:01]
earthy and tmux lets you control it programmatically much easier so that you can get scripts to spawn new windows and such quite comfortably [07:01]
DiabloD3 [DiabloD3!] has joined ##java [07:11]
mniip [mniip!mniip@freenode/staff/mniip] has joined ##java [07:18]
jadesoturi [jadesoturi!~jadesotur@unaffiliated/kfj] has joined ##java [07:30]
bn_work [bn_work!uid268505@gateway/web/] has joined ##java [07:31]
DonRichie [DonRichie!] has joined ##java [07:32]
hojang [hojang!hojang@nat/redhat/x-pnsecuatkohgobvg] has joined ##java [07:37]
zeden [zeden!~user@unaffiliated/zeden] has joined ##java [07:39]
dob1 parted the channel: "Leaving" [07:44]
masuberu [masuberu!] has joined ##java [07:59]
masuberu hi, is it a bad thing to have many http-nio and ajp-nio parked in a tomcat application? [08:00]
masuberu I am monitoring the app using visualvm [08:00]
cheeser just means the app is idle [08:00]
masuberu ok, monitor means blocked? [08:01]
masuberu I guess monitor is a bad thing [08:02]
cheeser blocked means blocked, iirc [08:05]
immibis parked also means blocked [08:11]
cheeser does it? [08:11]
immibis park is an internal mechanism used to implement several types of locks, IIRC [08:13]
cheeser nods. [08:13]
tomboy64 [tomboy64!~tomboy64@gateway/tor-sasl/tomboy64] has joined ##java [08:14]
immibis but also queues. blocked on a lock is bad (because it means your program is overloaded), blocked on an empty queue is good (because it means your program is underloaded(?)) [08:15]
masuberu im lost [08:18]
masuberu then how when to worry in regards my parked threads? [08:19]
mbooth masuberu: Are you observing a concrete problem? [08:19]
nokdoot [nokdoot!~nokdoot@] has joined ##java [08:20]
codecutter [codecutter!] has joined ##java [08:20]
codecutter if you return a callable do you still need the synchonrized keyword? [08:20]
masuberu yes, my app that runs in tomcat becomes unresponsive [08:20]
masuberu and I am trying to find out why [08:20]
codecutter i need a method to be thread safe [08:20]
dreamreal codecutter: those are not ... [08:20]
masuberu today for instance I had to reboot tomcat twice [08:21]
dreamreal Lucky day, then. I'd have expected more. [08:21]
cheeser ha! [08:21]
immibis codecutter: if you buy a pack of condoms from the store do you still need a hard hat? I need an adventure to be safe [08:22]
codecutter okay, okay dude... [08:23]
immibis analogies are hard. good ones are even harder. that's not innuendo I promise [08:24]
dreamreal codecutter: What are you trying to accomplish? What does your callable do? [08:24]
dreamreal synchronized isn't magic threadsafe sauce [08:24]
Kemikals [Kemikals!] has joined ##java [08:25]
conan [conan!] has joined ##java [08:41]
Jantz [Jantz!] has joined ##java [08:46]
[twisti] right, thats volatile [08:53]
[twisti] pours a generous helping of keywords on his source [08:53]
[twisti] git commit -a -m "Made all the code thread safe" && git push [08:53]
CookieM [CookieM!] has joined ##java [08:55]
KidBeta lol [08:57]
Jigsy [Jigsy!~Jigsy@unaffiliated/jigsy] has joined ##java [08:58]
ravenousmoose [ravenousmoose!~ravenousm@] has joined ##java [08:59]
Human_G33k [Human_G33k!~HumanG33k@] has joined ##java [09:00]
Human_G33k [Human_G33k!~HumanG33k@] has joined ##java [09:01]
rcm888 [rcm888!~u1@] has joined ##java [09:02]
rcm888 cannot set frame undecorated; the frame is displayable [09:05]
[twisti] syntax error [09:07]
dreamreal rcm888: ... what? [09:07]
rcm888 dreamreal: frame.setUndecorated(true); // IllegalComponentStateException [09:08]
dreamreal ah [09:09]
rcm888 dreamreal: says the frame is displayable [09:10]
rcm888 dreamreal: JRE 1.6 [09:11]
dreamreal Well, it's UI, I'm no use; plus, it's Java 1.6, yikes. [09:11]
Jigsy [Jigsy!~Jigsy@unaffiliated/jigsy] has joined ##java [09:13]
indistylo [indistylo!~aruns_@] has joined ##java [09:14]
firewyre [firewyre!] has joined ##java [09:19]
waz [waz!~waz@pdpc/supporter/active/waz] has joined ##java [09:19]
mindCrime [mindCrime!~mindCrime@] has joined ##java [09:23]
surial rcm888: you have to update the decoration BEFORE the thing is rendered. [09:25]
indistylo [indistylo!~aruns_@] has joined ##java [09:26]
surial rcm888: you can take the panel of the frame (frame.getComponentsomething or other, it's been a long time. also, given that you're on literally 10+ years out of date shit, I have to ask: Swing or AWT)? ? and add it to a new frame. so, make a new frame, give it some decoration, then add the entire panel (which removes it from where it was; a component can only be in one place). This has its own issues; best option is to pick a [09:26]
surial decoration, set it as y ou create the JFrame, and never touch it again. [09:26]
Jantz [Jantz!] has joined ##java [09:28]
rcm888 surial: but how am I supposed to switch into fullscreen on the fly? [09:29]
fragamus [fragamus!] has joined ##java [09:29]
surial make a new jframe, make it undecorated and screen-large, and invisible. [09:29]
surial and ensure the whole app is in a single JPanel (which by default is true or trivial to realize in swing). Take the panel, add it to the big jframe and make that visible, and the other one invisible: That's fullscreen. [09:30]
surial Reverse it for back-to-windowed. This has various shitty sideeffects but then, hey, you're writing a fucking full screen GUI app in swing. It's.. gonna hurt. Note that things like minecraft and co are written in various java2d libs, different beast. [09:30]
surial rcm888: ^^ [09:30]
surial oyu might also want to mess with .setAlwaysOnTop. That'll probably have mixed effects. [09:31]
surial rcm888: also: GraphicsDevice gd = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice(); and then: gd.isFullScreenSupported()? If yes, gd.setFullScreenWindow(this); [09:32]
surial (this being the jframe) [09:32]
indistylo [indistylo!~aruns_@] has joined ##java [09:33]
rcm888 terrifying... [09:33]
surial and then on mac you need to do something else, except the modern JDKs for osx no longer support any of the specific apple stuff, so nevermind that. It'll look like ass too. I know. I commisserate. [09:33]
surial you're using 15+ year old stuff. It still works, but the world kinda moved on. [09:33]
surial java moved on, mostly to web apps. A little bit to javafx. JVMs moved on (or were they ever there to start with?), away from desktop/local running, to running in the cloud. [09:34]
rcm888 yes I'm just learnign java. try do accomplish tutorial of year 2016... [09:35]
surial minecraft showed up somewhere half way through and went: Yeah okay well that's nice but y'all can go suck on a stick. Imma doing this! leeeeeeroy jenkinnnnns and is a game written with a tech nobody ever used before or since or anything else and is throwing middle fingers out at all received wisdom of what to write games in :P [09:35]
surial rcm888: I advise you not to take the swing stuff _TOO_ seriously; I'd focus on learning the language and libraries for DBs, collections, data manipulation and calculation etc. The GUI stuff, eh, enough to get by and make some fun stuff while you're learning is all. [09:36]
cheeser learn javafx not swing. [09:36]
surial If I had to guess, I'd say 80%+ of the frontend work java devs do at all is HTML+javascript+CSS based. [09:36]
dreamreal plus, minecraft's using ... opengl, no? [09:36]
dreamreal I thought minecraft's problem was in not using java worth a damn, not "using crappy APIs" [09:36]
surial the rest? Mostly don't do any frontend work, or do frontend-doesnt-matter work (maybe a super simple fucking ugly bad UX swing app because it just does not matter: 1 or 2 people monitored by the programmer themselves do some clicking around, and they get a personalized tutorial). That leaves MAYBE 1% that do real UI work in swing or javafx. [09:37]
surial dreamreal: opengl or g2ld or something not swing and not javafx, yes. [09:37]
greenfructose [greenfructose!~greenfruc@] has joined ##java [09:37]
dreamreal opengl is, uh, pretty common [09:38]
dreamreal it's hardly "tech nobody ever used before or since or anything else" [09:38]
surial cheeser, rcm888: I think cheeser is trying to indicate: _IF_ you're going to spend serious effort learning a front end java UI technology, javafx is a much better idea than swing, it being better and newer. However, my advice is to not focus on learning front end java tech whatsoever, but I understand it's fun to see things move and that makes learning easier and more enjoyable. So, if this tutorial you are following is doing [09:38]
surial swing, stick with it, just, don't go out of your way to learn every widget under the sun or whatnot. You won't spend your pro career being thankful you learned all about swing, no matter what you end up doing. [09:38]
surial dreamreal: opengl from java in the way minecraft is doing it is quite novel. [09:39]
KidBeta dreamreal: id says vulkan is more popular then OGL now days. [09:39]
dreamreal surial: okay. [09:39]
progart [progart!~kamee@] has joined ##java [09:40]
mf7 [mf7!~user@] has joined ##java [09:40]
DTZUZO [DTZUZO!] has joined ##java [09:43]
anirban [anirban!0e6212f6@gateway/web/cgi-irc/] has joined ##java [09:44]
anirban Hi. I have a question relating to using jni with C++. My use case is that I need to create an object in C++, pass it to Java, pass it back from Java to C++, and use the functions of that object in C++. Can anyone please help me out or guide me to a resource that discusses this, [09:45]
anirban Thank you for your time. [09:45]
surial anirban: that isn't really how you do it. [09:48]
surial anirban: you can pretty much only pass primitives and java things from C to java and back. [09:48]
surial YOu can't pass a C object. [09:48]
anirban Oh, okay, thanks. [09:48]
anirban ) [09:48]
surial also, everytime you mess with the java end of things it's.. not gonna be efficient. [09:48]
anirban Is it possible to keep a resource open in C++? Like a file [09:49]
anirban Instead of having to open it each time a function call is made. [09:50]
surial best way to employ JNI is to give one short and simple task description from java to C, then have the C code spend a long time doing the job, and then report on its result back to java using as little traffic as possible. For example, java code generates a text and some instructions, and then calls on C code to go manage the GFX card's facilities to do some parallellized hashing of the text + a random number or whatnot, and once [09:50]
surial it finds a bitcoin mine hit, feeds it back to java. That'd be the optiomal scenario. [09:50]
surial anirban: you can; just pass the file handle to java, that's a primitive. [09:50]
surial isn't it? Isn't it just a number? [09:50]
surial otherwise; I'm pretty sure you can claim some memory on the C side; just leave your file handle there. [09:50]
anirban Oh, okay, I will try that. [09:51]
Anticom [Anticom!~Anticom@] has joined ##java [09:51]
anirban Can I pass a pointer addresses back and forth? [09:57]
anirban What is the Java primitive equivalent of void *? [09:58]
indistylo [indistylo!~aruns_@] has joined ##java [10:02]
surial anirban: you can't. [10:03]
surial you can pass it in as a long I guess. [10:03]
anirban Okay [10:03]
surial long or int, in other words. [10:03]
Katana [Katana!~hentai@unaffiliated/katana] has joined ##java [10:04]
progart [progart!~kamee@] has joined ##java [10:07]
minos_ [minos_!] has joined ##java [10:08]
themsay [themsay!~themsay@] has joined ##java [10:10]
progart [progart!~kamee@] has joined ##java [10:18]
esro [esro!~esro@] has joined ##java [10:21]
indistylo [indistylo!~aruns_@] has joined ##java [10:23]
stefuNz [stefuNz!] has joined ##java [10:24]
greggerz [greggerz!~greggerz@unaffiliated/greggerz] has joined ##java [10:32]
gareppa [gareppa!~gareppa@unaffiliated/gareppa] has joined ##java [10:33]
hexyul [hexyul!~omonk@unaffiliated/omonk] has joined ##java [10:42]
jamezp [jamezp!~jamezp@redhat/jboss/jamezp] has joined ##java [10:42]
Wilfredor hi [10:43]
dreamreal hi [10:43]
Wilfredor how I could check if a string isBlank and isNumeric with only a function? [10:43]
Wilfredor for example [10:43]
dreamreal write a method for that purpose, simplest approach [10:43]
Wilfredor if (!StringUtils.isBlank(myString) && StringUtils.isNumeric(myString)) { [10:43]
Wilfredor I want to do the same check but only with a function [10:44]
cheeser so write one [10:44]
dreamreal boolean isNumericAndNotEmpty(String s) { return ... } [10:44]
Wilfredor ok [10:44]
yawkat blank strings arent numeric anyway [10:45]
Wilfredor Maybe is ok use only if (StringUtils.isNumeric(myString)) { [10:45]
conan [conan!] has joined ##java [10:45]
surial Wilfredor: no. [10:46]
surial Wilfredor: your requirement is bad code style. [10:47]
orbyt_ [orbyt_!~orbyt@] has joined ##java [10:47]
surial 'is blank' and 'is numeric' are utterly unrelated concepts. [10:47]
progart [progart!~kamee@] has joined ##java [10:47]
Wilfredor maybe i need just perform a isNumeric [10:47]
surial You might as well make a method called isGunOrGrandma. It'd be dumb code that is worthy of a denial on code review. [10:47]
surial Wilfredor: take one step back. [10:47]
yawkat surial: any blank string is not numeric, so the blank check is superfluous [10:48]
Wilfredor yawkat, i think that you are right [10:48]
surial Yes, if you turn it around (the string must be a number, and also, not blank) ? then the 'also not blank' is indeed useless; any string that is a number is by definition nonblank already. [10:48]
surial Wilfredor: it sounded like you wanted to reverse: Is this string EITHER blank OR numeric. [10:48]
surial That question is the 'guns and grandmas' one, where you both [A] should not expect there to exist a method that can do that, as well as [B] you shouldn't write it, or if you do, definitely don't call it .isBlankOrNumeric. Code style violation. [10:49]
Wilfredor no, its a AND [10:49]
surial Okay, well, then isNumeric is fine. Note that classes named XUtils from non-jdk packages are also a code smell. StringUtils.isNumeric seems stupid to me. [10:49]
surial You're looking for Integer.parseInt. [10:50]
Wilfredor surial, interesting, Im using sonarlint [10:50]
surial linting is an opinionated affair. [10:50]
cheeser Double.parseDouble actually [10:50]
surial or that. [10:50]
cheeser but an isNumeric() is fine because you'll want to wrap all the try/catch shit and just capture the boolean return. [10:51]
surial sonarlint holds a few opinions, but generally elects to avoid opinionated lint checks. Crucially, to KNOW that StringUtils.isNumeric is a bad idea requires to hardcode StringUtils, the name, into sonarlint. That's a little offensive, so sonarlint doesn't do it. presumably; I can't speak for the authors/maintainers. [10:51]
cheeser so, not stupid, per se, but it approaches padLeft levels of just write it yourself laziness :) [10:51]
surial It's AN evil. Not some sort of must-avoid-at-all-costs one; if you have a job to do and some XUtils class you found does it and does it well, you do what you gotta do. But first think if that's the only way. Here, it is not. Hence: Don't. [10:51]
surial cheeser: that, and also, WHY would you want to check if a string contains a number? [10:51]
Wilfredor surial, that is another problem [10:52]
surial I'm having a bit of a hard time really figuring it out. Perhaps some sort of validator framework where you validate ONLY and some other code will end up actualy transitioning the data on its way to its target, but that entire design seems silly. Just combine these jobs. [10:52]
surial Perhaps it's a thing where you receive data from across a boundary and the boundary dictates that even numbers are transitted as strings, and you're IMMEDIATELY going to transit this data across another boundary, again one that sends numbers as strings. Which makes me question the APIs on both sides, but, okay. Perhaps your java code wants to check that the input is in fact numeric but otherwise just passes it through. [10:53]
surial That seems like an exotic case and one where it's still shite API. [10:53]
rhelic [rhelic!uid188470@gateway/web/] has joined ##java [10:53]
surial If you are committed to these shite APIs and it's not feasible to write a wrapper to clean them up, yup. You found a use case. But that's ridiculously rare, and digging for an XUtils.isNumeric kinda method over writing it yourself just screams: We write bad, unmaintainable shite here. It's an easy enough conclusion to draw based on very little; usually when you oversee the whole code base it's rarely this bad. [10:54]
surial Doesn't change the base facts: This sounds funny, and not in a good way. I'd advise anyone calling StringUtils.isNumeric to have a think or two about how they'd designed things. [10:54]
Wilfredor Anyway thank you very much for clarifying the doubt, the other assumptions will possibly be part of another task [10:56]
zeden [zeden!~user@unaffiliated/zeden] has joined ##java [11:01]
emx [emx!] has joined ##java [11:09]
emx I get these massively useful log entries like "2019-07-18 17:08:17.281 WARN 2844 --- [io-44001-exec-1] o.s.s.c.bcrypt.BCryptPasswordEncoder : Encoded password does not look like BCrypt". How do I get the stack trace of it? [11:09]
cheeser there may not be a stacktrace. it's just a log entry. [11:09]
emx Hm... makes sense [11:10]
yawkat it's also just WARN. that usually indicates execution continued [11:11]
yawkat presumably it just failed pw verification at that point. [11:11]
yawkat depending on log framework you may be able to log stack trace anyway with the right config [11:11]
paws_ [paws_!uid89121@gateway/web/] has joined ##java [11:13]
emx yawkat, How is that called? Or can you point me to the documentation? [11:17]
yawkat well, it depends on your log framework... [11:17]
emx yawkat, uhm.. what spring uses :) [11:18]
orbyt_ [orbyt_!~orbyt@] has joined ##java [11:18]
manualcrank [manualcrank!] has joined ##java [11:20]
EmmaT [EmmaT!] has joined ##java [11:21]
Markow [Markow!~ejm@] has joined ##java [11:30]
themsay [themsay!~themsay@] has joined ##java [11:32]
x256 [x256!] has joined ##java [11:33]
prskavec [prskavec!~detlef@pdpc/supporter/active/prskavec] has joined ##java [11:39]
prskavec [prskavec!~detlef@pdpc/supporter/active/prskavec] has joined ##java [11:40]
cixx_ [cixx_!~user@] has joined ##java [11:42]
KrakenHH [KrakenHH!] has joined ##java [11:48]
RedSoxFan07 [RedSoxFan07!] has joined ##java [11:50]
HumanG33k [HumanG33k!~HumanG33k@] has joined ##java [11:52]
dpl [dpl!~dpl@] has joined ##java [11:54]
fragamus [fragamus!] has joined ##java [11:56]
surial emx: A bcrypt encoded password looks like $2a$10$abcd where: [11:56]
surial emx: 2a is always 2a or possibly just 2 or 2b or 2y. 10 is usually 10 (it's how 'difficult' the bcrypted password is; 10 is the default; always an integer)< and abcd is about 24 arbitrary characters a-zA-Z0-9. [11:56]
surial emx: usually you find these in a DB column named 'password' or 'passwordhash'. [11:56]
surial emx: presumably there was something in there that wasn't one of these. [11:57]
surial emx: I cansee how a stack trace would be useful. What log framework are you using? [11:57]
surial oh, 'what spring uses'. uh... [11:57]
surial looks like log4j2 front into logback back out of the box? [11:58]
untitled if I have to inject several beans, what is the best place for them, controller or service? [11:58]
conan [conan!] has joined ##java [11:58]
untitled (talking about spring) [11:58]
cheeser the first part of the question has 0 to do with the second. [11:59]
untitled I mean should I only use 1 injection in 1 controller? Is it bad practise to inject many beans into a controller? [12:01]
dreamreal no [12:02]
untitled some say that @Autowired in services (business logic) is band [12:02]
untitled bad [12:02]
cheeser inject what you need. if you need a lot you're probably doing too much in one chunk of code. [12:02]
dreamreal ^^^ [12:02]
dreamreal @Autowired can be difficult [12:02]
dreamreal it's not the same as "bad" [12:02]
HumanG33k [HumanG33k!~HumanG33k@] has joined ##java [12:05]
emx surial, logback sounds familiar... [12:07]
emx surial, I forgot to convert PHP generated $2y$ hashes to $2a$. The application does now what I expect. Thanks for reminding me of the ABC ^^ [12:11]
EmmaT [EmmaT!] has joined ##java [12:11]
zeden [zeden!~user@unaffiliated/zeden] has joined ##java [12:15]
Anthaas [Anthaas!~Anthaas@unaffiliated/anthaas] has joined ##java [12:22]
SanguineAnomaly [SanguineAnomaly!] has joined ##java [12:22]
jesmon [jesmon!] has joined ##java [12:37]
conan [conan!~conan@] has joined ##java [12:39]
progart [progart!~kamee@] has joined ##java [12:39]
BilldaCat [BilldaCat!] has joined ##java [12:40]
BilldaCat Newbie question here -- I'm trying to basically build an associative array with a key, since when I'm looping through my values, I need to possibly replace values if the key already exists. Right now, I basically have a HashMap of key,ArrayList(MyObject) that populates correctly -- the problem is, during the loop where I'm setting the ArrayList instead of adding it to the end if it matches, the ArrayList is obviously going to get out o [12:43]
BilldaCat order, and I need to maintain the order. I know I'm using the wrong type here since ArrayList doesn't guarantee the order. What's the easiest way to fix this? [12:43]
dreamreal Why are you not using a Map? [12:44]
dreamreal javadoc LinkedHashMap [12:44]
dreamreal dreamreal: [JDK: java.util.LinkedHashMap] [12:44]
BilldaCat sorry, was putting my pastebin link together. will take a look at LinkedHashMap, thanks. here's what I had if it matters. [12:48]
surial BilldaCat: this seems extremely inefficient. [12:49]
dreamreal also consider TreeMap, depending on your key types [12:49]
surial BilldaCat: map.get(x) is a million times faster than for (var entry : map.entrySet()) if (!entry.getKey().equals(x)) continue;. [12:49]
surial BilldaCat: here you do almost equals but equalsIgnoreCase. That is trivially fixed by using treemap and using the String.CASE_INSENSITIVE_COMPARATOR as compartor. [12:50]
surial then you can just do map.get(buildAllocKey(alloc));. [12:50]
cheeser ArrayList doesn't guarantee the order? [12:50]
surial HashMap doesn't. [12:50]
cheeser i know *that* :) [12:50]
surial Better yet, you can do: List<ControlSheetSection> list = map.computeIfAbsent(buildAllocKey(alloc), k -> ArrayList::new); [12:50]
cheeser BilldaCat: did you mistype up there? [12:50]
surial This will always reutrn a list; it might be empty. [12:50]
surial cheeser: I think so. [12:51]
SmearedBeard [SmearedBeard!~SmearedBe@unaffiliated/smearedbeard] has joined ##java [12:51]
surial pastebin [12:52]
surial Please paste your code and any errors online. For runnable main-classes, try . For general code and errors, use for instance or [12:52]
BilldaCat it probably is. I'm looking through 12 sets of data, which may or may not have all the key->values I need .. not sure how best to explain it. Set 1 may have a, a1, a2, a3, b, b1, c, c1, c2, d with associated values, and the next set may have a, a3, a4, a5, e, f, g .. where i'd want to overwrite a3 in this case, and add any missing elements. [12:52]
surial 'in this case' -> what's 'this case', here? [12:52]
surial because the alloc object, whatever that is, contians key = a and pos = 3? [12:52]
BilldaCat right -- the allockey matches, so I need to replace the arraylist there, not add a new one [12:53]
BilldaCat but keep the order [12:53]
sainathvd [sainathvd!~sainathvd@] has joined ##java [12:54]
surial BilldaCat: your code will loop through every entry in 'lineItemMap'. Every time the item fails to match you increment position... [12:55]
surial why? [12:55]
surial if you're looking for b4, why are you then incrementing position to 5 when you realize that 'a' is not equal to 'b'? Why does that mtter? [12:56]
surial alloc.getAllocation(); // your names are wonky. Appearntly you have 2 unrelated concepts both called 'allocation', or at least, one called 'alloc' and another called 'allocatin', that's.. not good. [12:57]
BilldaCat thought I was doing that so I'm setting foundAtPosition correctly, so I'm setting/overwriting the proper arraylist on line 24 [12:57]
jesmon [jesmon!] has joined ##java [12:58]
surial BilldaCat: [12:59]
surial note how this code is way smaller and yet includes more of the stuff you left off. [12:59]
surial The one thing I'm not doing here that your code did, is 'increment the position on not found', because I have no idea why you are doing that. [12:59]
surial BilldaCat: No, the position has zzero effect on which arraylist as affected. [01:00]
surial position affects which slot within the arraylist is affected. [01:00]
surial look at my paste which is clearer than yours, by parameterizing alloc and position. [01:00]
BilldaCat yeah, reading it now - thanks [01:00]
rruizt [rruizt!] has joined ##java [01:00]
surial What my paste does is: search the map for key "key of thingie you wanted" and then do nothing with (presumably you do want to do something with it; not sure what) it if found. If it is not found, create it, and put it in the right place, padding the lits with nulls in order to ensure that position exists in the first place. [01:01]
surial So, if I pass in an alloc that has key value 'c', and a position of '5', then it'll look through the map for the list of CSS associated with key 'c', and will then take the arraylist, creating it if necessary, pad it so that .get(5) will work (so, 6 items then) if needed using nulls, and then create a new CSS if needed or fetch what's already there, and write it into the list. [01:02]
velix A friend gave me these lines to run a pretty complex java app. Are the settings okay? JAVA_OPTS="-server -XX:TargetSurvivorRatio=75 -XX:SurvivorRatio=64 -XX:MaxTenuringThreshold=3 -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:ParallelGCThreads=4 -Xms32m -Xmx10g -XX:MaxMetaspaceSize=50m [01:02]
dreamreal velix: does it work? [01:02]
cheeser tech support [01:03]
cheeser Hello, ##java is not a technical support channel for your Java apps or virtual machines; it's a development channel for enthusiasts to discuss programming with the Java language. Please ask the vendor of your software for support if you're having trouble with it. [01:03]
BilldaCat surial: ok - i'll play around with it. appreciate the help - I know I'm doing this incorrectly, new to Java and I know how I'd want to do this in other languages, but haven't figured out (and am just simply not aware) of all the methods I can use to do what I want in this case [01:03]
surial velix: they don't imply 'wipe the harddisk then turn into a grenade' if that's what you're asking. They are highly unlikely to accomplish anything useful unless your friend knows precisely what app you're trying to run on this VM. [01:03]
led_dark_1 [led_dark_1!~Thunderbi@] has joined ##java [01:03]
velix surial: Ah, I see. What's the best way to get the optimal settings? Pay a consultant? [01:04]
surial BilldaCat: well, .computeIfAbsent lets you do, in one operation: Get if it is there, and make it if not and then return that. treemap lets you define a comparator as key function; we pass in the case insensitive comparator. With that comparator, "FoOO" is equal to "fooO". The rest is just.. basic coding 101 really. [01:04]
surial velix: possibly. Or just fuck about. Generally just java <name of app here> is pretty good. [01:04]
velix -Xmx10g was pretty important ;) [01:06]
surial I doubt any of that crap will make it faster. usually these settings mostly just make the app's warmup phase go a little faster, long term it'll change fuck all. Java adjusts on the fly if you give it no settings and works its way towards efficiency. You can try to enable fancy new alpha-mode garbage cllecots which is what that XX:+blahblahGC options do, but they are alpha for a reason. also on JDK12 and co thse things are [01:06]
surial already enabled by default, so, mostly, just.. run stuff on modern JVM installs and it'll run faster than that shit. [01:06]
surial velix: -Xmx10g just tells java it can grab more memory than it normally would. [01:06]
velix surial: I've got enough of it, but let me try without [01:07]
surial velix: specifically: 10 gb worth. If you're trying to go for fast, -Xms10g is better (which means: Grab 10gb immediately on startup and fail if you can't. -Xmx means: Continue to attempt to grab memory if needed up to at most 10gb, and silently do NOT fail if you can't get that much, just work with what you have). [01:07]
surial Generally if you want reliability (as in: Either do the thing and do it fast, or fail fast if you can't do what I want. 'do' here being: Use 10gb of ram). [01:07]
surial So, if you want reliability, your -Xms and -Xmx params should be equal. [01:07]
velix ok [01:07]
surial the maxmetaspacesize is basically irrelevant and is likely only to hurt. the GC options.. I vaguely recall these are already out of date. -server does nothing. the survivor ratios are tweak settings for the GC. I doubt they'd help much here. [01:08]
surial that explains all of them. [01:08]
yawkat its odd that theres no default max metaspace. [01:08]
surial velix: the -Xmx10g is likely to make a huge difference IF your app really needs that much. All the rest? I doubt it. [01:09]
yawkat it just fills up forever. [01:09]
surial yawkat: if you run over the configged maximum, what happens? OOME in the classloader? [01:09]
yawkat same as with permgen. [01:09]
surial ... which is...? OOME in the classloader? [01:09]
impermanence [impermanence!c01c0140@gateway/web/cgi-irc/] has joined ##java [01:09]
yawkat i believe so yes. [01:09]
velix OOME = only one meth exists? [01:09]
surial out of memory error [01:10]
velix only old mom's e... oh ok [01:10]
surial velix: okay, so we have determined what the XX:MaxMetaspaceSize=50m does. [01:10]
surial velix: if the app is properly written and does not have a classloader-based memory leak bug (and doesn't load a metric arsefuckton of classes), this setting does literally stone cold nothing. [01:11]
surial velix: whereas if the app is either improperly written due to having a classloader-based memory leak, or it loads a gigantic pile of classes, your app will crash entirely. [01:11]
surial (not immediately, eventually). [01:11]
velix I see. [01:11]
velix surial: Web says: "By default Metaspace in Java VM 8 is not limited, though for the sake of system stability it makes sense to limit it with some finite value." [01:12]
surial velix: XX:+UseConcMarkSweepGC implies -XX:+UseParNewGC; therefore that is completely useless. [01:13]
surial velix: I think I found your problem. [01:13]
surial velix: your friend is an idiot. [01:13]
cheeser ease up [01:13]
velix surial: Java's changing fast. [01:13]
surial velix: yes, limit it in order to ensure your VM just crashes nicely instead of bogging down eating ever more memory until it eventually grinds to a halt, having run dog slow for the last few hours as it tried to do the jobs assigned to it with very little actual memory. [01:14]
surial velix: .... but that scenario only happening if there's a classloader bug. Which certainly can be. I'd have preferred some limit, or perhaps some watchdog that will put a stop to a linearly increasing load but is okay with an initial spike (just in case you have a TON of classes to load). [01:14]
velix okay [01:14]
surial velix: messing with the classloaders, well, here be dragons and all that. It might help, it might hurt. A lot depends on the app, a lot depends on what the app's tasked to do. You can try those settings if you like, perhaps your friends tuned the heck out of it (but the presence of a param that seemingly does nothing puts that notion in doubt). [01:16]
surial I really doubt these settings are anywhere close to a good idea on JDK12 though. That's messing with GCs that have been in java since 1.6, and there's a lot of fun new stuff, GC-wise, in newer versions. [01:16]
velix dreamreal: yes, it does. Sorry, didn't see the message [01:17]
velix acidjnk: recommended to use +UseG1GC ? [01:18]
velix oops ... no ":" [01:18]
velix mmh ... java.lang.OutOfMemoryError: Java heap space [01:19]
surial velix: Did you take the -Xmx10g out? That's the ONE setting in that whole pile that definitely has quite a marked effect. [01:19]
velix surial: I've lowered it a bit ;) [01:19]
conan [conan!~conan@] has joined ##java [01:19]
surial I'm not quite sure what the -Xmx default is. also, uh.. what does java -version print? [01:19]
velix command not found [01:19]
velix just joking :D [01:19]
dreamreal surial: it's dependent on system memory [01:19]
velix no wait [01:19]
velix -bash: java: command not found [01:20]
velix DDD [01:20]
velix No joke! [01:20]
surial velix: how the fuck are you running this thing then? :O [01:20]
velix I am stupid, It's inside of a container. I am sooo stupid. [01:20]
velix Sttupppiddd [01:20]
SmearedBeard [SmearedBeard!~SmearedBe@unaffiliated/smearedbeard] has joined ##java [01:20]
surial ah, well then. push the ram limits on the container some :P [01:20]
dreamreal which container? [01:20]
cheeser this is tech support and should be taken somewhere else. [01:20]
velix surial: Nah... I've got 64 GiB of RAM. so ... pff [01:20]
dreamreal If it's docker, you may want to tell java specifically how much RAM to access [01:20]
velix dreamreal: 1 sec [01:20]
dreamreal also depends on what version of java you're running [01:21]
velix dreamreal: openjdk:8-jdk [01:21]
dreamreal okay, yeah, you want to give it the memory constraints. how much RAM are you giving the docker containers? [01:21]
velix dreamreal: Endless. But I'm not using docker. [01:21]
v01d4lph4 [v01d4lph4!~v01d4lph4@] has joined ##java [01:22]
dreamreal ah, okay. [01:22]
velix dreamreal: I'm a podman, baby. [01:22]
velix Completely (!!) rootless containers. [01:22]
cheeser velix: take this somewhere else, please. [01:22]
cheeser last time I ask. [01:22]
velix cheeser: What did you ask? [01:23]
cheeser tech support [01:23]
cheeser Hello, ##java is not a technical support channel for your Java apps or virtual machines; it's a development channel for enthusiasts to discuss programming with the Java language. Please ask the vendor of your software for support if you're having trouble with it. [01:23]
velix ok sorry [01:23]
cheeser i've asked 3 times now that this go somewher eelse. [01:23]
velix parted the channel: "Leaving" [01:23]
progart [progart!~kamee@] has joined ##java [01:33]
ranbox2d [ranbox2d!699cf2a4@] has joined ##java [01:38]
Galactus [Galactus!~Galactus@unaffiliated/galactus] has joined ##java [01:44]
ranbox2d hi, i'm having trouble figuring out what data type to use, or would like ideas on how to upgrade my class [01:44]
ranbox2d [01:45]
ranbox2d I want a key-value data type where i can control and modify order [01:45]
sebhoss [sebhoss!sid168260@gateway/web/] has joined ##java [01:46]
ranbox2d so far i have a linkedhashmap, and a few functions to get and put by index, i didn't implement remove or a few other stuff because i don't need them [01:46]
ranbox2d but one more necessary thing is changing the index of a key-value entry [01:47]
dreamreal um... if the map key is an integer, what's the difference when using an index? [01:47]
ranbox2d or something like swapping 2 elements [01:47]
dreamreal okay, so you have a key, a value, and an index? [01:47]
ranbox2d yes [01:48]
dreamreal what's the value of the index when you have a key? [01:48]
ranbox2d well, say ['a','b,'c'] is an array of non-keyed values, i permute this array, and i want to store each value's old positions [01:49]
ranbox2d so 0=a, 1=b, 2=c [01:49]
dreamreal so where's the key here [01:49]
ranbox2d now i want to permute these k,vs [01:50]
dreamreal so your index *is* the key [01:50]
ranbox2d for the initial map, sure, but from that map i have to create a list of maps [01:50]
ranbox2d for those maps index isn't equal to key [01:50]
dreamreal I'm sorry, I'm still unclear on what it is you actually are trying to accomplish [01:51]
ranbox2d maybe i can write an example hold on [01:51]
ranbox2d [01:54]
ranbox2d each of those 6 new hashmaps are ordered differently [01:55]
dreamreal how does line 10 work I assume that's an error in writing out the map. [01:55]
ranbox2d yes i missed the last value [01:56]
dreamreal anyway, you're just... permutating through the keys? You could use a simple HashMap for this, and get the keySet(), permute those [01:56]
enoq [enoq!~enoq@2a02:8388:6a87:b080:649f:9456:c1b1:28e4] has joined ##java [01:58]
rhelic [rhelic!uid188470@gateway/web/] has joined ##java [01:59]
Maldivia (yes yes, 5 min rule) but permutate the key of a hashmap? [02:00]
ranbox2d that's my problem, i don't know how to permute and get a linkedhashmap as the output [02:00]
dreamreal you don't need a linkedhashmap [02:00]
dreamreal just permutate the keys, access the values in order of the keys [02:00]
ranbox2d are you sure? i need all the permutations, they're really unique objects [02:01]
gedgeck [gedgeck!~ged@] has joined ##java [02:01]
ranbox2d i need to access them by index too, when accessing by index i'm looking at the sequencing, and by key i find the value of what exactly is ordered where [02:01]
ranbox2d [02:04]
ranbox2d it's like, "get me the yellow box", versus "get me the first box" [02:05]
ranbox2d sure, the first time they're inserted 0 = yellow, but when i permute colors, i want to see what index it has [02:05]
ranbox2d so if yellow,green,blue are keys, and a,b,c are value, 0,1,2 are indices [02:05]
dreamreal ranbox2d: but... if you can permute the keys, you get a set of lists, right? [0,1,2],[0,2,1],[1,0,2],[1,2,0]... [02:06]
dreamreal you could then just for each one of those lists, you'd just access the map value for each element in order [02:06]
impermanence [impermanence!c01c0140@gateway/web/cgi-irc/] has joined ##java [02:07]
ranbox2d sure, that's possible, but isn't it possible to have a self-contained data structure? [02:07]
dreamreal of course it is, but do you need one? Maps do everything you need *except* permutate the keys. (Is... permutate the right word? permute?) [02:08]
ranbox2d permute i think, it isn't my native language either, but that except is exactly why i'm here, :P what would i need to do to be able to do that? [02:09]
dreamreal "a method to permutate the values in a set." Maps can already give you the keys. [02:10]
gelignite [gelignite!] has joined ##java [02:10]
dreamreal It'd be pretty simple to do. [02:10]
ranbox2d but i'd be permutating the order of the keys inside the map [02:10]
dreamreal why INSIDE the map? [02:10]
dreamreal guava can generate the permutations for you, if memory serves; then it's just walking through the permutations and doing... whatever [02:12]
dreamreal [02:12]
dreamreal dreamreal's title: "Collections2 (Guava: Google Core Libraries for Java 19.0 API)" [02:12]
Sasazuka [Sasazuka!~Sasazuka@unaffiliated/sasazuka] has joined ##java [02:14]
ranbox2d hmm, maybe you're right, but it's just that it'd be kind of confusing to read if i only permute the indices of my class for example [02:14]
dreamreal why? That's what your problem description did. [02:15]
u1_ [u1_!~u1@] has joined ##java [02:15]
ranbox2d confusing to read/display the hashmap [02:15]
ranbox2d since the way i have it now, it is ordered, and inserting the keys the right way would display it like the paste i sent above [02:16]
dreamreal but you're altering the key order, so there's no "right way" [02:16]
bn_work hi, has anyone successfully used NSSM.EXE to install as Windows service a Java app that uses a batch file wrapper? I'm able to install it fine but when attempting to stop it, all child process close except the parent NSSM.EXE process (which itself was spawned off by service.exe). [02:16]
dez [dez!uid92154@fedora/deSouza] has joined ##java [02:17]
ranbox2d yeah i'll just lose the linkedHashMap and fully rely on my own indices rather than insertion order [02:17]
freeone3000 bn_work: No, but I've spawned a windows service directly, it's not terribly difficult. [02:18]
bn_work freeone3000: what do you mean? [02:19]
bn_work like written an installer for it in Java? [02:19]
bn_work does Oracle Java already provide some bin util to do this? [02:20]
Nitrousoxide [Nitrousoxide!~quassel@unaffiliated/nitrousoxide] has joined ##java [02:22]
freeone3000 No, in MSIX. [02:24]
EmmaT [EmmaT!] has joined ##java [02:25]
CookieM [CookieM!] has joined ##java [02:25]
bn_work freeone3000: are you talking about [02:26]
freeone3000 Yes. That's how I do windows installers. [02:26]
viju [viju!~viju@] has joined ##java [02:31]
viju [viju!~viju@] has joined ##java [02:32]
bn_work Can you clarify "not terribly difficult"? This is a 3rd party app that our app is dependent on, so "writing an [entire] MSI installer for it" may be a bit more time than I may be allowed for it. [02:35]
freeone3000 k. you could also just register it as a service using the powershell commands detailed here: [02:41]
themsay [themsay!~themsay@] has joined ##java [02:49]
Jigsy [Jigsy!~Jigsy@unaffiliated/jigsy] has joined ##java [02:49]
emx [emx!] has joined ##java [02:59]
emx pastebin [02:59]
emx Please paste your code and any errors online. For runnable main-classes, try . For general code and errors, use for instance or [02:59]
emx Is authenticationManager() ever executed to build the authentication manager? [03:01]
bn_work freeone3000: thanks, does that work for batch files too? [03:01]
nonconvergent [nonconvergent!c72f2503@unaffiliated/nonconvergent] has joined ##java [03:01]
bn_work (a lot of Java apps often get built with batch files that start/stop, ie: manage the "service") [03:02]
freeone3000 bn_work: Yes. [03:02]
emx It's spring boot 2.1.6 BTW [03:03]
freeone3000 Works with any binary path, so put your cmd.exe command right in there. [03:03]
nonconvergent Can I ask someone to confirm what I'd forgotten and now observe...that map operations while streaming a collection with nulls in it may throw NPE if they're not filtered out? For some reason I had the mistaken idea nulls didn't matter inside the stream. [03:04]
bn_work freeone3000: hmm, so would have to install by launching it via cmd.exe /c ? [03:04]
freeone3000 bn_work: how else do you launch a batch script? [03:05]
bn_work foo.bat | foo.cmd [03:05]
freeone3000 that doesn't work in a service context, it has to run an actual binary [03:15]
ertiportline [ertiportline!~ertiportl@unaffiliated/ertiportline] has joined ##java [03:17]
bn_work yes, that's why I was asking if it supported batch files, but I guess only via cmd.exe /c [03:21]
bn_work I'm also trying to YAJSW but it seems to be having trouble detecting the PID of the running Java app *sigh* [03:22]
bn_work (the GenConfig.bat script (and descendent callees) that is) [03:22]
bn_work oh wait, looks like it's because the process is running in SYSTEM context: [03:29]
bn_work bn_work's title: "Yet Another Java Service Wrapper / Support Requests / #12 Problem genConfig running on Windows 7 (32 bits)" [03:29]
ron if you're using something that's hosted on sourceforge, you may have bigger problems. [03:29]
surial nonconvergent: nulls aren't silently removed from streams, no. you can trivially filter them out. [03:31]
ertiportline [ertiportline!~ertiportl@unaffiliated/ertiportline] has joined ##java [03:32]
Katana [Katana!~hentai@unaffiliated/katana] has joined ##java [03:33]
fragamus [fragamus!] has joined ##java [03:38]
Hanii [Hanii!~Hanii@2a00:23c5:c587:a800:e891:56b0:786a:e9c0] has joined ##java [03:40]
mindCrime [mindCrime!~mindCrime@] has joined ##java [03:41]
jiffe is there a good way of creating a string with a whole lot of double quotes in it like a json string? [03:45]
cheeser escaping those quotes [03:45]
dreamreal jiffe: not really in java, yet [03:45]
dreamreal load it from a file in the classpath <-- easiest approach no matter what language you're using [03:46]
cheeser meh. easy in kotlin. :) [03:46]
progart [progart!~kamee@] has joined ##java [03:49]
dreamreal cheeser: still better to have it external, as editors can then work with it natively [03:50]
dreamreal and yes, literals are easy in kotlin [03:50]
cheeser IDEA can edit json in a string literal just fine [03:51]
cheeser inject language fragment. edit language fragment. [03:51]
cheeser easy peasy [03:52]
dreamreal *nod* [03:53]
dreamreal surial: yo - PM? [03:56]
kgrimes2 [kgrimes2!] has joined ##java [04:06]
bn_work ron: ? [04:07]
Nicmavr [Nicmavr!~Nicmavr@unaffiliated/nicmavr] has joined ##java [04:08]
bn_work *phew* aside from log file location, looks like YAJSW seems to work so far and installs as a service and when started/stopped, properly terminates all processes, ie: doesn't leave any parent processes around :) [04:10]
bitwinery [bitwinery!] has joined ##java [04:20]
orbyt_ [orbyt_!~orbyt@] has joined ##java [04:22]
palasso [palasso!~palasso@unaffiliated/palasso] has joined ##java [04:24]
Cahaan [Cahaan!~Cahaan@] has joined ##java [04:29]
AcTiVaTe [AcTiVaTe!] has joined ##java [04:33]
Jantz [Jantz!] has joined ##java [04:53]
waz [waz!~waz@pdpc/supporter/active/waz] has joined ##java [04:56]
immibis [immibis!] has joined ##java [04:57]
raztoki [raztoki!~a0sle@unaffiliated/a0sle] has joined ##java [04:59]
SwiftMatt [SwiftMatt!~Objective@2601:282:4300:3e:9541:a657:5b4b:ae80] has joined ##java [05:03]
SwiftMatt What is this regex? [A-Z&&[^IOQ]] [05:03]
ron [05:03]
ron ron's title: "Online regex tester and debugger: PHP, PCRE, Python, Golang and JavaScript" [05:03]
dpl [dpl!~dpl@] has joined ##java [05:05]
surial SwiftMatt: a single character, which is both A-Z and not I, O, or Q. [05:05]
surial precisely one of those. [05:06]
SwiftMatt ok thanks [05:06]
surial [^IOQ] is: one character amongst what's in here, and the ^ reverses, so: any single character that isn't I O or Q. A-Z is anything in the A-Z range, and && is a 'is both'. [05:06]
surial so, both A-Z and not IOQ. [05:06]
masuberu [masuberu!] has joined ##java [05:27]
slosh [slosh!~slosh@] has joined ##java [05:27]
paddyez [paddyez!~paddyez@wikipedia/paddyez] has joined ##java [05:30]
atslash [atslash!] has joined ##java [05:33]
Peste_Bubonica [Peste_Bubonica!~Peste_Bub@unaffiliated/peste-bubonica/x-4612396] has joined ##java [05:35]
bakwods_ [bakwods_!~bakwods@] has joined ##java [05:40]
Akuw [Akuw!~Akuw@] has joined ##java [05:41]
Akuw hi [05:41]
Akuw is there any channel to make some questions about tomcat8 ? [05:41]
bakwods_ hello folks, quick dumb question :P, i'm reviewing a PR and one of the changes is changing from using an array to a map keyed by integer - would you say this is better? the number of items in either doesn't change [05:42]
Akuw is /var/lib/tomcat8/webapps/ROOT the default webapp of tomcat8 ? [05:43]
cheeser Akuw: there's #tomcat last I checked [05:43]
Akuw cheeser: no answers [05:44]
DTZUZO [DTZUZO!] has joined ##java [05:50]
shicks2525 [shicks2525!] has joined ##java [05:55]
zeden [zeden!~user@unaffiliated/zeden] has joined ##java [05:58]
shicks255_ [shicks255_!] has joined ##java [05:59]
RoriconKnight [RoriconKnight!~RoriconKn@] has joined ##java [06:05]
themsay [themsay!~themsay@] has joined ##java [06:07]
kirua [kirua!~kirua@unaffiliated/kirua] has joined ##java [06:14]
surial bakwods_: depends entirely on the index. If you replace an array where indices 0-100 mean something and any other index doesn't, this is dumb. if on the other hand only values 0, 8, 12, and 854 mean something.. [06:16]
Jantz [Jantz!] has joined ##java [06:26]
Jantz [Jantz!] has joined ##java [06:30]
Jantz [Jantz!] has joined ##java [06:34]
Jantz [Jantz!] has joined ##java [06:37]
kgrimes2 [kgrimes2!] has joined ##java [06:39]
Jantz [Jantz!] has joined ##java [06:40]
nunllk does anyone know things about captchas? [06:44]
ron anyyone [06:47]
ron ron, what does that even *mean*? [06:47]
ron er [06:47]
ron can't type [06:47]
ron anyone [06:47]
ron Chances are someone has, so why not just ask your question and save some time? If someone knows the answer and wants/has time to help, perhaps they will. [06:47]
nonconvergent ask [06:51]
nonconvergent The Ask To Ask protocol wastes more bandwidth than any version of the Ask protocol, so just ask your question. [06:51]
nonconvergent preempts [06:52]
nonconvergent I'm thinking of interviewing again. Anyone know any good books? I'm confident in my architectural and framework chops, but I think I need to brush up on my stupid doubly ended linked lists tricks. [06:54]
nunllk [07:08]
nunllk i need to know what this is [07:08]
dreamreal not java [07:09]
nunllk [its a captcha] but i dont get the html code and how to parse this and send it to 2captcha [07:09]
dreamreal how is this java? [07:09]
nunllk not java [07:09]
nunllk i asked if someone has any idea about captchas [07:09]
dreamreal then this is the wrong channel [07:09]
nunllk but chances are high someone knows html too [07:10]
nunllk html channel low activity [07:10]
dreamreal I'm trying to figure out how that's our concern but I'm failing dramatically [07:10]
dreamreal I appreciate the problem but this is not the right channel [07:10]
nunllk autist confirmed [07:10]
nunllk xD [07:10]
kicked nunllk (op confirmed.) [07:11]
nunllk [nunllk!edium@gateway/shell/suchznc/x-voqvqwsdhjkfiojx] has joined ##java [07:11]
nunllk kid? [07:11]
dreamreal english? [07:12]
nunllk kick someone cauz u act like autism and cant take the criticism? [07:12]
nunllk cmon dude lol [07:12]
dreamreal and you're trying to double down? [07:12]
nunllk ... whatever [07:12]
dreamreal As opposed to, like, thinking "oh, an op was telling me what I was asking was offtopic and kicked me instead of banning me, maybe I should cohere to the channel mores"? [07:13]
dreamreal I mean, do you WANT a ban? I can do it, it's only a few more characters.... [07:13]
nunllk im so sorry for asking off topic question [07:14]
dreamreal "autist confirmed" isn't actually criticism, anyway. It's a stupid attempt at an insult. Grow up. [07:14]
nunllk you are absolutly right [07:14]
nunllk and i am completely wrong [07:14]
nunllk sorry for my very stupid behaviour [07:14]
dreamreal shrugs. the right response is to internalize it and move on [07:15]
tomboy64 [tomboy64!~tomboy64@gateway/tor-sasl/tomboy64] has joined ##java [07:21]
taxon [taxon!] has joined ##java [07:22]
Brainium [Brainium!~brainium@unaffiliated/brainium] has joined ##java [07:30]
Jantz [Jantz!~IceChat9@2407:7000:8d04:100:68e2:cd9f:f750:6a02] has joined ##java [07:33]
rhelic [rhelic!uid188470@gateway/web/] has joined ##java [07:39]
hypc [hypc!~Thunderbi@] has joined ##java [07:49]
Diablo-D3 [Diablo-D3!] has joined ##java [07:52]
kgrimes2 [kgrimes2!] has joined ##java [07:54]
plarsen [plarsen!~plarsen@redhat/jboss/pdpc.professional.plarsen] has joined ##java [07:55]
Diablo-D3 [Diablo-D3!] has joined ##java [08:02]
iam730 [iam730!~iam730@] has joined ##java [08:08]
javango [javango!~javango@] has joined ##java [08:10]
Diablo-D3 [Diablo-D3!] has joined ##java [08:12]
jdfthetech [jdfthetech!] has joined ##java [08:18]
Bebef [Bebef!] has joined ##java [08:22]
yawkat [yawkat!] has joined ##java [08:27]
VegetarianFalcon [VegetarianFalcon!uid258908@gateway/web/] has joined ##java [08:27]