« first day (3414 days earlier)      last day (1521 days later) » 

12:00 AM
"I am your density." -- George McFly in "Back to the Future" (source)
 
 
4 hours later…
4:18 AM
dreams of electric sheep
 
 
3 hours later…
7:40 AM
@Zoe is back. Noice!
 
Zoe
8:06 AM
Yeah ^^"
 
 
2 hours later…
10:33 AM
morn
 
morn
 
oh doggo !
:o
 
@Hans1984 hey. Treat her with respect you disphit
😉
 
huh ?
we always call her doggo
I will let that one slide...
 
you missed that wink D:
😉
*😉 intensifies*
 
10:42 AM
😉
😉
😉
😉
😉
😉
😉
😉
😉
😉
😉
😉
😉
😉
/8ball
😉
 
@Hans1984 Cannot predict now
 
ok
 
that's an interesting response
 
11:24 AM
/cat
 
Is there any difference between adding jar libraries inside web-inf/lib or through maven?
 
@BuSaeed 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:36 PM
o/ @Zoe
 
 
1 hour later…
1:52 PM
\o
 
o/
 
@Feeds So that would indicate that people with children age 2-5 have less proximity to trucks in daily life
 
Zoe
@Hans1984 o/
 
2:24 PM
/cat
 
lol
first its love and then its fear
 
Reminds me of my ex, except I'm the balloon
 
:o
 
I popped by myself tho
I'm a self-aware balloon
My job is so stupid right now
 
2:34 PM
jobs are always stupid
work from home ftw
 
Our whole financial system with UI is hardcoded to allow the calculation and display of 5 choosable periods. Now my job is, to make that infinite (or at least more periods).
I'm at home
Not gonna leave home unnecessarily with Corona making its way
^ Anyway, the whole financial system is hardcoded for 5 periods. I guess I'm done with the hardest stuff now though, and it's just looping things to n where it used to be 5 calls from now on
I hope
 
@d0n.key smart
Im not applying for new jobs till this corona thing is over
I decided today
 
People are going to festivals and having carnival parties around here - no wonder CoV is getting spread so quickly
 
also I found that I still got 2 airmask with filters ready
will wear them from now on
I got my incom through jobs I do from home
so Im fine
sitting this out till its resolved
 
You shouldn't buy face masks, the people who really need them are medical personnel.
 
2:37 PM
Gonna go to the supermarket with a Bundeswehr Schutzmaske
 
I bought them 3 years ago @Michael
they are unused including filters
 
Ah
 
@Michael Also I'd assume that German medical personnel has that stuff already
 
I was preaparing for apocalyptic world war back then
just kidding ;)
 
We're not like Italy, who don't test people for CoV unless they have DIRECT links to China
 
2:39 PM
@d0n.key I read that some hospitals are having trouble getting them because people are buying too many.
 
yeah but these italien dummies are infecting us too
thats the problem
 
It's not as bad in Germany yet. No deaths, many cures - but still
 
its out of control already
goverment just isnt telling
 
@Michael Yeah I read something similar. But I don't think that's the case in Germany yet. People don't really seem to care as much right now
@Hans1984 Nah calm down
 
hides in bunker
 
2:40 PM
Also our health ministry already stated that an outbreak is inevitable, so - yes they are telling actually :D
 
hey can anybody here help me understand lambda expressions?
for example I have this uglly methody
 
what do you not understand about them?
 
@Hans1984 "Parts of this answer could unsettle the public"
 
they are linked to functional interfaces
 
@d0n.key yeah atleast its better then china
where they hid it till it was out of control
 
2:42 PM
and they are assigned as values
 
lied to the public , lied to the world
what a corrupt country
#BlameChina
 
Basically I have this function which is really quite ugly
public CompanyBuilderPage fillApplicationDetails() throws InterruptedException{
    if(driver.findElements(qualifyingLicenseNumberInput).size()>0){
        inputText(qualifyingLicenseNumberInput, qualifyingLicenseNumber);
        clickElement(continueApplication);
        Thread.sleep(2000);
        if(driver.findElements(qualifyingLicenseNumberInput).size()>0){ //are we still on the page
            clickElement(continueApplication);
            tries+=1;
            assertTrue(tries<3);
                //try again
would like to make it look more like this i think
 
I cant see how this is related to corona
at all
just kidding ;)
 
@SamuelWakeman more like what?
 
well im not actually sure what it would look like basically
 
2:48 PM
I dont really see how there is a question about lambdas tho
 
public lamdbdaFunction fillApplicationDetails = (){
inputText(qualifyingLicenseNumberInput, qualifyingLicenseNumber);
clickElement(continueApplication);

return this;
}

public interface lamdbdaFunction{
Page foo();
}

tryAgain(driver.findElements(qualifyingLicenseNumberInput).size()>0, function);
i awnt to pass this function as anepression to a try again function rather than recurively call this function
 
I think a retry algorithm should be a loop around the thing you want to retry
 
i mean that's esentally what I'm doing above
 
I mean something like this:
for (int attempt = 1; attempt <= tries; attempt++)
{
	try
	{
		return doTheThing();
	}
	catch (Exception ex)
	{
		// ignored
	}
}
catching exceptions is the most common thing, but you could also do some check on the result of doTheThing()
 
@Hans1984 lmao
 
3:03 PM
;)
 
@Wietlol You shouldn't flat out ignore the exception, of course.
 
ye, but even then
fun <T> attemptInvoke(times: Int, action: (Int) -> T, condition: (T) -> Boolean): T =
	(1..times)
		.asSequence()
		.map(action)
		.dropWhile { condition(it).not() }
		.firstOrNull()
		?: throw TooManyFailuresException("Failed to invoke the function $times times.")
this would be a general purpose retry function in kotlin
the function itself cant really handle the failing results
the condition function should handle them instead
 
3:35 PM
different quiest
different question
 
Anyone tell me why this regex is not finding the below file on my disk?

\d{8}_\d{6}.csv

20181110_091621.csv
 
because you are not looking in the correct folder?
 
This site says it matches but Java app doesn't regex101.com
Maybe I need to escape: \\d{8}_\\d{6}.csv
 
what does your string look like?
 
20181110_091621.csv
 
3:42 PM
no, your regex string
 
\d{8}_\d{6}.csv
 
and with the quotes?
 
Yes '\d{8}_\d{6}.csv'
 
that isnt even java
 
FileFilter fileFilter = new WildcardFileFilter("\d{8}_\d{6}.csv", INSENSITIVE);
 
3:44 PM
that is also not valid java
 
FileFilter fileFilter = new WildcardFileFilter("\\d{8}_\\d{6}.csv", INSENSITIVE);
 
that should work
are you sure it is used as regex and not a literal equals?
 
Yeah
Sure
It's odd
 
can someone tell me if im iimplementing lambdas correctly
here:
public CompanyBuilderPage fillApplicationDetails2(){
tryAgain(driver.findElements(qualifyingLicenseNumberInput).size()>0, 3, tryFillApplicationDetails);
return this;
}

public FunctionToTryAgain tryFillApplicationDetails = ()->{
inputText(qualifyingLicenseNumberInput, qualifyingLicenseNumber);
clickElement(continueApplication);
clickElement(continueApplication);
return this;
};
public void tryAgain(Boolean condition, int retries, FunctionToTryAgain function){
int counter =0;
while(!condition){
function.tryagain();
if (counter==retries){
break;
}
counter++;
}
}
@FunctionalInterface
public interface FunctionToTryAgain{
Page tryagain();
}
 
4:01 PM
@TheCoder The period character is a special character in regex. You have to escape it.
Also, WildcardFileFilter does not take regex by the looks of it.
> The wildcard matcher uses the characters '?' and '*' to represent a single or multiple wildcard characters. This is the same as often found on Dos/Unix command lines.
 
4:34 PM
@TheCoder Isn't '.' a regex operator?
@Michael Yep that one
 
\o
 
o/
 
sup
 
is there a convenient way to map out Optional from a stream?
list.stream()
  .map(myMethodThatReturnsAnOptional)
  .filter(optional::ispresent)
  .collect(...)
that's what I have atm
I forgot a map with opt:get
 
5:24 PM
228
Q: Using Java 8's Optional with Stream::flatMap

Yona AppletreeThe new Java 8 stream framework and friends make for some very concise java code, but I have come across a seemingly-simple situation that is tricky to do concisely. Consider a List<Thing> things and method Optional<Other> resolve(Thing thing). I want to map the Things to Optional<Other>s and ge...

 
5:40 PM
@SamuelWakeman you usually wouldnt store them in fields tho
but you can also just reference methods to be executed
public CompanyBuilderPage fillApplicationDetails2(){
	tryAgain(driver.findElements(qualifyingLicenseNumberInput).size()>0, 3, this::tryFillApplicationDetails);
	return this;
}

private Page tryFillApplicationDetails()
{
	inputText(qualifyingLicenseNumberInput, qualifyingLicenseNumber);
	clickElement(continueApplication);
	clickElement(continueApplication);
	return this;
}
also...
public void tryAgain(Boolean condition, int retries, FunctionToTryAgain function)
{
	int counter =0;
	while(!condition)
	{
		function.tryagain();
		if (counter==retries)
		{
			break;
		}
		counter++;
	}
}
keep in mind that in this function, your condition will always be the same
the condition will be evaluated once and that result will be used over and over again for your while check
only looking at this function, would condition ever change?
what you could do is make the condition a lambda too
it would supply you with the result each time you would invoke it
the result being a boolean
public void tryAgain(Supplier<Boolean> condition, int retries, FunctionToTryAgain function)
{
	int counter = 0;
	while (!condition.get())
	{
		function.tryagain();
		if (counter == retries)
		{
			break;
		}
		counter++;
	}
}
with a Supplier<Boolean>, you can pass that condition as instruction which gets evaluated each time you do the condition check because each time, you invoke the get method
 
6:27 PM
Hi, guys. Seems like you were talking about Corona and some code for Selenium Webdriver :)
 

« first day (3414 days earlier)      last day (1521 days later) »