« first day (3504 days earlier)      last day (1459 days later) » 
00:00 - 19:0019:00 - 00:00

7:00 PM
...is the new blog post actually straight telling people to copy & paste all their code from SO? or is it just me?
 
That would be a nice custom expression parser. Come up with some operators and we could define a Gaussian expression example.
 
Anyone who has had a team of junior devs on a project will know why I hate that practice down to my very bones :P ;)
 
@LinkBerest-GoodbyeSE I haven't been reading anything the company's been saying since they got the new CEO
Actually, I stopped sooner. That blog is all about spam.
 
@AndrasDeak the answer still is not 42, is it? ;)
 
You have only yourself to blame if you look at it :P
@MisterMiyagi I suspect those LHC people would kill for 42 sigma results
 
7:02 PM
@AndrasDeak okay, I will grant you that
 
@AndrasDeak Just tell me who and consider it done.
 
I literally found it because I was writing about the dangers of copy and paste coding within academia (of which this is a problem) in my proposal and it came up as a hit - sigh I sometimes forget how much marketing that blog is
 
@PaulMcG One way I've handled that (on paper, not in a coding language) is to use a superscript letter on the ±, so that ± signs with the same superscript have the same parity. It's kind of analogous to a ± b being equivalent to a + ((-1)^n)×b, where n may be odd or even.
 
@LinkBerest-GoodbyeSE Oh wow, they just skimmed over the license part. "Whether these clones are good or bad is up for debate." But likely to be a licence violation? Yes. I now remember why I don't read them any more...
 
@PM2Ring In such cases I'd introduce a parameter that has a value of +1 or -1
 
7:07 PM
If/when I implement it, I'll just do the all-upper then all-lower evaluations, and return a pair of values.
 
@AndrasDeak That sounds sensible. :D
 
yes, yes. Andras is right. The blog should have a warning label
 
@LinkBerest-GoodbyeSE I hope not. They talked about the dangers of doing that here: stackoverflow.blog/2019/11/26/…
 
They cover the "dangers" at the very end but its just bad and I know junior devs and students will just go "oh, its good to copy and paste" and forget the (buried) rest of the message
 
And of course it's perfectly possible to screw up by misusing code that isn't buggy. A classic case is when Samsung cargo-culted stuff from SO written by our Code-Apprentice:
Nov 22 '19 at 14:31, by PM 2Ring
@roganjosh They also know how to cargo-cult code from SO. Just ask Code-Apprentice, or read about it on https://www.xda-developers.com/samsung-bixby-baseball-card-tracking-app-galaxy-s8/
 
7:14 PM
oh, yeah. I forgot about that one
After my first 2 years of teaching data engineering, I learned to add a bit to my introductory lecture entitled: "don't just copy my example code to try and solve the assignment given using it - it will always need to be altered". And including a bit that explains "altered" doesn't mean "change variable names"
In this case because the students don't know/do the math and just assume their results are still correct (more than the standard "do your work" issue) simply because they got a number as a result and not an error (the number is the error never occurs to them).
 
Copying code from the Net can save time. But it doesn't mean that you don't need to spend the time required to understand how that code actually works.
I must confess that I've sometimes used code that I don't fully understand. But I only run it on my own machine, I wouldn't risk it in code I expect other people to use.
 
I even have a slide entitled: "Why .05 P-Value means your wrong."
 
@AndrasDeak It's a shame Douglas Adams chose 42 rather than 43. Then people who know hex could make jokes like 2B or not 2B...
 
now we have to make do with six times nine
 
@PM2Ring actually, it's not 2B
 
7:25 PM
@AndrasDeak In base 13
@MisterMiyagi Huh? 2×16 + 11 = 43
 
@PM2Ring But 42 means not 2B... eh?
coughs
 
@MisterMiyagi Hmm. Ok...
 
@LinkBerest-GoodbyeSE who-dy what now? That's a pretty bold statement
I can accept that confidence intervals don't answer everything but saying "you're wrong" on the back of 95% confidence seems... iffy. I bet there's some fun examples to back it up?
 
7:48 PM
@roganjosh It's suppose to be a tongue in cheek title (the slide explains confidence intervals and expected ranges within assignments). But its also completely true of all my assignments (none should give .05 so if you get that, in my known datasets, your math has an error)
and specifically there's a bit of example code I do that if run completely unaltered on the assignment dataset will give .05% (it doesn't run anything the first function in the example code checks that it is the file and just returns that)
 
Anyone know how to fix incorrect string value when inserting into sql with pymysql? I looked it up and said use utf8mb4 charset, which i started doing, but i still get the same error
 
I'm not exaggerating that I'm super-interested in this slide/code :P
@ROODAY Where is the code for insert? I suspect you're using string concatenation
 
lemme get a paste bin one sec
the error I get is: pymysql.err.InternalError: (1366, "Incorrect string value: '\\xCB\\x88k\\xC3\\xA6\\xCE...' for column 'pronunciation' at row 1")
Same happens if i just set pronunciation to '' for everyone, i get then get the error for names (people with accents in names i assume)
 
Are those intentionally backticks inside the query string?
 
@roganjosh I'm cleaning up the repository now (and currently making proposals because we have to submit some "if I have to do online only next year" proposals quick) so I don't have a copy handy but I'll message you when I put it back up. (it will be on this group's repository and is one of the public ones in case I forget)
 
7:54 PM
@AndrasDeak Yeah its how the pymysql documentation had it
 
OK, just rubber ducking here
 
Yep no worries!
 
What is the column type?
They already are
 
The column type is text for both name and pronunciation (the ones that throw this error)
 
So, just TEXT?
 
7:57 PM
sorry, don't know how I misread that so bad
 
Whoops sorry
 
it's alright
 
Sorry, I jumped the gun in moving the message. My bad
 
So when i do show create table graduates, i see that CHARSET=utf8mb4, but for the column itself i see this: text CHARACTER SET latin1 NOT NULL
 
7:58 PM
too many research papers, eyes bleeding. Calling it a night all - adios
 
night
 
Night :)
 
I assume its that the character set is latin1 despite the table using utf8mb4?
see ya!
 
@ROODAY text encoding is a good way to confuse me. I'm not sure I'm confident to explore the issue with what's shared. Can you give me a specific traceback in a dpaste/pastebin please?
 
8:01 PM
I would naively expect that a database engine takes care of encoding when its input is a python 3 string (but as you may have noticed I only have naive impressions about databases)
 
So in the bottom it says that the table encoding is utf8mb4, the correct one, but the individual columns are latin1
I think because when i created this table the charset was latin1 so altering the table afterwards doesnt alter the columns inside?
 
@ROODAY That depends. Alembic may or may not pick up on the change during migrations
If you're not using Alembic then I don't know how you're managing that side of things
 
Hmm i ended up fixing this by modifying the schema.sql i was using to specify utf8mb4 explicitly for all the text columns, then dropping tables and resourcing the schema. Now the import script works!
 
Took a few more messages but I just rubber-ducked this too :P
 
What should be the correct close reason be for this? It sure seems like an old issue that only occurs under 2.x Unable to remove unicode char from column names in pandas under Python 2.x
...also, I can't readily find a 'Related' citation for the 'ASCII hammer' approach, if anyone has a link please post it on that question.
^^ Here is a bad example of an 'ASCII hammer' Q&A: Python non-ascii characters, the question statement is way too full of SQL-handling syntax, and most answers are not generic.
 
8:40 PM
@smci That just needs to be closed IMO
It's as ugly as sin. It stampedes over PEP8 and uses string concat to build queries
 
8:57 PM
@roganjosh Sure, but it's always good to include a better link for them, so people can learn.
 
For that particular question, I wanna call a close vote on it, possibly even a delv vote, because it's really bad. At the same time, I don't want to disrupt history
 
@roganjosh Hmm, what are our criteria for delvoting?
 
That it's a query build entirely by concats and the answer doesn't include any code to fix it
 
@roganjosh Yeah. I'm not praising it, but I'm saying even bad malformed questions based on misunderstandings have some small educational value, and in particular we can add links on them to better questions.
 
I'm weighing it up because I really do think the question's existence could be adding to the horrendous SQL Injection vulnerabilities
it's so far removed from ASCII issues
(stackoverflow.com/questions/7590030/python-non-ascii-characters) I went "more clarity" but "more focus" works too. It's terrible code, unrelated to the title
There's no way to delineate an issue with ASCII and just borked SQL in that, @smci IMO
 
9:20 PM
Alright, this is weird, but I think it's simple solution
There is a symlink from python3 to python3.7
 
user11006952
Does `settings.py` have special meaning/convention in Python? I was following the [docs](https://pypi.org/project/python-dotenv/) of python-dotenv and mentioned settings.py right off the bat.

Googling shows Django has settings.py but python-dotenv has a separate section on Django.

Is it simply code convention?
 
but the modules work only if I type the full path
 
@Rainb linux/unix or windows?
 
linux on windows
 
So what does which python3 give you? That same python3.7?
 
9:23 PM
no, python3 redirects to my /home/username/bin/python3 which symlinks to /usr/bin/python3.7
I suppose that is the problem?
 
does that username/bin/python3 belong to a virtualenv?
 
no
 
@Pax yes. I imagine you'd find it being loaded in Django boostrapping itself
 
python3.7 works, python3 doesn't
 
@Rainb What do you mean by "modules don't work"?
 
9:24 PM
but python3 symlinks to python3.7
 
they aren't found?
 
Yes, they aren't.
python3 -m pip
module not found.
 
And how did you install said modules?
 
python3.7 -m pip works.
They're the default modules.
 
OK, I can't help you
 
9:26 PM
I just installed with deadsnakes/ppa
 
user11006952
@roganjosh 👍🏼 Thanks.
 
@AndrasDeak I appreciate your help anyway, thanks a lot.
I think I'm getting onto it.
 
wim
@Pax no. it's just a Django thing
there are a some special filenames in Python: __main__.py and __init__.py, setup.py, sitecustomize.py to name a few
 
How do I fix the SQL syntax error here: pastebin.com/c3pfRb6i?
 
@JossieCalderon where is the syntax error
If I had to guess, you need Username VARCHAR(255) PRIMARY KEY but I don't know the dialect you're using
 
9:41 PM
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Taken VARCHAR(16),
            Time Started VARCHAR(16),
            Time Finish' at line 3.
 
Ok, simple. You can't have whitespace in the table names
Use underscores, and you also will want them to all be lowercase
 
This syntax worked here: towardsdatascience.com/…. I changed the column names, but now I get the error. It was working before.
 
You probably can have whitespace but that'll just be a technical discussion that I'm pre-empting
@JossieCalderon What am I supposed to be looking at, specifically?
 
That big block of text where it says:
        sql_create_table = """CREATE TABLE {}(
            Column1 INT(11),
            Column2 VARCHAR(30),
            Column3 DATETIME,
            PRIMARY KEY (Column1)
            )""".format(tableName)
 
ugh those quotes
 
9:49 PM
The above code works, but not the code where I changed the column names. And I agree, Andras: I will edit it.
 
Sure. The part where all the table names are single words not separated by whitespace
INT/VARCHAR is not relevant. You have Time Started
 
So, have Time_Started instead?
 
that's what he said
 
time_started :P
Use lowercase :)
 
9 mins ago, by roganjosh
Use underscores, and you also will want them to all be lowercase
that infamous tabs vs spaces dumpster fire stackoverflow.com/questions/119562/… cc @wim @MisterMiyagi
 
9:56 PM
well, it worked.
 
Got another gold spending question. Like last time, each turn your gold is set to 10 and you're presented with 5 random items. The difference is that now buying an item costs 2 gold, rerolling (getting another 5 random items) also costs 2 gold, and you can sell items for 1 gold.
 
:49429253
 
@Aran-Fey async problems
 
Again, the question is how to spend your last 2 gold if there are no items you want to buy. I constantly see people spend 2 gold to reroll, but wouldn't it be better to buy a random item and wait for the free reroll at the start of your next turn?
 
:49429286 what about freezing?
 
9:58 PM
freezing is still free
 
@JossieCalderon huzzah :)
 
Oh, and of course the items you own persist between turns. So the idea is that you sell the garbage item for 1 gold next turn, thus essentially having achieved the same number of rerolls but having 1 more gold at your disposal
 
Well the way I see it there are two possibilities: 1. you spend your 2 gold rerolling, which gives you a new set of items which you can choose to keep for 0 gold, i.e. the benefit of the original problem. 2. you buy an item to sell in the next round, in which case you don't have a free reroll which you can choose to keep, but you get 1 gold. Question is how much it's worth to you to know what you'll start with in the next round.
 
I'm gonna go ahead and say that having 10% more gold is better than knowing your 5 first items in advance
 
then there's your answer I think
 
10:07 PM
cool, thanks. Good to know my brain still works correctly sometimes
 
although we're in the same time zone so perhaps someone with a fresher mind might prove us wrong still :P
 
Not sure what you're talking about, my mind's still fresh this early in the morning :P
 
:49429305
Error: 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') VALUES ('test1','today','too late','1','a','c','e','g','i','k')' at line 12.
The whole relevant code is pastebin.com/PtCqZCD0
 
remove the comma after answer_question_6
 
I don't know how I missed that...
Why is it even there, right? It's as if a stray comma ran away to find a friend. I mean, it's not even in the original example.
 
10:20 PM
Sending commands as text is great, isn't it? Sure feels like something you'd wanna do in the 21st century. Hooray for technology
 
What is morse code?
 
10:53 PM
@Kevin Well as you know, you can if you define a custom subclass of that type, then override __repr__ on it. Surely there's a canonical for that? If it gets asked so often? Is there a better Q&A than this one for int?
 
user11006952
@wim Thanks. It's not a special python file but it seems like it is common that people use a "settings.py" to store their "settings/configuration constants"
 
@Aran-Fey You playing auto chess or something?
 
@smci yeah, I'm not done with it yet :P it looked at me funny
 
wim
wth
comments from main don't one-box? did they ever?
@Pax Hmm I would say it's not that common, more of a Django-ism.
 
11:07 PM
@wim they should, always have
 
wim
more common for config to be in a static file such as .ini than in a source code file
 
not on deleted posts, though
 
wim
ahhh
that must be it
SO chat is full of all kinds of weird surprises
 
it kind of makes sense: it would allow deleted content to leak out into chat
 
wim
true but meh?
it leak out in sede anyway
 
11:15 PM
sede results are not indexed by search engines
 
wim
heh, google lists the deleted content anyway. search for dateutil.parser.parse("May 20,2019") to see it
 
SOK
11:36 PM
@roganjosh Thanks! i managed to get pickle working which is great!
 
00:00 - 19:0019:00 - 00:00

« first day (3504 days earlier)      last day (1459 days later) »