diff options
author | initial.commit <initial.commit@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-07-27 00:38:33 +0000 |
---|---|---|
committer | initial.commit <initial.commit@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-07-27 00:38:33 +0000 |
commit | 584cd5cbd7be997400ccb8db24ae5410b0b88117 (patch) | |
tree | 083e5f1f48d019e0f07b96fef7179483df53c823 /third_party/libxml/dbgen.pl | |
parent | f5b16fed647e941aa66933178da85db2860d639b (diff) | |
download | chromium_src-584cd5cbd7be997400ccb8db24ae5410b0b88117.zip chromium_src-584cd5cbd7be997400ccb8db24ae5410b0b88117.tar.gz chromium_src-584cd5cbd7be997400ccb8db24ae5410b0b88117.tar.bz2 |
Add third_party to the repository.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'third_party/libxml/dbgen.pl')
-rw-r--r-- | third_party/libxml/dbgen.pl | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/third_party/libxml/dbgen.pl b/third_party/libxml/dbgen.pl new file mode 100644 index 0000000..1383d6e --- /dev/null +++ b/third_party/libxml/dbgen.pl @@ -0,0 +1,43 @@ +#!/usr/bin/perl + +$size = shift; + +if ($size eq "") +{ + die "usage: dbgen.pl [size]\n"; +} + +@firstnames = ("Al", "Bob", "Charles", "David", "Egon", "Farbood", + "George", "Hank", "Inki", "James"); +@lastnames = ("Aranow", "Barker", "Corsetti", "Dershowitz", "Engleman", + "Franklin", "Grice", "Haverford", "Ilvedson", "Jones"); +@states = ("AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DE", "FL", "GA", + "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD", + "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ", + "NM", "NY", "NC", "ND", "OH", "OK", "OR", "PA", "RI", "SC", + "SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY"); + +print "<?xml version=\"1.0\"?>\n"; +print "\n"; +print "<table>\n"; + +for ($i=0; $i<$size; $i++) +{ + $first = $firstnames [$i % 10]; + $last = $lastnames [($i / 10) % 10]; + $state = $states [($i / 100) % 50]; + $zip = 22000 + $i / 5000; + + printf " <row>\n"; + printf " <id>%04d</id>\n", $i; + printf " <firstname>$first</firstname>\n", $i; + printf " <lastname>$last</lastname>\n", $i; + printf " <street>%d Any St.</street>\n", ($i % 100) + 1; + printf " <city>Anytown</city>\n"; + printf " <state>$state</state>\n"; + printf " <zip>%d</zip>\n", $zip; + printf " </row>\n"; +} + +print "</table>\n"; + |