« first day (1860 days earlier)      last day (3092 days later) » 
00:00 - 14:0014:00 - 00:00

2:00 PM
Morning, cbg.
 
2:11 PM
cabbage
 
cabbage!
 
2:29 PM
@davidism, you use ArchLinux, right?
 
yes
 
which browser do you use?
 
Firefox
I have Chrome installed until Firefox on Linux supports Netflix.
 
Oh okay that answers that, I was gonna ask if you used Chromium + some form of silverlight available for linux
 
No, I have Google Chrome installed, not Chromium or Silverlight.
 
2:32 PM
Wanted to try to get Electron working as a netflix/youtube machine and get the Raspberry Pi to work as a pseudo-appletv
 
What's Electron?
 
You know the atom text editor? It's basically just applications that can be built on top of a stripped down version of Chromium
 
Oh, ok, I wasn't sure if you were talking about something related to Netflix.
You need Chrome, not Chromium though.
 
Yeah, therein lies the problem :\
I know chrome just kinda works on linux for netflix, seemed like chromium probably doesn't
 
cbg all
 
2:39 PM
Chromium doesn't have the DRM extension. You could always launch Chrome in kiosk mode.
 
Someone has been upvoting every question that gets downvoted in lately, it's really frustrating.
stackoverflow.com/q/33799168/400617 too broad, boils down to "I don't understand that you need to set up a web server to use CGI, but also I want to use Flask."
 
Hmm I'm reading pep8
now I wonder: can a module and filename be different?
 
yes, but don't do that
 
The module name is always taken from the file name.
 
2:53 PM
modules are objects just like everything else, so you can modify them and mess with the import system
 
Well then I decide I don't really like pep8
No one but me is going to tell me how I should name files.
 
I feel really bad for your co-workers.
5
 
@paul23 could you please write about something interesting rather than your continuous dissatisfaction with the practices of the language you chose to use? The astronomy stuff was much more interesting.
 
@davidism I'm naturally negative
 
get over it, and don't do it in here, it's tedious
 
2:58 PM
I'm not even allowed by my friends to talk during matches anymore :D. As apparently I always imply, "We're going to lose anyways".
 
@paul23 What is your criticism about it?
It’s the first time I hear someone unhappy with the file naming rules, so I’m genuinely curious.
 
@poke I never use underscores in my filenames (and no, no spaces either), and since I don't do that it makes searching for userfiles easier on my pc. Now in a future when I long forgotten the real project name etc -or even -python- but I know about the topic and I know I once made something with it, I could search my pc for the project. And then I wouldn't search using underscoeres.
 
People who stand on the escalator are literally slowing human progress.
 
well, I guess pep8 becomes a bit annoying when some pep-lawyer rejects your pr because the some line is 81 chars.
 
@paul23 get a better indexer
 
3:03 PM
yawns
 
git grep ftw.
 
@paul23 What do you use then? camelCase? Or dashes? Something else? Or doyoujustputeverythingtogether?
 
Mostly PascalCase - even though I know on NTFS it's the same as pascalcase
Anyways back to the sanity depriving task of cathcing up with writing docstrings. Apparently that makes code more readable.
 
I see, well to be fair, I name all my variables, classes and other things with camel or pascal case too, even if PEP8 mostly says lowercase + underscores. But for some reason, I do use lowercase and underscores in filenames (and as such for modules).
 
@paul23 kicked, stop complaining about everything
they're just guidelines
 
3:07 PM
*sigh*…
 
@poke :o I was criticized so badly on IRC for using camelCase and tabs in python :(
I guess I shouldn't have taken that too seriously?
 
I am rather ridiculously pleased that my rep to answer ratio has broached the 50 barrier. Still can't catch DSM - my original pace setter - but I'm pleased with it.
 
No, don’t :)
 
@AwalGarg freenode.net #python ?
 
triesToChangeTheSubject
 
3:08 PM
yes
 
don't go there.
 
I don't, anymore.
 
People who have nothing better to discuss about than formatting guidelines are not worth a dicussion :)
 
#python is a place where people go to learn which question they are not supposed to ask and what kind of things they are not supposed to want, because.
 
#python is beyond our borders. You must never go there.
 
3:09 PM
@poke hehe I was kinda annoyed at them so I made gist.github.com/awalGarg/5c9fc4f421c8dbc501b0 and posted it in there :D
3
 
one does not simply go to #python.
 
@AwalGarg That is amazing! :D
 
:D
 
@AwalGarg I don't think you'd get much love in here for tabs here.
It just wouldn't be criticism so much as a "Well, if you want to write code everyone hates, that's your choice".
 
@QuestionC Apparently you didn’t get it?
 
3:11 PM
I'd definitely want @ThiefMaster to read this conversation :D
 
Actually, a good reason to adhere the PEP8-ish style is that it is usually consistent with the standard library and most of the popular libs as well (except Twisted).
 
Yes, if you want your code to fit into an existing code base, adopt their convention. If that happens to be PEP8, then PEP8 everything. If it is something else, use that instead.
 
I have started to adhere to it. I can bare spaces as indentation if that makes the Python community a little bit happy reading my code :) <3 python soooo much.
 
I like Go's approach to this.
do whatever you want, we will re-format it anyway.
 
Yeah, gofmt is a beautiful tool.
 
3:15 PM
@AwalGarg don't expect any feedback if @ThiefMaster does read it - I think he's already used his quota of 5 messages/month to this room up :p
 
who's ThiefMaster?
 
hahahaha
 
@poke Formatting doesn't really matter, but doing approximately the same stuff everyone you're working with does. I only mention tabs because I honestly can't remember the last time I saw them in team code.
 
@JonClements doesn't he hangout with you blues in the blue room, though?
 
The first rule of the blue room is that we don't mention the blue room :p
 
3:17 PM
There’s a blue room? :(
 
You only know these things if have become one with the blue people.
 
@Programmer like smurfs - that's what the lounge nicknames mods anyway :p
 
1 message moved from Teacher's Lounge
wait, that never happened :D
 
Ahh so no blue man group references?
 
@AwalGarg Sneaky
 
3:24 PM
@JoranBeasley You can use this to further your cause to move to docker containers. https://github.com/docker/dockercraft

That project is so freakin' cool. We are trying to see how we can use this for a demo we want to show off for one of the projects we are working on. Anyone else interested in this kind of stuff...worth a look.
 
@AwalGarg people who indent python with tabs should be burnt on a stake :P
 
Just found this gem in our legacy code base TryStrToInt(IntToStr(get_int_from_db()))
 
Well I know my destiny
 
@ThiefMaster Come, find me. Burn me.
 
 
3:42 PM
I disagree that the meaning changed. The question states, as it did before, that you have a postfix server and want to display the messages that it receives with Flask, and shows your prior research. It just doesn't take 6 verbose paragraphs to do it. What were you asking differently? — davidism 1 min ago
anyone want to compare the revision and weigh in on whether I "destroyed" this new user's question?
(also cv-pls, it's too broad anyway)
 
DSM
Thursday morning cabbage.
 
cabbage
 
DSM
I tried, davidism, but to be honest my eyes glassed over before I finished it.. which might be evidence that you're right. :-)
 
@davidism looks like a fine edit.
 
3:55 PM
yeah, therion is nice
if you like female singers, youtube.com/watch?v=hCjkuCJrxq0 might be something for you too
 
Oh yeah I know that band, the female singer is great, but she's not in the songs enough imo
 
anyone in to screamo / post-hardcore metal
female vocals...but it's screamo :P
https://ctts.bandcamp.com/
 
That genre always seems like a very mixed bag
 
I agree...but I really like these guys
 
@corvid Is there a word for that 'feeling' you get from listening to that kind of music? Like... I think there's something universal feeling about hearing a warhorn and power chords and some northern european lady singing who may be a valkyrie.
It's like that part of a movie where things are going really well for the good guys before the final showdown between hero and villain.
 
4:12 PM
So I read this: docs.python.org/3/library/typing.html - does this mean that overloading functions for types is possible?
 
@idjaw I wouldn't call that music :D (also, *core bands attract way too many idiots on concerts)
 
Or are the hints just that: hints ignored by the syntax?
 
they are hints
I'm not sure what you mean with "overloading functions for types", since that sounds like normal inheritance.
 
I think it's kinda mixed. Emo-hair-neck-tattoo, though, bands are usually unbearable in concert.
 
Well how you call it: foo(Type1) {....} foo(type2) {...}
 
4:15 PM
@QuestionC I think it is called "awesome", if I am not mistaken
 
@ThiefMaster Embarrassingly, I have never been to a core show. I'll take your word for it. Do you like Glassjaw?
 
DSM
I think he means something like @singledispatch. Basically it sounds like he's interested in a language not much like Python..
 
never heard of them, i'm mostly into powermetal
 
ah ok
 
Both types have a complete different way to come to the "same" answer (mainly by preventing a lot of No-Ops)
 
4:15 PM
A couple of friends are mine love powermetal...so I listen to what they send me :)
 
Although their covers of classical music are cool with heavier drums and guitar
 
I'm not that knowledgeable in power metal...but is Blind Guardian considered good? I've liked what I've listened from them.
 
Therion that's not really powermetal. At least they were a symphonic metal band
 
Whenever I start listening to this kind of stuff, the path invariably passes by the Daffy Duck Wizard song.
 
That's a good song.
 
4:19 PM
which song?
 
The Daffy Duck Wizard song.
I showed it to my friend who is pretty into metal, but he was not amused.
 
Kevin did you get your holy cheerio working? :D
 
thanks @evandrix for this edit stackoverflow.com/revisions/14092332/3
 
It's working well enough.
 
Oh, I wasn't sure if you fixed that one problem you were having at the 'drop off' because it wouldn't render correctly or something.
 
DSM
4:23 PM
wait what?
Oh, the donut made of dots.
 
The Daffy Duck wizard song falls in the neat category of "Satire that can be appreciated unironically.", but probably only for people who pretended to be wizards as children.
 
It was totally the church-going cheerio.
 
I probably won't be doing more with it unless I remember how binary space partitions work
 
And on that note, let's see if the Metalocalypse opera is on youtube.
 
Metalocalypse is awesome!!!
 
4:27 PM
Liking the music, @corvid - fuelling my last hour of work...
 
@idjaw wow that is freaking awesome
 
I know!
I really want to set this up
 
@paul23 Are you thinking of java-like method overloading where you can have e.g. multiply(double[]... arrays) and multiply(int[]... arrays) in the same class? If so, Python is not your bag.
 
@JRichardSnape Well yes; but was just wondering if that type annotation could infer this
 
me too now I want to force the issue
:P
work suddenly got way more awesome :P
 
4:31 PM
:D
 
when you can integrate Minecraft in to your day-to-day like that...hell ya
The possibilities are hilarious. Bugs can be enemies you have to squash before you can even deliver that container in production
:P
 
Currently running 3 methods: Radius(theta); RadiusFromTrueAnomaly(theta); RadiusFromEccentricAnomaly(theta); Where Radius just uses is_instance and then calls the correct one.
 
Why not have class Radius subclassing float and then have static methods in it called from_anomaly (or fromAnomaly - I don't want that argument) that return an instance. So e.g. r = Radius.fromAnomaly(theta)
e.g.
 
@JoranBeasley we are currently running a build to use this right now...waiting for jenkins to spit out a green build. :)
 
4:40 PM
>>> class Radius(float):
...     @staticmethod
...     def fromAnomaly(theta):
...         return Radius(theta + 0.0001)
...     def __init__(self,r):
...         self.__float__ = r
...
>>> r = Radius.fromAnomaly(2)
>>> r
2.0001
>>> r*3
6.000300000000001
>>>
Or something like that... Then you can have as many different ways to construct a Radius as you like.
 
let me know how it goes... looks like alot of setup steps ... to bind stuff but it looks well explained
 
holy crap it works
we are currently walking down aisles and aisles of our docker containers
and controlling them
 
successfully controlled the state of a docker container using minecraft. I never thought I would ever say this.
 
I would put that on your resume for later
that seems like you didnt have a hard time at all setting it up :P
 
4:47 PM
it was VERY easy
just the fact that it worked so easily and I was able to say that really makes today a win.
 
@idjaw Sounds like a great way to start the day
 
I've got a pretty big smile on my face right now.
 
I hear people in the next office over muttering about "reply all". I have a feeling that a bedlam incident is occurring.
 
Or they're into podcasts.
 
My coworker also mentioned something about a bigwig at the BigCorp Virginia branch sending an email to the wrong recipients. Possible connection there.
 
DSM
4:57 PM
"This Kevinson fellow-- I like the cut of his jib. Why isn't he in charge of all development?"
 
I am, in my mind ;_;
 
@DSM ugh... my brain is dead - too many other things running through it - can you help with some simple algebra :)
 
DSM
@JonClements: sure!
@Kevin: several times over the last year or so I've thought of hanging out a shingle as a Python data consultant, with a website and business cards and everything. Then I'd be in charge of all my (non-salaried) development.
 
Contracting is easy and fun, I assume.
 
DSM
Countless clients from Heaven just waiting to give me blissfully enjoyable projects at divinely rewarding rates!
 
5:06 PM
lol
yeah they are all on fivr
...
 
In my fantasy, I do technical work solo, but have a business partner to handle everything not involving typing words into a screen
But who will be the Cruise to my Hoffman?
 
Noob question: If I have an event loop running for some async http requests, is a callback function necessarily executed outside of the i/o loop thread?
 
any call that isn't an asyncio coroutine causes the loop to wait
 
@davidism I'm using Tornado's event loop with callbacks
 
same thing
 
5:16 PM
Is it bad practice to bind routes to a collection? Eg: Users = Collection('users'); Users.Routes = { '/users/': """ route def here """ }
 
everything running in the process running the loop should be a coroutine
@corvid wrong room
 
@davidism uhh, you can totally run an io loop with callbacks rather than coroutines
I just don't know how to tell if my callback function is blocking the thread
 
put sleep(1000) in it and if your program hangs it's blocking
 
good idea. I'll try that.
 
but as far as I understand it, the most it will do is wrap that function as a coroutine, but it has no way to make the internals of the function work with the event loop
so you have the same problem
 
5:19 PM
yep it's blocking
hmm OK
 
Just fyi, the sleep thing was kind of a joke, of course it will hang if you put a blocking call in it. Everything "blocks" to some degree in asyncio, the idea is you figure out if it's worth the time to make more of the internal calls coroutines
If you make calls that do io and aren't coroutines, odds are you should fix those
 
re-cbg
 
5:34 PM
@davidism I just don't see why using a callback or a future is a problem per se. It's not like it's any less asynchronous. You could still block a coroutine if you were a noob like me.
 
I'm not even sure what you're asking anymore.
 
It sounds like you're implying that I have to use coroutines in order to avoid blocking problems.
 
You do, that's the point of a coroutine library.
As opposed to using threads (which will block anyway) or processes.
 
What I mean is the same crawler could be written with callbacks or futures and still be asynchronous.
 
8 mins ago, by davidism
I'm not even sure what you're asking anymore.
 
6:44 PM
Bleh framework is so irritating
 
Can I dump some code here for review? :P Too tired to fire up codereview.se :D
 
layzee
 
Go for it
 
Yeah but put it on pastebin if it's longish
 
7:00 PM
on it
@Kevin @corvid gist.github.com/awalGarg/4f436831b1c69d3b24af#file-ngxconf-py stuff I care about: that MATCH_NOTHING object. Not sure if that is not crazy silly. Also, do I need to do anything more to make it explicit that _rule_finder is not to be used outside the internal methods? Any other general things?
 
MATCH_NOTHING is fine; creating a blank object is the ordinary way to create sentinel values. _rule_finder's leading underscore should be sufficient to warn users to please not use it.
The only thing I find unusual is using _rule_finder(self, rule, value) instead of self._rule_finder(rule, value)
 
@Kevin derp, I'll fix that. Thanks!
/me brushed closely with getting an "LGTM" from creator of kevinscript
 
What structure are you iterating over?
 
What is the type of branch? You may be able to replace if l and branch[0] == rule: with if branch and branch[0] == rule: if it's a builtin
 
yeah branches are lists.
@corvid ^
tree is a list of branches :/
 
7:09 PM
if branch and... ought to be fine then
 
Neat, TIL
 
I don't think there's an official style guideline against it, but where possible I avoid having if and elif blocks with the same suite. if a: x(); elif b: x() could be written as if a or b: x()
In regards to lines 26-29.
 
gotcha
        if branch and branch[0] == rule:
            if value == NGXConf.MATCH_NOTHING or
               (len(branch) > 1 and branch[1] == str(value)):
                yield branch
@Kevin this looks ok :?
that indentation kind of scares me... but... pep8
 
Yeah although I think the parens are technically not needed since or has a higher precedence than and
However I'll leave in technically unnecessary parens if I think it will aid understanding. Not making your readers look up precedence tables is nice.
 
7:26 PM
@Kevin yeah that's why I added them :) I'll go with this then, thanks a lot again!
 
Whoops, s/higher/lower/. I always get that mixed up.
 
Any body know? amqp consumers can be increased by signal???
 
Nope, can't say I know
 
@Kevin I noticed this phenomenon, but I have no idea how to explain it. So, I tried to look into the source code of Pika. No idea until now.
 
7:43 PM
wait, why is NGXConf not accessible at gist.github.com/awalGarg/…? o.O
I get:
  File "parser.py", line 436, in NGXConf
    def _rule_finder(self, rule, value=NGXConf.MATCH_NOTHING, tree=None):
NameError: name 'NGXConf' is not defined
wait, shit that makes sense... but :(
 
Possibly default values for methods are evaluated before the class they live in are actually created.
I don't know for sure but it seems likely
How about def _rule_finder(self, rule, value=MATCH_NOTHING, tree=None)? I think the sentinel should be natively visible in that scope.
 
@Kevin Hah! That works indeed!
 
8:07 PM
Oh hey, github changed their design, it looks great on tall monitors
 
hmm...looks the same for me =/
 
DSM
Moi aussi.
 
I clicked the "switch to new version" button but I don't know what's different
 
DSM
Oh, there's a button? Nobody said there was a button!
 
@Kevin They don't have the widgets on the side, they have them on the top aligned horizontally
 
8:15 PM
Pretty sure this is a psychological experiment and corvid is in league with the testers
 
I agree...I don't have this button
 
If a button appears saying "click here to switch to the new view, but a person in the next room will receive painful electric shocks", I'm out of here
 
DSM
Maybe I don't see a button because I've already clicked it long ago?
 
Awh, you mean you got that button and I didn't? No fair
 
Who uses portrait mode on a monitor anyway? (or is that not what you meant by tall monitors?)
 
8:18 PM
I don't see anything new either :(
 
I'm starting to think Kevin's theory is right
 
DSM
Crows can be sneaky.
 
He did figure out how to light a cigarette with no hands...
 
I do see that the "issues" link that used to be on the right is now on the top.
So either the changes are real, or the testers have bribed me into trying to convince you all that the changes are real.
 
OH! I've been invited in to the program....the button has appeared!
anyone receive a shock?
 
8:23 PM
pics or it didn't happen >_<
 
The latter clause of that sentence seems like it would exclude itself from possibility, because why would I tell you that I'm trying to deceive you? But maybe it's reverse psychology. And maybe this sentence is pentuple reverse psychology.
 
DSM
As davidism would say: :-|
 
Insert joke here about confounders and being confounding
 
:-|
 
|-:
.T.
 
8:34 PM
GAME OVER
 
C-C-C-C-OMBO BREAKER
 
Ombo breaker?
 
My ombos!
 
Are they breaked!? D:
 
leave me and my ombo alone...
 
8:41 PM
I prefer zombo.
 
DSM
That's.. a lot of typing.
 
There's an easier way to do that? :D
 
Username "love to program in python". How they love it while thinking they need to write that is a mystery.
 
If they had used a for loop, they would have spent a lot less time programming this, which goes against their stated desires.
If anything, we should help them make it longer and more repetitive.
Too bad they don't have any conditionals, or they could just add ` == True` until the cows come home
 
8:51 PM
I can't tell if they meant to write _init_, 1 underscore, or misunderstood how __init__ and calling classes works.
 
DSM
Leave it for the rep-hungry, that's my take.
 
that class init scares me
 
@DSM what da...
 
Alright, there's got to be a better way to do this than iterating through each one
In Pandas I have two dataframes with the same y-axis label (a date). However the first dataframe has a variable number of columns, all with different names than the column of the second dataframe (which has a single column besides the index). What I want to do is add the value per row of the second dataframe to the values in the same row in the first dataframe
is there some trick that can help me do that without iterating through each one, looking up the cells in both, and adding the values?
 
DSM
Almost certainly yes. Make two toy frames with only a few rows and columns that we can copy and paste.
 
9:06 PM
            AAPL     GOOG
2011-01-05  332.57   350.32
2011-01-06  332.30   352.82
2011-01-07  334.68   942.49

            Price
2011-01-05  1000000
2011-01-06  501145
2011-01-07  501145
I couldn't figure out how to do it using .apply() with two separate dataframes, especially with a varying number of columns, but that's the sort of thing I'm looking for
 
DSM
So you want 1000332.57 1000350.32 in the new first row?
 
Yes :)
 
DSM
>>> df1
              AAPL    GOOG
2011-01-05  332.57  350.32
2011-01-06  332.30  352.82
2011-01-07  334.68  942.49
>>> df2
              Price
2011-01-05  1000000
2011-01-06   501145
2011-01-07   501145
>>> df1.add(df2["Price"], axis=0)
                  AAPL        GOOG
2011-01-05  1000332.57  1000350.32
2011-01-06   501477.30   501497.82
2011-01-07   501479.68   502087.49
 
How do you guys format python stuff like that anyway?
 
I click the "fixed font" button that appears when I have a multiline message
 
9:12 PM
I mean in Python output
is it just the command line version?
 
The ">>>" suggests that is the case, yes
 
Yeah it's just starting python in interactive mode
 
I use vim and compile with a python command
 
idle uses >>> as well
 
DSM
I use the IPython console, but when working on SO I typically use it in --classic mode so that I don't get people asking "why do you have all those numbers in brackets like [34] there? I don't."
 
9:16 PM
I use python.exe because I can't be bothered to get an IDE
 
DSM
That doesn't even do tab-completion inspection, though, does it?
 
It does not. I use dir and help a lot.
 
You can also Ctrl+K in the chat box to "Fixed font" stuff.
 
@DSM Thanks for the help!
only, I don't think it's adding for some reason...
no error
Oh, I must have to set df =
yaaaaaa
:D
Huh
 
9:40 PM
I am running python rabbitmq consumers on docker, but when I run "sudo kill -USR2 <process id>", the number of consumers increased. no idea
 
hmm for immutable objects you better use __new__ instead of __init__ right? - But why not use` __new__` for everything?
 
 
1 hour later…
10:46 PM
@ChengchengPei on a related note if you use docker you should use slashgear.com/…
 
hehehe
btw @JoranBeasley it's official. We put together a demo for our end of sprint using this to showcase what we did for our latest features
 
11:05 PM
thats awesome :P
best demo ever
although I heard if you have lots of containers steve dies before he can run the whole guantlet
he starves
 
11:18 PM
cbg all.
 
11:43 PM
cbg @TigerhawkT3 haven't seen you in a bit
 
being relatively new to this chat room, feels wrong to use "cbg" here... though I'm not sure why
 
I was out of town for a few days.
 
(I mean feels wrong for me to use it.)
 
being even newer to this chat room, i dont even know what cbg means so I feel like youre safe
 
@RNar sopython.com/chatroom -- There's a link towards the top.
 
11:52 PM
hm. interesting.
 
Digital evolution at it's finest :)
 
00:00 - 14:0014:00 - 00:00

« first day (1860 days earlier)      last day (3092 days later) »