Недавно я получаю эту ошибку при использовании msysgit, в частности, когда есть некоторый не-ASCII-контент, генерируемый выводом git:
предупреждение: ваш консольный шрифт, вероятно, не поддерживает Unicode. Если вы видите странные символы в выводе, подумайте о переходе на шрифт TrueType, такой как Lucida Console!
Забавно то, что хотя это сообщение говорит мне, что мой шрифт не поддерживает Unicode, на самом деле он поддерживает, и рассматриваемый текст отображается правильно (в правильной кодировке и со всеми отображаемыми символами).
печально то, что я не нашел способ отключить это сообщение. Я попытался изменить шрифт в Git Bash (обычно я использую PowerShell), но когда я проверил шрифт там, я заметил, что на самом деле он уже установлен на Lucida Console , и предупреждение появляется в той же консоли . Так что я немного не понимаю, что делать, чтобы исправить это или, по крайней мере, остановить msysgit от постоянной печати этого предупреждения.
Я попытался переустановить msysgit, также с выбранной опцией, которая должна установить шрифт на Lucida Console , но это не помогло. Generate a list of all artist pairs that appear together at least 50 ...
Came across this interview programming test recently:
I feel I have a pretty workable solution, but I'm wondering if they were looking for something specific that I missed.
(In case it makes a difference - this isn't from my own interviewing, so I'm not trying to cheat any prospective employers)
Here are my assumptions:
The third requirement is a little vague - technically, if you have any exact solution you've "evaluated all possible pairs".
first pass: convert artist names to numeric ids; store converted favorite data in a temp file; keep count of user favorites for each artist.
Requires a string->int map to keep track of assigned ids; can use a Patricia tree if space is more important than speed (needed 1/5th the space and twice the time in my, admittedly not very rigorous, tests).
second pass: iterate over the temp file; throw out artists which didn't, individually, meet the cutoff; keep counts of pairs in a 2d matrix.
Will require n(n-1)/2
bytes (or shorts, or ints, depending on the data size) plus the array reference overhead. Shouldn't be a problem since n
is, at most, 0.01-0.05 of 622K.
This seems like it can process any sized real-world dataset using less than 100MB of memory.
If you can't do multiple passes (for whatever contrived reason), use an array of Bloom filters to keep the pair counts: for each pair you encounter, find the highest filter it's (probably) in, and add to the next highest one. So, first time it's added to bf[0], second time bf[1], and so on until bf[49]. Or can revert to keeping actual counts after a certain point.
I haven't run the numbers, but the lowest few filters will be quite sizable - it's not my favorite solution, but it could work.
Any other ideas?