« first day (3524 days earlier)      last day (1428 days later) » 

1:23 AM
>>> args = ()
>>> not all(args)
False
???
 
1:35 AM
And second of all, if myList == [] is True, why does myList is [] return False? Don't they point to the same place in memory? Aren't they the exact same object?
 
1:47 AM
If I use conda install gurobi, to which folder does it install gurobi (so I can set the GUROBI_HOME environment variable)?
@JossieCalderon all([]) should be True. What's wrong?
@JossieCalderon myList and [] are different lists. They just contain the same items (i.e. none at all), which is what the equality sign is checking for.
a = []; b = []; a is b; a == b; a.append(3); a == b
 
@user76284 args is a tuple, not a list.
 
Same thing applies.
 
Did you try it in the interpreter?
The same exact code I typed?
 
Yep.
 
Then my Python 3.8.1 must be broken
 
1:53 AM
What do you mean? What answer do you get?
 
30 mins ago, by Jossie Calderon
>>> args = ()
>>> not all(args)
False
 
Yeah, that's what I get too.
 
It should return True
 
No, all(()) should return True.
not all(()) should be False.
It's correct.
Did you mean any?
any(()) is False.
 
Why does this answer say otherwise?
39
A: What is the best way to check if a tuple has any empty/None values in Python?

Tim PietzckerIt's very easy: not all(t1) returns False only if all values in t1 are non-empty/nonzero and not None. all short-circuits, so it only has to check the elements up to the first empty one, which makes it very fast.

 
2:01 AM
That answer says nothing about t1 itself being empty. It talks about elements of t1 being empty.
[[]] contains an empty list, but it is not itself empty.
It's not an empty list, but a list containing an empty list.
 
Thanks
 
No problem!
 
 
2 hours later…
4:09 AM
If a certain someone starred my message 14 hours ago, and it got unstarred, I haven't noticed until now that I see I have a Talkative badge that was awarded 14 hours ago.
 
Is there a general randomness chat?
Or is off-topic chatting okay?
Because I just achieved the privilege of posting in chat and Python is my favorite language.
 
 
1 hour later…
5:18 AM
@themadpsychologist visit the room rules for more guidance on posting in this room. Different rooms have different rules, and some rules are more strictly enforced than others. You can also browse the available rooms here.
Mostly just read the room. If there is an ongoing discussion about a Python question or topic, then dropping in an off-topic remark will definitely not be welcome. When there is a lull, some off-topic bits might be okay, but you'll really need to self-regulate, and spamming with gibberish or nonsense will get you kicked fairly quickly.
Some of the regulars here do like to go off on tangents sometimes, but it is a privilege that gets earned over time from solid on-topic participation in the chat. As a newcomer, you won't get much leeway right off.
Well, I guess I'm talking to myself. Not sure the room owners will like or agree with this "it's not so much a rule, it's more of a guideline" comments, but you have to admit that the regulars get a little more latitude as to what constitutes on-topic. I don't think that's necessarily bad, it definitely makes this room more interesting. But for new people and strict constructionists, rule-bending and grey shading can have an air of favoritism or bias, when none is really intended.
RO's feel free to send this all to the Rotating Knives, you won't hurt my feelings.
@MisterMiyagi I was just about to rbrb, but since you are here, have you been making progress in your pyparsing efforts?
Well then, to the sound of chirruping crickets, I'll rbrb off to bed.
 
5:53 AM
@PaulMcG Understood, thank you!
 
@JossieCalderon the wording in the answer is misleading. all checks whether there are no falsey values. It does not check whether there are truthy values. In the absence of any values, there are no falsey values as well.
@PaulMcG Not after adding your last batch of suggestions. Been pretty tied up with my dayjob lately.
Which surprisingly does have a use-case for pyparsing, but we've finished that already.
 
6:27 AM
It's a vacuous truth
 
user11006952
> Cute fluffy animals are cool, okay!?
—https://sopython.com/chatroom
 
> Now’s a good time to note: don’t use this server in anything resembling a production environment. It’s intended only for use while developing. (We’re in the business of making Web frameworks, not Web servers.) Django
What do they mean?
It says it's included for development convenience and Apache is better for production...
Anyone with web server production experience want to chime in?
 
6:46 AM
It means precisely what the quote says. It's easier for developing, since it has less knobs to worry about and you can debug it with regular Python tools. However, it is neither as fast nor as secure as a proper web server, such as Apache.
 
I think I'll just stop being lazy now
 
7:29 AM
cbg-ning
 
7:54 AM
@JossieCalderon flask has the exact same setup: flask.palletsprojects.com/en/1.1.x/server
some web framework ship with a so called development server, which is not actively maintained to be performant or secure, it's just there to test and debug your flask/django code
flask/django code is just a server definition, it can't just be executed to start/run a server. it's kind of non-obvious, even though it's really elementary to writing server backends
 
Sam
@Arne I thought thats exactly what it does
albeit not a production-grade server
@JossieCalderon I use gunicorn for production and the flask server in dev mode
 
8:13 AM
@Sam you meanflask.run()?
 
let's say I have a for like this
 
Sam
@Arne yah
 
for i in range(randrange(2,6)):
	a = randrange(1,17)
	if randrange(100) < 70:
		answer += a
		question += " + {}".format(a)
I want to add in question, the question is :
 
well, that's not part of the server definition, and it shouldn't be executed when running the code with an actual production server. it's just a crutch because booting up a gunicorn or apache is cumbersome during development
 
thing is if I add like that " the question is + {}".format(a)
it will give me this
 
8:16 AM
@AndyK:
 
('question is question is question is question is 18 - 5 - 2 + 1 + 16')
 
@AnttiHaapala ha ha ha you cracked me up
 
Just initialize the question as question = 'the question is : '?
 
@Aran-Fey that simple? let me have a try
 
8:37 AM
@Aran-Fey check my code and got the answer... I only needed to got out of the loop and voilà.
 
8:49 AM
@AndyK the problem is that you're using entirely wrong constructs here.
how about:
numbers = [randrange(1, 17) for _ in range(randrange(2,6))]
question = 'The question is: ' + ' + '.join(map(str, numbers))
answer = sum(numbers)
 
@AnttiHaapala Thanks Antti
 
What's the point of the if randrange(100) < 70: anyways? Are you selecting other options that are not shown in the code?
 
@MisterMiyagi the whole code would be like this
for i in range(randrange(2,6)):
	a = randrange(1,17)
	if randrange(100) < 70:
		answer += a
		question += " + {}".format(a)
	else:
		answer -= a
		question += " + {}".format(a)
question = "question is {}".format(question)
answer = "answer is {}".format(answer)
 
9:04 AM
trying to extend this statement
input_data = [[460]]
all(370 <= i <= 490 for i in input_data[0])
for multiple nested lists like input_data = [[460], [460]]
 
the else line is wrong, it should be question += " - {}".format(a)
 
do I need a special function for accessing multiple nested lists?
 
@roblox Are you aware that you can nest comprehensions? all(370 <= i <= 490 for nested_data in input_data for i in nested_data)
 
@MisterMiyagi did not know that , thanks
 
@AnttiHaapala you are using a list... interesting. I wouldn't have thought about that, first hand.
 
9:28 AM
@PaulMcG I fully agree with your assessment
@Pax or rather not doing that
Please leave moderation suggestions to room owners and long-time regulars
@themadpsychologist you're welcome to stick around, see what people are talking about, engage in ongoing discussion (off-topic or not), ask your python problems within the rules. But don't go out of your way to be off-topic.
 
Another for the canon: Do regular expressions from the re module support word boundaries (\b)?. The standarda gotcha when you forget to use r'\b' on your regex. I just hit it yet again. It's well worth documenting in canon.
 
You need to adopt the habit of putting regex in raw string literals
 
9:53 AM
the problem is actually the braindamaged regex syntax :D
 
is there some package to build regexes using regular objects/operators? pyparsing has some neat tricks, but does not reduce to regex.
 
10:09 AM
So, uh, I have two projects that depend on each other... can pip handle dependency cycles?
 
Hello guys. Might I ask you a quick question
?
 
don't ask if you may ask - just ask
 
Cool beanz.
So,
I have the following question.
Regarding the python's bytes() function. Lets say that I have the following
>>>bytes([10])
b'\n'
How does this exactly work? I said that I need the integer 10 converted into byte format. But what is the encoding the function just used?
 
compare against chr(10) and b'\x0A'
yes, bytes are represented as ASCII where possible.
 
Yes I was expecting b'\x0A' but I got '\n'.
 
10:21 AM
note that the byte actually holds the "value" 10. \n is merely a convenient representation.
 
Exactly , I do not understand this "representation"
 
@Aran-Fey doesn't that just mean that it's actually the same package?
 
@Broxigar Are you aware that 10, 0xA, 0b1010 and 0o12 all represent the same number?
 
If a byte contains the value X and the unicode code point X represents a printable ascii character, then that byte is represented as that ascii character. Otherwise, it's represented as hex
 
@MisterMiyagi ... of course
This is what I needed @Aran-Fey. Thanks!!
 
10:26 AM
@Arne Not really. One project deals with data types and typing, the other one deals with introspection (function signatures, etc). The typing projects needs the introspection project for things like is_instance(int, Callable[[], int]), and the introspection projects needs the typing project to generate correct reprs like (x: List[int]) (instead of the trivially generated typing.List[<type 'int'>]. There's an overlap, but they're not quite the same thing
Although, to be fair, the typing project is pretty much just a random collection of things related to data types, annotations, and similar things. It might make sense to move the typing introspection/compatibility layer into the other project... maybe...
 
could you make one of them optional? E.g. using a more basic repr when the pretty-printer is not available?
 
^ good call
 
the last few days reminded me that I wanted to brush off the dust from stenotype again...
 
Hmmm..... I'm not happy about it, but I guess I could
 
@MisterMiyagi is there still hope to have a more or less complete coverage over typing syntax?
ready the recent peps gave me a bit of a start regarding stenotype, the typing syntax is getting extended a lot
@Aran-Fey reading through dependency resolution specs is above my paygrade braingrade, but I can try to run a test with two cyclic for pip and poetry and just see if it works
 
10:32 AM
@Arne dunno, might have missed some. After reading the "we're adding Final because it works nicely in Java" PEP I kinda lost track. ;)
 
but just in case, here is the one proposed for pip: python.org/dev/peps/pep-0508
 
@Arne Please do! I tried my hand at that but failed because I don't know how to specify a local project as a dependency
 
holds up private pypi yeah, I wasn't planning on trying that either
I'm sure it's possible, but my next attempt would be to try depending on older versions and upward-leniency, and for that I'd need a package index anyway
@MisterMiyagi i think there was another one where builtin types can now be used to define types. so that dict[str, int] == typing.Dict[str, int] in a typing context, but I can't find it right now
 
10:54 AM
@Arne you're right, PEP 585 allows using the builtins in place of the typing names. So Dict[str, Tuple[int, int]] becomes dict[str, tuple[int, int]].
The syntax seems to stay the same, though.
 
How should I name a function that takes a typing fake-class as input and returns the corresponding regular class? i.e. func(List) -> list, func(list) -> list
 
I usually call such things "normalize"
 
str_to_list, I call them datatype in to datatype out
 
@MisterMiyagi implying that typing stuff isn't normal, I like it :P
 
well, usually it's something like <object space>.normalize, e.g. for stenotype there is stenotype.typing.normalize (normalize to typing) and stenotype.steno.normalize (normalize to steno, if anyone ever writes that).
 
11:17 AM
Hmm, I hadn't thought of that, I should probably write a function that does the opposite as well. I'll just name them type_to_class and class_to_type or something
 
but classes are types D:
call it to_python, that should contrast it nicely with typing
 
This was one heck of an xy problem stackoverflow.com/questions/62278920
 
oh so typing isn't python? :P
not a bad suggestion, though, to be honest
 
@Aran-Fey yup
@metatoaster also a typo, apparently...
on a less serious note the inverse could be to_java :P
Don't you want the former to be a method on your objects?
hmm, your func(list) case suggests not
Why do you even need to convert between the two? I thought typing was a completely separate shadow universe of its own.
 
right, I don't have my own objects (actually I do, but they're not relevant here)
 
11:23 AM
@AndrasDeak I already do, for years now. Just every now and then I forget, and wonder why what should work doesn't work. Rediscovered empathy for how confusing that was the first time around, and why it needs to be in the canon.
 
@AndrasDeak no real reason. It's a library for dealing with typing stuff, so I figure that's something I should have. I'm not using it for anything myself, though
actually, I do make use of the to_python function in my is_instance(obj, type) function. Not the other one though
 
But are you using that for typing? At runtime types shouldn't matter anything, right?
 
@AndrasDeak it can be useful to use typing as actual types, see e.g. functools.singledispatch
 
ugh
 
Yeah, I like to use them at runtime for stuff like that
there's also dataclass btw
 
11:26 AM
putting unpythonic yam in your foundations...
 
well, if collections.namedtuple counts as Pythonic... :P
typing.NamedTuple is so much more pleasant to use
 
"oh, sorry, we have to make typing mandatory (but just by convention), because <display of delightful new features>"
 
hm, I'm more concerned that they've choosen a type system which isn't correct. There are tons of languages out there (cough Julia cough) that show optional typing works well.
 
"Oh, since typing has become convention, why not make it mandatory? We can finally fix python's greatest shortcoming! Also we're removing assignments and we'll only keep assignment expressions, since there should be only one way to do something."
 
one of those days at the home office, huh?
 
11:30 AM
"Also adding strings and numbers can be done straightforwardly if we take enough care"
@MisterMiyagi nah, this is my baseline :P
 
@AndrasDeak I'm very happy with what you are doing. Keep defending the proper and good python. I would hate to have types in python
 
I'm actually finally almost free of teaching duties for this semester
 
me too. Poured much of that time into reading up on typing theory. ^^
 
I really love python and I'd hate to leave it, but if typing becomes mandatory I might have to look somewhere else. I mostly use it for convenience and productivity. If bloat gets reintroduced I might as well find a language that makes better use of boilerplate.
the ease with which asspressions can lead to unreadable code is the same thing
 
Considering that python 2 support ended only just recently, I think you'll have plenty of time to find a new language even if typing becomes mandatory tomorrow :P
 
11:37 AM
I hope that now that we have a steering committee we won't converge to the design principles of C++ :P
@Aran-Fey OK, I don't really expect it to become mandatory mandatory...
 
@AndrasDeak FWIW, I share both sentiments. I sleep soundly knowing that CPython is such a big ball of mud, adding mandatory types is next to impossible.
 
I'd be OK with a fork called Typethon. Typhon?
 
well, there's mypyc... :P
Actually, I would quite like for typing to be optional but have better support by tooling (aka JIT compiling). Python's history shows quite well that it's better to use the big guns only where they make an impact.
 
@MisterMiyagi never heard of it! Apparently mypy now
@MisterMiyagi isn't that julia?
Or does that always jit
 
Julia always JITs, but you do not have to annotate.
similar to how PyPy just inspects what you are doing.
but I find Julia code butt-ugly :/
 
11:45 AM
ironically, it's impossible to correctly annotate a function that takes type annotations as input (like func(List))
 
Sam
Given a function which returns two things:
def myfunction(x):
  return [1, 1, 1, 1], 1
 
@Aran-Fey have you tried @overload and hand-writing all the combinations that fit on a 64-bit architecture?
 
Sam
Is it possible to ignore the a given element in a list comprehension?
The alternative is:
z = []
for x in [1, 2, 3]:
  response, _ = myfunction(x)
  z.append(response)
wondering if you could somehow do it using [myfunction(x) for x in [1,2,3]]
 
@MisterMiyagi No :P
@Sam [myfunction(x)[0] for x in [1,2,3]]
 
that ^
 
Sam
11:48 AM
@Aran-Fey ahhhh
I did not think to do that, thanks :P
 
If this is a coding challenge, use map(itemgetter(0), map(myfunction, [1, 2, 3])).
 
Sam
@MisterMiyagi Its not for a challenge, but thanks for the alternative solution
 
oh my, don't use it unless you are interviewed and the other guy is making snide remarks how Python programmers don't know real code.
 
Heh
First implement compose
 
There's nothing like re-implementing lambda calculus when applying for a web shop gig.
 
11:58 AM
to be fair, it's pretty crazy how hard it is to read/write code using a programming paradigm you're not familiar with. I tried my hand at Haskell again a couple weeks ago, and it made me feel like my brain had turned inside out
so while I agree that writing functional python is bad, I understand why some people do
 
@Aran-Fey I get that all the time with recursion anyway
@Aran-Fey counterpoint: there's a reason I don't use haskell
 
you don't get paid for it? :P
 
aren't we contractually required to sympathise with Haskell because they have significant whitespace?
It's, like, practically the same language.
 
@Aran-Fey If there's any language I get paid for it's fortran...
@MisterMiyagi the awkward cousin twice removed. Better not bring it up at family dinners.
@Aran-Fey or should I say, "wait, you guys are getting paid?" :D
 
@AndrasDeak sure, in blood, tears and pain. How else?
 
12:04 PM
the point is that sometimes you have to use a language you don't like
 
Why I'm afraid when WFH ends: I'm partially responsible for the office coffee machine and have to tell my colleagues it cannot be switched on for a while. That's blood, tears and pain.
@Aran-Fey That's PERL for me. Never endured Haskell outside of academic curiousity.
 
@Aran-Fey but then code review would force you to write imperative code :P
 
code review? What's that? :D
 
 
1 hour later…
1:12 PM
Hello! I am working with sessions for login/logout and I noticed that layouts.html within my Flask application is able to access my session data without it being passed. My session data is only coded within my application.py file. Is this possible because the session data is stored on the client's browser? Am I understanding this correctly? Also, if this is not the best place for this question, please kindly guide me :).
 
Esoteric question, but I have a vmware esxi and I would like to install ubuntu on the pc, overwriting the esxi(not install an ubuntu inside the esxi). Now on boot I have an entry change apply options and boot. But it's a text interface saying: installerDiskDumpSlotSize=2560 no-auto-partition bootUUID=someString. Now I can edit this line, but I got no clue what I need to put there to load from the usb holding ubuntu. Any ideas?
 
Some linux-oriented room on chat.SE might be more useful. Or even asking on a main site.
 
1:29 PM
Or your coworker. He found it. Looks like my strategy of just caressing all the F1-F12 keys doesn't always work. I must have missed the timing. Hammering the F2 in this case really did lead me to the Bootloader :)
 
Ah. Yeah.
 
Cool to see that the new Ubuntu improved the detect your keyboard feature. I just had to press 1 button :)
 
"Warning: avoid using this attribute." -- comment on an attribute used on every execution on every page of my project.
 
rip
 
@Kevin time to wrap it. No comment, no problem ;)
 
1:32 PM
No explanation given, but it probably has something to do with the DuplicateWidgetException I've been getting for four days, despite the fact that Widgets.Add(Widget) is called exactly once in the entire solution
 
1:49 PM
@Aran-Fey I'm not entirely sure which function you're implementing, but this is commonly known as get_origin or get_last_origin. Typing inspect has them. The output varies on Python version, cause __origin__ changed form in IIRC Python 3.6. I know pytypes also has a lot of support around these functions, but can be a bit heavy.
I implemented it in Python 3.5.0 to 3.7.2 for all typing objects and it's a PITA to get normalized output.
 
yeah, I'm trying to avoid origin because it's unclear what it refers to
 
Pytypes probably has you covered then, IIRC their output doesn't change depending on Python version like origin.
 
>>> is_of_type(3, float)
True
I'm not very optimistic about this module...
wow, pytypes is throwing exceptions left and right
 
Oh, wow. It was pretty good when I last looked. :(
 
2:04 PM
oh, the last commit was last year. 3.8 broke it
 
@Aran-Fey that's per the typing rules. you can use int wherever float is approapriate.
 
huh. Makes sense I guess
 
it's a side effect of the number hierarchy
well, it can be a bit of a mess since floats are not exact numbers.
 
typing_inspect's get_origin isn't working as advertised either... I'll just stick to writing my own functions
 
Hmm, Widgets.Add is only called once explicitly, but WidgetBeanFactoryManagerFactoryProxyMapping.Configure() pulls configuration data from a number of sources, such as the app config, The cosmic microwave background, Widget.config.xml, and a number station somewhere in South Dakota.
Any one of these could be adding widgets without me noticing
 
2:14 PM
sounds devious. Have you considered promoting text terminals only?
 
wim
I've an easy +300 bounty here for grabs
Thought it would be taken in an instant but it wasn't ...
 
If I remove the .Configure() call, my project crashes a full 50 ms later than usual. Good sign.
 
wim
@Aran-Fey it can handle simple ones, yes
 
good to know, although I've already started ripping limbs off project1 and attaching them to project2
 
wim
@Aran-Fey you just use a local directory as an index, and then chuck .whl and/or .tar.gz files in there.
 
2:24 PM
@Kevin xD
 
@wim Hmm, I don't really get it. Would I need to set up a HTTP server? Or could I just point pip to a file:// URI?
Not that it really matters, since the dependency cycle is already gone
 
@AndrasDeak I have two companies I work with where the other programmers have refused to review my code cause there is no point (both are heavy data, both are heavily Functional & Recursive, both are NLP based, one is Python other is Java)
 
What do (they) you mean "there is no point"?
 
wim
@Aran-Fey just file:// protocol works but you can also do a python3 -m http.server
the benefit of the latter approach is that you see logging events any time pip hits the index
 
@nilajawill Correct. You will want the session data stored on the server side. I use flask-session for this with the SQLAlchemy interface but you can also use Redis or just the filesystem. The project has been somewhat dead for a while but got some updates ~a month ago, but now they've pulled the whole documentation down... :/
 
2:31 PM
They don't know functional programming and get lost in the recursion. They started by suggesting an imperative approach until they tried to build it and figured out why you have to use recursion with certain NLP analysis (i.e. where decisions are based on previous words, grammar, etc...)
 
There is also flask-kvsession but I haven't actually used it. I guess it'd be just as simple, though
 
wim
pip itself has cycles (pip -> setuptools -> pyparsing -> setuptools) but since they vendor everything it doesn't really apply here
 
@nilajawill If you want a skeleton outline for flask-session that uses SQL, ping me and I'll put one together for you when I get chance
 
@LinkBerest so your code is unmaintainable? :P
 
without a data engineer - yes (or at least not a shop made up entirely of webdevs and myself working as backend & data)
^ which is also why I try and avoid working with startups ;) :P
 
2:36 PM
@MisterMiyagi There are some regex-composing packages that I've run into over time, searching through pypi to see if I recognize any. And pyparsing does do some rendering to regex internally (most notably in the Word class and the quoted string expressions).
 
Ah ha, it was loading the widget from C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\widget.config. First place I should have looked, obv
 
@wim Yeah, that has no bearing on whether pip can install modules in a dependency cycle correctly. But anyway, I found a workaround that I'm pretty happy with, so it's a non-issue
 
Ever picked up an old project and knew fixing it was going to hurt because the person who was last maintaining it cause their commit history is "add 1839 characters" or things like this (and there's only like 4 commits for 7 months of work)?.......I need my clue-bat
 
Not the first time that a mysterious bug originated from that specific file, but I didn't know it could do the thing it was doing
Now I'm getting UnableToLoadProxyFactoryFactoryFactoryFactoryFactoryException, a full 100 ms later than my last crash. Progress.
 
@PaulMcG Good to know. Seems like I should take another look at pyparsing's internals... always learning something new.
 
2:44 PM
My problems suddenly seem irrelevant and miniscule :D
 
@wim What about foo(int=0)?
 
@LinkBerest at least it's in git
 
Some candidates:
http://www.maleagrubb.com/rere/ (last released Nov 2014)
https://github.com/rooney/oprex (last released June 2016)
https://github.com/HelloChatterbox/auto_regex (bits still wet, updated 6 days ago)
 
@JossieCalderon What about it? That will give you a kwargs whose key is the string "int", which is not an integer.
 
@PaulMcG nice. the first one looks closest to what I had in mind.
 
2:53 PM
@AndrasDeak lol, a professor wanted me to help with their code a few years ago and when I asked "do you use git or a different version control?" they said "oh, I just save a filename.py.todaysdate in the folder whenever I make a change"
 
you did say "professor"
 
Thus teaching me the lesson: be careful of academics asking for help with their code ;)
 
as an academic who writes code, I concur
 
When I did my master's thesis (in Excel/VBA of all things), my advisor was surprised when I showed him the test cases and corresponding analytical solutions to confirm that the code was working as intended.
 
wim
@LinkBerest to be fair it's a rough approximation of what git does too :D
 
2:58 PM
He said most of his grad students are ready to declare victory once the code compiles successfully.
 
^^ that's what they said (it actually is too) :)
 
@Aran-Fey a little late to the party, but yeah. can confirm that at least cycles with a straight-forward solution seem to be no problem for pip or poetry.
 
@PaulMcG That doesn't surprise me, I make unit code templates (i.e. fork/clone this it has the test built-in) assignments and the #1 issue students give? My code works but doesn't pass your tests - the test must be broken
 
@Arne thanks for testing
 
no problem. it reminded me that I really like playing with this kind of infrastructure. day job has been a bit of a drag lately, so it was a welcome distraction
 
3:17 PM
Does Intellisense in VSCode not work for a Python's class data members?
 
kinda (it tries)
You can see all that it does in Visual studio's docs
 
aha
thats Visual Studio
not Visual Studio Code
in VScode it does work sometimes, especially when pressing ctrl + space
 
same rules for VS as VSCode when it comes to intellisense & python
 
@wim Finally I can use my heretofore-useless source-diving powers for profit.
I would have answered faster but I had to escape from DLL Hell first
Or, more accurately, get a hall pass out of DLL Hell, as I must now return to that dark place
 
what do I do if neither ctrl+c/z work in my ssh session?
 
3:28 PM
@Hakaishin for what?
 
If you're trying to exit the prompt, try typing "exit"
 
to close the running program
 
keeping the shell but killing what's running in it?
 
yes
 
Comedy answer: :wq!
 
3:29 PM
comedy laughter
 
I'm serious about exit though, that usually works when I find myself in a strange terminal
Hmm, I may have misunderstood the objective here
 
if he wanted to kill the shell he'd have to use ctrl+d, or killing the shell on "this" side
 
if you want the VSCode docs there here but they work the same way
 
Ok, makes sense now.
 
ctrl+c should send SIGINT, ctrl+z SIGSTOP (put the program to the background, suspended)
 
3:31 PM
I killed the cmd running the ssh. It was unsalvagable
@AndrasDeak yes
 
I don't suppose anything in superuser.com/questions/382164/… helps? It's all greek to me.
 
@Hakaishin consider using something like screen or tmux next time
it will persist between ssh sessions (great!) and you can kill that if all else fails (also great!)
you could also kill the process from outside screen
 
did you use ssh or ssh -t? you could try piping ctrl+z to kill $1 if its really stuck but that would be a weird use-case
 
ah right, I keep rediscovering and forgetting time after time about tmux and screen
 
I use screen constantly at work
 
3:34 PM
I occasionally use screen on hpc servers. Extra useful when you request an interactive job and have to wait 5 hours to be scheduled
 
@AndrasDeak and here I am saving my commands into sublime and having shortcuts to get running faster :P I should really use tmux more
 
wim
@Kevin that's the one. bpo31655 was created shortly after the OP so I'd wager Serhiy reacted to the question in the first place.
 
You've made a mark on the world :-)
 
what type of pc (like mac, linux, windows 7, etc.) do you all think the majority of users in this room is using right now?
 
3:51 PM
I'm going to say 60%/40% Linux/Windows
 
I'm using all three of those (if you substitue 7 for 10) - even using Linux on windows right now in two different ways :)
 
you mean right now at the same time?
@Kevin Isn't that a bit broad?
 
This tweet by llanga:

For once, I need to ask you to *hold off* testing a new #Python version: we identified a critical issue (see https://bugs.python.org/issue40924) with Python 3.9.0b2 after it was already built and tagged. That's why it's not announced yet.

Stay tuned for a hotfix 3.9.0b3 later tonight.
 
sshed into a Linux Server, using my wife's laptop (Apple, honestly to turn on a show for my kids more than program), windows 10 is my main desktop system, Debain sub-system on windows 10 (building a JSON dataclass/Parser), Ubuntu Virtual Machine crunching some numbers in background
 
@AnnZen Yes :-)
 
3:55 PM
Who's using windows xp in here?
 
also assuming you mean OS (operating system) over PC (which usually means the type of personal computer (laptop, desktop, server, etc)
 
@Kevin adjusts his turtleneck Hrmpf. sips tea through his hipster beard
 
@LinkBerest So that's the word for it
 
Jun 1 at 20:37, by LinkBerest
May 29 at 14:28, by LinkBerest
fyi - a fun statistic with Windows PCs is to calculate how many are still using XP (its +20% the last time I checked - 3 months ago)
 
Any smartphone users around here?
 
3:59 PM
@MisterMiyagi If you're a Mac user, I regret to inform you that you are a rounding error ;-) But at least you are in good company.
 
rounding error?
 
hoomans have their phones smart too? blimey
cbg bdw
 
ugh
 
@AnnZen As in, do any of us primarily do Python development on a smartphone? I don't think any of us qualify. If you're just asking whether any of us use the chat room's mobile interface, that number is somewhat higher.
@AnnZen Yeah. I reckon that my 60/40 estimate is accurate to within about +/-5%. If fewer than 5% of users are mac users, then I'm still mostly correct.
 
@roganjosh prior to our previous discussion for koalas, 1 thing is for certain, we can't use koalas blindly coming from pandas, things like applymap etc. doesnt work there are actually lot of features that doesnt work, the idea is good but one needs to understand why some functions doesnt work (related to spark architecture) eg: re-partitions etc.. :)
 
4:02 PM
@Kevin well, the Finns are kinda cool (if they exist), so me (if I exist) being lumped in the same category (if it exists) is acceptable. You may proceed.
 
@Kevin I would be interesting to see someone typing code on a smartphone! :p
 
I downloaded a Python REPL app onto my phone because I occasionally found myself needing to do math that the built-in calculator couldn't handle. Even small expressions were a pain to type out because my onscreen keyboard has letters, numbers, and special symbols on different screens
 
@AnnZen It is doable but not fun. The SO main page is more forgiving, the chat is very difficult to use from a mobile device.
 
I've done quick edits and pull requests (spelling error in documentation or change color of font in css) on my phone before. Also built unit tests on Repl.it assignments for students when stuck in boring departmental meetings.....I mean just the first thing ;)
I agree with Kevin though - those were "stuck, no other option" style events as it took forever to type out anything
 
There's probably some combination of keyboard layout / predictive text that would make it a smoother experience, but I don't know whether such a thing exists already, or is still waiting to be invented
Google tells me that you can get a virtual keyboard that puts letters/numbers/symbols in one window, but the keys are a bit small for my taste
 
4:13 PM
I don't know that there is really a market for it. I mean, I've only done this when I was stuck at airports (or otherwise travelling) and was just cleaning up some presentation stuff.
@Kevin must be for those young hipsters ;)
 
If the product is good enough, the market will spring up around it!
 
^^ heh, the tech startup siren song
 
Am I the only one showing up at meetings with a laptop?
 
You may be the only one showing up at meetings period.
 
4:16 PM
' "If I had asked people what they wanted, they would have said faster horses." -- Henry Ford' -- tech CEOs that don't do fact checking
 
I used to use a laptop, then moved to tablet, now I use a chromebook (which I would qualify as a laptop)
 
@PaulMcG Meetings are the best occasion to work uninterrupted.
 
Or get in the occasional nap.
 
You mean preparing a medium-term productivity boost.
 
^ just make sure you poll your fellows to prove your theory ("a study showed that ...")
 
4:22 PM
Insert joke here about a double blind study where the subject closes their blinds to improve nap quality
 
Do moderators consider moderating a job, or something they enjoy doing when they have some spare time?
 
@anky That's a bit frustrating. I recently found that the dask API is also wonky if you try to treat it as a regular df, and it looks like they have crossover between some of the core devs so it's a shame it couldn't be consistent
 
@AnnZen that would depend on the individual moderator but if you mean are they volunteers or employees that was touched upon recently
 
4:46 PM
@roganjosh absolutely, i assumed the same starting with this, however have to accept the way it is :/
 
well, Spark dataframes (and R & Scala) are immutable so the translation between pandas and Spark tends to get wonky on operations which depend on a mutable framework (meaning both directly translating the code and the fact that those who use Spark take a completely different approach than someone using pandas)
 
agreed,
pandas is the de facto standard (single-node) DataFrame implementation in Python, while Spark is the de facto standard for big data processing. With this package, you can:

Be immediately productive with Spark, with no learning curve, if you are already familiar with pandas.

Have a single codebase that works both with pandas (tests, smaller datasets) and with Spark (distributed datasets).
what i mean this the above is not entirely true..?
 
@LinkBerest Yeah, it's just that it's the stated aim
 
oh, I know but I have to port these kinda programs a lot and it still ends up with doing some mapreduce magic with jsons created from pandas (or sql or whatever) to Spark DF (datasets, RDDs) ends up happening a lot
i.e. great dream - all behind it - haven't seen it with anything yet :)
 
I start to wonder whether having a drop-in Pandas API is just folly
 
4:58 PM
"what it meant to be will eventually be a memory every time i tried so hard"- resorted to pyspark
 
Given that both projects seem to be stumbling. Given the partitioning, the API itself might not even make sense - how high-level does it need to get to be directly equivalent? The library might end up making more decisions than you're comfortable with
 
I do like that you can use pyspark.sql.functions.* to do a lot of that translation (last few years or so) so hopefully it will move that way (and fully admit that companies may not have upgraded their versions so I hit a lot of legacy issues)
 

« first day (3524 days earlier)      last day (1428 days later) »