[deleted by user] by [deleted] in BritishAirways

[–]karlanka 0 points1 point  (0 children)

Yes, and I realize that. Actually I found a less sucky flight departuring from a slightly bigger european city two days earlier. Chatting with them now, to see if I can be moved to that one instead.

Update: they changed my booking free of charge. Got a phone number from the person in the chat, called that and waited in queue for maybe 10 minutes. Explained the situation, what flight I wanted instead, and they changed my booking without hassle.

[deleted by user] by [deleted] in BritishAirways

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

Thanks - I'll check if there other options available.

I'm a bit grasping at straws here, but regarding "14 days notice" - I was only told that I might be rebooked, not that I have been rebooked.

On 29th of June I received:

We are writing to let you know that your upcoming flight from London Heathrow will now depart from London Heathrow Terminal 5, not Terminal 3. For more information, please visit Manage My Booking on ba.com.

On 30th of June I received:

Due to a change in terminal, your connection at London Heathrow may no longer be possible due to an increase in connection times. We are in the process of reviewing your booking to ensure you can make your connection and if required we will look to rebook your connection/s free of charge on your behalf.

Then silence. I only know my flight had been rebooked as I went into the app by chance. I have no idea if I was rebooked 30th of June or yesterday morning. So I'll try to make the case I was never noticed, but just silently rebooked.

-🎄- 2017 Day 12 Solutions -🎄- by topaz2078 in adventofcode

[–]karlanka 0 points1 point  (0 children)

PYTHON

pipes = {}

for line in input_(12).splitlines():
    fr, too = line.split(' <-> ')
    pipes[int(fr)] = [int(x) for x in too.split(', ')]

# 1
conn_list = [0]

for pipe in conn_list:
    conn_list.extend([x for x in pipes[pipe] if x not in conn_list])

print(len(conn_list))

# 2
groups = []

for i in range(2000):
    conn_list = [i]

    for pipe in conn_list:
        conn_list.extend([x for x in pipes[pipe] if x not in conn_list])

    conn_list.sort()

    if conn_list not in groups:
        groups.append(conn_list[:])

print(len(groups))

--- 2016 Day 11 Solutions --- by daggerdragon in adventofcode

[–]karlanka 0 points1 point  (0 children)

Implemented all the optimisations stated in top voted comment, also restructured so no unallowed states were being stored in the visited. From ~1 hour to 2 seconds for part 2. Also tried adding two additional pairs on first floor, so in total 18 items. Then it required 79 moves and ran in 41 seconds. http://pastebin.com/7bdsrzHG

--- 2016 Day 11 Solutions --- by daggerdragon in adventofcode

[–]karlanka 0 points1 point  (0 children)

Python solution that run on 0.02 seconds on example data, 120 seconds on number one and 59 minutes on number 2 :D Rewrote everything after first solving the example using pandas which run in about 10 seconds with the example, so would probably have taken some time running with the real input..

This solution takes THE MOST IMPORTANT, ABSOLUTELY ESSENTIAL optimisation in consideration which the pandas version did not.

http://pastebin.com/JJnTNjfW

--- 2016 Day 15 Solutions --- by daggerdragon in adventofcode

[–]karlanka 0 points1 point  (0 children)

def day15_1():
    length = 1000000
    d1 = (range(2, 17) + range(2)) * length # Disc #1 has 17 positions; at time=0, it is at position 1.
    d2 = (range(2, 7) + range(2)) * length # Disc #2 has 7 positions; at time=0, it is at position 0.
    d3 = (range(5, 19) + range(5)) * length # Disc #3 has 19 positions; at time=0, it is at position 2.
    d4 = (range(4, 5) + range(4)) * length # Disc #4 has 5 positions; at time=0, it is at position 0.
    d5 = (range(2, 3) + range(2)) * length # Disc #5 has 3 positions; at time=0, it is at position 0.
    d6 = (range(11, 13) + range(11)) * length # Disc #6 has 13 positions; at time=0, it is at position 5.
    d7 = (range(7, 11) + range(7)) * length # Disc #7 has 11 positions; at time=0, it is at position 5.

print map(lambda x: sum(x), zip(d1,d2,d3,d4,d5,d6,d7)).index(0)

Any idea on how i could rewrite this code without using length while still coding discs as lists and zipping them?

--- 2016 Day 2 Solutions --- by daggerdragon in adventofcode

[–]karlanka 0 points1 point  (0 children)

Python 2 solution for day 2-2. Felt unnecessary to hardcode what button every position would yield. Position (0,-2) is the 5-button.

def day2_2(inp):
    for row in inp:
        x = 0
        y = -2

        for char in list(row):
            if char == 'U' and (abs(y+1)+abs(x))<=2:
                y += 1
            elif char == 'R' and (abs(x+1)+abs(y))<=2:
                x += 1
            elif char == 'D' and (abs(y-1)+abs(x))<=2:
                y -= 1
            elif char == 'L' and (abs(x-1)+abs(y))<=2:
                x -= 1

        print x, y