eLod
require 'numbers_and_words'
def convert(locale, numbers)
I18n.with_locale locale do
numbers.map { |i| i.to_words.length }
end
end
def eliminate(locale, numbers = (1..99).to_a)
eliminated = convert(locale, numbers).uniq
if (numbers - eliminated).empty?
eliminated
else
eliminate(locale, eliminated)
end
end
%i[en es ru fr ua hu lt lv et tr de it nl se].each do |locale|
print "#{locale}: #{eliminate(locale).join ', '}\n"
end
results: en: 4
es: 4, 6, 5
ru: 6, 3, 5, 4, 11
fr: 3, 5, 4, 6
ua: 5, 3
hu: 5, 2, 4
lt: 4, 2, 6, 5, 7
lv: 5, 7, 11
et: 4
tr: 2, 3, 4
de: 4
it: 3
nl: 4
se: 3, 4
so if i'm not mistaken 4 is four letters long on most of these languages, but you can see there are some other destinations on other languageslet's say there are 500.000 english words you are choosing from and you use 4 words. that gives you 500000^4 possibilities. let's assume the words averages about 5 characters, so we will compare this to a 20(=4 words * 5 characters) character long password made of 26 types of character (english alphabet, not using numbers and other special characters), that gives you 26^20 possibilities. and 26^20 - 500000^4 ~= 2x10^28, or put it this way: (26^20) / (500 000^4) = 318 850.382..
i know a random sequence of 20 characters are very hard to remember, but 500.000 is an overestimation too. let's say we use special symbols too (50 characters) and the word dictionary has 100.000 words. (50^12) / (100 000^4) = 2.44 so we can say it is better to have a 12 character long password (made of alphanums + symbols) than 4 random word concatenated (i think 12 is somewhat a 'standard' for 'sensitive' passwords). and i would argue that on the long term multiple concatenated passwords are very hard to remember. i'm not saying this is a terrible approach, just not the silver bullet to the 'password problem' (which xkcd never claimed of course, and for 'non sensitive', 'reused'/'throwaway' passwords it may be a viable option).
edit: and i forgot about case sensitivity too.
I pushed it to http://gfnf.heroku.com (source is at https://github.com/eLod/gfnf). The interface obviously lacks some detail, but still usable i think. You can create filters and set what to include based on languages, users and repositories. Without requirements those events are selected that matches any of the conditions (e.g. OR). With requiring user(s) for example only those events get selected whose actor is in the filter.
Of course backed with the right data this should be much easier.
barnabas:btch pota$ time python btch.py
found: 7555794
real 1m18.464s
user 1m18.417s
sys 0m0.031s
(i5 2500k)on the other hand i really think our education (and this is about our university education in my country - hungary) is too much based on "dictionary knowledge" in contrast to getting people able to solve real life problems (so teaching people how to think and be creative). but the k-12 education is much about getting you a "general education" (that is expected by the local society/culture). so the time is not the bottleneck here i think.
excuse me for my english