« first day (3473 days earlier)      last day (1478 days later) » 

12:34 AM
Morning, everyone
I am trying to generate valid sensor data for www.footlocker.it
But I am getting invalid cookie _abck.
 
1:21 AM
Anyone know why curl gets stuck with United Airlines?
`curl -IL http://google.com` <- Works
`curl -IL http://united.com` <- Stuck
 
Server disconnection
 
@JossieCalderon do you know why?
 
The server may be blocking you. Are you calling them too much? Also, isn't it PHP and not Python? (I digress.)
 
1:38 AM
it's unix technically. Just the command line. But no. Try it yourself on the command line. I think you'll get the same results
 
@roganjosh i removed the slash and tested the code just now but still the same result
 
1:52 AM
@Johnston 301, 302 MOVED TEMPORARILY
Probably fixing the servers
 
 
3 hours later…
4:47 AM
Cabbage. Can anyone give me a good reason to use while not False instead of while True? Just to poke your brains. (I can't think of a reason)
 
@Legorooj Maybe you've done something devious with True or some other python internal?
 
@toonarmycaptain I'll clarify. Using standard python 3.7(.3), is there any reason to use while not False instead of while True?
 
5:04 AM
I wasn't meaning anything but standard. You can overwrite builtins such as print or open, you can mess with sys.modules to manually add packages you haven't installed, so, although I don't know how to do it, I see no reason why you couldn't mess with how True evaluates. But that's all I could think of.
Unless semantically, in the context of the code, while not False reads more clearly than while True, but again I can't think of a circumstance.
 
I can't think of a good reason to use while not False: either. Only silly reasons, like some weird code golf where you want the total code length to have a certain value. Or steganography, where you have a secret message encoded somehow in the source code.
In Python 2, you could assign any value you want to False or True. You can still change them in Python 3, but it's a bit trickier. For that matter, you can even change the value of literal integers!
 
@toonarmycaptain It appears you can theoretically modify True; import builtins; builtins.True = False. However, it raises a SyntaxError, so it's not possible. It's because True is both a python keyword and an inbuilt object, the former meaning it's impossible to do in py3
 
@Legorooj Fair enough.
 
?? @PM2Ring how? In python3 it's nigh on impossible without editing the source code.
 
If your 'T' button is broken
 
5:14 AM
@toonarmycaptain it appears you can do True.bit_length and other standard integer operations, but you can't place the dot before the keyword.
@JossieCalderon groan.
 
@JossieCalderon You know what, normally I'd say that's absurd, but if one needed to and never went back to change it, I absolutely believe it, having done similarly silly things when I only had a borked keyboard.
So can you mess with True. to mess with it's boolean evaluation?
eg mess with True.__bool__
 
@toonarmycaptain `>>> def my_bool(self):
return False

>>> True.__bool__ = my_bool
Traceback (most recent call last):
File "<pyshell#4>", line 1, in <module>
True.__bool__ = my_bool
AttributeError: 'bool' object attribute '__bool__' is read-only
>>> `
 
2
A: What is the difference (if any) between "not true" and "false"?

GuillLet me try to clarify the difference. Lets start by assigning a value of -1 to false, and +1 to true, and 0 to something "in between". When someone says something is false, it has only a value of -1. When someone says something is not true, it can have a value not only of -1, but also of 0. The...

But that doesn't work in Python because False == 0 and True != 0
 
@Legorooj Now your challenge is to make it not read-only ;)
 
@Legorooj Using the ctypes module. See this answer by abarnert: stackoverflow.com/a/49272080/4014959 which illustrates ways to hack various things like that.
 
5:23 AM
@toonarmycaptain @PM2Ring as much as that would be fun, I don't have the time. PyInstaller is too much work.
 
Hey, before I sign off, I want to say I'm super proud of myself, as I figured out (with the help of St Ackoverflow, of course) how to patch a module imported inside a function, that won't exist during testing. patch sys.modules, and use unittest.mock.MagicMockto make a mock module xD
 
@toonarmycaptain Congratulations. Today, I got my program to work. :)
 
Cheers, congrats :)
Much better than having the test create the dir, __init__, and module.py file, as I'm mocking the value already.
 
5:41 AM
@toonarmycaptain that's a different approach to testing then I've used before... But I've never written code/a library that needs to run against a module.
 
6:03 AM
@Legorooj I've got a user settings file in the application that gets created/modified at runtime, so it doesn't exist in testing. I'll probably switch it out for a json file loaded at runtime, but at the moment it's a .py file so I can from settings import my_app_settings. I wrote this a long time ago when I knew less than I know now.
You could also use it with any library that might not be present, say if your code uses a package installed at runtime (the example I saw used an azure something or other). Or maybe the dependency you're using is huge and you don't want to install it fresh for every test.
anyway, rhubarb.
 
6:32 AM
Lokes like this bounty stackoverflow.com/questions/61135835/… is gonna end without answers in 2 days :(
 
 
1 hour later…
7:35 AM
cbg
@Kevin played someone last night on 2 life that played a murderous rider... ooopsies
not a lot of sympathy though as they had a hydra's growth on something that got up to 300+ - think they were waiting for a trample
that game though was completely theirs if they hadn't of played that though
 
7:48 AM
@wim the description on pypi is missing later part of the last sentence. "(...) has been compressed into a .zip"
 
near-total-dupe, other than polishing the regex and a df.pop() call. this The main issue was simply How to add multiple columns to pandas dataframe in one assignment, the left-hand side df['number','name'] = ... was meaningless
 
8:48 AM
@smci Closed
 
9:30 AM
was wondering where my head phones were...
just gone and bloomin' well sat on 'em and broke 'em
let's just say "bloomin'" isn't what I uttered to say the least
 
@IsraelObanijesu please show the template that you're using to trigger the request
@JonClements :( 10% is the new 100% volume
 
my brother's going to be annoyed for sure... they were decent bose jobbies
thankfully - he won't be able to be annoyed in person for at least another 3 weeks - so :)
 
Every cloud, hey?
 
indeed
 
hi??
 
9:43 AM
hello
 
10:23 AM
@JonClements Shards are the new intact
 
@smci I'll remember next time I break a rather expensive present
got a google home thingy sitting in its box... my brother thought it'd be nice as his house is massively automated... it's useful, but no way yet am I going to have one of 'em in my place
I'm quite (even being a yellow puppy) capable of using light switches and such
however, if "Okay Google, make a cup of tea appear on my desk" would actually deliver me a cuppa, I'd be all in :)
 
@JonClements at what cost?!
 
10:40 AM
I'm standing my ground on being nice to the machines so they may allow me to serve 'em later :)
 
It's fun working a day job where I insist we should be gathering data on everything and then go back to my cave to do some wall paintings and stuff
 
as long as you're not painting with blood and engraving with flint or something
 
<coughs>
 
wtf... shared play list on a family account... it's gone from Metallica to Justin Beiber...
when this isolation stuff is over, I'm coming for you nephew...
 
@JonClements Tell them it's all the rage in Japan
 
10:45 AM
skipped that track and now onto disney tunes
must be the nieces stuff - but actually, I love disney sound tracks, so all cool in the pool
 
Oh, it really has spiraled. Abort the playlist. Abort!
 
klaxons are sounding... run run run!
@roganjosh hate to admit but "Love Yourself" actually isn't a bad Beiber song...
 
It is... passable.
 
I like the lyrics
 
@JonClements if you start getting annoyed just let it go
 
10:53 AM
@AndrasDeak sure... just going to add "my touch" to that playlist :)
can't see any Queen on there - so that's gotta go on
bit of GnR and some more Metallica and Paul Simon added...
 
Add some Mongolian throat singing to build their character
 
Counter the Bieber with a sprawling epic like Rainbow - Stargazer
 
lyrics are great... I love the: "I can't afford to have a lot of money"
it's up there with "they're sharing a drink they call loneliness but it's better than drinking alone"
 
Oh, by the end of Rainbow, the lyrics remind me of my old History essays. One giant tautology, but with more "my eyes are bleeding" :P
@JonClements reminds me of the last verse of Peter Gabriel - Solsbury Hill
 
Hello,
Happy Easter to all.
 
11:05 AM
hi Chris - haven't we already done this?
 
:)
Yes
 
@roganjosh favourite PG track is "I Grieve"
 
Do you think this is just a toy project? stackoverflow.com/questions/61301724/…
@ChrisP I think Easter is over
 
Does someone mind helping me with a work matter?
 
nowPlayingSongTitle = Label(playerframe,text='Τίτλος τραγουδιού: ',anchor=NW,width=playerframe.winfo_screenwidth()-nowplayingImage.size[0]-20-45)

I want width unit to be in pixels.
But now it's in columns.
 
11:07 AM
Or is this a calendar shift thing again?
 
I have to ask my future employer for an extension for my assessment, but it's due today
 
Ah, Greece, could be it
 
@PrashinJeevaganth and err... that seems to be your priority - but why would it be anyone elses?
 
@ChrisP have you googled stuff like "tkinter label width pixels"?
 
Yes
width=
The width of the label. If the label displays text, the size is given in text units. If the label displays an image, the size is given in pixels (or screen units). If the size is set to 0, or omitted, it is calculated based on the label contents. (width/Width)
 
11:09 AM
@JonClements I requested for an extension yesterday, but as its the weekends now, they're unlikely to respond on time. Given this, should I just extend it or should I just submit whatever I have now
 
Setting a widget's size in pixels sounds like a bad idea. Why not just let it grow to whatever size it requires?
 
The deadline was originally set by me, and I didn't manage to make it due to school
 
In a couple of days it'll be the 42nd anniversary of the passing of Sandy Denny. Who Knows Where the Time Goes...
 
@PrashinJeevaganth it's not something we can really help you with
 
@Aran-Fey
That's good idea.
 
11:11 AM
@JonClements Just asking what's the industry's policy for these things, since y'all are actually working
 
The next Label should be right to it.
I can use .place() method.
 
@PrashinJeevaganth Not really. It will vary wildly by country and position, etc.
 
to place the next Label right as most as possible
 
place() works with pixels, doesn't it? Forget that rubbish and use pack() and/or grid() instead
 
@Aran-Fey Yes.
I am not familiar to python.
Any good tutorials to python Class - Method - Tkinker - Tuples - Arrays - Lists - Image .....?
 
11:16 AM
@PrashinJeevaganth I'll give you some frank advice... if you're asking for an extension of an interview or something... they're just going to be immediately turned off. Unless you've got some feeling it might happen and they're that interested to accept delays - it's not going to happen.
 
For tkinter, my go-to reference is effbot. For everything else, there's the official python tutorial
 
@PrashinJeevaganth I personally when I've people do expect them to turn up on time and demonstrate skills... the first is just a matter of courtesy
the second is how it works out... but unless I was really, really, really wanting to see a candidate for a position, as soon as you say you want to delay or I can see you asking for help online etc... whatever... you're almost 100% aren't going to get that job
 
@JonClements Yes I agree it was a lot of miscommunication here. They did state in the email that they're recruiting on a rolling basis and I'm free to ask for extension. Will inform people when their slots are filled
 
@ChrisP What Aran-Fey said. .place is generally a pain, especially for complicated GUIs. Use the other layout methods, .pack or .grid, instead. And never mix layout methods inside a parent widget (window or frame).
 
11:22 AM
Hammered
 
I guess that means its equally bad to ask for extension(last minute) and submitting crappish RESTful API on time then
 
@PrashinJeevaganth we don't do job advice here - this is my personal opinion, but be wary, if they're willing to do that - then it's something I'd be very cautious about
 
@JonClements I see, I guess I'm just being optimistic
 
get yourself a decent CV and a show case if you can - this one sounds like one I'd never go for if I was you - but ultimately it's up to you to decide - personally, I wouldn't spend any more time on it
having said that, I can't remember the last time I actually get interviewed for a job vs being the interviewer
 
I'm out of options and trying to do the assignment only because I couldn't do the interviews for other jobs
 
11:27 AM
@PrashinJeevaganth I actually misread some set notation for one of my positions and so subsequently ended up answering the wrong question. Still got the position by talking through it. It was a week-long task, too, not some whiteboard interview
 
@roganjosh Yes that is exactly the same kind of interview I have(the mini-project kind), but the deadline was decided by me, not them
 
Again, the advice can only be personal and I absolve all liabilities; I'd submit what you have and explain that you underestimated the time required. Everyone underestimates delivery time. Even if you add 10% to your initial estimate, maybe you made your estimate based on the knowledge that you were going to build contingency in, in the first place, and.... <recursion limit reached>
 
@JonClements Paul Simon has posted a few songs on YouTube in the last couple of weeks. His voice is a bit croaky these days, but he still knows how to deliver a song. Also see Joan Baez & Carole King. And Norah Jones has been doing mini-concerts too.
 
@PM2Ring Got loads of Carole King - don't make me get up in the loft when I can just click a few buttons :)
The Tapestry album is legend though
 
11:42 AM
@JonClements :) Go to YouTube & watch her covid19 isolation version of So Far Away. Her voice is slightly scratchy, but her piano playing is sublime.
 
@PM2Ring one of my favourite tracks - not sure I'd want to listen to that
 
That's reminded me of the blazing performance from Aretha Franklin at the honours for Carole King
 
also quite a fan of Carly Simon
 
@JonClements Fair enough. She can still sing well. It won't be a disappointment. FWIW, she never thought of herself as a singer. She'd been a professional songwriter for over a decade before she was convinced to do Tapestry.
@JonClements Me too. Let me find you one of my favourites...
 
11:49 AM
if my memory serves, Goffin?
he did most of the lyrics I think
 
@JonClements Yes. Gerry.
 
just looked it up on a search engine... glad at least my memory dodgy as it is didn't fail me there :)
Gerald Goffin (February 11, 1939 – June 19, 2014) was an American lyricist. Collaborating initially with his first wife, Carole King, he co-wrote many international pop hits of the early and mid-1960s, including the US No.1 hits "Will You Love Me Tomorrow", "Take Good Care of My Baby", "The Loco-Motion", and "Go Away Little Girl". It was later said of Goffin that his gift was "to find words that expressed what many young people were feeling but were unable to articulate."After he and King divorced, Goffin wrote with other composers, including Barry Goldberg and Michael Masser, with whom he wrote...
 
Here's Carly doing the song which was her 1st hit in Australia. A Kris Kristofferson number, originally written for Rita Coolidge. I've Got To Have You, live at Grand Central Station, 1995.
 
Shh, the off-topic police will come and get you... musically... ;-)
 
11:55 AM
@PM2Ring nice song
kinda of reminded of "The Carpenters" listening to it
 
@smci let's be mindful here that you're looking at a question from 2017 and that's 2 cv-pls for the same user. I don't think action is required for this particular question. As for the dupe one, I need to think about it a bit more before voting
 
one of my favs
 
Ok, for the second dupe call (I'm glad you raised the first that PM hammered) I think the function is doing too much lifting for it to be usefully duped @smci
 
and there's always rainy days and mondays @PM2Ring :p
 
@JonClements One of many great songs of that era written by Paul Williams.
 
12:04 PM
completely forgotten that a popular track by the Fugees was Roberta Flack: youtube.com/watch?v=l2n167F0eBc
 
cbg all!
 
Some more nice vocal harmonies here: a couple of young ladies & their dads covering CSN's Suite Judy Blue Eyes
 
How do you change in VS Code the autoformat settings for Python? It is so annoying when the linter and the autoformat don't conform to the same spec.
 
@JohnnyApplesauce What extensions do you have?
I use Python Indent and the main Python extension and don't have issues. Do you have a separate linter?
 
1:03 PM
@PM2Ring Thanks
 
1:19 PM
Code Runner and Python, yes
Linter is pycodestyle
 
1:46 PM
Poll: Does hearing "TUI" make you think "the heck is that", "text user interface", or "touch user interface"?
 
I always thought it meant terminal user interface, so the second. Only seen it in gdb --tui
there's also a travel agency by that name...
 
playerframe.winfo_screenwidth() returns 1024 and not the width of the widget.
 
Dotting the i's, crossing the t's and putting "u" in the middle. Grrr, advertising getting real estate in my brain
 
Ha! The likelyhood of someone confusing my "TUI" for a travel agency is too low for me to worry about, I think
I'll probably play it safe and go with "TextUI" though
 
Any help?
 
1:53 PM
yeah, it returns the screen width
If memory serves, you're looking for winfo_width()
 
`playerframe.update()
print(playerframe.winfo_width())`
Prints 1
But in that line of code i have not call the App. myapp = Application(master=root)
the
 
@ChrisP can you please start putting your sentences on a single line?
you can edit/delete messages in chat for two minutes
 
Better now.
 
yes, thank you
 
@ChrisP not only that, but this will now be the 3rd time I'm going to remind you of the chat formatting guide for code in less than 24 hours. You've done again what we established yesterday doesn't work
 
1:59 PM
Hmmm my use <code> `.....`but some times the code formats and some others not.
 
Oh, I missed that. @ChrisP please practice in the sandbox. If your next code block here isn't formatted well you'll be kicked.
 
@ChrisP you cannot mix code and general text. The guide shows everything else you need to know. And if you think I'm being a bit trivial about it for small snippets, be mindful that it gives me important meta-info about your willingness to follow suggestions from room members
 
2:17 PM
@roganjosh you asked for the template that im using to trigger the request, im sorry but i don't know anything about python so i don't understand, basically, i just run the code via cmd and pass the url in the browser, so i don't know what template means in this case
 
@IsraelObanijesu So you're just trying to copy code you find online until it starts doing what you want?
 
@IsraelObanijesu oops, sorry! I knew it was Flask and assumed that you were triggering the GET request with a HTML template. Let me look again
 
@JonClements Reminds me of Jerry Coffin from the C++ Lounge
 
@roganjosh okay
 
2:33 PM
@IsraelObanijesu on revisiting the question, I think you want something like this to get the parameters from your GET request and not set it up with <string:img>
Ugh, my terminology is going to be so crap here, apologies. I can only visualise the approach. You want your API to accept a named parameter like /imagelookup/?lookup_url= rather than just concatenating it to the URL
 
@roganjosh okay, i will try that now
 
It looks like you're stacking multiple GET requests, basically
 
2:47 PM
okay, it's working now, thanks
 
Great :)
And I didn't even need to start looking up the technical terms for what I was talking about. +1 for my day :)
 
nice (:
 
3:16 PM
Does anyone here have experience with turtle graphics in jupyter notebook ? I'v tried it all, turtle.bye() , turtle.done() , exitonclick() .. everything and I always get some error in my notebook.
Sometimes I get an error every other time I run the program
Here's the code:
 
@domocar1 Please see the room rules in regards to long blocks of code - please host them off-site and link to it here. Also, if you are posting code in future, please see the formatting guide
 
 
2 hours later…
5:03 PM
@JonClements hi, sorry to bother you, would it be possible to thaw chat.stackoverflow.com/rooms/100286/jeeves-playground?
 
@Tiffany Is that something one of the room owners could do? (genuinely asking, I don't really know the RO privs and capabilities)
 
No, needs a mod. Then again if a RO raises a chat flag the room usually gets unfrozen eventually.
 
@PaulMcG to my knowledge, no, because one of the ROs asked Jon a while back to thaw it out
slowly trying to rebuild a chat bot
 
In my continuing efforts to provide a safe eval libary, I pushed out version 0.2.0 of plusminus this morning. Now including set expressions and operations. Please hammer on it at ptmcg.pythonanywhere.com/plusminus - don't be gentle.
7
 
What is this
 
5:09 PM
It is module for taking user inputs and doing eval without the security risks of doing Python's eval().
That website is just a simple wrapper around a REPL, with some Javascripted buttons to make it easier to enter the Unicode operators.
Note - it is not a Python expression evaluator. It is an arithmetic and logical expression evaluator, and is not constrained to operators as defined in Python. For instance, you can do |4 - 12| and get 8, you can do 3! and get 6. Click on the Help, Examples, and Code buttons for more info.
Or visit the github repo.
 
user6276743
5:47 PM
Is there any way for the base class to call it's own method that has been overriden by the child class? Seems weird that the child class can still call it using super(), but base class cannot access it's own method using self.method.
 
__class__.method(self)
 
user6276743
Thanks, that works.
 
6:16 PM
This might be an actual place to define method as __method, not overridable in subclasses.
 
user6276743
Yes, I'm on the tutorial page which also describes name mangling.
 
6:35 PM
@Tiffany been afk for a bit - it's unfrozen now... use wisely and all that
 
6:45 PM
thanks!
 
 
2 hours later…
9:13 PM
Hello, I am having a strange issue with python re.split module, can someone please help. I am trying to split a url into 2 parts base url and path after base url. I have the following regex which seems to work:

https://regex101.com/r/1MebfR/1
on python I am doing the following:
pattern = "^(.*\/\/.+?\/)"
z = "https://www.google.com/search?client=firefox-b-d"
re.split(pattern, z)

Result I am getting is: ['', 'https://www.google.com/', 'search?client=firefox-b-d']
I dont understand why it is creating 3 splits and why the first match is an empty string? any idea?
 
Because you're splitting on https://www.google.com. It's the same thing as doing 'ab'.split('a'); the result is ['', 'b'] because there's nothing before the "a" and a "b" after it
option 1: use urllib.parse.urlparse
option 2: use re.match(r"(.*\/\/.+?\/)(.*)", z).groups()
 
Oh okay I think I understand the split thing your saying
i would use urllib.parse but I dont think it will work if a url is something like "//google.com"
thanks for option 2, I will test it out now
 
Is "//google.com" a valid URL?
 
no but some websites store href like that
 
yeah, a relative one
 
9:22 PM
ah
 
>>> urlparse('//google.com/test')
ParseResult(scheme='', netloc='google.com', path='/test', params='', query='', fragment='')
^ works fine
 
Ah yes I tried that before, and I remember why I didnt want that
But the thing is I don't like how it splits it out into path, params, query.. etc.

I just want to split it into base url and path, and then store just the path.
also the data I am viewing will varry, some of the data has a full url, and some of the data is just a path url, so trying to unify it
When i say I just want to store the path, what I mean is I just want to store everything after the base url (i.e. after the first '/')
 
I think re.split(r'(?=/[^/])', url) should do that, at least in the newer python versions that can actually re.split on empty matches
never mind, it doesn't do that
 
9:52 PM
Does anyone know how python supports arbitrary lengthed integers? I thought it's using C struct. But there isn't such this thing in C as I know by default.
 
@Aran-Fey Thanks for trying, its okay, your option 2 above seems like it does the job for now, I had to add a check before I can use .groups though, as it raises and error if no match found
 
 
1 hour later…
11:22 PM
@roganjosh, this one is needs details/clarity, also no MCVE. An apply calling three nested functions, doesn't show which triggered the error, doesn't show the input data. Btw, pandas has a native rank() function (and that's a one-liner) so this is all furthermore unnecessary. It's from 2017 and didn't get any answers, unlikely to now. So many reasons to close.
...That OP's code only appears to a do a lot, because they reinvent the pandas wheel and avoid using standard idioms. I've never seen a triply-nested apply function, ever.
 

« first day (3473 days earlier)      last day (1478 days later) »