279 karma · joined February 5, 2010
* Windows PCs without installation medium
* Windows installation with a full partitition table (four primary partitions)
* (intentionally?) corrupted partition tables
I.e. installing GNU/Linux requires you to resize partitions with a potentially corrupted NTFS file system and/or delete backup partitions. Alternatively the user uses a Windows image file as Linux file system (Wubi) which is slower and a more fragile solution.
result = Dir.glob('test?.txt').collect do |file_name|
File.new(file_name, 'r').read.split(' ').collect do |word|
word.downcase.tr '.,\'', ''
end.inject Hash.new(0) do |hash,word|
hash[word] += 1
hash
end
end.inject do |all,hash|
(all.keys + hash.keys).uniq.inject Hash.new(0) do |acc,word|
acc[word] = all[word] + hash[word]
acc
end
end
p result
Edit: The Python example in the article is better because it merges hashes in the reduce step which facilitates parallelisation. wget -c http://web4.cs.ucl.ac.uk/staff/s.prince/book.pdf puts (1 .. 21).inject :*
will output "51090942171709440000". And puts (1 .. 21).inject(:*).class
will output "Bignum" because Ruby switches to big numbers when its integer representation is exceeded.Here is a presentation by Fred Singer if anybody is interested (in the past he has headed the US weather satellite program for many years). http://videolectures.net/kolokviji_singer_nnha/
http://stream.qtv.apple.com/events/jun/11piubpwiqubf06/11piu...
http://www.ecis.eu/documents/Finalversion_Consumerchoicepape...
What about Psystar?