« first day (4486 days earlier)      last day (449 days later) » 

12:00 AM
An inclined plane is a slope up. -- Willard Espy, "An Almanac of Words at Play" (source)
 
 
1 hour later…
1:19 AM
Why doesn't it work? 🤔
 
 
7 hours later…
8:16 AM
@SergeyZolotarev try doing fewer steps and verifying that the program is doing what you expect it to do
in this case, try printing the result of getName()
 
9:09 AM
@Wietlol could you be a bit more specific? I don't know how I can print f.getName(). It seems to be valid only in that lambda expression
This must work. I don't see how my expression is different (other than using a different functional interface)
 
9:26 AM
the expression is the same, just the input is different
 
Hooray, I made it work with this: `dir.list((f, s) -> s.endsWith("pdf"))`

So, the term "directory" doesn't cover files themselves, is that correct?
Or is it only the case with this particular functional interface (FilenameFilter)?
 
9:55 AM
it is only the case with that particular function list
see the documentation of that function
/javadoc java.io.File#list
2
 
> only if the value true results when the FilenameFilter.accept(File, String) method of the filter is invoked on this abstract pathname and the name of a file or directory in the directory that it denotes
 
Look, I printed Paths. As you can see, some of them do indeed end with "png". But both of those images are still there! How come?
 
how do you know they are still there?
also, I would avoid using endsWith on types other than string
 
10:11 AM
@Wietlol well, I can check my desktop
What do you call this monstrosity? He created an class instance and then overrode some of the class's implemented methods right there in the curly brackets. What is it called? I can't even google it
 
anonymous class
the funny thing is, it also works on interfaces
 
 
3 hours later…
1:10 PM
posted on February 03, 2023

archive - contact - sexy exciting merchandise - search - about ← previousFebruary 3rd, 2023nextFebruary 3rd, 2023: You know what? I figure maybe these pictures got a few more comics in 'em!!– Ryan

 
 
1 hour later…
2:25 PM
Why doesn't String implement Cloneable? Is there a good reason for Strings to not be eligible for cloning?
 

« first day (4486 days earlier)      last day (449 days later) »