Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4039830
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T12:40:10+00:00 2026-05-20T12:40:10+00:00

I am working on a calculation project with lots of scientific, domain specific knowledge.

  • 0

I am working on a calculation project with lots of scientific, domain specific knowledge. As such, our client has given us CSV files populated with inputs and outputs. We can write unit tests by carefully copying over all this data to the setups and the asserts but we would like to avoid this as it is pure grunt work and missing a single decimal could invalidate our tests.

I have made a quick prototype that takes a simple CSV file and tun it into an input and output object using Common.BeanUtils.populate (works like a dream) and some brute force parsing. My file looks like such:

Inputs | AtomicNumber | AtomicWeight | IsIsotope | RateOfDecay |
       | ###          | ###          | 1         | 0           |

Output | WillItBlend  |
       | 1            |

And this has worked so far. My problem is now I’ve come to a class that has collections and a file that looks like this:

Inputs | MoleculeId | StateAtRoomTemp | IsPosionous | IsShiny |
       | ###        | L               | 1           | 1       |

Inputs | AtomicNumber | AtomicWeight | IsIsotope | RateOfDecay |
       | ###          | ###          | 1         | 0           |
       | ###          | ###          | 1         | 0           |
       | ###          | ###          | 1         | 0           |

Output | WillItBlend  |
       | 1            |

where each molecule has a number of elements. What (if any) elegant solutions exist to easily make a molecule bean with a list of elements?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T12:40:11+00:00Added an answer on May 20, 2026 at 12:40 pm

    I have come up with a possible but not perfect solution. I could change the format from:

    Inputs | AtomicNumber | AtomicWeight | IsIsotope | RateOfDecay |
           | ###          | ###          | 1         | 0           |
           | ###          | ###          | 1         | 0           |
           | ###          | ###          | 1         | 0           |
    

    to:

    *Elements | AtomicNumber | AtomicWeight | IsIsotope | RateOfDecay |
              | ###          | ###          | 1         | 0           |
              | ###          | ###          | 1         | 0           |
              | ###          | ###          | 1         | 0           |
    

    When I hit that *, I use the PopulateUtils with the property name that follows to get the type. I then create a new bean of that type, populate it like I populated the normal inputs and then put that new object or collection of objects into the previously created bean. I am not proud of this solution so I will not accept this until it is clear that it wont get better.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need an alternative to Java, because I am working on a genetics-calculation project.
I'm working on a hobby project involving a rather CPU-intensive calculation. The problem is
A project I'm working on requires detection of duplicate files. Under normal circumstances I
I am currently working on a project that will store specific financial information about
I'm working with an application right now for our project in school. My application
I am working on a quite big project: The program has to do multiple
I have a Asp.net project with complex calculation in database. for example: i need
The project I am working on generates a series of tabs for each item
I am working on a project where I need to calculate some numbers in
I'm working on a project for visually tracking trains. I've refactored the object relationship

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.