seed

How do I seed data into new columns in an existing Rails model?

I have a rails model called County that has 5 columns of data for different population attributes for that county. There is a record in the counties table for each county in the US. I now need to add additional county level data to meet a new need. The counties table will get an additional 10 or so rows for numeric population data (break...

How to set MessageDigest seed?

The MessageDigest class implements the SHA-1 algorithm (among many others). The SHA-1 algorithm allows one to use different "seeds" or initial digests. See SHA-1 Psuedocode The algorithm initializes variables, or the seed: Initialize variables: h0 = 0x67452301 h1 = 0xEFCDAB89 h2 = 0x98BADCFE h3 = 0x10325476 h4 = 0xC3D2E1F0 Howev...

How to re-seed a table identity in SQL Server 2008 and undo it all safely?

I need to do this for testing only, but then undo it when the test is done. I have seen some tutorials online on how to re-seed a table, but not so much on how to undo it. Let's say the table definition is the following: create table beer ( beer_id numeric(10) not null, mnemonic nvarchar(8) ); go Let's say that I want the ...

How to generate 8 byte hex value?

Hi I want to generate this sequential data in C data_packet[1] = 0706050403020100 (seed_value) next data_packet[2] = 0f0e0d0c0b0a0908 Next will be the next 8 hexadecimal characters and so on for say 100 bytes.How can i do it.Can we do it using character array ?? ...

Can one use negative numbers as seeds for random number generation?

Hi, This is not a coding question, but am hoping that someone has come across this in the forums here. I am using Python to run some simulations. I need to run many replications using different random number seeds. I have two questions: Are negative numbers okay as seeds? Should I keep some distance in the seeds? Currently I am usi...

Cucumber and Seed data

can we load seed data when start cucumber? Please support me a way. ...

Seeding file uploads with CarrierWave, Rails 3.

I'm trying to seed a database in Rails 3 with images using CarrierWave, however nothing I try seems to work short of having to upload them all by hand. pi = ProductImage.new(:product => product) pi.image = File.open(File.join(Rails.root, 'test.jpg')) pi.store_image! # tried with and without this product.product_images << pi product.save...

How are "out parameters" represented for Seed JavaScript GObject bindings?

I've just started using Seed for development. One thing that Seed's web page mentions is that it "Maps C-isms (say, out arguments, or enums) to things that make sense in JavaScript." Unfortunately, I can't find any documentation or examples for how out arguments should work. So, for example, the following call in Seed: window.get_size()...

Seed data for an American English dictionary.

I want to find seed data to load into my dictionary. I just need the word's orthographic representation (letters) and the definition. I'm looking for a single text file that contains this information to parse and then load into my db. I'm using rails so if there is a gem or plugin that can do this that would be nice if any knows about ...