« first day (3548 days earlier)      last day (1407 days later) » 

1:25 AM
farts
 
 
6 hours later…
7:25 AM
reads a book
 
think I'm having a brain fart here..
if I want to group specific exceptions in its own catch, can I make them all extend a common interface and catch that interface?
 
yes
you prolly meant implement but that's a detail
@Michael reproducable on three different computers now :)
 
I don't know if I can though
I mean, it has to derive from Exception which is a class
 
however. assume that you have two exceptions, you cna use | for that
catch(ThisException | SomethingException e) {
  ...
}
 
You can't "catch" something that doesn't derive from Exception or Throwable, can you?
so I can't "catch" an interface for that reason
 
7:34 AM
it must be implementing a throwable
or is that a class? :|
/javadoc Throwable
 
oh ... thought it was an interface. So you have to use extending classes
 
but an interface can't extend a class
 
boo
 
I think I have to use a class for this, pff
ah well
 
7:35 AM
you cna do interface IFoo extends IBar
but since throwable is a class, yeah
 
I don't honestly understand why it is made like this, is there a particular reason why an interface can't "extend" a class?
by extend I mean, anything that implements said interface must also extend that class
in this way an interface could only extend one class of course
 
interface is more a contract model. It is not intended to have working functionalities
but it has changed since the addition of default construct
what you can do is
class IllegalStateExceptionFoo extends Throwable implements IFoo
class BoxingExceptionFoo extends Throwable implements IFoo
but that needs to an addition type check in the catch body
😐
 
well it wouldn't have working functionalities
it is still only meaningful in the context of the classes that implement said interface
I don't mean extend a class as in it would have to implement all the abstract methods or something
 
kinda design flaw, but remember that it existed from 1.0, before interfaces got added
 
I just mean, you guarantee that if you use that interface, it is a InternalException or something
 
 
2 hours later…
9:40 AM
I have reached insanity level.
GRR
that fucking query problem is still occurring and am now digging in mysql driver to find the bastard culprit
 
yikes
you know it's serious when you're digging through driver code
 
10:21 AM
Hi everyone
 
@ziGi Welcome to the Java Chat, the room for Java enthusiasts! I'm Oak, one of the room's bots. If you want to ask a question, just ask it and someone will respond if they feel like it. But remember that this room is not a help desk or tutoring service! If you want to just hang out, then welcome aboard! Oh, and the room's full list of rules are posted here.
 
This is not something urgent, but something I've been wondering about. I am using Lombok and I have a @Builder on a class. However, I want to make an instance of the builder so that I can have the common fields set up, however after that I can augment the building process based on the input parameters. For example have a few ifs and assign different values on some properties.
Since @Builder generates a builder I am using DetailedTransaction.DetailedTransactionBuilder as a type and it works, but this is a raw use of parameterized class, is there a better way to do it?
 
@Neil found the culprit. Had to check the specs and there is a decision why that type check is conducted
when debugging, the jdbc driver is detecting the debug env themselves, not applying the where clause optimization.
the problem was that optimization, it gave me comparision clauses with String type while it should be DATETIME
I am using HeidiSQL and it uses a different driver. so running the query "manually" yielded a result.
same for running with debug on.
but just running? nope
oh boy. what a bastard bug
@Michael ^
 
10:47 AM
Hello guys, anyone interest to discuss a spring security related issue? :)
 
@PetarPetrovic Welcome to the Java Chat, the room for Java enthusiasts! I'm Oak, one of the room's bots. If you want to ask a question, just ask it and someone will respond if they feel like it. But remember that this room is not a help desk or tutoring service! If you want to just hang out, then welcome aboard! Oh, and the room's full list of rules are posted here.
 
 
1 hour later…
12:10 PM
@KarelG reminds me of the error I found about a month ago where I checked that a number was not 1 and it didn't include the records where it was null
 
@KarelG at least, problem solved :D
gj
also, at least it wasnt Optional that was the problem
 
12:40 PM
nope, problems are obligatory, not optional
 
when you are programming on my level, problems are optional :D
if you dont want problems, they become features :D
I suppose problems are required when you are remaking an old game
if you dont make the exact same problems, speedrunners will hate you
 
1:01 PM
everytime I read this it feels strange:
double[][] scoreArray = new double[driverPlanEnvironments.size()][maxPlanCount];
 
why so?
 
well I usually don't call a constructor on primitives :)
 
ah
 
@KarelG Dang, glad you figured it out. :)
 
ye
I remember in school that a lot of people had issues understanding arrays
because you do
new MyClass()
against
new MyClass[]
 
1:03 PM
:D
 
it is an exception on the rules of common syntax
new Array<MyClass>() would have made much more sense syntactically
but back in the days, that didnt exist
 
yep
 
at least Kotlin did it that way
 
1:33 PM
@motaa new X[] creates an array, not an X
 
posted on July 10, 2020

archive - contact - sexy exciting merchandise - search - about ← previousJuly 10th, 2020nextJuly 10th, 2020: Hey, I've got a mailing list for SECRET PALS! If you'd like to be a SECRET PAL, baby, now is your chance. I only send out a message like once a month!– Ryan

 
@fredoverflow hehe I know but I rarely see the syntax in code so it always reminds and also surprises me everytime :D
 
@fredoverflow try to explain to new peeps that new MyClass() is entirely different compared to new MyClass[]
you would be surprised how many have trouble understanding that
I also still get confused by some array syntax in C# and Java
 
There's also new Interface() { ... } for anonymous inner classes, that trips a lot of people up initially.
 
oh yea
I remember my teacher being "no no no no, this is all wrong"
those anonymous classes are quite old tho, arent they?
 
1:40 PM
I hate the expression anonymous inner class
I would call it in place implementation :D
 
are they inner classes tho?
 
@Wietlol Java 1.1
 
ooh, that is old
I was more thinking of 1.4 or something actually
 
@Wietlol I guess not, must have remembered it wrong.
Some also find var primitiveClass = int.class; funny.
 
I know them just as anonymous classes, which is a fine name I guess
 
1:42 PM
seems to be the official name
 
nested classes are always a pain to remember the name of tho
there are nested classes
there are also static nested classes
and inner classes, which are non-static nested classes
but we never use them, so I guess they dont exist :D
 
ye indeed :D
 
in C#, there is one use case for them
but the compiler prevents you from doing that because it hates you
 
jshell> int.class == Integer.TYPE   // interesting, TIL
$1 ==> true

jshell> int.class == Integer.class
$2 ==> false
 
extension methods in C# must be in a static class
so, I would make a static nested class to retain my visibility control
but, it must be in a static non-nested class
 
1:46 PM
That's too complicated, I'm gonna convert to JavaScript :D
 
oh yea, because JS isn't complicated at all :D
 
The one kind of class JavaScript has is just syntactic sugar, so technically, it has no classes at all ;)
 
const y = {...x};
 
2:32 PM
oh, how much I love JS :D
 
hehe
 
Zoe
uh
/help
yo @Michael, Oak is dead
 
he still has an use: as a coffin
:D
/shows-myself-the-door
 
man I currently love how my system around my hsm's just works :D
my colleagues were looking funny at me when I told them that I'm gonna wrap a persons daily activity plan into state machines since we want to run our simulations sequentially in parallel
and now I see all the new benefits that I get
 
 
3 hours later…
5:40 PM
@Zoe Dang it Zoe! Stop killing Oak!
 
Zoe
What did I do?!
 
OakBot Online.
 
@Zoe "Stop killing Oak!"
 
o/
 
\o
 
 
3 hours later…
8:15 PM
12
Q: What is the cost / complexity of a String.indexOf() function call

JimWhat is the cost / complexity of a String.indexOf() function call?

Why does Java use the naive algorithm (O(n*m)) and not KMP (O(n+m)) for substring search?
 
 
2 hours later…
10:01 PM
@Neil I just spent the last 4 hours refactoring my Aluminum Sheet factory. Made it stackable so I can get 180 sheets/m from one building lol.
 
 

« first day (3548 days earlier)      last day (1407 days later) »