« first day (2778 days earlier)      last day (2395 days later) » 

00:06
Is rankLangsByIndex missing a reverse on purpose?
With no pyspark knowledge that's all I've got
Also rhubarb
I don't think it needed a reverse, I could test it.... but only if I had an output. :(
00:22
@coldspeed If only all days were like today. My best recent thanks came from a dup-hammer earlier today.
@abarnert did you pull this number out of thin air or out of the endless vault of knowledge in your head?
I only know 1 company in San Francisco so I just assumed you worked for that one
69105 is a reference to Zork and other Infocom games. Like when you type count leaves it says something like "You see no point in counting the 69,105 leaves."
And inside Bureaucracy, you can try to play Zork on the hacker's computer, but it fails with INTERNAL ERROR 69105.
huh
that's a reference no one under the age of 30 would've gotten
From what I remember, it's based on MIT hacker slang. Because 0x69 == 105 and 0o105 == 69, you could shout out "105" in the computer room and people would giggle because the squares didn't get that you were making a sex reference.
00:38
would people really laugh when someone said 105?
I don't know if they would, I just know I read an interview with one of the Infocom guys who said they would…
there are certainly interesting people at Infocom
Wikipedia has an article on 69,105. It quotes the 1982 Jargon File and Guy Steele about the 69==105 thing.
DSM
DSM
@Annabelle: first print lang and text at the top of isFound; I don't think you're passing the same types in #1 as you are in #2 and #3, so I think nothing is getting through your if isFound(article, lang) filter. (Independently of this I'm also a little suspicious of your flatMap approach.)
stackoverflow.com/questions/50519983/… I'm sure it's a dupe of something, but really just a typo.
I cv-d for typo, if you need a dupe its probably stackoverflow.com/questions/11285613/…
01:00
done
DSM
DSM
You probably just aren't sophisticated enough to appreciate that the language can be enriched as a poem.
"It has always been and will be the number one IQ height and then practice" I'm only 5'11, can I still be a "top python expert" one day?
02:03
I wonder if Microsoft, Google and others use SciKit for training their Machine Learning models
03:00
new to pycharm. I created a file "test". Then I realized I needed it to be "test.py". Did a save as and deleted "test". But "test.py" doesn't have syntax color coding. How do I turn it back on for that file in pycharm?
03:14
Just gave myself a little scare...updated the BIOS, and it restarts with a blue screen saying Bitlocker would like a recovery key and I'm like yam yam yammity yam
If you close and reopen the file, does that help? I used to have to do that with BBEdit when I renamed a file.
03:29
@clickhere If you refresh the project, does that help? I found the simplest way is simply to copy the contents, right click--new--python file in pycharm, paste contents, and delete the old one.
04:02
Howdy Pythons
good day
Hi, I'm trying to build a function that finds all the occurences of a query in a html string, so for example, the html is <html><h1>hello world</h1></html> and the query is h. When running the code, all goes well, but it also finds all the h characters in the HTML tags. I would like to wrap the h matches not inside the tags in span tags for styling. I have access to beautiful soup. please help, been frustrating me for ages!
Use beautiful soup and .text
@DemCodeLines google uses tensorflow, fyi
04:24
cbg
@piRSquared cabbage
got 3 down votes yesterday... I must have angered someone.
cbg
you've been active this long and you're drawing the line at 3?
c'mon, I once got serially downvoted 6 times during my 2nd month of activity here
04:31
3 is a huge outlier
If you just answer pandas questions, 3 dv is definitely unusual
(-: other tags are more hostile?
Paul Panzer crushed that punctuation performance
yeah, should I accept his answer instead?
the solution forsakes readability for insane performance (it is severely unreadable, I don't know what it is doing at all, even after reading his explanation)
and anyway, he borrowed the plotting code from me >:D
Also looks to be fairly memory intensive
in the spirit of fairness, I've unaccepted my answer. I'll wait for the bounty period to end and accept whichever the community thinks is best.
04:41
I have to read it still. But once upon a time I posted a bounty on my question and I got a decent answer. I awarded the bounty just as an awesome answer was posted. So I decided to award another bounty. However, that bounty had to be double. So if after reading it I find it worthy, I'll award the less worthy answer the smaller bounty.
yeah, fair enough. I've done that too.
Is {'A': [{'B': [{'C': [{'D1':[]}, {'D2': []}]}]}]} really a "nested dictionary"
I think jpp has ruined tortoises for me
I used to think they were cute... now I associate them with fgitwing
04:45
It seems to me like a dictionary with 1 key whose value happens to contain more dictionaries
fastest gun in the wing
the human brain is interesting
I spent my time trying to be the fastest. EdChum was 100% correct. After a while, you stop caring
And it isn't fair for me to judge either. When I really started trying to gain rep, I was aggressive. Rep was important to me. It was going to be a proof point that I possessed some level of skill and/or knowledge in a domain I claimed to have it. I'd attempt to turn that into getting a new job. There was a real world goal. It wasn't just internet points. I don't know what the motivations of others might be. So I try to maintain some perspective.
Turns out, my decision to jump headlong into SO was one of the best ones I've made. But not for the reasons I had anticipated. My interactions on main and here and some of the connections I've made have made me grow into a better person and programmer.
I'm almost ready to even call myself a programmer (-:
All that said, I'm not happy about tortoises atm.
My goal was to get a k next to my rep on my answers, so I guess I can quit now :)
well, my goal was to get a job and a t-shirt, and I've got one of those now
04:59
I successfully deployed a hello world flask app to elastic beanstalk. Proof that I can follow instructions!
rad!
did you use the ebcli?
I learned how to use it be not reading the official documentation
stack overflow to the rescue, once again. Glad I have the power to vote
Pretty sure we've been over this, but aws documentation is one of the worst
Well I did mess up the instructions and had to back out of my mess. Yes @chrisz you've mentioned it (-:
05:03
(yes we have lol)
that is it for me. waking up in 5 hours. rbrb
rbrb
05:17
Morning cbg
05:34
mornin
The glory of GDPR is upon us.
06:31
@IljaEverilä allelujah!!!
cbg btw
07:09
There's this question that unmarshals and execs some data, which is a bit suspicious. Is there any way to figure out if that's dangerous without actually running it?
@IljaEverilä please don't close-vote or del-vote spam -- it should be flagged with the spam button specifically
@tripleee True, completely forgot about that.
over in the Charcoal-HQ room we collect and categorize spam, so I reported it separately there as well (so it is now archived in Metasmoke, the storage/analysis back-end)
On an unrelated note: had my speakers on 9000% volume. The ding was quite something :D
wow, that's way beyond "this one goes to 11"
07:47
Cabbage
In spite of their response, I still don't understand what this OP's RuleN is about. But I guess there's no need to close it as unclear, since they're unlikely to get any answers. :)
cbg
@coldspeed have you done much work with dask?
next to none
aside from installing the damn thing
I don't have a multi-node cluster so it is of no use to me :(
Gah. I've been desperate to find an excuse to use it locally but I don't really have the data size to warrant it currently. I was hoping there was someone to tell me how awesome it is and spur me to investigate it anyway
however, (protip) some questions are easy enough to answer by typing obj.function? in ipython and reading the docs ;-)
interesting note, it is worse than pandas even when used locally
08:03
Well, I changed the OP's code and got it running locally and it was very slow
the only time you see it becoming faster is when you run it on a cluster
But I'm assuming that the slowness is front-loaded while it sets itself up
I think there's just a lot of overhead in general
hey guys!
hey is for horses, cabbages are for room 6
get it right
08:10
Hello/cabbage
jk, hi
Yo. Anybody remember what CRT WinPython 3.7 is linked against?
@coldspeed Babbage's Cabbages.
that shows brassiness. If an answer can get 2 upvote, why not the question — cswah 6 mins ago
why indeed no upvote for a question that has been asked a million times before
and yet answers that have been posted a million times before still get upvotes :(
08:15
well, downvotes to answers are "expensive", so no one wants to do it :(
If answer scores got multiplied by the question score, that'd stop FGITWers from answering bad questions. ;)
that first answerer is a pathological fgitwer, but they're not a big enough fish for anyone to care
I don't downvote answers a lot on SO, but I'm relatively ruthless on SE.physics, considering my rep. physics.stackexchange.com/users/123208/pm-2ring?tab=answers
all time 917 up, 165 down?
even a fly's feelings wouldn't be hurt by that upvote/downvote ratio
Makes for an interesting rep graph though
08:22
@roganjosh Yeah. :)
@coldspeed True. They're only mildly annoying, although I do comment their answers when they get stuff wrong, or post particularly inefficient code.
But it's not fair to criticize them for posting Python 2 code if the OP's using Python 2.
If I were to answer that, I would've prefaced the reply with "please switch to py3. With that said, ..."
well, to be fair, that's what I should be doing. I rarely run into situations like that
most pandas questions are py version agnostic, so it doesn't matter there. And py2 questions on the main tag are all but extinct now
(moment of silence for them).
No!
They don't deserve that!
In my second-to-last company I was forced to work in Python 2.7 so in that case, telling me what I should be using would only get my back up. A more objective thing to say is that it's going to lose support soon, in the off-chance I didn't already know that.
did give em the python deathclock link too ;)
that is effectively a python deathclock.com. You'll see the ticker for python3 counting down in 10 years on the same website
08:28
Hopefully they won't mess up the branding with future version of python. AKA Python 4 should be called Python 3.10 (or similar)
We have been assured there will never again be a big break like there was going from Python 2 to 3.
@PM2Ring What does that imply? That python4 comes only after python3.99?
I guess I'll have to live with the inconsistent naming mess in the stdlib forever...
that's open source for ya
holes and headaches everywhere
@coldspeed The most important thing I took away is that python 3 libs can be imported and run in python 4 code without any work
i.e. there will be no need for a 3to4
08:41
nice!
@coldspeed IIRC, Python 4.0 comes after Python 3.9, but it will just be a normal update, with no backwards incompatibility.
When I see newbies asking Python 2 questions I post this in the comments: "Be aware that Python 2 will reach its End Of Life in 2020, so you really ought to be learning Python 3, unless you need Python 2 to work on legacy code."
But will people know that or will they avoid python 4 for no reason?
@Aran-Fey that depends mostly on our preaching efforts =D
'Why you should switch to python 4 right away' might be the title of a very popular blog post in a couple of years.
I guess it exists already, kind of
08:44
It might backfire to make a big deal out of it though. Maybe we should just act natural
others won't..
i mean, people with no clue will complain about yet another python version and how it is horrible and they will tell everyone to just stop using python because of it
Probably true :I
doesn't hurt to expect it and only run the risk of being positvely surprised
okay, been awake long enough. rbrb folks.
rbrb, happy weekend
08:48
@Arne you can have a clue and still complain about horrible new Python features and changes
@vaultah Of course, I was only referring to complaints on the name switching to python 4 after 3.9, not complaints about changes to the actual language
I did not mean to sound that dismissive :|
@coldspeed as it's been asked multiple times, quit harrassing users with salad. It's a local quirk, not a device for oppression
Is there a replacement for scikit-cuda? Seems to be incompatible with the cufft deployed in CUDA 9.2 (deprecated options like cufftSetCompatibilityMode).
"You must learn our language if you want to come here (jk hello).". Sound odd?
09:15
how can I import something (let's say a class) from a python file in a sibling folder?
like "../sibling_folder/file" in JS
is having ../sibling_folder on your PYTHONPATH when you start Python acceptable?
"sibling folder" sounds worrying. Do you mean "sibling module"?
@tripleee no if there's another way
@Aran-Fey I guess
but it's also a folder
call it directory
it needs to adhere to some additional conventions in order to be a module
it has __init__.py so maybe it's a module? :S
09:20
if it does, importing is simpler
from .sibling_folder import whatever should work, then
grrrrr yamming rain
@Aran-Fey with that dot?
@Neoares no that's just dirt on your monitor
09:21
Yes, that's a relative import
doesn't it need to be .. though?
it works with 2, I think
guess I should just check
@AndrasDeak possible. Depends on the details
this solves the problem I was describing the other day I think... lol
09:23
.
├── current_folder
│   ├── foo.py
│   └── __init__.py
└── sibling_folder
    └── __init__.py
what I'm imagining it looks like ^
yes
with a bar.py in slibing_folder
yeah, that too
If the code is in __init__.py, a single dot should work. If it's in foo.py, then you'll need two
if it's so easy why I didn't find it on the internet?
ah, so that's what you meant by details
@Neoares people hate best practices and people on SO answer all the crap. How many "append to sys.path" solutions have you found?
09:24
@Aran-Fey I have an empty __init__
@AndrasDeak a lot... I just insta-closed the browser tab
yup...
yam, I'm soaking wet
I tried ../sibling and "../sibling"
what if I want to go back 2 directories? :D
add more dots
like ../../foo/bar/baz
but no slashes
09:26
so ...foo.bar.baz
this is awesome lol
looks so neat
If the module you are working on is installed, you can also work from top down
some linters forbid these kinds of relative imports
hacking in particular
ignore my comment if you didn't plan to write a installable package
09:28
that's an interesting name for a linter hahaha
doesn't adding __init__ create a package?
it's modules all the way down in python
oh, installable
yeah, i edited that in to make it a bit more obvious what i mean
@Arne then answers in SO are dumb
cause I read many times that by doing that you created a package
09:30
Actually, everything is a module.
it's quite hard to ask the right questions for this kind of prgram structure/layout problem
> A module is a file containing Python definitions and statements. The file name is the module name with the suffix .py appended.
what would be helpful is if all these duplicate questions were closed and set to point to a good one with a complete treatment of the subject
Technically it's a package even without an __init__.py. A directory without an __init__.py is a namespace package (Warning: useless information)
this is getting quite philosophical
09:31
crap answers are a fact of life but SO is uniquely positioned to do something about the problem
@tripleee which would probably span so many pages that the kind of people who ask these questions would be overwhelmed by it
yeah, it's complicated
but yeah, the current situation with all information scattered in unfindeable places is suboptimal
just a brush of the subject but still
oh god, something clear in the official python docs
I still don't like them
I guess I cannot avoid comparing them to developer.mozilla.org/en-US
09:37
Is there any kind of hook at all to know whether a Flask session has overflowed?
I guess this is unclear: "I wanna when i clicked B2 button turn back other bg color chance operation with number of enter the entry text", but I want to give the OP time to respond before I ask for close votes. stackoverflow.com/questions/50525795/…
@Neoares that's not the official docs, that's the official tutorial
and the official docs are usually clear but they're not a tutorial
what's the official docs then
the reference?
@Neoares IME, the Python docs are mostly pretty good, once you get used to their style. However, I agree that there are definitely parts that aren't easy to understand. When I was first learning Python I just skipped the docs that didn't make sense. Some of those I've revisited in recent years, but there are a still a few gaps in my knowledge. ;)
Surprisingly enough, writing docs is hard :(
jpp
jpp
09:41
cbg all
Well, the Tutorial is part of the docs. But the Tutorial is separate from the Library Reference and from the Language Reference.
jpp
jpp
stackoverflow.com/questions/50525379/… (unclear; user does not wish to supply more information)
Huh. If it wasn't for your deleted answer, I'd have said that question is pretty clear.
jpp
jpp
@Aran-Fey, Yeh, well, I tried to help..
I asked for a little more info, and it backfired :(
09:45
it didn't "backfire", they just didn't want to do that
jpp
jpp
@AndrasDeak, In which case, either I'm a dummy and don't know what they don't want, or they need to be more clear :)
They do, I was mostly objecting to your use of the word. Your request for clarification didn't make it any worse, it merely didn't help. Just getting a bit too dramatic here for my taste nowadays
jpp
jpp
@AndrasDeak, Fair enough, I wasn't looking for overtones with backfired. Just a genuine feeling. I will be more careful with my terminology.
It's not (just) you, just a general feeling of most regulars always complaining about subpar OPs on main recently. Not that any of this is wrong, but it gets tiresome.
Sorry :(
09:50
there's a big complaining environment these days
@AndrasDeak wrong in the bool() sense, I mean
jpp
jpp
@AndrasDeak, Yeh I get the point. My only difference in opinion is you should never complain on a Q&A (which I think is infinitely more harmful) and, if/when I do it, please catch me out!
Will do :P
jpp
jpp
Meta / chat are (for good or for worse) used for venting. Let's just keep Q&A clean, at a minimum.
unclear / no mcve stackoverflow.com/questions/50525795/… I think 20 minutes is enough time…
@AndrasDeak It does get tiresome, and I know I'm guilty of it myself, from time to time. But I agree with jpp that it's better to complain in here than to get snarky about OPs in the comments.
09:55
it still risks the room becoming more and more like a mental trash can
There's a script for that
43
Q: Punch a user button!

Manishearth Gotten frustrated with a user? Want to vent? Feel like punching them? Don't worry, here's a script that adds a "Punch" button to every gravatar. You can punch all the worst users now: Installation Click here to install. Will work in Chrome or Firefox (the latter requires Greasemonkey). S...

now that's more like it
@Aran-Fey what does it do?
I think I first saw that userscript in a diamond's screenshot on meta, it was funny when people asked what that button does for mods
awesome
but I think the OP should've explained it
09:58
It doesn't work for me :(
Oh, it's all http:// links...
@BhargavRao FYI :P (sorry for late ping)
10:24
Hi, Martijn. I flagged one of your old comments yesterday for being obsolete. :)
the import ..thing doesn't work c:
ValueError: attempted relative import beyond top-level package
Well, the sibling folder has to actually be in the package.
package or module?
package
10:28
relative imports are within a big package
And the folder containing the entire package has to be in one of the folders that Python will search, i.e. in sys.path.
That doesn't mean that my_package/ is in sys.path, but the parent of my_package/ must be in sys.path.
then we end up adding stuff to sys.path
as opposite as what we said before
No, we end up installing stuff correctly so that it gets added to a path that's already in sys.path.
The solution depends on what you're importing. 1) Your own module from the same package? Use relative imports. 2) Another module, that isn't installed for some weird reason? Install it, or add it to sys.path, or import it directly with something like this. (99% of the time, installing it is the correct solution)
what is "install"?
I mean
it's my own code, but just in another folder
both folders have a __init__.py file
since I'm probably using them from the root dir (the project's root)
from ..util.video_parser import VideoParser
SystemError: Parent module '' not loaded, cannot perform relative import
10:39
I'm using "installing" as "making it importable", for example by adding a symlink to the module in python's site-packages folder
@Neoares ^that
So, step 1: Figure out if your two modules should be part of the same package or not
I have a long answer on that error
I'm all eyes
@Aran-Fey they can, actually I was planning to move it to the same package
but I still want to know how to make it work this way
jpp
jpp
@PM2Ring, Interesting that numpy array from unknown # of rows is actually a [pandas] question (where array size is well-defined).
10:43
or... it's a "good practice" to not import things from one package to another one?
oh no, wait, they have to be separated :P
it's my "util" package
packages are meant to be imported, but stuff you want to import should be set up such that you can import it, i.e. installed
ok
and my question is.. can I have files from different directories that belong to the same package?
btw, I'm gonna read some docs about this
@Neoares Yes, if those different directories are both somewhere in the directory tree of the package.
@Neoares yes, if you use namespace packages
@vaultah THAT
I just read something about __name__.py
is that what creates namespaces?
10:47
__name__.py has no special meaning
I'm gonna go out on a limb and say that you probably don't want a namespace package
But you don't want to combine things without good reason. Here's a silly example. Say my program needs Numpy to do number crunching and Tkinter to do GUI stuff. So it imports Numpy, and it imports Tkinter. It wouldn't make sense to have a combined "Numpy with Tkinter" package that you can import Numpy stuff and Tkinter stuff from.
:sigh:
Maybe you should give us some context? What's the project you're working on? What's the package you're trying to import?
I'm trying to import util.video_parser from model.video
10:51
So it should definitely all be one large package
in the same folder?
Yes!
eh.. no?
I don't want to put everything inside "util" just to use an util function
That structure is ok... if your package's name is src. ;)
idk what is my package name! Q_Q
10:53
Assuming that your package needs all of that stuff.
src/
	.idea/
	your_package/
		adult_filter/
			__init__.py
			...
		model/
		    __init__.py
			video.py
		speech_recognition/
		util/
		__init__.py
		config.py
		__main__.py
^ like that, I think
actually, .idea should probably be in the parent directory of src
oh, I need the __main__
nah, not really
the package doesn't need a __main__.py to work. But your main.py won't work, because you're not supposed to have executable scripts inside of packages
oh, you aded init inside model
package = library. library + executable script = you did something wrong
The point is that it's all inside a your_package folder
10:57
unless -m?
@AndrasDeak __main__.py is the exception, yeah :p
I have to remove __init__ from src
so is not a package enymore
but then I'm not going to be able to import things from src.config :P
You don't want to import anything from src. You want to import from your_package.
The idea is to make your whole project a single package. And if a project is named src, then you probably need to find a better name for it :P
no, that's the folder where I have the code
that's the project's directory
11:01
I feel like models should be in src okay then
the data, the python environment, models is where I save the trained neural networks
@vaultah xD
they're 500MB .h5 files, usually
tbh I've never had a package that depended on external files, so I'm not sure what the recommended place to put them is
in JS, src usually is the root of your code
Generally, the project should be structured like so
.git/
docs/
tests/
src/
    your_package/
README.md
setup.py
Though I have to admit that we're entering territory that's unknown to me. I've never packaged and published a project.
A good starting-point to read about this stuff is docs.python.org/3/tutorial/modules.html#packages
11:05
@PM2Ring I'm taking a look, thanks :D
no module named src , but I clearly added a __init__.py inside src
If you are going to be deploying to different platforms there are facilities in distutils (heavily used in setup.py) to ensure that you can access data files wherever the platform puts them.
I'm gonna read about __main__ ... I think it's the only thing I'm missing
is that or the need to add something in init :P
yeah, or something else
yeah... who knows xD
We could if you posted your code/sys.path/new directory structure
At this point you're better off posting on the main site
11:23
I did the same as in the docs.. apparently it's not working
wouldn't be the first time you misread the docs IIRC
nor the last
(ignore the errors because of the commented imports in video.py)
and calling main gives me the

from ..config import ROOT_DIR
ValueError: attempted relative import beyond top-level package
and I haven't added anything to pythonpath
so, sys.path only contains paths to virtualenv /lib/ and the "root" python ' lib/'
11:38
nevermind I misunderstood
I see two problems: There shouldn't be an executable file (main.py) in the package, and you shouldn't be using absolute imports inside the package (from model.video import Video)
(importing from the parent package like from src.model.video import Video would be fine though)
You can either use a __main__.py as the entry point and execute the package with python -m your_package, or move the main.py script out of the package
yeah, I also changed the import to from src.model.video import Video, but it says "no module named src"
I think I have to add it to pythonpath
If you want to use absolute imports then the module has to be installed ofc
src.model.video is absolute?
If it doesn't start with a . then it's absolute
11:50
ok
I think my problem is that I'm calling a python file from a directory with a __init__.py file
and apparently is not a good idea
so yeah, makes sense to have a parent that is not a package
Huh! The last bug I had in my processing script came from the fact that I took numpy's view behaviour a given :) I thought that it's enough to mutate bigarray[logical_inds] later and it will be reflected in the original array, whereas in the general case that has to create a copy because the logical indices can easily select a non-sliceable chunk from the big array.
@AndrasDeak Tricky. I guess it's tolerable because you want Numpy to make stuff as fast as possible, so it tries to make view work by pointer arithmetic when it can. But when it has to make a copy it'd be nice if it gave you some indication.

« first day (2778 days earlier)      last day (2395 days later) »