« first day (3254 days earlier)      last day (1686 days later) » 

12:00 AM
panic: kernel trap (ignored) (source)
 
 
2 hours later…
1:46 AM
dreams of electric sheep
 
 
4 hours later…
6:12 AM
TERRICFI
 
@OakBot Which answers this old question. Someone tell Philip
 
@wonderb0lt Type /help to see all my commands.
 
^ no halp för u fam
 
I DO NOT WANT A CASHMERE PULLOVER YOUTUBE MUSIC PLEAAAAAAAAAAAAASE!
Good morning.
 
Good morning.
 
7:03 AM
Morning.
 
Morning.
 
hello guys just wondering, if im going to use public dependencies to prod is it ok ? am I going to pay sumthing ?
like apache POI am I required to pay ?
 
The licenses will tell you what you can do with it.
E.g. go to the Maven repository: mvnrepository.com/artifact/org.apache.poi/poi
It says, "Apache 2.0"
Then Google Apache 2.0
 
Ahhh ok makes sense
Thanks @Druckles
 
or go to one of the builds and scroll down, it's also listed there usually
Then click the license: apache.org/licenses/LICENSE-2.0.txt
Then go make a cup of coffee/tea/hot chocolate.
Then read the license.
 
7:11 AM
ahh ok Thanks man
 
7:47 AM
The fastest way to get a Girl's heart is through her ribcage.
 
To quote Stephen King, "The secret to good writing is to have the heart of a child. I keep one in a jar on my desk."
 
8:16 AM
To clarify, a synchronized block on an instance means any thread other than the first which attempts to call it for any reason will get blocked until the first thread leaves the synchronized block, right?
I ask because I don't want a thousand requests to be queued up to reload the cache because it wasn't able to load the data the first time
In that case, they would enter a synchronized block one at a time, see that the data exists, then exit without again reloading the entire cache after the first successful reload
 
I think so yeah. When on thread runs something synchronized, other threads have to wait until the synchronized block is "not used" anymore and then the next thread can have it. But especially with me saying stuff you should take it with a grain of salt :)
 
Ok, so logically I would have to perform a check inside the synchronized block
because it's perfectly possible, even likely that a thread running that code in such a circumstance will have had to wait for another thread to finish first
Inner check and an outer check
 
@Neil sounds like you want to have a read-write lock
concurrent reading is fine, writing needs to lock the reading
 
8:31 AM
@Wietlol The actual writing of the cache isn't the issue
the loading from the database is expensive
but I have to consider the possibility that the initial loading from the database fails
perhaps due to some external issue
so I need to load the cache when a request comes my way
But lots of requests come my way, so I can't simply perform a load each and every time
 
if the initial loading fails... do you want to retry only after it is known it failed? or do you want to try several times until one succeeded?
 
8:45 AM
the code will actually look almost identical
hmm... funny
@kotlin.internal.InlineOnly
public inline fun <T> Lock.withLock(action: () -> T): T {
    lock()
    try {
        return action()
    } finally {
        unlock()
    }
}
fun <R> Lock.use(block: Lock.() -> R): R
{
	lock()
	try
	{
		return block()
	}
	finally
	{
		unlock()
	}
}
first is kotlin sdk... second is mine
guess which function gets deleted today
 
One could say that I might not be working on what I should be working on
 
FAKE
almost added "news" at the end >.>
 
@Wietlol It is a crucial system, so it must continue to try until it succeeds
 
/semi-trumpificiation
 
It's not fake!
 
8:56 AM
I guess I could just launch a timer which periodically retries
 
My script is just fast
 
and cancels itself on success
 
@Neil in that case, take a look at the paste and the second example
you might want to find a way how to "cancel" the other operations tho
in the else { cache = data; data } block, you have to cancel all other running tasks
and you catch those cancels and recover using the cache
keep in mind, you have to cancel after setting the cache
 
I also have to consider what I should do should loading of the cache fails and it already has cache available
 
if loading of cache fails, if cache is available, use the cache
however, if your cancellation works, you include that
 
9:13 AM
I meant, I have to decide if that's an error or not
it's tricky
Cache can be forcibly reset, so if you made an update and want to force it to load, by using the old, it would seem to imply everything went as expected
 
if you load cache 3 times concurrently and one finishes, the other two must use that one, no?
and cancel their own processing
a reset would simply clear the cache
in that case, a lateinit var would be replaced with a nullable var
 
uh no
 
no?
 
there's no competition here. If there are three requests and cache is being loaded, the other two hold, they don't load
or at least that's how it should be. We get roughly 10 requests per second at our peak
What's being loaded is substantial. Optimized, it is still taking somewhere between 3-6 seconds
Ideally it gets loaded at startup, but that's no guarantee and even if it did load, if cache is emptied, it needs to retry next available chance
 
so, you dont want to concurrently attempt a load?
in that case, use the first example
 
9:35 AM
again, if you want to invalidate the cache, a nullable property should be used instead of a lateinit property
 
lmao
I wrote JavaScript to cheat on the speedtyping multiplayer and they just set my wpm to 24 instead of 120 :D
72 keystrokes for 72 correct words. Just too good for this game!
 
I used a Java program to read the text from screen and use a robot to type the characters
iirc... I crashed the website
I typed the entire document in 0.2s
I forgot to add a delay between each keystroke
 
heh I don't believe that
 
I think the closest that I could get was like 7k wpm
 
you could have sent key strokes to the OS instead
 
9:41 AM
Yeah, I just read the word which fortunately is highlighted with a unique css class, send an input event to the only input field there is and loop that. I put a 500ms delay in there for good measure.
 
without breaking it
I ended up with approx 10 ms delay between keystrokes
 
LMAO
I set it to 100ms and I scored 113 wpm
7 seconds for 66 words :D
That just looks way to retarded!
 
10 words per second?
how cute :D
although... you appear to have some inconsistency there
7 seconds should be 70 words exactly
 
Not me; the website.
 
no?
 
9:49 AM
Also: No my name is not James; it's just a name I use for stuff when I don't know a better name or don't want to disclose mine.
 
 
déjà vu?
 
10:14 AM
@Neil this aint reddit. Don't repost from our lovely cat lady .
 
geez such animosity
 
10:27 AM
cat lady?
 
10:51 AM
crap. I work with java 8 and I need an API function that got introduced in java 9 ...
 
11:13 AM
which?
 
/javadoc CompletableFuture#orTimeout
 
@KarelG Sorry, I can't find that method. :(
 
11:39 AM
that is sad
 
posted on September 20, 2019

archive - contact - sexy exciting merchandise - search - about ← previousSeptember 20th, 2019nextSeptember 20th, 2019: As a Generic Guy #7, I find I cannot agree with any of this!!– Ryan

 
@Neil /marked as duplicate
 
11:52 AM
anyone uses TeamCity?
 
Multiplayer SimCity?
 
During high-comfort social interactions, our feet and legs will mirror those of the person with whom we are talking (also known as isopraxism). (source)
 
12:30 PM
Hello you beautiful people
 
12:47 PM
Hi, all.

Could anyone point me in the right direction?
Im trying to get a file as input stream from a folder inside the project using getClass().getResourceAsStream("ThatDamnFile") but am unable to. When I try creating a file using new File("Test") and then printing it's path, it's in the eclipse directory and not in the project directory. From all the questions/answers I've found here, getClass().getResourceAsStream("ThatDamnFile") should get me that file if it is in the same path as the class from which this code is called, right? Any ideas?
 
@Joker21srb 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.
 
@Joker21srb Often I evaluate getClass().getResource("/"), in a debugger, and that usually gives me a pretty good idea of what path I should use for "ThatDamnFile".
 
hmm... setRemoveOnCancelPolicy(true) does not do any batshit ?
I cancel a job and guess what: it does execute the job. That method should prevent it as written in the docs
 
@PiRocks hmm... Thanks, that does get me somewhere.
When trying:
final String dir = System.getProperty("user.dir");
System.out.println("current dir = " + dir); it prints "C:/eclipse/eclipse/

Then getClass().getResource("/"); gets me to file:/C:/dev/project/_tomcat_8/wtpwebapps/project/WEB-INF/classes/
From which I might work my way in the right direction
@PiRocks Yeah, that did it ^^ Thanks!
 
@Joker21srb Glad I was helpful.
 
1:23 PM
I'm supposed to call my vet to setup an appointment for tomorrow to bring my cat
it's a checkup, so not really even for a major issue. It stresses out the cat, and I really don't want to get up early saturday in order to do that, so I'm putting off the call as long as possible :)
 
1:45 PM
Happy Friday, Jaba!
@Neil FYI there's a formatting bug on your SO profile.
 
Zoe
Happy Friday, @mi!
 
@Michael bleh, it looks right before I save it then it always does that
There that should fix it
I think that happens when I copy the same profile to all my other profiles
 
Weird
 
Zoe
Maybe you should use code fences instead
 
@Zoe So we're down to two letters now? xD
 
Zoe
1:54 PM
dammit xd
 
@xdamian does not approve ಠ_ಠ
 
 
1 hour later…
3:16 PM
hi
 
Zoe
o/
 
\o
 
i need some suggestion on encode the json string in java...like ({"test":"3081471031286775"}) ..i tried many things like apache escape methods and jettison most are not working
its kind of deprecated
can i get some suggestion
 
Zoe
Use a JSON parser.
 
3:31 PM
oh
but its always displays an syntax error without /
 
Zoe
oh
You need to add a backslash before the quotes (\")
 
is it to add manually ?
i want to do it code way..any options ?
 
Zoe
If you're defining the JSON in Java code, you need it to make sure it's not parsed as a part of the code.
String json = "{\"test\": ...}";
 
hey zoe
 
Zoe
It's converted to " (without the backslash) if you print it
Hm?
 
3:35 PM
  String test = {"test":"3081471031286775"} this is the direct json string i have
 
Zoe
yeah, that's not valid
 
correct ..is there anyway its acceptable in java using code
any methods will do ?
 
Zoe
Java also doesn't have support for raw JSON objects.
 
any libraries can do ?
 
Zoe
Nope. Syntax limitation. You can use raw strings, but a lot of the initialization if you were to use i.e. a map is ugly.
 
3:37 PM
oh ok..
 
Zoe
... unless something changed in newer versions of Java. I haven't paid attention since Java 10
 
thanks Zoe
if i find something sure let u know
 
Zoe
Np ^^ But like I said, you can still use parsers to handle strings, but that requires String test = "{\"test\": \"<number>\"}";, along with a library to parse it
 
actually few elements value i need to replace at run time
it will be so hard to do if i am using parser
 
Zoe
Not really.
Most parser libraries also come with a wrapper class, which you usually can modify
 
3:41 PM
oh ok then i will do some study
 
Zoe
Off the top of my head, you can look into Jackson and Gson. They work differently though. There's more, but I'm not familiar with that many. But you got lots to pick from
 
 
1 hour later…
5:02 PM
yeah thanks Zoe
actually i am very well confident the Gson is not going to accept the way i wanted for taking the raw json code..
i tried an simple concatenation in existing escaped json and it got worked
jackson i will try once
@Brandin what about netbeans swing gui builder ?
 
5:23 PM
cant you just make a model class?
 
 
2 hours later…
7:23 PM
 

« first day (3254 days earlier)      last day (1686 days later) »