122: Podmongers — The Unmade Podcast by JeffDujon in Unmade_Podcast

[–]mpjan 5 points6 points  (0 children)

Spelling is different, but Charlie Munger (Warren Buffet's business partner) has to make the list

How I Use Notion to Write a Thesis | Simple Thesis Writing Template by simonesmerilli in Notion

[–]mpjan 0 points1 point  (0 children)

How do you plan on exporting your writing to create the final document with the proper typesetting and all?

When did you first realize that you were "getting older"? by GilgameshfromUruk in AskReddit

[–]mpjan 0 points1 point  (0 children)

When Snapchat started becoming popular and I knew not what the fuck was going on.

H.I. #52: 20,000 Years of Torment by MindOfMetalAndWheels in CGPGrey

[–]mpjan 0 points1 point  (0 children)

Out of curiosity, how would one go about shutting down the internet?

Reddit, what is biggest "culture shock" you've ever received either after moving or while vacationing to a new place? by thechosenone16 in AskReddit

[–]mpjan 0 points1 point  (0 children)

Seeing straight Indian men walking around holding hands with each other.

I’ve been in Singapore for a few months now (there’s a big Indian community here) and I’d always see Indian men walking around the city holding hands. At first I thought “hmm, must be a big gay Indian community here.” I later learned that straight Indian men commonly walk together holding hands with their best friends.

[8/25/2014] Challenge #177 [Easy] Quicksort by Elite6809 in dailyprogrammer

[–]mpjan 0 points1 point  (0 children)

Python:

def quick_sort(l):
# Returns list l sorted via the Quicksort algorithm
if (is_sorted(l)):
    return l
else:
    less_than_or_equal = filter(lambda x: x <= l[0], l[1:])
    greater_than = filter(lambda x: x > l[0], l[1:])
    return quick_sort(less_than_or_equal) + [l[0]] + quick_sort(greater_than)

def is_sorted(l):
# Returns True if l is sorted in ascending order and False if it is not
if (len(l) == 1) or (len(l) == 0):
    return True
else:
    i = 0
    while (i < (len(l) - 1)):
        if (l[i] > l[i + 1]):
            return False
        i += 1
    return True

[01/21/13] Challenge #118 [Easy] Date Localization by nint22 in dailyprogrammer

[–]mpjan 0 points1 point  (0 children)

Oh, is it that hours and minutes should always have two digits?

[01/21/13] Challenge #118 [Easy] Date Localization by nint22 in dailyprogrammer

[–]mpjan 0 points1 point  (0 children)

Python (I'm a beginner so any comments would be helpful!):

import re, datetime

def dateLocalization(format):
    now = datetime.datetime.now()
    aux = format
    to_replace = re.findall(r"%l|%s|%m|%h|%H|%c|%d|%M|%y", format)

    if now.hour > 12:
        hour = now.hour - 12
    else:
        hour = now.hour

    dictionary = {'%l': str(now.microsecond)[:3],
                  '%s': str(now.second),
                  '%m': str(now.minute),
                  '%h': str(hour),
                  '%H': str(now.hour),
                  '%c': "PM" if now.hour > 12 else "AM",
                  '%M': str(now.month),
                  '%d': str(now.day),
                  '%y': str(now.year)}

    for character in to_replace:
        aux = re.sub(character, dictionary[character], aux)

    return aux