« first day (2242 days earlier)      last day (2701 days later) » 

3:47 AM
goodmorning java!
 
 
3 hours later…
7:06 AM
mooorrrrn
 
7:42 AM
 
7:59 AM
Has anyone seen LA LA LAND ?
Y yu no link
 
8:31 AM
Morn
 
morn rahul
cat
 
hans i have question
 Iterator<ProductInfo> iterator = list.iterator();
            while (iterator.hasNext()) {
                ProductInfo next = iterator.next();
                if (next.isSelected()) {
                    daoSession.getProductInfoDao().delete(next);
                    iterator.remove();
                    Message.obtain(mHandler, 0, adapter).sendToTarget();
                }
            }
how can i write this into java 8
@ItachiUchiha
 
idk
im not very familiar with j8
 
ok np
 
Heyyyy, anyone familiar with the internals of JAVA?
and I just found out, holy shit, Java is C underneath. OMG. i figured
 
8:40 AM
:34544891list -> stream and then filter and then forEach
 
i want to perform some operation and want to remove element from list
that throwing concurrentmodificationexception
 
Oh, I see
You need to use removeIf()
A method on the Java 8 collection
 
ok
 
 
1 hour later…
10:00 AM
@Rahul did it work?
 
for remove it's working i'm just not getting how can i daoSession.getProductInfoDao().delete(next); this
before romve it
 
@Rahul You don't have to ;)
What are you trying to do here? can you explain?
 
i want to delete that element from database also
and remove from list
 
moring
+n
 
Oh, I see and you want to do it in one single statement?
 
10:05 AM
yes
 
difficult in one statement
 
 list.removeIf(productInfo -> {
                daoSession.getProductInfoDao().delete(productInfo);
                return productInfo.isSelected();
            });
let me try this way
 
No, this will delete everything from the db
 list.removeIf(productInfo -> {
            if (productInfo.isSelected()) {
                daoSession.getProductInfoDao().delete(productInfo);
                return true;
            }
            return false;
        });
@Rahul try this ^^
 
ok thanks
 
one last user said this to me: if in a thread you get a lock on an object and wait() on this very same object, you get an automatic, surefire deadlock
he's gone now but can someone verify it's a correct statement?
 
10:20 AM
@ItachiUchiha yeah that work now no while loop and iterator . thank you
 
@TheCoder it sounds like a deadlock situation to me
 
but isn't that the way threading works - if i want to call wait on an object, i must hold the lock?
i enter a synch'd block, i check a condition, if false, I wait(), if true, I continue
 
quick question, I got the following stream:
long personek = ekTours.values().stream().filter(l -> l.stream().anyMatch(s -> !s.equals("HEH"))).count();

I am not sure if I am getting what I want :D
it's a map<String, List<String> and I want the counter to go up if at least one item in that List is not equal to "HEH"
so as a result I want the number of keys where their values list contains at least one item that is not equal to "HEH"
i answered myself... it seems to be what i want :D
tried it by looping myself over it
 
 
1 hour later…
11:37 AM
Good morning Java
 
12:07 PM
Morning
 
Goddag
 
@TheCoder I don't think it would result into a deadlock. When thread calls wait it releases the object lock and than goes into waiting state.
 
I might be missunderstanding sth in java8 streams filter method
when i got a stream and use the filter method for lets say for values that are bigger than 5
will it return all values that are bigger than 5?
because here stackoverflow.com/questions/23696317/… in the excepted answer one says that it is "lazy"
but isn't the reason why it is lazy the findFirst method?
 
12:26 PM
morning
 
hi
ah forget my question i'm actually standing on soe sort of a brainpipe :D
 
1:12 PM
!!meow
 
1:31 PM
@Hans1984 Have you tried turning your cat off and on again?
2
 
oh nice :o
no i havent
@wonderb0lt
 
1:46 PM
:)
 
1:56 PM
anyone here willing to answer a question on wait(), notify()?
 
Morning, Java!
 
Morning Michael
 
Hey @Hans
 
2:46 PM
/8ball oaak?
nooopee
 
3:26 PM
bye
leaving
 

« first day (2242 days earlier)      last day (2701 days later) »