test-data

Traveling salesman example with known global optimum

六月ゝ 毕业季﹏ 提交于 2019-12-05 06:03:05
I made a memetic algorithm in Python for traveling salesman problem . However, all the test data (list of distances between cities) I've encountered lack the information of the best solution, so I can't know how close to global optimum my algorithm gets. Does anyone know where I can find some tsp test data (preferably in matrix form, but anything's good) with known best solution? Did you google? http://www.tsp.gatech.edu/data/index.html That page provides several test-cases of which 16 has an optimal solution. Perhaps you can generate your own test data? This definitely won't be comprehensive

Is there a Social Security Number reserved for testing/examples?

送分小仙女□ 提交于 2019-12-03 05:24:05
问题 Is there a canonical "test SSN" that is used by convention, so is understood by all who see it that it is not a real SSN? 回答1: To expand on the Wikipedia-based answers: The Social Security Administration (SSA) explicitly states in this document that the having "000" in the first group of numbers "will NEVER be a valid SSN": http://www.socialsecurity.gov/employer/stateweb.htm I'd consider that pretty definitive. However, that the 2nd or 3rd groups of numbers won't be "00" or "0000" can be

List of mock valid/invalid Email Addresses for Unit Tests

北城余情 提交于 2019-12-02 23:36:12
Does anyone know of a list of email addresses (which don’t need to be real) I can use for an email validation assembly for a unit test? I’ve been looking for such a list and can’t seem to find one. I’m not looking for real addresses, just ones that fit, and the more things I can throw at the test the better. I’ve got 10 right now, but if there is a list, it would give me a more thorough test. I believe you were looking for something like this: List of Valid and Invalid Email Addresses Check the tests of the Apache Commons EmailValidator class: EmailTest , EmailValidatorTest . The

Is there a Social Security Number reserved for testing/examples?

限于喜欢 提交于 2019-12-02 19:48:23
Is there a canonical "test SSN" that is used by convention, so is understood by all who see it that it is not a real SSN? Michael Burr To expand on the Wikipedia-based answers: The Social Security Administration (SSA) explicitly states in this document that the having "000" in the first group of numbers "will NEVER be a valid SSN": http://www.socialsecurity.gov/employer/stateweb.htm I'd consider that pretty definitive. However, that the 2nd or 3rd groups of numbers won't be "00" or "0000" can be inferred from a FAQ that the SSA publishes which indicates that allocation of those groups starts

Spring/Hibernate testing: Inserting test data after DDL creation

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-02 16:22:21
I have a Spring/Hibernate webapp that has some integration tests that run on an in-memory HSQL database. Hibernate takes this blank database and creates all of my test tables and constraints thanks to hbm2ddl=create. However, I have a new bean that checks for a particular config value from the database during its afterPropertiesSet() method, and so when this bean is initialized, such a row needs to exist in the database. Is there any good way to set up a Java/Spring/Hibernate equivalent of Rail's test fixtures? I'm trying to find a way to tell Hibernate "whenever you create this table, insert

PHP Script to populate MySQL tables

假如想象 提交于 2019-11-30 11:46:39
Is anyone aware of a script/class (preferably in PHP) that would parse a given MySQL table's structure and then fill it with x number of rows of random test data based on the field types? I have never seen or heard of something like this and thought I would check before writing one myself. What you are after would be a data generator. There is one available here which i had bookmarked but i haven't got around to trying it yet. 来源: https://stackoverflow.com/questions/19162/php-script-to-populate-mysql-tables

Parameter “stratify” from method “train_test_split” (scikit Learn)

冷暖自知 提交于 2019-11-29 20:33:21
I am trying to use train_test_split from package scikit Learn, but I am having trouble with parameter stratify . Hereafter is the code: from sklearn import cross_validation, datasets X = iris.data[:,:2] y = iris.target cross_validation.train_test_split(X,y,stratify=y) However, I keep getting the following problem: raise TypeError("Invalid parameters passed: %s" % str(options)) TypeError: Invalid parameters passed: {'stratify': array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1,

Sample database for exercise [closed]

扶醉桌前 提交于 2019-11-29 19:12:19
I would like to play with a larger database to test my knowledge on SQL. Is there a huge .sql out there that I can use to play with SQL queries? karim79 You could try the classic MySQL world database . The world.sql file is available for download here: http://dev.mysql.com/doc/index-other.html Just scroll down to Example Databases and you will find it. iberck This is an online database but you can try with the stackoverflow database: http://data.stackexchange.com/stackoverflow/query/new You also can download its dumps here: https://archive.org/download/stackexchange bendewey Check out CodePlex

How to let Autofixture create an instance of a type that contains properties with an interface type?

a 夏天 提交于 2019-11-29 06:44:01
I have such a class: public class ViewModel { public IPagination<Data> List { get; set; } // interface! public SearchFilter SearchFilter { get; set; } public string Test { get; set; } } public class SearchFilter { public string Name { get; set; } } A dynamic proxy shall be created around the IPagination interface and the proxy shall be filled with test data. Now is it possible to let AutoFixture create an instance of the ViewModel type? Be aware that I only know the type at runtime ( typeof(ViewModel) ). By now I know I can do this: var context = new SpecimenContext(fixture.Compose()); var

Parameter “stratify” from method “train_test_split” (scikit Learn)

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-28 16:23:32
问题 I am trying to use train_test_split from package scikit Learn, but I am having trouble with parameter stratify . Hereafter is the code: from sklearn import cross_validation, datasets X = iris.data[:,:2] y = iris.target cross_validation.train_test_split(X,y,stratify=y) However, I keep getting the following problem: raise TypeError("Invalid parameters passed: %s" % str(options)) TypeError: Invalid parameters passed: {'stratify': array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,