PDA

View Full Version : Some Help With This ?



RizlaUK
02-26-2010, 03:57 PM
ok, im typeing line after line of SQL querys adding test data to a database thinking "there must be a way to automate this" as i want to stress test my app with the database and my dialogs i needs loads of data, but i dont just wand random text i want coherent data

so after a quick google and saw many random name generators but non did what i wanted and all were not free

so i started this script that has tables of male first, female first, and last names and a few functions to retrive a random set forming a name and email address

but this still isent enough, i need random addresses too, but now im getting stuck for time

if anyone fancy s giving me 100 random address sets id be grateful

format and requirments:

road names, as many as you can think of (target 1000)

tADDRESS_RoadName[1]="Merrydown"
tADDRESS_RoadName[1]="Ashworth"
tADDRESS_RoadName[1]="Faylen"

just random citys will do (target 1000+)

tADDRESS_City[1]="NewYork"
tADDRESS_City[2]="Paris"
tADDRESS_City[3]="London"
tADDRESS_City[4]="Pekham"

any random zip/postal code will do (target 1000+)

tADDRESS_Zip[1]="ORJ 518"
tADDRESS_Zip[2]="W23 HGJ"
tADDRESS_Zip[3]="XPG 667"

road types, need some more

tADDRESS_RoadType[1]="Road"
tADDRESS_RoadType[1]="Avenue"
tADDRESS_RoadType[1]="Close"

email suffix, need more

tEMAIL_Suffix[1]="googlemail.com"
tEMAIL_Suffix[2]="rocketmail.com"
tEMAIL_Suffix[3]="yahoo.co.uk"

what iv got

1000 english female names
300 english male names
1000 english last names

and im adding names from other country's

when this is done i will release the script, this will be handy for anyone that wants/needs to fill a database with random people (quickly) and have coherent readable data

Centauri Soldier
02-26-2010, 04:30 PM
That's a tall order. Data sets that large are not easy to come by.

I found a list of 314 cities. Now, keep in mind, there are no repeats in "Cities Table.txt" so if you need more entries (1000 total) and don't mind repeats then just download the "Cities Large Table.txt" file.

How do you feel about sharing your names datasets as text files?

RizlaUK
02-26-2010, 04:32 PM
hey, that helps a lot, i can extract the info i need from the text

now i need some road names, the rest is easy, thanks CS :yes

EDIT: already formatted, nice one :)

Centauri Soldier
02-26-2010, 05:14 PM
Here's some street names. I built a generator based on this site http://www.jimwegryn.com/Names/StreetNameGenerator.htm

Imagine Programming
02-26-2010, 05:24 PM
Here's some street names. I built a generator based on this site http://www.jimwegryn.com/Names/StreetNameGenerator.htm

Oh boy, great generator! :D



undefined Landing


Hmm, undefined var in javascript I guess :p

Centauri Soldier
02-26-2010, 05:29 PM
Well, here's the generator I built...


local tSreetsNames = {};
tSreetsNames.Prefix = {"Amber", "Bright", "Broad", "Burning", "Cinder", "Clear", "Colonial", "Cotton", "Cozy", "Crystal", "Dewy", "Dusty", "Easy", "Emerald", "Fallen", "Foggy", "Gentle", "Golden", "Grand", "Green", "Harvest", "Hazy", "Heather", "Hidden", "High", "Honey", "Indian", "Iron", "Jagged", "Lazy", "Little", "Lost", "Merry", "Middle", "Misty", "Noble", "Old", "Pleasant", "Quaking", "Quiet", "Red", "Rocky", "Round", "Rustic", "Shady", "Silent", "Silver", "Sleepy", "Stony", "Sunny", "Tawny", "Thunder", "Umber", "Velvet", "Wishing"};
tSreetsNames.Middle = {"Anchor", "Autumn", "Barn", "Beacon", "Bear", "Berry", "Blossom", "Bluff", "Branch", "Brook", "Butterfly", "Cider", "Cloud", "Creek", "Dale", "Deer", "Elk", "Embers", "Fawn", "Forest", "Fox", "Gate", "Goose", "Grove", "Hickory", "Hills", "Horse", "Island", "Lagoon", "Lake", "Leaf", "Log", "Mountain", "Nectar", "Oak", "Panda", "Pine", "Pioneer", "Pond", "Pony", "Prairie", "Quail", "Rabbit", "River", "Rise", "Robin", "Shadow", "Sky", "Spring", "Timber", "Treasure", "View", "Wagon ", "Willow", "Zephyr"};
tSreetsNames.Suffix = {"Acres", "Avenue", "Bank", "Bend", "Canyon", "Chase", "Circle", "Corner", "Court", "Cove", "Crest", "Dale", "Dell", "Edge", "Estates", "Falls", "Farms", "Gardens", "Gate", "Glade", "Glen", "Grove", "Highlands", "Hollow", "Isle", "Jetty", "Knoll", "Landing", "Lane", "Ledge", "Manor", "Meadow", "Mews", "Nook", "Orchard", "Park", "Path", "Pike", "Place", "Point", "Promenade", "Ridge", "Road", "Round", "Run", "Stead", "Swale", "Terrace", "Trace", "Trail", "Vale", "Valley", "View", "Vista", "Way", "Woods"};

local nMax1 = Table.Count(tSreetsNames.Prefix);
local nMax2 = Table.Count(tSreetsNames.Middle);
local nMax3 = Table.Count(tSreetsNames.Suffix);

local sRet = "";

for x = 1, 2000 do
local sStreet = "";
local nRoll = Math.Random(1, 10);

if nRoll < 4 then
sStreet = tSreetsNames.Prefix[Math.Random(1, nMax1)].." "..tSreetsNames.Middle[Math.Random(1, nMax2)].." "..tSreetsNames.Suffix[Math.Random(1, nMax3)];
elseif nRoll > 3 and nRoll < 8 then
sStreet = tSreetsNames.Prefix[Math.Random(1, nMax1)].." "..tSreetsNames.Suffix[Math.Random(1, nMax3)];
elseif nRoll > 7 then
sStreet = tSreetsNames.Middle[Math.Random(1, nMax2)].." "..tSreetsNames.Suffix[Math.Random(1, nMax3)];
end

sRet = sRet.."\r\n".."tADDRESS_RoadName["..x.."] = \""..sStreet.."\";";
end

sRet = String.Replace(sRet, " ", " ", false);
TextFile.WriteFromString("C:\\Street Names (2000).txt", sRet, false);


(@ Rizla) Here's the city generator too in case you want something different.

local tCities = TextFile.ReadToTable("C:\\City List.txt");

local nMax = Table.Count(tCities);
local sRet = "";

for x = 1, 1000 do
sRet = sRet.."\r\n".."tADDRESS_City["..x.."] = \""..tCities[Math.Random(1, nMax)].."\";";
end

TextFile.WriteFromString("C:\\Cities Large Table.txt", sRet, false);

RizlaUK
02-26-2010, 06:00 PM
Well, here's the generator I built...

Perfect, i can work that directly into the script :yes

Imagine Programming
02-27-2010, 12:30 AM
Nice one Centauri :yes

Centauri Soldier
02-27-2010, 01:14 AM
Thanks mate! Glad to Help :).