« first day (3152 days earlier)      last day (2013 days later) » 

00:00
It is not well to be thought of as one who meekly submits to insolence and intimidation. (source)
 
2 hours later…
02:25
@Wietlol I must say thanks to you.
 
1 hour later…
03:49
hi guys, how's going on?
 
2 hours later…
05:43
good morning
Good morning.
@OakBot how are you kid ????
@Simmant Type /help to see all my commands.
06:38
Lolxxxxxx
06:53
@萝莉w omg, someone thanked the notorious Wietlol?
What bad thing did he do?
@nyconing Mew mew.
I plead the fifth
I refuse to answer the question because I might incriminate myself.
Emmmm...
07:01
Also because I don't talk badly about people on the internet.
Besides, I like ambiguity.
Additionally, I was using the other definition for "notorious"
That's the "publicly or generally known, as for a particular trait" definition. (from dictionary.com)
 
1 hour later…
08:29
Hey Java people. The java.io.Reader class implements an interface called .ready() for its subclasses.
If one does not use .ready(), will it cause errors if the resource/stream is not ready?
I mean I am looking for an example where if(reader.ready()) {} would prevent the program of throwing an exception
08:48
I mean if I would read from a file:
int data = inputStreamReader.read();
If it's not ready data is going to be -1. May not cause an error but if we are testing something it may cause errors if we don't do it like this: while(inputStreamReader.ready()){ ...read from resource}
09:16
I mean if you don't use for instance .ready() or .available() on InputStream class, there is no guarantee it wont fail because u can check same thing in other ways right?
09:56
@sockevalley you don't have to use .ready()
most don't
If you attempt to read from a reader which isn't .ready(), it only means the thread will block and wait until it is ready
which might be useful if, say, you expressly wanted to do some activity while you're waiting for new data to process
@sockevalley reading can still fail of course, but they're not related
@Neil Yes, I reasoned the same answer myself. Most people tend not to use available() or ready(). I was considering possible resource optimism errors and I have concluded that neither asserts to that.
depends on the operating system
but windows will let as many processes as you like read a resource, unless someone opens with intent to write (Writer for example)
at which point existing readers read the old file still, and new readers simply block until the writer has finished
it's tricky to optimize such things
most just don't try :P
Hehe, I see :P
If I am correctly, most of the time when programs fail, it is because the resource does not exist.
In those cases file.exists() or Files.exists() can be used to mitigate that issue.
10:12
Well yes and no
it is possible to check if a file exists, and then immediately attempt to open it and have it fail because the file doesn't exist
lets just say that should be a fairly rare situation
you should still prepare for that possibility
Precisely, always good to check either way.
yep
11:09
@JennaSloan So that's it. I see now.
11:41
posted on June 10, 2019

archive - contact - sexy exciting merchandise - search - about ← previousJune 10th, 2019nextJune 10th, 2019: This comic was written while I was drenched from being in the rain! Inspiration is all around you when you're drenched from being in the rain!!– Ryan

12:00
The first Olympics after the 9/11 terrorist attacks were held in Salt Lake City, UT, in 2002. Security costs shot up to over $500 million, almost five times the cost of security the last time the U.S. hosted an Olympics in 1996, at the much larger Summer Games in Atlanta. (source)
12:33
XD XD
Zoe
Zoe
13:16
1 message moved to Trash can
I have question regarding lazySingleton
Zoe
Zoe
Please use a paste site for long code snippets and stacktraces.
When the class is loaded does static method not gets called ?
and if gets called, then it will check if instance is null or not, if not it will create new instance...
Zoe
Zoe
only static blocks are called when the class is loaded
static methods ?
Zoe
Zoe
13:19
I.e. static { fooBar(); } top-level in the class
@ShivendraGupta The static method is called when the static method is called, not before
Zoe
Zoe
Not methods, blocks
yeah, I think you're thinking of static blocks
so in case of eager instantiation why do we say instance is created without invoking method which is creating the instance , at the time of class load ?
why getSingleton will be called at time of class load?
Zoe
Zoe
@ShivendraGupta It doesn't.
13:22
so why we say in eager instantiation an instance is always created wether we invoke getSingleton or not ?
Zoe
Zoe
Because top-level variables are initialized for their scope if the initialization is direct regardless of methods
i got it, thanks
@ShivendraGupta eager initiation for a singleton, if you want to call it that, I'd assume would mean you instantiate a static instance immediately rather than wait for getInstance() to be called
generally you want to avoid singletons though
As per as my understanding private static SingletonEager singleton = new SingletonEager(); is creating instance at time of class load
while on the other hand static mehthod doesn't get invoked automatically..
Zoe
Zoe
Yeah, but there's just one class load.
13:25
yes understood now :)
use spring DI, not singletons :P
Zoe
Zoe
Or use a better design pattern
Hey all. I'm facing a weird issue since migrating my app to Spring Boot 2.1.4
Hibernate Lazy Loading doesn't work. It throws a generic LazyInitializationException
I went through all the links on the web, and SO, but I don't think any of it helps
For e.g. I can't rewrite the methods into queries as mentioned in vladmihalcea.com/… as I'm using Repository based methods.
Due to me not explicitly using EntityManager bean in my code, I can't use the @PersistenceContext either
Other solutions are not recommended on SO answers as they are supposedly Anti-Patterns
Can anybody help?
13:40
@DarshitPatel hmm, the first thing I would check is how spring would be impacting your hibernate entities
don't give spring wildcards because they'll use them
How do I check it?
check your spring configuration file
you should define the class or package to use, but no wildcards
also consider that spring can look into subpackages
Ok, we moved from auto config to Java config during this migration
so see where spring is being used, and see if that somehow relates to where your hibernate entities are
@DarshitPatel gotta check all the differences :P
Haha yeah :)
13:43
which is a good reason to take tiny bite-sized changes in your project
Yeah I wish it were done so
14:05
Hi, there is any moderator to solve a about about a duplicated question (java)?
no mod, but if you want my opinion, you know where I am ;)
26
Q: Capture and log the response body

JonyI have a servlet that handle certain HTTP requests and responses. I want to log the response body before sending back to the client. Is there any way that I can capture the response body before it is send as a HttpServletResponse object from the servlet?

The oldest question has been marked as duplicated! I answered it along time ago and enter recently because has positive votes. Is not clear to me why the oldest question was relegated to favor of a newest one...
an opinion needed: I know many ways to read a SQL row, map to Java object, and get a Json string from it but what would be the fastest/most efficient way to do it?
I use Jackson but are there others out there
14:21
Thanks for your help, but my doubt is the status of the question that was marked as duplicated and I think that is not right.
I think that an user with java badged could check it and solve the situation.
14:35
Why on earth would a indirect testing detector classify following methods:
main
testModeAccept
testModeReject
testModeAcceptIgnoreCase
testModeRejectIgnoreCase
testModeAcceptAndNonPathFilter
testModeAcceptAndPathFilter
as smelly?
https://github.com/apache/nutch/blob/branch-1.4/src/plugin/urlfilter-suffix/src/test/org/apache/nutch/urlfilter/suffix/TestSuffixURLFilter.java

Very confusing.
Salamon Aleykum
Va rahmatullah
15:24
ok
Zoe
Zoe
@pdorgambide Duplication is by quality, not age
For most newer questions, that means they get closed as dupes of older questions. Those that slip past and actually become better than the older one tend to become the dupe target rather than be closed.
Why it wasn't closed when it was posted is an entirely separate question, but the site doesn't have a specifically good close rate atm, or, well, ever.
16:14
@Mahdi-Malv wasalaam :)
16:26
thanks @zoe! At my point the older question has clear answers and the younger need mor merits to promote over the first one. But I am not an expert and is only one opinion. I would like very apreciate for your answer, thanks
Zoe
Zoe
16:54
67
A: Disallow languages other than English in chat

Shog9As previously discussed, we cannot effectively moderate non-English chatrooms. If concerns are raised over the appropriateness of a room's conversation, then either the conversation or the entire room is subject to deletion. If you're seeing flags like this raised, re-flag with a mod-only flag ...

17:22
@Zoe I agree with Madara. Moderators can't moderate if they don't know the language being spoken. :P
Zoe
Zoe
Yeah
17:38
Oh, that question was posted 5 years ago. xD
Zoe
Zoe
Yeah, while Android Era was an actual thing
hi friends
in a java based enterprise application like some ecommerce, health, banking application. What primary key generator strategy do the developers use?
Zoe
Zoe
Numbers x_x
19:21
I sugest UUID generators, I dont use autoincrement numbers in our projects since 6 years ago.
 
1 hour later…
20:33
auto increment numbers for database primary keys is probably a must (for bigger tables)
we use that + a uuid as public identifier

« first day (3152 days earlier)      last day (2013 days later) »