Archive for January, 2016

Cron expression

5 dakida bir çalışan job için

0 0/5 * * * *

her gün gece yarisi calissin

0 0 0 * * ? *

Advertisements

Leave a comment

iki liste kesişim, fark ve eklenen

 

List<Long> previous=new ArrayList<Long>();
List<Long> current=new ArrayList<Long>();

List<Long> addList=new ArrayList<Long>();
List<Long> removeList=new ArrayList<Long>();
List<Long> updateList=new ArrayList<Long>();

previous.add(1L);
previous.add(2L);
previous.add(3L);

current.add(1L);
current.add(2L);
current.add(4L);

for(Long number:previous){
if(current.contains(number)){
updateList.add(number);
}
else{
removeList.add(number);
}
current.remove(number);

}
addList.addAll(current);

System.out.println(“update:”+updateList);
System.out.println(“remove:”+removeList);
System.out.println(“insert:”+addList);

, , , ,

Leave a comment