VirtualBox

source: vbox/trunk/src/libs/libxml2-2.6.30/dbgenattr.pl@ 20364

最後變更 在這個檔案從20364是 6076,由 vboxsync 提交於 17 年 前

Merged dmik/s2 branch (r25959:26751) to the trunk.

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Date Revision Author Id
檔案大小: 1.3 KB
 
1#!/usr/bin/perl
2
3$size = shift;
4
5if ($size eq "")
6{
7 die "usage: dbgen.pl [size]\n";
8}
9
10@firstnames = ("Al", "Bob", "Charles", "David", "Egon", "Farbood",
11 "George", "Hank", "Inki", "James");
12@lastnames = ("Aranow", "Barker", "Corsetti", "Dershowitz", "Engleman",
13 "Franklin", "Grice", "Haverford", "Ilvedson", "Jones");
14@states = ("AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DE", "FL", "GA",
15 "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD",
16 "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ",
17 "NM", "NY", "NC", "ND", "OH", "OK", "OR", "PA", "RI", "SC",
18 "SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY");
19
20print "<?xml version=\"1.0\"?>\n";
21print "\n";
22print "<table>\n";
23
24for ($i=0; $i<$size; $i++)
25{
26 $first = $firstnames [$i % 10];
27 $last = $lastnames [($i / 10) % 10];
28 $state = $states [($i / 100) % 50];
29 $zip = 22000 + $i / 5000;
30
31 printf " <row\n";
32 printf " id='%04d'\n", $i;
33 printf " firstname='$first'\n", $i;
34 printf " lastname='$last'\n", $i;
35 printf " street='%d Any St.'\n", ($i % 100) + 1;
36 printf " city='Anytown'\n";
37 printf " state='$state'\n";
38 printf " zip='%d'/>\n", $zip;
39}
40
41print "</table>\n";
42
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette