« first day (3551 days earlier)      last day (1380 days later) » 

1:38 AM
Also apparently we will have a naked eye visible comet (en.wikipedia.org/wiki/C/2020_F3_(NEOWISE) this year after all, after being disappointed by C/2020_F8_(SWAN)
 
 
4 hours later…
5:22 AM
...it occurs to me that sqlite3 isn't the best for learning how to do a sql database, since apparently the datatypes aren't even enforced?!
 
5:56 AM
@toonarmycaptain we, um, covered this :P
Jun 23 at 21:04, by roganjosh
The "low-hanging-fruit" is that SQLite doesn't even care about the type definitions you place on columns; shove a datetime into a float column; it won't care. I wanna try to be more sophisticated first :P
 
6:43 AM
why the canvas's scale factor doesn't work to resize the image in the following code snippet ->>> image = tk.PhotoImage(file = 'F:/Pinku/Scrap/NewTheme.png', height = 400, width = 400)
>>> img = can.create_image(0,0, anchor = tk.NW, image = image)
>>> can.scale(img, 0,0, 100, 100)
>>> can.scale(img, 4, 4, 0.5, 0.5)
>>> #can.scale not working for factors
 
7:39 AM
Hi guys, any one can help me for downloading logfiles in python?
 
@Abhijeet.py what's can?
@CodeGirl I don't quite follow. In how far is downloading logfiles different from just downloading files? are you trying to do that?
 
8:15 AM
@AndrasDeak Thanks, I will.
 
8:36 AM
@mistermiyagi : yes that is my problem and i dont know how to solve it!
 
how is a different than b. yes :D
 
9:02 AM
@CodeGirl Did you check out How do I download a file over HTTP using Python? or similar resources?
 
 
2 hours later…
11:00 AM
recbg
@Abhijeet.py please compare your code with the documentation: effbot.org/tkinterbook/canvas.htm#Tkinter.Canvas.scale-method
 
11:20 AM
how is it 2020 and firefox still does per default first an http request: superuser.com/questions/1101628/… This is outrages
 
11:36 AM
@Hakaishin I don't see that behaviour, but I have "https everywhere". Then again I'm pretty sure it did that on its own
 
@AndrasDeak type random url like: werlöqwekröhq.com/ copy paste it into something and get: "http://www.werlöqwekröhq.com/"
 
@Hakaishin I'm not sure that looking up a nonexistent URL means anything
 
Why not, it shows you what firefox searches for
websites which exist don't work. Because most proper websites do an automatic redirect to https, but that is not what firefox initialy requested
and I noticed, because our intern stuff is not proper :P Gotta setup a redirect to https. But then again, I feel like this should be a simple setting changeable in firefox, but I guess it isn't
 
@Hakaishin but the question you linked brings up superuser.com as an example. Which doesn't repro.
 
11:51 AM
doesn't repro?
 
I end up on https rather than http, whether or not http anywhere is enabled
 
Because most proper websites do an automatic redirect to https, but that is not what firefox initialy requested
 
How can I contact a moderator on Stack overflow?
 
@Hakaishin if they ever forced that you wouldn't be able to get to "localhost"
@Cherona custom flag the post in question
 
@LinkBerest well I'd rather force https everywhere and make an exception for localhost than the other way around. Seems like the internet is bigger than localhost, so the exception should be on the thing that is smaller
Not having the default gateway and the dhcp server be the same machine is weird. Or atleast needs some getting used to
 
12:01 PM
@Hakaishin "initially"?
 
when you type foo.bar into ff it searched for "http://foo.bar". Most servers are configured to redirect you to "https://foo.bar". This happens without you noticing. But as said "most", not all
 
there are two different things here
 
@Hakaishin not just localhost - any local ip address (yes they are used a lot internally at some places)
 
@AndrasDeak And I asked "doesn't repro?" Meaning i don't understand what you mean when with the sentence: "Which doesn't repro." What do you mean with that?
 
12:07 PM
your point being?
 
OP says "I open superuser.com and get http". I'm saying "I open superuser.com and get https". I.e. I cannot reproduce their problem. I.e. no repro.
I don't see how many ways more than one these words can be understood.
 
aaaah :D Ok
I didn't read the question. I rarely read questions on the internet, mostly only answers. Ain't nobody got time for that
 
...
 
and 95% of the time my search query and google are good enough to bring me to the right question, without having to have read it
@AndrasDeak maybe you can't repro, because superuser now has the redirect, but didn't have it at the time he asked
 
actually, I can repro for superuser.com, it's just not obvious what to look for
 
12:11 PM
@Hakaishin you posted a Q&A from 2016 and complained about redirect in 2020. You're not making it easy at all, are you?
 
Also a lot of gov sites outer portals are still http and not changing anytime soon
 
Despite governments' conviction that securing the privacy of the people is crucial :P
 
Lol yeah but gotta use what they give us so shrug
 
12:53 PM
Is RuntimeWarning: invalid value encountered in double_scalars specific to NumPy?
Looking at a question by a new user that just doesn't add up...
 
@MisterMiyagi I think so
division by zero or nan or similar in a ufunc, I think
>>> import numpy as np
>>> 0/np.float64(0)
__main__:1: RuntimeWarning: invalid value encountered in double_scalars
nan
 
1:08 PM
Thanks for clearing this up. Some MCVEs are more minimal than others...
 
1:22 PM
can i ask a question here about the python statement i am facing problem with
 
@sravs Sure. Please just take the time to read through the room rules first.
 
1:47 PM
yo guys any of you done the mega flask tutorial? going through it now and after implementing the registration part of the program it doesn't seem to be adding anything to the database when i register through the form but if i go through the python shell it adds just fine
NVM was being an idiot sorry guys lol
 
 
1 hour later…
3:16 PM
What's the way to say if potential_key not in dictio: add potential_key?
 
Well, you can use that logic or you can use dict.setdefault...
 
@JonClements doesn't that override the original value if present?
 
nope
 
Ah, no, that's why the name is terrible. Sorry.
it's basically a defaultdict's getter behaviour
 
3:35 PM
@roganjosh Yes. But I hadn't tried it yet. And I forgot, lol. Apparently you can put a CHECK on a column with whatever function you like, but I haven't tried this out yet.
 
Subprocess problem
If I do "curl --version" in my environment, it runs correctly
But look at this error
File "/usr/lib/python3.7/subprocess.py", line 1522, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'curl --version': 'curl --version'
 
@JohnnyApplesauce 1. no MCVE, 2. how much effort did you spend looking it up when I told you to look it up?
 
The offending line: subprocess.run(["curl --version"], stdout=subprocess.PIPE).stdout
Andras, you saw the "typing."
 
@JohnnyApplesauce the first arg is a list for a reason
if I look up the docs and see the example are clear there you'll be in trouble
 
Oh! Is it like excevp?
Fascinating
 
3:52 PM
@PrashanthSams please don't ask for help here with fresh questions on the main site as per our rules. Additionally, pinging random people with your problem is generally considered rude.
 
@AndrasDeak ah okay, sry I haven't read the rules.
 
4:22 PM
Website: we list all of our inventory in alphabetical order, but restrict search only to logged in users. Now you'll have to make an account >:-)
Me, already composing a binary search script: you underestimate my power.
(No, ctrl-f wouldn't work, because the results are spread out across 1000 pages)
 
@Kevin Distracting their data grabbing schemes with a fake account is too cruel, I take it?
 
Even making a fake account would go against my principles
 
4:42 PM
Understandable
 
I have a small amount of sympathy for {website} because they make no secret of the fact that their servers are barely capable of serving the current userbase, so it's hard to justify additional features to anonymous visitors. On the other hand, they've got less than 100k items in their inventory with maybe one new entry per day, so how hard would it be to index the whole thing during non-peak hours?
That question is only semi-rhetorical. If they only wanted search that matched the beginning of titles, then a trie would be embarrassingly efficient. I'm not sure how efficiently they could do substring searches.
 
@toonarmycaptain check constraints work but are not case sensitive
@Kevin substring searches can be horrible to setup (efficiently) if anything beyond a basic LIKE is needed
 
What kind of "beyond a basic LIKE" features do you have in mind?
 
4:57 PM
If you don't have easily predictable word boundaries
Or add some kinda of auto-spell things for searchers
If it's just ngrams, it's usually okay
 
Hmm, I see
 
1. Happens when dealing with multiple languages pretty often
 
@LinkBerest What do you mean? Or do you mean that you can use check rather than CHECK? I'm new to using SQL, but I'm presuming I'll be using what looks like a convention to all caps SQL keywords/commands.
 
I mean with SQLITE a check against say "comm" will match "Comm", "COmm", etc
 
The website has results from languages that don't use the Latin alphabet and/or don't conventionally use spaces, so #1 certainly applies
 
5:02 PM
^ so yeah :) ;)
 
@LinkBerest Ah, right. But (based on a perusal of a SO Q late last night, no experiment) assuming you don't have columns named name, NAME, and NaMe you're good, yes? And if you're just requiring string text under a certain length, that won't be an issue either, methinks?
 
Yep, just something to be aware of
If you have columns named like that I would strip you of all access to my database mind you ;)
 
@LinkBerest Cheers :) although if I ever have identical column/table names differentiated only by some casing, that would seem...like a bad idea?
 
Heh. See above
 
5:23 PM
Oh, so more like a BAD idea :p
 
5:35 PM
damn the bee episode in black mirror is so crazy
 
6:08 PM
Does anyone here run their unittests in vscode? I'm having trouble finding the 3 tests that failed in my list of 400 tests, is there no option to display only failed tests?
 
 
1 hour later…
7:24 PM
So, I've seen this regex re.sub thing where they use a lambda for the replacment character. I just don't get what arg.group() of lambda arg: stuff does or is, in the context of being the replacement argument re.sub. The 'stuff' part of the lambda is some stuff they'd do with arg.group() WHAT DOES ARGS.GROUP() DO?
 
@theX with arg, do you mean the match?
 
yea
the lambda, right?
the lambda argument
 
so far so good. And the winner is chocolate cake xD
 
@theX I have no idea what you are asking.
 
Man programming for fun is... well fun :D Next I want to have the ability to specify parents and compositions like show all eaten fruits in the last x days and all meals which had following ingredient
 
7:41 PM
If I get a FileNotFoundError from a script that is run in the same directory as the file, pasted from clipboard to ensure the name is spelled right, what can I infer?
 
check cwd
print(os.getcwd())
 
@JohnnyApplesauce a path is always resolved according to the current working directory (what Hakaishin said). If you want the file to be found relative to the script position, you have to find the absolute file path
 
Did you forget to add the file extension?
 
...crazy man
How do you change the wd in VSCode?
 
don't, you want your script to work nicely no matter from where it is executed, right?
 
7:45 PM
I want it to work in the directory that the file is in
 
well, then you have to navigate your shell or wherever the script is executed from into that directory
# or do this:
from pathlib import Path
HERE = Path(__file__).parent
with open(HERE / "my_file.txt") as fp:
  # do stuff with the file
 
np
 
Use path.open() instead of open(path) if you need your code to work in 3.5
 
@MisterMiyagi Something like x = re.sub(r'/2.*?/1', lambda x: re.sub(r'\s+', '_', x.group()), x)
I want some explanation on the x.group()
 
8:03 PM
@theX the callable gets passed match objects. Have you looked at the match objects' documentation?
try with a lambda x: print(f'I got {type(x)}, {repr(x)}') or similar and a simpler pattern and string
 
8:16 PM
@theX did you actually check the link I gave you?
 
@MisterMiyagi ugh, I missed that
 
Ooh, sorry, I missed that too
@MisterMiyagi Thank you very much!
 
 
3 hours later…
11:01 PM
@abstractmethod
def __init__(self, filename):
     [15 lines of code]
Just found this code in a github repo. People are discovering completely new ways of making bad code
 

« first day (3551 days earlier)      last day (1380 days later) »