« first day (3070 days earlier)      last day (1854 days later) » 
00:00 - 13:0013:00 - 19:00

1:03 PM
you can check that in shell
just do java -version and grep for OpenJDK Runtime
 
There is not much to grep like that. It only shows me this little:
java version "1.8.0_152"
Java(TM) SE Runtime Environment (build 1.8.0_152-b16)
Java HotSpot(TM) 64-Bit Server VM (build 25.152-b16, mixed mode)
 
Java(TM) SE Runtime Environment is from oracle
if you are using open jdk, then you should get OpenJDK Runtime Environment
 
So we were using Oracle all the time. Thanks a lot for the help Karel and Wiretlol as well
 
chuckles
If I have a class like this: https://paste.ofcode.org/4SihChJSqcPSiSHEgdsfi4
How can I get this to work with the generic param for the list of responses? Spring gives me an error that I have to provide an explicit type. Currently I have no clue how I can get that to work.
I read about @Any and found an option that would probably work for me with some additional boilerplate but I was wondering if there was another option.
 
DROP DATABASE; works
 
1:16 PM
The current options for that type parameter are String and Long so I was also trying to get around providing an additional implementation only to allow for that definition.
Wietlol?
 
no, his name is wiretlol
 
well... you cant @geisterfurz007
 
I CAN'T?!
What do you mean, I can't?
YOU CAN'T!
Can't do me like that, Wiretlol!
 
@geisterfurz007 you cant assume that things just wörk
iirc, you need a restriction on it of one of your interfaces (also annotated by JPA)
 
(which interfaces)
 
1:24 PM
ones that you make
your upper bound is java.lang.Object
that is not a JPA entity
you can use an interface of your own tho
and upper bound T to that
then it wörks
ofcourse, String and Long dont implement that interface
you need wrappers for those two
 
Ok so I write a Response interface and a LongResponse and a StringResponse implementation of that?
 
/damnit
 
Then I'd do what? Make that List<Response<T>> and still have the same problem?
 
lol
ideally you need a response interface and implementation of various types of it
@geisterfurz007 you get the error where?
 
1:39 PM
When starting the application.
 
that is a runtime exception
post the full logs
 
Not really runtime but more like startup (Spring Boot); hang on.
 
0 1 2 5 12 29 70 ???
what's the next number in the sequence?
 
Question for us or question for you?
 
well question for you I suppose if you're interested
I know what it is
 
1:44 PM
@geisterfurz007 sure
@geisterfurz007 no, because Response isnt generic
so not Response<T> just Response
or T extends Response
 
And with that I'd also remove the T from the Task class and provide implementations for that well?
 
nope
not if you use T extends Response
 
mhmm, lemme see.
 
@geisterfurz007 the error line is cropped there , man
ok its there
 
🤔
The interface would contain the getters and setters then @Wietlol?
I don't really see how I would structure that thing :/
 
1:48 PM
2
Q: Hibernate unbound type and no explicit target entity when using generic

BudzuI have the following two classes: @Entity @Table(name = "criteria") @Inheritance(strategy = InheritanceType.SINGLE_TABLE) @DiscriminatorColumn(name = AbstractCriteria.TYPE, discriminatorType = DiscriminatorType.STRING) public abstract class AbstractCriteria<T> implements Serializable { pub...

 
@geisterfurz007 keep in mind, I refuse to use generics in the database stuff
 
why not?
 
@Wietlol Then how'd you do this? Even if I left the T out and made it List<Response> I'd still have to provide the interface stuff.
 
because I dont have to
@geisterfurz007 I wouldnt
 
Help ._.
 
1:55 PM
lol
 
@geisterfurz007 any reason why you are doing that?
for convenience?
 
What exactly?
I like to harm myself. Is that what you mean?
 
using generics on a hibernate entity
 
did you check the answer i linked?
 
fyi, there is an annotation that solves that AFAIK. Something about targetEntity=Foo.class
 
1:57 PM
Yeah but I have two targetEntities.
String and Long. How does one do that?
 
the error suggest a @Type
did some lookups on that?
Can you not make that Long as String?
 
Is that a good thing to do? You're right; it would make my life a lot easier but I am not sure if that is a good thing D:
 
2:16 PM
@ColdFire Yes but one just removes the generics and one makes it a string. Neither seems like a good solution to me.
 
hmm
 
@geisterfurz007 one doesnt remove the generics
 
... instead one does ...
 
no
 
Instead one does no.
Ok.
 
2:20 PM
class MyClass<T extends Response>
still generic
 
I still don't know what methods go in Response.
 
MyClass<StringResponse>.getItems().map(it -> it.getText())
MyClass<LongResponse>.getItems().map(it -> it.getNumber())
Response doesnt need any methods
 
How comes?
 
because it comes
 
2:22 PM
you dont use MyClass<Response>
 
You see... I am not really convinced but let me write some of dem codez real quick.
 
you use MyClass<StringResponse> or MyClass<LongResponse>
 
I still annotate StringResponse with @Entity, eh?
 
if you write them real quick, I will write them float quick
 
But not Response?
 
2:23 PM
iirc, response too
(interface might have to be an abstract class)
 
In that case would it make sense to put the id and it's get/set in that abstract class as well?
Now you see, I have an issue here...
I get exactly the same stacktrace as before.
 
ok
same stacktrace
different error?
 
Njet; lemme try something.
Yeah, no. Same thing as before.
 
which is?
 
2:32 PM
and your code?
 
How much of the code do you need? The Task class and the Response classes?
 
(maybe you forgot the @Type annotation
Task should be plenty
 
I have no clue how to use that.
 
/fatcat
 
2:34 PM
just faced a pesky C code
int match_class(const char* entry, const char* className) {
  // ...
  return (entry != 0 && className != 0 && *entry!= '\0' && ...)
}
 
/catfat
 
tsss
 
roll me to toilet hoomaaan
 
it is especially that *entry!= '\0'
hazardous 😲
 
catardous
 
and that works?
 
No ._.
 
such a waste of space for paste.org
 
You are a waste of space ._. (for those who might review the flag, please watch context; I don't mean it like that).
 
/shrug
 
2:46 PM
¯\_(ツ)_/¯
 
@geisterfurz007 is that really flag-able?
 
Some people got suspended for 30 minutes because they used butt instead of but. I am not surprised by anything anymore here.
Any ideas Wiretlol?
 
@geis Line 12 is making me rage.
 
(៤︵៤)
 
2:49 PM
( ̚‿̚ )
 
@Michael that irked me as well
led to an little eye twist
 
I tried the C# room to no avail, I figured Id try here: Does anyone have experience working with telerik radgrid?
 
considering the same people are in the C-harp room as in the Jaba room, and it appears to be an asp.net thingy, I assume chances are low anyone here knows
 
thanks
 
3:06 PM
Should Line 21 be a Collection? Or is order important?
 
Yeah it should be Collection; I was half sleeping at that point :D
 
Set ;)
 
Dang it @geis! Stop half sleeping!
 
No u!
 
@Wietlol Sets have an overhead involved with regards to hashing.
 
3:09 PM
arent they sets by default?
 
eh Michael, I see people using HashSet when they want to manage a tree of ... id's.
 
Collections?
 
or even HashMap for ID -> object maps
so stupid
 
@KarelG you mean a TreeMap?
 
no. Sets. to have unique ids from a messy collection
 
3:10 PM
I have no clue anymore what I am doing here.
It's such an annoying thing. Starting on a project, learning new kinds of stuff and then running against a wall (figuratively).
 
Collection is an interface. All it says is: "I contain a bunch of stuff"
Sets enforce uniqueness.
List enforces order.
 
/javadoc OrderedSet
 
@geisterfurz007 Sorry, I never heard of that class. :(
 
Is there a class that implements both?
 
@geis Also, I would enclose the comments next to the two enum values in javadoc comments so that they are readable by the user of your API.
 
3:17 PM
Yeah yeah but that is not needed if my API is not working in the first place :D
 
@geisterfurz007 LinkedHashSet
 
Cheers.
 
@geisterfurz007 both what?
 
when order and uniqueness are important
 
if you want it sorted, then use a TreeMap
 
3:19 PM
So if I were to just make all stuff Object it would still not work because JPA cannot handle Object, correct?
 
depends on how you want it sorted
 
if you want it in insertion order, LinkedHashSet is probably better
 
LinkedHashSet acts like a List in that regard.. keeps it in order of insertion
 
wait... is there a TreeSet?
 
TreeSet or TreeMap is better when it's ordered by some criteria through a Comparator
Yep
 
3:20 PM
ah, there is
 
Just what you'd expect it to be
 
you could also use a BkTree
just for fun
 
Burger King needs a bit of love
 
3:40 PM
you can use a... BrTree?
 
what about a McD tree then
 
OakTree is my favorite.
 
hehe
 
4:10 PM
a Graph
 
4:39 PM
posted on March 20, 2019 by CommitStrip

 
5:06 PM
I have about 50k objects in a list, and I want to map them to a property of theirs, and only keep unique values of those (would leave about 40 values), considering that I'll want to do do something as soon as a new one is added
what's an efficient way to do this?
hold on, nvm
well, still curious
 
Parallel stream?
 
yup
basically, there's some code like this
        xs.stream().map(x -> x.getY()).forEach(y -> ys.put(y, new LinkedList<>()));
        xs.stream().forEach(x -> ys.get(x.getY()).add(x));
now, first thing I'd do is not keep putting the same thing
and collect as a set first
then convert that set to a list
but still, that's a bottleneck
ideally, you should be able to perform the second task as soon as another unique value comes through
(I didn't write that code)
and ys is more of a yToXs
 
5:28 PM
So your ys should be unique? I am really confused by that code :D
 
5:41 PM
ys = new HashMap<Y, List<X>>(); xs = new LinkedList<X>()
say you have a list of kids (xs) with a .getParent(), and you want a map (ys) of parents to list of kids (in this case, a kid would only have 1 parent. Poor kid, but still)
 
I'm trying to pass that Oracle exam for Java certification. Maybe it will make my resume look better.
 
6:00 PM
Good luck, Nathan!
/javadoc Collectors#groupingBy
1
 
I am not 100% sure but can't you use that @towc?
Something like xs.stream().collect(Collectors.groupingBy(Kid::getParent))
 
oh, interesting
 
or groupingByConcurrent because 50k elements.
 
that might do it, thanks :)
 
6:04 PM
You're welcome! Good luck :D
 
The problem is, I'm going to Seattle for 9 weeks this summer, so even though I'm probably ready to start applying for jobs now, I'm not sure saying I won't be available most of the summer really is going to get them to take me seriously.
 
00:00 - 13:0013:00 - 19:00

« first day (3070 days earlier)      last day (1854 days later) »