• arr.each_with_object(Hash.new(0)) { |v, h| h[v[0]] += v[1].to_i }
    
  • 支持

  • 3.times do
      2
    end
    1 if not_solved?
    
  • 申请删帖 at 2017年06月04日

    高深莫测

  • +1

  • 问一个数据库设计问题. at 2017年03月08日

    +1

  • +----------------------+-------+-------+---------+---------+-----+-------+
    | Name                 | Lines |   LOC | Classes | Methods | M/C | LOC/M |
    +----------------------+-------+-------+---------+---------+-----+-------+
    | Controllers          | 23878 | 13391 |     370 |    1760 |   4 |     5 |
    | Helpers              |  2381 |  1989 |       1 |     300 | 300 |     4 |
    | Models               | 21610 | 14640 |     335 |    1894 |   5 |     5 |
    | Mailers              |   745 |   625 |      27 |      91 |   3 |     4 |
    | Javascripts          | 18787 | 14934 |      35 |    2317 |  66 |     4 |
    | Libraries            |   702 |   552 |      14 |      71 |   5 |     5 |
    | Controller specs     | 11811 | 10239 |       2 |      17 |   8 |   600 |
    | Decorator specs      |   476 |   409 |       0 |       0 |   0 |     0 |
    | Feature specs        |  1082 |   910 |       0 |       1 |   0 |   908 |
    | Form specs           |  1505 |  1363 |       0 |       0 |   0 |     0 |
    | Helper specs         |   156 |    63 |       0 |       0 |   0 |     0 |
    | Lib specs            |    48 |    41 |       0 |       0 |   0 |     0 |
    | Mailer specs         |   393 |   329 |       0 |       0 |   0 |     0 |
    | Model specs          | 18993 | 13438 |       0 |      10 |   0 |  1341 |
    | Policy specs         |    36 |    31 |       0 |       0 |   0 |     0 |
    | Presenter specs      |   239 |   214 |       0 |       0 |   0 |     0 |
    | Query specs          |   174 |   156 |       0 |       0 |   0 |     0 |
    | Request specs        |   713 |   600 |       0 |       0 |   0 |     0 |
    | Serializer specs     |   784 |   419 |       0 |       0 |   0 |     0 |
    | Service specs        |  5376 |  4762 |       1 |      15 |  15 |   315 |
    | Uploader specs       |    51 |    41 |       0 |       0 |   0 |     0 |
    | Validator specs      |    75 |    64 |       1 |       1 |   1 |    62 |
    | Value specs          |   268 |   225 |       0 |       0 |   0 |     0 |
    | View specs           |  7107 |  6745 |       0 |       4 |   0 |  1684 |
    | Worker specs         |   114 |   101 |       0 |       0 |   0 |     0 |
    | Wrapper specs        |    32 |    26 |       0 |       0 |   0 |     0 |
    +----------------------+-------+-------+---------+---------+-----+-------+
    | Total                | 117536 | 86307 |     786 |    6481 |   8 |    11 |
    +----------------------+-------+-------+---------+---------+-----+-------+
      Code LOC: 46131     Test LOC: 40176     Code to Test Ratio: 1:0.9
    
  • 分母+1

  • 👍

    我以为会一直嵌套呢 😄

  • 如果有A任务耗时多了怎么办 如果有A任务失败了怎么办