HackerTrans
トップ新着トレンドコメント過去質問紹介求人

efdb

no profile record

投稿

Russia Launches 'Vodkabot'

theregister.com
4 ポイント·投稿者 efdb·8 か月前·0 コメント

コメント

efdb
·2 年前·議論
H
efdb
·2 年前·議論
J
efdb
·2 年前·議論
[flagged]
efdb
·3 年前·議論
Did you have a look at https://rqlite.io/ ?
efdb
·4 年前·議論
Not so unfortunate according to Socrates: 'the hardest task needs the lightest hand..' ;-)
efdb
·4 年前·議論
see https://github.com/nalgeon/sqlean for 'All the missing SQLite functions'
efdb
·5 年前·議論
self documenting code ;-)

  def descending(lst):
    if len(lst) < 2:
        return False
    first, second = lst[:2]
    if first > second:
        return False
    if first < second:
        return True
    descending(lst[1:])

  def monotonic(lst):
    if len(lst) < 2:
        return lst
    result = []
    status = 0
    temp = [lst[0]]
    for v in lst[1:]:
        if v >= temp[-1] and status >= 0:
            if v > temp[-1]:
                status = 1
            temp.append(v)    
            continue
        if v <= temp[-1] and status <= 0:
            if v < temp[-1]:
                status = -1
            temp.append (v)    
            continue
        result.append(temp)
        temp = [v]
        status = 0
    result.append(temp)          
    return [list(reversed(x)) if descending(x) else x for x in     result]
efdb
·5 年前·議論
i really like the syntax, very intuitive use of ->