« first day (2750 days earlier)      last day (2183 days later) » 

12:06 AM
Well hey, you were close. Unless you're in Europe it is way too early to be tired!
 
 
2 hours later…
wim
2:28 AM
@AndrasDeak đź‘Ťđź‘Ť
 
3:07 AM
flask 1.0 gives :
The view function did not return a valid response tuple
i have app.response_class = JSONifyResponseWrapper set as a class that automatically jsonifies the data
 
 
2 hours later…
5:25 AM
I have three classes inheriting from a base class. The problem however is I am overriding a public method in only one of them. The other two are exactly the same as base class except a private variable.
class fruit(object):
   _keyword = None
   # bla bla

class Orange(Fruit):
    _keyword = 'tasty'
Is this acceptable or should I revise my design?
 
6:10 AM
That's fundamentally flawed design since bananas>>oranges
Just to be sure: do you want class attributes rather than instance attributes?
 
I'd say class attribute
since 'tastiness' depends on type of fruit not individual bananas and oranges
 
6:28 AM
For this guy, is there an internet to singing telegram gateway? I know the cost per report is pretty high that way, but singing telegram hardware includes a 100B-neuron deep-learning network, which should be buzzword-friendly enough to find investors to cover the burn rate.
 
cbg, abarnert
 
I've had a fun week with the gas off and the power going off and on all week, while my landlord is out of communication in some jungle somewhere. Finally all fixed… I hope.
 
I live in the tropics. I am sick of bananas :D
 
6:45 AM
Are you in a jungle in the tropics? Have you seen my landlord?
 
Is he a forest ranger?
 
7:04 AM
Sunny cbg
 
this-week-felt-really-long cbg
 
Don't they all? :D
 
7:35 AM
Hi @abarnert! It's great to see that you're active on SO again. FWIW, one of my favourite lines on SO comes from one of your answers: "It doesn't make sense for a = 2 to turn the number 1 into the number 2 (that would give any Python programmer way too much power to change the fundamental workings of the universe); what it does instead is just make a forget the 1 object and point at the 2 object instead".
 
cbg
 
@Ajit we should switch; we've got loads of apples
bananas are too expensive
 
jjj
@abarnert I don't understand all the downvotes. That's a really funny question.
 
Asking for suggestions like that isn't a good fit for SO. And I guess he got bonus downvotes for posting a link to a text image & that stupid Excel screen.
 
jjj
I kno, I know. The wording is really funny though
Btw good to see you PM 2Ring
 
7:53 AM
@PM2Ring Of course my highest-voted answer after coming back shows how to actually turn the number 2 into the number 3. But I guess that's still not turning 1 into 2. :)
3
 
Hi, jjj. It's good to be back.
@abarnert Nice one. :)
 
@jjj I think some people want to post a funny reply, know it wouldn't be appropriate, and downvote out of frustration. (I of course come to the chat room and post my reply there, where I can see nobody laugh at it and realize it wasn't funny rather than stay annoyed at not having an outlet for my brilliant wit.)
 
jjj
:) I think your reply was funny enough
 
Singing telegrams are always funny. But not as funny as singing mammograms.
 
8:50 AM
^ that's a rarely seen tag
 
9:03 AM
Actually, that ^ is probably a dupe. No time to find one now though, gotta run.
 
 
1 hour later…
10:23 AM
I linked two related questions, so apply your own judgement whether or not it's a dupe
 
10:53 AM
Grrr. I wish people wouldn't pile on downvotes for stuff like this: stackoverflow.com/questions/50060597/django-background-fail Sure, it's not a great question, but lack of MCVE is a reason to close-vote, not to downvote. And even though the OP has no rep to lose I'm sure it must feel pretty discouraging to the newbies to get 5 downvotes.
 
Doesn't the lack of a MCVE mean the question is "not useful" and therefore downvote-worthy?
 
Is there btw. any mechanism that sort of reminds people to recheck a previously downvoted question, if it is improved? It'd be a shame if someone were to actually take notice and improve their initial question to something better, only to receive no attention due to an initial barrage of downvotes.
 
Perhaps. However, the OP does have code, they just didn't realise they need to include it in the question itself. OTOH, I guess the code they linked is their whole program, and not a nice MCVE, but trying to create a MCVE for a Django problem isn't trivial.
 
@Aran-Fey I think his point is that -2 / -3 is probably fine, but -7 is nuking OP and discouraging him from posting anything ever again.
 
Exactly. And according to the latest blog post, we're supposed to try to be more welcoming to the newbies.
 
10:59 AM
I think you can create a meta-post for this? Auto-hide downvotes > sutiable-threshold for new users. I am not sure how well-received it would be.
Or more like, downvote should trigger a vote option instead, or something. I don't know, but this can be brainstormed for better ideas.
 
So the OP only sees 3 of the 10 downvotes, then they improve their question and 7 people undo their downvotes, so now the OP still sees 3 downvotes and thinks improving the post had no effect whatsoever? Not sure how encouraging that would be
 
Maybe discourage downvotes then (in this context)
 
Sounds reasonable
 
Maybe force people to leave a constructive comment (or upvote an existing one) when they try to downvote low-rep users? To make it simple, offer the potential downvoters a choice of suitable canned comments.
 
I would say, leave it up to the downvoter on what he wants to do (simplifying things like leaving canned comments in a bonus), but do certainly let him know when he is about to downvote, that the OP is new and some more effort from downvoter would be ideal.
 
11:07 AM
The votes count should always represent the absolute truth, imo. Maybe really something like a prompt when downvoting a post that already has -3, like 'are you sure you want to do this? maybe op got the point already'
 
stackoverflow.com/questions/50058414/… OP added more info to clarify the question.
 
cbg all
 
@Arne yeah, exactly, like a suggestion.
 
a non pythonic question
linux basically
sorry for the non relevant question
 
I'd check for the correctness of /etc/apt/sources.list
 
11:12 AM
@Arne THe absolute truth can be a bit harsh, though. In an ideal world, new users all read and understand all the SO help pages, and have a feel for how SO works from having browsed numerous Q&A pages before they actually decide to register. But that doesn't happen, and I reckon it's reasonable to cut them a bit of slack when they're new.
OTOH, we don't want to let people just barge in, oblivious of SO standards & culture, ask crappy questions and then throw a tantrum when they don't get the answer given to them on a silver plate.
 
@SohaibAsif but since it's artful/main I'm not sure. Better check on appropriate SE sister.
 
when i do sudo cat /etc/apt/sources.list
deb http://archive.ubuntu.com/ubuntu artful main
deb http://archive.ubuntu.com/ubuntu artful main # auto generated by ubuntu-release-upgrader
two lines in it
 
so it's basically your internet connection or something else messing up
 
@SohaibAsif: why do you think it's acceptable to crosspost this in at least 3 different channels?
 
@SohaibAsif Please do not post the same question virtually simultaneously in three chat rooms.
 
11:17 AM
@PM2Ring I agree, the actual goal would be to invite constructive, positive interaction. I guess my judgement comes from how I'd like to be treated, which is to not feel coddled. But I'd be fine with a warning for downvoters to not kick a dead horse question instead.
I guess one should ask new users what they'd prefer.
 
According to the blog post many new users feel unwelcome, especially if they aren't white anglo-american males.
 
And at some point we have to accept that many new users will feel insulted if their questions get closed as duplicates, even if it answers their question perfectly, and that there's little we can do about that.
@PM2Ring Didn't read that yet, thanks for linking.
 
ooh boy, the PHP room seems quite harsh
 
No, that's teresko
 
Many new users are unwelcome
 
11:23 AM
@vaultah hmm thought so, but didn't it was so tolerant.
know*
 
I sometimes post a comment telling newbies that they shouldn't feel bad that their question was closed as a dupe, unless it's a really obvious dupe that could easily be found by a non-expert with a minute or two of Googling. I explain that dupe questions can be good, because they act as signposts, but that dupe answers are bad because we want all the relevant answers to be in the one place where they can be easily found, and where they can fairly participate in the voting process.
 
11:40 AM
@Arne thing is, posts are not supposed to have an objective measure of "deserved score", votes shouldn't be affected by existing votes
of course this is a thing regardless as exemplified by the downvote rep generator
@AshishNitinPatil the user they're talking to hasn't been without problems here either
oh, last time today it would seem :P
 
Do we have some kind of generic "how to use a dict to group stuff" Q&A for questions like this one? We get at least half a dozen variations of that every day and every time the OP gets an answer that works for their particular case but isn't really useable as a dupe target
And would it be ethical of make a self-answered Q&A about that topic even though we have boatloads of similar questions already?
 
it's not ethically problematic if there's no adequate dupe target, no
but you should make sure there's no adequate dupe target
 
Actually there are way more variations than I thought. Trying to cover all of them in a single answer is probably not gonna work out anyway
 
have you seen some of the "canonical" answers of Aaron?
 
11:55 AM
@Aran-Fey Dunno, but I just added an answer using setdefault. :)
@AndrasDeak No comment. ;)
 
Pffft. There's no way I can write an answer as long and comprehensive as Aaron's. I'd give up before I finish the first quarter.
 
And Wim says that I'm too long-winded...
 
hello, i got a question. is it possible to disable ssl validation in django app for testing? I am using a 3 party library and for testing on my oauth server i have a self signed certificate and beacuse of that my app is not trusting it
 
12:10 PM
Oops. Jean-François Fabre just scolded Daniel Roseman and me for answering that.
 
FWIW, I don't think the dupe he chose is very good
(Because the unpacking and extending is overkill when you're dealing with a single value)
 
@Aran-Fey Agreed. It's similar, but extend is different to append.
OF course, we can add better dupe targets to the list, if we want. Frankly, I can't be bothered searching right now. I just ate way too much pasta, and it's hard to get motivated to do anything. :)
 
I'll be surprised if you find a better one. I already googled a bit and it didn't look promising
 
Ok. Maybe Jean-François can find a better one in response to the comment I just left him.
 
12:44 PM
Can someone give me a hint on how to 'debug' RESTFul serializer (in Django)? How is this serializer being processed?
(I'm using Django)
Oh, I should perhaps point out that I use this serializer in a ModelViewSet
 
Cbg
 
For instance, I'd like to know what processes ProductDestroyView here.
So that I can sneak into that function and see what's going on with my attribute.
 
12:59 PM
Well, that was my first and last venture into the PHP room. I can well imagine some of the contributors there could prompt the blog post to be nicer to new users.
 
@RomanLuštrik Not sure what you want but the official docs and the source code should ultimately answer your question - django-rest-framework.org/api-guide/generic-views/…
 
DSM
Friday cabbage for all.
 
Network monitor project report: I have discovered that ordinary electric motors do not have an easy interface for turning the shaft exactly 120 degrees.
I can tell it to spin for an amount of time equal to (1/3 rotations) / (rpm advertised on motor's packaging) but that puts a lot of faith in the motor's company's marketing team
 
1:17 PM
@Kevin Sounds like you want a stepper motor en.wikipedia.org/wiki/Stepper_motor
 
Mm hmm, I was also looking at servos
The ones I looked at on Sparkfun all required six volts though, which my sad little Arduino cannot supply
 
\o getting-ready-for-fifa-by-buying-some-random-book-and-stickers-for-it-cbg
 
Maybe I shouldn't have shown this OP how to do AES without a proper crypto package... Oh well. :evil grin: stackoverflow.com/questions/50062663/…
 
PM, are you slowly turning into an evil maniac.
Next thing we know, you are recommending Python 2 with using globals and exec
oh the horror, why won't anyone think of the children.
 
@Kevin Scroll down to en.wikipedia.org/wiki/… to see a driver for Arduino
I guess it's really not that evil, since it shows how CBC is built from ECB.
 
1:27 PM
cbg for DSM and Moo
 
@AshishNitinPatil This might just be the lead I needed, thanks.
 
how goes it AD, have you been sleeping better these days ?
 
A-ha, this is where I get lost. Which method does this save call?
 
1:44 PM
morning cabbage
 
cbg to Code
 
@AndrasDeak Was this post supposed to show my activity, including deleted stuff?
Because it doesn't include that one answer that I deleted.
 
@PM2Ring did you finish cryptopals? I started it but got a little frustrated with how vague some of the problem statements are.
 
@Arne "above 10k"
@MooingRawr not really, thanks. But honestly the real issue is the quantity, not the quality :D Last night I was up after 2 and got up at 7...
but I'm fine :)
how are you?
 
ahh, not if the searched user has 10k but the searcher. That makes a lot more sense, too.
 
1:54 PM
as long as you are fine and functional, that's all that matters. sometimes I whisper this to my lambda functions when I don't understand why it works but it just works....
I'm fine, it's Friday so feeling good. But the office is hot and we haven't turned on the AC yet (just fan air flow from our central system) :(
 
can a function not be functional? 🤔
 
yes...... no ...... idk..... maybe sure why not D:
just don't be so judgmental and anything can be everything.
 
@Arne it only applies to your own posts so the two users always coincide
 
Should I reopen this question? The OP claims none of the answers work for them
 
2:11 PM
quick one
Florian found that out
ralt@zap at ~> python2 -c 'foo = 1; bar = [foo for foo in [1, 2, 3]]; print(foo)'
3
ralt@zap at ~> python3 -c 'foo = 1; bar = [foo for foo in [1, 2, 3]]; print(foo)'
1
how come?
 
DSM
In python 2 listcomps leaked the loop variable. In 3 they don't.
See poke here.
 
2:42 PM
cabbage
 
cabbage
 
cbg to you two
 
hey guys
 
@Code-Apprentice No, I didn't. I was also annoyed by the unclear problem descriptions. I got up to 2/17 CBC bitflipping attacks.
 
I didn't even get that far
 
2:51 PM
hi all
 
@Arne I think if it mutates the state it's not a 'pure' function
 
present sir
 
@Arne There's now a Meta question in response to that blog post: meta.stackoverflow.com/questions/366665/…
 
anything that does I/O .. unless you use a Monad
 
cbg
 
3:00 PM
I should write more Meta answers, that one's doing rather well. Pity they don't earn rep. :)
 
rb folks
@PM2Ring terrible
not sure what to say
 
@PM2Ring to be fair, writing clear problem statements is an art form. There is a fine balance between giving clear instructions yet leaving enough room for the student to explore the topic.
 
Is it just me or all programmers use 'colors' instead of 'colours' regardless of nationality
 
3:17 PM
@Code-Apprentice Fair point. The early Cryptopals problem statements were fine, IMHO, but they did start getting a bit vague, if not downright ambiguous.
 
@PM2Ring and unclear
too many times, I was uncertain about what the expected results should be
 
@Ajit I normally write "colour" when writing normal English, but when I'm coding I tend to use "color" because I'm probably doing some GUI stuff & the library I'm using uses the "color" form in function names, etc, and I think it would be confusing to have both "color" and "colour" in the one document.
The exception is when I'm writing POV-Ray SDL programs. It started life in Canada (as DKBTrace), and its author made a decision to permit both "color" and "colour", so naturally I use "colours". :)
typo stackoverflow.com/questions/50065320/password-and-sign-up-code Incorrect indentation. Only 1 more vote needed.
I think this poor OP probably needs to nuke the entire installation from orbit: stackoverflow.com/questions/50065432/…
 
makes sense
 
@Ajit The people who write languages state that they're in English, but they are Wrong. They use American language preference.
 
3:37 PM
when matplotlib starts accepting a colourmap keyword we can start talking about English ;)
 
wow this restful framework is making me rest less
 
It was a pain learning css without a linter back in the day
 
@PM2Ring Sorry if I was cluttering your answer.
 
@toonarmycaptain That's quite ok.
 
hey guys, is there no way to send a list as the top-level structure as a POST request?
in the constraints of django
 
3:51 PM
@OneRaynyDay I usually use Requests to send POST requests
All you need to do is convert it to a string before sending it
 
@StevenVascellaro see, but I have a datetime object, and the way Django RESTful handles stuff is to pass it into a Serializer
json load and dumping a datetime isn't supported by default, and I doubt it is "The Right Way"
 
@Ajit I've forgotten most of the CSS I learned, since I've hardly used it in the last few years. My HTML is also getting very rusty, as is my JavaScript, and what I do remember of them both is probably mostly obsolete. Oh well. :)
But when I was learning CSS I did have a nice resource: one of the regulars on the XKCD forums is a member of the CSS Working Group (as well as being a Google employee), and one of his main CSS jobs is looking after the documentation, so his knowledge of CSS is superb.
 
import requests

session = requests.Session()
headers = {"Content-Type": "type-name-here"}
response = session.post("example.com", data=my_data, headers=headers)
 
@StevenVascellaro my_data can be a list here?
 
@OneRaynyDay Sounds normal to me. I've been dealing with XML where everything is a string.
 
3:55 PM
are you guys having two separate discussions? :D
 
@OneRaynyDay I'm not sure. I've always converted my objects to a string before posting.
 
oh, that wasn't a reply to that remark, phew
 
@PM2Ring When I learnt my limited, rusty HTML (and when I used it most), CSS wasn't around, or wasn't ubiquitous like it is today. I had a little bit of a moment when I came across it in the Flask tutorial a couple of weeks ago. It does look like it's very useful, and definitely simplifies things, from what I can see.
 
@StevenVascellaro and I'm guessing you have a custom json serializer to strftime and strptime the datetime objects?
 
@OneRaynyDay I'm dealing with an XML API that accepts dates as a plain string. I just use str(datetime)
(After ensuring the datetime uses the correct format)
current_date = datetime.date.today().strftime("%m/%d/%Y")
date_string = str(current_date)
 
3:59 PM
@OneRaynyDay You may need to loop over the list items to convert them into the string format you want. If you convert a list to a string as a unit, the items in the list are converted to strings using their __repr__ method. That's ok in some contexts (like developing & debugging), but often it's better to have them converted using __str__ instead. Eg, if your list contains datetime.date objects, as I mentioned in this answer yesterday: stackoverflow.com/a/50057774/4014959
 
cbg
 
@toonarmycaptain CSS is amazing, and very powerful. However, some of the CSS design decisions can be a little hard to comprehend, if not downright insane. ;)
Yesterday I learned that some people call the green "accept" checkmark "the pipe".
@TemaniAfif “each one may have it's own interpretation” — the accept icon has even been referred to as “pipe icon” once. — Xufox 2 days ago
 
so when you're a new user on Stack Overflow you have pipe dreams
 
I guess "the pipe" makes sense: when I see the poor quality of some of the accepted answers I wonder what the OP was smoking. :) — PM 2Ring yesterday
 
So does running python manage.py test create a test db, but not populate it with tables?
 
4:07 PM
@JGrindal it makes the necessary tables. But they have no rows.
@PM2Ring that's... annoying :P I'm just not sure what format by default the django serializers need. Because origianlly it's as simple as:
serializer = Serializer(data=request.data, many=False)
if I post with the information:
client.post("/some/url/path", {"field1":"foo", "field2":datetime.now()})
But now... "Hey you want to send a list? Oh that's too bad! Do 10x the original work!"
 
Lazy solution: use unix epochs to represent datetimes. And cross your fingers and hope you don't have to deal with time zones or dates before Jan 1 1970 or dates after January 19, 2038
 
@OneRaynyDay It may seem annoying, but there's a reasonably good justification: nice programs don't show raw lists to the user, they extract the data from the list and format it nicely. The ability to print lists as a whole is a convenience so that programmers can inspect lists' contents. Of course, that justification doesn't mesh so well with the need for serialization. ;)
 
@OneRaynyDay I'm trying to run it and its saying
"no schema has been selected to create in"
 
@PM2Ring Well... Okay. But that still doesn't solve the issue of not being able to pass in a list as the data of a post request :P
 
cbg
 
4:17 PM
@JGrindal try RESET search_path
 
@OneRaynyDay where?
 
maybe you need to add create permissions to all
 
You said earlier that providing a custom serializer/deserializer for datetimes to json.dump didn't feel like the Right Way, but I think it's a reasonable approach as long as both endpoints understand the format.
 
in your psql
 
@OneRaynyDay I know its creating it because I can see it in pgadmin
 
4:19 PM
@JGrindal oh hmm... I'm not too sure then o_O try setting your db to a different test psql, you can change it in your projects/settings.py, change database settings depending on whether you have 'test' in your sys.argv
 
CSS was my first programming language. Unfortunately, it was also my first encounter with American English. Hence, I made a lot of "background-colour: blue" kind of errors. It took a while to unlearn the spelling of colour
 
@OneRaynyDay Where is that specified?
 
> you can change it in your projects/settings.py, change database settings depending on whether you have 'test' in your sys.argv
 
I mean, what am I changing in settings.py?
 
DATABASES
 
4:30 PM
I understand that I'm changing databases, but how do I point test at a different database is what I'm getting at. it's not as simple as just creating a new database with a different name - how do I direct django to, on test, look a different db
 
Are you using docker? You could set different environment variables
 
Yes you can
 
No, I'm not, but I can control envvars from my ide
 
I use something like this:
if os.getenv('DOCKER_CONTAINER'):
    POSTGRES_HOST = 'db'
else:
    POSTGRES_HOST = '127.0.0.1'
 
in your docker file you can do something like ENV VAR_NAME=VALUE
 
4:37 PM
sorry, had to go, special catering on fridays
you set DATABASES = { ... } depending on if statements regarding sys.argv
 
4:58 PM
I found my issue
postgis is a giant pita, and django doesn't know how to create the schema for it.
 
5:28 PM
Wow, we're quiet in here on Fridays.
 
Yep, And here I am at 1:30 AM on a Friday night.
 
I concur
 
Wait, are we in the same timezone?
 
Earth time is the best time
 
many cabbages, all. It's been a while
 
5:38 PM
cbg
 
recbg, welcome back
 
anyone with sklearn experience in here?
 
I've used it few times, but not a pro by any means
 
cbg
@Ajit Not at present.
 
5:57 PM
Say I have a big list (or other collection) of tuples of various sizes. I want to find all of the tuples of minimal length. Is there a smarter way than to do either of these?
minsize = len(min(lst, key=len))
minima = [u for u in lst if len(u) == minsize]

# or

lst.sort(key=len)
minima = []
minsize = len(lst[0])
for u in lst:
    if len(u) == minsize:
        minima.append(u)
    else:
        break
I assume the 1st way is faster, since finding a minimum is easier than sorting (O(n) vs O(n log n)); OTOH, TimSort is pretty fast...
Actually, with the sort-based approach, I could just scan and then do a slice, rather than building the new list by appending.
 
First one is pretty much how I'd do it.
 
wim
first one
 
Thanks, guys.
 
I thought there might have been a builtin function that gets the minimum, returning a list of all elements tied for smallest, but I guess that was a fever dream
 
wim
also the first part (finding the minsize) remind me of Length of longest word in a list
 
6:05 PM
@wim Sure. But that's the easy bit. :) Getting all the minima (or maxima) is the bit I'm concerned about.
 
wim
sorting is unnecessary here so using the 1st way seems like a no-brainer to me
 
It would be nice if the standard library provide versions of max and min that returned ties. I guess it's reasonable that built-in max and min are optimized to just return a single item, since I assume they're written in C, OTOH, I don't think it would impact performance too much if they were enhanced to take an extra arg or two to indicate that you'd like some or all ties returned.
 
Do we have a good dupe for "bytes/bytearray repr is confusing"?
 
wim
yeah, maxs and mins , returning lists. could be nice feature.
 
6:16 PM
@user2357112 I don't think so. We don't get a lot of newbie questions about bytes or bytearray, and I don't think we have any bytes / bytearray questions in our canonical collection.
 
The reason I was asking about that multiple mins stuff is in relation to this bin packing question I just answered. I don't need it for that question, but it'd be a nice extension. :) stackoverflow.com/questions/50066757/…
 
wim
that bin packing thing is in numpy already iirc
> We sent mixed messages over the years about whether we’re a site for “experts” or for anyone who codes.
 
@wim Nice, but in the question that 2357112 linked the OP wants the reverse operation of what your answer does. I see that the OP in your question does that using array.array, which to my mind is overkill compared to just passing the bytes / bytearray to list().
 
wim
hell yeah. I'm still confused about that.
 
6:23 PM
@wim Really? Wow! However, the OP didn't mention Numpy, and not everone has it installed. But I bet Numpy can do it faster than my plain Python code. :)
 
wim
OP don't need to mention numpy in order to be recommended numpy
^ this is one finds out about numpy and all its wonderful uses
 
True. OTOH, if it's homework, then he probably can't use a canned Numpy algorithm, he's expected to do it the long way.
 
I'm trying to submit a PR on Github. The little note I left for myself the last time I tried this says "use the real master branch as 'head fork' and your new branch as 'base fork'" but if I do that then it says there's no differences. If I do it the other way around, it displays my changes. Did I make a mistake when I wrote my little note last time?
 
wim
6:44 PM
yeah
base fork is theirs
head fork is yours
and don't use master branch from yours, use a feature branch
so if their github org is doggywarez and your github username is kevin, it will be:
doggywarez:master <-- kevin:mycoolpatch
makes sense?
 
Yeah. Ok, it's done.
Their documentation had an incorrect type signature for an interface I needed to implement. Cost me a minute of frustration. Let's put my suffering to good use
 
@Kevin Kevin's going to the dark side?
 
I think my how-to note got it backwards because it first talks about doing a PR if you already had a fork and it had fallen behind the master. Then you would do a head:theirs base:yours PR in order to make your fork up-to-date.
Then I copy-pasted that line into the section discussing PRs intended to make a change to their branch, but didn't swap the head/base
 
wow I officially hate django-restful
the validation step takes 8 seconds for 10k rows? what the hell?
 
7:16 PM
stackoverflow.com/questions/50068752/… this has to be a duplicate of something, just can't find a question that literally only requires df1.merge(df2)
 
wim
7:56 PM
are you talking about django-rest-framework ?
 
@wim yes*
 
8:14 PM
Hey Guys, question for you. I've got a server collecting data via a program called Stunnel. Stunnel decrypts the HTTPS traffic for me, which is great beceause I'm trying to run IDS tools against the unencrypted data. However the problem I have now is Stunnel needs an open port to terminate the data on.

I've been using Netcat while I'm deving my solution, but its not very persistent and I noticed that after a while netcat sessions will get killed, and they have issues handling multiple sessions.
or, would it be better to use a different tool? I'm thinking I can do this with a single python script, and have a cron job that starts it up on boot, but not sure if this is the best way to go about this
 
Hey guys, is there any cookie-cutter (i.e.: scale-able) way to make a lot of videos via python and source text (ideally it'd be nice to be able to feed something like HTML and some kind of animation instruction set like fades, scrolls, etc)
 
wim
8:37 PM
@OneRaynyDay it is a good framework but it doesn't protect you from making stupid queries
in particular, if you just use DRF and you don't really understand SQL well, it's very easy to accidentally write an API which suffers from the "n+1 queries" bug with related objects.
i.e. a list request for a table with 10 objs makes 11 queries, instead of 1 query.
I recommend to turn on a sql logging handler when developing with drf, to make sure you don't cause bad queries with your serializer/routes setup
 
9:01 PM
home time, have a great weekend \o
 
9:29 PM
@wim I've seen the (N+1) thing being referenced alot, but I have no idea how that actually happens
 
cbg
I've been using PyCharm for two years and it's okay, but the ability to click and refactor is awesome.
Stuff, like renaming functions and moving them around
But is there a way to get this without PyCharm?
And is there a way to extend this to IPython notebooks?
 
wim
@OneRaynyDay you should learn. step 1: turn on sql logging.
 
9:46 PM
Ah, apparently I'm supposed to be using Rope?
Oh jeez, finding a tutorial for this is non-trivial.
 
python rope tutorial?
python rope tutorial -fiber -climb -climbing -rock
I don't know what else rope is supposed to work with, but +that
 
Yeah. I'm starting to get the impression it's really only ever supposed to be used with an IDE.
 
10:18 PM
Hey, just got enough rep to talk in the third place!
That was my first message lol
wassup
 
iirc, rope is a tree-based data structure that is commonly used in editors
for fast inserts/deletes etc in log time
@wim unfortunately, I don't have admin privilege to the psql that I'm using.
But will ask for log file access
 
wim
You don't need admin access. You log the requests you're making from the python side.
something like this
    import logging
    logger = logging.getLogger('django.db.backends')
    logger.setLevel(logging.DEBUG)
    handler = logging.StreamHandler()
    logger.addHandler(handler)

    def toggle_sql():
        if handler in logger.handlers:
            print('turning sql logging OFF')
            logger.removeHandler(handler)
        else:
            print('turning sql logging ON')
            logger.addHandler(handler)
 
@wim ah. This is super useful. Thank you for the snippet :)
 
ok ignore me lol.
 
10:35 PM
@OneRaynyDay fyi, you are correct
 
wim
10:46 PM
Hello Flaming_Dorito, welcome to room 6.
 
11:27 PM
It's not the best room, but it's the only one we have.
 

« first day (2750 days earlier)      last day (2183 days later) »