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 7853869
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T19:50:10+00:00 2026-06-02T19:50:10+00:00

I’m generating test/seed data for a project using Autopoco. Each meeting abject gets assigned

  • 0

I’m generating test/seed data for a project using Autopoco.

Each meeting abject gets assigned a random date over a years time span(DefaultRandomDateSource), and i also want the meeting object to be assigned a random title from a predefined list(MeetingTitleSource).

The problem i’m getting is that the meeting title are not being applied in a random time order. Ie: the first two weeks are all “Perfromance Meeting”, then the next two weeks are all “Design Meeting” etc etc. I want the meeting titles to be assigned totally at random.

Can anyone help?

Here’s my code that creates the seed data

//Configure the default properties
        var meetings = AutoPocoContainer.Configure(x =>
        {
            x.Conventions(c => { c.UseDefaultConventions(); });
            x.Include<Meeting>()

                .Setup(c => c.StartDate).Use<DefaultRandomDateSource>
                (DateTime.Parse("21/Mar/2013"),
                 DateTime.Parse("21/Mar/2012"))
                .Setup(c => c.EndDate).Use<MeetingEndDateSource>(0, 8)
                .Setup(c => c.Title).Use<MeetingTitleSource>()

        });

        _meetings = meetings.CreateSession().List<Meeting>(MeetingRecords).Get();

Here’s the defaultdate source

 public class DefaultRandomDateSource : DatasourceBase<DateTime>
{
    private DateTime _MaxDate { get; set; }
    private DateTime _MinDate { get; set; }
    private Random _random = new Random(1337);



    public DefaultRandomDateSource(DateTime MaxDate, DateTime MinDate)
    {
        _MaxDate = MaxDate;
        _MinDate = MinDate;
    }

    public override DateTime Next(IGenerationContext context)
    {
        var tspan = _MaxDate - _MinDate;

        var rndSpan = new TimeSpan(0, _random.Next(0, (int)tspan.TotalMinutes), 0);


        return _MinDate + rndSpan;
    }
}

Here’s the MeetingTitle Source

    public class MeetingTitleSource : DatasourceBase<string>
{
    private Random mRandom = new Random(1337);

    public override string Next(IGenerationContext context)
    {

        return MeetingNames[mRandom.Next(0, MeetingNames.Length)];
    }

    private static string[] MeetingNames = new String[]{
        "Design meeting",   
        "Strategy Meeting", 
        "Performance review",   
        "Appraisal",
        "Disciplinary",
        "Project review",
        "Client Meetings",
        "Budget Meeting",
        "Financial Update",
        "CompStat",
        "Project Update"                     
    };
}
  • 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-06-02T19:50:12+00:00Added an answer on June 2, 2026 at 7:50 pm

    You are using the same seed so the same sequence of values will be generated every time.

    The nanosecond value from the system clock is often used as seed, you might want to try that.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I want to construct a data frame in an Rcpp function, but when I

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.