« first day (4912 days earlier)      last day (30 days later) » 

4:49 AM
@Aran-Fey There are tons of packages in Python and R where the documentation is not useful, merely a collection of pages with low-level summaries autogenerated from a docstring. Not a quickstart/ getting started/ vignette/ user guide on how to do a certain task e.g. plotting, summarizing, esp. For such packages, often best to rely on third-party summaries/ cheatsteets/ github gists. There are third-party companies which make a living out of that, or use them to generate leads/ inbound inquiries
 
Hello, does anyone here know how to handle multiple errors at the same time?
 
5:03 AM
@zoomingspeed You mean code throwing multiple exceptions? Show us an example line of code and the exceptions. Do you want to catch the first exception, print it and raise the second?
 
No, I want the code to detect ALL errors at the same time, and handle them. I didn't figure this out but I figured out how to handle one error to get rid of the rest
 
 
1 hour later…
6:06 AM
I asked which errors? Show us an example line of code and the exceptions, and we'll take it from there. Until we see that we don't know what you mean by errors.
 
 
4 hours later…
9:55 AM
Ugh, Chrome has seemingly trashed a part of my app. It seems to stop me opening a file upload dialogue box now on my site. I just checked on Firefox and it still works. Has anyone else noticed this issue?
nm, whatever they did must have been a temporary glitch because a further update has made it all work again. Thanks, Chrome, for sending me down a path of git blame on myself. It always feels shameful with that name
 
@roganjosh been there done that :D
@roganjosh for me it's the opposite, ff keeps crashing and chrome works fine :D
 
10:11 AM
It wouldn't hurt so much if that one feature hadn't taken literally days of dedicated effort as I was fiddling with image compression and getting the upload to scale properly in the preview box. "Oh man, what have I done?!" when it suddenly stopped working across multiple pages.
 
 
1 hour later…
11:26 AM
I'm having issues with mojibake. I have a piece of data with an unknown encoding, so I try a bunch of different ones until I find one that can successfully decode it. The problem is that sometimes the text gets decdoded "successfully", but the output is garbage. I know the text is supposed to be german and the problems are usually caused by umlauts (äöü). Is there an easy way to check if the decoded text is "valid" german?
 
Only German?
 
I think in rare cases it might be english, but that's a subset of german anyway :D
 
Ouchie
Actually, that might be a compliment? I'm in mixed emotions
My first thought was chardet but I'm guessing you tried that. It looks like language-specifics take a lot of effort with its own Mongo DB
 
Yeah, chardet doesn't always get it right
I should add, my data is essentially a serialized dataframe, not just text. So ideally I'd like to avoid working with bytes. I'd prefer to decode it and then run some sort of sanity check once I have the data as a string
 
How does the encoding become ambiguous in this process?
 
11:41 AM
The file is created by a 3rd-party program from the 90s. I don't know how it decides which encoding to use, but unfortunately it's not consistent
 
@Aran-Fey I'm pretty sure a number of NLP have language detectors. Depending on the output you make be able to check if the output is in the Latin Unicode blocks. You can possibly strip non-{Latin and white-space} characters and see if any words are in a German dictionary.
 
Latin is too permissive, unfortunately. Letters like ã are also in the same code block
 
My idea was if you're getting a ton of special characters and other non-sense - "Depending on the output"
 
Oh, here's an idea: all(char.isascii() or char in "ÄÖÜäöüß" for char in text). Let's see if something explodes, but I think that'll be good enough for my purposes
 
12:20 PM
@Aran-Fey did you try to detect the encoding using some unix tool? like file, etc
 
12:40 PM
Nope, I don't have access to linux here. I do know that the files use either ISO-8859-9 or utf8 though
 
 
4 hours later…
4:17 PM
> Every developer in the world thinks reading code is harder than writing code and every devtools vendor in the world is trying to charge you money for a button you can click that lets you read code instead of writing it.
 
4:58 PM
Honestly, I don't follow that point at all
I followed the comments further to try make sense of it and came upon this from the OP that just waters it down anyway. It just looks like the original post was trying to be profound or something, in a way that doesn't really add up unless you stretch your interpretations, just to say what's been said a billion times already
 
 
3 hours later…
8:18 PM
@roganjosh I think the point is that a GenAI tool like Copilot reduces the amount of code you have to write, but instead you have to read and understand the generated code so that you know what it does, and to make sure it actually does what you intend.
That may be harder than reading a colleague's code. At least with a colleague, you can ask them why they did stuff that you find puzzling. But if you ask an LLM, it may just hallucinate a plausible sounding explanation.
 
Maybe people will start valuing readable code more!
 
Perhaps.
Of course, readability is relative. A lot of old C code can look pretty cryptic. But compared to assembler code, it's very readable. :)
Lisp fans claim it's a very elegant language. But I've always found it very painful to read. All those parentheses trigger a kind of dyslexic reaction in my brain.
 
@PM2Ring Perfect, and exists complex and non-complex code, even if they are readable (but complex ones are less readable, of course)
 
Conversely, a lot of people find RPN languages like PostScript difficult to read. But I find it easy to read and write, once my brain clicks into RPN mode, which admittedly takes a couple of minutes.
 
8:33 PM
In this case, it is already a matter of knowledge of the programming language in question.
 
Almost all early C coders were experienced in assembler. C was promoted as a more human-friendly (and portable) alternative to assembler.
 
Of course
 
 
2 hours later…
10:42 PM
@Aran-Fey It's only latin5 (ISO-8859-9) or utf8? That narrows things down. Are you tying to find out if the result is a valid utterance in German language, or just that it doesn't contain non-German characters?
Yes chardet is not reliable, I found it unuseable for my purposes.
 
Either one would work for me
 
11:04 PM
Heya, I just downloaded Anaconda and PyCharm as an IDE. Whenever I try to run anything it complains that there's no interpreter. I'm setting it up as a Conda Environment with the default executable C:\Users\Admin\Anaconda3\condabin\conda.bat. Is this right? I see the environment appear in Anaconda Navigator, but it doesn't find an interpreter in PyCharm.
 
@Aran-Fey Are you trying to discriminate 'German' from 'English' or 'Eastern European' or 'non-ASCII' or 'gobbledygook'? Show us an example snippet.
@user10478 When you say "it", I assume you mean "PyCharm". First, make sure the Anaconda install is correct (you might also need to edit your Windows environment variables, I don't remember. Test if you can run Python from Windows terminal prompt). Second, go inside PyCharm and fix the settings/options for the default path to the Python install. If any further install issues, look in the Anaconda doc or on SuperUser; it's offtopic here.
 
Yeah PyCharm, I'll look into a couple of those thanks.
 

« first day (4912 days earlier)      last day (30 days later) »