Questions tagged [seed]

Seed is a JavaScript interpreter and a library of the GNOME project.

632 questions
15
votes
6 answers

How do I specify a single file to be seed only

I am using knex for seeding and I have a folder called development where I have all the seeds files. What I would want is: How to seed single file. The command I am using is: knex seed:run --env=development But this command is to seed all the files…
Lulzim
  • 547
  • 4
  • 9
  • 22
15
votes
2 answers

How to create ApplicationUser by UserManager in Seed method of ASP .NET MVC 5 Web application

I can create users in the old way: var users = new List { new ApplicationUser{PasswordHash = hasher.HashPassword("TestPass44!"), Email = "informatyka4444@wp.pl", UserName = "informatyka4444@wp.pl", …
Yoda
  • 17,363
  • 67
  • 204
  • 344
14
votes
4 answers

python seed() not keeping same sequence

I'm using a random.seed() to try and keep the random.sample() the same as I sample more values from a list and at some point the numbers change.....where I thought the one purpose of the seed() function was to keep the numbers the same. Heres a test…
Motion4D
  • 153
  • 1
  • 1
  • 5
14
votes
1 answer

Rails engine / How to use seed?

I have created a Rails Engine. I am having trouble using the seed command, if I run rake db:seed I get the error: "uninitialized constant". In the engine, I got a seeds.rb: Page.create(:title => 'Frontpage', :order => '1') Then in my dummy app I…
jakobk
  • 1,120
  • 1
  • 14
  • 26
13
votes
3 answers

How do I Seed random number generator on official Tour of Go?

The official tour of Go gives the following code in the sandbox: package main import ( "fmt" "math/rand" ) func main() { fmt.Println("My favorite number is", rand.Intn(10)) } And this instruction: Note: the environment in which these…
jonsanders101
  • 525
  • 1
  • 6
  • 13
13
votes
4 answers

Changing Identity Seed in SQL Server (Permanently!)

Is there any way of changing the identity seed for an identity column permanently? Using DBCC CHECKIDENT just seems to set the last_value. If the table is truncated all values are reset. dbcc checkident ('__Test_SeedIdent', reseed, 1000) select…
avenmore
  • 2,809
  • 3
  • 33
  • 34
13
votes
6 answers

Prevent Rails test from deleting seed data

I am using seeds.rb to populate some State model reference data: State.create :name => 'Alabama', :abbreviation => 'AL' State.create :name => 'Alaska', :abbreviation => 'AK' # ... Although I am not using state fixtures (since it's seed data to…
aaron
  • 1,068
  • 12
  • 14
13
votes
3 answers

Using a method in seeds.rb in Ruby On Rails

I am trying to add a method to my seeds.rb so that I don't have to write a bunch of verbose code. However, depending on the placement of the create_deliverable method I get one of two error messages when running db:setup. When method is before…
ahsteele
  • 26,243
  • 28
  • 134
  • 248
13
votes
2 answers

What is the function of the seeds.rb file?

I am very new to Ruby on Rails. I don't know what the function of the seed.rb file is, why we use this file, and why we need to run the rake db:seed command. Can anyone give an explanation with examples?
Willing
  • 602
  • 1
  • 6
  • 16
13
votes
6 answers

May near seeds in random number generation give similar random numbers?

I'm using sequential seeds (1,2,3,4,...) for generation of random numbers in a simulation. Does the fact that the seeds are near each other make the generated pseudo-random numbers similar as well? I think it doesn't change anything, but I'm using…
Homero Esmeraldo
  • 1,864
  • 2
  • 18
  • 34
11
votes
4 answers

Best way to revert to a random seed after temporarily fixing it?

Is this the only way to 'unseed' the random number generator: np.random.seed(int(time.time())) If you have some code that you want to be repeatable (e.g. a test) in a loop with other code that you want to be random each loop, how do you 'reset' the…
Bill
  • 10,323
  • 10
  • 62
  • 85
11
votes
2 answers

Split seeds.rb into multiple sections?

I'd like to split my seeds.rb file into multiple sections for ease of maintenance; seed all the A's in a.rb, the B's in b.rb, etc. The separate files are located in the db/ directory with seeds.rb. Each file consists of a bunch of "A.create" or…
GSP
  • 3,763
  • 3
  • 32
  • 54
11
votes
1 answer

NG2: angular2-webpack-starter - what is the purpose of HMR?

I'm cleaning up my angular2 project and for many reasons, I've decided to start with a seed. This one. This seed uses HMR but I don't fully understand what is the purpose of that. At the beginning, I was thinking that HMR was about dynamical loading…
Clément Flodrops
  • 1,114
  • 1
  • 13
  • 29
11
votes
2 answers

Code First Migration Seed Error: The binary operator Equal is not defined for the types 'System.Nullable`1[System.Int32]' and 'System.Int32'

I have the following issue with my update identifiers when seeding to my db: context.ClientPromos.AddOrUpdate( cp => new { cp.ClientID, cp.Recommendation_ID, cp.PromoCode_ID }, new ClientPromo { …
11
votes
4 answers

R set.seed() 's scope

My R script calls sub-functions which contains set.seed(). What is the scope of the set.seed()? Will it also affect to main program that calls it? More specificly # main program callsubfun() ... some statement ... sample.int(100,20) # sub…
lolibility
  • 2,187
  • 6
  • 25
  • 45
1 2
3
42 43