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

« 2021-04-07


2021-04-09 »

Nick Message Date
Sgeo [Sgeo!] has joined ##java [12:05]
dave_uy4 [dave_uy4!~david@] has joined ##java [12:08]
Enissay [Enissay!~Enissay@unaffiliated/enissay] has joined ##java [12:14]
Jantz [Jantz!] has joined ##java [12:17]
upgrdman_ [upgrdman_!~upgrdman@blender/artist/upgrdman] has joined ##java [12:26]
Enissay [Enissay!~Enissay@unaffiliated/enissay] has joined ##java [12:36]
ScrambledRK [ScrambledRK!] has joined ##java [12:55]
Enissay [Enissay!~Enissay@unaffiliated/enissay] has joined ##java [12:56]
Enissay [Enissay!~Enissay@unaffiliated/enissay] has joined ##java [01:13]
Sgeo [Sgeo!] has joined ##java [01:22]
swj [swj!~swj@2409:8928:544c:374:d4d5:b2:f1d9:8085] has joined ##java [01:50]
Enissay [Enissay!~Enissay@unaffiliated/enissay] has joined ##java [02:18]
Tide [Tide!~TideFN@2601:cb:8280:9520:512f:ec05:9d35:444] has joined ##java [02:24]
viju [viju!~viju@] has joined ##java [02:24]
Enissay [Enissay!~Enissay@unaffiliated/enissay] has joined ##java [02:40]
Matthijs [Matthijs!~quassel@unaffiliated/matthijs] has joined ##java [02:42]
code-witch [code-witch!~code-witc@] has joined ##java [02:45]
black_ant [black_ant!~antilope@unaffiliated/black-ant/x-1505394] has joined ##java [02:54]
dpl [dpl!] has joined ##java [03:02]
Enissay [Enissay!~Enissay@unaffiliated/enissay] has joined ##java [03:08]
bolovanos [bolovanos!~bolovanos@unaffiliated/bolovanos] has joined ##java [03:16]
Iacob [Iacob!~yong@] has joined ##java [03:23]
vantage [vantage!] has joined ##java [03:27]
Bebef [Bebef!] has joined ##java [03:28]
Enissay [Enissay!~Enissay@unaffiliated/enissay] has joined ##java [03:29]
swj [swj!~swj@2409:8928:544c:374:d4d5:b2:f1d9:8085] has joined ##java [03:30]
istlf [istlf!~istlf@] has joined ##java [03:30]
Sgeo_ [Sgeo_!] has joined ##java [03:55]
joelmo [joelmo!uid17355@gateway/web/] has joined ##java [04:02]
hendursaga [hendursaga!~weechat@gateway/tor-sasl/hendursaga] has joined ##java [04:06]
lithium [lithium!~lithium@unaffiliated/lithium] has joined ##java [04:25]
aedroid [aedroid!] has joined ##java [04:26]
welldone [welldone!2925d8da@unaffiliated/welldone] has joined ##java [04:46]
Fr1nge [Fr1nge!~Fr1nge@] has joined ##java [04:47]
welldone in tomcat, I want to redirect incoming HTTP connections to HTTPS, can I have 2 <Connectors> server.xml and use redirect parameter? [04:50]
_lucifer tech support [04:51]
_lucifer welldone, 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. [04:51]
LKoen [LKoen!] has joined ##java [04:53]
Fr1nge [Fr1nge!~Fr1nge@] has joined ##java [04:56]
Fr1nge [Fr1nge!~Fr1nge@] has joined ##java [04:57]
sizeof_void34 [sizeof_void34!] has joined ##java [04:58]
georgios [georgios!~george@unaffiliated/anaphaxeton] has joined ##java [05:11]
Jantz_ [Jantz_!] has joined ##java [05:12]
acidjnk_new [acidjnk_new!] has joined ##java [05:14]
fstd_ [fstd_!~fstd@unaffiliated/fisted] has joined ##java [05:18]
Fr1nge [Fr1nge!~Fr1nge@] has joined ##java [05:20]
Rashad [Rashad!~textual@2a01:9700:141d:fd00:3521:d57:8da:d7f1] has joined ##java [05:28]
Rashad [Rashad!~textual@2a01:9700:141d:fd00:3521:d57:8da:d7f1] has joined ##java [05:34]
aedroid [aedroid!] has joined ##java [05:45]
lithium [lithium!~lithium@unaffiliated/lithium] has joined ##java [05:47]
swj [swj!~swj@2409:8928:544c:374:890f:e0f0:9e5e:8304] has joined ##java [05:52]
Feuermagier [Feuermagier!~Feuermagi@2a02:2488:4211:3400:7285:c2ff:fe22:172e] has joined ##java [06:00]
mgd [mgd!] has joined ##java [06:04]
mgd I'm about to ask a stupid question so please bear with me as I'm not sure how to put this. How does Java define a method and a function? [06:07]
mgd Is everything ultimately a method or does java.util.function actually provide functions through streams and lamdas? [06:07]
[twisti] mgd: you need to elaborate what aspect your question is about. how its defined in the JLS ? how it looks in the bytecode ? whats legal ? [06:07]
[twisti] ah. ju.function is nothing but a marker interface, it doesnt really do anything on its own at all [06:08]
[twisti] wait, brain hiccup [06:08]
_lucifer i think you meant FunctionalInterface [06:08]
[twisti] do you mean java.util.function.Function, or the package ? [06:08]
mgd the package [06:09]
[twisti] or, as _lucifer said, the FunctionalInterface ? [06:09]
[twisti] ah. the package just defines convenience interfaces, really [06:09]
asymptotically [asymptotically!~asymptoti@gateway/tor-sasl/asymptotically] has joined ##java [06:09]
Fr1nge [Fr1nge!~Fr1nge@] has joined ##java [06:09]
[twisti] you could redefine your own if you wanted to [06:09]
mgd I'm a little lost as I've seen the terms method and function used interchangeable. I guess I just want to know how Java defines those two terms [06:10]
_lucifer everything is a method in java. you cannot have top level functions. [06:10]
_lucifer not everything everything. i mean java only has methods [06:11]
mgd Sorry and a top level function is like a higher order function or have I got that wrong? [06:11]
[twisti] i think the general consensus is that if its part of a class definition, people call it a method, and if its passed around, they call it a function [06:11]
mgd @twisti so like a lambda which can be passed around [06:12]
[twisti] a top level function would be one available without a class or interface, which some languages allow, but java doesnt [06:12]
_lucifer like in some languages say Python, you can define a function outside a class. [06:12]
_lucifer ^^ [06:12]
mgd Ok, so since every action in Java has to be linked to a class/interface, statically or otherwise, they are all methods? [06:13]
Fr1nge [Fr1nge!~Fr1nge@] has joined ##java [06:13]
Rashad [Rashad!~textual@2a01:9700:141d:fd00:3521:d57:8da:d7f1] has joined ##java [06:15]
_lucifer not sure what you aiming at here, but IMO for all practical purposes you can use the the term methods and functions interchangeably. [06:16]
aedroid [aedroid!] has joined ##java [06:16]
lithium [lithium!~lithium@unaffiliated/lithium] has joined ##java [06:17]
mgd It's a little hazy for me still. I can't really find a solid definition of a function and method which is separate to a particular language or paradigm. [06:17]
[twisti] there is no such thing [06:17]
[twisti] language is a fluid and imprecise thing, people use terms differently and sometimes they evolve over time [06:18]
mgd So it's just down to the vocabulary that the language uses? [06:18]
Maldivia mgd: it's actually straight forwards, java doesn't have functions, it only has methods :D [06:18]
mgd @Maldivia I can live with that :) [06:18]
[twisti] yes. if you want rock solid definitions applicable to java 100%, check out the Java Language Specification (JLS) [06:18]
Maldivia "A method declares executable code that can be invoked, passing a fixed number of values as arguments." [06:19]
mgd That's really useful. I've never really looked into the JLS [06:21]
Maldivia jls [06:21]
Maldivia Maldivia, jls is short for the 'Java Language Specification'; it is the official spec that defines what java (the language) is. You can find it at - you can also find the 'Java Virtual Machine Specification' there, which defines java (the virtual machine). [06:21]
[twisti] the JLS is horribly dry at times, but actually quite readable by a layman imo [06:22]
Maldivia and very verbose covering 99.9% of cornercases [06:22]
Maldivia (which is good) [06:22]
code-witch [code-witch!~code-witc@] has joined ##java [06:26]
aedroid [aedroid!] has joined ##java [06:30]
lithium [lithium!~lithium@unaffiliated/lithium] has joined ##java [06:34]
yawkat how do you use logback with native-image? initializing it at build time works fine, except for file appenders, because obv it should only open the log file at runtime [06:35]
[twisti] i think today is the first time in my life that i have unironically used the (logical) XOR operator in java [06:40]
yawkat logical = on boolean? [06:42]
[twisti] yes [06:42]
yawkat imo != is usually more readable [06:42]
[twisti] obviously i have used XOR on bits when i played with that kind of low level stuff [06:43]
computeiro [computeiro!~Wender@] has joined ##java [06:43]
[twisti] (im writing code that deals with file ownership, and it has both an ignore list as well as a list of patterns it will handle, and the code needs to be able to answer whether it deals with a file, and of course both dealing with it AND ignoring it is just as wrong as doing neither) [06:44]
[twisti] != didnt feel apropriate for saying 'either/or' [06:46]
[twisti] of course, i just realized that something being both ignored and covered, that really ought to throw an exception, not just return false [06:50]
[twisti] bye bye, ^ use [06:50]
lithium [lithium!~lithium@unaffiliated/lithium] has joined ##java [06:54]
Fr1nge [Fr1nge!~Fr1nge@] has joined ##java [06:57]
asymptotically [asymptotically!~asymptoti@gateway/tor-sasl/asymptotically] has joined ##java [07:02]
paddyez [paddyez!~Patrick-E@wikipedia/paddyez] has joined ##java [07:03]
solvr [solvr!57e3c46d@] has joined ##java [07:14]
Fr1nge [Fr1nge!~Fr1nge@] has joined ##java [07:15]
Fr1nge [Fr1nge!~Fr1nge@] has joined ##java [07:17]
waz [waz!~waz@pdpc/supporter/active/waz] has joined ##java [07:18]
solvr My usual strategy with constructors is to consider them a low level "everything and the kitchen sink" collectors of initial configuration and state, and relegate the nice UX to factory methods and builders. How does that match common practices. [07:20]
istlf_ [istlf_!~istlf@] has joined ##java [07:22]
Fr1nge [Fr1nge!~Fr1nge@] has joined ##java [07:23]
_lucifer if you want control over object creation, prefer builders or factories otherwise constructors are fine i think. [07:24]
_lucifer effective java covers this is some detail iirc. [07:24]
Fr1nge [Fr1nge!~Fr1nge@] has joined ##java [07:25]
solvr _lucifer, my point was I usually tried to keep constructors clean. Nowadays a constructor might have 10-20 arguments and I consider it OK because you rarely need to type that directly. [07:25]
_lucifer having a large number of arguments is another point in favour of builders. [07:26]
aedroid [aedroid!] has joined ##java [07:27]
solvr _lucifer, do you have a strategy for separating "dependency injection" arguments from "object configuration" arguments. [07:28]
_lucifer I haven't had to deal with that myself yet but I'd go ahead with whatever the idiom is for that framework. [07:30]
Fr1nge [Fr1nge!~Fr1nge@] has joined ##java [07:31]
solvr My question doesn't regard a given framework, more like 1) set of arguments where you take in dependencies from the environment (db connections, whatever) 2) set of arguments that define the object's behavior [07:31]
solvr Arguably those are the same things, but [07:31]
solvr Let's say the first set tends to be more uniform across a set of instances [07:31]
solvr The latter more specific [07:31]
Seji [Seji!] has joined ##java [07:33]
_lucifer I am not sure I understand you correctly but all of the arguments will need to go into the constructor, only thing you can control is the order, order them as you wish but consistently. [07:35]
solvr _lucifer, I'll give an example. You instantiate factory with DB connection, logger, and few other things like that. Then you can use this factory and instantiate concrete objects by passing few extra args, implicitly the object receives everything you gave the factory as well [07:37]
lithium [lithium!~lithium@unaffiliated/lithium] has joined ##java [07:37]
solvr _lucifer, call it curried construction :P [07:38]
Fr1nge [Fr1nge!~Fr1nge@] has joined ##java [07:39]
_lucifer sounds like AbstractFactory pattern? [07:39]
Fr1nge [Fr1nge!~Fr1nge@] has joined ##java [07:43]
Fr1nge [Fr1nge!~Fr1nge@] has joined ##java [07:54]
solvr [solvr!57e3c46d@] has joined ##java [07:54]
solvr _lucifer it's like an abstract factory in that you can configure a library and pass it around to make object. But it's unlike it in that the factory doesn't have to be polymorphic (it differs in construction arguments, not concrete class) [07:55]
solvr _lucifer, or maybe I misunderstand the pattern dunno [07:55]
lithium [lithium!~lithium@unaffiliated/lithium] has joined ##java [07:58]
Fr1nge [Fr1nge!~Fr1nge@] has joined ##java [07:58]
Fr1nge [Fr1nge!~Fr1nge@] has joined ##java [07:59]
Fr1nge [Fr1nge!~Fr1nge@] has joined ##java [08:00]
Fr1nge [Fr1nge!~Fr1nge@] has joined ##java [08:02]
Fr1nge [Fr1nge!~Fr1nge@] has joined ##java [08:05]
Fr1nge [Fr1nge!~Fr1nge@] has joined ##java [08:07]
Fr1nge [Fr1nge!~Fr1nge@] has joined ##java [08:12]
[twisti] [[twisti]!] has joined ##java [08:16]
Lengsdorfer [Lengsdorfer!~Lengsdorf@unaffiliated/lengsdorfer] has joined ##java [08:16]
Fr1nge [Fr1nge!~Fr1nge@] has joined ##java [08:20]
Zapek [Zapek!] has joined ##java [08:24]
Fr1nge [Fr1nge!~Fr1nge@] has joined ##java [08:27]
code-witch [code-witch!~code-witc@] has joined ##java [08:28]
Anticom [Anticom!~Anticom@] has joined ##java [08:30]
FabioP [FabioP!] has joined ##java [08:31]
LKoen [LKoen!] has joined ##java [08:40]
zeden [zeden!~user@unaffiliated/zeden] has joined ##java [08:46]
wedr [wedr!] has joined ##java [08:50]
solvr Looks like we're averaging about one "why OOP sucks" presentation per three months. [08:54]
Betal [Betal!~Betal@unaffiliated/betal] has joined ##java [08:56]
wedr Maybe Java can be rewritten to be a data-oriented programming language? [08:56]
solvr Pretty much is. [08:57]
solvr But once per 3 months is nothing. We probably get "why cute puppies suck" presentation more often than this. [08:57]
Chai-T-Rex [Chai-T-Rex!~ChaiTRex@gateway/tor-sasl/chaitrex] has joined ##java [09:02]
di0_ [di0_!~di0_@unaffiliated/di0-/x-5053590] has joined ##java [09:04]
sbalmos cute kittens are just juvenile terrorists [09:06]
v01d4lph4 [v01d4lph4!~v01d4lph4@] has joined ##java [09:07]
solvr sbalmos, I agree, unfortunately puppies get all the hate, while they do all the work [09:11]
md_5 [md_5!~md_5@mcdevs/trusted/md-5] has joined ##java [09:15]
yawkat [yawkat!] has joined ##java [09:17]
VideoGameEnjoyer [VideoGameEnjoyer!] has joined ##java [09:22]
muhaha [muhaha!59b09477@gateway/web/cgi-irc/] has joined ##java [09:32]
welldone [welldone!2925d8da@unaffiliated/welldone] has joined ##java [09:46]
average [average!uid473595@gateway/web/] has joined ##java [09:46]
hussam [hussam!~hussam@unaffiliated/hussam] has joined ##java [09:46]
plarsen [plarsen!~plarsen@redhat/jboss/pdpc.professional.plarsen] has joined ##java [09:49]
kicked Fr1nge (Banned: please fix your connection. you're bouncing in and out. this ban will expire after 4h) [09:49]
jamezp [jamezp!~jamezp@redhat/jboss/jamezp] has joined ##java [09:57]
VideoGameEnjoyer [VideoGameEnjoyer!] has joined ##java [10:00]
Peste_Bubonica [Peste_Bubonica!~Peste_Bub@unaffiliated/peste-bubonica/x-4612396] has joined ##java [10:06]
Sgeo [Sgeo!] has joined ##java [10:16]
[twisti] can LocalDateTime.parse be coerced to accept a DateTimeFormatter that does not include a time (and substitute zeroes) ? it seems awkward to have to have two code branches for user submitted date/time patterns [10:18]
_lucifer something like this ? [10:19]
_lucifer _lucifer's title: "java - Is there a way to determine if a DateTimeFormatter is date only or time only after construction? - Stack Overflow" [10:19]
[twisti] thanks, totally wrong question, but the answer still solves my problem :D [10:21]
Enissay [Enissay!~Enissay@unaffiliated/enissay] has joined ##java [10:28]
NorthwestVegan [NorthwestVegan!~Northwest@gateway/tor-sasl/northwestvegan] has joined ##java [10:39]
lithium [lithium!~lithium@unaffiliated/lithium] has joined ##java [10:40]
SirMangler [SirMangler!] has joined ##java [10:47]
MrFlibble [MrFlibble!Rimmer@] has joined ##java [10:51]
serra [serra!] has joined ##java [10:52]
lithium [lithium!~lithium@unaffiliated/lithium] has joined ##java [10:59]
mitch0 hm, that's pretty nice actually [11:05]
Sheilong [Sheilong!uid293653@gateway/web/] has joined ##java [11:07]
solvr [solvr!57e3c46d@] has joined ##java [11:08]
hnOsmium0001 [hnOsmium0001!uid453710@gateway/web/] has joined ##java [11:09]
Klinda [Klinda!~klinda@] has joined ##java [11:09]
maroloccio [maroloccio!] has joined ##java [11:11]
Sgeo_ [Sgeo_!] has joined ##java [11:18]
solvr Do we have some middle-ground between referencing an object directly, and using SQL-style PK/FK to reference it. [11:19]
Sgeo [Sgeo!] has joined ##java [11:20]
mitch0 solvr: ? [11:21]
solvr Sounds weird right [11:21]
mitch0 Map<String, YourObject> ? [11:22]
solvr mitch0, thanks [11:23]
cheeser omg [11:24]
tayl [tayl!~taylor@unaffiliated/tayl] has joined ##java [11:29]
mitch0 cheeser: :) [11:30]
solvr mitch0, cheeser, ok honestly that wasn't what I needed, but I didn't want to be an asshole [11:35]
mindCrime_ [mindCrime_!] has joined ##java [11:36]
solvr My problem is that I index a set of records on some criteria. Then I run a query using the index. First criteria with index, fine. But then I have a subset of records. I can no longer use my indexes on the SUBSET of records. Not efficiently at least. [11:36]
solvr Because the indexes are on all records [11:36]
solvr I guess I'm asking is there an algorithm to efficiently compute indexes on subset of data, where the full set of data is indexed [11:37]
freeone3000 you want a relational database. [11:37]
solvr Well, I want specifically to learn about index on subsets [11:37]
ernimril solvr, what does index on subset mean to you? [11:37]
solvr ernimril, let's say you have 1000 users. An you have a Map<userEmail, userArrayIndex> [11:38]
solvr ernimril, I have another similar index, on name. I get all users named John. Now I want to get all users John with email "foo@bar.baz" [11:39]
freeone3000 one of those is going to be a hashscan. [11:39]
solvr I can no longer use my index over the 1000 users, I have a subset of users John [11:39]
solvr freeone3000 and the other one? [11:40]
freeone3000 solvr: the other one uses the index, obviously. [11:40]
solvr Wait. [11:40]
ernimril yeah, with the tiny collections mentioned here it is probably not worth optimizing, but other than that I would suggest a spatial index, possibly my prtree [11:40]
freeone3000 solvr: you could also create a new index on email*name. [11:40]
solvr ernimril, I'll check this out thanks [11:41]
solvr freeone3000, am I misunderstanding what a "hashscan" is [11:41]
solvr It's not a scan... on hash? [11:41]
freeone3000 it is. it's the fallback method for a sql database, where each row is essentially checked for equality in linear time. [11:42]
solvr Oh so a linear scan [11:42]
solvr filter() basically [11:42]
solvr Why is it called a hashscan? [11:42]
freeone3000 'cause it scans. on the hash. [11:42]
solvr I associated it with hashtable [11:42]
solvr OK [11:42]
solvr Got it [11:42]
freeone3000 (it's going to be referenced more than once in a query, so what usually happens is a hashtable is *created* for this query alone, so you don't lose out on the work it already did when you need to do a where, or a subquery scan, or etc later) [11:43]
freeone3000 don't pay too much attention to me, though, I've only worked on an sql database for a *bit*. [11:43]
sonOfRa You can always... create a multi-column index. They're more efficient on most DBMS if you are searching on a "leftmost prefix" of the index [11:44]
solvr Why say that. I'm listening :P [11:44]
solvr sonOfRa, I'm trying to figure out the usecases where I don't know the exact column combos in advance, but I agree it's useful [11:45]
pioto [pioto!~pioto@unaffiliated/pioto] has joined ##java [11:45]
sonOfRa Ah so basically you have... some kind of document, which you need to store and query? [11:45]
sonOfRa this is veering rather off-topic for this channel [11:46]
solvr I have collections I, basically "join" SQL style. In memory. But without SQL DB [11:46]
solvr OK [11:46]
solvr You know one of the reasons I'm trying this is figuring out how to use immutable Java records in bigger structures, without rigidly connecting them explicitly with hard references [11:47]
solvr A record is immutable. But the relationship, I wish, was "externalized" and mutable. [11:48]
freeone3000 you want a database. [11:48]
solvr freeone3000, well. Like a very specialized, in-memory database. If you will. [11:48]
cheeser h2 then [11:48]
LKoen [LKoen!] has joined ##java [11:48]
Diablo-D3 really nothing wrong with h2, it works well [11:49]
solvr freeone3000, more specifically all I care about is quick joins. Nothing else. [11:49]
solvr I'll check h2 [11:49]
solvr The documentation has Windows XP screenshots. Exciting. [11:51]
sa02irc [sa02irc!] has joined ##java [11:51]
taxon [taxon!] has joined ##java [11:53]
solvr OK can I take a step back. [11:53]
solvr Let's forget databases, FKs and so on. [11:53]
solvr Let's just assume I want bunch of immutable Java records to have 1:1 or 1:N relationships. But despite the records are immutable, I want those relationships to be mutable, so I can swap a record for another record value in a given relationship [11:54]
freeone3000 solvr: have you considered a database? that'd be the first thing I reach for here. [11:54]
solvr They already come from a database. But they're a tiny subset of the database [11:55]
sonOfRa So query better? [11:55]
freeone3000 *use the database* [11:55]
solvr I'm not trying to filter out records. [11:55]
solvr I'm trying to relate them [11:55]
freeone3000 it also does that! that's the first word! [11:55]
solvr Filtering out is kind of instrumental [11:55]
solvr Come on, a DB returns flat records list [11:56]
freeone3000 no, it returns a *square* records *table* [11:56]
solvr Great [11:56]
qqqhhh [qqqhhh!~qqqhhh@] has joined ##java [11:56]
solvr That can't efficiently represent 1:N relationship [11:56]
freeone3000 yes, it can; that's an fk relationship, directly. [11:57]
solvr I don't know why I have to dumb this down so much. [11:57]
freeone3000 because you're bad at explaining. [11:57]
solvr Fine. [11:57]
solvr We have a table of users, who have friends. Graph of friends. [11:58]
solvr What query would fetch a graph for a subset of users [11:58]
solvr None. You'll get a subset of users, but not in a graph [11:58]
solvr Rather, in a list. [11:58]
freeone3000 ah, okay. you're thinking as if the representation of the data and the data have to be isomorphic. [11:59]
solvr So now you need to materialize this relationship somehow [11:59]
solvr freeone3000, I don't need it to be isomorphic directly from the DB. But I somehow need to get there at some point [11:59]
freeone3000 so just... trace the relations. the graph exists, in the db, as relations. [11:59]
solvr So I trace it. [12:00]
solvr I build the graph say [12:00]
freeone3000 why are you building a graph, when the graph is already built? [12:00]
rajrajraj [rajrajraj!uid72176@gateway/web/] has joined ##java [12:00]
freeone3000 the graph is *implicit* in your data. [12:00]
solvr .Implicit is great, until you gotta walk it [12:00]
solvr Then it's not great [12:01]
Cuckoo` i'm very confused by this conversation, i feel like you're doing that thing where you're inventing problems that don't exist for yourself or something along those lines [12:01]
Cuckoo` I'm not sure i follow your description of your database schema and what you're trying to do, but usually the answer to maintaining complex relationships in java objects is just a map of some kind based on your query, but without knowing what you're trying to do and your schema, we can't write your query for you [12:02]
ernimril a part of the problem is that solvr never wants to actually explain what he is trying to do or why it is all high level abstract stuff [12:02]
qqqhhh [qqqhhh!~qqqhhh@] has joined ##java [12:04]
Cuckoo` It can get kind of ugly nesting maps of maps and things, but i've done it many times and it works fine if you think it through. maybe some of the more experienced people here have better more technical recommendations but in my experience it works for me [12:04]
solvr Let's take this "implicit graph" of friends. [12:05]
davidv7_ [davidv7_!] has joined ##java [12:05]
solvr How do I provide a nice API on top of it, so people can walk it, "user foo, their friends, their friends' friends"... [12:05]
Cuckoo` Is this "graph" a column in a database? some code generated based on data in the database? what is this 'graph' [12:05]
solvr Cuckoo`, a graph of people, like on Facebook. [12:05]
solvr People who know each other. [12:06]
ernimril solvr, easy, implement something for the first 5 levels, then return everyone... six-degrees [12:06]
Cuckoo` sounds more like a tree [12:06]
qqqhhh [qqqhhh!~qqqhhh@] has joined ##java [12:06]
gambl0re how do i remove and return the removed element from a set? [12:07]
solvr Cuckoo`, well, a tree is a graph. [12:07]
Cuckoo` i don't make graphs [12:07]
solvr Great [12:07]
Cuckoo` i use reporting tools to turn data into graphs, if i ever do that [12:07]
mbooth Cuckoo`: A graph has nodes (people) and edges (relationships) [12:08]
gambl0re you guys doing leetcode? [12:08]
gambl0re interesting.. [12:08]
mbooth It sounds like each person record has a list of other people with which they have a relationship, hence the "implicit" nature of the graph [12:09]
_lucifer gambl0re: what does that mean? you are removing the element, just return it? [12:09]
Cuckoo` Map<User, Collection<User>> thisUserToAllFriendsMap [12:09]
VideoGameEnjoyer [VideoGameEnjoyer!] has joined ##java [12:09]
Cuckoo` build from map [12:10]
gambl0re _lucifer: remove returns a boolean, not the value [12:10]
rajrajraj i wanted to talk about oracle vs google, but i am banned in #java-talk [12:10]
_lucifer gambl0re: but you pass the value you want to remove to it [12:10]
mbooth rajrajraj: A programming channel is not really the place to discuss a lawsuit either, IMO [12:10]
gambl0re im removing by index [12:11]
rajrajraj mbooth: #java-talk is much more of a casual channeel [12:11]
mbooth looks around [12:11]
mbooth rajrajraj: We are not in #java-talk [12:11]
gelignite [gelignite!] has joined ##java [12:11]
solvr Well there are programming implications of that lawsuit [12:11]
solvr Can't we have like QA rule that the lawsuit talk stops when someone asks a Java question [12:12]
rajrajraj mbooth: yes i am banned there i dont even remember why [12:12]
_lucifer gambl0re: didn't you say you were using a Set? [12:12]
solvr But permit it otherwise [12:12]
Renari [Renari!] has joined ##java [12:12]
mbooth rajrajraj: Okay? [12:12]
gambl0re _lucifer: ya [12:12]
gambl0re i dont want dupe values... [12:12]
solvr rajrajraj, try #programming. The lawsuit has broad implications [12:12]
solvr rajrajraj sorry ##programming [12:12]
_lucifer sets are unordered [12:12]
rajrajraj same banned solvr [12:13]
solvr Hehe [12:13]
rajrajraj proabbaly they dont like irccloud [12:13]
gambl0re should i use arraylist? [12:13]
solvr rajrajraj, is your nick registered, that may be it [12:13]
rajrajraj its registered [12:13]
solvr rajrajraj try [12:13]
rajrajraj that reveals my IP :x [12:13]
solvr Oh no, your IP. [12:14]
solvr P  /s [12:14]
_lucifer gambl0re: if you don't want duplicates, sure use set. but why are you removing by index? [12:14]
mbooth Hahaha, "everywhere I go I get banned -- the problem must be my client and definitely not me" [12:14]
gambl0re rajrajraj: you can use Tor [12:14]
_lucifer which set implementation are you using? [12:14]
gambl0re HashSet [12:14]
rajrajraj gambl0re: i am on office pc, installing tor on this is red alert :D [12:14]
rajrajraj btw i just heard that spring boot is getting old [12:15]
nyxyn [nyxyn!~nyxyn@2600:1700:3db0:2540:910:e58b:2116:37c2] has joined ##java [12:15]
_lucifer gambl0re, so where do you see a method to remove by index? [12:15]
rajrajraj is there something advanced in spring boot [12:16]
gambl0re _lucifer: what do you mean? [12:16]
gambl0re set.remove(index_pos) [12:16]
_lucifer check the javadoc, there is no such method. [12:17]
gambl0re im using intellij, the remove method is being shown [12:17]
mbooth gambl0re: Are you *sure* it's a Set then? [12:18]
_lucifer well, its the remove(Object) method [12:18]
gambl0re im doing Set<Integer> nums = new HashSet<>(); [12:18]
gambl0re isnt that a set? [12:18]
_lucifer yes, but it will remove the integer you pass to it. [12:19]
mbooth Yes, but it has remove(Object) and NOT remove(index) [12:19]
mbooth You should actually read the javadoc ;-) [12:20]
gambl0re then how come its working for me [12:20]
gambl0re when i do remove method [12:20]
gambl0re i did set.remove(0) and it worked [12:20]
Cuckoo` It's removing your integer from the set. It is not removing the index of that integer from an array. [12:20]
Cuckoo` Because it's not an array. [12:20]
Cuckoo` Behind the scenes there is probably an array with indexes to keep track of what is in that set and where it is in the backing array (an educated guess), but as far as what you're interacting with, there's no method to remove by index as mentioned above [12:21]
Kristine86 [Kristine86!4a45dc0c@gateway/web/cgi-irc/] has joined ##java [12:21]
Cuckoo` So, to answer your question, in your case, the thing being removed is literally the integer you passed in. [12:22]
gambl0re oh so when i was doing set.remove(0) it wasnt removing el from index 0 but rather the literal value of 0 [12:22]
gambl0re thanks guys [12:22]
solvr In C/C++ sometimes we on purpose hide the identity of an object, and expose some abstract identifier, like a simple number even, for others to refer to it. Do you do this in Java? [12:24]
Kristine86 I am trying to parallelize current code that stores values in a single HashMap but in different keys. I'm trying to calculate value for each key in HashMap in a single thread. Currently using newFixedThreadPool. Do I have to use concurrentHashMap, is it recommended? What's your suggestion? [12:25]
ernimril Kristine86, do not modify HashMap from concurrent threads, that never ends well [12:26]
ernimril Kristine86, so ConcurrentHashMap or some other synchronized version is what you want [12:27]
_lucifer Cuckoo: its actually backed by a HashMap. [12:27]
Cuckoo yeah, that's why i said it was a guess, cuz i was totally not sure but in my head an array made some sense [12:27]
Kristine86 ernimril OK I will look into it. So it doesn't limit me from functions I was using for HashMap though right? [12:28]
_lucifer and java's HashMap implementation is very interesting. if the bins exceed a certain size, they are converted to Trees. [12:28]
ernimril Kristine86, Both HM and CHM expose a lot of methods, most of them are the same from a high level perspective [12:29]
Kristine86 OK great! Didn't know about converting it to Trees. Interesting _lucifer [12:29]
ernimril may be converted to trees, if the content is comparable [12:30]
dmlloyd the implementation has changed over time, and will probably continue to change [12:30]
ernimril and it is something you really do not want to rely on, it means you have a hashCode that is silly, but you have bothered to implement comparable in a sane way [12:30]
_lucifer yeah, it was added as a protection against DDoS attacks iirc. Heinz Kabutz had a nice talk about it. [12:32]
maroloccio [maroloccio!] has joined ##java [12:35]
v01d4lph4 [v01d4lph4!~v01d4lph4@] has joined ##java [12:41]
lithium [lithium!~lithium@unaffiliated/lithium] has joined ##java [12:42]
long4mud [long4mud!] has joined ##java [12:51]
guacjack [guacjack!~guacjack@2a01:4b00:e80c:5800:1c05:128f:9772:1cec] has joined ##java [12:54]
solvr Regarding the lawsuit not that anyone asked, but I wish Oracle won. [01:00]
solvr But the fact I can steal everyone's API is also cool. [01:00]
asymptotically [asymptotically!~asymptoti@gateway/tor-sasl/asymptotically] has joined ##java [01:01]
lithium [lithium!~lithium@unaffiliated/lithium] has joined ##java [01:02]
sbalmos grr... IDEA's bundled Maven seems to not be parsing ${parent.parent.version} in a plugin version [01:02]
irrgit [irrgit!~ch33se@] has joined ##java [01:09]
solvr Lenses in Java. Do we need them? [01:16]
lithium [lithium!~lithium@unaffiliated/lithium] has joined ##java [01:16]
TheBeastie solvr: I do... or I don't see anything :) [01:19]
solvr Lenses are functions for reading a deeply nested immutable value from an immutable structure, or producing a copy of said deep immutable structure with that deep value changed [01:21]
solvr Basically it's the immutable version of getter/setter but at arbitrary depth [01:21]
solvr It's also hurting my brain [01:21]
Xiti [Xiti!~Xiti-@unaffiliated/xiti] has joined ##java [01:23]
hussam [hussam!~hussam@unaffiliated/hussam] has joined ##java [01:24]
SirMangler [SirMangler!] has joined ##java [01:26]
dmlloyd immutable data structures are very useful in Java but also undersupported [01:27]
dmlloyd you're not going to have a lot of support for things like lenses, or even e.g. making a new immutable list which consists of the old list plus one item [01:27]
dmlloyd frameworks like guava give you some of that [01:28]
solvr dmlloyd, they're useful but I wonder if we can't reduce them to mutable collections of immutable records, with implicit relationships, negating the need for immutable structures, lenses etc. [01:28]
dmlloyd in non-concurrent cases, maybe [01:28]
fax [fax!~quassel@unaffiliated/fax] has joined ##java [01:28]
dmlloyd mutability can become a huge headache in shared structures in multithreaded programs [01:28]
solvr dmlloyd, actually when I think about it, the collections don't have to be mutable. Rather it should be easy to produce "subset" selectors from an immutable large collection. [01:30]
solvr Hmm [01:30]
dmlloyd you can, sometimes [01:30]
solvr Has anyone ever tried mixing immutable structures with elements of relational algebra? [01:30]
paddyez [paddyez!~Patrick-E@wikipedia/paddyez] has joined ##java [01:32]
DTZUZU [DTZUZU!] has joined ##java [01:33]
lithium [lithium!~lithium@unaffiliated/lithium] has joined ##java [01:34]
tang^ [tang^!~tang^@2604:3d09:47c:f970:1c9f:ca7:4c04:2326] has joined ##java [01:35]
Peste_Bubonica [Peste_Bubonica!~Peste_Bub@unaffiliated/peste-bubonica/x-4612396] has joined ##java [01:35]
freeone3000 solvr: Yes! Lots of people! In the sixties and seventies, in fact. You might be interested in what they came up with. [01:36]
solvr freeone3000, see, no one explicitly mentions relational algebra and functional programming in the same sentence [01:36]
freeone3000 solvr: Please read *anything* by Edgar F. Codd [01:37]
solvr freeone3000, I think we've hit the ceiling of snark and sarcasm, and you may need to be a bit more specific [01:40]
tang^ I have a class named EntityObject that extends MutableTreeNode with a method that tries to return children as a Vector<EntityObject>. This is currently running on Java 8. With Java 9+, the return for children changed from Enumeration to Enumeration<? extends TreeNode>. I'm unsure if I can still pack that return into a Vector<EntityObject>. [01:40]
tang^ we have no ceiling for those two things [01:40]
freeone3000 solvr: Start with [01:41]
freeone3000 solvr: First paragraph of the paper, after the abstract, directly answers your question. The remainder of the paper addresses solutions. [01:41]
solvr freeone3000 the words functional and immutable are not in this paper [01:41]
freeone3000 solvr: It was the 70s. Immutability was assumed in an n-tuple. Mutability was added later. [01:42]
freeone3000 (Keep in mind we didn't have large amounts of read-write memory yet; this system operated on punched cards.) [01:42]
solvr freeone3000, really. So I guess computers were totally immutable until in the 70s they were like "shit, we can change stuff in memory" [01:43]
solvr So then they needed a word for it [01:43]
zeden [zeden!~user@unaffiliated/zeden] has joined ##java [01:44]
Kristine86 [Kristine86!4a45dc0c@gateway/web/cgi-irc/] has joined ##java [01:45]
tang^ amazing how that happens, eh? [01:46]
mbooth Wow, I don't know why you bother, freeone3000 [01:46]
Kristine86 can I use threadpool to run just a function rather than creating a new class that implements runnable? [01:47]
cheeser define "threadpool" [01:47]
yawkat pass a method reference? [01:47]
Kristine86 cheeser I'm just using ExecutorService pool = Executors.newFixedThreadPool(MAX_T); Now I want to use it to call same function but different param for different threads [01:49]
Kristine86 yawkat I'm trying to avoid creating a new class. how do I pass method reference, any example what you mean?> [01:50]
mindCrime_ [mindCrime_!] has joined ##java [01:50]
yawkat this::method [01:50]
yawkat lambda [01:50]
yawkat The Java 8 Lambda Expressions Tutorials are located at [01:50]
junktext__ [junktext__!junktext@fsf/member/junktext] has joined ##java [01:51]
Kristine86 so I don't have to implement a new class with Runnable right? Do I still need to create run? Can I avoid that? I'm new to threading. [01:52]
Maldivia method reference [01:52]
Maldivia Maldivia, method reference is a shortcut for a lambda to call a specific method. this::foo for example is equal to () ->, and Foo::new equals () -> new Foo(). You can also reference method that require one or more parameters, depending on the functional interface they are to represent. See [01:52]
cheeser you're still creating a new class. you're just leaning on the lambda syntax to do it. [01:53]
lithium [lithium!~lithium@unaffiliated/lithium] has joined ##java [01:54]
yawkat oh oracle [01:54]
yawkat do you need these to create an account or is there another way? i need to sign the oca [01:54]
Kristine86 cheeser I'm confused. I will work on a code and share. It will probably be helpful to get feedback from that [01:56]
_lucifer yawkat, yeah but i had filled those as N/A when i signed the OCA and it was approved. [01:58]
yawkat ah, that works. thanks [01:58]
cheeser yawkat: openjdk stuff? [02:02]
Maldivia Kristine86: at runtime, a lambda or method-reference expression is converted into a class automatically, so you don't see it on disk [02:02]
yawkat cheeser: graal bug [02:02]
cheeser yawkat: ah. fighting graal (native) myself atm. kotlin coroutines blow up. [02:02]
Kristine86 Maldivia that makes sense. I'm familiar with lambda exp but not confident how it will act with thread. I'm working on the code to test that. [02:03]
yawkat cheeser: why, do they use reflection? [02:03]
yawkat i thought they were pretty much compile time [02:03]
Maldivia cheeser: I thought you'd finished that long ago :D [02:03]
cheeser java.lang.IllegalStateException: @NotNull method kotlin/reflect/jvm/internal/impl/builtins/KotlinBuiltIns.getBuiltInClassByFqName must not return null [02:04]
cheeser Maldivia: i got it working in jvm mode last week. [02:04]
yawkat well... guess it does :D [02:04]
LionBar_ [LionBar_!~l@gateway/tor-sasl/lionbar] has joined ##java [02:04]
Maldivia I seem to trigger Quarkus bugs all the time though, when ever I work on my pet project :D [02:04]
yawkat is very proud of making awt work with native-image now [02:04]
cheeser now, it might just be how we're invoking them because we're definitely using reflection (for now) to map the requests coming in. [02:05]
cheeser i guess i could suck it up and generate the correct code. [02:05]
yawkat i wish graal had a mode where it wrote to stderr when a class.forName fails [02:06]
cheeser so far i think native mode is overrated. [02:06]
yawkat not hard to add, looking at the graal source, but graal is a pain to build (time and memory wise) [02:06]
yawkat D [02:06]
fingo [fingo!~fingo@gateway/tor-sasl/fingo] has joined ##java [02:07]
cheeser long running processes definitely lag behind the jvm there last time i saw numbers. [02:07]
yawkat yea i get the lambda use case, but beyond that... [02:09]
yawkat and you dont get shenandoah :( [02:09]
yawkat i use a java app for my desktop env ( ) and the fast startup is nice there though [02:10]
yawkat yawkat's title: "GitHub - yawkat/wm: Panel and tooling for herbstluftwm, written in java" [02:10]
yawkat and the compiler concept is really interesting... writing the opts in java is much nicer than in c++ [02:10]
cheeser what does this app do? [02:13]
yawkat it's just my desktop env, stuff like taskbar and screenshotting and such [02:14]
yawkat from when i had too much time on my hands... [02:14]
cheeser i can see that. :) [02:14]
superhanz2 [superhanz2!] has joined ##java [02:15]
superhanz2 hi this is a very basic question. I have a project that relies on a jar file called MASON.20.jar. However, the MASON framework also supports another extension called 2D Physics. The issue I have is how I should use Physics2D. It is not given as a jar file, but rather just as a directory containing its source code [02:17]
cheeser classpath [02:18]
cheeser The classpath tells Java or the compiler which jar files and folders to search for classes and resources. Use the -cp/-classpath run-time options to specify the classpath (does NOT work with -jar!). Also see [cheeser's blog], [], or for more information. [02:18]
superhanz2 thanks Cheeser [02:19]
superhanz2 I'll give this a read, see if I can figure it out [02:19]
MatthijsH [MatthijsH!~quassel@unaffiliated/matthijs] has joined ##java [02:20]
lithium [lithium!~lithium@unaffiliated/lithium] has joined ##java [02:24]
superhanz2 hmm okay so having read the first article [02:29]
superhanz2 am I right in thinking that I would add the entire folder of Physics2D to my classpath? (presumably in my .bashrc?) and it doesn't need to be first compiled into a jar file? [02:30]
dmlloyd no, you don't want to do it like that [02:30]
superhanz2 also I should note I'm using intellij [02:31]
dmlloyd first you'll need to compile Physics2D [02:31]
superhanz2 hmm okay so the readme does mention compiling [02:31]
superhanz2 and I think it has a make file? but I'm not sure how this works, and it isn't really explained [02:31]
dmlloyd most projects use Maven or Gradle to build, but some don't, to their detriment [02:32]
superhanz2 "To install this package, just add the physics2d directory to your CLASSPATH. Alternatively you can unpack the files into the appropriate directories in MASON, or create a jar file and stick that in your CLASSPATH. " [02:32]
dmlloyd I think that might be missing some context [02:33]
dmlloyd do you have a link? [02:33]
superhanz2 [02:34]
dmlloyd OK, it's already compiled for you [02:35]
superhanz2 compiled into a jar file? [02:35]
cheeser compiling and jars are separate concerns [02:35]
dmlloyd no, but that doesn't matter too much unless you need to repackage it [02:35]
hendursaga [hendursaga!~weechat@gateway/tor-sasl/hendursaga] has joined ##java [02:36]
superhanz2 when you mean its compiled do you mean the .java files are compiled into .class files? [02:36]
dmlloyd so now if you want to use both this and the MASON.20 thing, you'd use a class path that looks like `/path/to/physics2d:/path/to/MASON.20.jar` [02:36]
dmlloyd yes [02:36]
superhanz2 ah great, I'll give that a try. [02:37]
dmlloyd if your project has no build system configuration, then the way to do this is to go into "project structure", add both of those items (one directory and one JAR file) as "Libraries", and then add those two libraries to your module's "Dependencies" [02:37]
dmlloyd (this is in IntelliJ, since you said that's what you're using) [02:38]
dmlloyd then you're good to go for development [02:38]
dmlloyd IntelliJ should allow you to create run configurations from this setup [02:38]
superhanz2 I've already added the mason jar file. If I were to add the Physics2D directory, doing this is adding it to the classpath? [02:39]
superhanz2 I wouldn't have to add anything to my .bashrc, say? [02:40]
dmlloyd yes. be aware that "classpath" is an abstract term [02:40]
dmlloyd in general you don't want to do anything related to classpath in your shell [02:40]
lithium [lithium!~lithium@unaffiliated/lithium] has joined ##java [02:42]
Fiji [Fiji!a06d682c@unaffiliated/fiji] has joined ##java [02:42]
superhanz2 brilliant it seems to have worked [02:43]
superhanz2 thanks so much dmlloyd [02:44]
dmlloyd ? [02:44]
superhanz2 i think you've cleared up what I've actually done to get it working, so I'm no longer just blindly trying new things until it works with no idea why [02:44]
twodee23 [twodee23!~freenode@] has joined ##java [02:49]
twodee23 Hi, I'm trying to understand Event Sourcing and CQRS and applying it with Java. I understand that there has to be an event bus that will trigger services based on events. On the read side, I'll have a read model derived from those events and there will be a separate db on the write side. What is typically stored on the write side? The event store? Or something like an updated consistent state? [02:54]
lithium [lithium!~lithium@unaffiliated/lithium] has joined ##java [03:02]
ebullient [ebullient!~ebullient@redhat/ebullient] has joined ##java [03:06]
ebullient4 [ebullient4!~ebullient@redhat/ebullient] has joined ##java [03:12]
guacjack [guacjack!~guacjack@2a01:4b00:e80c:5800:1c05:128f:9772:1cec] has joined ##java [03:18]
lithium [lithium!~lithium@unaffiliated/lithium] has joined ##java [03:19]
solvr [solvr!57e3c46d@] has joined ##java [03:29]
solvr Does it make sense to have a trie represent a list of records, and when I build an index on those records... that's also a trie with the same topology. So when I select a subset of records, I select the same segments from the index trie, and I'll have less false positives when reusing the index? [03:30]
cheeser you want a database [03:32]
solvr cheeser, databases don't even do this [03:33]
cheeser you're so cutting edge, eh? [03:33]
solvr cheeser, also not sure how many times I said the data comes from a database [03:33]
Diablo-D3 so why not just query that db?! [03:33]
solvr Because that's not the point at all [03:33]
Diablo-D3 then whats the point?! [03:33]
Diablo-D3 what are you *actually* trying to solve?! [03:34]
_lucifer so you think you can beat the performance of the db? [03:34]
solvr Well apparently it's hard to explain [03:34]
ernimril solvr, consider giving concrete example of what you are trying to do if you want help. [03:34]
Diablo-D3 its like you're badly reimplementing a db cache [03:34]
solvr _lucifer, not the point at all either [03:34]
solvr Well what I was asking is index trie. [03:34]
solvr Does that make sense [03:34]
cheeser no. use a database. [03:34]
solvr So index trie it is [03:35]
ernimril solvr, I think you want to have an unlimited number of attributes and have index lookups for all attributes and that wont work well [03:35]
solvr Not all attributes at all. [03:36]
solvr Just ones acting as PK or FK [03:36]
ricky_clarkson ernimril: Isn't that what columnar DBs achieve? [03:36]
cheeser so ... attributes, then. [03:36]
solvr My problem is that when I select a subset of a collection of records, my indexes are useless [03:37]
solvr I wanna ship usable indexes with that subset [03:37]
cheeser apply more than one index? [03:37]
ernimril ricky_clarkson, try having 50 attributes and setup index on all of them and try grabbing searches by random attributes, first one and then some of the others and see if you can guarantee any good performance [03:37]
solvr So efficiently reducing false positives is essential [03:37]
solvr Some false positives is OK [03:37]
ricky_clarkson ernimril: BigQuery basically does that, without any manual indexing setup. [03:37]
solvr (false positive = the index points to a record that's not in the subset) [03:38]
ernimril solvr, as I said before there are multi-dimensional indexes for example my prtree, but I guess you did not look at that [03:38]
ricky_clarkson based on the original Dremel whitepaper that led to some open source impls [03:38]
solvr ernimril, prtree is interesting but not what I want, because the subset is not known in advance [03:38]
ernimril ricky_clarkson, the problem is that you will get some combinations that are horrible for performance [03:38]
ricky_clarkson In the BQ case that will happen with data skew, just 1 machine will process 90% of the data. [03:39]
ricky_clarkson that's for joins but for straight queries there's no such problem [03:39]
solvr Also maybe I don't need a trie, per se, I just need segments, flat segments even [03:39]
ernimril solvr, well until you can explain your question you will probably not get help [03:39]
solvr ernimril, I did explain it. You have a list of records, and in index on them. Some random criteria selects a subset of them. I want the indexes I have to be usable with that subset [03:40]
solvr ernimril, to be usable we need to reduce false positives to something less than 50% [03:40]
ernimril solvr, consider asking question with enough contexts that other people can understand, preferably with a few examples [03:40]
solvr The less the better [03:40]
ernimril solvr, so setup an index for each and do a hash-join on the index lookups? [03:41]
solvr index for each what [03:41]
ernimril solvr, you previously mentioned something like 1000 records so you can do whatever you want with that in memory without it taking any time [03:42]
ernimril solvr, each attribute you want to search for [03:42]
Diablo-D3 so whats wrong with throwing h2 at it? [03:42]
Diablo-D3 export from db, import into your db, go ham [03:42]
solvr ernimril, I mentioned 1000 but what I didn't mention is the n^m complexity of looking those up recursively to build, say, a graph they represent [03:42]
lithium [lithium!~lithium@unaffiliated/lithium] has joined ##java [03:43]
ernimril solvr, what did I say about asking question with enough contexts? [03:43]
solvr Well there it is [03:43]
solvr ) [03:43]
ernimril solvr, no, there it is not [03:44]
solvr I feel like the only way to provide enough context is to pull down my pants and reveal my most sacred secrets [03:44]
solvr Anyway. [03:44]
solvr I tried to explain as well as I could. [03:44]
_lucifer do you see measurable performance degradation when using the tools available or is it this all out of thin air? [03:44]
solvr Thanks for the feedback [03:44]
ernimril solvr, we do not care about your private parts, keep them to yourself [03:45]
solvr ernimril noted [03:45]
ernimril solvr, if you want help you have to explain enough for us to actually understand [03:45]
asymptotically [asymptotically!~asymptoti@gateway/tor-sasl/asymptotically] has joined ##java [03:45]
solvr ernimril, I'll give it a last shot. And present the situation in two parts. [03:46]
solvr Part 1) you have a graph as a flat list of users forming a graph. Between 200 and 10k items typically. You want to build that graph as an object graph in memory. How would you [03:47]
ernimril solvr, also: consider that a data structure discussion is not something secret, having a program that works well enough and a userbase is what you want [03:47]
solvr ernimril, I have no secrets, I'm just trying to explain the class of problems I'm looking at [03:48]
solvr Sorry for the nonsense [03:48]
ernimril solvr, I decide the data structure and the algorithms to use first when I know what question I need to answer [03:48]
solvr I'd solve part 1 by building a Map<> index on the attributes I want to connect, and then recursively matching the index to the attributes building a graph [03:49]
solvr So far so good, that works fine. And mostly O(N) speed [03:49]
ernimril solvr, so for now a Set of objects, and some way to say "what are the neighbours of this thingy". For example a Map<ItemId, Item> where each item has a List<ItemIds> neighbours [03:49]
johnjay [johnjay!~pi@] has joined ##java [03:50]
solvr Right [03:50]
solvr So here comes part 2 [03:50]
deepy With javafx after 8 I don't seem to be able to add things to the pre-existing context-menu, only to set a new context-menu, is there some helper for re-adding the Select All/Copy/Paste/etc? [03:51]
solvr Part 2) from this initial list of users, which list now has the necessary indexes in Maps to build graph from, I have an arbitrary filter() lambda, that picks SOME subset of those users. I need to pass this subset of users to another method, but I want to pass it with a usable subset of the indexes I have so they don't have to rebuild them from [03:51]
solvr scratch. [03:51]
solvr So they can also build a graph. From the subset I gave them [03:52]
solvr If I pass the full indexes, looking up will produce tons of false positives where the index points to users which are NOT in the subset [03:53]
solvr Having some false positives is OK, if it doesn't make the index pointless. [03:53]
ernimril solvr, again, too little information. Arbitrary filter does not make sense. [03:54]
solvr It's arbitrary. [03:54]
solvr Some lambda I'm given from elsewhere. [03:54]
ernimril solvr, so it can be a filter on _every_ attribute you have? [03:54]
solvr It's opaque to me. A subset is selected, I know what that subset is. I don't know it in advance tho [03:54]
ernimril solvr, the filter can depend on the phase of the moon? [03:54]
solvr ernimril, it can even be a filter on info outside the records for all I know. Might include current time or phase of moon. Arbitrary lambda [03:55]
ernimril solvr, then you can not setup any index that will work so why even try? [03:55]
solvr ernimril, the index is on my PK/FK attributes. The filter doesn't use those indexes. But after I pass the subset to method FOO() , that method will NEED indexes on PK/FK on that subset I gave it [03:56]
solvr Story so far:   (list of users + indexes on PK+FK) -> (comes along wild filter(lamdba), picks a subset) -> (method FOO() receives the subset, and needs to look things up by PK/FK) [03:57]
ernimril solvr, what is your pk/fk? an int? an uuid? a string? Do you not have a Map<Id, Item> that you can use to find items by pk/fk? [03:58]
solvr ernimril, it varies, but yes, a Map is OK [03:59]
ernimril solvr, so Foo() can grab an item by the key in O(1) time, so what is the problem? [03:59]
solvr ernimril, the problem is this map covers the full list, not the sublist [03:59]
lithium [lithium!~lithium@unaffiliated/lithium] has joined ##java [03:59]
ernimril solvr, so? why does that matter? you are looking up things by id [04:00]
ernimril solvr, passing the Map is just passing one reference so that is cheap [04:00]
solvr ernimril, so imagine FOO() looking things up by PK in an 1:N relationship. It finds a list of N items. Loops through them, most are not even in the subset [04:00]
ernimril solvr, so, a check that the found item is in the sublist is another map lookup, another O(1) operation (as long as you prepare the input into a map or a set) [04:02]
ernimril solvr, so you have two O(1) operations, is that heavy calculations? [04:02]
solvr ernimril it becomes O(N) over a list of N items, and if you do this recursively to build a graph, it become N^M [04:03]
solvr Where M is the depth of the graph [04:03]
ernimril solvr, so here is another thing about missing context [04:04]
_lucifer i just noticed "Remove the Experimental AOT and JIT Compiler" is JEP 410. (410 Gone) ? [04:04]
yawkat D [04:05]
ernimril solvr, and I think you overestimate things. How many recursions do you do? [04:05]
solvr ernimril, unknown but probably max sqrt(list size) [04:06]
ernimril solvr, is that <10 <1000 <1000000 ? [04:06]
solvr < 1000 [04:07]
ernimril solvr, so that rules out ordinary recursion, you will hit stack overflow. Sorry, but you have to rewrite to some other type of loop [04:07]
ricky_clarkson Trampoline! [04:07]
solvr Wait, the stack is that small? [04:07]
solvr Well anyway I can write it as a loop with a manual stack [04:08]
solvr Complexity remains the same tho [04:08]
ernimril solvr, so how large is N? [04:09]
waz [waz!~waz@pdpc/supporter/active/waz] has joined ##java [04:09]
ernimril solvr, and how long time do you have to run every query? [04:09]
solvr ernimril, see, this is why I don't wanna explain much. [04:09]
solvr ernimril, I appreciate one needs context [04:10]
solvr But there's just too much context [04:10]
solvr Thanks ernimril, I'll think about it more [04:10]
ernimril solvr, ok, go and figure this out on your own, not sure why you ask questions if you do not want to discuss the issue? [04:10]
solvr Well, I don't wanna fill the entire thread with minutae of my BS [04:11]
ricky_clarkson I respect Scheme implementations, rather than stack overflow they put the stack on the heap just before overflow and point back at the beginning of the stack. [04:11]
solvr I thought maybe I'm missing something obvious [04:11]
yawkat much too late for that lol [04:11]
solvr And I did get interesting pointers from you and others [04:11]
GnarlyBob [GnarlyBob!~chris@unaffiliated/gnarlybob] has joined ##java [04:11]
solvr yawkat, we're event-sourced here, I can only apply a transaction reversing "mea culpa" event. [04:12]
_lucifer if and when you solve your problem, i would be interested in knowing how much performance you gained by not using an existing solution. [04:13]
solvr _lucifer, prolly something trivial. [04:14]
solvr I do it for (shitty) science I guess [04:14]
nyxyn [nyxyn!~nyxyn@2600:1700:3db0:2540:910:e58b:2116:37c2] has joined ##java [04:14]
_lucifer this is isn't science but nvm. [04:16]
lithium [lithium!~lithium@unaffiliated/lithium] has joined ##java [04:16]
solvr _lucifer it is when I'm stupid [04:16]
whaley_ [whaley_!] has joined ##java [04:18]
junktext_ [junktext_!junktext@fsf/member/junktext] has joined ##java [04:24]
dave_uy48 [dave_uy48!~david@] has joined ##java [04:25]
dougquai1 [dougquai1!dougquaid@gateway/vpn/privateinternetaccess/dougquaid] has joined ##java [04:26]
Jantz [Jantz!~IceChat95@2407:7000:8d04:100:8c51:e457:ecf5:1348] has joined ##java [04:31]
lithium [lithium!~lithium@unaffiliated/lithium] has joined ##java [04:38]
acidjnk_new [acidjnk_new!] has joined ##java [04:38]
dpl_ [dpl_!] has joined ##java [04:49]
akaWolf [akaWolf!~akaWolf@unaffiliated/akawolf] has joined ##java [04:54]
lithium [lithium!~lithium@unaffiliated/lithium] has joined ##java [04:55]
Jantz_ [Jantz_!~IceChat95@2407:7000:8d04:100:bd2e:b515:22a2:e00a] has joined ##java [05:04]
Kristine86 How do I make this work without using implements Runnable? [05:10]
cheeser execute( () -> { sleep(1000); println(); map.put("fast", "fast"); } ); [05:14]
Kristine86 That is just a sample code in fn method though. I need to put a large block of code there. [05:15]
lithium [lithium!~lithium@unaffiliated/lithium] has joined ##java [05:15]
cheeser ok. put that large block in a method and call it from there. [05:16]
cheeser execute( () -> { largeBlockOfCode(); } ); [05:16]
cheeser magic! [05:16]
Kristine86 haha yes it works now thanks. [05:18]
Kristine86 I was forgot before ()-> and I thought execute needed Runnable object in there. [05:18]
Kristine86 testing it now [05:18]
cheeser it does. but you can hide that with the right syntax. [05:18]
cheeser are you using IDEA? [05:19]
Kristine86 me? What do you mean, what IDEA? [05:19]
cheeser what IDE are you using? [05:19]
Kristine86 eclipse, but I need to run in a remote machine. Why? [05:20]
cheeser well, i had an IDEA tip but it's not applicable if you're using eclipse [05:22]
Kristine86 pool.awaitTermination(Long.MAX_VALUE, TimeUnit.NANOSECONDS); is this a right efficient statement to wait for threads to end? [05:24]
mbooth An efficient way to wait...? [05:25]
Kristine86 Yes. Or could it cause longer delay than needed? [05:25]
ricky_clarkson an efficient way of waiting for potentially 292 years. Interesting ;) [05:26]
Kristine86 well if threads end sooner it would too thought right? [05:26]
ricky_clarkson sir, you waited for 292 years and 2 seconds, that's a hard fail [05:27]
Kristine86 ricky_clarkson I know what you did there :P [05:27]
cheeser to be fair, the waiting is the hardest part. [05:29]
freeone3000 use an actual reasonable value there, please. [05:30]
freeone3000 this is like, advanced programming 201: nothing is actually infinite. instead, set it to be finite, but larger than you'll ever need -- so if it turns out you were wrong, on either end, you can figure out why. [05:31]
freeone3000 if your threads aren't terminating, that's a problem! that problem needs to be solved! If killing the threads when they don't terminate cause a problem, well, that'd also cause a problem if they were killed for any other reason, so that needs to be solved to. reliability and consistency. [05:32]
runlevel7 [runlevel7!runlevel7@gateway/vpn/privateinternetaccess/runlevel7] has joined ##java [05:32]
Kristine86 ah ok got it. [05:37]
Kristine86 I just need to parallelize the actual code [05:37]
Matthijs [Matthijs!~quassel@unaffiliated/matthijs] has joined ##java [05:39]
CookieM [CookieM!] has joined ##java [05:43]
nyxyn [nyxyn!~nyxyn@2600:1700:3db0:2540:910:e58b:2116:37c2] has joined ##java [05:46]
cliluw [cliluw!~cliluw@unaffiliated/cliluw] has joined ##java [05:47]
Fleck [Fleck!~fleck@unaffiliated/fleck] has joined ##java [05:49]
hendursaga [hendursaga!~weechat@gateway/tor-sasl/hendursaga] has joined ##java [06:00]
pppingme [pppingme!~pppingme@unaffiliated/pppingme] has joined ##java [06:01]
Feuermagier [Feuermagier!~Feuermagi@] has joined ##java [06:04]
Jantz [Jantz!~IceChat95@2407:7000:8d04:100:70fd:4067:d98a:9f2c] has joined ##java [06:10]
guacjack [guacjack!~guacjack@2a01:4b00:e80c:5800:1c05:128f:9772:1cec] has joined ##java [06:15]
kirua [kirua!~kirua@unaffiliated/kirua] has joined ##java [06:15]
dreamreal [dreamreal!~jottinger@unaffiliated/dreamreal] has joined ##java [06:34]
jess [jess!jess@freenode/staff/jess] has joined ##java [07:18]
mindCrime_ [mindCrime_!] has joined ##java [07:25]
JackB [JackB!b968f6e0@] has joined ##java [07:32]
Gazooo parted the channel: "The Lounge -" [07:44]
major_majors [major_majors!~majors@unaffiliated/major-majors/x-6070374] has joined ##java [08:07]
hussam [hussam!~hussam@unaffiliated/hussam] has joined ##java [08:12]
jrandom [jrandom!] has joined ##java [08:19]
jrandom If I have a type T for a class example, `public class Foo<T> {}` how can I restrict this type `T` such that type which implements `compareTo()` method (I think there is an interface for that in Java right?) will only be allowed. And type which do not implement that method isn't allowed. How can I do that? [08:21]
nyxyn [nyxyn!~nyxyn@2600:1700:3db0:2540:910:e58b:2116:37c2] has joined ##java [08:27]
jrandom What I need to do to `Foo` such that only types `T` which implements `Comparable`(which impelments the method .compareTo() since we make use of that inside) is only allowed? [08:28]
ge0rgios [ge0rgios!~george@unaffiliated/anaphaxeton] has joined ##java [08:31]
jrandom Ok, looks like I need to do something like `public class Foo<T extends Comparable>{}` [08:32]
dreamreal Comparable<T> probably [08:42]
waz [waz!~waz@pdpc/supporter/active/waz] has joined ##java [08:44]
Kristine86 [Kristine86!4a45dc0c@gateway/web/cgi-irc/] has joined ##java [08:47]
georgios [georgios!~george@unaffiliated/anaphaxeton] has joined ##java [08:47]
gambl0r3 [gambl0r3!~rickyjw@unaffiliated/gambl0re] has joined ##java [08:50]
freakz [freakz!~ad@2a01:cb14:82fc:d00:8419:345b:c679:13c] has joined ##java [08:52]
freakz Hi everyone, I finally complete the official tutorial [08:52]
freakz I'm looking for a good book to go deeper [08:53]
freakz the most recommanded is Head First Java [08:53]
freakz it seems too old no ? [08:54]
swj [swj!~swj@2409:8928:544c:374:cd85:a8f0:bdb1:4404] has joined ##java [08:57]
jrandom If i have a member variable which if type `List<T> list;` where T is a generic type(like before which extends Comparable), How can I instanciate the type `List<T> list;` in the constructor of class `Foo`? [09:04]
jrandom nevermind, List is an interface. [09:17]
jrandom my bad [09:17]
hendursaga [hendursaga!~weechat@gateway/tor-sasl/hendursaga] has joined ##java [09:25]
NorthwestVegan [NorthwestVegan!~Northwest@gateway/tor-sasl/northwestvegan] has joined ##java [09:32]
Jantz [Jantz!~IceChat95@2407:7000:8d04:100:70da:d6f2:f266:7cac] has joined ##java [09:52]
waz [waz!~waz@pdpc/supporter/active/waz] has joined ##java [10:01]
Goplat [Goplat!~Goplat@reactos/developer/Goplat] has joined ##java [10:12]
Iacob [Iacob!~yong@] has joined ##java [10:15]
pioto [pioto!~pioto@unaffiliated/pioto] has joined ##java [10:30]
pioto [pioto!~pioto@unaffiliated/pioto] has joined ##java [10:32]
upgrdman [upgrdman!~upgrdman@blender/artist/upgrdman] has joined ##java [10:49]
spirit [spirit!~spirit@unaffiliated/spirit-pact/x-7942062] has joined ##java [10:52]
Jantz [Jantz!] has joined ##java [10:55]
zulutango [zulutango!] has joined ##java [11:12]
shailangsa [shailangsa!] has joined ##java [11:14]
db [db!uid18678@gateway/web/] has joined ##java [11:16]
p[a]ddy [p[a]ddy!~Patrick-E@wikipedia/paddyez] has joined ##java [11:38]
ScrambledRK [ScrambledRK!] has joined ##java [11:52]