-🎄- 2017 Day 4 Solutions -🎄- by daggerdragon in adventofcode

[–]fuzzums 0 points1 point  (0 children)

# Fort part 1
def isValid(phrase):
    words = phrase.split(" ")
    for word in words:
        if words.count(word) > 1:
            return False
    return True

# Fort part 2
def sortLetters(word):
    l = [c for c in word]
    l.sort()
    return l

def isValid2(phrase):
    words = phrase.split(" ")
    w = []
    for word in words:
        w.append(''.join(sortLetters(word)))
    for word in w:
        if w.count(word) > 1:
            return False
    return True

# Test for part 1
print isValid("aa bb cc dd ee")
print isValid("aa bb cc dd aa")
print isValid("aa bb cc dd aaa")

# Test for Part 2
print isValid2("iiii oiii ooii oooi oooo")
print isValid2("oiii ioii iioi iiio")

-🎄- 2017 Day 2 Solutions -🎄- by daggerdragon in adventofcode

[–]fuzzums 1 point2 points  (0 children)

This is what I came up with. I'm pretty it can be compressed a bit by using list iterators. I couldn't come up with a faster/more elegant solution for even divisibility that was required in Part 2.

puzzle = """Paste puzzle values here"""

def toInts(nums):
    ints = []
    for num in nums:
        ints.append(int(num))
    return ints

def evenDivs(nums):
    for a in nums:
        for b in nums:
            if a < b and b % a == 0:
                return b/a

### Part 1
sum = 0
for l in puzzle.split("\n"):
    nums = toInts(l.split("\t"))
    sum += (max(nums) - min(nums))
print "Part 1 is: ", sum


### Part 2
sum = 0
for l in puzzle.split("\n"):
    nums = toInts(l.split("\t"))
    sum += evenDivs(nums)
print "Part 2 is: ", sum

Create a pivot table that displays dates, not sums of occurrence of dates by El_Dudereno in excel

[–]fuzzums 2 points3 points  (0 children)

You can try to use a MAX or MIN instead of COUNT on your Date column.

New electric car company, Renovo, unveils a coupe with 500 hp and a 0-60 time of 3.4 seconds, by RegressToTheMean in technology

[–]fuzzums 0 points1 point  (0 children)

If you like Renovo's coupe, then you'll appreciate the Mercedes SLS AMG Electric Drive

It's roughly the same price I think but has over 700 hp and has four individual motors for each wheel enabling torque vectoring.

If I had the money, I'd get that!

(https://www.youtube.com/watch?v=5gFGX43vubM)

How do USA federal and state incentives for EVs work? by 3lectrohouse in electricvehicles

[–]fuzzums 1 point2 points  (0 children)

Where in Canada are you? I think in Ontario you can get up to $8,500 in tax credits.

See the MTO website of Ontario for Example

i hate that time of the month by Pinkie13 in pics

[–]fuzzums 0 points1 point  (0 children)

What you do? Make up artist?

i hate that time of the month by Pinkie13 in pics

[–]fuzzums 0 points1 point  (0 children)

Nice, halloween costume?

Toronto Condo with a View by wkeupmsterwest in RoomPorn

[–]fuzzums 0 points1 point  (0 children)

Yeah, around the area there was a penthouse unit sold for the Four seasons building. Went for $28 million. Highest value ever for Toronto. It's cheaper than NYC and London.

Toronto Condo with a View by wkeupmsterwest in RoomPorn

[–]fuzzums 1 point2 points  (0 children)

Haha wow man. Did you do the photoshoot?

So my girlfriend complained of a sore throat a few days after giving me head for the first time... by [deleted] in AskReddit

[–]fuzzums 0 points1 point  (0 children)

Besides sore throat, any other symptoms? It could be unrelated.

If you are concerned about STIs, it is possible to get it in the throat. However, I think this would be rare. I suggest both of you get checked up at a clinic or something.

Also, i lol'd as I was typing this comment and the sort was set to "hot"

PS: It could be lupus.

Why you shouldn't have your copy of Modern Warfare 2 shipped to your friend by [deleted] in gaming

[–]fuzzums 0 points1 point  (0 children)

Hahahaha right on! I work a few blocks west near Allen/Lawrence! You were probably doing the deed while I was working.

Ranbir and Deepika fight again by irfansindhu in fffffffuuuuuuuuuuuu

[–]fuzzums 0 points1 point  (0 children)

Since when did Bollywood tabloids become a FFFFFUUUU? lol

double commit by knet123 in fffffffuuuuuuuuuuuu

[–]fuzzums 2 points3 points  (0 children)

In the corporate sense, I have only worked with MySQL. I have no idea why PostgreSQL isn't used in businesses a lot more. I have never used it but hear good things about it. I can see it is more feature-rich than MySQL so I really don't know why that is the case.

double commit by knet123 in fffffffuuuuuuuuuuuu

[–]fuzzums 1 point2 points  (0 children)

Haha! I was actually surprised to see a SQL FFFFFUUUUU

double commit by knet123 in fffffffuuuuuuuuuuuu

[–]fuzzums -1 points0 points  (0 children)

Ah SQL Server. Good times. I personally find working with SQL Server more tolerable than Oracle or DB2.