« first day (4566 days earlier)      last day (449 days later) » 

3:55 AM
Hi, I've the following code
prompts = {
                "core_idea": "What is the main idea of this paper/document?",
                "research_problem": "What is the problem or issue addressed in this paper/document?",
                "methodology": "What methodology or approach is used to address the research problem?",
                "dataset_availability": "Is the dataset used in this paper/document publicly available? If so, where can it be accessed?",
                "code_availability": "Is the code used in this paper/document publicly available? If so, where can it be accessed?",
It throws following error
inputs = {"text": doc["text"]}
TypeError: 'Document' object is not subscriptable
Any idea how to fix this? Thank you
 
 
2 hours later…
6:06 AM
@MarceloPaco when you have a specific debugging task with another user it's probably better for everyone to start a dedicated chatroom with them rather than bringing the one-on-one to a general chatroom such as this one. You can create chatrooms with a user in their chat profile chat.stackoverflow.com/users/12975537/emm
I'll probably move your above discussion to a dedicated chatroom
 
6:23 AM
Sounds good. Thank you and sorry again 😅
 
 
1 hour later…
7:28 AM
does python 2 support decorator?
 
okay thankyou
 
 
3 hours later…
10:13 AM
This must be one hell of a bored UI designer. The goals section a bit down the page really is a disorientating experience for me. I guess that's one way you can obfuscate your goals for net zero - make every seasick trying to read them :D
 
10:54 AM
thanks, I'm dizzy now. also seems downright buggy, there were some items in the right section that I couldn't scroll down to.
 
It's all over the shop. If you go back up it doesn't seem to stay in sync. It's very important you see those scrolling numbers, though :P
 
I'll just trust you on that one and not verify ^^
 
11:58 AM
Since there was a discussion on this a few days ago, perhaps this unix.stackexchange Q&A may be interesting to some people: Process unicity: how gathering enough information at process start time to be sure to kill it later, and not one with the same pid coming days after?
 
12:49 PM
@roganjosh Reminds me of a startup I used to work for. Their site is the worst I've seen so far UX wise
 
@MisterMiyagi you definitely told me about pidfiles, thanks
 
That is too much scrolling oh god
 
@AlexandreMarcq Good lord, that one-ups my example and then some :O
 
On the topic of bad websites... here's what happened to my chatroom css (rn)
 
I can still read the content. You didn't explode it well enough
 
12:59 PM
yeah but idk why it's happening. I did overflow: wrap ugh
maybe because they're list items?
 
The real fun comes from when you have a website that is only functioning incidentlly because of HTML's forgiving nature. Then you add that one box and it's like a steamroller went through the site
 
@roganjosh the content isn't readable. can you understand it xd
 
Oh, I just assumed that the text is what you wrote. It's legible, not intelligible
 
itis
 
Oh, I missed the real gem of that site @AlexandreMarcq. Clicking the links at the top forces it to cycle through all the animations at full speed. Ahahaha; that's given me a proper chuckle.
 
1:26 PM
@12944qwerty figured out what was happening here. It needed a space to properly wrap itself. But my text was extremely long without spaces which is why it didn't work.
 
2:04 PM
Doesn't it suck when people absolutly hate on you when you say one thing that you didn't know but they thought it was something even a baby would know?
 
2:29 PM
I guess it depends on what "hate on you" means. For myself, I kinda relied on people calling me out on obvious stuff I'd missed because my learning was (and still is) pretty haphazard and situational
I can cover a wide surface area and yet my Death Star has a lot of exhaust vents still
 
3:16 PM
The average SO commenter...
 
The easiest way not to get hate when asking a question is to make a [mcve] (does this still work? edit: no it doesn't)
Also, hate is a myth. Stack Overflow is very welcoming to probies these days
 
Just happened to me here
 
it depends on the MRE and the complexity/size too. You have to make your problem/MRE out of context as much as possible. If it doesn't make sense taken out of context for your case, just frame it in something that make sense, generally (that way you prevent the comment saying "why are you doing this?")
 
@12944qwerty I must be missing something because I don't see any disrespectful or hateful language in that comment
 
same, looks informative too
 
3:25 PM
the "of course" doesn't add anything useful though
if it were so obvious, it wouldn't have been a problem, right? so why add language that doesn't achieve anything?
 
It wasn't the language. He voted down and cved immediately. It came across that way to me
 
@12944qwerty you don't know that, do you?
 
No, but either way someone had done that
 
the "of course" part, while unnecessary doesn't seem hateful. Also, yes you shouldn't make assumptions on who voted on your posts because the two events (posting & voting) happening at the same time could've been entirely coincidental
 
@12944qwerty you also don't know if they're male/female/diverse, lots of assumptions you got there :p
 
3:30 PM
:/
 
Anyway, I don't think you should let that get to you. I had a lot of down and some up in asking questions. Even if you do everything perfectly, there always this one case where it's not well received still. It does not matter though, if the only thing that is important to you is getting a solution
 
Also, does anyone know if Stack Overflow gives out 250k swag? I know they used to. It's been several years since I hit 250k but never got anything. When I opened a ticket, it was automatically closed without any comment or reason.
 
@cs95 I think they stopped, at least based on a meta post I saw once
let me find it unless someone beat me to it here
 
Someone asked that same thing a week ago
33
A: Will there be an Amazing 2019 Stuff-A-Way?

animusonUnfortunately, we are no longer able to promise swag for any activities on our site. That covers spontaneous contests which aren't sponsored, as well as the swag for 100k and 250k milestones. I've written previously about the temporary hold while we transitioned to a new swag provider. We comple...

(check the 100K starred message on the right ;)
 
3:34 PM
I feel like I remember seeing that, but also saw it was reinstated soon after because "it was a vital part of preserving good relations with the community" (paraphrasing) or maybe I'm just going senile
 
I guess it's still possible for them to send it to you, based on a recent post made in 2022 and 2020, but I'm not sure
 
@cs95 It works, just no space allowed between the ] and (
 
and it looks like they paused it again
 
[mcve]
doesn't seem like it works
 
3:42 PM
??? I'll try mcve
That was [mcve](https://meta.stackoverflow.com/questions/366988/what-does-mcve-mean)
 
I used to have a chrome extension that did that for me :')
 
 
1 hour later…
 
1 hour later…
5:57 PM
@cs95 I just hit 100k a week ago. After some research, I figured out that they are no longer sending swag for rep milestones like 100k and 250k. However, a couple days later, I did get a lovely ecard (URL too long to post here) congratulating me on my achievement. You need to have your email settings configured to receive mail on contests, etc.
This link should bring you to it.
 
 
1 hour later…
7:00 PM
@Arne I guess this is where I diverge from the common sensibilities. The "of course" does convey to me that I am missing something fundamental. Do I like being on the receiving end of it? No - but I'm not supposed to like it. At the same time, I don't really take it personally in technical subjects. If I want to get offended, it's better to just turn to Meta
 
Yeah. I mean, there are such things as being evident. It exists. To the question "should I be arrested if I drive at 120 km/h in a school zone" answering "of course" is really needed. Like, of course you should be arrested if you're driving recklessly in a place full of small children that ask nothing more than to jump into the street.
And in some cases, programming matters can be as evident as that, I believe.
 
I really like that anaolgy
 
Yeah, it is a judgement call for sure deciding when things are obvious and when they aren't. It's also a decision when it makes sense to express that opinion. My opinion with respect to "how should I provide feedback in programming" got influenced a lot by mtlynch.io/human-code-reviews-1, I link that post to every junior that enters my team.
3
 
8:03 PM
>So, why is that the way we talk about code reviews?
presumably, because we don't see that sort of communication as being part of the purpose of the review.
that said, I can tell this is good right from the 'techniques' summary list. in particular I am a huge advocate of "never say 'you'", and have said the same when it comes to editing SO answers.
(in not quite the same words)
 
Who wrote the code?
I spend quite a bit of mental energy in the general world to make sure I never say "you should do X" or anything of its sort. But with programming, there are quite clear guidelines... that's why I gravitate to it. In that space, surely objectivity should win, and "you" (the programmer) takes responsibility for 99.99% of what happens next
 
8:26 PM
bah. jetbrains added a git history tab to the files, so it gets easier to know who wrote the code without actually asking (:
We always get back to this tension between "is there any time in life where being a bit rude is actually ok". Like, I think we should strive not to be rude willingly. We should also strive not to keep reading subtle put downs in sentences we read.
For instance, "I link that post to every junior that enters my team", could be construed as implying anyone more than juniors should already know it, much in the same way than someone could take offense in "of course"
But it objectively would not make any sense for me to feel put down by Arne's link of the post, even if it's presented as something for juniors.
 
but non-juniors don't see the non-sending of that link
 
blessed ignorance
 
in fact a non-junior (who does reviews) when linked that posted (unless as "hey check out what I found) could easily take it as "you need to do better"
 
yeah, it's 100% what I felt on the moment :P
and decided to overthink myself in another direction, because I also take great care when reviewing stuff
 
I feel like the "Be generous with code examples" part takes more care than described - i.e., awareness of the person being reviewed. If I received a fully-worked example for a list comprehension I would probably feel condescended to
with "can we replace this with a list comprehension?" I would perhaps feel silly for not having written it that way in the first place, but at least the annoyance would be internal.
(also, didn't f-strings exist when this was written?)
...on the other hand, if I were the reviewer, my instinct would be to just show the revised version without commentary at all. :/
(aside from code review, I'm a proponent of just, like, voluntarily refactoring and improving stuff)
 
9:05 PM
@FélixAdriyelGagnon-Grenier actually, the reason I link it to juniors is because I want them to know their worth. asking for code reviews is scary when you're fresh from uni/bootcamp, and if someone senior puts them down I want them to know that them screwing up code is less bad than someone else screwing up tone
 
"Asking for code reviews"? Wow! :D
 
my assumption is that anyone non-junior has developed a thick enough skin already =)
@AndrasDeak--СлаваУкраїні slipped on the return-key there :p
 
I just meant (80% jokingly) that I usually see auto-assigned reviewers rather than explicit requests from juniors :P
that being said I've taken up reviews for juniors when their own team had fewer experts with sufficient bandwidth to teach them via reviews
 
you think they approached you nervously?
 
No, but then again they didn't approach me per se. Just complained about lack of experts bonking on their head during reviews, and I offered to bonk :D
But this is an assertive dev with a strong motivation to learn and do stuff right. That needs learning too if someone doesn't do that innately.
 
9:14 PM
True
 
So I can easily imagine other juniors, especially the ones you should be careful about giving feedback to tactfully, to be more nervous about that kind of thing. But I'm always tactful anyway, even with experts.
I do need to be polite with all the 100+ comment PRs I leave behind :D
 
100+ comments PR sounds lovely
 
can always soften the impact of such a review by using cute emojis
using a different pattern saves memory here 😊
 
even my mother could get this right 🙃
The most comments I remember accumulating within the same review round was around 60 I think? But a lot of that are trivial typos and stuff like that which are easier to suggest an edit for than fixing them myself and pushing.
 
is this really the best you can do? 💀
@KarlKnechtel yeah, I don't take this article as a set of rules either, even though I like it. communication is complicated, especially if you know the person you're talking to, and it's impossible to provide a definitive and generic set of "this is how to criticize" rules
I'm certainly rude in code reviews with people where I know they'll think it's funny
 
9:30 PM
I like when there's a Torvalds in the room, because it reassures me that I won't get kicked off the project for being a milder version of Torvalds
 
I've identified people on my team who will make you work for their approval versus people who will happily rubber stamp to unblock you and I select who request a review from depending on how much time I have to get whatever it is out the door
 
I know this is not optimal but I really need this out my door, pls trust me ;-)
somewhat related: never underestimate the impact of a rightly placed TODO
// TODO make this actually work
 
9:59 PM
A // TODO(bug_id) is better than a naked // TODO
 
@KarlKnechtel ohh, any opinion you got about lkml.org/lkml/2018/9/16/167 and the code of conduct they adopted?
I committed to a repo a while ago which banned TODOs and FIXMEs =( I know they're considered harmful, but banning them..
 
10:30 PM
@Arne I vaguely recall that incident. I have many thoughts about Torvalds' conduct particularly in regards to that, but not really a coherent statement about it.
I agree that Torvalds has often made things personal in inappropriate ways. However, much criticism of Torvalds seems to revolve around his... passion and use of colourful language, irrespective of whether he was actually making something personal at the time.
I do know very well that people are prone to taking things personally regardless of how they are phrased; see the constant stream of people complaining on Meta about "getting downvoted"
the other side of this is that I have found "codes of conduct" to be largely a trojan horse used to introduce various political memes into a project's ecosystem.
people generally do not need to be told to be bigoted; and bigots generally will not stop their bigotry because you ask nicely - because it stems from something they honestly believe and consider important.
what happens is that a code of conduct becomes used to propose new ideas about what bigotry (, harassment, etc.) actually entail
separate to that, the presence of a heavy-handed policy carries chilling effect. It makes one think that there must have been specific problems of all of those sorts, in order for explicitly written policy to exist.
which is to say, its existence is inherently accusatory.
 
Which one is preferred?
# A
output = []
for n in notes:
    output.extend(getTone(n).tolist())
output = np.array(output)
wf.write("twinkle.wav", fs, output.astype(np.int16))

# B
output = []
for n in notes:
    output = [*output, *getTone(n).tolist()]
wf.write("twinkle.wav", fs, np.int16(output))
I just learnt spread operator. :-)
 
wf.write("twinkle.wav", fs, np.int16(t for n in notes for t in getTone(n)))
if you're going to go back and forth with lists, at least use Python's tools, such as list comprehensions. This approach is idiomatic for creating a flattened result: stackoverflow.com/questions/1077015/…
 
OK. THank you.
 
that said, there is presumably better Numpy-specific stuff for this. np.concat I think?
but notably in my version: I don't call .tolist, because a Python-level iteration is necessary anyway, so whatever iterable comes back from getTone(n) is fine already.
if I'm thinking straight:
 
10:47 PM
    wf.write("twinkle.wav", fs, np.int16(t for n in notes for t in getTone(n)))
TypeError: int() argument must be a string, a bytes-like object or a real number, not 'generator'
 
wf.write("twinkle.wav", fs, np.concatenate(getTone(n) for n in notes))
@TheRealMasochist ah, it needs to be explicitly listified then.
 
    wf.write("twinkle.wav", fs, np.concatenate(getTone(n) for n in notes))
  File "<__array_function__ internals>", line 200, in concatenate
TypeError: The first input argument needs to be a sequence
 
in both cases
with surrounding square brackets.
wf.write("twinkle.wav", fs, np.concatenate([getTone(n) for n in notes]))
wf.write("twinkle.wav", fs, np.int16([t for n in notes for t in getTone(n)]))
I don't do a lot of scientific computing stuff; my specialty is more parsing and formatting data
 
@KarlKnechtel This one works. Thanks.
 
of course, I also can't see your getTone, so.
 
ok, so the output should be a 1d numpy array of floats that are within the int16 numeric range?
(you may also be interested in looking up functools.partial, btw)
 
@KarlKnechtel Yes. Because the amplitude of the wave is np.iinfo(np.int16).max.
 
11:09 PM
@KarlKnechtel hm, i found the most interesting part about the whole tale being Linus' shift from code>people to people>code, as it was mirrored by large parts of the community too, drawing justification from guys like Linus in particular
@KarlKnechtel I haven't seen that actually happen yet, even though I was initially also put off by the strong language they often times use
 

« first day (4566 days earlier)      last day (449 days later) »