• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Create a date list with "change of conditions"

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys!
I've a complex (maybe) problem with my java application. Pratically, I've a date list (days of month) from a query and a date list (CoC) with a random number of dates.
I'm developing a java application to scan the days of month and write in output all the days of month and the relative date of other list when it changes.
I know, I'm uncleary but I've writed a simple code to make it clear to you. (I'm using JodaTime libs)

This is my (wrong) code:



This is the result:



This is my expected result:



Thanks so much!!
 
Saloon Keeper
Posts: 10879
87
Eclipse IDE Firefox Browser MySQL Database VI Editor Java Windows ChatGPT
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
On line 39 you are using count_coc to get dtJs element. You need an independent index into dtJs.
 
Roberto Tucci
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Carey Brown wrote:On line 39 you are using count_coc to get dtJs element. You need an independent index into dtJs.



Thanks man for reply!
Yes, you're right...Anyway, there is something wrong in the logic of my code. I'm trying other solutions but it's very complex case...I'm losing all hopes...
 
Marshal
Posts: 79655
381
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Roberto Tucci wrote: . . . but it's very complex case. . .

I suspect it isn't. I suspect you have not worked out what the conditions are and not written them down simply and clearly in ordinary English/French/Welsh/Whatever.
 
Been there. Done that. Went back for more. But this time, I took this tiny ad with me:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic