programmer group

Knowledge points of HMR

What is HMR? In short, the code can be updated without refreshing the whole page, which can improve the development efficiency API and technical function points of implementing HMR in webpack Nodejs listening file APIhttp://nodejs.cn/api/fs.html#fs_fs_watchfile_filename_options_listener, used to monitor file changes Memory file systemhttps://github.com/webpack/webpack-dev-middleware/blob/v3.7.0/lib/fs.js#L115Using memory file system...

programmer group

Interview string completion

demand Converts the given number to a binary string. If the length of the string is less than 8 bits, 0 will be filled to the full 8 bits. Examples input 65 output 01000001 solution Mode 1 uses the cycle to fill the left zero function convertToBinary(num) { var str = num.toString(2); while(str.length < 8) { str = "0" + str; } return str; } Mode 2 fixed length zero compensation slice function...

programmer group

Spark parameter tuning

Spark parameter tuning Refer to spark official document:http://spark.apache.org/docs/… Shuffle related Shuffle operation is probably one of the most important steps affecting the performance of spark (because it may involve many CPU or IO intensive operations such as sorting, disk IO, network IO, etc.), which is why the whole shuffle framework code is reconstructed in spark 1.1 code, and the shuffle related read-write operations...