« first day (2088 days earlier)      last day (2878 days later) » 

1:05 PM
@AnttiHaapala That's certainly more elegant than using map. I need to get used to these Python 3 idioms... hackerrank.com/rest/contests/master/challenges/ginorts/hackers/…
 
@PM2Ring my eyes :D
@PM2Ring kudos for using set() for consume_iterator
hmm your isupper is nicer tho
 
It's one char shorter than list(), and it means we only get a single None instead of a bunch of them. :)
 
1:21 PM
cbg
 
happy America Day to my fellow neighbours down south
 
cbg
 
Umm... what's the best dupe for stackoverflow.com/questions/38185696/… ?
@Withnail I see you found me on twitter :)
 
hiya
yeah, i was looking for something in the SOPython wiki and came across the twitter page
obviously, I can't remember what i was looking for in the first place
 
1:28 PM
ahh... yet another senile follower - great :p
 
who are you again?
:)
 
I'm "Ninja Puppy" - but you may call me Jon - or Joanna at weekends :p
 
that's like getting caught in the tvtropes abyss
4h later.... where am i? what was I doing?
 
yeah, a bit.
i had a question about tutoruials/recommended reading, but I couldn't find the page I was thinking of/may have imagined it.
 
1:53 PM
@thefourtheye I didn't know that :)
 
2:13 PM
@JonClements puppy, that OP is so confused.
 
Is there a tutorial people would recommend on starting with ML in python? The Datacamp/Kaggle one? Scikit-learn?
 
@Withnail sklearn is always a good place to start.
 
(this was the question I was looking in the SOPython wiki for earlier :P )
 
If you're a complete novice to ML then I'd look at the Titanic Kaggle competition.
It has some quite good tutorials that use sklearn.
(sklearn is the "import" name for scikit-learn btw, as imports can't have - in them.)
 
I've just been reading meta.stackoverflow.com/questions/327295/… I get why some people find that guy's style annoying, and it's certainly a lot less formal than the usual SO answer. But it looks like the guy really does know his stuff, and he is moderately funny, which makes up for the slightly reduced S/N ratio, IMHO.
 
2:21 PM
hah, ok. Those were the two I'd returned by dilligent Googling. :)
Reassuring.
 
The Titanic Kaggle comp has been going for years, they keep on extending it, because it's designed to be a learning one.
 
DSM
@PM2Ring: huh, I've never noticed this guy before.. and his website is blocked for me!
URL interdite. Catégorie d'URL: -Dubious/Unsavory -Information Technology .
Wait, github is being blocked.
 
That might be more of a problem...
 
@PM2Ring I like the bear typing one :)
That guy has under 1000 rep
 
I suspect it won't be under 1000 for long. :)
 
2:42 PM
@DSM Owch.
No open source for you.
 
2:53 PM
cbg, everyone. @PM2Ring that html regex post quite amusing. haha
 
@wgwz That post is probably the most linked SO post of all time. :)
 
@wgwz hey, let's get your pr merged if you have some time
just need to address those comments
 
@davidism ok. i've been working on the docs as well (just the tutorial section). i can probably add it all this afternoon.
 
Hello
Is cabbage still a thing?
 
user559633
yep. and hello
 
3:05 PM
cool
 
@MaxPower long time no see :)
 
lol hey and yeah i know... forgot about this place again
How have you been doing @JonClements ?
 
same old - same old... you forgot about this place!? Is that possible? :p
 
Yeah got used to hanging out on a teamspeak with some friends and now that i don't do that anymore, I felt the need of being somewhere social :P
 
DSM
Hooray! Github has been liberated.
 
user559633
3:11 PM
What do you mean, DSM?
 
user559633
Ah, thanks
 
DSM
@tristan: earlier I discovered to my dismay that github was being blocked. Turns out when they gave me my upgraded laptop, they configured it to be behind a particular proxy which has the world's dumbest blocklist. (github; freekorea.us, a North Korea blog I read; and other miscellaneous places.)
 
user559633
Ah, I remember you mentioning that proxy and freekorea. I didn't know if GitHub had done some July 4th based joke page.
 
DSM
Oh, yeah! Happy Independence Day! .. and welcome to Earth!
 
user559633
3:23 PM
:) Earf welcoming party 2016
 
More like Happy Traitor Day.
Chris Evans has stepped down as presenter of Top Gear.
 
user559633
Well, now you know that asking people in this continent to do anything we don't want to do will be met with extreme belligerence.
 
DSM
He's the guy who took over after the other guy was kicked out for beating someone up, right?
 
I feel like you can't really pin that on the Revolutionary Forces of America, though.
 
Yarp
 
user559633
3:25 PM
he looks like a store brand simon pegg
 
Boston Tea Party >> Two hundred odd years later Chris Evans resigned. Probably not a causal link.
 
DSM
Wake up, sheeple! It's all connected. Boston Tea Party, Chris Evans' resignation, LPTHW, Half Life 3. One big kaleidoscope of weird.
 
user559633
I was wondering how someone would connect that to half life 3. Half expected someone to make a half life of something in tea.
 
DSM
I used the Billy Joel method and made a list instead of thinking of something.
 
Half life 3's one of those eternal vaporware games, right?
 
3:32 PM
@DSM So you really didn't start the fire - is that what you're saying? :p
 
user559633
I still haven't played the extensions/episodes of hl2
 
@Ffisegydd It was never going to work - there's just some shows where the presenters "make the show" - it's like I couldn't really watch "Countdown" after Richard passed...
 
@JonClements 8 Out Of 10 Cats Does Countdown though? That's bangin'
 
user559633
Yeah, the combination of characters made the original top gear
 
oh yeah - that's fun - but it wasn't "Countdown" :)
 
3:34 PM
The original Top Gear was garbage.
The new Amazon Top Gear will be worse garbage.
 
The one with Tuffnell?
 
user559633
Was there one before 2002?
 
oh yeah - but it was easy turn your brain off for a bit garbage :)
 
Yeah, back in late 80s, early 90s.
 
No I mean the one with Clarkson, it was rubbish.
 
user559633
3:35 PM
Ah, I meant the one that brought us this:
 
Previous one was a 'proper' car show, did sensible headed reviews of the new astra, etc. Not much hooning about in supercars.
 
user559633
I disagree that it was rubbish. I think it was a decent skit comedy.
 
I think it was a rubbish car show, and I don't even think it was that funny.
So it fails on both counts for me :P
 
steam buddies. Have you guys picked up any games? Couple hours left, and nothing is screaming out at me. Unless there are some hidden gems you guys found.
 
3:38 PM
standard shoutout to the many hours of my life spent playing Kerbal, but I assume everyone has that...
 
user559633
Oh hello idjaw :)
 
howdy
 
Haha, opening the door to push the car back upright.
 
@davidism just pushed up my latest changes :)
 
Too late, I'm distracted by Top Gear now.
 
3:41 PM
Ah, well. Enjoy
 
@idjaw Not really. I already have all of the games. I added Far Cry to my basket but didn't actually buy it.
 
I ended up getting the remaining episodes of Resident Evil Revelations 2 I was missing, Alien Isolation and Life Is Strange
I'm looking forward to Life is Strange. I hear great things.
 
Quite into 'We Happy Few', looking forward to that.
 
Sometimes I listen to Life is Strange OST
haven't played the game though
 
@wgwz wow, that's a lot of change
 
3:51 PM
Hopefully the "lagging when firing" was a once off - but I'd be up for playing Duke 3D again at some point :)
 
@davidism hope it is alright ..
 
Some American music for 4th of July: Dreams Allman Brothers, 3/19/10 - United Palace Theater
 
@davidism let me know what you think. i'm glad to make changes if you think some things are not necessary. maybe i got a bit carried away with switching 1st to 3rd person.
 
@wgwz I usually prefer writing in the present tense and avoiding phrases like "just" and "simply", but it's not a big deal.
 
@davidism 2nd i meant. i don't mind making some more changes.
 
3:57 PM
I'll go through and proofread it for consistency later, it's not like it was particularly good about that before.
 
recbg
 
sounds good.
 
@wgwz Any chance you can re-file it against 0.11-maintenance on the off chance that we can release a new version of the docs?
I'll merge it into master after that.
 
Hi guys
I wish all my USA brothers and friends
Happy independence day
 
okay
And I wish all my UK brethren a happy independence day in the near future:P
 
4:10 PM
Speaking of, I saw Independence Day: Resurgence last night. It was both cooler and more boring than the original. All the space tech was cool, "story" barely existed and made zero sense. The ending just wasn't as satisfying.
 
So...Michael Bay?
 
Independence day 1 was very very awesome
 
Roland Emmerich
 
that's what you get for letting eye candy become the norm
 
Nah, it wasn't that the space stuff was eye candy, it was legit interesting, the movie just did absolutely nothing with the premise.
 
4:13 PM
:)
too bad
I guess I'll watch anyway
 
Yeah, still worth watching. It's a high budget B movie.
 
oh this is the weird guy...
 
@davidism sure. i will do that. i don't understand what you mean though...
 
Which part?
 
do you mean to just file a new PR on the maintenance branch?
 
4:20 PM
Yeah
I don't think you can rebase an existing PR to a different branch.
 
do you want to isolate the changes i made to the docs vs the changes to the flaskr? or is it ok to just submit my branch to the maintenance branch as is?
 
it's fine as is
 
ok.
 
How you guys celebrate independence day?
 
I generally have a little cry into my cup of tea.
 
4:23 PM
:D
imagine all those taxes...
 
The same way we celebrate everything else: get drunk and play with fire.
 
so just to make sure, i'll close the current PR and then issue the new, right?
 
either order is fine
 
ok, i think i've done it correctly. let me know if any problems.
ah, dang. i just saw your comment about the init.py in tests/.
 
I wish I could see Christmas of USA
Christmas and independence day celebration
 
4:34 PM
Christmas in Texas is brilliantly obnoxious brilliant. Instead of stockings, they get their presents in cowboy boots
 
Christmas is special, in that case the fires being played with are indoors, based on evergreen trees
(I hope people set their trees on fire in the US as well)
(well, not hope per se, but you know what I mean)
 
@davidism i think i've done something wrong. i've gotten a thumbs down from thiefmaster haha
 
uh, yeah, looks like you pulled in a bunch of other commits
 
Christmas in the US is one of the weirdest most OTT things I've ever experienced. Although opening presents by the pool in FL was pretty awesome.
 
How many days of holiday you guys get in Christmas?
 
4:36 PM
@Learning two
 
I think you want the Travel SE ;)
 
@Withnail OTT?
 
Over The Top
 
ah:)
 
Just 2 days
 
4:39 PM
@wgwz ok, what you should have done is rebased only your commits against the other branch. It looks like you merged the two branches.
 
I have heard that in Christmas generally 10 days of holidays is there
 
Wow, I want to go work for that company.
 
We don't even get that much in the UK. Generally a week off over Christmas here.
 
I heard that in France there are crazy amounts of vacation
 
Actually my company clients doesn't comes for 10-15 days during Christmas
 
4:43 PM
OK, there's a difference between what everyone does around the holidays, and how much time off a company gives.
 
hello
 
@AndrasDeak France requires 25 paid leave days, and there are 11 public holidays.
 
That's one of the things I miss about the civil service. (one of the only) I used to get 30 days annual leave + 9 days public and privilege days. + flexi time.
 
ah that makes sense:)
I just found what I remembered:
 
4:45 PM
(oops, train connectivity made me post twice)
 
in SO Close Vote Reviewers, May 26 at 17:36, by Tunaki
I have 38 vacation days per year
 
My company gives 25 days, + around 15 holidays.
 
It's the way forward tbh. 25 hour week, 40 weeks a year.
 
I just remember that much smaller numbers were being thrown around during that chat
 
4:47 PM
@wgwz if you need help, I can reopen the first pr and do the merge myself. It will just show that the pr was closed instead of merged on GH.
 
Hey everyone. I have a Python-related question; I wrote a short snippet of code and it seems to be stuck in a loop. I've tried debugging but I haven't been able to find the issue. Would it be cool if I asked it in chat?
 
Cool. So I'm just learning python programming, and wanted to try my hand at the Project Euler problems. I'm on #7 (which should be easy, as I understand) and after jotting down some pseudocode, I thought my algorithm should produce the solution
So I implemented the pseudocode in Python, but it seems that I'm stuck somewhere
what I'm essentially trying to do is create a list with a "base case" prime (the number 2) and then tell my code for every number after 2, if it's divisible by a number in the list, then it musn't be prime
however, if it's not divisible by any element in the list, it must be prime itself, and it can join the list
OH SNAP
I see what I did
sorry for interrupting everyone
 
:D
 
glad we could help:)
 
4:54 PM
I had a counter outside the loop
 
I've done that so many times, trying to write out my question answers it about half the time
 
therefore, based on the rest of my code, it was stuck in an infinite loop without restarting the counter each time
 
Don't use a counter - use enumerate :)
 
that's why we keep bugging everybody about MCVEs
 
what's that?
 
4:54 PM
MCVE+RTFM is 80% of the solution
15% of the remaining problem is google
5% is what should be asked on SO
 
lol
 
well, you're probably iterating over a list, right?
 
yes
(would you like to see the code?)
 
nah. :) but if you use enumerate, you don't need to use a manual counter
which as you've discovered can get misplaced
 
excellent- let me try that out
thanks
 
4:57 PM
i'm just pleased someone's asked a question I can help with :D
I mostly just hang out here and try and get pythonic by osmosis
 
I might have to do the same
(python via osmosis)
hmm.. seems like my code is too time consuming
I'll have to find a more efficient way
 
In the majority of nations, including almost all industrialized nations except the United States, advances in employee relations have seen the introduction of statutory agreements for minimum employee leave from work—that is the amount of entitlement to paid vacation and public holidays. Several companies will offer contractually more time, depending on the sector. Companies and the law may also differ as to whether public holidays are counted as part of the minimum leave. Disparities in national minimums are still subject of debate regarding work-life balance and perceived differences between...
 
what's the end of your iteration when searching for a given prime candidate?
@MartijnPieters that dark France:P And Northeners...
man, I'm always surprised of how far Iceland actually is
although this is a sneaky projection
 
Hungary solidly mid-table there. Not too bad. ;)
 
yeah, I guess
we have the legacy of a social security system from communism
 
5:04 PM
Was surprised to see there's no right to bank holidays in the UK.
 
@daOnlyBG If you google stackoverflow python fast prime you'll find some great examples
Eg, stackoverflow.com/a/3035188/4014959 That code is for Python 2, but it's pretty easy to convert it to Python 3.
 
that's cheating:P
if they're using something brute force, a first optimization is looping until sqrt(n) instead of n
that's why I didn't mention the kitchen utensil of a certain man
 
5:19 PM
@AndrasDeak It's all Greek to me...
@AndrasDeak No point re-inventing the wheel :)
 
@AndrasDeak Knifey spooney? i.ytimg.com/vi/mcE0aAhbVFc/hqdefault.jpg
 
It's pretty hard to beat that code by Robert William Hanks; OTOH, it's not exactly easy to understand, especially if you're new to Python. Sorry, I'm typing in the dark. :)
 
Are you by any chance hiding from a giant man-eating mollusc endemic to Australia?
 
Not as such. :)
 
5:30 PM
that's a relief
 
@PM2Ring Thanks. I've been doing some reading and finding some ways to trim the time.
My first version took me 45 seconds, but I think I can optimize it a bit
 
are you still using brute force, or some smarter trick?
 
I'm essentially creating a list with two base primes (2, 3) and then for every odd number after 3, testing to see if it's divisible by a number in the list; if it isn't, I add it to the list. Once the list hits the desired length, I know the n'th prime
the thought of creating a "sieve" list came to mind and I might decide to do that soon
 
yeah, that's quite brute force
but you should ignore 2 when looking for divisors;)
not that that would make a huge difference
 
@AndrasDeak Yeah, i thought about taking that out. it's not necessary, obviously
well, the first optimization I'll do is loop until root n or somethign
**something
 
5:36 PM
yup
 
@daOnlyBG Yep. A sieve will be much faster. You just need to come up with a way to make a rough estimate of the size of the sieve.
 
@daOnlyBG that should give significant speedup
 
OK, I don't know if it's because I have another app on my laptop open (iTunes)
but taking out the "2" actually slowed my code down by 3 seconds
oh wait, I know why
 
@daOnlyBG Let me guess: you forgot to change the loop so that it only loops over odd numbers. :)
 
@PM2Ring Nope, I actually did that in my first version
 
5:39 PM
Oh, ok.
 
However, I forgot to adjust the while loop to loop over only 10,000 times
 
instead of inf?
 
no no
OK, the objective is to find the first 10,001 primes
so when my list hits length 10,001, it stops
However, I wish to eliminate all evens, because hey, there's no even prime
(beside 2)
so I took the "2" out. If I'm taking the "2" out, I only have to find the next 10,000 primes
 
@daOnlyBG Are you comfortable with generator functions? They can be handy for stuff like this.
 
ah, I see
 
5:44 PM
@PM2Ring I don't know if I'm comfortable with much lol. I didn't study CS or programming much in college, so a lot of this is new to me
 
that shouldn't be a problem, generator functions are odd anyway
 
now I'm going to implement the square root of n limit
python syntax question: is there a way to place a constraint on a for loop, i.e. "for x in list such that (...)"?
 
oh - looks like I solved that one about 4 years ago or something...
Looks like I stopped after #206...
 
@daOnlyBG Fair enough. But I'll post a link to my potential_primes generator anyway; it's not that hard to understand and you might find it interesting.
 
@daOnlyBG you should put the constraint in the list, i.e. use a list comprehension (or a generator expression)
so I think the answer is no
you can't do for k in range(10) if k ...:, but you can do for k in (l for l in range(10) if l ...), although it might be seen as an anti-pattern
(I'm only guessing, but it just doesn't look exactly right)
often the answer is "why not just put an if inside the for?"
OR put the whole loop into a comprehension; now that would be "pythonic"
shivers
I should note that I'm not too proficient with python, so take all my notions with a grain of salt
 
5:53 PM
@daOnlyBG Note that n ** 0.5 is faster than math.sqrt(n) because the former is an operator, the latter is a function call.
 
@AndrasDeak he needs all the values so I'm not sure if a generator expression is worth it
 
@RobertGrant I'm not sure I know what you mean
 
Although it would be neat to have a generator that keeps track of the existing primes inside itself
 
@PM2Ring that should be evaluated only once, right? (but otherwise it's really good to know, I didn't know that)
 
annoying.
I really need to do some CSRF protection on this one application...
... however the problem are the countless different libraries doing AJAX posts...
 
5:56 PM
@PM2Ring I was actually going to use n**0.5 for that reason alone- I'd like to use as little code as possible (and thus, import as little as possible too)
 
@AndrasDeak There's a double loop, you need to calculate sqrt for each run of the inner loop, so you know when to stop testing factors of the current number.
 
@AndrasDeak the genexp is useful if you're not trying to keep all the values (e.g. if you just want the 10001st prime, but not all the ones in between), but if you're keeping all the values it can be a normal list comp
 
@PM2Ring let's just ignore my previous comment, please:D
@RobertGrant but you don't loop over the primes (that would beat the purpose), you're looping over divisor candidates (well, and prime candidates)
 
thinks
 
great... stuck in a loop
 
5:59 PM
@daOnlyBG I believe decreasing the ceiling of the loop should only make runtime even more finite:P ;)
 
In C, you'd actually invert the test and square the potential factors, stopping the inner loop when the square is higher than the current number you're testing. But in Python that's less efficient, due to the way Python for ... range loops work.
 
@AndrasDeak Haha yes, this one's my bad
Just not sure what I did wrong by introducing that constraint. Well, obviously, I must have implemented the constraint incorrectly
 

« first day (2088 days earlier)      last day (2878 days later) »