生成人员数据的来源?

发布于 2024-07-23 12:09:49 字数 204 浏览 11 评论 0原文

这只是一个无关紧要的编程问题。 在哪里可以找到易于解析的人名列表? 这实际上只是填充材料,因此它们不需要太多押韵或理由。

或者,当您需要创建一堆虚拟时,是否有相当于 lorem ipsum 的程序员账户?

This is only tangentially a programming question. Where can I find a simple-to-parse list of people names? This is really just filler material, so they don't need much rhyme or reason.

Alternatively, is there a programmer's equivalent to lorem ipsum for when you need to create a bunch of dummy accounts?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

冷…雨湿花 2024-07-30 12:09:49

您可以从 names.txt(46 KiB,逗号分隔值)中随机抽取名称 < a href="http://projecteuler.net" rel="nofollow noreferrer">Project Euler 问题 22.


编辑美国人口普查局拥有统计数据名字和姓氏

You could draw names randomly from names.txt (46 KiB, comma-separated values) from Project Euler problem 22.


EDIT: The U.S. Census Bureau has statistical data for first and last names.

一曲琵琶半遮面シ 2024-07-30 12:09:49

查看 http://www.generateata.com

本杰明·基恩 (Benjamin Keen) 创建了这个出色的工具,可能符合要求为你。

Check out http://www.generatedata.com

Benjamin Keen has created this terrific tool that would probably fit the bill for you.

十雾 2024-07-30 12:09:49

您始终可以使用一堆名称和数字:

firsts = [ "Dave", "John", "Jane", "Jack", ...];
seconds = [ "McMuffin", "Frontage", "Bush", "McProgrammer", ...];

for f in firsts {
    for s in seconds {
        for( i=0; i<10; i++){
            tmp_user = f + "_" + s + i;
            // Add user to database
        }
    }
}

如果您添加更多的用户名,那就是相当多的用户名了:)

祝你好运

You could always use a bunch of names and numbers:

firsts = [ "Dave", "John", "Jane", "Jack", ...];
seconds = [ "McMuffin", "Frontage", "Bush", "McProgrammer", ...];

for f in firsts {
    for s in seconds {
        for( i=0; i<10; i++){
            tmp_user = f + "_" + s + i;
            // Add user to database
        }
    }
}

That's quite alot of usernames if you add a few more :)

Good Luck

葬花如无物 2024-07-30 12:09:49

如果您只需要一些文本而不关心它的外观,您可以使用 Excel 之类的工具来生成一个大的姓名列表。

例如:在单元格 A1 中输入 ="FirstName" & ROW(A1) 然后选择您想要的行数并向下填充。 在 B 列中对姓氏执行相同操作,另存为 CSV 并导入到数据库中。

或者你可以更聪明一点:在 A 列中放入一些名字,在 B 列中放入一些姓氏。

C1 的公式:

=OFFSET(A$1,INT(RAND()*[[number_of_first_names]]),0)

D1 的公式类似:

=OFFSET(B$1,INT(RAND()*[[number_of_last_names]]),0)

If you just need some text and dont care how it looks, you could use something like Excel to generate a big list of names.

eg: in cell A1 enter ="FirstName" & ROW(A1) then select however many rows you want and fill down. In column B do the same for surname, save as CSV and import into your DB.

Or you could get a little smarter: Put some first names in column A and some surnames in column B.

Formula for C1:

=OFFSET(A$1,INT(RAND()*[[number_of_first_names]]),0)

and something similar for D1:

=OFFSET(B$1,INT(RAND()*[[number_of_last_names]]),0)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文