V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
czheo
V2EX  ›  自言自语

吐槽下天猫 app

  •  
  •   czheo · 2016-06-11 14:10:37 +08:00 via iPhone · 258 次点击
    这是一个创建于 3091 天前的主题,其中的信息可能已经有所发展或是发生改变。
    首页向左滑向右滑用户看来根本是鸡肋。这算 ABtest ?两个页面看不出啥大差别,根本无所谓。不知道的用户还会纳闷下。
    为了 metrics driven 而硬做 ABtest 和为了 test driven 而破坏代码结构一样,都是本末倒置。
    4 条回复    2017-02-01 19:33:19 +08:00
    czheo
        1
    czheo  
    OP
       2017-02-01 19:32:38 +08:00
    ``` python
    def quick_sort(numbers,left,right):
    if right - left <= 0:
    return numbers

    tmp = numbers[left]
    i = left + 1
    j = right

    while i < j:
    while numbers[j] > tmp and i < j:
    j -= 1
    while numbers[i] <= tmp and i < j:
    i += 1
    numbers[i], numbers[j] = numbers[j], numbers[i]

    if numbers[i] > numbers[left]:
    numbers[i-1], numbers[left] = numbers[left], numbers[i-1]
    else:
    numbers[i], numbers[left] = numbers[left], numbers[i]

    quick_sort(numbers,left,i-1)
    quick_sort(numbers,i+1,right)

    return numbers

    test = [3,7,8,5,1,2,2,2,22,11,5,4]
    print(quick_sort(test, 0, len(test) - 1))
    ```
    czheo
        2
    czheo  
    OP
       2017-02-01 19:32:48 +08:00
    ```
    def quick_sort(numbers,left,right):
    if right - left <= 0:
    return numbers

    tmp = numbers[left]
    i = left + 1
    j = right

    while i < j:
    while numbers[j] > tmp and i < j:
    j -= 1
    while numbers[i] <= tmp and i < j:
    i += 1
    numbers[i], numbers[j] = numbers[j], numbers[i]

    if numbers[i] > numbers[left]:
    numbers[i-1], numbers[left] = numbers[left], numbers[i-1]
    else:
    numbers[i], numbers[left] = numbers[left], numbers[i]

    quick_sort(numbers,left,i-1)
    quick_sort(numbers,i+1,right)

    return numbers

    test = [3,7,8,5,1,2,2,2,22,11,5,4]
    print(quick_sort(test, 0, len(test) - 1))
    ```
    czheo
        3
    czheo  
    OP
       2017-02-01 19:33:00 +08:00
    ~~~
    def quick_sort(numbers,left,right):
    if right - left <= 0:
    return numbers

    tmp = numbers[left]
    i = left + 1
    j = right

    while i < j:
    while numbers[j] > tmp and i < j:
    j -= 1
    while numbers[i] <= tmp and i < j:
    i += 1
    numbers[i], numbers[j] = numbers[j], numbers[i]

    if numbers[i] > numbers[left]:
    numbers[i-1], numbers[left] = numbers[left], numbers[i-1]
    else:
    numbers[i], numbers[left] = numbers[left], numbers[i]

    quick_sort(numbers,left,i-1)
    quick_sort(numbers,i+1,right)

    return numbers

    test = [3,7,8,5,1,2,2,2,22,11,5,4]
    print(quick_sort(test, 0, len(test) - 1))
    ~~~
    czheo
        4
    czheo  
    OP
       2017-02-01 19:33:19 +08:00
    ~~~
    def quick_sort(numbers,left,right):
    if right - left <= 0:
    return numbers

    tmp = numbers[left]
    i = left + 1
    j = right

    while i < j:
    while numbers[j] > tmp and i < j:
    j -= 1
    while numbers[i] <= tmp and i < j:
    i += 1
    numbers[i], numbers[j] = numbers[j], numbers[i]

    if numbers[i] > numbers[left]:
    numbers[i-1], numbers[left] = numbers[left], numbers[i-1]
    else:
    numbers[i], numbers[left] = numbers[left], numbers[i]

    quick_sort(numbers,left,i-1)
    quick_sort(numbers,i+1,right)

    return numbers

    test = [3,7,8,5,1,2,2,2,22,11,5,4]
    print(quick_sort(test, 0, len(test) - 1))
    ~~~
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1398 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 22ms · UTC 23:48 · PVG 07:48 · LAX 15:48 · JFK 18:48
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.