« first day (1592 days earlier)      last day (3359 days later) » 

1:00 PM
@SecondRikudo only 2k? Meh
 
@Vogel612 ... XML?!
 
"build.xml ant file"
 
well
eh
runs away
 
it's even worse than maven...
 
@FlorianMargaine Hahaha
I wonder how long is our build.xml...
 
1:07 PM
but it werkz cough
 
fge
You can include in ant build files
 
4.3KLoC, nice :D
 
fge
I have actually rewritten a complete ant build system a while ago...
Went down from one file which was 12k lines long to 6 files each being less than 700 lines long; macros + ant-contrib ftw
In fact, it is much, much better than maven
 
aside from the completely missing dependency-management, but hey
who needs managed dependencies anyways ;)
 
fge
Yep, but then there's ivy
 
1:15 PM
(which is also XML-based)
 
There are two things in Java I don't understand the logic of. And I hope someone can help me understand.
 
Try.
 
What's the point of the @Override annotation, and what's the point of the final keyword?
 
=javadoc Override
 
@Unihedro java.lang.Override: Indicates that a method declaration is intended to override a method declaration in a supertype. If a method is annotated with this annotation type compilers are required to generate an error message unless at least one of the following conditions hold: The method does override or implement a method declared in a supertype. The method has a signature that is ...
override-equivalent to that of any public method declared in Object.
 
1:18 PM
final allows you to define things as referentially immutable
 
@Unihedro I know what it is.
I'm asking for the why
 
(which is the same as completely immutable for primitives)
final stuff is easier to handle and can often be optimized by JIT
 
@Vogel612 why do I need to define it?? Can't the compiler see I'm not changing the variable throughout the lifetime?
 
@SecondRikudo to make sure you're overriding a method
or the compiler can think you're doing a new method
 
Its point would be to make the source code clearer so the programmer reading it without an IDE that marks the method as overriding would know? It also asserts a compile-time error to be thrown if an Override annotation is used on a non-overriding method.
 
1:19 PM
the point is that you can turn on compiler warnings for missing @Override. Then you can spot instances where you'd accidentally override something
 
@FlorianMargaine If a method is defined by the interface, and I implement the method with the same signature, there's exactly one option.
 
Just like @FunctionalInterface, it doesn't have to be added for an FI to be an FI, but it asserts compiler warnings to be present. As well as IDE warnings.
 
and also the other way around like Uni said
 
on a related note you can't override final methods
 
@SecondRikudo if you implement @Override public void typoFunction () {}, javac will tell you something's wrong
 
1:21 PM
Hi, someone use OpenShift?
 
@FlorianMargaine Frankly, that's an IDE's job, not a compiler's
But okay, I can kind of sort of see the point
 
an IDE job has to run a spell checker on function names?
 
@SecondRikudo nope, that's the thing about Java :p
 
What about final?
 
as for final, it has overloaded meaning so what do you mean? the qualified for methods or the one for variables?
 
1:22 PM
Let me try to answer the question about final. This makes the compiler declare more functional contracts, which is usually pointless because some fields are contextually final anyway. However, since the keyword is used in many places, you'd have to dive into each of those levels. Let's go to a final type first.
 
Why can't the compiler deduce that a variable never changes and optimize based on that?
I'm referring to final Type var = new Type()
 
it can. but these are to help the programmer. tests done at compile time
 
First of all, immutable types. Say you have class PairOfInt { final int first, second; }, the type seems to be immutable.
 
@Unihedro Again, I'm not asking what final is.
1 min ago, by Second Rikudo
Why can't the compiler deduce that a variable never changes and optimize based on that?
 
fge
@SecondRikudo the compiler will not; the JIT may
 
1:23 PM
@SecondRikudo because the compiler doesn't optimize, the JVM does in JIT
 
Why do I need the extra verbosity for?
 
fge
The java compiler is dumb
 
the premise is broken
 
because, if you don't mark them explicitly, you could accidentaly modify the "immutable" type
 
@kiheru So basically, both of these (this and @Override) is Java's way of saying "You're an idiot, let me make sure you don't make this mistake"
 
1:24 PM
@SecondRikudo no
 
@SecondRikudo you could argue the same for const
 
fge
That's the opposite, it's the compiler which is dumb
You need to spoonfeed it, basically
 
@FlorianMargaine I definitely can, but the difference is that const whatever is no more verbose than var whatever or let whatever.
 
@SecondRikudo It's java's way for the programmer to place safe guards where they want them
 
@SecondRikudo which will never happen...
 
1:26 PM
@Vogel612 What would never happen?
 
@SecondRikudo how do you declare an immutable variable in other languages?
 
because you'd have at least const auto whatever
 
@Vogel612 That's JavaScript
 
@SecondRikudo no that's c
 
1:26 PM
@Unihedro actually it's C++...
 
I'll slit the wrists of the first one using auto in C
 
fge
final is effectively there to say to the compiler "I won't touch that variable and that's final"; or in a class, it means you cannot extend it
 
@Vogel612 No I was purposefully saying it was C even though it will never be seen in C. :p
 
@fge But the compiler can definitely tell I'm not touching that variable!
 
1:27 PM
shame on you @Unihedro
@SecondRikudo no it can't
 
fge
@SecondRikudo no; as I said the Java compiler is very, very dumb
 
because nobody knows all implementing (or extending) classes
 
@Vogel612 I'm focusing on final Type variable for now
 
@SecondRikudo it doesn't matter because if the compiler optimizes them away anyway, reflection will be broken :p
 
fge
And it is on purpose that it does that; all the hard work is done by the JVM
 
1:29 PM
@SecondRikudo subclasses may access fields of this type
 
Hi to all
anyone work applet Signing JAR Files
 
If you have Type variable instead, the compiler can't infer whether subclasses write or read to or from it
 
@Unihedro That's a problem solved with visibility...
 
@SecondRikudo nope reflection
 
@Unihedro Explain
 
1:30 PM
ugh fine
ok, there's a utility method Math.random(), which uses a private field in class Math as private Random randomNumberGenerator.
If the compiler infers that the field is final and optimizes it away, you can't change the randomNumberGenerator variable anymore to mock Math.random()!
private void setUpRandomness() {
    try {
        Field field = Math.class.getDeclaredField("randomNumberGenerator");
        field.setAccessible(true);
        field.set(null, new Random() {
            @Override
            public double nextDouble() {
                return 4; // chosen by fair dice roll.
            }             // guaranteed to be random.
        });               // Proof: xkcd.com/221
    }
    catch (final SecurityException | NoSuchFieldException | IllegalArgumentException | IllegalAccessException e)
Actually, compilers optimizes away very few things. Like compiling:
 
@Unihedro That sounds like a horrible, horrible thing to do to begin with.
 
// 1
{
  Type a = a();
  a.b();
  a = a(2);
  b(a);
}
as:
// 2
{
  final Type a = a();
  a.b();
  final Type a0 = a(2);
  b(a0);
}
They actually compile into the same bytecodes. :p
 
Another issue is multithreading. For normal fields you need to make sure the writes are visible to other threads (so visibility alone does not help there), but final fields are guaranteed to be safe for reading
 
Yes, and when final Type variable is used it asserts that the first write to it is finished before moving onto the rest of the stack, if multithreading's involved.
Otherwise JIT optimizes away that bit as well. It usually doesn't matter, but eh.
 
Those "usually it does not matter" things make fun bugs to hunt
 
1:38 PM
Yeah, which is why it's advised to make everything that's final final. xD
Not sure why, possibly the jQuery theory.
 
@Unihedro the functionality of final is not under question here.
But the compiler can (even if it doesn't, because it's dumb) determine whether or not a variable is final without me spoonfeeding it to it..
 
So how'd you handle the concurrency issue? Never allow reordering instructions?
 
@SecondRikudo ... no?
 
It's not that hard to determine, at the very least inside of methods, that a variable is declared once, read a couple times, then dies.
It's also possible to determine that throughout the entire code graph, there's only this one place where a variable is written to, even in object/class variables.
 
for those inside methods java 8 has the "effectively final" concept, that does what you want
 
1:41 PM
"at the very least inside of methods" - that's a different thing, fields and local variables scoped in methods
and even local variables scoped in code blocks in methods
final works differently in all three of the above cases - for example, variables that are effectively final are optimized away in code blocks
 
Some one used OpenShift?
 
@AndreaCatania None that bothers helping, it seems. If someone would had, they would already had answered you.
 
@SecondRikudo
15 mins ago, by fge
final is effectively there to say to the compiler "I won't touch that variable and that's final"; or in a class, it means you cannot extend it
if you accidentally do, the compiler will tell you
you do know that java programmers are stupid, right?
 
@FlorianMargaine I was trying very hard not to say it, but I ended up saying it anyway a few messages back.
 
@Unihedro Ok thanks
 
1:43 PM
at least the "architect" can define clearly done interfaces, and the java monkeys just have to make the code pass the compiler
 
19 mins ago, by Second Rikudo
@kiheru So basically, both of these (this and @Override) is Java's way of saying "You're an idiot, let me make sure you don't make this mistake"
 
@FlorianMargaine friendly...
 
@SecondRikudo many language constructs are just that, though
 
@SecondRikudo If you completely ignore the functionality which I just told you, yes
 
@Gemtastic ;)
@SecondRikudo that's the point of any statically typed language btw
 
1:44 PM
@Unihedro What functionality did you explain that cannot be inferred by the compiler on its own?
Not the Java compiler which I understand isn't the brightest bulb in the box, but "a" compiler.
 
@SecondRikudo all
 
@Unihedro Okay, let's agree that on scoped variables, final can be inferred by the compiler?
 
At least I'm happy to be able to place these kinds of assertions to the code where they both make the intent of the code clear, and get done at compile rather than at run time
 
The "effectively final" policy?
 
@SecondRikudo that's only applicable to pure methods
@SecondRikudo no
 
1:46 PM
@Unihedro Yes
@Unihedro Why not?
 
@SecondRikudo because not every scoped variable is constant on thread local usage.
 
Hello everyone & @Uni
 
why hello there
 
I am writing unit tests using mockito, testNG & assertj and need a little help
 
@fge I summon you!
 
1:48 PM
@Unihedro I didn't get that one.
 
hahaha I already tried to ping him but seems like he is away
 
Hmm.
 
@Unihedro If I have a scoped variable inside of a method, how can another thread modify it without the compiler being able to tell?
 
@Uni Is it possible to use when().thenReturn() for custom implemented function?
 
@Mr.777 Have you tried?
 
1:52 PM
Ofourse I have tried
 
@SecondRikudo because the compiler is stupid
 
@SecondRikudo that's not what constant on thread local usage means...
 
Eh, this:
12 mins ago, by Second Rikudo
It's not that hard to determine, at the very least inside of methods, that a variable is declared once, read a couple times, then dies.
 
@Unihedro Again, the fact that the compiler is stupid is not an excuse to treat me as if I'm stupid as well.
 
Just because a variable is declared once and read a couple times doesn't mean it will remain constant thread-locally.
@SecondRikudo That has no correlation.
 
1:53 PM
@Unihedro What might change it?
 
@SecondRikudo all
 
...
If throughout the entire code graph, the variable is never written to. What could possibly change it?
 
coughs
 
a subclass using ThreadLocal<Type>
 
@Unihedro Please show me how a variable can be written to without writing to it.
 
1:54 PM
Huh?
 
1 min ago, by Second Rikudo
If throughout the entire code graph, the variable is never written to. What could possibly change it?
 
2015 Java Chat Election: Star this message to vote for @Unihedro
 
@Mr.777 I already own this room.
 
But he's already a RO
 
a subclass using ThreadLocal<Type> is still under the "entire codegraph"
 
1:55 PM
But owner can be voted, no?
 
we're voting for new owners
 
@Mr.777 Voted for owner? :P
 
Aaah nevermind, I've been away from the room very long, so no idea what's going on
 
If you clicked on any of those messages to visit the transcript you'd see it anyway. xD
 
:P
 
1:56 PM
@SecondRikudo you're right
It doesn't have to anyway, since it's going to be optimized away by JVM as JIT compilation more effectively.
 
fge
@Unihedro yes, master?
 
15 mins ago, by Mr.777
I am writing unit tests using mockito, testNG & assertj and need a little help
 
fge
Well, uh, tests for what?
 
@Mr.777 I summon you!
 
2:05 PM
Ugh, this is hard.
 
@Unihedro Are you holding the goat blood bucket properly above your head?
 
No, I just installed a Spark from Botania. I don't have a Tesseract to tap into the free energy workshop yet.
And since the Spark doesn't get a channel, the entire thing dies and is no longer powered. But the items network dies as well!
 
@fge
public ABC requestMethod(Request request) {
dao.getMethod(request);
}

// In DAO
there is implementation of the method getMethod
I want to mock the call of dao.getMethod(request) with my mocked ABC class object
I am trying this:
when(dao.getMethod(request)).thenReturn(ABCMock);
Am i doing it right?
Because function doesnt mock it's response and returns the actual response of implementation instead of my mocked response
 
if dao.getMethod has side effect, you need to use instead doReturn(ABCmock).when()
 
fge
<--- rewriting throwing-lambdas with the new definition
Works well so far
@Unihedro want to help, or have you decided to take HTTP/2 seriously? :p
 
2:18 PM
@fge I'll help!
Most of my HTTP/2 code sessions are "I have no idea what I'm doing but this is fun".
I should probably just finish JCE. xD
 
fge
@Unihedro OK, just wait a second until I get the first two tests done
 
fge
2:36 PM
@Unihedro this is the new base class: gist.github.com/fge/93ceae333c7c4ef12dfb
 
@Gemtastic @fge what's the verdict on Gem's app?
Are we going to make a model case out of it?
 
I want to
 
fge
Well, @Gemtastic decided, so I guess the answer is yes
 
When do we start?
 
what do you want to do?
 
fge
2:47 PM
Whenever you want, and the first thing to do is define the objectives; among other things, what will the application be (webapp?)
 
@fge cool beans
 
@fge It's the server that gets most focus here.
Good server don't care about which clients are using them :P
 
fge
Well, if you have a server and no clients, it's not really worth it either :p
 
@fge well, for this version I thought we agreed on webapp so that Second would be a little bit more familiar with what he's doing
 
fge
If it's a webapp I was thinking about using spark (not Apache spark but this
@Gemtastic makes sense
 
2:50 PM
@fge I like the look of that
 
fge
@SecondRikudo this is what I'm going to use for the webapp version of my debugger also; and yeah, I love the feel of it too
 
@fge This feels very similar to how Node does things btw
 
fge
@Gemtastic start writing a design document ;)
@SecondRikudo except that as it is based on a servlet engine this is not async I/O by default ;)
 
@fge How do I do that? :D
 
You pass a callback to be called when a request is received, it holds two objects the request and response, and you can do WTF you want with it.
 
fge
2:52 PM
But it can be if you use websockets
 
@fge Yeah, but the feel of it.
It just makes sense
Call this function whenever a request arrives
What could be clearer than that?
 
I want some advice on how i should...
 
fge
@Gemtastic just get started writing a document, as with all specs it will refine as comments come in etc ;)
 
well, I kinda have one
what's bad about it?
 
fge
THat's the functional specifications; missing are the technical specifications
 
2:56 PM
Ah
 
fge
@SecondRikudo and I can give recommendations but that's your call, ultimately; also, it should tell whether tables are populated with some test data or something
And "all that"; there is no hard rule but the work needs to go in one direction, not several :p
Among the core decisions are which build tool
I'd prefer gradle but again, that's your call, not mine
 
@fge The way I generally approach these kind of things is to create a generic RESTful server, and implement the client to use that API.
(This puts a bit more focus on the client in this case)
As for build tool, how is it my decision? :P
 
fge
That was directed at @Gemtastic actually
Note that I said "@SecondRikudo and I"
But yeah, that wasn't obvious
 
Ah :P
 
well, if we're using gradle I need to dl a new ide :P
 
fge
3:05 PM
Eh?
What are you using at the moment?
 
netbeans
 
fge
Ah
And it has no gradle support?
 
you could geet a plug in apparently
 
fge
Well, I'd recommend IDEA, but...
 
3:10 PM
is the free one enough?
 
YES
Don't get the ultimate one it crashes too much on Windows
 
@Gemtastic Definitely.
 
installing
 
3:28 PM
@fge halp
private ClientPropertiesManager = mock(ClientPropertiesManager.class);
This makes Intellij complain
Added import static org.mockito.Mockito.*; at the top, Intellij still complains (and marks the import as unused)
I'm an idiot. Disregard me.
 
fge
Hmmyeah, if you don't give a name to it, it won't work very well :p
 
well I got intellij now
 
@fge Now to figure out how to test crap with Spring injecting stuff
 
fge
@SecondRikudo my condolences
 
Is it possible to have a constructor inherited without needing to redeclare it?
 
fge
3:39 PM
Only for the default constructor, if any
 
@fge "default" constructor?
I defined one constructor on the abstract class (the constructor is not abstract)
Can I inherit it without overriding for each implementing class?
I see, the "default" constructor is the one you didn't define
So that's a no
ffs
 
fge
Well, you cannot have abstract constructors, really
 
Alright, let's widen the perspective
@fge I have a dependency for all "Command" objects. All "Command" objects require "SomeManager"
 
fge
But no, you have to provide constructors for all matching constructors of your super class
 
I want to test the concrete implementations of "Command" by mocking SomeManager
 
fge
3:49 PM
(even if that just means calling super(with,whatever, arguments))
 
@fge The Command object is under test
I want to mock Manager
 
fge
Well, mock(Manager.class) can do it; or spy(new SomeManagerImplementation())
 
@fge But how do I inject it into Command?
 
fge
Is the manager a parameter of the Command constructor?
 
@fge That's what I want to avoid.
Because I don't want to copy paste a constructor across 10 implementations.
 
3:51 PM
you want to avoid DI?
 
@FlorianMargaine Spring handles DI for me. It's magical.
 
fge
Well, I guess this is a case of instructing Spring to "inject this mock please"
But honestly I've no idea how to do this
<-- still doesn't use Spring, still doesn't want to use it, except at gunpoint
 
Maybe this is something to have a look at? codewithzenmind.wordpress.com/2013/07/11/…
 
4:15 PM
quick question. i want to access variable of parent class. tried to docode Parent.this.variableName code without success ,any help?
i have gone too far with it.. shouldve put only the var name
ty tho
 
@somefolk could you be more specific about your question
 
it was a stupid one i got it pretty quickly though.. it was abouot an inner clas trying to access parent variable
 
okay
 
@fge Using Mockito, why do I get an instantiation error when I tell mockito to create it with @Spy?
 
4:22 PM
Hmm
I want to do a hangout sometimes about my view of MVC and why I think most frameworks get it wrong
(surprisingly not Spring though)
 
@SecondRikudo I'm game
I know it from working with spring
 
@Gemtastic The part where most people get it wrong is the M
People tend to think of Models as database accessors
That's not the case. Not really.
 
@Gemtastic what are you planning to do?
 
@Smrita What we do every night @Smrita
Try to take over the world!
It's @Smrita, @Smrita and the @Gem @Gem @Gem @Gem...
 
@SecondRikudo haha
whats its all about?
Do you all have odesk account?
 
4:27 PM
I can join a hangout now
Models kinda only are beans
Or maybe I should think before I speak XD
 
@SecondRikudo even I am
 
fge
@SecondRikudo no idea; I never use these annotations, I always use @Before* to initialize mocks
 
So you guys wanna do a hangout?
 
fge
And the subject would be?
Sorry, I am multitasking
(also implementing the next version of throwing-lambdas)
 
@Gemtastic MVC right?
 
4:42 PM
Yes
 
> I want to do a hangout sometimes about my view of MVC and why I think most frameworks get it wrong
 
^^^^
@Second you wanna host?
I have a mic now :3
 
fge
Hmm, OK
I have a hard time still with all these MV* acronyms
Whenever you want
 
Just waiting for Second
 
I don't have a mic at the moment, still at work
How about in about an hour?
@Gemtastic @fge @ItachiUchiha?
 
4:55 PM
Works for me
 
I can't vouch for that I'm not in the shower then
 
@SecondRikudo Yeah, that's not gonna happen. You can't hear anything but the shower in htere
 
fge
@SecondRikudo I'm here
 
4:56 PM
Not to mention the moist will ruin the computer if I put it in there
 
2 mins ago, by Second Rikudo
How about in about an hour?
 
fge
Fine by me
 
Great
 
fge
@Gemtastic so, what about the ORM? jooq? :p
 
Well, I still feel like I need more feedback
On the error message part. I think I'm kinda done "enough" then, because I understood it is following 3NF so technically it's good enough
 
5:05 PM
The same assholes that abuse animals because "they are stupid and don't have feelings" are going to be the same assholes to abuse their robot butlers in the future and cause a robot uprising. STOP animal abuse NOW!
 
fge
You mean the error reports?
 
Yes
 
fge
Well, from what you explain, to me it is only a question of selecting all error reports for a particular car since its last visit (or "the beginning of time" if it has never been handled before)
 
Well, the thing is that I imagine that there has to be a connection between an appointment and an error report because as far as I know, you always book a time to fix it. I interpret the data gathering's purpose as finding out how long a customer have to wait in between the error report and when that particular error is fixed
 
fge
final Field<DateTime> lastVisitDate = getLastVisitForCar(id);
return jooq.select(ERRORS.ID, ERRORS.DESC).from(ERRORS)
    .where(ERRORS.CAR_ID.eq(id))
    .and(ERRORS.DATE.ge(lastVisitDate))
    .fetch().map(whateverMapper);
 
5:12 PM
@Gemtastic What's an "error report" in the context of a car shop?
 
It's pretty much any error that occurs with a car
 
@Gemtastic Cars don't have "errors" :D
 
There are two major type of things happening at a car shop; the repairs, and the maintenance surveying.
Yes, they have errors, especially in modern day cars; their software can get an error too
And it's called error because I don't know what "felmeddelande" (lit. fault message) translates to, and the dictionary said "error report"
Or error message
 
@Gemtastic fault is good
malfunction is also good
"error" implies either software error or human error
 
Malfunction-report sounds better. Longer, but better
 
5:55 PM
OK
I'm ready when you are.
@Gemtastic @fge @ItachiUchiha
 
I'm still here
 
Even I am
 
Haven't taken that coveted shower yet?
 
Nope
Dunno when it will happen; I'm not gonna shower alone.
 
5:58 PM
Can I just go grab me some tea while it's being set up?
 
Waiting on @fge
@Gemtastic Sure
 
fge
I'm here
 
Tea is almost done! How's the setup coming along @Second?
 
I don't have you on my G+ so you didn't receive a full fledged invitation
@ItachiUchiha
 
got it
 
6:38 PM
http://www.commitstrip.com/en/2015/03/03/stackoverflow-youre-not-alone/
CommitStrip - Blog relating the daily life of web agencies developers
Stackoverflow : you’re not alone
CommitStrip
1425407888
 

« first day (1592 days earlier)      last day (3359 days later) »