« first day (3559 days earlier)      last day (1614 days later) » 
00:00 - 17:0017:00 - 00:00

00:30
@msulol You will need both
 
1 hour later…
01:50
@AndrasDeak I remember very distinctly going to an air show as a kid and the field we were in had such a fence. You could hold on to it and it felt like a balloon blowing up and then popping, repeatedly, in your upper arm (best description I can give for the sensation). They don't necessarily have to zap you properly, it's enough of a deterrent... unless you're a kid with peer pressure :P
02:05
Which, in hindsight was probably a cycle of it building up a spasm and then discharging it on a short cycle
 
1 hour later…
03:06
@AndrasDeak Wow. I just spent a good part of my evening sifting through everything, and just... wow. Poor woman.
New mantra: "The community is not the company. The company is not the community."
@MattDMo ain't that the truth
on a different note - why do people keep trying to draw me into the weirdest arguments? (I seriously have no idea what all those pings were about and don't really want to link them).
 
2 hours later…
 
1 hour later…
06:44
dpaste.com/1K0MG9V long message chat box is not allowing me to post
06:56
I just need the path of that docx2pdf (It looks like "docx2pdf" is actually docx2pdf.exe just like we got python some_script.py is actually python.exe) in "usage: docx2pdf [-h] [--keep-active] [--version] input [output]"(from the docs)
07:47
^ closed
08:07
dpaste.com/18RWYY3 what am I missing here?
That's easily google-able. There are extensive answers covering that specific error
741
Q: Relative imports in Python 3

John Smith OptionalI want to import a function from another file in the same directory. Sometimes it works for me with from .mymodule import myfunction but sometimes I get a: SystemError: Parent module '' not loaded, cannot perform relative import Sometimes it works with from mymodule import myfunction, but som...

I think my package matches the answer
my package name is python
And from admin import isUserAdmin, runAsAdmin? Does that work?
from admin import isUserAdmin, runAsAdmin
ModuleNotFoundError: No module named 'admin'
I even tried from . import admin
Offtopic but highly interesting, if you're into that sort of thing: SpaceExploration: Mars versus the poles of Mercury, wrt colonization
08:19
@VisheshMangla How do you run this? Do you use the -m switch as shown in the linked Q&A?
hmm, I 'm running a python script from C#
that script's name is backend.py
I can show a picture of working dir
-m ok let me try that
This Q&A may be relevant for brevity.
that might be the issue, thanks @MisterMiyagi
In general, avoid having scripts inside your package. If you really have to, prefer to use a console_scripts entry_point instead.
@AndrasDeak I suggest that's worth adding explicitly to the guide.
@JonClements JonClements can you give me write permissions as promised back in May?
@Kevin How did the conversation get around to that...
08:32
stackoverflow.com/questions/19672352/… Hey, why aren't the answers updated, I wasted whole bunch of time on the first answer and after clearing that error by copying from two functions to backend.py I saw it was written in python2
shouldn't there be an outdated flag
@VisheshMangla That's because SO lives from volunteer contributions. Guess what, the number of contributors is vastly lower than the number of consumers...
so is there an outdated flag?
"Released under the same license as Python 2.6.5" should have given you a hint, though.
How could you use such a flag? What's outdated to you might not be to someone else
damn I missed to read those comments
ok mb
08:35
@VisheshMangla It's an old 2013 question, and most of SO [python] tag is not current, much of it is 2.x or a mishmash of early 3.x and 2.x, and no there's no [outdated] tag. By all means if you can write a more up-to-date answer, do, we will upvote it. This is the only way outdated stuff gets changed on SO. Please join in fixing.
@roganjosh I've come to accept the relevancy of such answers to my work as a proof of being outdated, not as a counterproof to it. :/
hmm, ok, I don't think people see lot of answers except for the few top ones
@VisheshMangla There's a 'rich-get-richer' effect on old highly-upvoted SO answers, it drowns out newer more up-to-date answers. But please join in fixing outdated stuff when you can.
@MisterMiyagi aww, c'mon man, you'll be rocking the retro style soon enough. Few more years and you'll be the envy of all :)
sure @smci
08:40
@MisterMiyagi Python 2.6.5 was released back on March 19, 2010. Shortly after Lady Gaga's 'Bad Romance' had peaked...
@roganjosh It's my proud duty to carry on the proud legacy of the Heroes of COBOL!
Either that or carry on my sneaky masterplan of sneaky switching everything to Py3. It's looking good so far, I'm proud to sneakily admit.
I'm a big fan of covert operations, carry on soldier!
@smci Not sure which of those two facts makes me feel older. It's working, though. ^^
@VisheshMangla roganjosh is right that 'outdated' is subjective, anyway all of us have discussed that many times before... if a question contains horrifically broken assumptions(/code) that are no longer relevant, best to open a newer one that explicitly states "v 3.7 or newer" in say the first line, and add \[python-3.7\] to tags, and also acknowledge the older question by a link in the newer question body.
answers should have tags then
in my distress , it's quite often I need a working soln and I might copy some snippet when working with windows, c#, python, django, god knows what
08:46
@smci Better times. If you can look past the fact that she's clearly not a natural singer, the imagination that went into this parody is fantastic and probably reminiscent of the lives of several of us :)
@VisheshMangla Does that actually work? Copying answers? I can't think of a single case where code could be transplanted verbatim from an answer to my existing code.
@VisheshMangla Dude, SO is not really under active development, post-2019 more than ever, and site enhance requests can in theory be discussed on Meta, but the Meta audience knows and cares almost nothing about the tag-specific requirements that Python would need, so it would be wasting your breath to raise such requests there, you'd just get flamed. But please do go skim Meta to catch up with prior discussions, also this chatroom. I previously asked some of what you're asking over the last few yrs
@MisterMiyagi functions can be copied
The best we can do in [python] tag is to clearly tag (and occasionally edit the title and/or body) of old seriously outdated questions, add explicit dates or version numbers, and/or drop comments on them to point out same. But only do that on like the 2% that people still use regularly, or are top-10 Google hits.
stackoverflow.com/questions/19672352/… like here you could just copy the two functions
08:51
Eek, PEP8 violations.
and google top priorities are outdated stuff these days
it gives python 2.7 docs if you search anything
and w3schools which people hate
now the python docs show a bright pink note that docs are outdated
The last two I've realised as well. It's really annoying. Google sends me mostly either to 2.7 or 3.4, both of which are irrelevant usually.
@VisheshMangla keeping in mind that that post is the direct subject of a problem that you brought to this very room
So, um, case in point?
@VisheshMangla You're totally misunderstanding my point: I'm only talking about Google hits on SO posts, specifically there are many cases where an ancient outdated but historically highly-upvoted and highly-backlinked/cited SO post (like you describe) ranks higher in Google top-n than a newer, more accurate SO post. (And by the way, SO is well aware that Google hits are how it acquires a lot of its new-users these days). So, that situation is not going to change.
sorry no idea of that, how that works
08:57
A Google search for any Python question these days typically results in an SEO war between SO vs dubious content sites, tutorials, content-scrapers, farms, plagiarists, bootcamps, paid Q&A sites etc. This is the reality we have to deal with. SO will not voluntarily harm the Google rank of its highly-ranked but outdated posts.
ya I read somewhere that google has an algorithm designed by Larry Page by which it ranks the pages but I got no knowledge of SEO yet.
@roganjosh Sorry that parody doesn't do it for me... there are many better Gaga parodies...
@smci Doesn't their algorithm respect personalised relevance?
@smci it's probably because I was just about to embark on my PhD and was doing sponsored research at the time it was released. I'm biased :)
@VisheshMangla You or I don't need to know the specific details of Google SEO, anyway they change every few years. The point is that high rankings (whether deserved or not) are the lifeblood ($$$) of any website, so a website won't harm its own rankings, even it when it knows its old stale content is eclipsing newer more accurate content. So I suggested you what you can do here on SO to tag, mark and retitle old outdated content as such.
09:04
got it now
@MisterMiyagi To some extent, but that can't discriminate that much between bad coding sites and good sites, it only seems to change the jukebox-like order in which the bad ones are interleaved. See any of my or other people's posts on SEO of SO hits being bad and getting worse, over the last few years
@MisterMiyagi Compare the hits for a typical Python question search on Google when you're logged into and out of Chrome/Google, and when you're coming from a US vs EU vs other IP address. There clearly is a big SEO war for those keywords and the good guys aren't winning. Also, Google's concept of 'personalized relevance' skews towards ad clickthrough rates in each geo by 'people like you', not a better concept of relevance.
...maybe I should edit my Google profile to say I'm a lion-tamer.
@VisheshMangla Yes we know, I've been documenting specific examples of that here for a year, others have been too. Be aware that any mention of 'w#sch**ls', even to say it sucks, is going to boost their SEO. They evidently spend a lot on all sorts of programming-related Adwords and backlinks.
mdn is good that's what I have been told
...I'd honestly rather talk about colonizing the perpetual-shadow craters near the north pole of Mercury.
To prove the point, here's one comment Kevin made two years ago (ok strictly he was talking about SEO between Python's own 2.x vs 3.x doc pages, but that's also relevant, because the bootcampers and tutorial people are largely still peddling and backlinking to 2.x not 3.x, yes even after the 2.x sunset in 2019):
Jun 22 '18 at 18:58, by Kevin
Ok then. I suppose tcl has the same SEO problem that python does: googling a term brings you to documentation that's 2+ versions behind
Jun 22 '18 at 18:59, by Andras Deak
we should write a crawler that clicks python 3.6 links all day
09:23
Some nice lady in here gave me a tapermonkey script to automatically go to 3 docs when clicking on 2 docs, except if you manually select 2
super useful, my german brain wants to add double letters everywhere :P
09:36
Huh, just been bitten by this in Flask's config where it complains about hashing dictionaries. Even if I wrap the dictionary in a list, it still complains. I don't think I properly understand the issue; is there a sane way around this?
@roganjosh Are you calling from_object(some_dict)?
from_object but with:
class Config:

    MACHINE_STATS = [{
            {1: {'ideal_run_rate': 100,
                 'efficiency': 0.85,}, ...}
            }]
I'm generally confused why it gives TypeError: Unhashable type 'dict'
I guess it's to do with the fact that Flask's Config object inherits from dict but I'm missing some detail because I don't understand where, exactly, I'm trying to do any hashing of the dict in that case
needs focus (multiple questions) stackoverflow.com/questions/62881878/…
Are the extra {} intentional?
You have a list of a set of a dict...
Putting the dict into the set triggers the TypeError.
<facepalm>
If it helps, I had to look at this way longer than I'm comfortable to admit.
09:48
Sorry. I conflated my own silliness with the warning in the source. Thanks
@smci either you or someone else has suggested that, and I agree
@VisheshMangla please don't double post the issue in such quick succession. As regulars join the room, they will scan back through the transcript and will assist if they feel able
sorry I didn't know that.
I have come from IRC where messages above goes away and new people cant see them anymore
And if the UI doesn't allow you to post a message it's a good sign that it's not suitable for chat
@VisheshMangla you've been here enough to know that chat is persistent
I have been enough here, but still not sufficient to know(and understand) all the rules
10:01
It's not a rule as such, it's a common courtesy. You will recall that we've discussed this kind of thing in depth and double-posting is just bumping your own issue
I got it. I won't do it again.
Sam
Sam
Morning. Looking for a solution for finding the min distance for each element of a list. For example: given an input list [1, 3, 4, 5, 7, 9, 11] I want to iterate over each item in x and determine the absolute distance to its closest value in the list. Hopefully that makes sense..
@Sam did you try implementing exactly that?
is the list always sorted?
you need to give more info, are you allowed to use numpy?
10:05
@Sam also, did you change your profile pic for something facebooky? It won't load for me :)
@MisterMiyagi I guess even sorting is fastest. N log N vs N^2
You could O(N) check if it's sorted if you just want good complexity
(Unless timsort is O(N) best-case)
@AndrasDeak I'm also occasionally seeing profile pics not load for various people, including you. Did you change your profile pic to something facebooky? :P
@MisterMiyagi me?? No way. It's stack imgur.
Not loading (after page reload) means FB avatar that's blocked for tracking protection
Occasionally gravatar breaks too
I haven't identified a pattern yet. The last regular was LinkBerest for me.
OK, Sam loads now, just some hiccup
@MisterMiyagi his always loads for me. New asker Pedro's never does
Honestly, I've just assumed it's one of those weird chat glitches. Like the dinosaurs.
10:19
In this case it was. Sam's is also stack imgur...
@MisterMiyagi what I mean is meta.stackoverflow.com/questions/259904/…, see also the deleted answer by Jeremy
10:34
Hi. When you write . in requirements.txt is it going to be transformed into path to requirements.txt or will it always be $CWD? If the latter, how to do the former?
@AndrasDeak Huh, wasn't even aware avatars could be external.
@MisterMiyagi there's no reason why they should be, other than maybe gravatar
@DanM. not sure I understand what you're asking. What does . represent?
10:50
Why Rust is faster than Python?
@MisterMiyagi I did want now?
@abdullahkhawer why is Fortran faster than Rust?
^ faster means nothing with out context
@abdullahkhawer why does rust form on iron?
probably the same reason why a lot of other languages are faster than python
@roganjosh just a requirements.txt file with . in it. Like in this answer stackoverflow.com/a/49684835/4114447
@AndrasDeak Rust is not interpreted.
@DanM. are we really having this conversation?
(Hint: no, we aren't)
@AndrasDeak sorry, wanted to mention @abdullahkhawer
11:01
doesn't really matter
Oh, my avatar. Weird it's just black & white picture of one of the mountains in Camp Pendleton a buddy of mine took (i.e. I just uploaded it - not FB thing at all)
the discussion revolved around your avatar not loading at all :)
@DanM. IIUC I think you're asking whether the path you specify in requirements.txt to get to your setup.py script is relative to the requirements.txt file? In which case, I think the answer already solves that by saying that it will point to ./setup.py
I'm not supposed to even be awake right now so my brain is only on half-speed (stupid server problems always happening at 5am)
@roganjosh well, is there a way to point it to "<dir wirh requirements.txt>/setup.py"?
11:08
@AndrasDeak thanks I figured it out eventually ;) :)
@DanM. I don't think I have any concept of the scenario you're describing. That's exactly what it already does
@roganjosh you said it points to ./setup.py . Which means that if you call pip install -r ./foo/requirements.txt it'll try to find setup.py in the same folder as foo.
In which case, why is your requirements.txt not on the top level of your package?
@LinkBerest because it thought it could run? I'll see myself out...
I don't think I'm the best person to be helping with this one btw and I'm somewhat confused already
11:16
@roganjosh it is. But you don't need to be in the root dir of the package to call setup.py, but it appears that you need to be to use requirements.txt which creates some dissonance.
@JonClements because Fortran already has it's ticket punched
I'm pretty sure you don't have to be to use requirements.txt because you're just going to scan through the file and install the dependencies into a virtualenv. I don't think python cares if you decide the venv should be in a wonky place, buried in the package
@roganjosh if the requirements.txt contains . it'll try to find setup.py, which is the problem.
In any case, I'm reverting back to "I'm not the best person to help with this"
Anyway, thanks for trying.
11:29
@LinkBerest You are completely innocent, other than having an avatar that sometimes does not load for me.
Aaand, after reading the transcript I realise you know that already.
Heh, yep :)
@MisterMiyagi A crime that unfortunately must be answered by death-by-1000-squirrels. <sigh> it's always a shame to see a good one go, but rules are rules
11:46
I've seen one of those grey squirrels up close last time I was in the UK. Death by 1 is probably punishment enough.
Awww. We used to have loads on campus and they'd come eat out of your hand. I mean, they're completely horrible to red squirrels, but... look at that bushy tail and little forearms.
12:01
They're cute and fluffy. The scary part is that they always reminded me of my cat. A 14 pound furball with a psychopathic attitude.
Hmm, I'll keep that in mind for the next cruel and unusual punishment that I invent :)
Hi guys, does anyone know any matplotlib tutorials out there?
I am trying to read through the docs and I can't seem to piece them together
Currently stuck at understanding the locators and formaters of the ticks no matter how much i read the docs lol
@Pherdindy which part are you stuck with? Those two items seem straightforward enough to me.
I'm trying to actually learn matplotlib but i'm not sure of the order of reading the doc
@Pherdindy you don't learn by reading the doc like a book
Did you see the official tutorials I linked? There's plenty.
12:11
I actually read the usage guide already
There is a part there about locators/formaters but doesn't seem to explain much
Is too abstract for me to get it lol
strftime really should be renamed to: datetime_to_string and strptime should be string_to_datetime. Like this i got to look it up every time
@Hakaishin hint: p is for parse, f is for format
@Pherdindy how about Tick locator gallery?
hmmm, i might have even heard that before, but it's not the 80s anymore. we can afford to call it strparsetime and strformattime
@Hakaishin ew, no
@AndrasDeak great maybe this will help. What are your tips for beginners to learn the library
Do you suggest i look for a book
12:17
@Pherdindy I don't know
@Pherdindy the only time I opened an actual book on programming was for Turbo Pascal
@AndrasDeak hah, same :D
How did you learn though
Just randomly clicking each hyperlink to hyperlink? lol
@Pherdindy just trying stuff, and then playing forensic detective every time your attempt explodes?
Yeah I guess that's the way to go brute force the docs lol
And do trial and error
1. You want to do something 2. you try to come up with terms which translate natural language to programming concepts. 3. you read what you find. If step 2 doesn't work I usually start to read tutorials to know what terms to google
12:19
@Pherdindy I've known quite a few languages and libraries by the time I started working with matplotlib. I looked at stuff on Stack Overflow (and the docs, of course) whenever I needed something. The interface was intuitive enough. I don't remember if I read the "getting started". I came from MATLAB so a lot of the approaches wasn't shocking. But my learning experience shouldn't necessarily be applicable to others.
@Hakaishin just format and parse then, please. That it's about str and time is kinda obvious.
I mean you also need to be mindful of:
Jul 3 at 20:58, by Aran-Fey
Remember, hours of trial and error can save you minutes of reading the doc
But at some point, you'll need to try something
yeah, would still be miles better than now. datetime.now().format("stuff") would be so beautiful, compared to strftime
but then the C programmers wouldn't understand what it does
badumtss
12:21
To be fair python also gets a lot of flak for doing other things differently, like "def".
Yeah I usually work towards a goal but if I don't know a functionality exists I get stuck so I decided to read the docs first. Thanks for the tips I think it's just really a balance of trial and error and reading/skimming the docs
@Pherdindy I find the matplotlib examples very helpful. The library is too vast to learn it all. Narrowing it down to the thing you need to do helps immensely.
Right just looking at the API overview intimidates me lol
Gotta just start slow and do small stuff
Hi, the issue which I was facing was due to os.path.join using wrong backslashes
Concerning datetime format: Does datetime support format specifiers? As in f"It is {mydatetime:%H:%M:%S}" or somesuch?
12:27
"python\\.\\document.pdf" . It's strange // or \\ and all how it works. I have the problem but not a good solution
Not feeling like poluting my day with actually touching datetime, just throwing random throughts out there....
I put / whenever I use paths
@VisheshMangla Are you on windows?
Are you aware of raw string literals?
12:28
r""
yes
\ is escape character . r"" prevents python from taking it as an escape character
@MisterMiyagi no clue
I 'm using paths the following way
no use of raw strings anywhere
@Pherdindy there's also googling "thing you want to do site:stackoverflow.com". Answers from Joe Kington and ImportanceOfBeingErnest and a few others are always idiomatic and helpful
dpaste.com/14W3CTP . Ahh I used to think about what is is Postix path in Pathlib, finally I got a use
@VisheshMangla I understand neither of these code dumps.
@VisheshMangla If you are on Windows, then PosixPath is very likely not the solution.
12:35
I saw PureWindowsPath too
I can't make sense of those two pastes either. What's the problem we're trying to solve?
The problem is use of "\\" by os.path.join makes the path wrong and python cannot find a file at the path created by joined "\\". The right thing is to use "/" or "//"
If you're on windows, using "\\" isn't wrong. What makes you think it's wrong?
I'm 95% sure that os.path.join does the right thing when joining paths for your OS.
because it resolved my error
12:41
Can confirm that I've not had issues with os.path.join when porting code over from Windows (my main environment)
Give or take the famous "but windows!?!?!" renormalization .
sorry, no idea what the error was, you were right it was not the "\" or "/" . I just observed in dpaste my "C:\Users\.." had "\". I need to dig up more
12:59
@Aran-Fey Hi Aran, apologies for asking a clarification here. Based on your answer for the question : stackoverflow.com/questions/44524631/… , can we do the same using flask instead of tkinter. In my requirement I'm trying to write a python web UI wrapper of dedupe library , in which the source code has input() function to get user input. Which I'm trying to change to flask .
@user3319471 I have seen your recent question. You can't transplant a tkinter solution to Flask
^^ You were given an answer, though, which shows how you need to take the input from a HTML form
was that for me @roganjosh?
@VisheshMangla That's enough now, please. You're going back to your old ways of just dumping every problem into a dpaste and linking here
@user3319471 Probably not, although I'm not entirely sure because I'm not a webdev. But I doubt you'd want to block your entire web server until the user provides their input
@VisheshMangla No. The reply I directed at you was, though
13:03
ok
@Aran-Fey Thanks for your response. So is there any way I can expose the Tkinter solution in web.
I don't think so. Tkinter is a single-user interface, but a web server handles multiple users simultaneously. I would be surprised if there was a way to make a blocking input() call that still allowed the web server to function normally until it returns
Sam
Sam
@AndrasDeak Nope picture is still the same :)
@Aran-Fey Agreed But we can run separate scripts for each user right
13:12
No idea, like I said, not a webdev
@Aran-Fey No problem , thanks for your response though :)
<-- also responded and works with Flask every day, but nevermind :P
@roganjosh Yeah but that didn't work though.
@user3319471 the python docs on "wsgi" tells good about web servers and how they work
@VisheshMangla Thanks Vishesh , will go through them
13:16
@user3319471 you haven't shown anything about your implementation. All I know is that you want to translate a tkinter approach to Flask, and you want multiple users to run scripts in isolation. All of that is perfectly possible, but there's no detail on what you tried
@roganjosh Sure let me share them shortly
Hello everyone
Does anyone know how to check cuda version on windows?
13:33
Obligatory question: Did you install cuda?
@MisterMiyagi no
... Seriously?
Going for a cig :P
13:40
conda install -c anaconda cudatoolkit
This should suffice for that right?
@RaphX I would expect that "how to get cuda" is an easily findable thing, yes?
@roganjosh This reminds me of the guy calling techsupport from the cellphone because the power was off in the building xD
@AndrasDeak yeah
@Hakaishin I am replenished now, anyway. Back to my app for a while :)
I'm going nuts, is there a way windows could tell me WHICH file it can't find? I just get: error: [WinError 2] The system cannot find the file specified
does: subprocess.call(protoc_command, cwd=folder) the cwd not work anymore?
13:56
According to the docs, it does.
"In particular, the function looks for executable (or for the first item in args) relative to cwd if the executable path is a relative path."
['C:\\Users\\user\\Documents\\protoc-3.0.0-win32\\bin\\protoc.exe', '--python_out=..\\app\\proto', 'command.proto']
that's what I got, but it doesn't make sense why it doesn't work
Well, is the path correct?
does the same happen if you don't pass any non-trivial input args, just -v or whatever?
I have subprocess.call(protoc_command, cwd=folder) and yes the paths are correct
running the same command by hand works. I think subprocess is doing some weirdness
ugh, it wasn't even that command failing, it was later on subprocess.call(['pwd']). But what a strange error. Usually when a command is unkown you get is not recognized as an internal or external command, instead of file not found. Ah this was annoying
14:11
I think the "is not recognized as an internal or external command" message comes from your shell.
At least that's the only way the "internal command" part makes sense to me.
doesn't subprocess call call the command from my shell?
if subprocess.call(['pwd']) != 0:
    sys.exit(-1)
also why would anybody do this? When would you expect pwd to fail on linux? why not just do print(os.getcwd()) and make it os independent
strange things
subprocess.call does not invoke the shell by default
@Hakaishin not unless you pass shell=True.
what does it use then if not the shell? And this seems like a strange default
also subprocess.call can fail if no more processes can be spawned
14:19
@Hakaishin There are tons of people who don't know better and just translate shell code, for example.
My favorite is when people do subprocess.run('cd '+path, shell=True)
@Hakaishin It tells the OS to spawn a process. The same way a shell does.
@Aran-Fey lol
if you only got a hammer and so on
14:47
are there only really 7 people running for moderator?
yes
there were 9 but 2 retracted
hmmm, interesting. I might have to finally cast my vote. I alwayes assumed there are a thousand people who want to do that and then I felt overwhelmed to inform myself. But 7 is a quite nice number to compare
did they finally randomized the order in which candidates are shown?
they are always randomized in the election phase
ah only later not?
only earlier not (during nomination)
15:32
Checking the exit code of a subprocess/function that has a (1e-20)% failure rate reminds me of my C++ days
Funny you should say that. Earlier today I had an issue that would produce [segfault, double free(), expected result] with roughly uniform distribution, using deterministic code.
"Ok, yes, malloc will only fail if your hard drive is one second away from melting, but if you're going to write C++, you're going to need constant vigilance or else you'll go soft"
(disclaimer: I don't actually know how robust malloc is in non-melting scenarios)
@AndrasDeak Try moving some comments around, that usually appeases the spirits
The error started being worse when I added a kwarg to customize a colourbar :'|
black text rather than white only makes the spirits angrier, apparently
You have my sympathy. Nondeterministic results from deterministic code is always a bad feeling.
Mostly because it dashes the comfortable illusion that everything between the metal and the executable has predictable behavior
When in reality you've got multiple cores racing against each other, and non-cooperative multitasking between processes, and pipelined lookahead branching CPUs that sometimes maybe execute assembly but not really...
15:40
And cosmic rays will flip an average of one bit per month per server rack, and impurities in the wiring may affect the speed of light, and magnetic induction in one chip can rowhammer its neighbor... Excuse me, I need to lie down
spinning my head right round, right round baby going down down :D
My therapist told me I should do less catastrophic thinking, but what if it's the only thing standing between me and catastrophe???
:D
Yeah, I don't get the whole mentally live your life and don't worry just enjoy it. It's like dude we ALL have a big problem namely death. How can you just be here and enjoy and not alteast worry a bit about it. I feel like ageing research is underfunded
@Hakaishin mm, have you got 3 hours? I don't think it works quite like that
haha I don't but it'd still be interesting to hear you out
15:51
Partially agree. I think humanity can eventually cure senescence, but I understand why the average person on the street would shrug their shoulders and say "everybody dies, man". What they probably really mean is "I, and everybody I know, will die, because the cure is more than 70 years away, and if I think about that too much, it will degrade the quality of my life"
Notice that many humans are bad at planting trees whose shade they'll never be able to lie under
@Hakaishin picture a scene. The CEO video-casts to 800 employees across 5 countries. roganjosh is on the video call. CEO says "If we don't get this next round of funding, I'm afraid we're all going home. It relies on roganjosh fixing Issue X". I mean, it's totally hypothetical and it didn't cause me lasting damage.
@Kevin There is a good xkcd/smbc about that the cure is always 70years away and so it will never be done, because nobody feels like it's worth it. On that note, the thought of us living in an era where humans die, but there might be one where people might live forever fills me with anguish. there is another good smbc, but I can't find it
There's an element of chicken-and-egg here, because maybe if every person on the planet was gung-ho for aging research and was willing to put tax dollars towards it, maybe the research time would drop by half and lots of people would live long enough to enjoy it
True, for a while I was thinking if this isn't the most important thing to do and if I shouldn't go into that field of study, but the feeling passes, after all I'm only average
@roganjosh I don't really understand is there more to this?
There's a good short fiction piece on SlateStarCodex about a group of alchemists that discover that the elixir of life is possible, but formulating it would require the concentrated research of one alchemist for 160 years, and no you can't do it with two alchemists over the course of 80 years
Any alchemist worth their salt has read The Mythical Man-Month
Unfortunately the SSC page is down so I can't look for it
15:58
haha discovering that must have sucked
@Hakaishin have you been in a position where your ability to fix a problem means 800 people might lose their job? Kinda poos on the idea of just living your life and not worrying about it
Well, they're not giving up. They throw themselves into the research of research, and discover that the research time can be reduced by half if one scholar dedicates 150 years of his life to the art of teaching others how to research.
And that can be reduced by half by researching the research of research...
i love it :D
The end result is that the alchemist monastery is crammed full of researchers of teaching of researching teaching research, and they all get very grumpy when anyone rings the doorbell because it sets back their progress by a decade
@Kevin oh lovely. This does not remind me of my institute at all :D (sarcasm), man this is less fun in chat
16:05
Blergh. incompatible type "Dict[str, int]"; expected "Union[List[Union[Dict[str, Union[int, List[int]]], Dict[str, Union[Dict[str, Union[int, List[int]]], List[int]]]]], Union[Dict[str, Union[int, List[int]]], Dict[str, Union[Dict[str, Union[int, List[int]]], List[int]]]]]"
o_o
Does anyone know how to work with such yam?
I know regular expressions pyparsing!
import pyparsing as pp
pp.nestedExpr('[', ']').parseString('[' + diag + ']').pprint()

[['Union',
  ['List',
   ['Union',
    ['Dict',
     ['str,', 'Union', ['int,', 'List', ['int']]],
     ',',
     'Dict',
     ['str,',
      'Union',
      ['Dict',
       ['str,', 'Union', ['int,', 'List', ['int']]],
       ',',
       'List',
       ['int']]]]],
   ',',
   'Union',
   ['Dict',
    ['str,', 'Union', ['int,', 'List', ['int']]],
    ',',
    'Dict',
    ['str,',
     'Union',
     ['Dict',
      ['str,', 'Union', ['int,', 'List', ['int']]],
I tried to strip out the unions and find all the possible concrete type combinations, and I got this:
List[Dict[str, int]]
List[Dict[str, List[int]]]
List[Dict[str, Dict[str, int]]]
List[Dict[str, Dict[str, List[int]]]]
List[Dict[str, List[int]]]
Dict[str, int]
Dict[str, List[int]]
Dict[str, Dict[str, int]]
Dict[str, Dict[str, List[int]]]
Dict[str, List[int]]
... But this indicates that Dict[str, int] is valid, and we already know it isn't, so I must have missed something
Here is my approach.
I wonder if that type signature was autogenerated, because some of those Unions could be flattened into a simpler form, and that seems like relatively low-hanging fruit for a maintenance-minded human. Sayeth the docs, Union[Union[int, str], float] == Union[int, str, float]
16:23
peace out guys
@PaulMcG While I still don't get the error, that is impressive.
@Kevin @PaulMcG The Type is from a simplified form of this question. I'm not sure whether it's a bug in the type or in mypy.
Ok, having brushed the dust off my type checker, I can confirm that I'm getting the error too
The furthest I've come is that mypy is fine with DataDict = Dict[str, Data]] but not DataDict = Dict[str, Union[Data, List[Data]]].
user13415013
16:38
Guys guys
user13415013
Is there any way to solve problem when loading image from url, using imageio module
mypy.readthedocs.io/en/latest/common_issues.html#variance describes a scenario where mypy will be unable to recognize the argument as having a valid type, but the example they give doesn't seem to apply to us. Their example obscures type information via an untyped assignment statement, whereas I'm passing a dict literal in directly, which should be easy to inspect
user13415013
It kept blocking when i wanted to download from url giving error
imageio imread The read operation timed out uta
@Kevin The thing that confuses me is that IMO any argument of the form a: Union[X, Y] should be no more restrictive than a: X.
Agreed
16:42
And as far as I can tell, what we're doing here is the same, for X=Dict[...]`` and Y = List[X]`.
user13415013
How can i get image content without blocking from url image link.
I am making dataset and ran into problem
Trying to pare down to the smallest type annotation that still produces the error... Got it down to Union[Dict[str, Union[int, List[int]]], Dict[str, List[int]]] so far
user13415013
I was using imageio which worked but at some point it is giving index error....
I notice that Dict[str, List[int]] is derivable twice by different paths. I wonder if that matters.
@nerd The host may be rate-limiting you. Make sure your script downloads only a reasonable amount of images over time. Say, one per five seconds.
user13415013
@Kevin thanks, but it hurts amount of time while downloading.
16:47
If that doesn't help, they may have blacklisted your IP address or some other identifying fingerprint, so you may need to wait for the block to be lifted, or use a different computer
@Kevin I've had mypy down to lecturing me about Dict invariance with one variant, but it was rather convoluted.
user13415013
@Kevin i was using colab. when directly open through my browser, it show website dont exits, and again refreshing solves the problem.
user13415013
@kevin , how can i add time
time.sleep is one popular approach.
user13415013
Thanks @Kevin .
user13415013
16:56
Guys, Do you often get problem when using google colab, freezes whole pc until restart how do you solves this
I've never used google colab.
user13415013
oh, Any other
00:00 - 17:0017:00 - 00:00

« first day (3559 days earlier)      last day (1614 days later) »