Google Python Style Guide
permitted. Use loops instead when things get more compli- cated. Yes: result = [] for x in range(10): for y in range(5): 6 if x * y > 10: result.append((x, y)) for x in xrange(5): for y in xrange(5): if None) squares = [x * x for x in range(10)] eat(jelly_bean for jelly_bean in jelly_beans if jelly_bean.color == 'black') No: result = [(x, y) for x in range(10) for y in range(5) if x * y > 10] return ((x0 码力 | 30 页 | 94.81 KB | 1 年前3Google C++ Style Guide
pointer or smart pointer with calls to new commonly falls into this category, as does use of auto in a range-based loop over a container whose type is spelled out nearby. • (Allowed) When the type doesn’t matter used for anything other than equality comparison. • (Encouraged) When iterating over a map with a range-based loop (because it is often assumed that the correct type is pairwhereas it They may have a space // before the semicolon, but this is rare. for ( ; i < 5 ; ++i) { ... // Range-based for loops always have a space before and after the colon. for (auto x : counts) { ... 79 } 0 码力 | 83 页 | 238.71 KB | 1 年前303 Experiments, Reproducibility, and Projects - Introduction to Scientific Writing WS2021/22
ranges of values Don’t hide important information Experiments and Result Presentation Don’t limit range to make you look good If there are multiple relevant parameters, show them all For log-scale0 码力 | 31 页 | 1.38 MB | 1 年前301 Structure of Scientific Papers - Introduction to Scientific Writing WS2021/22
Viktor Leis, David G. Andersen, Michael Kaminsky, Kimberly Keeton, Andrew Pavlo: SuRF: Practical Range Query Filtering with Fast Succinct Tries. SIGMOD 2018 #12.3 Viktor Leis, Alfons Kemper, Thomas0 码力 | 36 页 | 1.12 MB | 1 年前3
共 4 条
- 1