« first day (1881 days earlier)      last day (3291 days later) » 

00:16
Can a set have repeating elements in python3?
I didn't think it could, but this line in my code:
print(set(self.current_states))
is returning:
{0, 1, 2, 0, 3, 14, 0, 15, 0, 0, 0, 0, 1, 0, 2, 0, 0, 0}
How can that be?
self.current_states is a list
What happens when you do: print self.current_states, type(self.current_states)
[1, 2, 9, 3, 0, 1, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0] <class 'list'>
(different list from before, because the conditions are slightly different)
Ah, christ, I figured it out
The set elements were never ints
They were objects with an int repr
00:31
sneaky.
@MartijnPieters please nuke this very suspicious question stackoverflow.com/questions/34191644/python3-login-program
i flagged and voted delete etc
Already gone :P what did it ask?
00:59
Hmm with django how many connections (or actually calls back to the sqlite database) can I typically take before it jams?
 
2 hours later…
02:37
@paul23 the question is more how many connections can sqlite handle.
@JGreenwell Hmm is it possible for django to log the access times (actually accessing the database)? Than i can profile it a bit.
yes, you can either set up some logging manually (use/create some middleware) or change the logging setup in settings.py
If I recall either:
DJANGO_LOG_LEVEL=DEBUG #this will show everything
or
12
Q: log all sql queries

Oleg PavlivHow can I log all SQL queries that my django application performed? I want to log everything, including SQLs from admin site. I saw this question and a FAQ answer but I still can't figure out where should I put from django.db import connection connection.queries to log everything to one file...

02:58
Thanks
Funny thing is, maybe I shouldn't even use HTTP and opt for a more bare metal approach.
the HTTP headers are much larger than the messages I keep sending (by like a few factors) - I just need to send every minute back and forth roughly 100 bytes..
I would think the decision to use HTTP/HTTPS would depend on other requirements (aside from size)
Meh I use it for ease of access, basically I write a small game of hide and seek between friends - using GPS.
A small site like that shouldn't run into any problems using SQLite (with connection limits or concurrent limits)
03:42
can i get help with python here?
yes, please read our room rules: sopython.com/chatroom
What I am trying to do is write a function that randomly flips two letters of a word other than the first and last characters for instance if the user input "beginner" the output would be "begnnier" where the only two characters flipped were the i and n this is what I have so far the problem is that my function flips all the characters rather than just two
def scramble(word):
result = word[0]

if len(word) > 1:
for i in range(len(word) - 2, 0, -1):
result += word[i]

result += word[len(word) - 1]

return result
DSM
DSM
Where in that code do you try to randomly select two letters (except the first and last) to flip?
you asked that question on the main site an hour ago and received multiple answers
so far none of the answer work
answers work
03:51
> If you have posted a question on the main site and a significant amount of time has passed without receiving a satisfying answer, then you can discuss your question in the room.
how much time is significant?
you can use the menu to the left of a message to edit or delete
2 days
ohh okay thnaks
phihag's answer works fine for me
just to explain why: we and others already watch the tag
in fact, I was looking at the post a minute before you showed up
DSM
DSM
03:54
Albert is right, or so it seems to me: none of the answers work.
w/e, it's not that big a deal right now, discuss away
comment on that answer if it doesn't work for you as to why (note it is not the same as the other answer)
ahh...just glanced at it. See the problem now.
You want to flip consecutive characters, not just any two characters, right?
DSM
DSM
The example he gives isn't consecutive.
... yep :-/
DSM
DSM
04:02
And I'm assuming that by "letters" the OP really means "characters at two indices" -- things become a bit of a nuisance if we have to flip two different letters that don't match those at the start and the end..
now his answer works (assuming I'm reading the question as "swap any two random characters, only two, except the first and last letter")
DSM
DSM
TBH this seems needlessly complicated. Why not just random.sample(range(1, len(word)-1), 2) to get the indices, and then use list/change/join?
Oh, wait. Maybe phihag is being deliberately baroque?
Any guesses as to the AoC problem tonight?
bad questions last few days ...
DSM
DSM
04:19
7 annoyed me because of a quote error on my part which took forever to find.
04:49
what
matplotlib.org is down
where am I supposed to get my documentation now
DSM
DSM
05:07
Part 2 was disappointing. I mean, it was just part 1, again.
DSM
DSM
Ah, well. Time to sleep. :-)
Rhubarb for all!
 
2 hours later…
07:45
hello everyone :)
07:59
@DSM: EIGHTEEN SECONDS? I bet that stings. :-D
08:09
Re-Cabbage :-)
08:32
btw cbg 4 all
09:07
Cbg
Hey up mucka mine.
Hello all , I'd like to ask a question
about Pyspark and lambda expressions , is it OK ?
@toren if a question is about Python it's fine.
But if it's about the more Spark-side of it, you'll find that not many people will be able to help.
I'll try ...
I have a key/value pair where x is a key of (x,(a,b)) , I'd like to sum b over each a , but keep x
x is important key and can varry
Thanks for any help
09:37
Cbg
Cbg :)
Anyone found a smart way to do AoC today? My naive approach took 6 seconds to do part b and I'm wondering if there's better out there. However - many seconds dev time saved by just writing my initial thoughts in code, so, optimal for some definition of optimal I guess.
@Toren Can you explain with an example?
09:57
Cabbage!
@JRichardSnape Not sure if you can solve it in a smart way without calculating the actual stuff.
@poke yeah - I kinda thought you probably can't. Haven't listened to the John Conway link yet. My suspicion is that there are only a small number of unique chains (obviously you can "start" from different places in the chain).
Yeah, I remember Kevin and me talking about this before, and he somehow prooved that the largest number is 4 or something
(largest number that is generated)
10:20
There are interesting properties definitely. For instance - '22' is a 'stationary' point and will never change with this scheme. Also, the chain for 11 is same as 1 with one extra step. Similarly 12,13 etc. I'm not sure whether there are finitely many chains. This will keep my mind occupied...
anyone up for a challenge ?
I think there are. I think all numbers greater than a certain (TBD) upper limit will necessarily map back to a number smaller than that. Now musing on whether I can show it / work out the upper limit...
@SarvagyaAgarwal Question too open, failing to compute ;)
a.k.a. maaaaaaaayyybeeee......
@SarvagyaAgarwal Don't leave a space before question mark :)
davidism should be telling this :P
@BhargavRao The force is strong with you young Bhargav ;)
lol :D
10:29
No - I've convince myself that there is no I can't find a number that is an upper bound for sequence length under the transformations in AoC today
I have two integers A and B in base 7 . I need to calculate C such that B*C = A . (It is guaranteed that B is a divisor of A). I need to output C mod (7^L). And i need the answer to be in base 7 .
What is L?
I could do a straightforward brute force here but the problem is that length of A is <=10^6 and length of B and L <=10000 .
Always so surprised how little format() is known (as part of the str.format() ecosystem). See stackoverflow.com/questions/699866/python-int-to-binary
L is a given integer .
10:34
Everyone uses '{0:b}'.format(i), taking a huge hit in parsing out the {..} placeholder format, and matching it with an argument, which then effectively calls format().
@MartijnPieters There was some answer somewhere with your comment telling format is better in that particular case. I saw that yesterday :D
('{arg:formatspec}'.format(arg) calls arg.__format__(formatspec) after parsing, format(arg, formatspec) does the same without the extra parsing).
So if A=202 and B=13 and L=2 the answer is 13
Gotta love the ole deadbeef example. And format() is the best way to do this. — Martijn Pieters ♦ May 7 '13 at 8:32
Found it :)
Is it a huge hit? I just timeit'd it (on different PC so can't copy+paste) but the times seemed very similar.
Not that I'm not arguing it's a nicer solution, of course.
10:49
Wow, Python 3.4 is damn fast compared to 3.5.
$ python3 -m timeit -s "import random;l = [random.randint(1,127) in range(100000)]" "[chr(i) for i in l]"
1000000 loops, best of 3: 0.441 usec per loop
$ python3.5 -m timeit -s "import random;l = [random.randint(1,127) in range(100000)]" "[chr(i) for i in l]"
1000000 loops, best of 3: 0.515 usec per loop
@MartijnPieters Really? Interesting.
any insights on my problem ?
I usually use 'format'.format(args) because it allows me to add characters to the format string that are not part of the format spec.
– or because multiple arguments. It’s quite rare that I only format a single thing.
Both are excellent reasons to use str.format().
@BhargavRao Not for me:
PS C:\> py.exe -3.4 -m timeit -s "import random;l = [random.randint(1,127) in range(100000)]" "[chr(i) for i in l]"
1000000 loops, best of 3: 0.377 usec per loop
PS C:\> py.exe -3.5 -m timeit -s "import random;l = [random.randint(1,127) in range(100000)]" "[chr(i) for i in l]"
1000000 loops, best of 3: 0.327 usec per loop
10:52
Nah @poke I think I am able to get the reason why. Py3.4 is default in ubuntu.
So I guess default Python is always faster than the others.
So I need to find an answer for that on askubuntu. :/
@SarvagyaAgarwal Is it B * C = A mod 7 or B * C = A? (i.e. are you talking about modular arithmic?)
@Bhargav Maybe it’s compiled more efficiently.
@BhargavRao: I can't reproduce that either; 3.5 is actually faster for me. By a fraction, so not significant.
Which is to be expected, since nothing changed in that area.
@poke B*C=A (A and B are given in base 7) what i need to output is C mod(7^L, L is given)in base 7 .
@Martijn Did you try the default python (if on linux).
I am searching for the reason on askubu, but there is no related question on that.
I'm still surprised when I see strftime being used in new code...
10:58
@Sarvagya It doesn’t matter what base the inputs are given in. Once you interpret them, you can see them as base 10. It’s still not clear to me. Do you have examples?
@poke for the example i mentioned above A=202 in base 7 or 100 in base 10 , B = 13 in base 7 or 10 in base 10. A/B = C = 10 . C mod (7^L) = 10 mod (7^2) = 10. 10 in base 7 is 13 so the answer is 13
@poke is it clear now ?
So int('202',7)/int('13',7) would give 10
Now we need to reconvert that back to Base 7.
@BhargavRao yup
A B L are all very big .
Ugg, How do you reconvert it to base 7. has forgotten maths
@BhargavRao keep on dividing the number by 7 and store the remainders until the number becomes 0. now just reverse the remainders
11:05
@Sarvagya Like this?
>>> def toBase7 (n):
        s, n = [], int(n)
        while n > 7:
            n, r = divmod(n, 7)
            s.append(str(r))
        s.append(str(n))
        return ''.join(s[::-1])

>>> a = int('202', base=7)
>>> b = int('13', base=7)
>>> c = a / b
>>> L = 2
>>> toBase7(c % 7 ** L)
'13'
Python3.4.1 - 0.556 usec per loop
Python3.4.3 - 0.441 usec per loop  (preinstalled)
So preinstalled Python is faster than Normal python.
QED
That's not QED worthy.
yeah
Quod erat demonstrandum means something like "which is what had to be proven" and should follow a logical proof.
11:13
So QED doesn't mean, hence proved?
You haven't proved it though.
You have shown evidence for it.
Oh Ok. Got it.
It should have been “Two examples show that the preinstalled Python version on my system is executing this one example code faster than a self-compiled or self-installed version. This could suggest that all preinstalled versions on this kind of machine are faster than other versions, but there hasn’t been a study with extensive tests to support that idea.”
Is that question on-topic for SO? Or should I ask on askubu?
To show is not to prove, added the mathematician, sagely
11:16
Statistics can never prove stuff :)
Bad statistics (2 out of 2 tests…) even less so ;)
I'm surprised no one has asked out that before. :D
Maybe before asking it, you should ask someone else to test this on their Ubuntu machine to provide evidence that it’s not just your machine
Yep. True that. I will hold it till I find a peer system to test on.
@BhargavRao I'm not on Linux; I've built my own Python binaries (using buildout.python), but the brew Python 3.5 doesn't show any slowdown either.
@SarvagyaAgarwal Is there a reason you can't just do C = A/B and then express C in base 7 mod 7^L ? Note that there is no need to express anything in base 7 for the calculation itself - if you then input is in base 7 you can always convert to base 10 (0r 2, 8 or 16 for that matter), do the calculation and then express C in the format you want. That's what poke has done for your toy example - does that work for all?
@BhargavRao I can run something on an Ubuntu virtualbox if that helps. What's your exact test code? (pop it on a dpaste or something)
11:19
@JRichardSnape Here
@JRichardSnape Mathematician eh? That's a big word for an engineer.
4
@Ffisegydd I believe it means an engineer that can't work out which way to turn the spanner - is that right?
Mathemagician
Ta poke - actually, I can't help. Something (either windows firewall or my antivirus) has updated and is now blocking VirtualBox from running as "WinVerifyTrust" failed. Sorry. adds yet another job to the TODO list
xD
11:27
@thefourtheye I'll try to explain with example :
I have a key/value pair (key,(value1,value2)) I'd like to sum value2 over each value1 , but I want to keep the key . The key can varry for example 1,2,3 or 4 , so Ineed to keep it I tried sumRDD = filteredRdd.map(lambda (x, (a, b)): (a, b)).reduceByKey(add) it works but I lose the kye
@JRichardSnape I actually tried the naive way only difference i can think of is that i did all the operations on integers @poke on the other hand did it with strings . It timed out when i did because the constraints are pretty high .
@SarvagyaAgarwal You cannot calculate base 7 numbers with decimals.
@SarvagyaAgarwal is it a coding challenge? Otherwise I'm not sure what "timed out" means. When you say high - how high? number of order 10**10, or 10**100 or...
So you have to represent the result as a string.
^ What he said
11:34
@JRichardSnape by high i mean that number of digits in A can be 10^6 . number of digits in B and L can be upto 10^4.
10^6 digits
OK - quite high then ;) What do you mean by timed out? Your program just hangs?
Goes to market, Buys a server
@JRichardSnape it's a coding challenge where the limit is set to 1 second . It basically takes more than 1 second so it times out
e.g. I can quite easily do a = 10**(10**6) and b=5**(10**6) with latency ~0.5 secs in python, but c=a/b will take a long (~10 secs) time
11:37
Then you’re obviously not supposed to do this using computational power, but by thinking about it.
@poke That's what i asked
modular inverses seem the way to go, potentially. 7 is prime - making me thing it's chosen so that modular inverses exist
@poke I couldnt find any number theory results which can be applied here
Can you post the full challenge description?
11:38
@JRichardSnape what is B is divisible by 7
interest piqued
Plus if you're looking for number theory help, you'd probably have more luck on Maths.SE.
Which is not to say that certain people here couldn't help.
@poke sure 1 sec
Although, as my esteemed colleague the physicist has pointed out, I am but an engineer.
Sereja has two integers — A and B — in 7-ary system. He wants to calculate the number C, such that B * C = A. It is guaranteed that B is a divisor of A.
Please, help Sereja calculate the number C modulo 7^L.
11:39
@JRichardSnape whatever your shortcomings, we still love you.
it is 7^L there
hmm
@SarvagyaAgarwal Thoughts in progress You want to work all in modulo (7^L), so the point is whether B is divisible by (7^L), not 7. I think that might have to be a caveat to your solution. So - you need fewer base 7 digits in B than L. If that is satisfied, I think you can do it.
the result C_r = C mod 7^L means that C = C_r + k * 7^L for some k.
For fast multiplications there are algorithms like FFT, karatsuba etc . Nothing for fast division ?
11:45
So we have B * (C_r + k * 7^L) = A which is equivalent to B * C_r + B * k * 7^L = A.
Almost sure fast plain division is not the way to go
I am sure there was a hack for questions that asked to find modulo at the end.
I used that technique in my interview. (I did not pass though)
So C_r = (A - B * k * 7^L) / B
(not really sure what I’m doing)
As long a B is coprime to 7^L, which it will necessarily be if it is < 7^L then its modular inverse exists and can be found in next to no time. Then you simply have C = A * mod_inv(B). If you want some mod_inv code, I have some kicking around somewhere...
modular arithmetic is too long ago…
11:51
Basically - poke is more or less there. You have B mod_inv(B) = 1 mod 7^L. i.e. kB - 1 = q * 7^L. Run up through the ks until you find one that divides by 7^L. That gives you q (but you discard that). mod_inv(B) = k. iirc
There are probably quicker ways of finding k than simply going up through the integers, but for your case of ~10**4, you shouldn't need to worry
@JRichardSnape 7^(10**4)
@SarvagyaAgarwal mmm - yes - fair point. maybe there is something more clever than that you can do. Do you have real sample data? I'm wondering if there is something special about B that makes the search for its inverse easy
@JRichardSnape sorry i dont have the real sample data , the online judge does.
@BhargavRao /closed
12:01
@SarvagyaAgarwal hang on - I remember. You can do something like pow(B,mod-1 (or was it 2), mod) to get the inverse (it's coming back to me).
Still might take too long for mod = 7**(10**4), though, I think.
@JRichardSnape 7^(10^4)
You're mixing ^ and ** here?
Or are you? I haven't been paying attention.
Man its confusing :P
12:07
Being a physicist, I'd have thought you'd brush away such notation clashes as arbitrary ;)
7 power 10 power 4 Explicit is better than _____
As a physicist I take every opportunity to show my natural superiority.
@BhargavRao Is that (7 power 10) power 4 or 7 power (10 power 4)? ;P
@Ffisegydd resists the obligatory XKCD
:D that xkcd perfectly describes every physicist every (not a gross blanket statement but bare truth)
12:09
@poke (╯°□°)╯︵ ┻━┻
:D
Hey, it’s a difference, so you’re not explicit enough!
I worked with a modeller who was a physicist originally - had worked with Ilya Prigogine (nobel winning physicist). He was still exactly like that comic, despite 30 years out of physics proper
@poke Lol yeah. :D
(7^10)^4 is 7^40, which obviously isn’t the same as 7^(10^4) which is 7^(10000)
Every time I see ^ it just makes me think of emojis (^_^) and now I'm just thinking about syntactically valid emojis...
12:13
(<_>)
^_^ hmm… power to the last evaluation result, power to…
d^_^b <- Emoticon with head phones. Valid Python syntax.
to 1.61803398875?
got memoryerror with pandas pivot_table
@SarvagyaAgarwal Use the mod_inv implementation here rosettacode.org/wiki/Modular_inverse#Python . It uses a neat Euclidean algorithm to cut down time to find the inverse. I just tried it with L and B both around 10**4 and it was under a second. Still doesn't make use of the fact your input is in base 7, which makes me think there's another trick...
@JRichardSnape Thanks I'll see if it reduces time
12:26
Ahh - one further thought. If A is input in base 7, you can simply take the rightmost L digits of it, as that will be it mod 7^L and it's safe to do that as (X*Y)mod M == (X mod M * Y mod M) mod M if memory serves
I have already configured gearman, pymongo and other packages in my system and works fine
I have moved to one directory, where it gives
ImportError: No module named gearman
same for pymongo, socks and other packages
How come this possible? any probable reason for this?
@SarvagyaAgarwal Summary of thoughts so far. It works, but it's about 3 secs rather than 1 on my machine, I think dpaste.com/0NDSY3V
Gotta do some real work now...
@JRichardSnape Nice
@JRichardSnape thanks for the help
@SarvagyaAgarwal You're welcome - fun problem
12:38
@JRichardSnape what happens if mod_inv does not exist ?
ValueError
Tea time. Rbrb.
12:54
@PeterVaro Looks like a variation of the technique I used for spiral_clock.gif. But it's a little trickier to make it seamless like that. And the aberration around the edges is interesting.
Looks like someone is proficient in both programming and Photoshop.
GCHQ getting in on the Advent programming fun
It's a stretch to call Picross "baffling".
Oh how lovely, I can't fill in the boxes in MS Paint because of all the jpg noise.
panda's pivot_table for a large dataset gave me memory error ... is there any other way to generate a sparse table with pandas without running out on memory
Oh, there's a "series of tougher challenges" after the Picross. Complaint of bafflement rescinded.
Now in minute 5 of waiting for gchq.gov.uk to load...
DSM
DSM
@MartijnPieters: yeah. My FGITW days are mostly behind me, so if I can hit #1 I'll stop trying and just solve them in the morning like a reasonable person. But I'm so close..
13:08
Do they not want me because I'm American? ;_;
They don't want me because I'm a subversive
DSM
DSM
@Kevin: they're also not wanting us Loyalists, apparently.
I couldn't access the site using the old "plug a website into google translate for a quick pseudo-proxy" trick, but downforeveryoneorjustme.com says it's accessible, so I don't know what to think.
I wonder if it's possible to do today's AoC without actually creating the tremendous string.
Firewall? That happens a lot to me when I google things for programming and often ads link to places considered blocked for 'gaming' content.
I have been wondering tge same. Poke votes no. I think he's right. Then I got distracted by modular arithmetic
DSM
DSM
13:26
The need to coalesce contiguous groups is a challenge for ways to avoid materializing the string. 1122 goes to length 4 but 1212 goes to length of 8.
Yeah it's not trivial to do something with Divide & Conquer since adjacent subsections can interact with one another in the next stage.
user4891978
cabbage
DSM
DSM
There seem to be no shorter strings which generate the initial string.
user4891978
So, I was wondering if anyone can help me here.
user4891978
Wait, nevermind, hold on.
13:30
^ I have those moments sometimes too
I wonder if it depends on your initial string or whether they're designed as unique starting points
user4891978
Nope, I still need help.
DSM
DSM
Oops, I stand corrected. 132113.
user4891978
So, I have two functions here that can more or less just be combined to make up one function.
user4891978
def validation_input(dialog, validation, error_message = NOPE):
    while True:
        answer = input(dialog)
        if validation(answer):
            return answer
        else:
            print(error_message)

def choice_input(dialog, options = YN, error_message = NOPE):
    while True:
        answer = input(dialog).lower()
        if answer in options:
            return options[answer]
        else:
            print(error_message)
13:31
We know that there will never be a character other than "1", "2", or "3", and we know that the longest possible run of identical characters is 3 long, provided the input follows those same constraints. So the variety of output is pretty limited in comparison to the set of all strings.
user4891978
Only problem is, one of those has to have input be lowercase.
DSM
DSM
So the root is 3: ['3', '13', '1113', '3113', '132113', '1113122113']
user4891978
How would I be able to call .lower() on it without needing a separate function to do basically the same as the other?
@Texenox How about:
def get_input(dialog, options = YN, error_message = NOPE, use_lower=False):
    f = str.lower if use_lower else lambda x: x
    while True:
        answer = f(input(dialog))
        if answer in options:
            return options[answer]
        else:
            print(error_message)
@Kevin Use Conway's constant to estimate the output?
user4891978
13:34
@Kevin Ah, right, something like that would work.
user4891978
Except I need validation_input rather than choice_input.
user4891978
For example.
user4891978
age = validation_input(
            "How old are you? ",
            lambda age: all(i in '1234567890' for i in age),
            error_message = NOPE + " (Input must be a positive integer)"
        )

        gender = choice_input("What gender are you? ('m' for male, 'f' for female, 'o' for other) ", # it was not my idea to add the 'other' option
                              options = {'m': "Male", 'f': "Female", 'o': "Other"})
Oh, I missed that one has a validation parameter and the other doesn't.
Maybe the functions are different enough that you should just keep them as separate functions. It's possible to combine them but I don't think you're gaining anything in regards to maintainability.
user4891978
Wait, maybe I can figure something out with the use_lower.
13:40
Yeah I think I'd keep 'em separate and do:
def validation_input(dialog, validation, error_message = NOPE):
    while True:
        answer = input(dialog)
        if validation(answer):
            return answer
        else:
            print(error_message)

def choice_input(dialog, options = YN, error_message = NOPE):
    key = validation_input(dialog, lambda answer: answer.lower() in options, error_message)
    return options[key.lower()]
DSM
DSM
Okay, I've changed my mind. I think it is possible to get the nth term in AoC 10 without materializing the string.
Which at least prevents duplication of the while True: logic
DSM
DSM
Yep. You can do it. And it's fascinating.
Nooooooo, you have opened another rabbit hole. my first instinct was that it was possible, but I had dismissed it. And then you say that ^ ;)
user4891978
Right, gotta go.
13:48
I wonder if there's a simple bijection between legal look-and-say sequences and the integers...
Or natural numbers, whatever's easier.
Gaaaahhh strangled gurgles
Too many interesting puzzles
I notice that all L&S sequences stemming from "2", have the same length as their respective sequences stemming from "3". In fact each is identical to its counterpart except for the very last digit.
Ex. g("2", 10) and g("3", 10) are '132113213221133112132123222112', '132113213221133112132123222113' respectively
DSM
DSM
Aaargh, we need longer for editing purposes.
> Ooh! I'm getting one of those, what do you call it? A headache with pictures?
> You mean an idea?
> Uh huh!
That's how I feel right now.
Maybe Divide & Conquer is doable if you split at the right positions...
now you can't edit staring to starting :)
Ooo, day 10 looks interesting.
Ooh, I think I found something... Fascinating ;-)
DSM
DSM
DSM's Advent of Code 10 challenge: starting with the string s='3', what is the length of the string after calling s=look_and_say(s) 5000 times (mod 10**9+7)?
This is becoming a game in and of itself
DSM
DSM
14:11
And now it really is time to head into the office. I don't know if my boss will accept "see, I was trying to nerd-snipe my net.friends" as an explanation for being late.
Whoops, the thing I thought I found turned out to be not real.
I thought g(a,N) + g(b,N) == g(a+b, N) if a ends with "1" or "3" and b starts with "22", where g(s,x) is "do the process on s, X times"
But it's not necessarily so.
I often discover unicorns while searching through these kind of problems. I am studiously ignoring the almost overwhelming urge to get into this...
I'm still investigating the possibility of "permanent cleave points", but the required conditions aren't as simple as I thought they'd be
Note that is a meta spoiler as it does not contain a spoiler in itself, but a link that may contain a spoiler / assistance @kevin
I have read your meta spoiler and acknowledge its validity. I still want to work on my own for a bit though.
14:26
ofc
user559633
No, unacceptable
What is? JS as a whole?
Bleh, PyCharm changed their icon and now I can't find it on my toolbar.
Hello
some great book to learn python?
Hmm, I thought we had a list of paper books too, but I don't see it in the wiki.
14:34
@Kevin it'd be really great
The answer for AoC10 is much bigger than I expected.
btw, thanks
@Kevin I'd appreciate some python 2.7 maybe, rather than 3
@ITProGuy Why?
@MorganThrapp It's just because we're developing in 2.7
@ITProGuy Ah, gotcha.
14:40
I really like php, js and this kind of languages, do you think that learning python will be easy for me?
I really like Conway's description of look-and-say.
> It seemed to me the stupidest problem you can conceivably imagine that led to the most complicated answer you can conceivably imagine.
I'm going from python to php/js. I feel like js made more sense to me, if that helps
Emergent complexity phenomena are the easter eggs of real life.
Ooh, think I found one possible criteria for permanent cleave points.
So we're trying to solve the DSM challenge now?
Yeah.
14:48
Maybe later. My desire to discover life's little numerical secrets is at odds with wanting to not get fired.
This problem seems like it would be interesting in binary.
morning everyone
Ok, my special cleave-point-aware length finder works for 40 and 50... Now to try 5000.
Wow, I'm really glad I spend so much time in here, otherwise I would've completely missed using hover for spoilers to solve day 10.
I really like this problem btw. It's a nice example of how something that grows exponentially can really blow up.
Also, seriously, day two is just 10 more iterations?
Alright, that does take a little bit longer.
14:52
9b was "Found Max? Cool now find min." and it's as easy as it sounds.
Wasn't it the other way around? I thought 9b was max?
Unless you're talking in terms of efficiency.
Have someone here ever embedded Python in C application? I need to get notification for every interpreted line. I also wonder how can one run Python script step-by-step. (here's my question if I got you interested: stackoverflow.com/q/34075757/5114473 )
I just mean easy alt- challenges is par for the course.
I got an answer for 500, but 5000 says "Python has stopped working."
14:56
I think 5 had the trickiest alt so far. That was the naughty-nice.
Why does music still sell on CDs? Why can't they sell it on cheap little 500MB usbs?
The last time I bought a CD was for a performer who clearly made all his money on overpriced CD sales.
It seems like it's impossible to find some music digitally short of pirating it or going to their concerts. 50% of things I search on iTunes/bandcamp doesn't have anything :\
Also, I'm not sure if flash drive readers / mp3 players are common everywhere.

« first day (1881 days earlier)      last day (3291 days later) »