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

« 2019-03-14


2019-03-16 »

Nick Message Date
indistylo [indistylo!~aruns_@2406:7400:58:adba:9c29:c5cd:1cdf:bd3a] has joined ##java [12:03]
CombatVet [CombatVet!~CombatVet@gateway/tor-sasl/combatvet] has joined ##java [12:10]
yvyz [yvyz!~yvyz@gateway/tor-sasl/yvyz] has joined ##java [12:10]
NorthwestVegan [NorthwestVegan!~Northwest@gateway/tor-sasl/northwestvegan] has joined ##java [12:11]
learningc [learningc!] has joined ##java [12:22]
robnester [robnester!] has joined ##java [12:28]
g00s [g00s!~g00s@unaffiliated/g00s] has joined ##java [12:36]
learningc [learningc!] has joined ##java [12:47]
g00s [g00s!~g00s@unaffiliated/g00s] has joined ##java [12:59]
ludocode [ludocode!] has joined ##java [01:09]
Crash1hd [Crash1hd!~Crash1hd@unaffiliated/crash1hd] has joined ##java [01:10]
runlevel7 [runlevel7!~runlevel7@unaffiliated/runlevel7] has joined ##java [01:14]
pd09041999 [pd09041999!~pd0904199@] has joined ##java [01:19]
xa0s_ [xa0s_!] has joined ##java [01:23]
HatesLongFiles if i want a vararg to accept more than one type does it need to be of type Any ? for example, f(1, 2, 3.5, "5", *na) [01:30]
halprin [halprin!] has joined ##java [01:34]
s0ullight [s0ullight!] has joined ##java [01:35]
s0ullight If an object is manipulated from multiple threads and read from multiple threads through its methods, is it enough to make the methods manipulating the object ?synchronized? enough to make it thread safe? [01:37]
HatesLongFiles dunno, consult a book [01:40]
User__ [User__!] has joined ##java [01:43]
HatesLongFiles id recommend Effective.Java.3rd.Edition.2018.1.pdf and [01:44]
AMcBain [AMcBain!] has joined ##java [01:45]
g00s [g00s!~g00s@unaffiliated/g00s] has joined ##java [01:47]
pd09041999 [pd09041999!~pd0904199@] has joined ##java [01:52]
HatesLongFiles aswell as [JAVA][Beginning Java 8 Fundamentals].pdf and [JAVA][Beginning Java 8 Language Features].pdf [01:52]
led_dark_1 [led_dark_1!~Thunderbi@] has joined ##java [02:00]
Fossfile [Fossfile!] has joined ##java [02:00]
javango_ [javango_!~javango@] has joined ##java [02:03]
g00s [g00s!~g00s@unaffiliated/g00s] has joined ##java [02:11]
javango__ [javango__!~javango@] has joined ##java [02:13]
Secret-Fire [Secret-Fire!~Secret-Fi@2601:1c1:4201:458c:cfe:6f0e:2703:8a61] has joined ##java [02:19]
shan [shan!shan@unaffiliated/jasatso1301] has joined ##java [02:19]
shan [shan!shan@unaffiliated/jasatso1301] has joined ##java [02:21]
Deeewayne [Deeewayne!~dwayne@2605:a601:a803:7800:ffaf:2fa4:84dc:10e4] has joined ##java [02:27]
indistylo [indistylo!~aruns_@2406:7400:58:adba:2d11:7627:2ce7:57a6] has joined ##java [02:28]
indistylo [indistylo!~aruns_@] has joined ##java [02:30]
acidjnk [acidjnk!] has joined ##java [02:36]
Android [Android!] has joined ##java [02:42]
indistylo [indistylo!~aruns_@2406:7400:58:adba:2d11:7627:2ce7:57a6] has joined ##java [02:42]
comrad [comrad!~comrad@holarse/core/comrad] has joined ##java [02:44]
learningc [learningc!] has joined ##java [02:44]
paddyez [paddyez!~paddyez@wikipedia/paddyez] has joined ##java [02:50]
timkofu [timkofu!~timkofu@] has joined ##java [02:58]
OnceMe [OnceMe!~OnceMe@unaffiliated/onceme] has joined ##java [02:58]
mingzie [mingzie!675a3202@gateway/web/freenode/ip.] has joined ##java [03:02]
mingzie hi guys, i printed milliseconds time in a loop [03:02]
mingzie <for loop> [03:04]
Nicmavr [Nicmavr!~Nicmavr@unaffiliated/nicmavr] has joined ##java [03:04]
mingzie line of code; <-- ms is 10ms taken </for loop> print ms <-- shows 50ms taken [03:05]
indistylo [indistylo!~aruns_@2406:7400:58:adba:2d11:7627:2ce7:57a6] has joined ##java [03:13]
ogradyd [ogradyd!~Thunderbi@2a02:8070:88bf:9df0::dff] has joined ##java [03:14]
ravenousmoose [ravenousmoose!~ravenousm@] has joined ##java [03:15]
Zee- [Zee-!] has joined ##java [03:18]
gareppa [gareppa!~gareppa@unaffiliated/gareppa] has joined ##java [03:26]
shan [shan!shan@unaffiliated/jasatso1301] has joined ##java [03:27]
palasso [palasso!~palasso@unaffiliated/palasso] has joined ##java [03:32]
indistylo [indistylo!~aruns_@2406:7400:58:adba:2d11:7627:2ce7:57a6] has joined ##java [03:37]
User__ [User__!] has joined ##java [03:43]
progart [progart!~kamee@] has joined ##java [03:44]
ExtraCrispy [ExtraCrispy!~ExtraCris@gateway/tor-sasl/extracrispy] has joined ##java [03:45]
bolovanos [bolovanos!] has joined ##java [03:46]
pd09041999 [pd09041999!~pd0904199@] has joined ##java [03:48]
julius__ [julius__!c2726876@gateway/web/freenode/ip.] has joined ##java [03:51]
julius__ hi [03:51]
julius__ found this: article that shows which ways there are to get some classes into the test context in spring boot 1.4 whats the current way to get classes into the context for spring 2.x? [03:52]
julius__ none of the described work [03:52]
kernel-sanders [kernel-sanders!~rts-sande@] has joined ##java [03:59]
learningc [learningc!] has joined ##java [04:01]
henbruas [henbruas!~henbruas@unaffiliated/henbruas] has joined ##java [04:01]
bravoslo [bravoslo!~bravoslo@] has joined ##java [04:04]
HatesLongFiles [HatesLongFiles!] has joined ##java [04:05]
mohsen_1 [mohsen_1!uid289573@gateway/web/] has joined ##java [04:06]
indistylo [indistylo!~aruns_@2406:7400:58:adba:2d11:7627:2ce7:57a6] has joined ##java [04:08]
Fossfile I'm having trouble with a circular array singleton provider. it duplicates writes into all indexes. Would appreciate help. posted the code here [04:17]
Fossfile Fossfile's title: "java - Why does my ArrayList contain N copies of the last item added to the list? - Stack Overflow" [04:17]
Fossfile ^that is actually not my title but the one of a linked suspected duplicate - which I can't see how it is claimed as duplicate [04:18]
yawkat singleton [04:19]
yawkat yawkat, singleton is a controversial pattern where you enforce only one instance of a class. Singletons often make non-trivial programs clunky and difficult to maintain. Read and before implementing one yourself, and consider dependency injection as a modern alternative. [04:19]
Chuguniy [Chuguniy!~Chuguniy@] has joined ##java [04:21]
skuuter [skuuter!] has joined ##java [04:23]
Fossfile i'd think the bot line should say trivial rather than non [04:23]
Matthijs [Matthijs!~quassel@unaffiliated/matthijs] has joined ##java [04:26]
CombatVet [CombatVet!~CombatVet@gateway/tor-sasl/combatvet] has joined ##java [04:29]
whaley [whaley!] has joined ##java [04:32]
skuuter [skuuter!] has joined ##java [04:33]
odinsbane Why do you have "if(instance==null)" ? [04:34]
indistylo [indistylo!~aruns_@2406:7400:58:adba:2d11:7627:2ce7:57a6] has joined ##java [04:34]
odinsbane oh, I should have tried to tag them. [04:37]
kirua [kirua!~kirua@unaffiliated/kirua] has joined ##java [04:38]
indistylo [indistylo!~aruns_@2406:7400:58:adba:2d11:7627:2ce7:57a6] has joined ##java [04:41]
SuperTyp [SuperTyp!] has joined ##java [04:43]
puppy_za [puppy_za!uid277586@gateway/web/] has joined ##java [04:52]
User__ [User__!] has joined ##java [04:59]
Tichodroma [Tichodroma!~lutz@fsf/member/Tichodroma] has joined ##java [05:00]
Zee- [Zee-!] has joined ##java [05:03]
Gazooo [Gazooo!~Gazooo@] has joined ##java [05:07]
exonity01 [exonity01!] has joined ##java [05:08]
Secret-Fire [Secret-Fire!~Secret-Fi@2601:1c1:4201:458c:398c:bd9f:4fda:3390] has joined ##java [05:18]
Fossfile [Fossfile!] has joined ##java [05:20]
themsay [themsay!~themsay@] has joined ##java [05:26]
User__ [User__!] has joined ##java [05:30]
User__ [User__!] has joined ##java [05:31]
User__ [User__!] has joined ##java [05:32]
progart1 [progart1!] has joined ##java [05:43]
VelvetThunder [VelvetThunder!~VelvetThu@2a01:4b00:9411:7f00:118d:5daa:4515:624f] has joined ##java [05:48]
eliasr [eliasr!uid27497@gateway/web/] has joined ##java [05:51]
mf7 [mf7!~user@] has joined ##java [05:54]
adder [adder!~adder@gateway/tor-sasl/adder] has joined ##java [05:55]
learningc [learningc!] has joined ##java [06:00]
Tobbi [Tobbi!~Tobbi@supertux/tobbi] has joined ##java [06:00]
HatesLongFiles does anyone work with proteus [06:05]
yawkat anyone [06:07]
yawkat 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:07]
rager [rager!] has joined ##java [06:09]
HatesLongFiles how do i use Proteus Android Layout Engine [06:10]
AMcBain I rather suggest you ask the Android IRC channel. [06:10]
AMcBain The chance you'll get an answer is much higher there. [06:11]
ageis [ageis!~kevin@] has joined ##java [06:14]
minimal_life [minimal_life!~minimal_l@2601:603:1500:1e9a:b8bb:e723:757b:3999] has joined ##java [06:21]
somazero [somazero!~somazero@2600:8805:100:1a:dd0:d01c:6bd3:f6b] has joined ##java [06:26]
n35xdxb0_ [n35xdxb0_!] has joined ##java [06:26]
Addax AMcBain: don't bother - it's Android, the guy who's writing his own JSON wrapper for JSON because he can't figure out maps of maps [06:29]
AMcBain Uhhh, oh dear. [06:29]
Addax he's been asking about proteus for a while now. Bit of a lost cause, unfortunately. :( [06:31]
skuuter [skuuter!] has joined ##java [06:31]
puppy_za [puppy_za!uid277586@gateway/web/] has joined ##java [06:36]
HatesLongFiles Addax: x.x [06:38]
LaSombra [LaSombra!lasombra@unaffiliated/lasombra] has joined ##java [06:39]
DiabloD3 [DiabloD3!] has joined ##java [06:39]
Addax HatesLongFiles: sorry. Be more competent, and that opinion will change. [06:41]
kernel-sanders ouch [06:42]
Bombe Heh. [06:43]
Amadiro I need to sync some data from a weird database-like system into a database that I connect to using jdbc. To do this, I need to create the table in the target database -- but I don't know the schema or number of columns ahead of time. Is there a safe way to do a parameterized jdbc query to create the table with the schema without doing any string co [06:44]
Amadiro ncatenation? [06:44]
Addax nope. Which database is it, though [06:45]
Amadiro The target? it's Hive [06:45]
Addax does hive have a document column? [06:47]
Addax oh, it's hadoop [06:48]
Amadiro What's a document column? [06:49]
zulutango [zulutango!] has joined ##java [06:49]
Addax Well, like a column you can store JSON in, while retaining indexing [06:49]
Addax postgres, etc [06:49]
bolt [bolt!~r00t@unaffiliated/bolt] has joined ##java [06:55]
paddyez [paddyez!~paddyez@wikipedia/paddyez] has joined ##java [06:56]
Amadiro Addax: ah. Well, it's gotta be in tabular format in the end, at any rate [06:59]
Amadiro but I guess I'll just have to bite the bullet of doing a string concatenation and strictly sanitizing the input column names [06:59]
User__ [User__!] has joined ##java [06:59]
HZun [HZun!] has joined ##java [07:01]
Addax yeah, probably :( [07:02]
noodlepie [noodlepie!] has joined ##java [07:09]
otto_j [otto_j!] has joined ##java [07:14]
zulutango [zulutango!] has joined ##java [07:23]
JD-Robbs [JD-Robbs!~JD-Robbs@] has joined ##java [07:30]
pd09041999 [pd09041999!~pd0904199@] has joined ##java [07:43]
waz [waz!~waz@pdpc/supporter/active/waz] has joined ##java [07:45]
noodlepie [noodlepie!] has joined ##java [07:48]
deathcap [deathcap!] has joined ##java [07:51]
deathcap So I keep finding myself using inner classes with all instance variables set to final or AbstractMap.SimpleEntry whenever I need something akin to a tuple (which comes up fairly often in a sequence of map/flatmap/filter/etc operations. Other than third party libraries or just writing a "tuple" type with generics, is there a "best practice" way to have tuple-esque behavior? [07:54]
kirua [kirua!~kirua@unaffiliated/kirua] has joined ##java [07:57]
waz [waz!~waz@pdpc/supporter/active/waz] has joined ##java [07:57]
irrgit [irrgit!] has joined ##java [07:58]
learningc [learningc!] has joined ##java [08:00]
cheeser pair [08:00]
cheeser Q: Why is Java such a manly language? A: Because every programmer has to grow a Pair. [08:00]
pd09041999 [pd09041999!~pd0904199@] has joined ##java [08:03]
Addax I really kinda wish they'd included tuples in the runtime library, too :/ [08:03]
cheeser i don't know why they haven't [08:04]
Addax Probably scala's fault [08:04]
forgottenone [forgottenone!~forgotten@] has joined ##java [08:04]
Addax "We don't want to be SCALA, do we?" [08:04]
deathcap oh hey, javafx.util.Pair does exist. [08:06]
Addax yeah, but it doesn't belong there [08:07]
deathcap right? [08:07]
kirua [kirua!~kirua@unaffiliated/kirua] has joined ##java [08:08]
deathcap I mean it's shorter than AbstractMap.SimpleEntry, but I *really* don't like typing that whenever I need a quick 2 member tuple. [08:08]
Addax Why not make your own, or use a library that has it? [08:08]
dosdebug [dosdebug!~dosdebug@unaffiliated/dosdebug] has joined ##java [08:08]
deathcap I always just end up doing stuff like class A { final String blah; final Date blahblah; public A(blahblahblah)} [08:09]
cheeser the JDK should have a Pair and a Triple class. [08:09]
cheeser anything more, people can build themselves. but, come on, oracle! [08:09]
deathcap There's a javatuples maven library apparently. [08:09]
deathcap that goes up to an arity of 10 [08:09]
Addax And a Quadruple, and Quintuple, and a Sextuple, and a Septuple, and a DuoDecaple... [08:10]
Addax deathcap: scala goes up to 22 [08:10]
deathcap D :D [08:10]
Addax which is hilarious in its own way [08:10]
Addax if you haven't guessed, I have a lot of room to be more impressed with Scala [08:10]
Addax like... all the room [08:10]
deathcap clojure goes up to an infinite number. but that's really just sequences and destructuring. [08:11]
deathcap and when you're using dynamic typing and everything is just a generic data structure anyway, I'm not sure exactly how you'd define a "tuple" in that language. [08:12]
adamkowalczyk [adamkowalczyk!50471239@gateway/web/freenode/ip.] has joined ##java [08:13]
Addax Anyone on IDEA EAP with JBR 11? Curious to what it adds - does it perform better, what features? [08:14]
deathcap Addax 22 seems like such an arbitrary number. [08:16]
Addax deathcap: exactly why it's so funny [08:16]
deathcap about as funny as the closest thing to a proper binary tuple to be buried in javafx for some reason. [08:17]
plarsen [plarsen!~plarsen@redhat/jboss/pdpc.professional.plarsen] has joined ##java [08:18]
Addax well, at least there we have history, because java's inherently very conservative [08:18]
Addax "We don't have a Pair because we've ALWAYS been feminists!" [08:18]
AMcBain .oO( VRGoggles extends javafx.util.Pair<LeftEye, RightEye> ) [08:18]
Addax ... never mind that women have pairs of many other things as well, nobody said java's designers were especially reasonable [08:18]
User__ [User__!] has joined ##java [08:20]
deathcap colloquially, does "a pair" usually refer to anything that's not a sexual organ? [08:21]
Addax sure [08:21]
deathcap i mean nobody says "yeah look at that pair of eyes" [08:21]
deathcap well, referring to a person. [08:21]
Addax hrmmm. colloquially, if someone refers to a generalized "pair," it probably is sexual, generally male too [08:22]
Addax I'm not exactly a catcaller or anything - gross - but I can't imagine saying "look at the pair on that woman!" [08:23]
deathcap I mean I could concievably see it being *said* [08:25]
noodlepie [noodlepie!] has joined ##java [08:25]
Addax It'd sound stupid, though [08:25]
deathcap pretty sure uncle Rudy's said shit like that. [08:25]
deathcap but not everyone has a catcalling uncle. [08:25]
adder [adder!~adder@gateway/tor-sasl/adder] has joined ##java [08:25]
Addax It would require individual admiration - or whatever - of the specific attribute [08:25]
Addax "I like the left one, but the right one..." [08:26]
deathcap i like the n-arity collection on that woman! [08:26]
deathcap doesn't quite work. [08:26]
simon816 [simon816!] has joined ##java [08:26]
Addax ... no, no it does not. [08:27]
q9929t [q9929t!~Thunderbi@] has joined ##java [08:32]
conan [conan!] has joined ##java [08:35]
Essadon [Essadon!] has joined ##java [08:37]
adamkowalczyk My company is looking for feedback on their automatic unit test generator, if anyone is interested: [08:40]
adamkowalczyk adamkowalczyk's title: "Diffblue - Playground" [08:40]
mohsen_1 In Guava's SettableFuture, I'm setting an exception in an asynchronous call, right after that, I'm checking settableFuture.get() to see if the call has set the value, how can I check if one of those exceptions I set occured? [08:41]
whaley [whaley!] has joined ##java [08:42]
mohsen_1 [08:43]
mohsen_1 How do I check if any of those exceptions occurred? [08:44]
surial mohsen_1: when you run future.get(), they are thrown [08:44]
mohsen_1 So I should catch them in the try-catch block? [08:46]
noodlepie [noodlepie!] has joined ##java [08:46]
surial mohsen_1: .get() throws ExecutionException. [08:46]
surial mohsen_1: exceptions have 4 major properties. [1] a type. [2] a message. [3] a stack trace. [4] a causal chain. [08:46]
surial mohsen_1: writing code like catch (Exception e) {e.printStackTrace(); } ? is commonly observed. Idiots/morons/newbies write it. Don't. [08:47]
surial That prints [3], and makes [1], [2], and [4] disappear. [08:47]
surial THere's no easy way to print all 4, so, just let those exceptions bubble up; the default exception handler of whatever you're doing WILL print ALL of it. [08:47]
surial mohsen_1: in this case, ExecutionException occurs, and the ACTUAL exception you 'threw' (future.setException()), is the cause of that one. [08:47]
noodlepie [noodlepie!] has joined ##java [08:48]
surial mohsen_1: so, if you must have it: try { future.get(); } catch (ExecutionException e) { Throwable actualExceptionYouPassedInTheFutureSetExceptionCall = e.getCause(); } [08:48]
mohsen_1 surial: ok [08:49]
indistylo [indistylo!~aruns_@2406:7400:58:adba:2d11:7627:2ce7:57a6] has joined ##java [08:50]
mohsen_1 surial: thanks [08:50]
gareppa [gareppa!~gareppa@unaffiliated/gareppa] has joined ##java [08:51]
enoq [enoq!~enoq@2a02:8388:6a87:b080:649f:9456:c1b1:28e4] has joined ##java [08:53]
enoq [enoq!~enoq@2a02:8388:6a87:b080:649f:9456:c1b1:28e4] has joined ##java [08:59]
simon816 [simon816!] has joined ##java [09:00]
waz [waz!~waz@pdpc/supporter/active/waz] has joined ##java [09:04]
buttholesprouts - on line 32 && 42 here - I'm attempting to add an instance to an ArrayList - but each time a new value is added to the instance, it's overwritten in the ArrayList - Presumably because it's adding a reference to the list. I've tried to fix using new BreakPoints(this) - but having the same issue. [09:15]
yawkat well yea, thats how java works [09:16]
yawkat pbv [09:16]
yawkat Java only supports pass by value. However, non-primitive variables hold references to objects, not the objects themselves. You're passing the reference by value. For more information see: and ask me about ~primitives if you don't know what those are. [09:16]
kirua [kirua!~kirua@unaffiliated/kirua] has joined ##java [09:20]
whaley [whaley!] has joined ##java [09:20]
learningc [learningc!~learningc@2001:d08:d6:3bf7:4d06:2d8c:4476:c89f] has joined ##java [09:20]
t2mkn [t2mkn!~t2mkn@] has joined ##java [09:21]
conan [conan!] has joined ##java [09:29]
Markow [Markow!~ejm@] has joined ##java [09:30]
rockyraccoonn [rockyraccoonn!] has joined ##java [09:30]
mr_lou [mr_lou!] has joined ##java [09:33]
alphazb [alphazb!~alphazb@unaffiliated/alphazb] has joined ##java [09:33]
alphazb [alphazb!~alphazb@unaffiliated/alphazb] has joined ##java [09:40]
stryek [stryek!uid332574@gateway/web/] has joined ##java [09:40]
zeden [zeden!~user@unaffiliated/zeden] has joined ##java [09:41]
bluezone [bluezone!uid104970@gateway/web/] has joined ##java [09:44]
Rapture [Rapture!] has joined ##java [09:52]
surial buttholesprouts: So, every Breakpoint contains a list named 'breakp'.. and that list contains.. breakpoints. [09:56]
surial buttholesprouts: I think you're confused. [09:56]
buttholesprouts correct, attempting to fix with clone() [09:58]
yawkat clone [09:58]
yawkat yawkat, cloning is making copies of objects ( Also read an interview of Josh Bloch on why to use a "Copy Constructor versus Cloning": Either way don't use Object.clone, use a cloning framework if you want to clone (e.g. kryo). [09:58]
t2mkn [t2mkn!~t2mkn@] has joined ##java [09:59]
whaley [whaley!] has joined ##java [10:01]
Tobbi [Tobbi!~Tobbi@supertux/tobbi] has joined ##java [10:02]
alphazb [alphazb!~alphazb@unaffiliated/alphazb] has joined ##java [10:04]
rippa [rippa!] has joined ##java [10:10]
surial buttholesprouts: 'cloning' doesn't fix this. Why do breakpoints contain lists of breakpoints? [10:10]
surial buttholesprouts: shouldn't the concept 'Breakpoints' (note the s at the end) contain this entirely separate concept called 'Breakpoint'? [10:10]
Crash1hd [Crash1hd!~Crash1hd@unaffiliated/crash1hd] has joined ##java [10:11]
jamezp [jamezp!~jamezp@redhat/jboss/jamezp] has joined ##java [10:12]
dendazen [dendazen!] has joined ##java [10:13]
buttholesprouts it does - they're set in another file and passed through with breakpoints.add() - which is represented by this. in Breakpoints [10:16]
ludocode [ludocode!] has joined ##java [10:17]
pd09041999 [pd09041999!~pd0904199@] has joined ##java [10:19]
pd09041999 [pd09041999!~pd0904199@] has joined ##java [10:20]
pd09041999 [pd09041999!~pd0904199@] has joined ##java [10:22]
buttholesprouts this what you mean ? [10:24]
mike802 parted the channel: [10:26]
progart [progart!~kamee@] has joined ##java [10:28]
zeden [zeden!~user@unaffiliated/zeden] has joined ##java [10:29]
darkSeid [darkSeid!~textual@2a02:c7d:281c:e200:4d53:c5d3:16fc:378] has joined ##java [10:29]
indistylo [indistylo!~aruns_@2406:7400:58:adba:2d11:7627:2ce7:57a6] has joined ##java [10:32]
t2mkn [t2mkn!~t2mkn@] has joined ##java [10:34]
t2mkn [t2mkn!~t2mkn@] has joined ##java [10:51]
happymeal` [happymeal`!] has joined ##java [10:54]
deathcap god Eclipse sucks with lambdas [11:00]
yokel [yokel!~yokel@unaffiliated/contempt] has joined ##java [11:01]
cheeser s/ with.*// [11:01]
deathcap "That is too a valid symbol, it's in the lambda signature, compile damn you!" [11:01]
deathcap here i am trying to use the "office standard" IDE instead of my atypical Emacs based workflow and it's like a step backwards. [11:02]
yawkat You're holding it wrong [11:03]
Maldivia deathcap: well, either you've encountered a bug in Eclipse, a bug in the language, or a bug in your code... so report it or fix it, and onwards [11:03]
deathcap it didn't start until I started adding comments... [11:04]
mbooth Maldivia: Oh man, but it's so much easier to just complain [11:04]
deathcap so probably Eclipse. [11:04]
Maldivia probably your code [11:05]
deathcap if you say so. [11:05]
cheeser it usually is. [11:06]
deathcap oh believe me I know. [11:07]
deathcap and i also know overconfidence is a common malady. [11:08]
HatesLongFiles wonders if json2View can do what i want [11:12]
cheeser deathcap: that usually presents itself by blaming the tools ;) [11:13]
deathcap that being said my specific issue is as simple as using a lambda like d -> {hashmap.get(d);} and it telling me that the d inside the brackets doesn't exist [11:13]
veegee [veegee!] has joined ##java [11:13]
Maldivia that usually means something higher in the source code isn't compiling as it should, or unmatched brackets etc [11:14]
deathcap when doing new Consumer<Date>() { public void(Date d) { hashMap.get(d);}} works just fine. [11:14]
conan [conan!] has joined ##java [11:16]
yawkat language level 7? :) [11:18]
yawkat or whatever the eclipse equivalent is... [11:18]
deathcap I've got it set to JavaSE-1.8! [11:19]
yawkat eclipse isnt great, but the compiler is [11:19]
yawkat so it's probably a problem on your side [11:19]
Pieter12345 [Pieter12345!~Pieter123@] has joined ##java [11:20]
ludocode [ludocode!] has joined ##java [11:20]
deathcap seems like i only get issues once i start nesting a bunch of lambdas. [11:21]
deathcap so yeah probably my problem. [11:22]
SerialSmile [SerialSmile!~SerialSmi@] has joined ##java [11:26]
gareppa [gareppa!~gareppa@unaffiliated/gareppa] has joined ##java [11:26]
troulouliou_div2 [troulouliou_div2!~troulouli@unaffiliated/troulouliou-div2/x-0271439] has joined ##java [11:29]
rohdef [rohdef!] has joined ##java [11:30]
pertu [pertu!] has joined ##java [11:36]
forgottenone [forgottenone!~forgotten@] has joined ##java [11:38]
upgrdman [upgrdman!~upgrdman@blender/artist/upgrdman] has joined ##java [11:38]
_BIGSHOT_ [_BIGSHOT_!~big__@unaffiliated/niceguy00] has joined ##java [11:41]
gareppa [gareppa!~gareppa@unaffiliated/gareppa] has joined ##java [11:41]
_BIGSHOT_ in javafx i want to run a method once at a particular time ... which method should i use? [11:41]
MadLamb [MadLamb!~fabio@] has joined ##java [11:42]
MadLamb Is there another way to receive apart from a controller method? I'd like to have somehow an auth service as a class dependency that I could ask the Authentication object from. [11:43]
pd09041999 [pd09041999!~pd0904199@] has joined ##java [11:47]
Maldivia MadLamb: can't you do something like securityContext.getAuthneitcation() [11:48]
Maldivia (without the spelling errors) [11:48]
_BIGSHOT_ in javafx i want to run a method once at a particular time ... which method should i use? Maldivia [11:51]
Opus [Opus!~opus@] has joined ##java [11:51]
Teckla _BIGSHOT_: I am totally just guessing here, but perhaps java.util.Timer [11:52]
_BIGSHOT_ Teckla, is this okay? [11:52]
cheeser does it work? [11:52]
_BIGSHOT_ i want to know first if it's not old deprecated [11:53]
_BIGSHOT_ newer better way exists or not [11:53]
cheeser quartz [11:53]
cheeser cheeser, quartz is An open source job scheduling system. Jobs can be defined as standard Java components or EJBs. You can find more info at or see for a core java solution. [11:53]
cheeser is generally the "correct" answer [11:53]
whaley [whaley!] has joined ##java [11:54]
Teckla _BIGSHOT_: java.util.Timer is not deprecated and not due to be deprecated, as far as I know [11:54]
Maldivia that being said, java.util.Timer is a shitty class :D [11:55]
lseactuary [lseactuary!36ef06b1@gateway/web/freenode/ip.] has joined ##java [11:55]
lseactuary hello. is CSP (sequential processes) a subset of java (.csp) or that is something else? [11:56]
dosdebug _BIGSHOT_: Use `ScheduledThreadPoolExecutor` [11:56]
cheeser supposition: most things that end up in 'util' buckets are, to some extent, shitty/hacks [11:56]
cheeser csp is not a java thing, no. [11:56]
lseactuary what language does it fall under? [11:57]
MadLamb Maldivia, this is probably what i want, but Could not autowire. No beans of 'SecurityContext' type found. [11:57]
cheeser \_(?)_/ [11:57]
MadLamb Maldivia, same for SecurityContextHolder [11:57]
Maldivia the thing that Timer provides that ScheduledThreadPoolExecutor doesn't though, is a way to schedule at a specific time, and not just after a delay [11:57]
cheeser lseactuary: google knows [11:57]
exonity01 Same here: try SecurityContextHolder.getContext() [11:57]
dosdebug MadLamb: You do not need to autowire `SecurityContext` [11:57]
sonOfRa Isn't CSP some completely theoretically math-based modeling language? [11:57]
MadLamb dosdebug, static call? [11:57]
sonOfRa How did you even get the idea that it would be a sub(or super) set of java? [11:57]
lseactuary @cheeser - it came with java :/ [11:58]
lseactuary sonofRa - ye [11:58]
sonOfRa It most definitely doesn't "come with java" [11:58]
lseactuary [11:58]
lseactuary lseactuary's title: "GitHub - adamluzsi/ Communicating Sequential Processes Technics for both high and low level concurrency implementations" [11:58]
sonOfRa That's... an *implementation* of CSP, *in java* [11:59]
Maldivia so you found an implementation of it written in java -- that's completely different [11:59]
dosdebug MadLamb: `SecurityContextHolder.getContext().getAuthentication()` [11:59]
lseactuary [11:59]
lseactuary right [11:59]
MadLamb dosdebug, that seems to work but would be nice to have it in the constructor instead of the static call [11:59]
surial lseactuary: last edit february 20, 2003. [11:59]
surial lseactuary: It's.. 2019. [11:59]
surial It's.. IT. It's a fast moving thing. [11:59]
Tobbi [Tobbi!~Tobbi@supertux/tobbi] has joined ##java [11:59]
dosdebug MadLamb: Provided by Spring, they know it better than us though :) [12:00]
dosdebug MadLamb: May be have `SecurityContext` in constructor and pass from client? [12:00]
sainathvd [sainathvd!~sainathvd@] has joined ##java [12:00]
orbyt_ [orbyt_!~orbyt@] has joined ##java [12:04]
nutzz [nutzz!557a1764@gateway/web/freenode/ip.] has joined ##java [12:05]
nutzz to level up from junior java developer do middle what should I know? [12:05]
Maldivia you need 42xp for that [12:07]
adamkowalczyk My company is looking for feedback on their automatic unit test generator, if anyone is interested: [12:09]
adamkowalczyk adamkowalczyk's title: "Diffblue - Playground" [12:09]
cheeser have to sign in? [12:09]
cheeser so is this a fuzz generator essentially? [12:10]
surial adamkowalczyk: the cookie banner expertly hides the generate tests button, making the site confusing as fuck until you click it away. A minor niggle. [12:10]
cheeser i hit that, too. :) [12:10]
cheeser also, i don't want to sign up for an account just to kick the tires. [12:10]
cheeser it's pretty though [12:11]
surial oof, sign in required. Well, sounds like fun dev. I personally dislike the notion of trying to shoot for max test coverage so this kind of thing bothers me more than it helps. But I'm definitely quite far off the centre, so, perhaps that just means I'm not the target audience. [12:11]
kindling [kindling!3SNmZU8m@unaffiliated/kindling] has joined ##java [12:11]
adamkowalczyk surial: Thanks for that feedback, its pretty annoying I agree, hopefully will be fixed soon. [12:11]
surial adamkowalczyk: for those asinine 'waaaaaaat SIGN IN? Jesus christ heeeeel nooo!' folks, a little screencasty movie for the bare bones basics just so we know what we're looking at might help add some conversion, but this is all feedback for your webmaster, not the actual application y'all developed :P [12:12]
cheeser you want me to watch a video now?!? *goes back to facebook* [12:12]
adamkowalczyk Yes, the sign in requirement is pretty annoying. All the devs involved want it gone, all the marketing people say we have to keep it :S [12:12]
Maldivia lead gen! :D [12:13]
adamkowalczyk The tool generates unit tests for Java code, and yes, its really aimed at creating a regression suite. It can't pick up bugs, but it can help you identify changes in behaviour. [12:13]
adamkowalczyk surial: Yup, good point about an intro, I think a sort of onboarding modal is in the works. [12:14]
adamkowalczyk Anyway, for all the flaws of the current site, the underlying tech is pretty cool :D [12:17]
waz [waz!~waz@pdpc/supporter/active/waz] has joined ##java [12:19]
waz [12:23]
bendem MadLamb: you want an argument resolver. [12:23]
waz oops, wrong channel [12:24]
bendem By default the security context is bound to the current request which is bound to the current thread. Thus the static call. There isn't really a nicer way than using an argument resolver so you can request the current user from your controller method [12:25]
bendem If you want an example, I can provide one in 40 minutes when I get home [12:25]
Maldivia (make a request-scoped bean, add a method to it, that just contains return SecurityContextHolder.getContext().getAuthentication() -- profit) [12:26]
Maldivia D [12:26]
HZun [HZun!] has joined ##java [12:27]
peteski [peteski!~peteski@unaffiliated/peteski] has joined ##java [12:29]
bendem Yeah, that would do the same thing without having to manually pass the user around [12:29]
Essadon [Essadon!] has joined ##java [12:29]
peteski Anyone in here use the MongoDB java driver? [12:31]
peteski <-- [12:32]
cheeser anyone [12:32]
cheeser 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. [12:32]
peteski Fair enough, just wanted to get a feel for the audience before I start blithering :) [12:32]
peteski We have a project which has been using the older async driver which is now deprecated for the reactive streams version. I've tried to get it up and running again following the docs, but there's a lot of bits that seem to be missing. Firstly, the 'installation' suggests you only need 1 Maven dependency which doesn't seem to fly based on the API docs which suggest that trying to create() a [12:35]
peteski MongoClient with 'settings' actually needs the MongoClientSettings from the main package (com.mongodb.MongoClientSettings) [12:35]
peteski so you bring in that dependency, not a big deal.. and you get things compiling, then when I run the thing I'm getting an error trying to call that .create method saying java.lang.NoSuchMethodError :( [12:36]
orbyt_ [orbyt_!~orbyt@] has joined ##java [12:37]
peteski and in the message it looks like it's using async driver stuff (under the hood) [12:37]
peteski java.lang.NoSuchMethodError: com.mongodb.async.client.MongoClients.create(Lcom/mongodb/async/client/MongoClientSettings;Lcom/mongodb/MongoDriverInformation;)Lcom/mongodb/async/client/MongoClient; [12:39]
peteski ( [12:39]
Maldivia peteski: sounds like the libraries you're using doesn't match with the version they were compiled against [12:42]
Maldivia which should also explain why you get a difference in the guide and what you're experiencing -- the guide probably has the versions of the artifacts it it [12:43]
peteski [12:43]
peteski I'm using this (1.11.0) of the reactive streams lib [12:44]
Maldivia and what other mongodb versions do you have in your pom? [12:44]
peteski As I say though, you can't actually follow their 'quick tour' ( if you want to use MongoClientSettings to create the client [12:44]
exonity01 Do you use maven or gradle? [12:44]
peteski as you have to then use the main mongo package. (yep, lemme grab that too, which is latest) [12:44]
peteski maven [12:44]
peteski [12:45]
peteski peteski's title: "Maven Repository: org.mongodb mongo-java-driver 3.10.1" [12:45]
exonity01 oh shit, didn't see the last messages [12:45]
exonity01 saw* [12:45]
cheeser you were right the first time [12:46]
peteski that's the latest for the main package :/ and removing the reactive streams one blasts away all the reactive stream stuff, I wondered if just trying to use the "uber" package as it describes itself would contain the Rx stuff too :( but doesnt [12:46]
Maldivia peteski: and what imports are you using? the reactive ones or the async ones? [12:47]
peteski reactive [12:47]
peteski; (these two - neither are the old 'async' ones though) [12:48]
peteski peteski's title: "Maven Repository: org.mongodb mongo-java-driver 3.10.1" [12:48]
Maldivia peteski: well, the error you pasted above looks like you trying to use com.mongodb.async.client.MongoClients instead of com.mongodb.reactivestreams.client.MongoClients [12:50]
Maldivia but my mongodb is very very limited; though very familiar with NoSuchMethodError :D [12:51]
exonity01 I don't know the mongodb stuff, but perhaps is the library required in different versions and maven is taking the newest? [12:51]
peteski Maldivia: Yeah I know what you mean, I'm wondering if that reactive streams one just wrappers bits of the async one (I guess I can go off in the code base to see) [12:52]
kindling [kindling!3T2r5ieB@unaffiliated/kindling] has joined ##java [12:54]
Foxfir3 [Foxfir3!~Foxfir3@] has joined ##java [12:55]
kegster [kegster!~kegster@unaffiliated/kegster] has joined ##java [12:56]
peteski goes off to play with IntelliJ IDEA cache settings and mvn clean package -U to redownload everything just in case something is lingering around [12:58]
HatesLongFiles how do i convert a JSONObject to a JsonObject (GSON to org.json [01:01]
HatesLongFiles ) [01:01]
cheeser don't use org.json. use Jackson. [01:02]
cheeser and then stop using Gson as well. [01:02]
adder [adder!~adder@gateway/tor-sasl/adder] has joined ##java [01:02]
esro [esro!] has joined ##java [01:03]
whaley [whaley!~whaley@] has joined ##java [01:03]
dez [dez!uid92154@fedora/deSouza] has joined ##java [01:04]
kirua [kirua!~kirua@unaffiliated/kirua] has joined ##java [01:04]
ron stop using JSON [01:09]
Regon [Regon!~Regon@unaffiliated/regon] has joined ##java [01:10]
HatesLongFiles ok [01:11]
HatesLongFiles does the 'this' keyword act differently in kotlin and java [01:14]
cheeser no [01:16]
cheeser and please don't crosspost. [01:16]
karab44 [karab44!~karab44@unaffiliated/karab44] has joined ##java [01:17]
conan [conan!~conan@] has joined ##java [01:18]
peteski Yeah, the rx driver depends on the async driver, shambles [01:22]
cheeser likely you're missing context and your driveby analysis is insufficient to properly graps the realities involved. [01:23]
cheeser \_(?)_/ [01:23]
peteski moi? probably :D [01:23]
peteski It's also time to leave this for another day, it's Friday! [01:24]
peteski Thanks for the help people tried to give. have a good weekend [01:24]
cheeser just a few more hours to go! [01:24]
peteski is on GMT [01:25]
peteski hf cheeser [01:25]
sbalmos It's always 5:00 somewhere [01:25]
freeone3000 <pedantry>INCORRECT many time zones are at an integer offset, it can only possibly be 5:00 somewhere at :00, :20, :30, and :40 after the hour, and for everything except :00, the hour also depends on if there's an offset [01:26]
surial See? sbalmos. You been SCHOOLED, son! [01:27]
freeone3000 ponders making [01:27]
freeone3000 parked. dang. [01:28]
Bombe There?s also one or two timezones with a :15 offset. [01:31]
srisri [srisri!~srisri@] has joined ##java [01:32]
wad [wad!~wad@] has joined ##java [01:32]
wad Quick question: Annotations for, say, JSON stuff via jackson, should they go on the member variable, or on the getter? [01:33]
wad For DTOs. [01:33]
cheeser the variable, iirc [01:33]
wad My thoughts too. Thanks. [01:34]
cheeser but, as always, [01:34]
cheeser tias [01:34]
cheeser Try it and see. You learn much more by experimentation than by asking without having even tried. [01:34]
g00s [g00s!~g00s@unaffiliated/g00s] has joined ##java [01:34]
ExtraCrispy [ExtraCrispy!~ExtraCris@gateway/tor-sasl/extracrispy] has joined ##java [01:34]
[twisti] wad: getters and setters should be generated, by your ide or an awesome library like lombok, and if you chose a good tool, it will copy things to the generated methods [01:35]
[twisti] so yeah, on the variable [01:36]
wad Thanks! [01:36]
conan [conan!~conan@] has joined ##java [01:40]
cruxeternus [cruxeternus!] has joined ##java [01:43]
funeral [funeral!] has joined ##java [01:44]
Nicmavr [Nicmavr!~Nicmavr@unaffiliated/nicmavr] has joined ##java [01:44]
gelignite [gelignite!] has joined ##java [01:45]
seventwo [seventwo!] has joined ##java [01:54]
progart [progart!~kamee@] has joined ##java [01:59]
enoq [enoq!~enoq@2a02:8388:6a87:b080:649f:9456:c1b1:28e4] has joined ##java [02:09]
potato____ [potato____!ae8acf34@gateway/web/freenode/ip.] has joined ##java [02:10]
potato____ hi there, i'm having a strange problem and can't figure it out. i've written a simple game server/client where the server has an entity component system and when components change, it sends that update to clients. i have a method that packages an update packet with the changed components and sends it along. problem is, on the server side it packages the new values, but the client side recieves the old values. why would this be? [02:11]
conan [conan!~conan@] has joined ##java [02:12]
enoq [enoq!~enoq@2a02:8388:6a87:b080:649f:9456:c1b1:28e4] has joined ##java [02:12]
yawkat consults the tea leaves [02:12]
Maldivia packaging the new values but you're accedentially sending the old ones? [02:12]
yawkat i recommend lots of logging and wireshark [02:12]
yawkat see where it goes from new to old [02:12]
Maldivia receiving the new values, but not actually reading what you read from the wire [02:12]
potato____ i'm trying to find that point, yeah. so on the server it packages them into a ComponentUpdatePacket object, and prints the .toString to console- no problems. on the client it receives that serialized ComponentUpdatePacket and prints the .toString- old values! [02:13]
Maldivia so yeah, as yawkat said, wireshark to see what's actually being sent [02:13]
potato____ Will download wireshark, for some reason I don't have it. The only thing I could think of is i'm using the very same type of packet to initially send the components, that I am using to send the changed components. is some kind of optimization on the networking layer seeing that and just copy/pasting theold components again? do i have to mark them as volatile or something so that it won't? [02:14]
potato____ i don't know much about how networking works under the hood in ava [02:14]
Tobbi [Tobbi!~Tobbi@supertux/tobbi] has joined ##java [02:14]
freeone3000 potato____: What are you actually sending? [02:15]
sir_galahad_ad [sir_galahad_ad!] has joined ##java [02:16]
potato____ something called ComponentUpdatePacket which contains the entity ID in question and an arraylist of Component objects [02:16]
potato____ the entity component system on both svr/client is a set of HashMaps that map entity id : component of whatever type, one map per component type [02:16]
freeone3000 potato____: You're saying you're sending an object. How are you sending an object? [02:17]
potato____ ObjectOutputStream [02:17]
yawkat / [02:18]
freeone3000 serialization [02:18]
freeone3000 Serialization is the mechanism by which objects are turned into bytes and vice versa, often for storage or transmission across a network. See (tutorial), (cheeser's blog), (the spec). Ask me about ~java serialization . [02:18]
freeone3000 We don't really do ObjectOutputStream. It leads to some weirdness. [02:19]
freeone3000 This weirdness shouldn't apply here, and we can debug your network protocol like it's 1995 if you really want. [02:19]
Sasazuka [Sasazuka!~Sasazuka@unaffiliated/sasazuka] has joined ##java [02:19]
Maldivia and how are you reading it on the other side? [02:19]
potato____ ObjectInputStream :P [02:19]
Maldivia sounds like a ~showus [02:20]
potato____ the only thing I could think of is if ObjectOutputStream or something underneath it caches objects, sees i'm trying to send the "same" one again, and sends the cached version? [02:20]
Maldivia it doesn't [02:20]
Maldivia but you just said that you had a HashMap, that sounds like a cache [02:20]
potato____ yeah the entity system itself is based on HashMaps internally. one map per component type (ex: position component map, name component map, etc) [02:21]
freeone3000 There actually is this concept of object IDs in an ObjectOuptutStream/ObjectInputStream, but if you properly reset the stream after each message, you won't hit the internal caching layer. [02:21]
freeone3000 You're properly resetting the stream, as the docs say, right? [02:21]
potato____ will check [02:22]
freeone3000 (This is partially why we don't do this, because "no, I just wrote the code and it mostly works" is the most common modality of usage, and ObjectOutputStream will NOT work properly if you do this) [02:22]
Maldivia oh, you're mutating a ComponentUpdatePacket and sending it back/forth? [02:22]
potato____ mutating, i don't know. serializing, yes [02:23]
Maldivia mutating, as in existingObj.setValue(...) as opposed to creating a new ComponentUpdatePacket(newValues..) [02:23]
potato____ yeah. ex: PositionComponent.x = newvalue; .z=newvalue; then sending that same object across [02:24]
freeone3000 Yep, that'll trigger the object cache if you're not resetting. [02:25]
Maldivia yep, then it's cached if you don't reset [02:25]
potato____ oh, cool. learning. what is it cached by and how do i reset? [02:25]
Maldivia object identity [02:25]
freeone3000 potato____: .reset() [02:25]
freeone3000 potato____: So, the idea is is that if you do: oos.write(x); oos.write(x); and on the other side, x =; y =; then x == y. [02:26]
_BIGSHOT_ [_BIGSHOT_!~big__@unaffiliated/niceguy00] has joined ##java [02:26]
_BIGSHOT_ i am using this; but whenever there are 2 calls to audio plays incompletely! [02:26]
_BIGSHOT_ how to synchronize both audios so that both play simultaneously!? [02:26]
freeone3000 potato____: This is dumb, but it's in the spec, so it has to work. Which means that object IDs in a single "session" (which is application-defined) get cached. To undo this, call .reset() on both sides pretty much at the same time. [02:26]
potato____ freeone3000: .reset on what? the object output stream? input stream? the component object itself? this is new to me and shouldn't be, smh [02:26]
Maldivia javadoc ObjectOutputStream.reset() [02:27]
Maldivia Maldivia: [JDK:] [02:27]
potato____ so, ObjectOutputStream.reset() after sending a packet, and input stream.reset() after receiving one? or just on sending side? [02:27]
freeone3000 potato____: Only on the sending side! On the receiving side, it means something entirely different. [02:27]
juro [juro!~juro@] has joined ##java [02:27]
juro parted the channel: [02:27]
freeone3000 potato____: (it will attempt to rewind the stream to the last mark point, which doesn't make sense for sockets, so it won't actually do anything) [02:27]
potato____ okay, thanks. reading this doc entry now. not sure how i dug through so many object stream tutorials while writing the networking stuff and missed this, but thank you guys for showing it to me :) [02:28]
freeone3000 (Because InputStream has mark()/reset() as a method pair, with different smenatics) [02:28]
freeone3000 potato____: Now. Here's the issue. [02:28]
freeone3000 potato____: You know this, despite a literature review, reading the documentation, and about a week working with this, because you heard it *from some guy on IRC* [02:28]
potato____ hahahaha. yeah :S [02:29]
freeone3000 potato____: Please reconsider using ObjectOutputStream and ObjectInputStream, and use something better-designed. Like JSON. [02:29]
potato____ Sure, I've got no problem changing it up. I didn't know they were discouraged/or there were better things until now :O [02:29]
potato____ JSON would be great for a bunch of reasons actually :) [02:30]
_BIGSHOT_ yo freeone3000 i am using this; but whenever there are 2 calls to audio plays incompletely! [02:30]
Maldivia _BIGSHOT_: don't poke people directly [02:30]
Maldivia wina [02:30]
Maldivia Why is no one answering? 1) They don't know. 2) They don't care. 3) They're too busy. Constantly repeating your question won't help. If someone knows, maybe they'll answer. In the meantime, you should consult your search engine of choice. [02:30]
potato____ thanks freeone, adding .reset() on the sending side did fix it. i guess my hunch that the object was "cached" was kiiind of right ish, but with the wrong understanding. in the future i'll work to replace the networking guts of this project with something better! [02:33]
potato____ thanks Maldivia too, and yawkat [02:35]
yottabyte [yottabyte!48008896@gateway/web/freenode/ip.] has joined ##java [02:36]
ztychr [ztychr!~ztychr@unaffiliated/ztychr] has joined ##java [02:37]
Sasazuka [Sasazuka!~Sasazuka@unaffiliated/sasazuka] has joined ##java [02:37]
yottabyte I don't know much about threads or concurrency and was wondering where I should start. The question stems from using the google storage api to download files and zip them together for downloading and finding if you download the files in a thread one by one, it makes everything much faster. is that sensible? [02:38]
Maldivia yottabyte: can work, yeah - really depends on the other end if they allow concurrent connections or not [02:39]
yottabyte is doing something like forEach(f -> new Thread(() -> {// download from google storage}) the same as parallelStream.forEach(f -> // download from google storage)? [02:39]
surial no. [02:40]
Maldivia new Thread you shouldn't do - use an executor service [02:40]
yottabyte it seems to work but I don't know about system threads vs cpu threads vs user threads vs java threads. do I have to worry about locking up the system and stealing threads from other processes? [02:40]
surial the par operation will maybe parallellize some of it. Creating 1 thread for each file will definitely end up running them all simultaneously... if google allows it. [02:40]
surial yottabyte: no. [02:40]
yottabyte does parallelStream use executor service behind the scenes? If memory serves you have to specify a number of threads right? what do I set that to? [02:41]
surial the system will manage this. modern OSes get perhaps a bit hot and bothered once you hit a few thousand. For pragmatic reasons, I'd limit your threads to something sane. mabbe 10. There are nice classes in j.u.concurrent package to create the construct of: "Here, take these 500 jobs, now run them all, and use 10 threads, so, take 10 jobs, run them, and the moment one of them is done, immediately run the 11th job, and keep going [02:41]
surial until they're all done'. [02:41]
surial yottabyte: don't use parstream, it's not what you want here. Use an actual executor service. [02:42]
surial (The reason to use ~10 isn't for CPU or local resources, really. It's more for the notion that downloading 500 files simultaneously really isn't going to make it go any faster). [02:42]
pd09041999 [pd09041999!~pd0904199@2405:205:5:ee80:106a:4c48:e82:9dba] has joined ##java [02:47]
synju [synju!c4d2309e@gateway/web/freenode/ip.] has joined ##java [02:48]
zrhoffman_ parted the channel: [02:53]
code_zombie [code_zombie!~code_zomb@2605:a601:aa1:da00:9069:bc94:3160:5b5f] has joined ##java [03:05]
plarsen [plarsen!~plarsen@redhat/jboss/pdpc.professional.plarsen] has joined ##java [03:05]
warfront1 [warfront1!4710f13a@gateway/web/cgi-irc/] has joined ##java [03:06]
henbruas [henbruas!~henbruas@unaffiliated/henbruas] has joined ##java [03:07]
t2mkn [t2mkn!~t2mkn@] has joined ##java [03:08]
worric [worric!] has joined ##java [03:11]
kgrimes2 [kgrimes2!] has joined ##java [03:19]
fstd_ [fstd_!~fstd@unaffiliated/fisted] has joined ##java [03:20]
fstd_ [fstd_!~fstd@unaffiliated/fisted] has joined ##java [03:22]
fstd_ [fstd_!~fstd@unaffiliated/fisted] has joined ##java [03:23]
jesse1010 [jesse1010!] has joined ##java [03:24]
jesse1010 does anyone know which gui framework ghidra uses? [03:24]
cheeser never heard of it [03:24]
jesse1010 the new nsa app [03:24]
jesse1010 reverse engineering [03:24]
cheeser i'm going to guess Swing this being a java channel and all [03:25]
jesse1010 well there is javafx [03:25]
cheeser did you bother checking it's github page? [03:25]
cheeser ha! how lame. why bother having a github page? [03:25]
cheeser nothing there but readmes. lame. [03:25]
jesse1010 yes but there isnt anything there [03:25]
freeone3000 yottabyte: parallelstream uses the thread's innate ForkJoinPool which has an executor but probably isn't what you want if you want any semblance of control [03:28]
RedSoxFan07 [RedSoxFan07!~Thunderbi@] has joined ##java [03:30]
yottabyte surial: so what about cpu threads vs java threads? I could set it to 1000? how did you pick 10? when is a case for parallelStream? [03:32]
surial yottabyte: 'cpu threads'? [03:33]
surial that's not a thing. [03:33]
surial yottabyte: there's no case for parstream, really. [03:33]
freeone3000 (it is a thing! but it doesn't make sense here) [03:33]
surial As I said, I picked 10 not for the CPU, for the network [03:33]
freeone3000 yottabyte: java.util.Thread has a 1:1 mapping with OS-level threads. Java does not expose interfaces below this layer. [03:34]
yottabyte I've heard of cpus having like 4 cores and 4 threads or 4 cores and 8 threads (hyper threading) [03:34]
yottabyte but maybe that's a lower level than what os level threads are like what freeone3000 is describing [03:34]
freeone3000 Yes, that's lower-level. This is not something Java allows you to manipulate. [03:35]
yottabyte should I do all downloading in multiple threads? you mentioned that downloading 500 filess simultaneously isn't going to make it go faster, but what's the harm in setting it that high? also, how can I download even 10 simultaneously if I only have 4 or 8 cpu threads? I guess I just don't know about OSes and these os level threads [03:36]
freeone3000 Ah, good questions! [03:36]
yottabyte where how can I possibly work on 500 threads at the "same time" [03:36]
freeone3000 yottabyte: We're going to go on an expedition into MC Hammer land ("can't touch this") for the purposes of learning. [03:36]
yottabyte yay [03:37]
freeone3000 yottabyte: So imagine you have a computer. It has one processor, which can do one thing at a time. One core, one thread, it's simple. Now, say you want to run two programs at once. First thought: Obviously you can't. Second thought: Well, you can, if they work together, and hand off control when they don't need the processor for a bit. Third thought: Well, if they can already hand it off, why doesn't the OS just handle the switch-off and [03:38]
freeone3000 make it invisible to the process? [03:38]
freeone3000 yottabyte: So modern OSes do the third. Threads are a way of doing this without doing multiple processes, because if you can do it per-process, you can do it at units smaller than a process if the OS says you can. However, there's a *cost* associated with the switch - the old code has to be unloaded, the new code has to be loaded, all the current state has to be unloaded, the new state has to be loaded, and this all has to be undone when [03:39]
freeone3000 the other program resumes. [03:39]
freeone3000 yottabyte: So, essentially, there's an in-built cost to concurrency built-in, for the illusion of being able to do two things at once. The highest-throughput programs are single-threaded. Which is why 500 is not necessarily better than 50. You can't download 10 simultaneously if you only have 4 available processors ("processors" being schedulable processing units, cores or threads or whatever they look like in hardware), but the OS will [03:41]
freeone3000 conspire to pretend you can. [03:41]
freeone3000 Now, why isn't 10 download threads better than 1 download thread? Because you're not hitting a CPU limit. Being able to spread the download across multiple CPUs doesn't help you, as you still only have one network connection everything has to be sent over. [03:42]
waz [waz!~waz@pdpc/supporter/active/waz] has joined ##java [03:44]
ernimril using threads may make the code easier to read though/maintain/write correctly so there is also a bonus to splitting some problems to several threads, several concurrent downloads can typically be such a case. [03:45]
freeone3000 I'd say that the real value there was in making the task a discrete unit (a Runnable/Callable) and invoking those through a common interface, and nothing to do with actually making it run in parallel. [03:46]
yottabyte what do you mean by your last line? is it about my download problem specifically? [03:51]
freeone3000 yottabyte: Yes, but it's also true in general. [03:51]
yottabyte well you can make multiple download requests to google cloud storage at the same time. I guess then you also have to worry about disk i/o bottleneck [03:52]
noodlepie [noodlepie!] has joined ##java [03:53]
Velgor [Velgor!] has joined ##java [03:53]
freeone3000 yes, but notably, you also have to worry about *network i/o bottlenekc* [03:54]
kirua [kirua!~kirua@unaffiliated/kirua] has joined ##java [03:56]
yottabyte well maybe it's the case google will never server a singular file faster than x, but you can have many files download at x if your connection is fast enough (this appears to be the case) [03:59]
nfd9001 [nfd9001!] has joined ##java [03:59]
pd09041999 [pd09041999!~pd0904199@] has joined ##java [04:00]
freeone3000 This was the case but should not currently be the case, but sure. [04:00]
Phizzy [Phizzy!] has joined ##java [04:05]
Velgor [Velgor!] has joined ##java [04:05]
ravenousmoose [ravenousmoose!] has joined ##java [04:07]
themsay [themsay!~themsay@] has joined ##java [04:10]
ztychr [ztychr!~ztychr@unaffiliated/ztychr] has joined ##java [04:12]
Tobbi [Tobbi!~Tobbi@supertux/tobbi] has joined ##java [04:24]
whaley [whaley!] has joined ##java [04:45]
aqd [aqd!] has joined ##java [04:52]
dez [dez!uid92154@fedora/deSouza] has joined ##java [04:52]
conan [conan!] has joined ##java [05:10]
nokdoot [nokdoot!~nokdoot@] has joined ##java [05:13]
ogradyd [ogradyd!~Thunderbi@2a02:8070:88bf:9df0::c1d] has joined ##java [05:15]
nokdoot Hello, I have a question, following code does not work on eclipse, but work on console with javac/java [05:17]
nokdoot [05:17]
cheeser doesn't work [05:18]
cheeser cheeser, doesn't work is useless. Tell us what it is, what you want it to do, and what it is doing. Consider putting some code and any errors on a pastebin. (use ~pastebin for suggestions) [05:18]
surial nokdoot: an exception contains 4 elements. [1] a type [2] a message [3] a stack trace and [4] a causal chain. [05:19]
nokdoot It never stop [05:19]
surial nokdoot: you print [3], and toss 1,2, and 4 in the trashcan. Stop doing this. Just make your main 'throws Exception'. [05:19]
surial nokdoot: of course not, standard in is endless. [05:19]
surial nokdoot: it's endless with javac/java too. [05:19]
surial nokdoot: in your loop, have some sort of 'get out' option. For example: if (line.equals("DONE")) break; [05:20]
zeden [zeden!~user@unaffiliated/zeden] has joined ##java [05:21]
nokdoot Ok I will change it thanks :> [05:22]
Anticom [Anticom!] has joined ##java [05:24]
nokdoot Thanks :> it works [05:25]
nokdoot cheeser: I'm sorry, I will try to explain about my problem next time [05:25]
surial yay! [05:25]
ravenousmoose [ravenousmoose!] has joined ##java [05:28]
noodlepie [noodlepie!] has joined ##java [05:29]
pr3d4t0r [pr3d4t0r!~zhenya01@2603:3024:1d7a:4000:6a05:caff:fe05:9a0e] has joined ##java [05:53]
dosdebug [dosdebug!~dosdebug@unaffiliated/dosdebug] has joined ##java [05:58]
immibis [immibis!] has joined ##java [06:03]
rruizt [rruizt!] has joined ##java [06:04]
Remavas [Remavas!~Remavas@unaffiliated/remavas] has joined ##java [06:08]
SolarFlare [SolarFlare!~SamanthaB@unaffiliated/samanthabdawn] has joined ##java [06:12]
discmuc [discmuc!~yaaic@] has joined ##java [06:18]
wildlander [wildlander!~wildlande@unaffiliated/wildlander] has joined ##java [06:20]
sakhd [sakhd!~sakhd@] has joined ##java [06:30]
Katana [Katana!~hentai@unaffiliated/katana] has joined ##java [06:31]
g00s [g00s!~g00s@unaffiliated/g00s] has joined ##java [06:33]
presonic [presonic!] has joined ##java [06:36]
jll94_ [jll94_!~jll94@2600:1004:b040:1655:68d5:b136:b824:ef22] has joined ##java [06:48]
wadadli So I'm trying to build a scala app on on a Jenkins build server... [07:15]
wadadli It appears they both use the java opts in the env to set the max heap size [07:15]
wadadli I'm so confused by this [07:16]
wadadli computers suck. [07:16]
wadadli The JX watcher seems to be what dies complaining about being OOM [07:17]
Markow [Markow!~ejm@] has joined ##java [07:32]
ztychr [ztychr!~ztychr@unaffiliated/ztychr] has joined ##java [07:42]
tristianc [tristianc!] has joined ##java [07:54]
mingzie_ [mingzie_!3d44304e@gateway/web/freenode/ip.] has joined ##java [07:59]
Crash1hd [Crash1hd!~Crash1hd@unaffiliated/crash1hd] has joined ##java [08:02]
whaley [whaley!] has joined ##java [08:07]
orbyt_ [orbyt_!~orbyt@] has joined ##java [08:10]
rruizt [rruizt!] has joined ##java [08:43]
RedSoxFan07 [RedSoxFan07!~Thunderbi@] has joined ##java [08:47]
Tobbi [Tobbi!~Tobbi@supertux/tobbi] has joined ##java [09:16]
whaley [whaley!] has joined ##java [09:21]
Tobbi [Tobbi!~Tobbi@supertux/tobbi] has joined ##java [09:22]
adder [adder!~adder@gateway/tor-sasl/adder] has joined ##java [09:26]
zulutango [zulutango!] has joined ##java [09:26]
l0ck [l0ck!] has joined ##java [09:29]
AMcBain [AMcBain!] has joined ##java [09:38]
Bittersweetsymph [Bittersweetsymph!~bitterswe@unaffiliated/bittersweetsymph] has joined ##java [09:57]
CAPITANOOO [CAPITANOOO!~CAPITANOO@] has joined ##java [10:11]
flippo [flippo!~flippo@unaffiliated/flippo] has joined ##java [10:27]
javango [javango!~javango@] has joined ##java [10:37]
pd09041999 [pd09041999!~pd0904199@] has joined ##java [10:45]
forgottenone [forgottenone!~forgotten@] has joined ##java [11:04]
Tobbi [Tobbi!~Tobbi@supertux/tobbi] has joined ##java [11:07]
jll94_ [jll94_!~jll94@2600:1004:b040:1655:68d5:b136:b824:ef22] has joined ##java [11:07]
Tobbi [Tobbi!~Tobbi@supertux/tobbi] has joined ##java [11:08]
Goplat [Goplat!~Goplat@reactos/developer/Goplat] has joined ##java [11:11]
tassee [tassee!] has joined ##java [11:15]
dez [dez!uid92154@fedora/deSouza] has joined ##java [11:23]
Jigsy` [Jigsy`!~Jigsy@unaffiliated/jigsy] has joined ##java [11:31]
Anthaas [Anthaas!~Anthaas@unaffiliated/anthaas] has joined ##java [11:37]
pd09041999 [pd09041999!~pd0904199@] has joined ##java [11:47]
pyav [pyav!7aa6581f@gateway/web/freenode/ip.] has joined ##java [11:55]