« first day    last day (559 days later) » 

12:14 AM
still here
If you're new to the site, this chat room is still in beta mode, talk is enabled in the Python room.
 
12:30 AM
ok, gotta head home, I'll check back in later.
ok, really heading home now.
 
1:09 AM
I'm back.
 
 
1 hour later…
2:32 AM
ok, I guess I'll open this room. It's subject to being closed to non-permitted users, but I'll add people as they come if they behave.
room mode changed to Public: anyone may enter and talk
ok, we're open for business, I suppose.
 
3:31 AM
Charles Lutwidge Dodgson was prescient when he wrote "it takes all the running you can do, to keep in the same place. If you want to get somewhere else, you must run at least twice as fast as that!"
 
3:48 AM
Ask Hacker News: news.ycombinator.com/item?id=9784008 How do you familiarize yourself with a new codebase?
ok, going to switch back to read only for now...
room mode changed to Gallery: anyone may enter, but only approved users can talk
I did approve a lot of higher rep Python room regulars to talk
ok, well if I don't go to bed right now, I'll be in the doghouse, so off I go. Good night everyone.
 
 
10 hours later…
1:48 PM
And we're back
 
 
2 hours later…
4:17 PM
hm...
 
4:50 PM
ok, just finished this. Took about 20 minutes... not bad?
import string

LETTERS = string.ascii_uppercase

def to_int(alpha):
    if not alpha:
        return 0
    return (LETTERS.index(alpha[-1]) + 1) + to_int(alpha[:-1])*26

def to_alpha(n):
    if not n:
        return ''
    return to_alpha(n // 26) + LETTERS[(n % 26) - 1]

def main():
    assert to_int('A') == 1
    assert to_int('AA') == 26 + 1
    assert to_int('AAA') == 26**2 + 26 + 1
    assert 'ABCD' == to_alpha(to_int('ABCD'))
First go, string index out of range (for 0), so remembered to add check for end, next go, I was adding the to_alpha on the wrong side, so my second assert failed by returning 'DCBA' Haha...
Worked on the third try though.
 

« first day    last day (559 days later) »