• 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

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: 9275
78
Eclipse IDE Firefox Browser MySQL Database VI Editor Java Windows
  • 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: 75708
354
  • 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.
 
The moth suit and wings road is much more exciting than taxes. Or this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic