Questions tagged [seed]

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

632 questions
8
votes
3 answers

Random seed at runtime

How can I generate different random numbers at runtime? I've tried srand((unsigned) time(0)); But it seems to get me a random number on every startup of the program, but not on every execution of the function itself... I'm trying to automate some…
Pacane
  • 20,273
  • 18
  • 60
  • 97
7
votes
2 answers

Possible sources for random number seeds

Two points -- first, the example is in Fortran, but I think it should hold for any language; second, the built in random number generators are not truly random and other generators exist, but we're not interested in using them for what we're doing.…
tpg2114
  • 14,112
  • 6
  • 42
  • 57
7
votes
1 answer

nodeJS with ts : module declares component locally, but it is not exported

In my nodeJS app I have a models and seeders folder, I created an address.model.ts schema like that : export {}; const mongoose = require('mongoose'); const addressSchema = new mongoose.Schema({ street: { type: String, required: true, …
547n00n
  • 1,356
  • 6
  • 30
  • 55
7
votes
1 answer

Seed for $RANDOM environment variable in bash

I am working on a bash script that uses the $RANDOM environmental variable as an input in a simulation. The variable does what it say, give random integers, and I as far I understand it is taken from /dev/random. However I would like to have a…
Juan
  • 1,520
  • 2
  • 19
  • 31
7
votes
3 answers

Laravel Seeder for Different Environments

I created two folders in my seeder folder: /seeds /local /production DatabaseSeeder.php Then, defined the following inside DatabaseSeeder.php class DatabaseSeeder extends Seeder { /** * Run the database seeds. * * @return void …
Kousha
  • 32,871
  • 51
  • 172
  • 296
7
votes
2 answers

Skip email confirmation when creating a new user using Devise

I have a user registration page and will send the information to couple of admin users that one new user registered in the site. Now, I created the seed data with list of users (200+). So, It'll send the 200+ email to the respective admin users.…
Mr. Black
  • 11,692
  • 13
  • 60
  • 85
7
votes
2 answers

Rails - Seeding HABTM associations

Equipment.create(name: "Room to run") Equipment.create(name: "Pull-up bar") Workout.create( description: "Do 100 pull-ups then run 5km", :equipment => Equipment.where(:name => 'Pull-up bar')) Equipment and Workouts have a HABTM relationship.…
6
votes
3 answers

Using itertools.product and want to seed a value

So I've wrote a small script to download pictures from a website. It goes through a 7 alpha charactor value, where the first char is always a number. The problem is if I want to stop the script and start it up again I have to start all over. Can I…
Ryan
  • 167
  • 1
  • 3
  • 12
6
votes
4 answers

Issues with seeding a pseudo-random number generator more than once?

I've seen quite a few recommendations for not seeding pseudo-random number generators more than once per execution, but never accompanied by a thorough explanation. Of course, it is easy to see why the following (C/C++) example is not a good…
Flygsand
  • 115
  • 1
  • 8
6
votes
4 answers

What is the best practice for updating rails seed data

I have a rails application in production with seed data. We need to add more seed data, but using rake db:populate will replicate all the old seed data and of course we don't want to add the data to migrations. What is the best method of adding…
Joel Jackson
  • 1,060
  • 1
  • 10
  • 24
6
votes
1 answer

How to populate pivot table in laravel??

I wrote factories for posts and categories and the work perfectly. But i can't find a way to populate the category_post table to test the ManyToMany relation between them. How can I do that?
Rahimi0151
  • 395
  • 3
  • 11
6
votes
3 answers

Getting In Container.php line 752: Class RoleTableSeeder does not exist error, when trying to seed a role in Laravel

Currently, I am trying to create roles for my application, unfortunately I am having some troubles. Whenever I run php artisan migrate --seed, I get the error I've written in the title. Honestly, I feel like I've messed up something really simple…
Onyx
  • 5,186
  • 8
  • 39
  • 86
6
votes
2 answers

How do I pre-populate my Rails 4 application with a Google user?

I’m using Rails 4.2.5 with the “omniauth-google-oauth2” gem. In my application, the only way users will be able to sign in is through their Google or Facebook logins. What I would like is to pre-populate my application with an initial user, me…
Dave
  • 15,639
  • 133
  • 442
  • 830
6
votes
3 answers

C# Random(Long)

I'm trying to generate a number based on a seed in C#. The only problem is that the seed is too big to be an int32. Is there a way I can use a long as the seed? And yes, the seed MUST be a long.
user1599078
  • 167
  • 1
  • 3
  • 9
6
votes
3 answers

Uncorrelated parallel random seeds with C++ 2011?

Currently, I have a main application in Fortran that need a seed to generate pseudo-random numbers. I would like to run many (many) times this application with completely uncorrelated seeds (and furthermore completely independent pseudo-random…
Vincent
  • 57,703
  • 61
  • 205
  • 388