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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T02:23:45+00:00 2026-05-20T02:23:45+00:00

I have approximately 100 tips that I need to display randomly on a site,

  • 0

I have approximately 100 tips that I need to display randomly on a site, different tip each day, and there is no access to a database. I have thought about putting the tips into array groups and associating each group with a day of the month, but that would not make the tips show up randomly. What is a relatively painless way to accomplish this task?

  • 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-20T02:23:45+00:00Added an answer on May 20, 2026 at 2:23 am

    Since you want to display only one tip a day, and you can’t store any state, you can do the following:

    1. Sort the tips using some deterministic method.
    2. Seed a random number generator with today’s date.
    3. Display the ith tip where i = random.Next(numTips)
    4. Repeat this whole process (including reseeding the random number generator) each time.

    If you also want to ensure each tip is displayed at least once before a tip is repeated:

    1. Seed a random number generator with a constant value (not the current time, this is important).
    2. Shuffle the elements with Fisher-Yates, using the not-so-random number generator you created. Or use LINQ:

      tips.OrderBy(x => random.Next()).ToArray();
      
    3. Display the ith tip mod tips.Length where i is the number of days since Epoch.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have 16 1D arrays with approximately 10-11 million double-precision elements each. I need
I have approximately 100 SQL views that are a variation of this: select *
Consider that I have 100 instances of a squeaker class. Each squeaker object is
I have the following query: SELECT MAX([LastModifiedTime]) FROM Workflow There are approximately 400M rows
What are the advantages of NumPy over regular Python lists? I have approximately 100
I have a set of approximately 1.1 million unique IDs and I need to
i am building a solution with approximately 100 assemblies that is taking a considerable
I have a dataset of approximately 100,000 (X, Y) pairs representing points in 2D
I have two matrices (of approximately 300 x 100) and I would like to
I have a program which needs to hold approximately 3000 open file descriptors in

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.