<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Programming &amp; Software Q&amp;A | CollectiveSolver - Recent questions and answers</title>
<link>https://collectivesolver.com/qa</link>
<description>Powered by Question2Answer</description>
<item>
<title>Answered: How to sort a list of files by name, extension, dates, and size in C</title>
<link>https://collectivesolver.com/97433/how-to-sort-a-list-of-files-by-name-extension-dates-and-size-in-c?show=97434#a97434</link>
<description>&lt;pre class=&quot;brush:cpp;&quot;&gt;#include &amp;lt;stdio.h&amp;gt;
#include &amp;lt;stdlib.h&amp;gt;
#include &amp;lt;string.h&amp;gt;

/* ------------------------------------------------------------ */
/* Date struct for proper date handling                         */
/* ------------------------------------------------------------ */
typedef struct {
    int year;
    int month;
    int day;
} Date;

/* ------------------------------------------------------------ */
/* File entry struct                                             */
/* ------------------------------------------------------------ */
typedef struct {
    char name[32];      /* file name without extension */
    char extension[8];  /* extension including dot */
    Date date;          /* real date struct */
    int size;           /* bytes */
} FileEntry;

/* ------------------------------------------------------------ */
/* Helper: print a date in YYYY-MM-DD format                     */
/* ------------------------------------------------------------ */
void formatDate(const Date* d, char* buffer, size_t bufferSize) {
    snprintf(buffer, bufferSize, &quot;%04d-%02d-%02d&quot;, d-&amp;gt;year, d-&amp;gt;month, d-&amp;gt;day);
}

/* ------------------------------------------------------------ */
/* Sort by name (lexicographically)                              */
/* ------------------------------------------------------------ */
int compareByName(const void* a, const void* b) {
    const FileEntry* fa = (const FileEntry*)a;
    const FileEntry* fb = (const FileEntry*)b;
    
    return strcmp(fa-&amp;gt;name, fb-&amp;gt;name);
}

void sortByName(FileEntry* files, size_t count) {
    qsort(files, count, sizeof(FileEntry), compareByName);
}

/* ------------------------------------------------------------ */
/* Sort by extension (lexicographically)                         */
/* ------------------------------------------------------------ */
int compareByExtension(const void* a, const void* b) {
    const FileEntry* fa = (const FileEntry*)a;
    const FileEntry* fb = (const FileEntry*)b;
    
    return strcmp(fa-&amp;gt;extension, fb-&amp;gt;extension);
}

void sortByExtension(FileEntry* files, size_t count) {
    qsort(files, count, sizeof(FileEntry), compareByExtension);
}

/* ------------------------------------------------------------ */
/* Sort by date (year → month → day)                             */
/* ------------------------------------------------------------ */
int compareByDate(const void* a, const void* b) {
    const FileEntry* fa = (const FileEntry*)a;
    const FileEntry* fb = (const FileEntry*)b;

    if (fa-&amp;gt;date.year != fb-&amp;gt;date.year)
        return (fa-&amp;gt;date.year &amp;lt; fb-&amp;gt;date.year) ? -1 : 1;
    if (fa-&amp;gt;date.month != fb-&amp;gt;date.month)
        return (fa-&amp;gt;date.month &amp;lt; fb-&amp;gt;date.month) ? -1 : 1;
    if (fa-&amp;gt;date.day != fb-&amp;gt;date.day)
        return (fa-&amp;gt;date.day &amp;lt; fb-&amp;gt;date.day) ? -1 : 1;
        
    return 0;
}

void sortByDate(FileEntry* files, size_t count) {
    qsort(files, count, sizeof(FileEntry), compareByDate);
}

/* ------------------------------------------------------------ */
/* Sort by size (ascending)                                      */
/* ------------------------------------------------------------ */
int compareBySize(const void* a, const void* b) {
    const FileEntry* fa = (const FileEntry*)a;
    const FileEntry* fb = (const FileEntry*)b;

    if (fa-&amp;gt;size &amp;lt; fb-&amp;gt;size) return -1;
    if (fa-&amp;gt;size &amp;gt; fb-&amp;gt;size) return 1;
    
    return 0;
}

void sortBySize(FileEntry* files, size_t count) {
    qsort(files, count, sizeof(FileEntry), compareBySize);
}

/* ------------------------------------------------------------ */
/* Helper: print file list                                       */
/* ------------------------------------------------------------ */
void printFiles(const FileEntry* files, size_t count) {
    char dateBuf[16];
    size_t i;
    for (i = 0; i &amp;lt; count; ++i) {
        formatDate(&amp;amp;files[i].date, dateBuf, sizeof(dateBuf));
        printf(&quot;%s%s  %s  %d bytes\n&quot;,
               files[i].name,
               files[i].extension,
               dateBuf,
               files[i].size);
    }
    printf(&quot;\n&quot;);
}

int main(void) {
    FileEntry files[] = {
        {&quot;G1zTo5jJk&quot;, &quot;.jpg&quot;, {2007, 7, 8}, 51954},
        {&quot;LTEE4SI0j&quot;, &quot;.jpg&quot;, {2011, 11, 13}, 43442},
        {&quot;PDqmuO3GH&quot;, &quot;.cpp&quot;, {2004, 5, 21}, 3346},
        {&quot;qJO2qjukZ&quot;, &quot;.png&quot;, {2010, 8, 27}, 67087},
        {&quot;HqclTqxb4&quot;, &quot;.cpp&quot;, {2020, 9, 5}, 70531},
        {&quot;imVyTyoaF&quot;, &quot;.jpg&quot;, {2011, 3, 19}, 43846},
        {&quot;rXwXdy8XO&quot;, &quot;.txt&quot;, {2017, 10, 12}, 70193},
        {&quot;9Z4fbOBUc&quot;, &quot;.pdf&quot;, {2004, 6, 9}, 1754},
        {&quot;ZHahuu4vS&quot;, &quot;.txt&quot;, {2003, 10, 10}, 65126},
        {&quot;0SnZHh2GT&quot;, &quot;.png&quot;, {2006, 10, 18}, 25890}
    };
    size_t count = sizeof(files) / sizeof(files[0]);

    printf(&quot;Original:\n&quot;);
    printFiles(files, count);

    printf(&quot;Sorted by name:\n&quot;);
    sortByName(files, count);
    printFiles(files, count);

    printf(&quot;Sorted by extension:\n&quot;);
    sortByExtension(files, count);
    printFiles(files, count);

    printf(&quot;Sorted by date:\n&quot;);
    sortByDate(files, count);
    printFiles(files, count);

    printf(&quot;Sorted by size:\n&quot;);
    sortBySize(files, count);
    printFiles(files, count);

    return 0;
}



/*
run:

Original:
G1zTo5jJk.jpg  2007-07-08  51954 bytes
LTEE4SI0j.jpg  2011-11-13  43442 bytes
PDqmuO3GH.cpp  2004-05-21  3346 bytes
qJO2qjukZ.png  2010-08-27  67087 bytes
HqclTqxb4.cpp  2020-09-05  70531 bytes
imVyTyoaF.jpg  2011-03-19  43846 bytes
rXwXdy8XO.txt  2017-10-12  70193 bytes
9Z4fbOBUc.pdf  2004-06-09  1754 bytes
ZHahuu4vS.txt  2003-10-10  65126 bytes
0SnZHh2GT.png  2006-10-18  25890 bytes

Sorted by name:
0SnZHh2GT.png  2006-10-18  25890 bytes
9Z4fbOBUc.pdf  2004-06-09  1754 bytes
G1zTo5jJk.jpg  2007-07-08  51954 bytes
HqclTqxb4.cpp  2020-09-05  70531 bytes
LTEE4SI0j.jpg  2011-11-13  43442 bytes
PDqmuO3GH.cpp  2004-05-21  3346 bytes
ZHahuu4vS.txt  2003-10-10  65126 bytes
imVyTyoaF.jpg  2011-03-19  43846 bytes
qJO2qjukZ.png  2010-08-27  67087 bytes
rXwXdy8XO.txt  2017-10-12  70193 bytes

Sorted by extension:
HqclTqxb4.cpp  2020-09-05  70531 bytes
PDqmuO3GH.cpp  2004-05-21  3346 bytes
G1zTo5jJk.jpg  2007-07-08  51954 bytes
LTEE4SI0j.jpg  2011-11-13  43442 bytes
imVyTyoaF.jpg  2011-03-19  43846 bytes
9Z4fbOBUc.pdf  2004-06-09  1754 bytes
0SnZHh2GT.png  2006-10-18  25890 bytes
qJO2qjukZ.png  2010-08-27  67087 bytes
ZHahuu4vS.txt  2003-10-10  65126 bytes
rXwXdy8XO.txt  2017-10-12  70193 bytes

Sorted by date:
ZHahuu4vS.txt  2003-10-10  65126 bytes
PDqmuO3GH.cpp  2004-05-21  3346 bytes
9Z4fbOBUc.pdf  2004-06-09  1754 bytes
0SnZHh2GT.png  2006-10-18  25890 bytes
G1zTo5jJk.jpg  2007-07-08  51954 bytes
qJO2qjukZ.png  2010-08-27  67087 bytes
imVyTyoaF.jpg  2011-03-19  43846 bytes
LTEE4SI0j.jpg  2011-11-13  43442 bytes
rXwXdy8XO.txt  2017-10-12  70193 bytes
HqclTqxb4.cpp  2020-09-05  70531 bytes

Sorted by size:
9Z4fbOBUc.pdf  2004-06-09  1754 bytes
PDqmuO3GH.cpp  2004-05-21  3346 bytes
0SnZHh2GT.png  2006-10-18  25890 bytes
LTEE4SI0j.jpg  2011-11-13  43442 bytes
imVyTyoaF.jpg  2011-03-19  43846 bytes
G1zTo5jJk.jpg  2007-07-08  51954 bytes
ZHahuu4vS.txt  2003-10-10  65126 bytes
qJO2qjukZ.png  2010-08-27  67087 bytes
rXwXdy8XO.txt  2017-10-12  70193 bytes
HqclTqxb4.cpp  2020-09-05  70531 bytes

*/
&lt;/pre&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
<guid isPermaLink="true">https://collectivesolver.com/97433/how-to-sort-a-list-of-files-by-name-extension-dates-and-size-in-c?show=97434#a97434</guid>
<pubDate>Sat, 16 May 2026 15:33:00 +0000</pubDate>
</item>
<item>
<title>Answered: How to sort a list of files by name, extension, dates, and size in C++</title>
<link>https://collectivesolver.com/97430/how-to-sort-a-list-of-files-by-name-extension-dates-and-size-in-c?show=97432#a97432</link>
<description>&lt;pre class=&quot;brush:cpp;&quot;&gt;#include &amp;lt;algorithm&amp;gt;
#include &amp;lt;iomanip&amp;gt;
#include &amp;lt;iostream&amp;gt;
#include &amp;lt;string&amp;gt;
#include &amp;lt;tuple&amp;gt;
#include &amp;lt;vector&amp;gt;

// ------------------------------------------------------------
// Date struct for proper date handling
// ------------------------------------------------------------
struct Date {
    int year;
    int month;
    int day;
};

// ------------------------------------------------------------
// File entry struct
// ------------------------------------------------------------
struct FileEntry {
    std::string name;      // file name without extension
    std::string extension; // extension including dot
    Date date;             // real date struct
    int size;              // bytes
};

// ------------------------------------------------------------
// Helper: print a date in YYYY-MM-DD format
// ------------------------------------------------------------
std::string formatDate(const Date&amp;amp; d) {
    char buffer[11];
    std::snprintf(buffer, sizeof(buffer), &quot;%04d-%02d-%02d&quot;, d.year, d.month, d.day);
    return buffer;
}

// ------------------------------------------------------------
// Sort by name (lexicographically)
// ------------------------------------------------------------
void sortByName(std::vector&amp;lt;FileEntry&amp;gt;&amp;amp; files) {
    std::sort(files.begin(), files.end(),
              [](const FileEntry&amp;amp; a, const FileEntry&amp;amp; b) {
                  return a.name &amp;lt; b.name;
              });
}

// ------------------------------------------------------------
// Sort by extension (lexicographically)
// ------------------------------------------------------------
void sortByExtension(std::vector&amp;lt;FileEntry&amp;gt;&amp;amp; files) {
    std::sort(files.begin(), files.end(),
              [](const FileEntry&amp;amp; a, const FileEntry&amp;amp; b) {
                  return a.extension &amp;lt; b.extension;
              });
}

// ------------------------------------------------------------
// Sort by date (year → month → day)
// ------------------------------------------------------------
void sortByDate(std::vector&amp;lt;FileEntry&amp;gt;&amp;amp; files) {
    std::sort(files.begin(), files.end(),
              [](const FileEntry&amp;amp; a, const FileEntry&amp;amp; b) {
                  return std::tie(a.date.year, a.date.month, a.date.day) &amp;lt;
                         std::tie(b.date.year, b.date.month, b.date.day);
              });
}

// ------------------------------------------------------------
// Sort by size (ascending)
// ------------------------------------------------------------
void sortBySize(std::vector&amp;lt;FileEntry&amp;gt;&amp;amp; files) {
    std::sort(files.begin(), files.end(),
              [](const FileEntry&amp;amp; a, const FileEntry&amp;amp; b) {
                  return a.size &amp;lt; b.size;
              });
}

// ------------------------------------------------------------
// Helper: print file list
// ------------------------------------------------------------
void printFiles(const std::vector&amp;lt;FileEntry&amp;gt;&amp;amp; files) {
    for (const auto&amp;amp; f : files) {
        std::cout &amp;lt;&amp;lt; f.name &amp;lt;&amp;lt; f.extension &amp;lt;&amp;lt; &quot;  &quot;
                  &amp;lt;&amp;lt; formatDate(f.date) &amp;lt;&amp;lt; &quot;  &quot;
                  &amp;lt;&amp;lt; f.size &amp;lt;&amp;lt; &quot; bytes\n&quot;;
    }
    std::cout &amp;lt;&amp;lt; &quot;\n&quot;;
}

int main() {
    std::vector&amp;lt;FileEntry&amp;gt; files = {
        {&quot;G1zTo5jJk&quot;, &quot;.jpg&quot;, {2007, 7, 8}, 51954},
        {&quot;LTEE4SI0j&quot;, &quot;.jpg&quot;, {2011, 11, 13}, 43442},
        {&quot;PDqmuO3GH&quot;, &quot;.cpp&quot;, {2004, 5, 21}, 3346},
        {&quot;qJO2qjukZ&quot;, &quot;.png&quot;, {2010, 8, 27}, 67087},
        {&quot;HqclTqxb4&quot;, &quot;.cpp&quot;, {2020, 9, 5}, 70531},
        {&quot;imVyTyoaF&quot;, &quot;.jpg&quot;, {2011, 3, 19}, 43846},
        {&quot;rXwXdy8XO&quot;, &quot;.txt&quot;, {2017, 10, 12}, 70193},
        {&quot;9Z4fbOBUc&quot;, &quot;.pdf&quot;, {2004, 6, 9}, 1754},
        {&quot;ZHahuu4vS&quot;, &quot;.txt&quot;, {2003, 10, 10}, 65126},
        {&quot;0SnZHh2GT&quot;, &quot;.png&quot;, {2006, 10, 18}, 25890}
    };

    std::cout &amp;lt;&amp;lt; &quot;Original:\n&quot;;
    printFiles(files);

    std::cout &amp;lt;&amp;lt; &quot;Sorted by name:\n&quot;;
    sortByName(files);
    printFiles(files);

    std::cout &amp;lt;&amp;lt; &quot;Sorted by extension:\n&quot;;
    sortByExtension(files);
    printFiles(files);

    std::cout &amp;lt;&amp;lt; &quot;Sorted by date:\n&quot;;
    sortByDate(files);
    printFiles(files);

    std::cout &amp;lt;&amp;lt; &quot;Sorted by size:\n&quot;;
    sortBySize(files);
    printFiles(files);
}



/*
run:

Original:
G1zTo5jJk.jpg  2007-07-08  51954 bytes
LTEE4SI0j.jpg  2011-11-13  43442 bytes
PDqmuO3GH.cpp  2004-05-21  3346 bytes
qJO2qjukZ.png  2010-08-27  67087 bytes
HqclTqxb4.cpp  2020-09-05  70531 bytes
imVyTyoaF.jpg  2011-03-19  43846 bytes
rXwXdy8XO.txt  2017-10-12  70193 bytes
9Z4fbOBUc.pdf  2004-06-09  1754 bytes
ZHahuu4vS.txt  2003-10-10  65126 bytes
0SnZHh2GT.png  2006-10-18  25890 bytes

Sorted by name:
0SnZHh2GT.png  2006-10-18  25890 bytes
9Z4fbOBUc.pdf  2004-06-09  1754 bytes
G1zTo5jJk.jpg  2007-07-08  51954 bytes
HqclTqxb4.cpp  2020-09-05  70531 bytes
LTEE4SI0j.jpg  2011-11-13  43442 bytes
PDqmuO3GH.cpp  2004-05-21  3346 bytes
ZHahuu4vS.txt  2003-10-10  65126 bytes
imVyTyoaF.jpg  2011-03-19  43846 bytes
qJO2qjukZ.png  2010-08-27  67087 bytes
rXwXdy8XO.txt  2017-10-12  70193 bytes

Sorted by extension:
HqclTqxb4.cpp  2020-09-05  70531 bytes
PDqmuO3GH.cpp  2004-05-21  3346 bytes
G1zTo5jJk.jpg  2007-07-08  51954 bytes
LTEE4SI0j.jpg  2011-11-13  43442 bytes
imVyTyoaF.jpg  2011-03-19  43846 bytes
9Z4fbOBUc.pdf  2004-06-09  1754 bytes
0SnZHh2GT.png  2006-10-18  25890 bytes
qJO2qjukZ.png  2010-08-27  67087 bytes
ZHahuu4vS.txt  2003-10-10  65126 bytes
rXwXdy8XO.txt  2017-10-12  70193 bytes

Sorted by date:
ZHahuu4vS.txt  2003-10-10  65126 bytes
PDqmuO3GH.cpp  2004-05-21  3346 bytes
9Z4fbOBUc.pdf  2004-06-09  1754 bytes
0SnZHh2GT.png  2006-10-18  25890 bytes
G1zTo5jJk.jpg  2007-07-08  51954 bytes
qJO2qjukZ.png  2010-08-27  67087 bytes
imVyTyoaF.jpg  2011-03-19  43846 bytes
LTEE4SI0j.jpg  2011-11-13  43442 bytes
rXwXdy8XO.txt  2017-10-12  70193 bytes
HqclTqxb4.cpp  2020-09-05  70531 bytes

Sorted by size:
9Z4fbOBUc.pdf  2004-06-09  1754 bytes
PDqmuO3GH.cpp  2004-05-21  3346 bytes
0SnZHh2GT.png  2006-10-18  25890 bytes
LTEE4SI0j.jpg  2011-11-13  43442 bytes
imVyTyoaF.jpg  2011-03-19  43846 bytes
G1zTo5jJk.jpg  2007-07-08  51954 bytes
ZHahuu4vS.txt  2003-10-10  65126 bytes
qJO2qjukZ.png  2010-08-27  67087 bytes
rXwXdy8XO.txt  2017-10-12  70193 bytes
HqclTqxb4.cpp  2020-09-05  70531 bytes

*/
&lt;/pre&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
<guid isPermaLink="true">https://collectivesolver.com/97430/how-to-sort-a-list-of-files-by-name-extension-dates-and-size-in-c?show=97432#a97432</guid>
<pubDate>Sat, 16 May 2026 13:35:23 +0000</pubDate>
</item>
<item>
<title>Answered: How to create a list of random file names, including extension, dates, and file size in Swift</title>
<link>https://collectivesolver.com/97428/how-to-create-a-list-of-random-file-names-including-extension-dates-and-file-size-in-swift?show=97429#a97429</link>
<description>&lt;pre class=&quot;brush:jscript;&quot;&gt;import Foundation

// Generate a random string of given length
func generateRandomString(_ length: Int) -&amp;gt; String {
    let charset = Array(&quot;abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789&quot;)
    
    return String((0..&amp;lt;length).map { _ in charset.randomElement()! })
}

// Generate a random date
func generateRandomDate() -&amp;gt; String {
    let year  = Int.random(in: 2000...2020)
    let month = Int.random(in: 1...12)
    let day   = Int.random(in: 1...28)

    return String(format: &quot;%04d-%02d-%02d&quot;, year, month, day)
}

// Generate a random file size
func generateRandomFileSize() -&amp;gt; Int {
    return Int.random(in: 1...100_000)
}

let extensions = [&quot;.txt&quot;, &quot;.jpg&quot;, &quot;.png&quot;, &quot;.cpp&quot;, &quot;.pdf&quot;]
let numberOfFiles = 10
let fileLength = 9

for _ in 0..&amp;lt;numberOfFiles {
    let fileName = generateRandomString(fileLength)
    let ext = extensions.randomElement()!
    let date = generateRandomDate()
    let fileSize = generateRandomFileSize()

    print(&quot;\(fileName)\(ext) \(date) \(fileSize) bytes&quot;)
}



/*
run:

FB6mPqSeq.txt 2010-10-04 20258 bytes
Z6NuSVE7P.txt 2011-09-27 12237 bytes
Ok8atoROe.jpg 2016-06-25 46104 bytes
rQVdPBrh1.pdf 2017-04-27 85629 bytes
pStRebMDT.png 2016-07-15 39061 bytes
xtf8b6IYk.txt 2007-07-18 66353 bytes
9qDy6LByM.png 2020-03-25 57955 bytes
AVb0QZAxx.cpp 2014-04-12 71164 bytes
YY5zhSRvX.png 2010-12-16 30188 bytes
XWmUX5Y8F.jpg 2000-11-10 70623 bytes

*/
&lt;/pre&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
<guid isPermaLink="true">https://collectivesolver.com/97428/how-to-create-a-list-of-random-file-names-including-extension-dates-and-file-size-in-swift?show=97429#a97429</guid>
<pubDate>Sat, 16 May 2026 09:23:43 +0000</pubDate>
</item>
<item>
<title>Answered: How to create a list of random file names, including extension, dates, and file size in Kotlin</title>
<link>https://collectivesolver.com/97426/how-to-create-a-list-of-random-file-names-including-extension-dates-and-file-size-in-kotlin?show=97427#a97427</link>
<description>&lt;pre class=&quot;brush:jscript;&quot;&gt;import kotlin.random.Random

// Generate a random string of given length
fun generateRandomString(length: Int): String {
    val charset = &quot;abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789&quot;
    return buildString(length) {
        repeat(length) {
            append(charset[Random.nextInt(charset.length)])
        }
    }
}

// Generate a random date
fun generateRandomDate(): String {
    val year = Random.nextInt(2000, 2021)   // 2000–2020
    val month = Random.nextInt(1, 13)       // 1–12
    val day = Random.nextInt(1, 29)         // 1–28

    return &quot;%04d-%02d-%02d&quot;.format(year, month, day)
}

// Generate a random file size
fun generateRandomFileSize(): Int {
    return Random.nextInt(1, 100_001)       // 1–100000 bytes
}

fun main() {
    val extensions = listOf(&quot;.txt&quot;, &quot;.jpg&quot;, &quot;.png&quot;, &quot;.cpp&quot;, &quot;.pdf&quot;)
    val numberOfFiles = 10
    val fileLength = 9

    repeat(numberOfFiles) {
        val fileName = generateRandomString(fileLength)
        val extension = extensions.random()
        val date = generateRandomDate()
        val fileSize = generateRandomFileSize()

        println(&quot;$fileName$extension $date $fileSize bytes&quot;)
    }
}



/*
run:

8OwQIB1OA.png 2009-11-03 22081 bytes
NGnQeg0W4.png 2017-01-18 30807 bytes
r79DV3gyk.pdf 2014-01-02 81783 bytes
JSYubC0q4.jpg 2001-02-19 91443 bytes
WLxWsbTFU.pdf 2019-09-16 74495 bytes
SQzti0Xlo.cpp 2002-01-04 83266 bytes
njpM3HaeS.jpg 2013-06-17 6149 bytes
8ekNZDyjK.png 2014-01-13 32864 bytes
Fi8G3YquR.png 2016-12-13 55878 bytes
u74eqvUtb.txt 2004-11-15 63307 bytes

*/
&lt;/pre&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
<guid isPermaLink="true">https://collectivesolver.com/97426/how-to-create-a-list-of-random-file-names-including-extension-dates-and-file-size-in-kotlin?show=97427#a97427</guid>
<pubDate>Sat, 16 May 2026 09:20:50 +0000</pubDate>
</item>
<item>
<title>Answered: How to create a list of random file names, including extension, dates, and file size in Ruby</title>
<link>https://collectivesolver.com/97424/how-to-create-a-list-of-random-file-names-including-extension-dates-and-file-size-in-ruby?show=97425#a97425</link>
<description>&lt;pre class=&quot;brush:ruby;&quot;&gt;require &quot;securerandom&quot;

# Generate a random string of given length
def generate_random_string(length)
  charset = &quot;abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789&quot;
  Array.new(length) { charset[SecureRandom.random_number(charset.length)] }.join
end

# Generate a random date
def generate_random_date
  year  = rand(2000..2020)
  month = rand(1..12)
  day   = rand(1..28)

  format(&quot;%04d-%02d-%02d&quot;, year, month, day)
end

# Generate a random file size
def generate_random_file_size
  rand(1..100_000)
end

extensions = [&quot;.txt&quot;, &quot;.jpg&quot;, &quot;.png&quot;, &quot;.cpp&quot;, &quot;.pdf&quot;]
number_of_files = 10
file_length = 9

number_of_files.times do
  file_name = generate_random_string(file_length)
  extension = extensions.sample
  date      = generate_random_date
  file_size = generate_random_file_size

  puts &quot;#{file_name}#{extension} #{date} #{file_size} bytes&quot;
end



=begin
run:

T2EbtxWFW.png 2003-08-03 27665 bytes
vYPW8XBXU.jpg 2009-07-19 95754 bytes
IZ7CCX3xd.png 2012-07-22 32720 bytes
6QxrIzesR.pdf 2014-09-04 26436 bytes
w6lRCpVlD.png 2009-01-15 46181 bytes
cQW7kPPTH.txt 2014-05-21 39794 bytes
9E0NaNYBR.jpg 2006-03-01 80741 bytes
l6UfBOx1H.jpg 2008-01-28 65547 bytes
ca11Xm0ji.txt 2005-01-14 80979 bytes
hDlxlfFr5.pdf 2017-10-13 3523 bytes

=end
&lt;/pre&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
<guid isPermaLink="true">https://collectivesolver.com/97424/how-to-create-a-list-of-random-file-names-including-extension-dates-and-file-size-in-ruby?show=97425#a97425</guid>
<pubDate>Sat, 16 May 2026 09:15:04 +0000</pubDate>
</item>
<item>
<title>Answered: How to create a list of random file names, including extension, dates, and file size in Scala</title>
<link>https://collectivesolver.com/97422/how-to-create-a-list-of-random-file-names-including-extension-dates-and-file-size-in-scala?show=97423#a97423</link>
<description>&lt;pre class=&quot;brush:scala;&quot;&gt;import scala.util.Random

object RandomFiles {

  // Generate a random string of given length
  def generateRandomString(length: Int): String = {
    val charset = &quot;abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789&quot;
    val sb = new StringBuilder(length)
    for (_ &amp;lt;- 0 until length) {
      sb.append(charset(Random.nextInt(charset.length)))
    }
    sb.toString()
  }

  // Generate a random date
  def generateRandomDate(): String = {
    val year  = 2000 + Random.nextInt(21) // 2000–2020
    val month = 1 + Random.nextInt(12)    // 1–12
    val day   = 1 + Random.nextInt(28)    // 1–28

    f&quot;$year%04d-$month%02d-$day%02d&quot;
  }

  // Generate a random file size
  def generateRandomFileSize(): Int = {
    1 + Random.nextInt(100000) // 1–100000 bytes
  }

  def main(args: Array[String]): Unit = {
    val extensions = List(&quot;.txt&quot;, &quot;.jpg&quot;, &quot;.png&quot;, &quot;.cpp&quot;, &quot;.pdf&quot;)
    val numberOfFiles = 10
    val fileLength = 9

    for (_ &amp;lt;- 1 to numberOfFiles) {
      val fileName = generateRandomString(fileLength)
      val extension = extensions(Random.nextInt(extensions.length))
      val date = generateRandomDate()
      val fileSize = generateRandomFileSize()

      println(s&quot;$fileName$extension $date $fileSize bytes&quot;)
    }
  }
}



/*
run:

Os65lCLUN.cpp 2007-05-04 45761 bytes
xT882Lsut.pdf 2012-08-20 37279 bytes
b4cjeuFSl.txt 2011-11-04 12896 bytes
8EtyDwLUm.pdf 2007-11-10 90561 bytes
3rNXG4plf.cpp 2008-06-15 46248 bytes
eAIeoPjHT.jpg 2006-11-28 61313 bytes
Ievr1ysKE.pdf 2006-06-18 90182 bytes
j6R5vv22d.png 2012-11-26 71070 bytes
rcyIH3v3w.pdf 2006-09-27 62660 bytes
wqk94MTwc.png 2013-07-12 83833 bytes

*/
&lt;/pre&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
<guid isPermaLink="true">https://collectivesolver.com/97422/how-to-create-a-list-of-random-file-names-including-extension-dates-and-file-size-in-scala?show=97423#a97423</guid>
<pubDate>Sat, 16 May 2026 09:11:24 +0000</pubDate>
</item>
<item>
<title>Answered: How to create a list of random file names, including extension, dates, and file size in Go</title>
<link>https://collectivesolver.com/97420/how-to-create-a-list-of-random-file-names-including-extension-dates-and-file-size-in-go?show=97421#a97421</link>
<description>&lt;pre class=&quot;brush:cpp;&quot;&gt;package main

import (
    &quot;crypto/rand&quot;
    &quot;fmt&quot;
    &quot;math/big&quot;
    &quot;strings&quot;
)

// Generate a random integer in [0, max)
func randomInt(max int64) int64 {
    n, _ := rand.Int(rand.Reader, big.NewInt(max))
    return n.Int64()
}

// Generate a random string of given length
func generateRandomString(length int) string {
    const charset = &quot;abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789&quot;
    var sb strings.Builder
    sb.Grow(length)

    for i := 0; i &amp;lt; length; i++ {
        idx := randomInt(int64(len(charset)))
        sb.WriteByte(charset[idx])
    }

    return sb.String()
}

// Generate a random date
func generateRandomDate() string {
    year := 2000 + randomInt(21) // 2000–2020
    month := 1 + randomInt(12)  // 1–12
    day := 1 + randomInt(28)    // 1–28

    return fmt.Sprintf(&quot;%04d-%02d-%02d&quot;, year, month, day)
}

// Generate a random file size
func generateRandomFileSize() int64 {
    return 1 + randomInt(100000) // 1–100000 bytes
}

func main() {
    extensions := []string{&quot;.txt&quot;, &quot;.jpg&quot;, &quot;.png&quot;, &quot;.cpp&quot;, &quot;.pdf&quot;}
    numberOfFiles := 10
    fileLength := 9

    for i := 0; i &amp;lt; numberOfFiles; i++ {
        fileName := generateRandomString(fileLength)
        extension := extensions[randomInt(int64(len(extensions)))]
        date := generateRandomDate()
        fileSize := generateRandomFileSize()

        fmt.Printf(&quot;%s%s %s %d bytes\n&quot;, fileName, extension, date, fileSize)
    }
}


/*
run:

k4Sg2ica6.png 2010-10-10 71145 bytes
U8Hi7ICwj.png 2003-12-28 16447 bytes
vNfPYzuI9.txt 2007-04-28 77029 bytes
wkc6jy7h7.jpg 2013-08-18 44492 bytes
mI0rLiCSh.pdf 2006-12-18 88282 bytes
RI0ODHyrT.pdf 2017-03-03 21178 bytes
Oy4Gi8SkO.txt 2001-03-11 61983 bytes
9xEgcQiJM.png 2016-09-07 37712 bytes
3iAH8w9Mb.txt 2001-12-04 46002 bytes
pO8VCSG5I.jpg 2012-05-28 28702 bytes

*/
&lt;/pre&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
<guid isPermaLink="true">https://collectivesolver.com/97420/how-to-create-a-list-of-random-file-names-including-extension-dates-and-file-size-in-go?show=97421#a97421</guid>
<pubDate>Sat, 16 May 2026 09:05:02 +0000</pubDate>
</item>
<item>
<title>Answered: How to create a list of random file names, including extension, dates, and file size in TypeScript</title>
<link>https://collectivesolver.com/97418/how-to-create-a-list-of-random-file-names-including-extension-dates-and-file-size-in-typescript?show=97419#a97419</link>
<description>&lt;pre class=&quot;brush:ts;&quot;&gt;// Generate a random integer in [min, max)
function randomInt(min: number, max: number): number {
    return Math.floor(Math.random() * (max - min)) + min;
}

// Generate a random string of given length
function generateRandomString(length: number): string {
    const charset = &quot;abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789&quot;;
    let result = &quot;&quot;;

    for (let i: number = 0; i &amp;lt; length; i++) {
        result += charset[randomInt(0, charset.length)];
    }

    return result;
}

// Generate a random date
function generateRandomDate(): string {
    const year: number = randomInt(2000, 2021);  // 2000–2020
    const month: number = randomInt(1, 13);      // 1–12
    const day: number = randomInt(1, 29);        // 1–28

    return `${year.toString().padStart(4, &quot;0&quot;)}-${month
        .toString()
        .padStart(2, &quot;0&quot;)}-${day.toString().padStart(2, &quot;0&quot;)}`;
}

// Generate a random file size
function generateRandomFileSize(): number {
    return randomInt(1, 100001); // 1–100000 bytes
}

const extensions: string[] = [&quot;.txt&quot;, &quot;.jpg&quot;, &quot;.png&quot;, &quot;.cpp&quot;, &quot;.pdf&quot;];
const numberOfFiles = 10;
const fileLength = 9;

for (let i: number = 0; i &amp;lt; numberOfFiles; i++) {
    const fileName = generateRandomString(fileLength);
    const extension = extensions[randomInt(0, extensions.length)];
    const date = generateRandomDate();
    const fileSize = generateRandomFileSize();

    console.log(`${fileName}${extension} ${date} ${fileSize} bytes`);
}



/*
run:

u0kxUsC1S.png 2009-12-01 14836 bytes
3GPrsXtI0.jpg 2007-07-21 11436 bytes
wlIKGsXPv.jpg 2001-01-17 43676 bytes
NVFFHXgLQ.pdf 2005-02-10 62508 bytes
rsBeakICg.jpg 2009-10-14 90438 bytes
fMfz8sNQu.pdf 2016-11-09 53066 bytes
3ZPuAjv9v.txt 2010-12-03 11045 bytes
aTE2qYJEv.pdf 2005-07-24 34763 bytes
iwP31dCms.pdf 2016-06-08 46436 bytes
XIzzxpOGX.cpp 2014-09-04 6458 bytes

*/

&lt;/pre&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
<guid isPermaLink="true">https://collectivesolver.com/97418/how-to-create-a-list-of-random-file-names-including-extension-dates-and-file-size-in-typescript?show=97419#a97419</guid>
<pubDate>Sat, 16 May 2026 08:57:55 +0000</pubDate>
</item>
<item>
<title>Answered: How to create a list of random file names, including extension, dates, and file size in JavaScript</title>
<link>https://collectivesolver.com/97416/how-to-create-a-list-of-random-file-names-including-extension-dates-and-file-size-in-javascript?show=97417#a97417</link>
<description>&lt;pre class=&quot;brush:jscript;&quot;&gt;// Required libraries
const crypto = require(&quot;crypto&quot;);

// Function to generate a random string of given length
function generateRandomString(length) {
  const charset = &quot;abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789&quot;;
  const bytes = crypto.randomBytes(length);
  
  return Array.from(bytes, b =&amp;gt; charset[b % charset.length]).join(&quot;&quot;);
}

// Function to generate a random date
function generateRandomDate() {
  const year = crypto.randomInt(2000, 2021);  // 2000–2020
  const month = crypto.randomInt(1, 13);      // 1–12
  const day = crypto.randomInt(1, 29);        // 1–28

  return `${year.toString().padStart(4, &quot;0&quot;)}-${month
    .toString()
    .padStart(2, &quot;0&quot;)}-${day.toString().padStart(2, &quot;0&quot;)}`;
}

// Function to generate a random file size
function generateRandomFileSize() {
  return crypto.randomInt(1, 100001); // 1–100000 bytes
}

const extensions = [&quot;.txt&quot;, &quot;.jpg&quot;, &quot;.png&quot;, &quot;.cpp&quot;, &quot;.pdf&quot;];
const numberOfFiles = 10;
const fileLength = 9;

for (let i = 0; i &amp;lt; numberOfFiles; i++) {
  const fileName = generateRandomString(fileLength);
  const extension = extensions[crypto.randomInt(extensions.length)];
  const date = generateRandomDate();
  const fileSize = generateRandomFileSize();

  console.log(`${fileName}${extension} ${date} ${fileSize} bytes`);
}



/*
run:

NuRRD2KUX.txt 2017-02-10 69297 bytes
yArSM0sYZ.png 2017-12-12 4108 bytes
hzMmH8TqE.txt 2019-04-22 24290 bytes
RjeKjoeqF.jpg 2016-09-20 7670 bytes
h92UxcbgS.png 2007-12-03 92993 bytes
OOH7tteo6.pdf 2005-04-19 26052 bytes
UWaBRLEyb.jpg 2003-03-07 30305 bytes
8pHhgqNfI.jpg 2006-05-12 99940 bytes
cvj6Zw5U2.pdf 2013-07-03 38290 bytes
1NCguOPIa.pdf 2020-07-06 93160 bytes

*/
&lt;/pre&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
<guid isPermaLink="true">https://collectivesolver.com/97416/how-to-create-a-list-of-random-file-names-including-extension-dates-and-file-size-in-javascript?show=97417#a97417</guid>
<pubDate>Sat, 16 May 2026 08:41:59 +0000</pubDate>
</item>
<item>
<title>Answered: How to create a list of random file names, including extension, dates, and file size in Python</title>
<link>https://collectivesolver.com/97414/how-to-create-a-list-of-random-file-names-including-extension-dates-and-file-size-in-python?show=97415#a97415</link>
<description>&lt;pre class=&quot;brush:python;&quot;&gt;import secrets
import string
import random

# Function to generate a random string of given length
def generate_random_string(length: int) -&amp;gt; str:
    charset = string.ascii_letters + string.digits
    return ''.join(secrets.choice(charset) for _ in range(length))

# Function to generate a random date
def generate_random_date() -&amp;gt; str:
    year = random.randint(2000, 2020)   # Random year between 2000 and 2020
    month = random.randint(1, 12)       # Random month between 1 and 12
    day = random.randint(1, 28)         # Random day between 1 and 28
    return f&quot;{year:04d}-{month:02d}-{day:02d}&quot;

# Function to generate a random file size
def generate_random_file_size() -&amp;gt; int:
    return random.randint(1, 100000)    # Random file size between 1 and 100000 bytes

extensions = [&quot;.txt&quot;, &quot;.jpg&quot;, &quot;.png&quot;, &quot;.cpp&quot;, &quot;.pdf&quot;]
number_of_files = 10
file_length = 9

for _ in range(number_of_files):
    file_name = generate_random_string(file_length)
    extension = random.choice(extensions)
    date = generate_random_date()
    file_size = generate_random_file_size()

    print(f&quot;{file_name}{extension} {date} {file_size} bytes&quot;)



&quot;&quot;&quot;
run:

wJEDG3P1P.jpg 2020-01-05 22313 bytes
xTDSKi5TD.jpg 2009-03-05 18269 bytes
eyX7wGFkF.png 2007-12-16 89669 bytes
jNhtKIiW1.png 2001-04-01 73366 bytes
fvfD1aQ2b.jpg 2009-08-07 70933 bytes
OhFlcNBoq.jpg 2019-08-18 10257 bytes
hP5E21eg2.pdf 2009-08-21 83989 bytes
MMj2YlhGc.pdf 2006-07-05 8007 bytes
oPlO1RDoq.cpp 2020-08-02 93292 bytes
FgToK06No.cpp 2016-04-01 56052 bytes

&quot;&quot;&quot;
&lt;/pre&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
<guid isPermaLink="true">https://collectivesolver.com/97414/how-to-create-a-list-of-random-file-names-including-extension-dates-and-file-size-in-python?show=97415#a97415</guid>
<pubDate>Sat, 16 May 2026 08:38:29 +0000</pubDate>
</item>
<item>
<title>Answered: How to create a list of random file names, including extension, dates, and file size in PHP</title>
<link>https://collectivesolver.com/97412/how-to-create-a-list-of-random-file-names-including-extension-dates-and-file-size-in-php?show=97413#a97413</link>
<description>&lt;pre class=&quot;brush:php;&quot;&gt;// Function to generate a random string of given length
function generateRandomString(int $length): string {
    $bytes = random_bytes($length);
    $charset = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
    $result = '';

    foreach (str_split($bytes) as $b) {
        $result .= $charset[ord($b) % strlen($charset)];
    }

    return $result;
}

// Function to generate a random date
function generateRandomDate(): string {
    $year  = random_int(2000, 2020); // Random year between 2000 and 2020
    $month = random_int(1, 12);      // Random month between 1 and 12
    $day   = random_int(1, 28);      // Random day between 1 and 28

    return sprintf('%04d-%02d-%02d', $year, $month, $day);
}

// Function to generate a random file size
function generateRandomFileSize(): int {
    return random_int(1, 100000); // Random file size between 1 and 100000 bytes
}

$extensions = ['.txt', '.jpg', '.png', '.cpp', '.pdf'];
$numberOfFiles = 10;
$fileLength = 9;

for ($i = 0; $i &amp;lt; $numberOfFiles; $i++) {
    $fileName = generateRandomString($fileLength);
    $extension = $extensions[array_rand($extensions)];
    $date = generateRandomDate();
    $fileSize = generateRandomFileSize();

    echo &quot;{$fileName}{$extension} {$date} {$fileSize} bytes\n&quot;;
}



/*
run:

7NMA0AMd1.txt 2017-04-02 31059 bytes
l9yccOFue.cpp 2013-06-22 93711 bytes
U2zaVbKPZ.cpp 2016-05-20 96622 bytes
EowfiiJK1.jpg 2014-09-17 94504 bytes
j2JNqDcOR.jpg 2015-07-12 35133 bytes
WkYgLBh0E.jpg 2009-08-16 20852 bytes
qO8qB7Czf.png 2015-03-20 34394 bytes
zvLkdKbm8.png 2017-01-10 7299 bytes
EtSnIE4VW.cpp 2007-03-11 12605 bytes
WtZ5IWU0N.png 2014-06-24 16367 bytes

*/&lt;/pre&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
<guid isPermaLink="true">https://collectivesolver.com/97412/how-to-create-a-list-of-random-file-names-including-extension-dates-and-file-size-in-php?show=97413#a97413</guid>
<pubDate>Sat, 16 May 2026 08:30:49 +0000</pubDate>
</item>
<item>
<title>Answered: How to create a list of random file names, including extension, dates, and file size in C#</title>
<link>https://collectivesolver.com/97410/how-to-create-a-list-of-random-file-names-including-extension-dates-and-file-size-in-c%23?show=97411#a97411</link>
<description>&lt;pre class=&quot;brush:csharp;&quot;&gt;using System;
using System.Collections.Generic;
using System.Security.Cryptography;
using System.Text;

class RandomFiles
{
    // Function to generate a random string of given length
    static string GenerateRandomString(int length) {
        const string charset = &quot;abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789&quot;;
        var bytes = new byte[length];
        RandomNumberGenerator.Fill(bytes);

        var sb = new StringBuilder(length);
        foreach (byte b in bytes)
            sb.Append(charset[b % charset.Length]);

        return sb.ToString();
    }

    // Function to generate a random date
    static string GenerateRandomDate() {
        int year  = RandomNumberGenerator.GetInt32(2000, 2021); // 2000–2020
        int month = RandomNumberGenerator.GetInt32(1, 13);      // 1–12
        int day   = RandomNumberGenerator.GetInt32(1, 29);      // 1–28

        return $&quot;{year:0000}-{month:00}-{day:00}&quot;;
    }

    // Function to generate a random file size
    static int GenerateRandomFileSize() {
        return RandomNumberGenerator.GetInt32(1, 100001); // 1–100000 bytes
    }

    static void Main()
    {
        var extensions = new List&amp;lt;string&amp;gt; { &quot;.txt&quot;, &quot;.jpg&quot;, &quot;.png&quot;, &quot;.cpp&quot;, &quot;.pdf&quot; };

        int numberOfFiles = 10;
        int fileLength = 9;

        for (int i = 0; i &amp;lt; numberOfFiles; i++)
        {
            string fileName = GenerateRandomString(fileLength);
            string extension = extensions[RandomNumberGenerator.GetInt32(extensions.Count)];
            string date = GenerateRandomDate();
            int fileSize = GenerateRandomFileSize();

            Console.WriteLine($&quot;{fileName}{extension} {date} {fileSize} bytes&quot;);
        }
    }
}


/*
run:

oz8tMiA8m.cpp 2011-11-28 42022 bytes
hYDtnqmqd.txt 2013-02-07 17553 bytes
deUsovuqT.cpp 2012-05-06 33347 bytes
EPrF7lY10.cpp 2009-10-22 57643 bytes
bBQklRNgx.jpg 2008-08-27 60546 bytes
jfaDtpCu6.jpg 2004-09-07 16648 bytes
C06fKesUT.jpg 2020-04-08 83568 bytes
Ajt5xxglR.txt 2016-10-28 67010 bytes
9zo5AZTyT.cpp 2001-02-17 38595 bytes
lPaRR6vdN.png 2016-01-21 92418 bytes

*/
&lt;/pre&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
<guid isPermaLink="true">https://collectivesolver.com/97410/how-to-create-a-list-of-random-file-names-including-extension-dates-and-file-size-in-c%23?show=97411#a97411</guid>
<pubDate>Sat, 16 May 2026 08:16:54 +0000</pubDate>
</item>
<item>
<title>Answered: How to create a list of random file names, including extension, dates, and file size in VB.NET</title>
<link>https://collectivesolver.com/97408/how-to-create-a-list-of-random-file-names-including-extension-dates-and-file-size-in-vb-net?show=97409#a97409</link>
<description>&lt;pre class=&quot;brush:vb;&quot;&gt;Imports System
Imports System.Collections.Generic

Module RandomFiles

    ' Function to generate a random string of given length
    Function GenerateRandomString(length As Integer, rng As Random) As String
        Const charset As String = &quot;abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789&quot;
        Dim result As Char() = New Char(length - 1) {}

        For i As Integer = 0 To length - 1
            result(i) = charset(rng.Next(charset.Length))
        Next

        Return New String(result)
    End Function

    ' Function to generate a random date
    Function GenerateRandomDate(rng As Random) As String
        Dim year As Integer = rng.Next(2000, 2021)   ' Random year between 2000 and 2020
        Dim month As Integer = rng.Next(1, 13)       ' Random month between 1 and 12
        Dim day As Integer = rng.Next(1, 29)         ' Random day between 1 and 28

        Return String.Format(&quot;{0:0000}-{1:00}-{2:00}&quot;, year, month, day)
    End Function

    ' Function to generate a random file size
    Function GenerateRandomFileSize(rng As Random) As Integer
        Return rng.Next(1, 100001) ' Random file size between 1 and 100000 bytes
    End Function

    Sub Main()
        Dim rng As New Random()

        Dim extensions As New List(Of String) From {
            &quot;.txt&quot;, &quot;.jpg&quot;, &quot;.png&quot;, &quot;.cpp&quot;, &quot;.pdf&quot;
        }

        Dim numberOfFiles As Integer = 10
        Dim fileLength As Integer = 9

        For i As Integer = 1 To numberOfFiles
            Dim fileName As String = GenerateRandomString(fileLength, rng)
            Dim ext As String = extensions(rng.Next(extensions.Count))
            Dim dateStr As String = GenerateRandomDate(rng)
            Dim fileSize As Integer = GenerateRandomFileSize(rng)

            Console.WriteLine($&quot;{fileName}{ext} {dateStr} {fileSize} bytes&quot;)
        Next
    End Sub

End Module



' run:
'
' JQJfuugwV.pdf 2011-08-07 64591 bytes
' ze3dGbKio.jpg 2012-07-04 82428 bytes
' IWoukV2AQ.jpg 2018-01-15 99133 bytes
' WCwKrxSoN.png 2008-03-23 38739 bytes
' AuRbAmX69.txt 2001-02-09 12012 bytes
' 7DlXFixp5.cpp 2014-10-08 83328 bytes
' UF03TNqOJ.jpg 2013-06-19 94306 bytes
' 1wNV7vSoY.jpg 2008-01-09 23922 bytes
' i7RXKjaUE.png 2016-10-07 14697 bytes
' ysZ6fkLpR.png 2004-08-14 5597 bytes
'


&lt;/pre&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
<guid isPermaLink="true">https://collectivesolver.com/97408/how-to-create-a-list-of-random-file-names-including-extension-dates-and-file-size-in-vb-net?show=97409#a97409</guid>
<pubDate>Sat, 16 May 2026 08:03:31 +0000</pubDate>
</item>
<item>
<title>Answered: How to create a list of random file names, including extension, dates, and file size in Java</title>
<link>https://collectivesolver.com/97406/how-to-create-a-list-of-random-file-names-including-extension-dates-and-file-size-in-java?show=97407#a97407</link>
<description>&lt;pre class=&quot;brush:java;&quot;&gt;import java.time.LocalDate;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ThreadLocalRandom;

public class RandomFiles {

    // Generate a random string of given length
    static String generateRandomString(int length) {
        String charset = &quot;abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789&quot;;
        StringBuilder sb = new StringBuilder(length);
        ThreadLocalRandom rng = ThreadLocalRandom.current();

        for (int i = 0; i &amp;lt; length; i++) {
            sb.append(charset.charAt(rng.nextInt(charset.length())));
        }

        return sb.toString();
    }

    // Generate a random date
    static String generateRandomDate() {
        ThreadLocalRandom rng = ThreadLocalRandom.current();

        int year  = rng.nextInt(2000, 2021); // Random year between 2000 and 2020
        int month = rng.nextInt(1, 13);      // Random month between 1 and 12
        int day   = rng.nextInt(1, 29);      // Random day between 1 and 28

        return String.format(&quot;%04d-%02d-%02d&quot;, year, month, day);
    }

    // Generate a random file size
    static int generateRandomFileSize() {
        return ThreadLocalRandom.current().nextInt(1, 100001); // 1–100000 bytes
    }

    public static void main(String[] args) {

        List&amp;lt;String&amp;gt; extensions = List.of(&quot;.txt&quot;, &quot;.jpg&quot;, &quot;.png&quot;, &quot;.cpp&quot;, &quot;.pdf&quot;);

        int numberOfFiles = 10;
        int fileLength = 9;

        for (int i = 0; i &amp;lt; numberOfFiles; i++) {
            String fileName = generateRandomString(fileLength);
            String extension = extensions.get(ThreadLocalRandom.current().nextInt(extensions.size()));
            String date = generateRandomDate();
            int fileSize = generateRandomFileSize();

            System.out.println(fileName + extension + &quot; &quot; + date + &quot; &quot; + fileSize + &quot; bytes&quot;);
        }
    }
}



/*
run:

VYVjgab1p.cpp 2001-08-21 21278 bytes
qM694nEJk.jpg 2015-05-19 1882 bytes
assCZSzeB.jpg 2009-05-24 19520 bytes
rPU1dIdDV.txt 2011-08-27 71847 bytes
VMLwC4X3s.jpg 2010-08-04 13391 bytes
fEddG6O7Z.cpp 2007-06-18 72556 bytes
jDKBCUsiI.cpp 2019-06-02 4995 bytes
6SwFYqHJd.txt 2012-01-18 68285 bytes
B5gFKGZGA.jpg 2001-06-13 51497 bytes
aeYkX5EPU.pdf 2009-04-16 21547 bytes

*/&lt;/pre&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
<guid isPermaLink="true">https://collectivesolver.com/97406/how-to-create-a-list-of-random-file-names-including-extension-dates-and-file-size-in-java?show=97407#a97407</guid>
<pubDate>Sat, 16 May 2026 07:54:19 +0000</pubDate>
</item>
<item>
<title>Answered: How to create a list of random file names, including extension, dates, and file size in Pascal</title>
<link>https://collectivesolver.com/97404/how-to-create-a-list-of-random-file-names-including-extension-dates-and-file-size-in-pascal?show=97405#a97405</link>
<description>&lt;pre class=&quot;brush:delphi;&quot;&gt;program RandomFiles;

{$mode objfpc}{$H+}

uses
  SysUtils;

// Function to generate a random string of given length
function GenerateRandomString(Len: Integer): string;
const
  Charset = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
var
  i: Integer;
begin
  SetLength(Result, Len);
  for i := 1 to Len do
    Result[i] := Charset[Random(Length(Charset)) + 1];
end;

// Function to generate a random date
function GenerateRandomDate: string;
var
  Year, Month, Day: Integer;
begin
  Year  := Random(21) + 2000;  // Random year between 2000 and 2020
  Month := Random(12) + 1;     // Random month between 1 and 12
  Day   := Random(28) + 1;     // Random day between 1 and 28

  Result := Format('%4d-%0.2d-%0.2d', [Year, Month, Day]);
end;


// Function to generate a random file size
function GenerateRandomFileSize: Integer;
begin
  Result := Random(100000) + 1; // Random file size between 1 and 100000 bytes
end;

var
  Extensions: array of string;
  i: Integer;
  FileName, Ext, DateStr: string;
  FileSize: Integer;
begin
  Randomize; // Seed RNG

  // Available extensions
  SetLength(Extensions, 5);
  Extensions[0] := '.txt';
  Extensions[1] := '.jpg';
  Extensions[2] := '.png';
  Extensions[3] := '.cpp';
  Extensions[4] := '.pdf';

  for i := 1 to 10 do
  begin
    FileName := GenerateRandomString(9); // Generate random file name
    Ext      := Extensions[Random(Length(Extensions))]; // Random extension
    DateStr  := GenerateRandomDate; // Random date
    FileSize := GenerateRandomFileSize; // Random size

    WriteLn(FileName, Ext, ' ', DateStr, ' ', FileSize, ' bytes');
    
  end;
end.



(*
run:

Up0aj2mLg.cpp 2004-06-11 10688 bytes
HLkwJCmZU.cpp 2009-07-19 16060 bytes
QQS9Xy29j.pdf 2004-08-28 6943 bytes
ZBc4nVVGU.png 2009-01-27 95418 bytes
nhREfBHpM.jpg 2004-07-26 7772 bytes
60d3UPjBh.cpp 2000-06-25 78496 bytes
3L8eIjB9u.txt 2008-10-25 19312 bytes
2y7lJaFgG.pdf 2017-01-09 95183 bytes
tr01Mc1bl.jpg 2020-12-24 37343 bytes
v2bxhmwfu.png 2020-03-10 81073 bytes

*)
&lt;/pre&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
<guid isPermaLink="true">https://collectivesolver.com/97404/how-to-create-a-list-of-random-file-names-including-extension-dates-and-file-size-in-pascal?show=97405#a97405</guid>
<pubDate>Sat, 16 May 2026 07:36:26 +0000</pubDate>
</item>
<item>
<title>Answered: How to create a list of random file names, including extension, dates, and file size in C</title>
<link>https://collectivesolver.com/97402/how-to-create-a-list-of-random-file-names-including-extension-dates-and-file-size-in-c?show=97403#a97403</link>
<description>&lt;pre class=&quot;brush:cpp;&quot;&gt;#include &amp;lt;stdio.h&amp;gt;
#include &amp;lt;stdlib.h&amp;gt;
#include &amp;lt;string.h&amp;gt;
#include &amp;lt;time.h&amp;gt;

// Function to generate a random string of given length
void generateRandomString(char *buffer, size_t length) {
    const char charset[] = &quot;abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789&quot;;
    size_t charsetSize = sizeof(charset) - 1;

    for (size_t i = 0; i &amp;lt; length; i++) {
        buffer[i] = charset[rand() % charsetSize];
    }
    buffer[length] = '\0'; // Null-terminate
}

// Function to generate a random date
void generateRandomDate(char *buffer, size_t size) {
    int year  = rand() % 21 + 2000; // Random year between 2000 and 2020
    int month = rand() % 12 + 1;    // Random month between 1 and 12
    int day   = rand() % 28 + 1;    // Random day between 1 and 28

    snprintf(buffer, size, &quot;%04d-%02d-%02d&quot;, year, month, day);
}

// Function to generate a random file size
size_t generateRandomFileSize() {
    return (rand() % 100000) + 1; // Random file size between 1 and 100000 bytes
}

int main() {
    srand((unsigned int)time(NULL)); // Seed RNG

    const char *extensions[] = {&quot;.txt&quot;, &quot;.jpg&quot;, &quot;.png&quot;, &quot;.cpp&quot;, &quot;.pdf&quot;};
    size_t extCount = sizeof(extensions) / sizeof(extensions[0]);

    size_t numberOfFiles = 10;
    size_t fileLength = 9;

    char nameBuffer[64] = &quot;&quot;;
    char dateBuffer[32] = &quot;&quot;;

    for (size_t i = 0; i &amp;lt; numberOfFiles; i++) {
        generateRandomString(nameBuffer, fileLength);
        const char *ext = extensions[rand() % extCount];
        generateRandomDate(dateBuffer, sizeof(dateBuffer));
        size_t fileSize = generateRandomFileSize();

        printf(&quot;%s%s %s %zu bytes\n&quot;, nameBuffer, ext, dateBuffer, fileSize);
    }

    return 0;
}



/*
run:

BPZ3JAH7u.txt 2008-12-23 494 bytes
QJch2hlC5.jpg 2015-12-07 77239 bytes
st6S6WLFk.jpg 2014-09-15 25197 bytes
0dAGMALDH.png 2015-03-21 75428 bytes
m0lEhhmd3.txt 2009-05-24 74620 bytes
GmkwnK0X8.cpp 2003-09-19 37509 bytes
6EnisyLzF.pdf 2000-10-26 23619 bytes
BA45KesXM.pdf 2004-11-09 24378 bytes
eW79oifGG.png 2015-03-25 75090 bytes
x9rWzjRan.png 2012-04-19 47351 bytes

*/&lt;/pre&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
<guid isPermaLink="true">https://collectivesolver.com/97402/how-to-create-a-list-of-random-file-names-including-extension-dates-and-file-size-in-c?show=97403#a97403</guid>
<pubDate>Sat, 16 May 2026 06:56:44 +0000</pubDate>
</item>
<item>
<title>Answered: How to create a list of random file names, including extension, dates, and file size in C++</title>
<link>https://collectivesolver.com/84281/how-to-create-a-list-of-random-file-names-including-extension-dates-and-file-size-in-c?show=97401#a97401</link>
<description>&lt;pre class=&quot;brush:cpp;&quot;&gt;#include &amp;lt;iostream&amp;gt;
#include &amp;lt;vector&amp;gt;
#include &amp;lt;string&amp;gt;
#include &amp;lt;random&amp;gt;
#include &amp;lt;chrono&amp;gt;
#include &amp;lt;iomanip&amp;gt; // setw

// Function to generate a random string of given length
std::string generateRandomString(size_t length, std::mt19937&amp;amp; rng) {
    const std::string charset = &quot;abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789&quot;;
    std::uniform_int_distribution&amp;lt;size_t&amp;gt; dist(0, charset.size() - 1);

    std::string result;
    result.reserve(length);

    for (size_t i = 0; i &amp;lt; length; ++i) {
        result.push_back(charset[dist(rng)]);
    }

    return result;
}

// Function to generate a random date
std::string generateRandomDate(std::mt19937&amp;amp; rng) {
    std::uniform_int_distribution&amp;lt;int&amp;gt; yearDist(2000, 2020); // Random year between 2000 and 2020
    std::uniform_int_distribution&amp;lt;int&amp;gt; monthDist(1, 12);     // Random month between 1 and 12
    std::uniform_int_distribution&amp;lt;int&amp;gt; dayDist(1, 28);       // Random day between 1 and 28

    int year = yearDist(rng);
    int month = monthDist(rng);
    int day = dayDist(rng);

    std::ostringstream oss;
    oss &amp;lt;&amp;lt; std::setw(4) &amp;lt;&amp;lt; std::setfill('0') &amp;lt;&amp;lt; year &amp;lt;&amp;lt; &quot;-&quot;
        &amp;lt;&amp;lt; std::setw(2) &amp;lt;&amp;lt; std::setfill('0') &amp;lt;&amp;lt; month &amp;lt;&amp;lt; &quot;-&quot;
        &amp;lt;&amp;lt; std::setw(2) &amp;lt;&amp;lt; std::setfill('0') &amp;lt;&amp;lt; day;

    return oss.str();
}

// Function to generate a random file size
size_t generateRandomFileSize(std::mt19937&amp;amp; rng) {
    std::uniform_int_distribution&amp;lt;size_t&amp;gt; sizeDist(1, 100000); // Random file size between 1 and 100000 bytes
    return sizeDist(rng);
}

int main() {
    // Seed RNG with high‑resolution clock
    std::mt19937 rng(std::chrono::high_resolution_clock::now().time_since_epoch().count());

    std::vector&amp;lt;std::string&amp;gt; extensions = {&quot;.txt&quot;, &quot;.jpg&quot;, &quot;.png&quot;, &quot;.cpp&quot;, &quot;.pdf&quot;};
    std::uniform_int_distribution&amp;lt;size_t&amp;gt; extDist(0, extensions.size() - 1);

    size_t numberOfFiles = 10; // Number of random files to generate
    size_t fileLength = 9;

    for (size_t i = 0; i &amp;lt; numberOfFiles; ++i) {
        std::string fileName = generateRandomString(fileLength, rng); // Generate random file name
        std::string extension = extensions[extDist(rng)];             // Randomly select an extension
        std::string date = generateRandomDate(rng);                   // Generate random date
        size_t fileSize = generateRandomFileSize(rng);                // Generate random file size

        std::cout &amp;lt;&amp;lt; fileName &amp;lt;&amp;lt; extension &amp;lt;&amp;lt; &quot; &quot;
                  &amp;lt;&amp;lt; date &amp;lt;&amp;lt; &quot; &quot;
                  &amp;lt;&amp;lt; fileSize &amp;lt;&amp;lt; &quot; bytes\n&quot;;
    }
}



/*
run:

1oiPG9Nox.jpg 2006-07-03 20903 bytes
g3zAS2CTx.pdf 2003-09-03 12098 bytes
XZl7rmAA2.cpp 2004-12-09 27672 bytes
b5y5HZvOt.txt 2005-11-20 28251 bytes
TncRJ8aWJ.txt 2017-02-18 73647 bytes
T4PyWDaDj.pdf 2014-05-24 45914 bytes
lP5mjg1zf.cpp 2019-11-04 40439 bytes
reKDBdlMp.pdf 2020-03-04 48000 bytes
tOINuNtlH.cpp 2005-12-24 72486 bytes
pQ29vLIkT.jpg 2006-09-04 85396 bytes

*/&lt;/pre&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
<guid isPermaLink="true">https://collectivesolver.com/84281/how-to-create-a-list-of-random-file-names-including-extension-dates-and-file-size-in-c?show=97401#a97401</guid>
<pubDate>Sat, 16 May 2026 06:50:32 +0000</pubDate>
</item>
<item>
<title>Answered: How to generate random file name in VB.NET</title>
<link>https://collectivesolver.com/19588/how-to-generate-random-file-name-in-vb-net?show=97400#a97400</link>
<description>&lt;pre class=&quot;brush:vb;&quot;&gt;Imports System

' unique filename with a specific extension

Module RandomFileName
 
    Sub Main()
 
		Dim filename As String = $&quot;{Guid.NewGuid()}.txt&quot;
 
        Console.WriteLine(filename)
 
    End Sub
 
End Module


' run:
' 
' b64f9750-9955-465c-bf0c-03e1248c4082.txt
'

&lt;/pre&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
<guid isPermaLink="true">https://collectivesolver.com/19588/how-to-generate-random-file-name-in-vb-net?show=97400#a97400</guid>
<pubDate>Sat, 16 May 2026 05:56:43 +0000</pubDate>
</item>
<item>
<title>Answered: How to generate random file name in C#</title>
<link>https://collectivesolver.com/12304/how-to-generate-random-file-name-in-c%23?show=97398#a97398</link>
<description>&lt;pre class=&quot;brush:csharp;&quot;&gt;using System;

// unique filename with a specific extension
 
public class Program
{
    public static void Main(string[] args)
    {
        string fileName = $&quot;{Guid.NewGuid()}.txt&quot;;
         
        Console.WriteLine(fileName);
    }
}
 
 
/*
run:
 
45380e1e-0bb3-4e12-a57b-e82e0f491981.txt
 
*/&lt;/pre&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
<guid isPermaLink="true">https://collectivesolver.com/12304/how-to-generate-random-file-name-in-c%23?show=97398#a97398</guid>
<pubDate>Sat, 16 May 2026 05:50:59 +0000</pubDate>
</item>
<item>
<title>Answered: How to create a list of random dates in Swift</title>
<link>https://collectivesolver.com/97395/how-to-create-a-list-of-random-dates-in-swift?show=97396#a97396</link>
<description>&lt;pre class=&quot;brush:jscript;&quot;&gt;import Foundation

// Generate a random date between two years using Date
func randomDate(startYear: Int, endYear: Int) -&amp;gt; Date {

    let calendar = Calendar.current

    // Convert start and end years to timestamps
    let start = calendar.date(from: DateComponents(year: startYear, month: 1, day: 1))!
    let end   = calendar.date(from: DateComponents(year: endYear, month: 12, day: 31))!

    let startTime = start.timeIntervalSince1970
    let endTime   = end.timeIntervalSince1970

    // Uniform distribution over the timestamp range
    let randomTime = TimeInterval.random(in: startTime...endTime)

    // Convert back to Date
    return Date(timeIntervalSince1970: randomTime)
}

var dates: [Date] = []

for _ in 0..&amp;lt;10 {
    dates.append(randomDate(startYear: 1990, endYear: 2030))
}

let calendar = Calendar.current

for d in dates {
    let year  = calendar.component(.year, from: d)
    let month = calendar.component(.month, from: d)
    let day   = calendar.component(.day, from: d)

    print(&quot;\(year)-\(month)-\(day)&quot;)
}



/*
run:

1999-11-16
2017-8-19
1991-6-23
2000-5-27
1998-3-26
1995-12-20
2002-8-8
2017-7-28
2028-2-11
1994-6-19

*/
&lt;/pre&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
<guid isPermaLink="true">https://collectivesolver.com/97395/how-to-create-a-list-of-random-dates-in-swift?show=97396#a97396</guid>
<pubDate>Sat, 16 May 2026 05:38:49 +0000</pubDate>
</item>
<item>
<title>Answered: How to create a list of random dates in Kotlin</title>
<link>https://collectivesolver.com/97393/how-to-create-a-list-of-random-dates-in-kotlin?show=97394#a97394</link>
<description>&lt;pre class=&quot;brush:jscript;&quot;&gt;import java.time.LocalDate
import kotlin.random.Random

// Generate a random date between two years using LocalDate
fun randomDate(startYear: Int, endYear: Int): LocalDate {

    // Convert start and end years to timestamps
    val start = LocalDate.of(startYear, 1, 1)
    val end   = LocalDate.of(endYear, 12, 31)

    val startEpoch = start.toEpochDay()
    val endEpoch   = end.toEpochDay()

    // Uniform distribution over the timestamp range
    val randomEpoch = Random.nextLong(startEpoch, endEpoch + 1)

    // Convert back to LocalDate
    return LocalDate.ofEpochDay(randomEpoch)
}

fun main() {

    val dates = List(10) { randomDate(1990, 2030) }

    for (d in dates) {
        println(&quot;${d.year}-${d.monthValue}-${d.dayOfMonth}&quot;)
    }
}


/*
run:

2001-10-1
2001-12-23
2015-6-21
2004-10-27
2025-3-17
2001-11-7
2029-8-29
2002-4-26
2017-4-20
2019-5-5

*/
&lt;/pre&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
<guid isPermaLink="true">https://collectivesolver.com/97393/how-to-create-a-list-of-random-dates-in-kotlin?show=97394#a97394</guid>
<pubDate>Sat, 16 May 2026 05:35:44 +0000</pubDate>
</item>
<item>
<title>Answered: How to create a list of random dates in Scala</title>
<link>https://collectivesolver.com/97391/how-to-create-a-list-of-random-dates-in-scala?show=97392#a97392</link>
<description>&lt;pre class=&quot;brush:scala;&quot;&gt;import java.time.{LocalDate, ZoneOffset}
import java.time.temporal.ChronoUnit
import scala.util.Random

object RandomDates {

  // Generate a random date between two years using LocalDate
  def randomDate(startYear: Int, endYear: Int): LocalDate = {

    // Convert start and end years to timestamps
    val start = LocalDate.of(startYear, 1, 1)
    val end   = LocalDate.of(endYear, 12, 31)

    val startEpoch = start.toEpochDay
    val endEpoch   = end.toEpochDay

    // Uniform distribution over the timestamp range
    val randomEpoch = Random.between(startEpoch, endEpoch + 1)

    // Convert back to LocalDate
    LocalDate.ofEpochDay(randomEpoch)
  }

  def main(args: Array[String]): Unit = {

    val dates = (1 to 10).map(_ =&amp;gt; randomDate(1990, 2030))

    for (d &amp;lt;- dates) {
      println(s&quot;${d.getYear}-${d.getMonthValue}-${d.getDayOfMonth}&quot;)
    }
  }
}



/*
run:

2010-5-31
2024-4-8
2027-11-24
2028-1-27
1998-5-23
2023-2-24
2017-12-11
2012-2-3
2030-2-25
2024-12-12

*/
&lt;/pre&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
<guid isPermaLink="true">https://collectivesolver.com/97391/how-to-create-a-list-of-random-dates-in-scala?show=97392#a97392</guid>
<pubDate>Sat, 16 May 2026 05:32:51 +0000</pubDate>
</item>
<item>
<title>Answered: How to create a list of random dates in Ruby</title>
<link>https://collectivesolver.com/97389/how-to-create-a-list-of-random-dates-in-ruby?show=97390#a97390</link>
<description>&lt;pre class=&quot;brush:ruby;&quot;&gt;require 'date'

# Generate a random date between two years using Date
def random_date(start_year, end_year)
  # Convert start and end years to timestamps
  start_date = Date.new(start_year, 1, 1)
  end_date   = Date.new(end_year, 12, 31)

  # Uniform distribution over the timestamp range
  range_days = (end_date - start_date).to_i
  offset = rand(0..range_days)

  # Convert back to Date
  start_date + offset
end

dates = []

10.times do
  dates &amp;lt;&amp;lt; random_date(1990, 2030)
end

dates.each do |d|
  puts &quot;#{d.year}-#{d.month}-#{d.day}&quot;
end



=begin
run:

2019-10-14
2025-8-8
2015-12-30
2030-11-19
2029-10-3
2017-1-2
1995-12-27
2027-2-26
2022-6-19
2020-7-11

=end
&lt;/pre&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
<guid isPermaLink="true">https://collectivesolver.com/97389/how-to-create-a-list-of-random-dates-in-ruby?show=97390#a97390</guid>
<pubDate>Sat, 16 May 2026 05:31:18 +0000</pubDate>
</item>
<item>
<title>Answered: How to create a list of random dates in Go</title>
<link>https://collectivesolver.com/97387/how-to-create-a-list-of-random-dates-in-go?show=97388#a97388</link>
<description>&lt;pre class=&quot;brush:cpp;&quot;&gt;package main

import (
    &quot;fmt&quot;
    &quot;math/rand&quot;
    &quot;time&quot;
)

// Generate a random date between two years using time.Time
func randomDate(startYear, endYear int) time.Time {

    // Convert start and end years to timestamps
    start := time.Date(startYear, time.January, 1, 0, 0, 0, 0, time.UTC)
    end   := time.Date(endYear, time.December, 31, 0, 0, 0, 0, time.UTC)

    startUnix := start.Unix()
    endUnix   := end.Unix()

    // Uniform distribution over the timestamp range
    randomUnix := rand.Int63n(endUnix-startUnix+1) + startUnix

    // Convert back to time.Time
    return time.Unix(randomUnix, 0)
}

func main() {
    rand.Seed(time.Now().UnixNano()) // Seed RNG

    dates := make([]time.Time, 0, 10)

    for i := 0; i &amp;lt; 10; i++ {
        dates = append(dates, randomDate(1990, 2030))
    }

    for _, d := range dates {
        fmt.Printf(&quot;%d-%d-%d\n&quot;, d.Year(), d.Month(), d.Day())
    }
}



/*
run:

2021-1-2
2006-2-11
2015-5-2
1995-1-2
1997-4-14
2015-3-27
1997-9-12
2013-5-4
2026-7-26
1994-5-10

*/
&lt;/pre&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
<guid isPermaLink="true">https://collectivesolver.com/97387/how-to-create-a-list-of-random-dates-in-go?show=97388#a97388</guid>
<pubDate>Fri, 15 May 2026 18:42:15 +0000</pubDate>
</item>
<item>
<title>Answered: How to create a list of random dates in TypeScript</title>
<link>https://collectivesolver.com/97385/how-to-create-a-list-of-random-dates-in-typescript?show=97386#a97386</link>
<description>&lt;pre class=&quot;brush:ts;&quot;&gt;// Generate a random date between two years using Date
function randomDate(startYear: number, endYear: number): Date {

    // Convert start and end years to timestamps
    const start: Date = new Date(startYear, 0, 1);   // January = 0
    const end: Date = new Date(endYear, 11, 31);   // December = 11

    const startTs: number = start.getTime();
    const endTs: number = end.getTime();

    // Uniform distribution over the timestamp range
    const randomTs: number = Math.floor(Math.random() * (endTs - startTs + 1)) + startTs;

    // Convert back to Date
    return new Date(randomTs);
}

const dates: Date[] = [];

for (let i: number = 0; i &amp;lt; 10; i++) {
    dates.push(randomDate(1990, 2030));
}

for (const d of dates) {
    console.log(`${d.getFullYear()}-${d.getMonth() + 1}-${d.getDate()}`);
}



/*
run:

2024-12-17
2026-4-19
1995-8-25
2015-4-13
1995-9-8
2021-11-30
2029-3-29
1990-5-8
2019-10-2
2023-5-15

*/
&lt;/pre&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
<guid isPermaLink="true">https://collectivesolver.com/97385/how-to-create-a-list-of-random-dates-in-typescript?show=97386#a97386</guid>
<pubDate>Fri, 15 May 2026 18:40:44 +0000</pubDate>
</item>
<item>
<title>Answered: How to create a list of random dates in JavaScript</title>
<link>https://collectivesolver.com/97383/how-to-create-a-list-of-random-dates-in-javascript?show=97384#a97384</link>
<description>&lt;pre class=&quot;brush:jscript;&quot;&gt;// Generate a random date between two years using Date
function randomDate(startYear, endYear) {

    // Convert start and end years to timestamps
    const start = new Date(startYear, 0, 1);   // January = 0
    const end   = new Date(endYear, 11, 31);   // December = 11

    const startTs = start.getTime();
    const endTs   = end.getTime();

    // Uniform distribution over the timestamp range
    const randomTs = Math.floor(Math.random() * (endTs - startTs + 1)) + startTs;

    // Convert back to Date
    return new Date(randomTs);
}

const dates = [];

for (let i = 0; i &amp;lt; 10; i++) {
    dates.push(randomDate(1990, 2030));
}

for (const d of dates) {
    console.log(`${d.getFullYear()}-${d.getMonth() + 1}-${d.getDate()}`);
}



/*
run:

1995-1-9
1993-1-6
1997-10-19
2030-7-2
2004-10-20
2022-2-27
1994-6-22
2008-7-13
2030-5-19
1990-7-3

*/
&lt;/pre&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
<guid isPermaLink="true">https://collectivesolver.com/97383/how-to-create-a-list-of-random-dates-in-javascript?show=97384#a97384</guid>
<pubDate>Fri, 15 May 2026 18:37:31 +0000</pubDate>
</item>
<item>
<title>Answered: How to create a list of random dates in Python</title>
<link>https://collectivesolver.com/97381/how-to-create-a-list-of-random-dates-in-python?show=97382#a97382</link>
<description>&lt;pre class=&quot;brush:python;&quot;&gt;import random
from datetime import datetime, timedelta

# Generate a random date between two years using datetime
def random_date(start_year, end_year):
    # Convert start and end years to timestamps
    start = datetime(start_year, 1, 1)
    end   = datetime(end_year, 12, 31)

    # Uniform distribution over the timestamp range
    range_days = (end - start).days
    offset = random.randint(0, range_days)

    # Convert back to datetime
    return start + timedelta(days=offset)

dates = []

for i in range(10):
    dates.append(random_date(1990, 2030))

for d in dates:
    print(f&quot;{d.year}-{d.month}-{d.day}&quot;)



'''
run:

2008-7-6
1996-3-4
1997-9-19
2028-7-7
2025-7-26
2016-7-29
2014-12-28
1991-6-15
2008-5-20
2012-9-8

'''&lt;/pre&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
<guid isPermaLink="true">https://collectivesolver.com/97381/how-to-create-a-list-of-random-dates-in-python?show=97382#a97382</guid>
<pubDate>Fri, 15 May 2026 18:34:56 +0000</pubDate>
</item>
<item>
<title>Answered: How to create a list of random dates in PHP</title>
<link>https://collectivesolver.com/97379/how-to-create-a-list-of-random-dates-in-php?show=97380#a97380</link>
<description>&lt;pre class=&quot;brush:php;&quot;&gt;&amp;lt;?php

// Generate a random date between two years using DateTime
function random_date(int $startYear, int $endYear): DateTime {

    // Convert start and end years to timestamps
    $start = new DateTime(&quot;$startYear-01-01&quot;);
    $end   = new DateTime(&quot;$endYear-12-31&quot;);

    // Uniform distribution over the timestamp range
    $startTs = $start-&amp;gt;getTimestamp();
    $endTs   = $end-&amp;gt;getTimestamp();

    $randomTs = rand($startTs, $endTs);

    // Convert back to DateTime
    $result = new DateTime();
    $result-&amp;gt;setTimestamp($randomTs);

    return $result;
}

$dates = [];

for ($i = 0; $i &amp;lt; 10; $i++) {
    $dates[] = random_date(1990, 2030);
}

foreach ($dates as $d) {
    echo $d-&amp;gt;format(&quot;Y-n-j&quot;) . &quot;\n&quot;;
}


/*
run:

1994-5-31
2009-3-17
1997-3-12
2000-6-3
2002-6-16
2016-10-30
1998-1-9
2023-8-12
1994-11-22
1995-5-30

*/
&lt;/pre&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
<guid isPermaLink="true">https://collectivesolver.com/97379/how-to-create-a-list-of-random-dates-in-php?show=97380#a97380</guid>
<pubDate>Fri, 15 May 2026 18:33:03 +0000</pubDate>
</item>
<item>
<title>Answered: How to create a list of random dates in C#</title>
<link>https://collectivesolver.com/97377/how-to-create-a-list-of-random-dates-in-c%23?show=97378#a97378</link>
<description>&lt;pre class=&quot;brush:csharp;&quot;&gt;using System;
using System.Collections.Generic;

class RandomDates
{
    // Generate a random date between two years using DateTime
    static DateTime RandomDate(int startYear, int endYear, Random rng) {
        // Convert start and end years to timestamps
        DateTime start = new DateTime(startYear, 1, 1);
        DateTime end   = new DateTime(endYear, 12, 31);

        // Uniform distribution over the timestamp range
        int rangeDays = (end - start).Days;
        int offset = rng.Next(0, rangeDays + 1);

        // Convert back to DateTime
        return start.AddDays(offset);
    }

    static void Main()
    {
        Random rng = new Random(); // Seed RNG
        List&amp;lt;DateTime&amp;gt; dates = new List&amp;lt;DateTime&amp;gt;();

        for (int i = 0; i &amp;lt; 10; i++) {
            dates.Add(RandomDate(1990, 2030, rng));
        }

        foreach (DateTime d in dates) {
            Console.WriteLine($&quot;{d.Year}-{d.Month}-{d.Day}&quot;);
        }
    }
}



/*
run:

2015-3-4
1999-3-2
2013-9-2
1996-2-19
1992-1-21
1990-8-1
2029-5-22
1992-11-20
2001-10-23
2017-1-21

*/
&lt;/pre&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
<guid isPermaLink="true">https://collectivesolver.com/97377/how-to-create-a-list-of-random-dates-in-c%23?show=97378#a97378</guid>
<pubDate>Fri, 15 May 2026 15:07:08 +0000</pubDate>
</item>
<item>
<title>Answered: How to create a list of random dates in VB.NET</title>
<link>https://collectivesolver.com/97375/how-to-create-a-list-of-random-dates-in-vb-net?show=97376#a97376</link>
<description>&lt;pre class=&quot;brush:vb;&quot;&gt;Imports System
Imports System.Collections.Generic

Module RandomDates

    ' Generate a random date between two years using Date
    Function RandomDate(startYear As Integer, endYear As Integer, rng As Random) As Date
        ' Convert start and end years to timestamps
        Dim startDate As New Date(startYear, 1, 1)
        Dim endDate As New Date(endYear, 12, 31)

        ' Uniform distribution over the timestamp range
        Dim rangeDays As Integer = CInt((endDate - startDate).TotalDays)
        Dim offset As Integer = rng.Next(0, rangeDays + 1)

        ' Convert back to Date
        Return startDate.AddDays(offset)
    End Function

    Sub Main()
        Dim rng As New Random() ' Seed RNG
        Dim dates As New List(Of Date)

        For i As Integer = 0 To 9
            dates.Add(RandomDate(1990, 2030, rng))
        Next

        For Each d As Date In dates
            Console.WriteLine($&quot;{d.Year}-{d.Month}-{d.Day}&quot;)
        Next
    End Sub

End Module



' run:
'
' 2022-4-22
' 2019-5-8
' 2024-2-9
' 1990-6-19
' 2030-2-17
' 2026-8-12
' 2028-10-6
' 2006-6-10
' 2023-5-5
' 2007-9-5
'
&lt;/pre&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
<guid isPermaLink="true">https://collectivesolver.com/97375/how-to-create-a-list-of-random-dates-in-vb-net?show=97376#a97376</guid>
<pubDate>Fri, 15 May 2026 15:04:24 +0000</pubDate>
</item>
<item>
<title>Answered: How to create a list of random dates in Java</title>
<link>https://collectivesolver.com/97373/how-to-create-a-list-of-random-dates-in-java?show=97374#a97374</link>
<description>&lt;pre class=&quot;brush:java;&quot;&gt;import java.time.LocalDate;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ThreadLocalRandom;

public class RandomDates {

    // Generate a random date between two years using LocalDate
    public static LocalDate randomDate(int startYear, int endYear) {

        // Convert start and end years to timestamps
        LocalDate start = LocalDate.of(startYear, 1, 1);
        LocalDate end   = LocalDate.of(endYear, 12, 31);

        long startEpoch = start.toEpochDay();
        long endEpoch   = end.toEpochDay();

        // Uniform distribution over the timestamp range
        long randomEpoch = ThreadLocalRandom.current().nextLong(startEpoch, endEpoch + 1);

        // Convert back to LocalDate
        return LocalDate.ofEpochDay(randomEpoch);
    }

    public static void main(String[] args) {

        List&amp;lt;LocalDate&amp;gt; dates = new ArrayList&amp;lt;&amp;gt;();

        for (int i = 0; i &amp;lt; 10; i++) {
            dates.add(randomDate(1990, 2030));
        }

        for (LocalDate d : dates) {
            System.out.println(d.getYear() + &quot;-&quot; +
                               d.getMonthValue() + &quot;-&quot; +
                               d.getDayOfMonth());
        }
    }
}



/*
run:

1990-2-9
2007-6-24
1999-4-20
2029-2-6
2010-7-31
2011-9-26
2017-10-24
2026-11-27
1997-10-9
2009-10-21

*/
&lt;/pre&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
<guid isPermaLink="true">https://collectivesolver.com/97373/how-to-create-a-list-of-random-dates-in-java?show=97374#a97374</guid>
<pubDate>Fri, 15 May 2026 08:56:26 +0000</pubDate>
</item>
<item>
<title>Answered: How to create a list of random dates in Pascal</title>
<link>https://collectivesolver.com/97371/how-to-create-a-list-of-random-dates-in-pascal?show=97372#a97372</link>
<description>&lt;pre class=&quot;brush:delphi;&quot;&gt;program RandomDates;

{$mode objfpc}{$H+}

uses
  SysUtils, DateUtils, Math;

// Generate a random date between two years using TDateTime
function RandomDate(startYear, endYear: Integer): TDateTime;
var
  startDate, endDate: TDateTime;
  rangeDays: Integer;
  offset: Integer;
begin
  // Convert start and end years to timestamps
  startDate := EncodeDate(startYear, 1, 1);
  endDate   := EncodeDate(endYear, 12, 31);

  // Uniform distribution over the timestamp range
  rangeDays := Trunc(endDate - startDate);
  offset := Random(rangeDays + 1);

  Result := startDate + offset;
end;

var
  dates: array of TDateTime;
  d: TDateTime;
  i: Integer;
  y, m, day: Word;

begin
  Randomize; // Seed RNG

  SetLength(dates, 10);

  for i := 0 to High(dates) do
  begin
    dates[i] := RandomDate(1990, 2030);
  end;

  for d in dates do
  begin
    DecodeDate(d, y, m, day);
    WriteLn(y, '-', m, '-', day);
  end;
end.



(*
run:

1996-4-6
2023-9-21
2011-9-15
2005-4-18
2001-4-10
2002-3-2
2022-9-26
2011-10-24
2010-7-3
2029-3-25

*)
&lt;/pre&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
<guid isPermaLink="true">https://collectivesolver.com/97371/how-to-create-a-list-of-random-dates-in-pascal?show=97372#a97372</guid>
<pubDate>Fri, 15 May 2026 08:35:26 +0000</pubDate>
</item>
<item>
<title>Answered: How to create a list of random dates in C</title>
<link>https://collectivesolver.com/97369/how-to-create-a-list-of-random-dates-in-c?show=97370#a97370</link>
<description>&lt;pre class=&quot;brush:cpp;&quot;&gt;#include &amp;lt;stdio.h&amp;gt;
#include &amp;lt;stdlib.h&amp;gt;
#include &amp;lt;time.h&amp;gt;

// Generate a random date between two years using time_t
struct tm random_date(int startYear, int endYear) {
    // Convert start and end years to timestamps
    struct tm start = {0};
    start.tm_year = startYear - 1900;
    start.tm_mon = 0;
    start.tm_mday = 1;

    struct tm end = {0};
    end.tm_year = endYear - 1900;
    end.tm_mon = 11;
    end.tm_mday = 31;

    time_t start_t = mktime(&amp;amp;start);
    time_t end_t   = mktime(&amp;amp;end);

    // Uniform distribution over the timestamp range
    long long range = (long long)end_t - (long long)start_t;
    long long offset = rand() % range;

    time_t random_t = start_t + offset;

    // Convert back to tm
    struct tm result = *localtime(&amp;amp;random_t);

    return result;
}

int main() {
    srand((unsigned)time(NULL)); // Seed RNG

    int count = 10;
    struct tm *dates = malloc(sizeof(struct tm) * count);

    for (int i = 0; i &amp;lt; count; i++) {
        dates[i] = random_date(1990, 2030);
    }

    for (int i = 0; i &amp;lt; count; i++) {
        struct tm d = dates[i];
        printf(&quot;%d-%d-%d\n&quot;,
               d.tm_year + 1900,
               d.tm_mon + 1,
               d.tm_mday);
    }

    free(dates);
    
    return 0;
}



/*
run:

2000-9-6
2016-5-8
1997-11-22
2002-3-1
2028-12-21
2018-12-9
1998-2-15
1993-8-10
2007-12-16
2007-7-24

*/
&lt;/pre&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
<guid isPermaLink="true">https://collectivesolver.com/97369/how-to-create-a-list-of-random-dates-in-c?show=97370#a97370</guid>
<pubDate>Fri, 15 May 2026 08:29:09 +0000</pubDate>
</item>
<item>
<title>Answered: How to create a list of random dates in C++</title>
<link>https://collectivesolver.com/84275/how-to-create-a-list-of-random-dates-in-c?show=97368#a97368</link>
<description>&lt;pre class=&quot;brush:cpp;&quot;&gt;#include &amp;lt;iostream&amp;gt;
#include &amp;lt;vector&amp;gt;
#include &amp;lt;random&amp;gt;
#include &amp;lt;ctime&amp;gt;

// Generate a random date between two years using time_t
std::tm random_date(std::mt19937 &amp;amp;rng, int startYear, int endYear) {
    // Convert start and end years to timestamps
    std::tm start = {};
    start.tm_year = startYear - 1900;
    start.tm_mon = 0;
    start.tm_mday = 1;

    std::tm end = {};
    end.tm_year = endYear - 1900;
    end.tm_mon = 11;
    end.tm_mday = 31;

    time_t start_t = std::mktime(&amp;amp;start);
    time_t end_t   = std::mktime(&amp;amp;end);

    // Uniform distribution over the timestamp range
    std::uniform_int_distribution&amp;lt;long long&amp;gt; dist(start_t, end_t);

    time_t random_t = dist(rng);

    // Convert back to tm
    std::tm result = *std::localtime(&amp;amp;random_t);
    
    return result;
}

int main() {
    std::mt19937 rng(std::random_device{}());
    std::vector&amp;lt;std::tm&amp;gt; dates;

    for (int i = 0; i &amp;lt; 10; i++) {
        dates.push_back(random_date(rng, 1990, 2030));
    }

    for (auto &amp;amp;d : dates) {
        std::cout &amp;lt;&amp;lt; (d.tm_year + 1900) &amp;lt;&amp;lt; &quot;-&quot;
                  &amp;lt;&amp;lt; (d.tm_mon + 1) &amp;lt;&amp;lt; &quot;-&quot;
                  &amp;lt;&amp;lt; d.tm_mday &amp;lt;&amp;lt; &quot;\n&quot;;
    }
}



/*
run:

1990-5-25
2011-6-13
2006-10-25
1999-11-16
2030-6-6
2004-9-11
2027-3-15
2029-12-13
2010-6-7
1999-9-18

*/&lt;/pre&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
<guid isPermaLink="true">https://collectivesolver.com/84275/how-to-create-a-list-of-random-dates-in-c?show=97368#a97368</guid>
<pubDate>Fri, 15 May 2026 08:24:55 +0000</pubDate>
</item>
<item>
<title>Answered: How to find the difference between two random future dates in C#</title>
<link>https://collectivesolver.com/97365/how-to-find-the-difference-between-two-random-future-dates-in-c%23?show=97366#a97366</link>
<description>&lt;pre class=&quot;brush:csharp;&quot;&gt;using System;

class Program
{
    /*
     * Generates a random future date by adding a random number of days
     * to today's date. The range is controlled by minDays and maxDays.
     */
    static DateTime GenerateRandomFutureDate(int minDays, int maxDays, Random rng) {
        int randomOffset = rng.Next(minDays, maxDays + 1);  // random number of days
        
        return DateTime.Now.AddDays(randomOffset).Date;     // convert to date-only
    }

    /*
     * Calculates the difference between two dates and returns a TimeSpan.
     */
    static TimeSpan CalculateDateDifference(DateTime date1, DateTime date2) {
        return date2 - date1;
    }

    static void Main()
    {
        Random rng = new Random();  // random number generator

        // Create two random future dates
        DateTime date1 = GenerateRandomFutureDate(10, 40, rng);  // between 10–40 days from now
        DateTime date2 = GenerateRandomFutureDate(20, 60, rng);  // between 20–60 days from now

        // Calculate the difference
        TimeSpan difference = CalculateDateDifference(date1, date2);

        // Display results
        Console.WriteLine(&quot;Random Future Date 1: &quot; + date1.ToShortDateString());
        Console.WriteLine(&quot;Random Future Date 2: &quot; + date2.ToShortDateString());
        Console.WriteLine(&quot;Difference in days: &quot; + difference.Days);
    }
}


/*
run1: 

Random Future Date 1: 06/24/2026
Random Future Date 2: 06/15/2026
Difference in days: -9

run2:

Random Future Date 1: 06/01/2026
Random Future Date 2: 06/12/2026
Difference in days: 11

*/&lt;/pre&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
<guid isPermaLink="true">https://collectivesolver.com/97365/how-to-find-the-difference-between-two-random-future-dates-in-c%23?show=97366#a97366</guid>
<pubDate>Fri, 15 May 2026 05:45:36 +0000</pubDate>
</item>
<item>
<title>Answered: How to find the difference between two random future dates in VB.NET</title>
<link>https://collectivesolver.com/97363/how-to-find-the-difference-between-two-random-future-dates-in-vb-net?show=97364#a97364</link>
<description>&lt;pre class=&quot;brush:vb;&quot;&gt;Imports System

Module Program

    '
    ' Generates a random future date by adding a random number of days
    ' to today's date. The range is controlled by minDays and maxDays.
    '
    Function GenerateRandomFutureDate(minDays As Integer, maxDays As Integer, rng As Random) As DateTime
        Dim randomOffset As Integer = rng.Next(minDays, maxDays + 1)   ' random number of days
	
        Return DateTime.Now.AddDays(randomOffset).Date                 ' convert to date-only
    End Function

    '
    ' Calculates the difference between two dates and returns a TimeSpan.
    '
    Function CalculateDateDifference(date1 As DateTime, date2 As DateTime) As TimeSpan
        Return date2 - date1
    End Function

    Sub Main()
        Dim rng As New Random()   ' random number generator

        ' Create two random future dates
        Dim date1 As DateTime = GenerateRandomFutureDate(10, 40, rng)   ' between 10–40 days from now
        Dim date2 As DateTime = GenerateRandomFutureDate(20, 60, rng)   ' between 20–60 days from now

        ' Calculate the difference
        Dim difference As TimeSpan = CalculateDateDifference(date1, date2)

        ' Display results
        Console.WriteLine(&quot;Random Future Date 1: &quot; &amp;amp; date1.ToShortDateString())
        Console.WriteLine(&quot;Random Future Date 2: &quot; &amp;amp; date2.ToShortDateString())
        Console.WriteLine(&quot;Difference in days: &quot; &amp;amp; difference.Days)
    End Sub

End Module


'
' run1: 
'
' Random Future Date 1: 05/25/2026
' Random Future Date 2: 06/28/2026
' Difference in days: 34
'
' run2:
'
' Random Future Date 1: 06/22/2026
' Random Future Date 2: 06/17/2026
' Difference in days: -5
'
&lt;/pre&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
<guid isPermaLink="true">https://collectivesolver.com/97363/how-to-find-the-difference-between-two-random-future-dates-in-vb-net?show=97364#a97364</guid>
<pubDate>Fri, 15 May 2026 05:43:16 +0000</pubDate>
</item>
<item>
<title>Answered: How to calculate the value of x where x + x^2 + x^4 + x^5 + x^8 = 6897 in C</title>
<link>https://collectivesolver.com/97361/how-to-calculate-the-value-of-x-where-x-x-2-x-4-x-5-x-8-6897-in-c?show=97362#a97362</link>
<description>&lt;pre class=&quot;brush:cpp;&quot;&gt;#include &amp;lt;stdio.h&amp;gt;
#include &amp;lt;math.h&amp;gt;

/*
 * Computes the value of the polynomial:
 *     f(x) = x + x^2 + x^4 + x^5 + x^8
 */
double evaluatePolynomial(double x) {
    return x
         + pow(x, 2)
         + pow(x, 4)
         + pow(x, 5)
         + pow(x, 8);
}

/*
 * Performs a binary search to find the value of x such that:
 *     f(x) ≈ targetValue
 *
 * The function assumes f(x) is strictly increasing for x &amp;gt; 0.
 */
double findRootBinarySearch(double targetValue, double left, double right) {
    while (right - left &amp;gt; 1e-9) {   // stop when precision is high enough
        double mid = (left + right) / 2.0;
        double value = evaluatePolynomial(mid);

        if (value &amp;lt; targetValue)
            left = mid;
        else
            right = mid;
    }

    return (left + right) / 2.0;
}

int main() {
    double target = 6897.0;

    // Search range chosen because the solution is known to be small and positive
    double x = findRootBinarySearch(target, 0.0, 10.0);

    printf(&quot;Approximate solution: x = %.10f\n&quot;, x);
    
    return 0;
}


/*
run:

Approximate solution: x = 3.0000000002

*/
&lt;/pre&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
<guid isPermaLink="true">https://collectivesolver.com/97361/how-to-calculate-the-value-of-x-where-x-x-2-x-4-x-5-x-8-6897-in-c?show=97362#a97362</guid>
<pubDate>Thu, 14 May 2026 18:13:41 +0000</pubDate>
</item>
<item>
<title>Answered: How to calculate the value of x where x + x^2 + x^4 + x^5 + x^8 = 6897 in C++</title>
<link>https://collectivesolver.com/97359/how-to-calculate-the-value-of-x-where-x-x-2-x-4-x-5-x-8-6897-in-c?show=97360#a97360</link>
<description>&lt;pre class=&quot;brush:cpp;&quot;&gt;#include &amp;lt;iostream&amp;gt;
#include &amp;lt;cmath&amp;gt;

/*
 * Computes the value of the polynomial:
 *     f(x) = x + x^2 + x^4 + x^5 + x^8
 */
double evaluatePolynomial(double x) {
    return x 
         + pow(x, 2) 
         + pow(x, 4) 
         + pow(x, 5) 
         + pow(x, 8);
}

/*
 * Performs a binary search to find the value of x such that:
 *     f(x) ≈ targetValue
 *
 * The function assumes f(x) is strictly increasing for x &amp;gt; 0.
 */
double findRootBinarySearch(double targetValue, double left, double right) {
    while (right - left &amp;gt; 1e-9) {   // stop when precision is high enough
        double mid = (left + right) / 2.0;
        double value = evaluatePolynomial(mid);

        if (value &amp;lt; targetValue)
            left = mid;
        else
            right = mid;
    }
    
    return (left + right) / 2.0;
}

int main() {
    double target = 6897.0;

    // Search range chosen because the solution is known to be small and positive
    double x = findRootBinarySearch(target, 0.0, 10.0);

    std::cout &amp;lt;&amp;lt; &quot;Approximate solution: x = &quot; &amp;lt;&amp;lt; x &amp;lt;&amp;lt; std::endl;
}



/*
run:

Approximate solution: x = 3

*/&lt;/pre&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
<guid isPermaLink="true">https://collectivesolver.com/97359/how-to-calculate-the-value-of-x-where-x-x-2-x-4-x-5-x-8-6897-in-c?show=97360#a97360</guid>
<pubDate>Thu, 14 May 2026 18:09:11 +0000</pubDate>
</item>
<item>
<title>Answered: How to calculate the values of a and b where a × b = 899 in C</title>
<link>https://collectivesolver.com/97357/how-to-calculate-the-values-of-a-and-b-where-a-b-899-in-c?show=97358#a97358</link>
<description>&lt;pre class=&quot;brush:cpp;&quot;&gt;#include &amp;lt;stdio.h&amp;gt;

// You can compute all integer pairs (a, b) such that a × b = 899 
// by checking every divisor of 899

void findAB(int n) {
    for (int a = 1; a &amp;lt;= n; a++) {
        if (n % a == 0) {
            int b = n / a;
            printf(&quot;a = %d, b = %d\n&quot;, a, b);
        }
    }
}

int main() {
    int n = 899;
    
    findAB(n);
    
    return 0;
}


/*
run:

a = 1, b = 899
a = 29, b = 31
a = 31, b = 29
a = 899, b = 1

*/
&lt;/pre&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
<guid isPermaLink="true">https://collectivesolver.com/97357/how-to-calculate-the-values-of-a-and-b-where-a-b-899-in-c?show=97358#a97358</guid>
<pubDate>Thu, 14 May 2026 16:39:43 +0000</pubDate>
</item>
<item>
<title>Answered: How to calculate the values of a and b where a × b = 899 in C++</title>
<link>https://collectivesolver.com/97355/how-to-calculate-the-values-of-a-and-b-where-a-b-899-in-c?show=97356#a97356</link>
<description>&lt;pre class=&quot;brush:cpp;&quot;&gt;#include &amp;lt;iostream&amp;gt;

// You can compute all integer pairs (a, b) such that a × b = 899 
// by checking every divisor of 899


void findAB(int n) {
    for (int a = 1; a &amp;lt;= n; a++) {
        if (n % a == 0) {
            int b = n / a;
            std::cout &amp;lt;&amp;lt; &quot;a = &quot; &amp;lt;&amp;lt; a &amp;lt;&amp;lt; &quot;, b = &quot; &amp;lt;&amp;lt; b &amp;lt;&amp;lt; std::endl;
        }
    }
}

int main() {
    int n = 899;
    
    findAB(n);
}



/*
run:

a = 1, b = 899
a = 29, b = 31
a = 31, b = 29
a = 899, b = 1

*/&lt;/pre&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
<guid isPermaLink="true">https://collectivesolver.com/97355/how-to-calculate-the-values-of-a-and-b-where-a-b-899-in-c?show=97356#a97356</guid>
<pubDate>Thu, 14 May 2026 16:37:59 +0000</pubDate>
</item>
<item>
<title>Answered: How to draw a simple cuboid generator in C++</title>
<link>https://collectivesolver.com/97353/how-to-draw-a-simple-cuboid-generator-in-c?show=97354#a97354</link>
<description>&lt;pre class=&quot;brush:cpp;&quot;&gt;#include &amp;lt;iostream&amp;gt;
#include &amp;lt;string&amp;gt;

/**
 * Draws a 3D-style wireframe cuboid in the console.
 * @param w Width of the front face
 * @param h Height of the front face
 * @param d Depth (the slant)
 */
void drawCuboid(int w, int h, int d) {
    // Basic validation to prevent visual glitches
    if (w &amp;lt; 2 || h &amp;lt; 2 || d &amp;lt; 1) {
        std::cout &amp;lt;&amp;lt; &quot;Dimensions too small to render.&quot; &amp;lt;&amp;lt; std::endl;
        return;
    }

    // 1. Top Edge
    std::cout &amp;lt;&amp;lt; std::string(d, ' ') &amp;lt;&amp;lt; &quot;+&quot; &amp;lt;&amp;lt; std::string(w, '-') &amp;lt;&amp;lt; &quot;+&quot; &amp;lt;&amp;lt; std::endl;

    // 2. Top Face (Slanted)
    for (int i = 1; i &amp;lt; d; ++i) {
        std::cout &amp;lt;&amp;lt; std::string(d - i, ' ') &amp;lt;&amp;lt; &quot;/&quot; &amp;lt;&amp;lt; std::string(w, ' ') &amp;lt;&amp;lt; &quot;/&quot; 
                  &amp;lt;&amp;lt; std::string(i - 1, ' ') &amp;lt;&amp;lt; &quot;|&quot; &amp;lt;&amp;lt; std::endl;
    }

    // 3. Middle Connecting Edge
    std::cout &amp;lt;&amp;lt; &quot;+&quot; &amp;lt;&amp;lt; std::string(w, '-') &amp;lt;&amp;lt; &quot;+&quot; &amp;lt;&amp;lt; std::string(d - 1, ' ') &amp;lt;&amp;lt; &quot;|&quot; &amp;lt;&amp;lt; std::endl;

    // 4. Front Face &amp;amp; Side Face
    for (int i = 0; i &amp;lt; h; ++i) {
        std::cout &amp;lt;&amp;lt; &quot;| &quot; &amp;lt;&amp;lt; std::string(w - 2, ' ') &amp;lt;&amp;lt; &quot; |&quot;; // Using w-2 to account for the '|' borders
        
        // Logic for the receding side edge
        if (i &amp;lt; h - d) {
            std::cout &amp;lt;&amp;lt; std::string(d - 1, ' ') &amp;lt;&amp;lt; &quot;|&quot;;
        } else if (i == h - d) {
            std::cout &amp;lt;&amp;lt; std::string(d - 1, ' ') &amp;lt;&amp;lt; &quot;+&quot;;
        } else {
            int slant_remaining = h - i - 1;
            std::cout &amp;lt;&amp;lt; std::string(slant_remaining, ' ') &amp;lt;&amp;lt; &quot;/&quot;;
        }
        std::cout &amp;lt;&amp;lt; std::endl;
    }

    // 5. Bottom Edge
    std::cout &amp;lt;&amp;lt; &quot;+&quot; &amp;lt;&amp;lt; std::string(w, '-') &amp;lt;&amp;lt; &quot;+&quot; &amp;lt;&amp;lt; std::endl;
}

int main() {
    int w = 20, h = 8, d = 4;

    std::cout &amp;lt;&amp;lt; &quot;--- Cuboid Generator ---&quot; &amp;lt;&amp;lt; std::endl;

    drawCuboid(w, h, d);

    return 0;
}


/*
run:
 
--- Cuboid Generator ---
    +--------------------+
   /                    /|
  /                    / |
 /                    /  |
+--------------------+   |
|                    |   |
|                    |   |
|                    |   |
|                    |   |
|                    |   +
|                    |  /
|                    | /
|                    |/
+--------------------+
 
*/
 
&lt;/pre&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
<guid isPermaLink="true">https://collectivesolver.com/97353/how-to-draw-a-simple-cuboid-generator-in-c?show=97354#a97354</guid>
<pubDate>Thu, 14 May 2026 15:35:58 +0000</pubDate>
</item>
<item>
<title>Answered: How to draw a simple cuboid using plain ASCII art in C++</title>
<link>https://collectivesolver.com/97350/how-to-draw-a-simple-cuboid-using-plain-ascii-art-in-c?show=97352#a97352</link>
<description>&lt;pre class=&quot;brush:cpp;&quot;&gt;#include &amp;lt;iostream&amp;gt;

using std::cout;
using std::endl;

int main() {

    // ---------------------------------------------------------
    //   A cleaner, more proportional cuboid
    // ---------------------------------------------------------

    cout &amp;lt;&amp;lt; &quot;     +----------+&quot; &amp;lt;&amp;lt; endl;
    cout &amp;lt;&amp;lt; &quot;    /          /|&quot; &amp;lt;&amp;lt; endl;
    cout &amp;lt;&amp;lt; &quot;   /          / |&quot; &amp;lt;&amp;lt; endl;
    cout &amp;lt;&amp;lt; &quot;  +----------+  |&quot; &amp;lt;&amp;lt; endl;
    cout &amp;lt;&amp;lt; &quot;  |          |  +&quot; &amp;lt;&amp;lt; endl;
    cout &amp;lt;&amp;lt; &quot;  |          | /&quot; &amp;lt;&amp;lt; endl;
    cout &amp;lt;&amp;lt; &quot;  |          |/&quot; &amp;lt;&amp;lt; endl;
    cout &amp;lt;&amp;lt; &quot;  +----------+&quot; &amp;lt;&amp;lt; endl;
}



/*
run:

     +----------+
    /          /|
   /          / |
  +----------+  |
  |          |  +
  |          | /
  |          |/
  +----------+

*/&lt;/pre&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
<guid isPermaLink="true">https://collectivesolver.com/97350/how-to-draw-a-simple-cuboid-using-plain-ascii-art-in-c?show=97352#a97352</guid>
<pubDate>Thu, 14 May 2026 14:00:17 +0000</pubDate>
</item>
<item>
<title>Answered: How to compress and decompress repeated string characters by storing the repeated length (RLE) in Swift</title>
<link>https://collectivesolver.com/97348/how-to-compress-and-decompress-repeated-string-characters-by-storing-the-repeated-length-rle-in-swift?show=97349#a97349</link>
<description>&lt;pre class=&quot;brush:jscript;&quot;&gt;import Foundation

/* ---------------------------------------------------------
   Compress: turn &quot;aaabbcccc&quot; into &quot;a3b2c4&quot;
   This is run-length encoding (RLE)
   --------------------------------------------------------- */
func compress(_ s: String) -&amp;gt; String {
    if s.isEmpty {
        return &quot;&quot;   // Edge case: empty string
    }

    var out = &quot;&quot;                // Result string
    var count = 1               // Count of repeated characters
    let chars = Array(s)

    // Start from index 1 and compare with previous character
    for i in 1...chars.count {

        // If still repeating the same character, increase count
        if i &amp;lt; chars.count &amp;amp;&amp;amp; chars[i] == chars[i - 1] {
            count += 1
        } else {
            // Character changed OR reached end of string
            out.append(chars[i - 1])          // Add the character
            out.append(String(count))         // Add how many times it repeated
            count = 1                         // Reset counter
        }
    }

    return out
}


/* ---------------------------------------------------------
   Decompress: turn &quot;a3b2c4&quot; into &quot;aaabbcccc&quot;
   Reads a letter, then reads digits, expands them.
   --------------------------------------------------------- */
func decompress(_ s: String) -&amp;gt; String {
    var out = &quot;&quot;                 // Result string
    var currentChar: Character?  // The character being processed
    var number = &quot;&quot;              // Digits representing the count

    for c in s {

        if c.isLetter {          // Found a letter
            // If we already have a previous letter + number, expand it
            if let ch = currentChar, !number.isEmpty {
                if let count = Int(number) {
                    out.append(String(repeating: String(ch), count: count))
                }
            }

            currentChar = c      // Start new character
            number = &quot;&quot;          // Reset number buffer

        } else if c.isNumber {   // Found a digit
            number.append(c)     // Build multi-digit number
        }
    }

    // Handle the last character + number pair
    if let ch = currentChar, !number.isEmpty {
        if let count = Int(number) {
            out.append(String(repeating: String(ch), count: count))
        }
    }

    return out
}


func main() {
    let s = &quot;wwwwwwwwwwwwbwwwwwwwwwwbbbwwwwwwccccwwwwwwwwwwww&quot;

    let c = compress(s)
    let d = decompress(c)

    print(&quot;Original:    \(s)&quot;)
    print(&quot;Compressed:  \(c)&quot;)
    print(&quot;Decompressed: \(d)&quot;)
}

main()



/*
run:

Original:    wwwwwwwwwwwwbwwwwwwwwwwbbbwwwwwwccccwwwwwwwwwwww
Compressed:  w12b1w10b3w6c4w12
Decompressed: wwwwwwwwwwwwbwwwwwwwwwwbbbwwwwwwccccwwwwwwwwwwww

*/
&lt;/pre&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
<guid isPermaLink="true">https://collectivesolver.com/97348/how-to-compress-and-decompress-repeated-string-characters-by-storing-the-repeated-length-rle-in-swift?show=97349#a97349</guid>
<pubDate>Thu, 14 May 2026 08:17:12 +0000</pubDate>
</item>
<item>
<title>Answered: How to compress and decompress repeated string characters by storing the repeated length (RLE) in Kotlin</title>
<link>https://collectivesolver.com/97346/how-to-compress-and-decompress-repeated-string-characters-by-storing-the-repeated-length-rle-in-kotlin?show=97347#a97347</link>
<description>&lt;pre class=&quot;brush:jscript;&quot;&gt;/* ---------------------------------------------------------
   Compress: turn &quot;aaabbcccc&quot; into &quot;a3b2c4&quot;
   This is run-length encoding (RLE)
   --------------------------------------------------------- */
fun compress(s: String): String {
    if (s.isEmpty()) return &quot;&quot;   // Edge case: empty string

    val out = StringBuilder()    // Result string
    var count = 1                // Count of repeated characters

    // Start from index 1 and compare with previous character
    for (i in 1..s.length) {

        // If still repeating the same character, increase count
        if (i &amp;lt; s.length &amp;amp;&amp;amp; s[i] == s[i - 1]) {
            count++
        } else {
            // Character changed OR reached end of string
            out.append(s[i - 1])      // Add the character
            out.append(count)         // Add how many times it repeated
            count = 1                 // Reset counter
        }
    }

    return out.toString()
}


/* ---------------------------------------------------------
   Decompress: turn &quot;a3b2c4&quot; into &quot;aaabbcccc&quot;
   Reads a letter, then reads digits, expands them.
   --------------------------------------------------------- */
fun decompress(s: String): String {
    val out = StringBuilder()         // Result string
    var currentChar: Char? = null     // The character being processed
    val number = StringBuilder()      // Digits representing the count

    for (c in s) {

        if (c.isLetter()) {           // Found a letter
            // If we already have a previous letter + number, expand it
            if (currentChar != null &amp;amp;&amp;amp; number.isNotEmpty()) {
                val count = number.toString().toInt()
                out.append(currentChar.toString().repeat(count))
            }

            currentChar = c           // Start new character
            number.clear()            // Reset number buffer

        } else if (c.isDigit()) {     // Found a digit
            number.append(c)          // Build multi-digit number
        }
    }

    // Handle the last character + number pair
    if (currentChar != null &amp;amp;&amp;amp; number.isNotEmpty()) {
        val count = number.toString().toInt()
        out.append(currentChar.toString().repeat(count))
    }

    return out.toString()
}


fun main() {
    val s = &quot;wwwwwwwwwwwwbwwwwwwwwwwbbbwwwwwwccccwwwwwwwwwwww&quot;

    val c = compress(s)
    val d = decompress(c)

    println(&quot;Original:    $s&quot;)
    println(&quot;Compressed:  $c&quot;)
    println(&quot;Decompressed: $d&quot;)
}


/*
run:

Original:    wwwwwwwwwwwwbwwwwwwwwwwbbbwwwwwwccccwwwwwwwwwwww
Compressed:  w12b1w10b3w6c4w12
Decompressed: wwwwwwwwwwwwbwwwwwwwwwwbbbwwwwwwccccwwwwwwwwwwww

*/
&lt;/pre&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
<guid isPermaLink="true">https://collectivesolver.com/97346/how-to-compress-and-decompress-repeated-string-characters-by-storing-the-repeated-length-rle-in-kotlin?show=97347#a97347</guid>
<pubDate>Thu, 14 May 2026 08:15:11 +0000</pubDate>
</item>
<item>
<title>Answered: How to compress and decompress repeated string characters by storing the repeated length (RLE) in Scala</title>
<link>https://collectivesolver.com/97344/how-to-compress-and-decompress-repeated-string-characters-by-storing-the-repeated-length-rle-in-scala?show=97345#a97345</link>
<description>&lt;pre class=&quot;brush:scala;&quot;&gt;import scala.collection.mutable.StringBuilder

/* ---------------------------------------------------------
   Compress: turn &quot;aaabbcccc&quot; into &quot;a3b2c4&quot;
   This is run-length encoding (RLE)
   --------------------------------------------------------- */
def compress(s: String): String = {
  if (s.isEmpty)
    return &quot;&quot;   // Edge case: empty string

  val out = new StringBuilder()   // Result string
  var count = 1                   // Count of repeated characters

  // Start from index 1 and compare with previous character
  for (i &amp;lt;- 1 to s.length) {

    // If still repeating the same character, increase count
    if (i &amp;lt; s.length &amp;amp;&amp;amp; s(i) == s(i - 1)) {
      count += 1
    } else {
      // Character changed OR reached end of string
      out.append(s(i - 1))        // Add the character
      out.append(count.toString)  // Add how many times it repeated
      count = 1                   // Reset counter
    }
  }

  out.toString()
}


/* ---------------------------------------------------------
   Decompress: turn &quot;a3b2c4&quot; into &quot;aaabbcccc&quot;
   Reads a letter, then reads digits, expands them.
   --------------------------------------------------------- */
def decompress(s: String): String = {
  val out = new StringBuilder()   // Result string
  var currentChar: Option[Char] = None   // The character being processed
  val number = new StringBuilder()       // Digits representing the count

  for (c &amp;lt;- s) {

    if (c.isLetter) {             // Found a letter
      // If we already have a previous letter + number, expand it
      currentChar.foreach { ch =&amp;gt;
        if (number.nonEmpty) {
          val count = number.toString.toInt
          out.append(ch.toString * count)
        }
      }

      currentChar = Some(c)       // Start new character
      number.clear()              // Reset number buffer

    } else if (c.isDigit) {       // Found a digit
      number.append(c)            // Build multi-digit number
    }
  }

  // Handle the last character + number pair
  currentChar.foreach { ch =&amp;gt;
    if (number.nonEmpty) {
      val count = number.toString.toInt
      out.append(ch.toString * count)
    }
  }

  out.toString()
}


@main def main(): Unit = {
  val s = &quot;wwwwwwwwwwwwbwwwwwwwwwwbbbwwwwwwccccwwwwwwwwwwww&quot;

  val c = compress(s)
  val d = decompress(c)

  println(s&quot;Original:    $s&quot;)
  println(s&quot;Compressed:  $c&quot;)
  println(s&quot;Decompressed: $d&quot;)
}



/*
run:

Original:    wwwwwwwwwwwwbwwwwwwwwwwbbbwwwwwwccccwwwwwwwwwwww
Compressed:  w12b1w10b3w6c4w12
Decompressed: wwwwwwwwwwwwbwwwwwwwwwwbbbwwwwwwccccwwwwwwwwwwww

*/
&lt;/pre&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
<guid isPermaLink="true">https://collectivesolver.com/97344/how-to-compress-and-decompress-repeated-string-characters-by-storing-the-repeated-length-rle-in-scala?show=97345#a97345</guid>
<pubDate>Thu, 14 May 2026 08:13:30 +0000</pubDate>
</item>
<item>
<title>How to compress and decompress repeated string characters by storing the repeated length (RLE) in Ruby</title>
<link>https://collectivesolver.com/97342/how-to-compress-and-decompress-repeated-string-characters-by-storing-the-repeated-length-rle-in-ruby</link>
<description></description>
<guid isPermaLink="true">https://collectivesolver.com/97342/how-to-compress-and-decompress-repeated-string-characters-by-storing-the-repeated-length-rle-in-ruby</guid>
<pubDate>Thu, 14 May 2026 08:08:10 +0000</pubDate>
</item>
<item>
<title>How to compress and decompress repeated string characters by storing the repeated length (RLE) in Rust</title>
<link>https://collectivesolver.com/97340/how-to-compress-and-decompress-repeated-string-characters-by-storing-the-repeated-length-rle-in-rust</link>
<description></description>
<guid isPermaLink="true">https://collectivesolver.com/97340/how-to-compress-and-decompress-repeated-string-characters-by-storing-the-repeated-length-rle-in-rust</guid>
<pubDate>Thu, 14 May 2026 08:06:09 +0000</pubDate>
</item>
<item>
<title>How to compress and decompress repeated string characters by storing the repeated length (RLE) in Go</title>
<link>https://collectivesolver.com/97338/how-to-compress-and-decompress-repeated-string-characters-by-storing-the-repeated-length-rle-in-go</link>
<description></description>
<guid isPermaLink="true">https://collectivesolver.com/97338/how-to-compress-and-decompress-repeated-string-characters-by-storing-the-repeated-length-rle-in-go</guid>
<pubDate>Thu, 14 May 2026 08:00:30 +0000</pubDate>
</item>
<item>
<title>How to compress and decompress repeated string characters by storing the repeated length (RLE) in TypeScript</title>
<link>https://collectivesolver.com/97336/how-to-compress-and-decompress-repeated-string-characters-by-storing-the-repeated-length-rle-in-typescript</link>
<description></description>
<guid isPermaLink="true">https://collectivesolver.com/97336/how-to-compress-and-decompress-repeated-string-characters-by-storing-the-repeated-length-rle-in-typescript</guid>
<pubDate>Thu, 14 May 2026 07:57:03 +0000</pubDate>
</item>
<item>
<title>How to compress and decompress repeated string characters by storing the repeated length (RLE) in JavaScript</title>
<link>https://collectivesolver.com/97334/how-to-compress-and-decompress-repeated-string-characters-by-storing-the-repeated-length-rle-in-javascript</link>
<description></description>
<guid isPermaLink="true">https://collectivesolver.com/97334/how-to-compress-and-decompress-repeated-string-characters-by-storing-the-repeated-length-rle-in-javascript</guid>
<pubDate>Thu, 14 May 2026 07:49:11 +0000</pubDate>
</item>
</channel>
</rss>