MKoD - D Programming Language

Randomly generated names and addresses for a personnel table - D Project

Random Data in the Red-Orbs font
This is personal project I worked on at home after work two years ago, and had gotten it nearly 90% done at the time. But life, has a way turning your focus onto other things, yet I had always wanted to finish it. The main idea behind it, is to create realistic randomly generated personnel names, gender, birthdays, phone numbers and full addresses for the creation of a set of personnel tables into a company database for testing data purposes. And if you've ever seen some of the dummy data that people create into their testing databases, then you'll know why I thought this kind of project would be worth while to make. :)

Currently I'm working toward creating a USA only version (since I collected and formated the data already needed), but once I've finished this project it would be nice, to turn around and do an International version. We'll see.

24.Aug.04: After having converted wincon.h, sql.h, sqlext.h, sqltypes.h, and sqlucode.h to D I'm beginning to have a small foundation in which to start building a console front-end with ODBC32.DLL support, that'll give me the ability to gather / store data to and from a Database. Also with Walter (he's a very busy man!) finally putting the ifind() and irfind() functions into Phobos, I can now start moving on writing my text-based functions...my project's work-horses. Plus, I've decided to rename the propercase() function to asciiProperCase(), which should better identity that this function operates only on 7-bit ASCII (0x00 thru 0x7F) characters...as I'm very sure Regan Heath and Arcane Jill the D unicode experts would be quick to point out, once I've placed a link to this code on the D forum. :P

17.Nov.04: Well after reworking all the XML data files a bit to make them smaller (they're nearly half the size now), and reformated them some so they'll work better with my Text-Based/Read Only XML Class, that I'm calling "toyXML" (mainly because I had designed three different XML Classes and the simplest one based off my original VB6 design won out), I've decided to put the data up for downloading. Hopefully within a few more weeks I should have the D code ready for downloading as well. In which, the code will be designed (Stage I) to run as a commandline app that'll use a config-type setup XML file, and to output the randomizes data as XML files. Later I'll focus on a more GUI frontend type of app (Stage II) with options to export the data into a Database using the ODBC32 APIs, and to create different types of export files (XML, Comma-Delimited, Fixed-Length, and etc.) for later importing into a Database. :))

03.Dec.04: The console only version (Stage I) is how ready for people to use, please download both zipfiles ( one's the XML data, and the other one the D code ). Enjoy! It may take me a while on the GUI frontend (Stage II)...I'll need to play around bit with some of the GUI librarys, before moving forward. Meanwhile I do plan to keep updating the console version, because afterall it's the core logic to be used in the GUI version and cause I haven't added everything I want yet into this current build.

08.Jan.05: A special thanks goes out to Simon Sweetman for the eMail that pointed out a good web site to get even more names...in fact, "Last Names" have increased a to whopping 88,588 entries, plus the "Male and Female First Names" are a little bit larger than before as well. Which is why the download zipfile has almost doubled in size, and why the "Random Data" program will take many times longer to process too. But the idea is to create data once and import into a database...so I don't see this as a "Show Stopper," in fact it makes for much better random data! (Plus, I'll focus on tuning the D code a little later on...so it won't be that bad.)

29.Jan.05: Increased USA_street_names.xml from 1,000 entries to 4,000 street names.
27.Feb.05: Increased USA_female_first_names.xml from 5,114 entries to 9,462 names, and USA_male_first_names.xml from 2,178 entries to 5,408 names.
10.Jun.05: Recompiled and tested with dmd v0.126.
17.Sep.05: Recompiled and tested with dmd v0.131, also added 128 Female first names.
18.Sep.05: Did some performance turing to the code, which saves 5 minutes on a 23 minute process (based on multiple runs done on my 1.8Ghz Intel) when creating 10,000 entries.
14.Jan.06 Recompiled and Tested with dmd v0.143.
26.Mar.06 Recompiled and Tested with dmd v0.150, and added the genBirthDate() function which takes in the age of the person as an input parameter to create a birth date for them.

  • RandomDataXML v0.45 - XML data for randomly creating Names, and Addresses - 100% Done

    • 88,588 USA Last Names - USA_last_names.xml
    • 5,408 USA Male First Names - USA_male_first_names.xml
    • 147 USA Male Middle Names - USA_male_middle_names.xml
    • 9,644 USA Female First Names - USA_female_first_names.xml
    • 375 USA Female Middle Names - USA_female_middle_names.xml
    • 20 USA Both Gender Middle Names - USA_bothsexes_middle_names.xml
    • 204 USA Street Suffixes Abbreviations - USA_street_suffixes_Abbr.xml
    • 23 USA Secondary Unit Designator Abbreviations - USA_sec_unit_designator_abbr.xml
    • 58 USA State Abbreviations - USA_state_abbr.xml
    • 4000 USA Street Names - USA_street_names.xml
    • USA City Names, Zipcodes, Areacodes, and Countys - 1 file for each of the 50 States plus 2
    • 3 Basic USA Address Templates - USA_address_templates.xml


  • toyXML Class v0.24 (case insensitive) - toyxml.d

    -= Public class member functions =-
    • void loadXMLDocument( in char[] ) - 100% Done, with unittests.
    • void saveXMLDocument( in char[] ) - 100% Done.
    • ulong ulXMLDocumentLength() - 100% Done, with unittests.
    • char[] getChildNodes( in char[], in uint = 0 ) - 100% Done, with unittests.
    • uint getNumOfNodes( in char[] ) - 100% Done, with unittests.
    • char[] getNodeValueByPosition( in char[], in uint ) - 100% Done, with unittests.
    • char[] getAttrValue( in char[], in char[] ) - 100% Done, with unittests.
    • char[] getNodeValueByAttr( in char[], in char[], in char[] ) - 100% Done, with unittests.
    • char[] getNodeValueByAttr( in char[], in char[], in char[], out uint ) - 100% Done, with unittests.
    • char[] getNodeValueByAttr( in char[], in char[], in int ) - 100% Done, with unittests.
    • char[] getNodeValueByAttr( in char[], in char[], in int, out uint ) - 100% Done, with unittests.
    • char[] getNodeValue( in char[], in uint = 0U ) - 100% Done, with unittests.
    • char[] getXML( in uint = 0U, in uint = uint.max ) - 100% Done, with unittests.

    -= Private class member functions =-
    • char[] loadXMLFile( in char[] ) - 100% Done, with unittests.
    • char[] doInitialCheck( in char[] ) - 100% Done, with unittests.


  • RandomDataCode v0.25 : randomdata.d functions

    • int getStateFilenames( in char[], inout udtXmlInfo[] ) - 100% Done.
    • int getNameFilenames( in char[], inout udtXmlInfo[] ) - 100% Done.
    • int getAddrFilenames( in char[], inout udtXmlInfo[] ) - 100% Done.
    • void loadStateXMLs( in char[], inout udtXmlInfo[], inout toyXML[] ) - 100% Done.
    • void loadNameXMLs( in char[], inout udtXmlInfo[], inout toyXML[] ) - 100% Done.
    • void loadAddrXMLs( in char[], inout udtXmlInfo[], inout toyXML[] ) - 100% Done.
    • void genFemaleName( in udtXmlInfo[], in toyXML[], out char[], out char[], out char[] ) - 100% Done.
    • void genMaleName( in udtXmlInfo[], in toyXML[], out char[], out char[], out char[] ) - 100% Done.
    • void genAddress( in udtXmlInfo[], in toyXML[], out char[], out char[], out char[] ) - 100% Done.
    • void genCityStateZipCode( in udtXmlInfo[], in toyXML[], out char[], out char[], out char[] out char[] ) - 100% Done.
    • void getOutputOptions( in char[], out char[], out uint ) - 100% Done.
    • uint getRandomNumber( in uint = 0x0, in uint = 0xFFFFFFFF ) - 100% Done.
    • char[] genBirthDate( in uint ) - 100% Done.

    NOTE: That the download zipfile below, includes both toyxml.d v0.24, stringplus.d v0.13, and stringbuffer.d v0.12.


  • a Database Wrapper / Import Method - 40% Done (Converted ODBC32.DLL headers to D)

    • MS SQL Server 7.0 / 2000 / MSDE 2000 / 2005 / 2005 Express ( "The Best SQL Server out there!!" )
    • MS Access 2000 / XP
    • maybe MySQL and others



Discover Mars Magik