« first day (2531 days earlier)      last day (2642 days later) » 
00:00 - 18:0018:00 - 00:00

00:01
Just saw a couple walk by with this on the back of their hoodies.
I almost spit out my hot chocolate
 
2 hours later…
01:55
recbg
 
1 hour later…
03:14
evening cabbage
 
1 hour later…
04:32
cbg
04:48
Although it's said that bash is slower than C, why is it given less running time to bash than C in programming contests?Example As mentioned here
 
2 hours later…
06:46
@aquire Python room :)
cbg all
cbg
07:05
Hi. How do I select the "P Net" columns in here? imgur.com/a/qWTnC
@Code-Apprentice Where is that formula even from?
07:23
cbg from scrum
i am thinking of writing a code that will automatically industry of a company.I guess its machine learning.I have fields in my db that industries of companies so when new company came it will predict from previous records what is its industry
can someone guide me what python library should i use for this
just a little hint and i will get going on my own
There we go. df[[('KM 100 NO 3 SHAFT', 'P Net'),('KM 100 KAREE HOSTEL', 'P Net')]]. Is there a way to not have to repeat 'P Net' every time?
I know this is python room but there's nobody to answer to th q
07:42
Maybe not super optimal, but I created a helper function
def sub_selection(cols, subcols):
    return df[[(c,s) for c in cols for s in subcols]]

sub_selection(['KM 100 NO 3 SHAFT','KM 100 KAREE HOSTEL'], ['P Net'])
08:05
@SohaibAsif did googling "python machine learning" turn anything up?
@aquire no buts. This is the python room and questions of the form "I know this is the python room but <question about completely unrelated technology>" are strongly frowned upon. Try the C++ room.
@Mierzen weren't you trying to use multiindices? I'm not closely familiar with those but they sound like they make indexing like this easier
08:30
The bit about IndexSlice here suggests my impression is correct
import time
from selenium import webdriver
from selenium.webdriver.common.keys import Keys

print("Entered here")

profile = webdriver.FirefoxProfile()
profile.set_preference("browser.download.folderList", 2)
profile.set_preference("browser.download.manager.showWhenStarting", False)
profile.set_preference("browser.download.dir", '/home/sKKDWN/.')
profile.set_preference("browser.helperApps.neverAsk.saveToDisk", "application/download")

driver = webdriver.Firefox(firefox_profile=profile)
When I create driver I get error Not a directory
----> 1 driver = webdriver.Firefox(firefox_profile=profile)

/usr/local/lib/python2.7/dist-packages/selenium/webdriver/firefox/webdriver.pyc in __init__(self, firefox_profile, firefox_binary, timeout, capabilities, proxy, executable_path, firefox_options, log_path)
    140             capabilities.pop("marionette")
    141             self.service = Service(executable_path, log_path=log_path)
--> 142             self.service.start()
    143
    144             capabilities.update(firefox_options.to_capabilities())
09:01
@Code-Apprentice could you please check the text wrapping bug in mobile for Mierzen's last message? Worth an edit+bump to the bug report if you can repro
09:19
cbg
Hi everybody,
I have a question. I have 2 different external python packages both called pyrat. I'd install them by using "python setup.py install". In order to avoid conflicts, can I simply RENAME the directory (through refactor in pycharm) of the first installed package? Like pyrat_author1 and pyrat_author2 ?
09:34
I think the name is also somewhere inside the setup.py
You might also have to adjust absolute imports if the module uses those internally
morning cbg
@Withnail o\
Ahoy all.
09:56
@jon Can you look into a declined flag for me?
@poke umm.. guess so... is it one you raised?
okay... I'll have a look and ping the mod or something
Would just like some explanation, since it was just declined without any further comment… :/
(and I’m still of the opinion that that discussion was super silly and useless)
I'm in the middle of other things at the moment, but have pinged the mod - if they choose to give feedback... that's up to 'em
@poke and? should I modify it as well?
@JonClements Thanks a lot! :)
@Robyc I’d guess so? But I have really no idea, sorry
10:04
;)
Oh, it’s always fun when OPs return over a month after asking a question… *rolls eyes*
@poke I'm the one who declined the comment flag. As I explained to Jon, it looked like one party in the discussion had just decided that they didn't like the other party's comments and asked for them to be deleted. I read them all carefully, and deleted one that looked like it fit rude/abusive, but the rest seemed fine to me and even possibly educational, so I left them.
Without any compelling reason to delete them, it kinda looked like the flagger just disagreed with the other person and wanted the evidence gone. Jon says you wouldn't do that, though. :-)
And we don't have any way to "respond" or give a reason for a declined comment flag.
@AndrasDeak They are already multiindexed. I'm slicing from a multiindexed df. But my helper function does the job :-)
@Cody Okay, thanks for the explanation, really appreciated :) For what it’s worth, I had the impression that the discussion was going nowhere, and at some point instead of giving actual arguments or reasons, that other user just started to get rude or ended up nitpicking on individual word choices instead of actually responding to the criticism.
– And since it ultimately came down to there not being any arguments in favor of that user’s claim that this is a non-Python way to implement it, I considered it “over” and no longer relevant. But I’m fine if you believe that it serves some educational purpose, even though I kind of dislike the directions it took.
10:26
@poke Like I said, I did see one comment that was kinda rude (just phrased in a very unconstructive way) so I deleted that one, but I did not see the entire discussion as noise. That may just be due to my lack of Python knowledge. Also, the fact that it was a "fresh" question also factored into my judgment. If it was old and obviously stale, I would have been more likely to purge the whole business.
Agreed that it wasn't going anywhere, though, and good for you that you "bowed out" after you realized it wasn't going to go anywhere.
I do understand your point though :) Thanks a lot for taking the time to explain it :)
Of course. You're welcome.
10:40
seems like the new Python coursework assignments are in... who's up for writing the canonical posts?
@JonClements it'd be nice if people at uni just got help from each other to pretend they should be able to pass their degrees, instead of getting help from the whole world :)
Why bother - when you can put incoherent text into a question box and hope for the best?
The instructors should give us a heads-up before, so we can actually help people instead of solving their problems for them.
10:58
@poke that's a good point
SO should get into that instead of silly marketing nonsense
11:09
haven't heard it in years - oldy but a goody
@JonClements o/
11:36
recbg
11:57
Does anyone here have experience using pygal?
anyone worked with twitter ? im having hard time calculating reach of tweets.
> Ask your questions without a preamble
http://sopython.com/chatroom
@Mierzen didn't look like slicing to me, but whatever :P
I actually just wanted to know if someone was online
@AndrasDeak maybe not slicing. Whatever that kind of "selection" is called
12:15
@Prakhar well, that is a hard problem
work cbg
12:38
im going for unique retweets + unique likes + (account's followers) + the engaging user's followers
and call it
potential reach
13:20
cbg \o
@MooingRawr o\
13:48
morning cabbage
cabbage
@poke no idea. I just appreciate the Monty Python reference even if the formula is most likely just nonsense.
I am using openpyxl and try to apply conditional formatting to cells to fill with re cells that have value greater that 80, but as a result get all in red.
    redFill = PatternFill(start_color='EE1111', end_color='EE1111', fill_type='solid')
x.conditional_formatting.add('{}:{}'.format(cell, cell),
CellIsRule(operator='greaterThan',
formula=[80],
stopIfTrue=False,
fill=redFill))
What could be wrong?
14:07
i found it useful
in-case anyone wants to do numbers in social media
Is there any way in bash to pass in an arg with a '*' to a Python script, and suppress bash's natural inclination to do the wildcard expansion? Without enclosing the argument in quotes?
I guess this answer would imply 'no' stackoverflow.com/questions/15322362/…
okay I have a very dumb question. How do you reconcile a rotation, height, and width efficiently, along the central axis? The rotation is in terms of degrees. I think I need sin and cosine
I want to determine the new height and width based on that rotation, and get the aspect ratio from it
14:23
@corvid If the rotating object is anything other than a rectangle, then you can't find the new width and height. See Can axis aligned bounding boxes be recalculated after rotation of object using trigonometry?
it's going to be a rectangle for sure in this case
Ok, then it's a couple lines of trig. Let me look for an envelope to write on the back of...
Or, hmm, I don't think it's a pretty closed-form formula, because you don't know which corners are going to be the maxima/minima for which axis. But it's still O(1) so NBD
import math

def rotate_point_about_origin(x,y,angle):
    current_angle = math.atan2(y,x)
    magnitude = math.hypot(x,y)
    new_angle = current_angle + angle
    new_x = magnitude*math.cos(new_angle)
    new_y = magnitude*math.sin(new_angle)
    return new_x, new_y

def get_dimensions_of_rotated_rectangle(width, height, angle):
    corners = [
        (+width/2.0, +height/2.0),
        (+width/2.0, -height/2.0),
        (-width/2.0, +height/2.0),
        (-width/2.0, -height/2.0)
    ]
    new_corners = [rotate_point_about_origin(*p) for p in corners]
I'm certain there are faster ways to do this but they require, like, matrix multiplications, and it's too early in the morning for that.
All of these angles are in radians btw so remember to convert from degrees before calling
14:50
cbg
Hmm, you could do half as many operations by only working with two non-opposite corners, and calling abs() when creating right and top
you can take any [[x],[y]] point and get its rotated form around the origin by multiplying by [[cos(phi), -sin(phi)],[sin(phi),cos(phi)]] from the left
#themoreyouknow
it's probably simplest to calculate that by hand as Kevin did it
Like I said, my matrix multiplication lobe doesn't open for business until noon
cbg
x,y pixel values are typically non-negative ones, so for this rotation to work you'd probably have to shift them to center beforehand
14:54
@Marcus \o cbg long time no see how goes it
all is well
@MooingRawr please accept my sincere condolences
i feel very sorry
@MooingRawr oh, supposed to go to @Marcus :D
haha
14:58
In other news, my company hired a new worker, her name is pronounce as stef-a-nyaa, me being a hidden power level now imagine her with little cat ears :\ Something is wrong with me
that's the proper Russian pronunciation by the looks of it
and polish as well
*Slavic, there
I don't know anything about her never got introduced, I'm sure I will because she works with one of my co worker who i eat lunch with sometimes :\ Will update you
14:59
@marxin yeah it was :D I can't stay away from this chat, sometimes I just lurk in it
the important question is
is stef-a-nyaa nice
I don't know..... i just imagine her with little cat ears and it's adorable.... but i can't let my power level leak out, maybe in this chat but not at the office.
@Marcus congrats !
thanks
15:02
@AndrasDeak would make sense, half of the office is Asian, 15% Russian/around Russia, 10% European, rest is others
I wanna learn Japanese/Russian/German for my fourth language :(
Russian seems so "harsh" sounding, german seem so "cool", and japanese seems useful personally lol
Learn em all, then another ten, then get a job as head translator for the UN
@MooingRawr I think the exact opposite
Russian is smooth and awesome, German can be used to grind diamonds
(no offense meant to any German speakers)
@AndrasDeak I like to hear german and russian too
15:14
german is like a barbed wire, basically
@AndrasDeak I think they're both cool, but agree that Russian is particularly smooth
this is not to say that my own native language is not among the weirdest to hear (I imagine)
@Kevin some guy got a job created for him since hes fluent in 40+ languages .... that guy is so cool.
Although I've heard it said that it sounds similar to Finnish. So yeah, weird :D
Hmm... IMHO (German native speaker) German is a language with pretty clear and differentiated pronunciation, which causes it to not sound that melodic but is easier to understand.
15:16
I never met a Finnish person so don't know the sound of that... (could look it up but it's not the same)
German to me seems efficient and cool. Typical German efficiency.
Maybe I watched too many Action moves where the bad guys are generally Russian / German... The Russians are portrait as aggressive, while the German are shown as cool and cunning (until the MC foils the plans). Maybe this translated/influenced my opinions.
@MooingRawr do you watch Fullmetal Alchemist?
listen to that song
@Code-Apprentice cbg \o so it's been a while since you started at your work, do you still enjoy it ?
just to compensate your experiences with Russian :)
15:19
@AndrasDeak can't click YT links at work. If it's the anime, yes I've seen it and read it. If it's the live action, no I haven't
live....action...? D:
Oh I know Russians can be a beautiful language too... (some songs)
no, music from the anime; the original
noooo wwaaaaaaaaay
I'm so not going to watch that :D
(but you should listen to that song at home ;)
15:21
There's only one live action that was created from an anime that I enjoyed, Rurouni Kenshin Legend Ends.
If it's Bratja BROTHERS I have it on my phone :D
yup :P
that's my go-to Russian sample
FMA[BH] has a really good soundtrack... Even the movies had really good tones
FMA is my go to 'gateway drug' for people getting into anime. That or Ghost in a Shell (if they want to watch a movie).
Seems like a perfect mix of western theme in an anime setting, mature yet still fun.
I really enjoy that song, time to look for it in my phone :D
fun until you don't want to get out of bed
Edo...waaaaaaaado... o.O
15:24
Me this morning :\ slept 8 hours still sleepy ... but on the weekend I'm ready to go with only 6 hours of sleep :\ #life
btw "bratya" means exactly brothers
Oh did not know that lol
rb folks
\o have a good one Andy.
@MooingRawr It is going well. Stress is high. Trying to finish up a work plan for my first major project.
15:42
Distant World IV came out in July and I didn't notice. Amazon used to give little popups when book and music series had new releases.
Unfortunately only one FF VIII song.
@MooingRawr and have you read the meaning of the lyrics?
it's highly relevant to the anime :)
@AndrasDeak so you are saying he's repeating himself?
yes? :P
The problem with the newer Distant Worlds is that they draw from XII and up more, where everything was already orchestrated, so unless the arrangement is really good, it sounds mostly the same.
Or maybe that's just because I'm used to XII remastered's OST now.
@MooingRawr Just arrived at work when you pinged me and almost immediately had to do a stand up which we usually do a little later
@KevinMGranger want to know anything about Mercurial and Py 3?
(I was the Google Summer of Code mentor of Pulkit Goyal, who did a lot of the Py3 work ).
I've never actually used mercurial .__. but I thought mercurial was in the category of "yeah, we probably won't port to py3" so this was a nice surprise.
We worked quite hard to change that perspective.
(we == Facebook Python engineers)
I always saw mercurial come up as the golden example of why Python 3 was an unnecessary hardship, but those conversations were always full of FUD anyway. But I'm glad to see that's not the case!
Well, there are still some issues to iron out; Py3 startup time is a regression from Py2.
and Unicode everywhere is making life a little harder for an application that decided long ago to go bytes everywhere.
But progress is being made nonetheless.
16:16
@MartijnPieters interesting that you decided to keep all strings as bytes. Most projects I see, including Flask, use Unicode strings and ensure encoding happens correctly at boundaries.
That's fine for frameworks, but Mercurial is not a framework.
There is close to 12 years of legacy data to support.
wim
wim
the startup time thing has to be addressed somehow if mercurial is ever going to compete with git in a bigger way
@wim: we use a long-running process called chg now.
wim
wim
like a mercurial daemon?
not sure what the status of that is in core.
Yes.
16:17
Well, does it "need" to compete? And in what spaces? It's doing just fine for enterprises-with-monorepos, no?
wim
wim
I don't think that's a great approach
And Mercurial blows Git out of the water for large-scale use-cases.
Which is why FB went with Mercurial, not git.
wim
wim
getting mercurial working with micropython could be interesting
the startup time is way better
@KevinMGranger it's better for big monorepos, yes
Has bookmark handling gotten better? I'm so used to git branching at this point, and I remember bookmarks were trying to become more like that.
wim
wim
but it's not very popular in OSS , git/github is king
16:20
@AndrasDeak no I just enjoy the song :D Typically if I don't understand a language I still enjoy the music, I treat the vocal and lyrics like if it's an instrument (think classical)
cat reading a newspaper meme I should learn mercurial
@Code-Apprentice stand up for what ? -dudududududu- but no really you ahve to stand up ?
@davidism: define 'better'.
I use bookmarks where git uses branching, yes.
@MooingRawr when I first started we had a stand up every day at 10 am. People have been busy the last week or two and we have been skipping it.
Not that we do much branching at fb, there are no long-running branches.
We use remotebookmarks to share a common bookmark state.
16:23
Last time I was able to seriously use Mercurial, bookmarks were hard to sync between developers. It's been a while, I just remember having trouble keeping things straight.
and yes, we are actually standing...mostly because we move to the managers office
I'm trying to get this straight, are init , builtin, main, etc., etc., constructors? or a method to create a class?
documentation isn't forward with this
or im not understanding this ish
Only one of those things is related to classes.
oh wait, dammit, I meant to put underscores under those
but they italicized
that doesn't change the previous statement
16:25
@davidism: that's what remotebookmarks aims to solve.
main is a class
Not that I am that steeped in all the aspects; I'm focusing on sparse working copies mostly these days.
builtin accesses built-in names in a module?
init is a constructor that points to a class when it is created?
Can you elaborate on how you came to those conclusions?
__init__ is a hook called after the instance has been created.
So it is not a contructor, it is an initialiser.
__new__ is the actual constructor, but you usually don't need to deal with that.
16:28
__init__ is the only method of the three things you mentioned.
__builtin__ is an implementation detail on how all built-in names are made available.
You don't need to worry about that name.
Python uses __dunder__ names for anything that has specific meaning in the language.
So __init__, not init, is the special method called to initialise a new instance.
But there are many more __dunder__ names, all over Python, that fill various functions. They do not necessarily have anything to do with the lifetime of an instance.
When a file is imported or run through python, any code within it (not in a function or whatnot) is run. If you only want that code to be run when you run it through python, you check if the special __name__ thing is equal to the string __main__. As in, if __name__ == "__main__":
That’s a really smart spam mail (also not really sure what its purpose is):
> From: Manuela Diaha
> To: Undisclosed recipients
>
> I have sent you email twice and you did not respond. plase are you still using this email address?
@MartijnPieters is remotebookmarks a different thing than hg push -B name?
Too bad it’s to undisclosed recipients, so I cannot answer her question (because I do receive mails to multiple addresses that I no longer use :P)
16:32
thanks guys, i have some studying to do on these peeps
so these are known as data models?
Have you gone through the official tutorial yet?
and no im going through a book that doesn't mention these
its a book for noobs
What book?
16:34
Maybe it doesn't mention them for good reason?
Or maybe you should just keep reading the book?
> We see a lot of questions that could have been avoided if readers continued reading. Remember, tutorials have an end goal, so keep reading even if a concept initially doesn’t make sense.
(sorry, remotenames, not remotebookmarks)
@davidism no, I think -B is handled by remotenames.
@MartijnPieters it's starting to jog my memory. When we used push -B, it didn't behave nicely (yet, it was still new). If a name changed locally and remotely weird things might happen, and you had to remember to use -B every time you pushed otherwise only the commits, not the bookmark, would update.
We also tried hgflow, which used named branches, when bookmarks would have made more sense. Looks like it was never updated.
hgremotenames sounds exactly like what I would have wanted.
@poke if you respond, they'll know your email is still in use, so they can spam you even more
16:44
that makes sense
16:55
@MooingRawr if you ever feel like having your heart broken again by that anime, here's a loose translation :)
Sigh, answerer on that question trying to justify their post. Just don't answer low quality stuff.
heh
peer pressure badge builds character (he's not there yet though)
cbg
17:27
cbg
wim
wim
@MartijnPieters you should flesh your comment into an answer
the two answers there are both about **kwargs, which is not good to recommend without knowing any more about the context.
17:46
@faceless if you are having trouble understanding data models (which that book covers but passes over). You can check out this guidebook on data modeling in business and this really fundamental book on databases
Hi all! What are some book recommendations on OOP and general code design in Python? Fluent Python?
I'm mostly interested in idioms and good practices
See the SO question on best practices is a good start
cbg
Can I ask someone to see if this site loads for them:
http://www.xamuel.com/inverse-graphing-calculator.php
17:51
@toonarmycaptain it doesn't
I can't get it to load for me. I suspect it's how some of my wife's students are cheating.
They've been given an assignment to create functions to graph their name (Algebra II), and they're coming up with fancy functions that we suspect they're cheating somehow, but I can't find a site that just gives it to you (apart from that link).
Any ideas?
Cheers @Rawing
00:00 - 18:0018:00 - 00:00

« first day (2531 days earlier)      last day (2642 days later) »