« first day (2897 days earlier)      last day (2056 days later) » 
00:00 - 13:0013:00 - 23:00

12:00 AM
"Extend beyond your preconceived limits!" -Lorii Myers (source)
 
 
1 hour later…
1:16 AM
@Wietlol it's correct, they both have pros and cons.
 
1:48 AM
I'm starting to like java more
but let me remind you 'liking java more' != 'liking java'
 
 
2 hours later…
3:32 AM
Good morning!
 
Good morning.
 
user8622974
Good morning!
 
4:24 AM
morning
 
user8622974
morning
 
Morning.
 
5:05 AM
Hi, I'm new to Java (specifically enterprise) coming from .NET, struggling to understand the 'mindset' that comes with enterprise development and I have questions.

These are things I've seen my senior developer do, and discussing/arguing for hours with him on design choices, maybe i just need more opinions from other developers to truly get the concepts.

1) Why does the ORM need to be decoupled from our code? Has anyone had to go through changing ORMs in their application?
2) I've seen my senior dev structure our code where there is an EntityService which communicates with the repository,
 
@Igneous01 Welcome to the Java Chat, the room for Java enthusiasts! Please use a code snippet tool when posting code snippets. If you have an Android question, you're in the wrong place! And remember: this is not tech support! Thanks for visiting and have fun! :D
 
Also, why do interfaces not follow the ISomething convention? I get it's a .NET convention, but I find it super easy to identify when something is an interface vs a class. It's hard to know whether Context, WebContext, ContextBuilder, ContextFactory are concrete implementations or interfaces.
 
5:47 AM
Interface names are usually adjectives. Class names are typically nouns.
 
/javadoc Converter
4
 
6:08 AM
hy @geisterfurz007
 
Oof! Too early still. Try again in an hour or two ;)
TIL: Don't listen to your IDE if it tells you you can lower the scope of a method in an EJB.
 
 
1 hour later…
7:34 AM
Hi guys THere is a method t put a file into respoonse GET OPERATION
?
 
Sure! My approach would be to read the file and send the bytes as response. I bet though that would find a answers with a lot more details and better approaches with a little google query :)
//lmgtfy java get file request
 
user8622974
 
Or something like that.
 
user8622974
 
Yeah the second one is better.
 
7:41 AM
I don' use java like fron end
 
As long as your java backend knows what you are trying to do and can serve the file, you should be good, no?
 
Zoe
7:57 AM
Morning
 
user8622974
Morning
 
Morning.
 
8:27 AM
> ')', '*', <operator> or DISTINCT expected, got 'DISTINCT'
Help.
 
@Zoe hiya
 
@JerryChin you in le Jaba chat?
or wait, I might be confusing you for someone else
@Igneous01 1, reasons someone at your company made up probably
2, this is a really nice way of programming, giving each class one responsibility or one concern, this way, you can easily replace certain things and reuse code wherever you need it without writing anything more than you already have
you shouldnt have to look at the classes in the intermediate layers though, they should be named quite self-explanatory
 
8:47 AM
0
Q: EL expression invoke javascript var in <script>

xz G <%--A JSP FILE--%> <%@ page contentType="text/html;charset=UTF-8" %>\ <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@ taglib prefix="mine" uri="ELFunction" %> <%@include file="/page/header.jsp"%> <script> function validateForm() { va...

he needs to revise his concepts
 
that should also solve issue 3, classes should be small enough to understand what they do without much magic being involved
 
You need to revise the room topic Karel :P
 
classes that you dont edit should be assumed to work
@KarelG HERESY!
> JakartaScript
 
re 1: yes I wanted to change the ORM at least twice after a few days of working on two particularly egregious applications. Sometimes the ORM just sucks. Also ORMs generate pretty crappy queries most of the time.

re 2: Allows separated codesharing. You can Marshal / Serialize the DTOs and keep the database annotations out of there for clients

re 3: One gets used to it... You may be more familiar with the "Repository Pattern". That's the C# equivalent on the ORM side...
 
@geisterfurz007 I am in Java room. And it is both java and javascript
1/2
THAT IS JUST THE HALF
SO DEMOCRACY RULE SAYS: ACK
 
8:52 AM
give SO time to answer the question ;)
 
Crap; didn't see the jsp tag
 
morn
 
user8622974
morn
 
morn
 
bourne
 
9:09 AM
~waves
 
Heyyo :)
 
while (t.isAlive()) {
					System.err.println("trying okay");
					try {
						t.join();
						System.err.println("join okay");
						break;
					} catch (InterruptedException e) {
						System.err.println(e);
					}
				}
is this loop safe to use?
I can't be sure that when t.join exit, t.isAlive() will always return false.
 
Hi guys someone use tomcat?
 
@JerryChin what?
why cant you just do t.join()?
 
9:26 AM
1. the t thread is doing some important work, if I return immediately, the JVM will be forcefully kill thereafter, so the work will be lost.
So I have to wait for t thread to exit in a loop.
 
no need to loop
that whole thing can be replaced by t.join()
so long as t is not null, that will have the exact effect you're expecting
 
why?
 
/javadoc Thread.join
 
@Vogel612 Sorry, I never heard of that class. :(
 
/javadoc Thread#join
 
9:28 AM
How do I know current thread will never be interrupted>
 
3
 
@JerryChin that's not really relevant there.
 
Good bot.
 
@JerryChin but if you do t.join(), your thread will wait
 
9:29 AM
if you don't expose your thread it won't be interrupted
 
joining all worker threads is a common thing when closing an application
 
if you catch and ignore the InterruptException, you're breaking the behavioural semantics of interrrupts
 
its like windows showing you that some applications are still busy
when shutting down
the InterruptException is like the option where you say "Shut down anyway"
 
I see.
 
however, the interrupt can only be done explicitly on each thread
if you never expose your thread (as Vogel mentioned) noone should be able to do that interruption
(except reflection and shit)
 
9:32 AM
My thread is not exposed to anyone, I'll just resume Interrupt status bit in the catch block.
Thanks.
 
Guys sorry if I'm not english so If I show a confirm dialog where I put "Do you want exit?" and there are two botton
button ok the confirm with "ok" like label
and button that cancel the operation
which is the labelname more properly^
 
USM
9:53 AM
if (taskList.contains("/some")) {

}
this is returning false
if taskList [some, some-other]
 
> Guys sorry if I'm not english
are you english?
"/some" != "some"
 
USM
@Wietlol but it shld chck contains not equals
right mr.weedlol
?
 
"some".contains("/some") == false
but if taskList is a list, it does
"some".equals("/some")
"some-other".equals("/some")
 
USM
oh oooohhh
 
@Doflamingo19 what is your question?
 
Zoe
10:25 AM
@Michael Sorry, I completely missed that message xd The dependencies are for Jekyll. The gemfile contains the actual dependencies. The ones in the lock file includes the dependencies of the dependencies.
 
learns about Sequence<T> in Kotlin
goes over code to find cases where to replace Stream<T> with Sequence<T>
 
Zoe
10:56 AM
lol
 
/kotlindoc Sequence
/javadoc Sequence
Yeah out of those options I choose none, thanks for the help :)
2
 
Zoe
n00b
 
Was curious if that still worked :)
n000000000b
 
Zoe
> A sequence that returns values through its iterator. The values are evaluated lazily, and the sequence is potentially infinite.

Sequences can be iterated multiple times, however some sequence implementations might constrain themselves to be iterated only once. That is mentioned specifically in their documentation (e.g. generateSequence overload). The latter sequences throw an exception on an attempt to iterate them the second time.

Sequence operations, like Sequence.map, Sequence.filter etc, generally preserve that property of a sequence, and again it's documented for an operation if it
 
Multiple usage is pretty neat, yeah
 
11:07 AM
@geisterfurz007 Kotlin's Sequence<T> is Java's Stream<T>
as in, lazy evaluation
 
Oh Kotlin's Stream is not lazy?
 
Kotlin's collections have map, filter, etc
but those arent lazy
 
Oh iSee!
 
kotlin, being a JVM language, has access to Stream, so I still can write myList.stream().map { it.toStuff() }.filter { it.isValid }.collect(toList())
 
But then that stuff is still lazy, no?
 
11:09 AM
yes
but kotlin's collections have a considerable amount of additional methods
 
Nice, I now know Kotlin.
 
and they didnt provide them for stream
so, each time, I had to make a stream equivalent
 
I see, I see.
 
but I now know that they didnt provide them because they have an alternative to Stream which jetbrains can control entirely without JDK changes :D
so I can see why they didnt add the Stream methods
in any case
/afk lunch
 
@Wietlol Cya later
 
11:10 AM
Good guy Jetbrains! Enjoy your meal!
 
USM
11:24 AM
how can we use property file dynamically, as and when required, if we have multiple prop files? in Spring Boot.
 
Doesn't Properties suffice your needs?
/javadoc Properties USM
2
 
USM
11:51 AM
I need to load property file based on some conditions,
say suppose task is fetch, then fetch.properties shld be loaded
and load, then load.properties
it shld be on the fly
 
Oh is loading properties something special in Spring boot?
 
USM
10
A: Dynamically loading properties file using Spring

TillThe following supports what you are looking for: https://commons.apache.org/proper/commons-configuration/userguide/howto_properties.html PropertiesConfiguration config = new PropertiesConfiguration("usergui.properties"); config.setReloadingStrategy(new FileChangedReloadingStrategy()); This s...

 
back
 
@Wietlol Welcome back!
 
oh thank you
 
11:55 AM
posted on September 28, 2018

archive - contact - sexy exciting merchandise - search - about ← previousSeptember 28th, 2018nextSeptember 28th, 2018: HOW TO INVENT EVERYTHING IS OUT NOW, aaaahhhhh!!– Ryan

 
sigh
I cant get module errors to disappear
 
@Wietlol Member how you wanted to help me with Haskell?
By now I managed to do everything on my own \o/
 
So maybe you may help me next week :)
 
hmm
I am unable to reproduce this error that occurs randomly and on a low frequency rate
javax.servlet.ServletException: org.apache.tomcat.util.http.fileupload.FileUploadBase$InvalidContentTypeException: the request doesn't contain a multipart/form-data or multipart/mixed stream, content type header is null
 
12:00 PM
At 216th place, Taiwan has one of the lowest birth rates in the world. Japan, Hong Kong, and South Korea are even lower. (source)
 
Does that help you? ^
 
the service has been used by multiple people (1000+) but it happens that the above is being thrown
it is just a matter of why
 
DON
How to apply filter for Object array using Java 8
userObject[0]="AA"
userObject[1]="BB"
userObject[2]="CC"

userObject.stream().filter(T ->userObject[1].equals("BB") )
 
log the incoming request when that error is thrown
wait what?!
 
@DON Arrays.stream( urArray ).filter
 
12:01 PM
website is down?
 
@DON You stream the array as KarelG mentioned and then process each array element in the filter: .filter(element -> element.equals("BB"))
The resulting stream would then only include elements from the array that equal "BB".
 
also, dont use userObject[1] inside the filter
filter(it -> it.equals("BB")
 
DON
Actually userObject is collection ie Collection<Object[]> userObject
 
keh
@Wietlol "BB".equals(it) is much cleaner D:
 
@KarelG yes, it's not prone to NPE
 
12:10 PM
meh
filter(::equals:("BB"))
(not Jaba yet)
@mike who would put nulls into a list?
also, I have no such thing as an NPE :D
 
Who knows. But systematically excluding NPEs is always better than trusting developers^^
Also, you can create a nice lamda that way: filter("BB"::equals)
 
systematically using a language that makes nullability explicit is always better
 
but I have to check if method references work on literals. not exactly sure right now
 
"BB"::equals does indeed actually work
literals are values
values are a perfectly fine left operand
 
yep, just tested it! Thx
Stream.of("AA", "BB").filter("BB"::equals).count();
 
12:14 PM
I still find filter(::equals:("BB")) better (currying)
 
What language is that?
scala?
has currying?
 
its a proposal
by me :D
 
:D
I wrote a currying framework once. jcurry.
 
scala doesnt seem to have proper currying though
 
Currying? Isn't that a food-related word?
 
But I had to use soo much generics, that is was a pain. I just stopped developing at some point
 
JakartaScript?
 
@JennaSloan partical application of method arguments
 
also
@mike my design requires a different syntax though
 
@Wietlol thats just a user profile. Mine is that: github.com/mbe24/jcurry
Whats yours?
Or where's your proposal
 
12:19 PM
// def mod(base, divisor) = (base % divisor) == 0
// mod(10, 5)  // 0        // Int
// mod:(10, 5) // 0        // () -> Int
// mod:(_, 5)  // mod x 5  // Int -> Int
// mod:(10, _) // mod 10 x // Int -> Int
basically
where :() signifies currying
which might not be entirely neat, but whatever
 
Why would you need : in the second line? What is there left to curry?
 
it cant just be mod(10, 5) because that could be either calling the method or fully currying the method
the second line is a function that takes no arguments
in Java, a Supplier<Integer>
 
Ahh. Okay, got it
Supplier<Integer>
:D
 
not action ofcourse :D
but that is the reason why you cant just have mod(10, 5)
there is a dilema for having partial stuff though
as in mod:(10) == mod:(10, _)
but I dont think that would be good
(or the other way around, filling in blanks from the left)
 
Wish you look with your proposal. But Java wants (nearly?) everything to be backwards compatible. That could be a problem
 
12:24 PM
although, using kotlin, a lot of places, where you normally want to curry, you can easily just write the lambda
since their lambdas are really nice
 
I have problems on my own, though :D I need a (lightweight) and non-distributed alternative to Apache Storm
0
Q: Apache Storm in non-distributed scenarios

mikeI'm developing an application that processes transactions that contain fragments of serialized messages. It reads, groups and concatenates, and pushs them to subscribed readers after deserializig them. The different tasks (reading, grouping, deserializing) are implemented as dedicated components...

 
@mike that wont be a problem, this is a compile-time feature
at runtime, there is no need for additional stuff
currying is basically a different syntax for a lambda
same as method references
there is also method reference chaining
 
Ahhh. Nice. So you preprocess it a create partial function objects. Similar to Mockito (which uses objgenesis, I thinkk)
*preprocess it AND create
 
::getPrinter->print:("Hello, World!")->close
 
@Wietlol wtf
 
12:27 PM
(ofcourse this example is stupid, but whatever)
 
@Wietlol The method signature changes, though. So you need another type
 
not really
which method signature has to change?
 
Coming back to Apache Storm. Anyone some advice? :D:D
 
Wietlol, you are towc's version here in this Java room
 
0.o?
 
12:28 PM
@Wietlol i.e. BiFunction (add(x, y)) to Function (add_x(y)) for example.
 
o_0
 
@mike take for example Stream<T>.filter(predicate) predicate here needs a Predicate<T> (aka Function<T, Boolean>)
String.equals is (String, String) -> Boolean
that being curried by one value would be String -> Boolean
so could be applied on a filter on a Stream<String>
// ::equals:("BB")
// String::equals:("BB")
// e -> e.equals("BB")
basically syntax sugar
 
That makes it longer and less verbose.
 
More like syntax pepper if you ask me.
 
12:32 PM
@geisterfurz007 in this case maybe
also, it only makes it longer because I named the variable e
 
My point of less verbose still stands.
 
balls I'm tired
 
lol
 
@geisterfurz007 more verbose?
less verbose is better I think
except when more verbose makes it more clear
and readable
 
That was what I meant
How is String::equals("BB") clearer than myVariableWhichIProperlyNamed.equals("BB")?
 
12:35 PM
The signature, in this case, is a known signature. String::equals:("BB") is Predicate<String> which is Function<String, Boolean>. What if you curry functions with more parameters? You need many function types Function3<P1, P2, P3, R>, Function4<P1, P2, P3, P4, R> etc.
@geisterfurz007 You'd use it in a stream. So 'myVariableWhichIProperlyNamed' would not provide any benefit
 
For me it does because it adds clarity about what is currently being processed. A guy sometimes passes through here with questions about streams which I don't think he would have if he was clear about what each step takes in and puts out.
 
yah I wish he would just put out
 
lol
 
randomListOfPeople.stream().map(person -> person.lastName).filter(lastName -> lastName.startsWith("L"))
 
So is this a software engineering chatroom now?
 
12:41 PM
The responsibility weighs heavily on our shoulders, sir.
 
Okay, I'd use map(Person::getLastName), though :P
 
oooo
 
@ballBreaker Maybe. I new^^
 
Nah it's a room about Java
@Michael you should remove the part in the room description that says "and general software engineering principles"
 
Can anyone help me out. For spiritual being's sake: stackoverflow.com/questions/52554686/… :D
 
12:43 PM
I think it'll welcome help vampires from universities thinking we're going to help them with software engineering principles
 
Please don't use chat as fastlane for your questions. Instead, wait a few days before asking here to give the people on the main site some time. If we want to answer questions there, we will look for them on our own.
 
also I don't remember this chatroom ever being software engineering
 
@ballBreaker Well it sometimes is :D
 
I don't like change
Stop changing this room
you dingos
 
Flagged >.>
DAS RUDE!!!
 
12:45 PM
you fliggerwink
 
I probably should rephrase that comment and make it a little less... rude I guess? Maybe a poet like @Michael could look over the comments in my StockComments script :P
no U
 
you downright shwoopdipooptydoo
 
@mike you curry them at the same time
 
This brings up a curious topic
If the tone of a word suggests it's meant to be offensive, even if the word is made up. Is it considered offensive?
 
::doStuff:(a, b, c, d, e)
::doStuff:(_, b, c, d, e) = Function<A, Stuff>
::doStuff:(a, _, c, d, e) = Function<B, Stuff>
 
user8622974
@geisterfurz007 Learned.
 
::doStuff:(_, _, c, d, e) = BiFunction<A, B, Stuff>
 
//llama
 
etc
 
user8622974
 
12:48 PM
Best. Image. Ever.
 
@ballBreaker I've asked a question on law stackexchange once. law.stackexchange.com/questions/3989/implied-insults
About implied insults
 
Oh boy another German here?
This room becomes the same for Germans as Android Era was for Indians :P
 
@mike hmm interesting
 
A'ight, gtg. Don't destroy stuff or get this room frozen, kids :P Later o/
 
Not quite the same as what I was saying, but close enough to draw some parallels
 
12:50 PM
randomListOfPeople
	.stream()
	.map(Person::lastName)
	.filter(::startsWith:("L"))
@geisterfurz007
 
Yes. But why would a made up word be understood as offense? I think because it implies some insult.
 
My reasoning is that if a madeup word is said with the intent and tone to deem it as offensive, and someone gets offended. Then the opposite is true, where you could say an offensive word with the intent and tone for it not to be offensive and therefore should not be deemed offensive. But the issue is that offense is subjective and people are babies
Yeah exactly
 
There's a difference between offensive and hurt. Offensive is more objective than hurt. Being hurt is purely subjective.
 
I disagree, I think they're used almost interchangeably
You can't say X, that's offensive
 
@Wietlol ...
 
12:53 PM
lol
 
...
 
what if there is an object ?
randomListOfSubscriptions.stream()
   .map(Subscriptions::getOwner)
   .filter(::isMemberOf( something ))
 
Offensive Language is more clearly defined than the state of being hurt and/or what actions lead to it. Your wife can get hurt if you friendly suggest that she should to more sports/eat more healthy etc. But that is not offensive (language).
*do more sports
 
Yeah see, I think you're using it properly where most people don't
 
@KarelG object?
like "L" ?
 
12:55 PM
that is an object
instance of class
 
.filter(::startsWith:("L"))
 
isMemberOf can be ambigu
 
Let's say on the other hand that you made a joke to your wife that you think her friend should do more sports/eat more healthy. She would get offended, not hurt
 
::isMemberOf
is inferred as
T::isMemberOf
 
how could she be offended ?
 
12:57 PM
The definition of being offended is this:
> resentful or annoyed, typically as a result of a perceived insult.
so the key there is perceived
Which is subjective
 
Because you "attacked" here friend. And to attack literally is the translation of the latin 'offendere' which is the root for offensive.
*her friend
 
and offensive is:
> causing someone to feel deeply hurt, upset, or angry.
so really being hurt and offended are one in the same
 
everything can be considered offensive
 
I make the things simpler
 
exactly
That's my point
 
12:59 PM
here "That's my point"
 
" I just vouch my opinion. For others' being offended: I do not care"
 
Not really. You can be offensive without someone being hurt. If I insulted the highly enlightened Dalai Lama he sure wouldn't get hurt.
 
Offense is subjective and dependent on the perceived insult
 
I consider that offensive because it isnt ball's point, it is a point I made, not ball
 
Nah you're just re-emphasizing my already thought out point
 
12:59 PM
And crybabies can get hurt, without you being offensive. E.g. you forget their birthday.
 
@ballBreaker and now you are being offensive in that you assume I dont know stuff
 
00:00 - 13:0013:00 - 23:00

« first day (2897 days earlier)      last day (2056 days later) »