Tag Info

New answers tagged

2

Yes, literature indicates that it is ok, and common, to reuse a hash function to produce k hash functions, specifically if the hash function takes a seed value. This is apparently the case in the Ruby sample you provided. For large k, finding unique hash functions can be challenging. Of course, this supposes a good hash function, in the first place. Not ...


3

I'm not sure why you think the product of two multisets should be an array. It should obviously be a multiset. A multiset of ordered pairs, to be precise. Ruby doesn't have a prebuilt representation of ordered pairs (or more generally tuples), so you could do one of two things: provide your own pair implementation do what Hash#each does and represent ...


2

It's part of your private environment. Most people want; some random tool like guard is not something I know or care about, nor want to use if for some reason it managed to be installed. I build projects by typing make, not automatically in the background. However, I disagree that privately useful files should never be part of the repo. Many projects ship a ...


2

You're imposing three constraints here: a specific total number of questions several pools of questions of similar difficulty, where the exam should contain elements of each pool a predefined average difficulty As ratchet freak said, this is a knapsack problem and therefore hard to solve, although if the list of questions is reasonably small a complete ...


0

If it is a rails project and you set your 'core' repository as a gem in the Gemfile, then rake has access to the 'core' rake tasks.



Top 50 recent answers are included