scala-PriorityQueue-ordering-explain

at my previous code, i used PriorityQueue to solve this issue. I am not that faimiliar with scala syntax, so it takes me some time to figure out how th customized the comparator. f...

Read More

642-design-search-auto-complete-system

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949...

Read More

scala-for-the-impatient-chapt-5-ex.md

ex 1123456789101112131415161718192021/** * ex 1 * * Improve the Counter class in Section 5.1, “Simple Classes and Parameterless Methods,” * on page 55 so that it doesn’t tu...

Read More

scala-for-the-impatient-chapter-4-ex.md

firstly put the time profile function and print function 1def prn(x: TraversableOnce[_]) = println(x.mkString(x.getClass.getSimpleName + "(", ", ", ")"...

Read More

scala-for-the-impatient-chapter-3-ex

ex 11234567891011121314/** * EX 1 : * Write a code snippet that sets a to an array of n random integers between 0 (inclusive) and n (exclusive). * * @param n * @return */priv...

Read More

scala-for-the-impatient-chapter-1-ex

ex 11234567891011/** * ex 1 : * The signum of a number is 1 if the number is positive, –1 if it is negative, and 0 if it is zero. Write a * function that computes this value. * * @...

Read More

elasticsearch-no-data-nodes-with-HTTP-enabled-available

problemwhen run spark job to write data to es cluster on aws, I got error like this: 12345678910111213141516171819/01/09 16:18:41 WARN TaskSetManager: Lost task 0.0 in stage 0.0 (T...

Read More

how to sync forked repo on github

after fork a project on github, you may also need to sync your repo with the original repo you forked from, how to do that? add upstream1git remote add upstream git@github.intuit....

Read More

elevator-design part 1

How to design an elevator systemthis is a famous interview questions. Design a elevator system would never be an easy task. How to ship people efficiently and quickly without over ...

Read More

manacher's algorithm

manacher’s algorithmwhat’s it?manacher’s algorithm is good at calculate palindrome string, the time-complexity can reach o(n). it would re-use the pattern to calcuate, so it is ver...

Read More