Questions tagged [seeding]
525 questions
9
votes
1 answer
controlling seeds with mclapply
Imagine we are doing a number of processes where i want to set one overall seed at the beginning of a program: e.g.
mylist <- list( as.list(rep(NA,3)), as.list(rep(NA,3)) )
foo <- function(x){ for(i in 1:length(x)){
x[[i]]…

user1320502
- 2,510
- 5
- 28
- 46
8
votes
4 answers
SIMD XOR operation is not as effective as Integer XOR?
I have a task to calculate xor-sum of bytes in an array:
X = char1 XOR char2 XOR char3 ... charN;
I'm trying to parallelize it, xoring __m128 instead. This should give speed up factor 4.
Also, to recheck the algorithm I use int. This should give…

klm123
- 12,105
- 14
- 57
- 95
8
votes
3 answers
Seeding SQLite RANDOM()
Does SQLite support seeding the RANDOM() function the same way MySQL does with RAND()?
$query = "SELECT * FROM table ORDER BY RAND(" . date('Ymd') . ") LIMIT 1;";
From the MySQL Manual about RAND(N):
If a constant integer argument N is
…

Alix Axel
- 151,645
- 95
- 393
- 500
8
votes
4 answers
Seeding database with path from code?
I've been using Laravel's migrations with the path parameter like so:
Artisan::call('migrate', array('--path' => 'path/to/my/Migrations'));
Is there anyway I can run the seed command in the same way? I have a number of seed files I want to use but…

Dan
- 6,265
- 8
- 40
- 56
7
votes
5 answers
Does the django_address module provide a way to seed the initial country data?
I'm using Django 2.0, Python 3.7, and MySql 5. I recently installed the django_address module. I noticed when I ran my initial migration based on my models.py file ...
from django.db import models
from address.models import AddressField
from…

Dave
- 15,639
- 133
- 442
- 830
7
votes
2 answers
Sequelize dynamic seeding
I'm currently seeding data with Sequelize.js and using hard coded values for association IDs. This is not ideal because I really should be able to do this dynamically right? For example, associating users and profiles with a "has one" and "belongs…

bideowego
- 451
- 1
- 5
- 17
7
votes
2 answers
Laravel 5.1 foreign keys in model factory
How do you define foreign keys in a model factory. For example if I have a organisations table which has a foreign key to the countries table, in my model factory I'm having to define a dummy value for the country id as…

adam78
- 9,668
- 24
- 96
- 207
7
votes
3 answers
Equivalent of Laravel Seeders on Symfony?
I'm developing a web site with Symfony. I'm new on this framework. Before i used Laravel 5.0 and I need to have a database with rows.
I create my db with command prompt but now I don't find how to seed it.
There is a equivalent of Laravel seeders…

hemir
- 93
- 1
- 1
- 6
7
votes
1 answer
Run a rake db:seed multiple times without creating duplicate records?
I have some code in a seed file that I'd like to alter so that it does not create duplicate records when I run the seed command multiple times. Any way to adapt the code below from my seeds file so that this is possible? The find_or_create_by method…

John
- 443
- 8
- 19
7
votes
3 answers
takeSample() function in Spark
I'm trying to use the takeSample() function in Spark and the parameters are - data, number of samples to be taken and the seed. But I don't want to use the seed. I want to have a different answer everytime. I'm not able to figure out how I can do…

Prateek Kulkarni
- 481
- 2
- 5
- 12
6
votes
1 answer
How to seed multiple many-to-many relationships with different pivot data in laravel 8?
I know that I can use the hasAttached method to create many-to-many relationships with pivot data in Laravel 8:
Meal::factory()
->count(3)
->hasAttached(Ingredient::factory()->count(3), ['gram' => 100])
->create();
Is…

theovier
- 184
- 11
6
votes
2 answers
Laravel 5 Reseeding the Database for Unit Testing Between Tests
I start with a seeded database and am trying to reseed the database between unit tests in Laravel 5. In Laravel 4 I understand you could simply use Illuminate\Support\Facades\Artisan and run the…

Nabsta
- 101
- 3
- 12
6
votes
2 answers
Deploy different seed data for different publish profiles using visual studio ssdt?
Is it possible to deploy different sets of seed data for different publish profiles using visual studio Sql Server Data tools database project?
We know you can deploy seed data using a post deployment script.
We know you can deploy to different…

Dib
- 2,001
- 2
- 29
- 45
6
votes
3 answers
Rails db:seed error "undefined method `finder_needs_type_condition?' for nil:NilClass"
I have a problem when attempting to populate my sqlite db. There's not much info regarding the specific error "finder_needs_type_condition?" that I can find, but I don't have much experience with Rails yet to even suspect where the problem could…

ssky101
- 63
- 1
- 6
6
votes
1 answer
Laravel DB Seeds - Test Data v Sample Data
I'm probably misunderstanding exactly how this works, but what's the best way to accomplish this? I have something in mind but it seems quite hacky.
I have a set of sample data which I use to test my application. This is seeded via the built in…

Alex C
- 1,371
- 2
- 13
- 16