« first day (2907 days earlier)      last day (2057 days later) » 

2:00 PM
and this is a trick question and you will hate me when I answer :P
hint, it doesn't hurt if you read my highest-upvoted answer...
 
Reading that probably takes longer than figuring it out on your own :P
 
Most likely this is not the intended answer, but let's get it out of the way:
>>> code = 'code'
>>> print(code == eval(code))
True
 
He's more machine now than man. His mind is twisted and eval.
@Kevin argh...
ok let's make one more constraint
print(code == eval(code, {}, {}))
 
All code golf problems have the implicit rule of "...and smarty-pants answers don't count" so it's not strictly necessary to enumerate all the ways that you can break out of the sandbox
 
this is a trick answer
you need "python sorcery level 68" or "forward jump in time + hindsight 20/20"
 
2:07 PM
Hmm, I've got something in mind. Let's see...
 
ah and no repr
code = '<75 characters go in here, pep8>'
print(code == eval(code, {}, {}))
prints "True"
 
>>> code = 'type("",(object,),{"__eq__":(lambda self, other: True)})()'
>>> print(code == eval(code, {}, {}))
True
Not sure whether this falls afoul of the "no constructors" requirement
I am, indeed, constructing an object
 
:D wow ... yea I didn't consider that...
@Kevin ok I can add even more evil constraints.
print(str(code) == str(eval(code, {}, {})))
or even worse
 
Was just about to say "I'd still like to see a solution where actual string comparison happens"
 
print(code is eval(code, {}, {}))
and then we come down to the trick :P
 
2:15 PM
is? That has to be relying on an implementation detail...
 
@Aran-Fey :P
not sure about jython 2.7 ...
% java -jar jython.jar test.py
True
Jython 2.5.2
prints true in Python 3.7 too.
 
Well, I'm stumped...
 
I don't think I'm going to come up with an answer, either
 
code = '<75 characters go in here, pep8>'
print(code is eval(code, {}, {}))
the 75 characters are....
 
I was playing around with __name__ and naming my file something tricky, but that can't be it if your file is named test.py
 
2:21 PM
' or compile("__import__('inspect').currentframe().f_code", '', 'eval') #
 
Heh
 
:I
Somebody ban Antti
 
yay, i guessed the first character!
 
Good old sql injection
kind of
 
@Chillie congrats :P
 
2:23 PM
1.3% correct
 
@Aran-Fey you can always flag my message ;)
 
 
Wait a minute, wasn't the solution supposed to be limited to '()._ + letters?
 
well I changed it a bit :F
 
*shakes fist*
 
2:27 PM
I suspect there's an alternate implementation that does the same thing without "#"
 
or '
In hindsight, the trick should've been obvious the moment ' was a legal character but \ wasn't
 
I'm having popcorn and reading through this! why do I have assigned voices to your texts, so I read them with your own voices?!! :-)))
 
Dec 4 '17 at 5:36, by Antti Haapala
Oct 13 '16 at 17:58, by Antti Haapala
Sep 16 at 13:58, by Antti Haapala
Thanks folks, I'll be here all week month year decade probably too long.
 
The ride never ends
 
@NasrinShirali The worst part is that the voices in your head speak better english than you do. At least the voices in my head do.
 
2:35 PM
cbg-noon
 
then you have to get the real voices
 
quick question
 
How come the voices in my head don't struggle with english pronunciation as much as I do? It's not fair :(
 
@Aran-Fey not sure why @AnttiHaapala has a Danish or maybe German accent when I read his texts :-P yours is Canadian anyway!
 
Maybe they do, but you don't notice their mistakes. Much in the same way that one tends to wake up in the middle of the night with a world-changing idea, so one writes it down for review in the morning, but when morning comes it's drivel
 
2:37 PM
My accent is Finnish received pronunciation
 
I wouldn't recognise a Canadian accent
 
cbg, Andy
 
Last night I had a dream where I was trying to determine whether the average of all primes was rational or irrational.
 
I would. I have a Canadian friend and he pronounces 'about' in a certain way
 
@NasrinShirali Canada is an english speaking country, so I'll take that as a compliment :D
 
2:38 PM
@Kevin and next night you'll have this dream:
 
@NasrinShirali aboot, eh?
 
cbg, all ye pyfolk
 
@Kevin I thought that'd be easy to figure out, but apparently I've been away from number theory for quite long, and of course there's no correct answer to that (may or may not be irrational).
 
@AndrasDeak Exactly! :-P and it's so cute :-))
cbg @PaulMcG
 
I think that's stereotypical French Canadian
 
2:41 PM
@Chillie o\
what means that
 
I'm not sure that finding the average of an infinitely long divergent series is a coherent concept in the first place.
 
In any case, I think I am glad I don't have such nightmares
 
if NameVariable:
there are no equality nor inequality
 
"Solve this difficult puzzle with ever-changing requirements" is probably in my top 3 most frequent bad dreams
 
does it mean if it exists?
 
2:43 PM
I've developed a tiny smidgen of lucidity during those kinds of dreams to the point that I can recognize them and pull the eject lever to catapult myself to consciousness
 
Maybe not French Canadian atlasobscura.com/articles/…
 
@AndyK It's equivalent to if bool(NameVariable) is True:. What bool(NameVariable) returns depends on the variable. For numbers, it's x != 0, and for lists it's len(x) > 0, for example
 
@Kevin for diverging usually no.
 
Chased by a monster? Can't identify it as a dream. Engaging with a puzzle that doesn't meet my demanding standards of quality? Impossible, must be in the dream realm
 
@AndyK that's a "truthy" evaluation, as JS would call it. (not entirely sure what you mean, but that'd evaluate to if True: then)
 
2:44 PM
>>> bool(3)
True
>>> bool(0)
False
>>> bool([1, 2])
True
>>> bool([])
False
 
(and of course, you would get NameError if variable doesn't exist)
 
cheers @Aran-Fey & @shad0w_wa1k3r
 
Don't forget bool('')
 
I was bit puzzled
 
2:46 PM
@shad0w_wa1k3r +1
@AndrasDeak is it for me?
 
@AndrasDeak I just sent him this, and he replied saying "I have an accent?" :-))))
 
@AndyK No
@NasrinShirali aboot time
 
Similarly one might argue that [0, 1, -1, 2, -2, 3, -3...] has an average of 0
Oops, I thought you had linked to the page on "1+1-1+1-1+1..."
In mathematics, the infinite series 1 − 1 + 1 − 1 + ⋯ {\displaystyle 1-1+1-1+\dotsb } , also written ∑ n = 0 ∞ ( − 1 ) n {\displaystyle \sum _{n=0}^{\infty }(-1)^{n}} is sometimes called Grandi's series, after Italian mathematician, philosopher, and priest...
 
3:07 PM
Nope
 
for really the worst Finnish English accent go to Hydraulic Press Channel
 
Oh my word the answers on this question
I think people took Ajax's answer as a challenge to write more convoluted code
 
3:38 PM
And here I thought Ajax had bettered himself
Though I rarely even see answers from him anymore
 
rb folks
good eve
 
Rbrb, Andy
 
3:54 PM
@Aran-Fey did you ever post a solution to the puzzle you posted end of last week?
Something about checking for empty iterables
 
Nobody seemed to be interested, so I didn't
Hold on
 
Interesting.
 
Why exactly does that raise an exception on a non-empty iterable?
Oh, too many values to unpack, clever
 
jpp
@user3483203, Would you class my Pandas solutions as convoluted? re: stackoverflow.com/questions/52583876/…
I guess what I'm saying is most Pandas methods are pretty self-explanatory, e.g. assign, sort_values, groupby, head, to_dict. I could add an explanation for each, but I'm not sure it would help.
 
4:20 PM
@jpp. Yes. I don't have a problem with suggesting pandas if there is a benefit. But to include so many operations that just aren't intuitive to look at, just to output the result to a dictionary, seems wasteful, especially since the apply(list) makes it less performant than any native python solution anyways. The other pandas answer wasn't great, but I think a better approach would have been to show the benefit of using the DataFrame data structure.
 
jpp
@user3483203, Fair point, I stumbled on the apply(list) bit at the end of my solution (up until then it went swimmingly well), will keep in mind for future :)
 
How does the GIL affect uwsgi performance (python 2 vs python 3)? makes reference to a change in the GIL between Python 2 and 3. What change, specifically, is he referring to? I notice that wiki.python.org/moin/GlobalInterpreterLock links to "Reworking the GIL (for 3.2)". Could it be that?
If you had asked me thirty minutes ago, I would have said that the GIL works the same in all versions
Since whatever point in the distant past it sprang fully formed into the code base
 
jpp
5:19 PM
@user3483203, OK, I think this solution leverages Pandas a little more.
 
@IljaEverilä I think the description of the question is sufficiently clear. Do you really need a copy-pasteable example?
 
@PaulMcG As I mentioned in the comments, the question already answers itself, unless more details are given.
 
cabbage
oh hey, happy birthday @Andras!
 
Sep 27 at 14:02, by Andras Deak
my birthday is in November :P
I should probably unstar that message...
but thank you ;)
 
oh lol :P
... I mean, I've been doing Javascript all month long, that was just an async gone wild
 
5:43 PM
Unfortunate ambiguity that the message can be interpreted either as "Stack overflow says 'it is my birthday'" or "THUSLY, it is my birthday"
In either case, the speaker is then slapped, perhaps with a large herring
 
I'm not sure I've ever said SO in an emphatical manner
 
Anything goes when it's your birthday
 
Git is almost as annoying as CMake :-|
 
impossibru
 
6:01 PM
@NasrinShirali no
 
6:11 PM
>>> assert(composition > inheritance)
>>>
 
you can drop the parens :P
 
Oh. That's why nobody's taking the vaguely hidden bait into an opinionated question? :P
 
@jpp agreed
 
6:27 PM
@AndrasDeak yes :-D
 
are you using git right? ;)
(not really joking)
 
<She isn't but doesn't want to say so> ... Yes, of course I am using it right!
but then again, you don't hate things because you don't use them right. You hate them cause you don't use them right.
otherwise I'd have loved CMake :-D
 
upon subsequent readings, that second sentence loses meaning ;)
 
Is there a way to mix mapping and kwargs?
a, b = MyClass(**foo), MyClass(**bar)

# What I want
a, b = map(MyClass, (foo, bar))
I know I could use a comprehension, more just wondering
 
from itertools import starmap
a, b = starmap(MyClass, (foo, bar))
 
6:34 PM
I'd be inclined to keep those in two lines, but that's just my two lines cents
@piRSquared no
that's for *args unpacking
 
bah
then
 
itertools.starstarmap when?
 
a, b = map(lambda x: MyClass(**x), (foo, bar))
 
this seems like a weird enough use case not to merit a built-in solution
@piRSquared ew
might as well use a genexp
 
Yea I think (MyClass(**baz) for baz in (foo, bar)) is going to be cleanest
 
6:37 PM
yup
 
Yam it! I'm taking my 'lambda' and going home.
 
I figured out a better solution everyone:
df = pd.DataFrame({'col': [foo, bar]})
a, b = df.col.apply(lambda x: MyClass(**x)).values
Clearly superior
 
of course!
 
7:09 PM
I'm now literally a meta.so fanatic.
 
I've got 11 days consecutive there
 
That sounds way healthier
 
considering that meta is murder, yeah :P
 
don't ask about my stats on main
 
7:12 PM
let me ignore that right away; what are they?
(damnit, I went visiting family this weekend, my streak has ended!!!!)
 
Wooow, have the presence stats always produced a popup calendar with green blocks where you were active that day?
 
I used regex patterns for detecting names in a text....but I found the f score, preceision and recall decreased the larger the text got...any ideas why?
 
Anyway: "visited 1183 days, 1171 consecutive"
@erotavlas that's a good joke setup right there. Start with something reasonable, then suddenly subvert expectations by making it a ML question ;)
 
:O
I physically opened my mouth
 
lol
 
7:17 PM
you lost me at "...." I'm afraid
 
@AndrasDeak not sure, it's neat
 
Same. Regexes do not have such concepts as "f score" and "precision" and "recall".
 
@FélixGagnon-Grenier Is it red or just empty for your weekend?
 
kind of them ;)
 
7:18 PM
Does anyone know when exactly the daily reputation cap resets?
 
yes they do, if you create a training set with pre marked names (begin and end of strings
 
@Aran-Fey I imagine these things are midnight UTC
 
then the regex either matches it exactly at that location in the text or it doesn't
 
some scripts run at 3 AM UTC
 
7:18 PM
Regexes do not have a concept of "training set"
 
lol. regular exceptions expressions is one of the fields I'd have expected to steer clear of machine learning
 
That'd be in 5 hours. I think it happens a bit earlier than that, but I might be wrong
 
"yeah, I'm like 99.5% sure that's the pattern you're looking for"
imagine the perf gainz!
 
"This is not the pattern you are looking for"
cbg
 
7:20 PM
cbd
 
Central Business District? :)
 
cannabidiol
 
Oh, now it makes sense
 
lol
I was going for "is that a localized 420?"
 
7:21 PM
cbg = cannabigerol
ok listen imagine your ML algorithm is nothing but a method that loops through a list of regex patterns and tries to find them in your text....then you can say F, P and R can be calculated
so :P
 
I believe I just dodged a bullet or something. We have make scripts defined in a makefile, and I wanted to pass cli arguments to python scripts called from that make script, and started to think about passing arguments to the cli commands in the makefile. Then, thankfully, I read "yeah just use env variables bro". so many thanks anon
 
Good old global variables. Did I say global variables? I meant environment variables.
 
la la la can't hear you
there have been worse copy pastes in the history of the internet
 
It was intentional, the preview just was meh and I wanted to figure out a better intro
I think I'm gonna read the whole thing first but tl;dr: VS Code is awesome, and there's some plugin they just found related to python and machine learning that does a ton for you in terms of visualizations of how everything is set up
 
I created a machine learning room, only one person entered so far (besides me)
i'm giving away free cake in that room
 
7:38 PM
Chocolate?
 
yes chocolate
 
@KevinMGranger I thought it was an ironic post about pointless emoji abuse. It sure got the message through
 
Machine learning is kind of the antithesis of my ideal system. I want to understand how my computer works, from transistors to application level. Machine learning says "now let's insert a million nodes whose behavior can't be predicted or even understood."
Maybe I just have a bad impression of it because of all the horror stories from users of Facebook/Youtube/whatever where they keep getting harassed by ads and/or content recommendations full of content they hate, and when they talk to tech support, they just shrug and say "sorry, it's what the algorithm thinks you want"
 
I honestly don't know what's going on with the recommender systems in YouTube
They are utter garbage. It keeps selecting a Chrome book advert for me that repeatedly says "A serious error has occurred" and it makes me want to punch the screen. And that I get about 50% of the time
 
@Kevin I somewhat lean that way, but applications are so impressive... Computer vision, for instance, is what it now is mostly because of machine learning.
 
7:48 PM
"you clicked that link about minecraft and you watched it for 10 seconds mistakenly or not, so here's a million fortnite videos you might enjoy, because you know minecraft was hip and now fortnite is hip too"
 
I thought fortnite was a shooter
 
When I was working for a supermarket chain, they were building a recommender system in a different team. If you selected our top-range pork for 2, a reasonably-priced champagne was suggested. If you picked the bargain pork, it suggested our largest bottle of Lambrini :P
 
@Kevin that is correct, I've heard authoritative people say that we don't actually understand how neural networks (especially deep ones) work, they just do. Which also explains how they can be uncannily susceptible to attacks
(I.e. they don't always work, oops. I'm sure nobody will ever want to use them as evidence in law enforcement)
 
@AndrasDeak the worst is if you catch them with an input outside of their training range. You can get pretty predictable behaviour within the problem space you trained on, but inputs outside of that range can cause seriously exponential outputs
 
Well I imagine it's as bad as extrapolating any decent interpolation method, plus layers
 
7:55 PM
Stray a little outside of their domain, a couple of neurons don't fire and there's nothing to compensate for the ones that do fire
 
@AndrasDeak I've had similar echo. It possibly makes for a poor fit on SO, too, due to that "not actual understanding of how it really works"
 
Not necessarily, there's a whole lot of heuristics and best practices to play around with. It's more about them being better fits on something data- or statistics-related
 
hey guys how long does it take for an abandoned chat room to die?
 
they never really die. they get frozen after 15(?) days of inactivity
 
frozen?
 
8:03 PM
yeah, which means only a mod can thaw them, so they're dead ;)
 
is that the person who created them...or an actual mod
 
When I say mod I mean mod
 
Your words are captured in amber, for the bemusement of future generations
3
 
len({mod, room_owner, room_creator}) == 3
 
8:04 PM
lol
 
s/3/[2,3]
is that how you do inclusive ranges? ^
 
huh?
 
well, room_creator can be room_owner as well
 
Yes, but '==' is not how you do 'is element of'
 
incidentally yes, but they are different things, and what Paul said
 
8:06 PM
:)
 
so is there a mod who's job it is to go around and thaw frozen rooms?
 
Doubt it. I don't think rooms get unfrozen very often.
 
@erotavlas nope
And what Aran said. Almost never happens.
 
why doesn't it happen?
 
Once it's frozen, you just gotta let it go (sorry)
 
8:08 PM
hehehe
@erotavlas Because rooms usually freeze when they're abandoned. Abandoned means there's nobody to thaw it for.
Exceptions are rooms frozen by mods for moderation purposes, which sometime get thawed afterward
 
No discussion of fractals for you
 
@roganjosh let's not go back to that. The past is in the past
 
@AndrasDeak Nice.
 
@AndrasDeak that's upsetting but you'll never see me cry
 
somewhat said something about fractals?
 
8:15 PM
They're all around
 
<-- bio actually relevant
 
even in some people's avatars
 
hue hue hue
 
recbg
 
And I take issue with "somewhat" instead one "someone". I'm odd, but I am human :P
 
8:17 PM
oh damn, that was unintentional!
 
I thought you were a snowman
 
:P
 
I'm really not strong with Math, but am slowly reading "Fractals everywhere", and it's so, so inspiring
 
Apparently I can't type either, and my phone won't let me edit. Truce :)
 
8:22 PM
@FélixGagnon-Grenier Elsa of Arendelle played a pivotal role in illustrating the prevalence of fractals in everyday life, particularly in frigid bodies.
 
That's an interesting Lord of the Rings crossover
 
yeah, Magneto had an important role as tritagonist
 
holy wow, I really missed that pun, by a continent
 
I'm going off what Wiki tells me is her title. I have no idea if it's true, but why would I bother with following that up in this day in age? I think she also helped build the Death Star.
 
I believe the title is correct
Queen Elsa, to be precise
 
8:25 PM
You are correct
I don't know how I keep doing this. I sat down with the full intention this evening of going through some SQLAlchemy and now I'm discussing the scientific exploits of Disney queens
Although, this has reminded me of on of my favourite parodies (even if the singing isn't perfect). youtube.com/watch?v=Fl4L4M8m4d0
 
some lolz are to be had
 
"Blot blot, Western baby, Figure 1 will be amazing" :)
 
8:48 PM
rbrb all, have to beat the traffic on the home commute
 
rbrb
 

« first day (2907 days earlier)      last day (2057 days later) »