Use hide for story score

Streamed

First stream!

scratch


three paths for changing flags to not punish score:
 1. new flags now have a score of 0
   update_score below stays the same, hotness needs to ignore flags
 2. update the score sql below to filter out votes w -1 score
   break existing stories scores in the database, big swing on next vote
x  update score_delta in Vote.vote_thusly...
x  update Story.update_score_and_recalculate, Story.calculated_hotness
x  update Comment.calculated_confidence
x  update display in Story. and Comment.vote_summary
x  flags shouldn't touch user karma (is this in Vote?)
x  story scores can't go negative anymore - opacity on listdetail should base on flags
 3. add model for flags, move out of voting
   bigger implementation; have to touch all the vote code paths
   add model for flags
   migration: create Flags for all -1 votes
   time bomb test to delete flags from db
   update Vote.vote_thusly
   update Story.calculate_hotness
   update Comment speed_limit

x concern: hide only does -1 if the hider hasn't voted or commented in story

fakes! https://www.amazon.com/s?k=principia+discordia&crid=1YJV3EMHJPNND&sprefix=principia+discordia%2Caps%2C117&ref=nb_sb_noss_1

issue with replying comments:
  we don't want to send people into a flamewar
  bug now the score caching column doesn't include flags
  I don't want to join against hidings bc perf <- maybe this is ok
  I don't want an expression score - flags bc perf
  use flags directly?
    

Transcripts are generated with whisperx, so they mistranscribe basically every username and technical term. They're OK but not great, advice appreciated.

Recording



53hejihyuuga oh darn i can't give bits
hejihyuuga thank you for all the work you do on lobsters
Thank you.

02:26pushcx I have to be an Affiliate for that, which requires streaming 8 total hours on 5 days after today.
Okay.

03:30pushcx And I will probably turn it off, https://lobste.rs/s/95uler/woul…
Let's get that.

06:58hejihyuuga There's a chance you can't turn it off/it takes extra effort to turn it off once you get affiliated
OK. Hey, folks. I'm going to get started. Let's clear that out. And let's see. Where am I? All right. Close out these extra browsers. Quit talking to people. So stream here. I forgot to do any office hours, and somebody in the announcer post comments about me streaming already asked if they could have some help with their sister site, which is in Armenian. So if that's you, put it up in the chat, and I'm happy to help. Otherwise, if anybody's got any queries they want to run, that's...

07:51up here of yeah i will run sql or queries against the products that don't reveal pii or make the worst of leaderboard i'll give that a second but then otherwise if you saw my other browser tag go by there a couple of weeks ago somebody said hey let's have a flag for stories that says this story's not very good. And I had a very weird experience of yeah, we tried that a dozen years ago and it didn't work. And I said it a little nicer than that because of course things change and it's possible that it would start working but there wasn't really anything that was different over the exact thing we tried. hejihyuuga your microphone is cutting in and out
So I had one idea that I left in a comment there of let's say that there should be a... pushcx whoops
So my microphone is cutting in and out. Whoops. pushcx prob a bed noise gate setting
So that is probably a bad noise gate setting. Let me see if I can unfold that. Sorry, this didn't come up in the first one. Please let me know if it seems to be going better or worse. And I am going to keep rambling so that hopefully there is some amount of audio. Where the hell is the advanced filters button? Is it here? No. Still getting the hang of it. Still getting the hang of OBS. What if I say that? All right. Hedgie Hugo, can you let me know if it sounds better or worse now? I feel like an optometrist. Better or worse? One. or two, three, or four. gtfrvz still choppy
All right. Still choppy. Cool.

10:23All the indicators about, let's just turn that off. OK. So I've entirely turned off the noise gate.

...40gtfrvz no
Hopefully I sound better now? GTFRVZ? Does it seem more reasonable? No? Great. Anybody know OBS setup? Because I sure don't. If I could just bring it a little closer to me, there isn't really much else in the way of settings. Let's pull up that volume panel. Maybe it's some system setting of, like, use terrible quality. Linux audio, it's super reliable, right? gtfrvz seems better now
That looks good, that looks good. Which one? No, it's using the actual mic instead of the webcam. So that part should be fine. Yeah, everybody looks set fine. All right. I am going to assume it's in an okay state and keep rolling. gtfrvz it got worse again
Feel free to interrupt me if there are that or other issues. Obviously, this is not a super published stream, as you can guess by the fact that there's a bad shell up on the screen rather than something cool. So it got worse again. Fuck if I know. Sorry for the technical issues.

12:24Do we have a compressor?

...30What if I just do a... How does this look? That looks also like it's fine. I'll cut out some of my typing and clicking noises.

...55This Vox setting is already at 100%.

13:05See, this is the kind of thing I did the, tech stream on Saturday. ShakeOut. Nobody said anything about it being crappy. Bitrate is happy, the web is happy, the CPU is happy. Which, I mean, the CPU is idling at 100%. It's fine on this end. I don't have a... Let's see if I can just... any room tone or anything it's gonna be

14:14gtfrvz so far so good
So if I boost this here, a little more, a lot more. Okay, I think that's in a pretty good place. All right, all right. Totally lost my train of thought. So where was I? Thanks for that feedback. I really appreciate it. I don't know how to... reward it on stream. It's still pretty new at Twitch. But thank you especially for GTFRVZ giving that nice feedback. So if anybody has wandered in and wants to run queries against the prod database or access logs, we can do that. Otherwise, somebody recently posted this about saying, hey, Let's have this low quality flag. We had this forever ago. God, I have to turn off my own voice. I'm going to go insane. Where's that setting again? Okay. That was weird. I was listening to myself with like a two second echo. So we had this idea of a low quality flag on the site and I wanted to hack on that because We have a mechanism for people to flag comments and stories that they think need moderator attention. And we've kind of experimented a bunch with how voting works and how flagging works. Originally, the site had very Reddit style where you could just up or downvote, but then downvotes... were not really informative and mostly just meant I disagree, which is what they use mean on Reddit, but that's not actually helpful because especially when a community is small and young, you want to encourage discussion, not give people a big like, hey, you're hated kind of comment, which is what seeing those nice negative numbers can feel like. And so we... Then I'm going to switch over to the hidden thing for a second. Where is this? Here we go. All right. Had a notification I forgot to turn off. So I wanted to get that so it's not just distracting me forever with the red dot. And so we've mutated the voting and flagging a whole lot. And where it's at right now is there are no downloads anywhere on the site. You can flag. a thing, and there are a couple of flag reasons. If I log in here to this.

17:06Now this is kind of fun. Let's see if I can manage to do this without flashing my password on screen, because that would be no fun to have to rush and change. Good. Oh, I don't want to be logged into prod, though. Let's get a dev server running. Okay, so over here, we'll say b-rail-server. Oh, cool, I blew up my Ruby install just before stream. I was tinkering with writing a gem, and it got super mad that CSV is in the standard lib for Ruby, but then moving to a gem with 3.4, and some gems are prepared for it and some not, and... Really, you're gonna... Oh, right, that one just wants... Okay. So let's move you over here. I said, let's move you over out of the way. There we go. So now, so the thing I caught there is in development mode, the TOTP code is commented out. So it just skips it. So, okay. So here is some sample data. As you can guess by the fact it's all lorem ipsum and it's all old. So let's, add some more because you can only flag yeah i totally want to we only have half a million records you can only flag fairly comments fairly recently the window closes because again that's one of those things where because flagging includes a negative penalty to a comment score sometimes people get mad at each other and they're like aha i will punish you with a flag and it's kind of annoying for us as mods because it's like They are punishing them with our attention, but they just wanna push the score down. Oh, cool, I've got a bug to fix. In the meantime, we are gonna just comment that out, because I already have categories, and try that again. It was airing at 1.26. This was trying to make stories. The category is any categories that exist. That's going to fail again. And if the category is categories that exist, it's the one that it managed to make. This whole fake data thing is a little bit janky. It's really only intended to run once in development mode. Here, let's run that properly and so it doesn't get a lot of maintenance and it's very easy for it to slip out of working but hopefully whatever that flaky thing is we won't hit it again and we hit it again that's great because i didn't save the code when i commented that thing out Can I just say, OK, I can say, yeah, that's not performant, but it will work.

20:54Again, it's OK to be slow in. developer tasks sometimes, especially if the developer only has to run it once or, say, nine times. What did I just do?

21:16I didn't abort you. Because I didn't hit yes. I just hit enter. It is not a default. It tried to do something reasonable because... So that little warning is in there because I heard of people running it in prod when they are setting up, using the code base to set up sister sites. And it's super awful to have to clean up a ton of lorem ipsum from your prod database if you manage to do that. Especially because the whole site... Good, got past the bug. Is built around... There's lots of stuff we don't delete. And so... Going down a whole ton of untested code paths is no fun. So if users are occasionally using flags to punish each other, in response to that suggestion I had a week or, what, three weeks ago, I said one idea I've been kicking around is kind of imposing a cost on it and saying, okay, so flag won't affect scores anymore. So it won't be that kind of automatic ranking signal because people use that to try and punish. And instead, we will have hide be that ranking signal. And so this is kind of the idea here. When you hide a story, all of its comments just basically stop appearing on the site. So if you look at latest comments, you don't see them. If you look at Stories on the homepage is just literally not there. It basically vanishes for you. Modulo the fact that story hiding is very easily bugged. And that's kind of a cost of, well, you can't participate anymore. Which is good, because if you're like, well, I really, really don't want to see this, hide is the right button to push. I have been telling people for like five or six years, like, if you don't like something, don't just flag it, just Hide it. Put it away. And so what I want to do is update the story scoring so that flags don't punish, but hiding. If the user hasn't commented or voted in the story comments, we'll add a minus one to the score. And that caveat there is, again, sometimes people get mad. And if they are already interacting in the story and saying like, something and then they get annoyed and frustrated so they just click hide to make the discussion go away that's totally fine but it's not really a clear signal that they don't want to see the thing because they wanted it enough to comment in the first place or vote in the first place maybe another way to put it is I don't want the hide button to be a mic drop so let's look at the specs for story voting because I think I have some I hope I have some. There is a lot of basic site functionality that only has very basic smoke tests. Oh, right. There's this wonderful method name that comes from the site's original creator who very clearly has written a lot of C and thus is burned by the fairly weak type system there. is easy to swap the order of two integer arguments and so you kind of want to have this is you know that scar tissue along the lines of that famous quote where it's saying this is the order of the arguments so you are voting a Oh, this is not upvoting. Look, I already fixed something. So we're going to say if you upvote... So this code is trying to cover every case from if you are changing a vote or adding a new vote or replacing a vote. And... Yeah, that's fine. The code is kind of exhaustive because... That's not the terminal I wanted. Because voting is so common that this method is very specialized and drops down to do a bunch of direct SQL database accesses rather than go through all of the active record callback stack. And so that's like half... half wanting to avoid active record callback hell, and half wanting to do this in a performant manner, because it's our biggest table. jcsdotorg i think it was more objective c and its overly verbose method names that ruined me
Yeah, what is that at now? So let's log into prod. And we've got database.

26:32Yeah, so we have 3.4 million votes in that table. So I'm trying to keep it down. Definitely don't want to do anything that walks the whole table again. So let's say that when we upvote a story and use flags, let's think about this. So there's two ways to do this. oh look you can tell I was poking around looking at this code a little before the stream so there's the update score method that calls the database and sums all the votes and what I basically want to do is either update this to say that let's get the

27:29Let me know if the font size gets too small. And, oh, JCS, thanks for dropping in. Yes, JCS is the original author of the Lobster's Codebase. Thank you for pointing out that you got that from Objective-C rather than regular C. I didn't know that. I just assumed that it was a, you have been burned by C stuff so many times. All right, let's go ahead and tuck that away. and get that back off screen. I have the Lobster's IRC window open there. That's what just went by. So votes are implemented, and flags are part of votes. So there are kind of three paths I can see.

28:27I haven't thought about which one because I figured stumbling through problems is the fun part of programming. And doing it live isn't terrifying at all. So, votes are in. Flags are implemented as votes with a negative one. And so, we can make it as saying flags now have a score of zero. And that will... new flags that will break a bunch of the tests this update score below stays the same didn't this code have something about flags somewhere in here yeah calculated hotness will also have to change

29:27And this is... I believe this is a scope? Nope. What's flags? Flags is a... Oh, it's just an attribute. Okay. Oh no, it's... I did it here. Alright. That was the clever thing. Yeah. Alright, so...

30:04that's one path the other is you could update the score sql load to ignore to filter out votes with negative one score that's gonna break existing scores in the database Yeah, that's... Oh, so Twitch made a goal on the stream and said, hey, let's look for getting a bunch of followers, and then it said I got it. Okay, so I think it's going to make a new goal. I don't know. jcsdotorg what if comment flagging is disabled for any subthread where the user is participating?
There may be a weird UI that shows up on the chat about that, because different parts of the UI are telling me I have 89 or 90 followers, so it may... kushbrahmbhatt W Streamer Using Vim, Ruby On Rails
kushbrahmbhatt W W
do a thing i don't know let me know i don't have a lot of that visual feedback all that requires like the the clever overlay stuff where it puts up like so and so just followed you requires obs to have the browser plugin and the browser plugin yes it is vim with ruby on rails the browser plugin is in a weird broken state on arch right now and it's funny because like it's a running gag for arch and other rolling release distros that they are unreliable and this is like not really a problem for me and this is the first time i've really been bitten by it i've burned kushbrahmbhatt Hey man, I am building websites on Plain PHP and Next.JS, if I move to Ruby On Rails what should I expect like what will be the learning curve?
like two hours fighting packages and trying to edit pkg builds to satisfy weird dependencies yesterday and it just did not want to build so i don't know that the reputation finally caught up to me i am not exactly like mad enough to run and install osx or something but that was a little annoying so maybe the clever overlay stuff will come in in the future but for right now you'll get vim and like it pushcx https://www.railstutorial.org
Krish, if you are building sites with PHP and Next and you want to move to Rails, the learning curve is not so bad. And here, I'll put a link in the chat. pushcx or google for Rails TUtotiral Michael Hartl
If it's not that, it's Rails tutorial Michael Hartle. And so there are nice tutorials available. There is lots of material available. I am a big fan of Rails, but I have been using it since, I don't know, before 0.4, whatever that first release was I got on it. kushbrahmbhatt Damn
kushbrahmbhatt Bro is ROR Chad
Maybe that was 0.4, and then 0.5 was the whoops blog in 15 minutes video that came out a little while later. Anyways. Break existing stories in the database. Big swing on next vote. That's weird. So if I change to filter out negative one scores, the thanks, Kush. Yes, I have Rails chat. Been around forever. I just have gray in my hair. That's all. It's not anything fancy. That one's kind of weird because you can continue to upvote stories indefinitely. And so when the sequel runs to sum all of the votes, those stories might jump a bit. I think it's probably fine because they're not going to like change ranking or jump on or off the homepage or anything. It just feels a little weird. The other thing would be, you know, just for completeness sake, I'm going to list this, but like, what if we did it properly and model flags, add model for flags, move out of voting. So it's a bigger implementation, but it's not bad because Rails is bigger on all this crud stuff and it would be a fairly small centralized code model. I would have to touch nogweii Easy solution to the lack of browser plugin, just make a vim plugin handle that instead :P
kushbrahmbhatt In India, there is less job listings for Ruby On Rails and I also checked for USA and it's less too
all the vote code paths which is a little intimidating because like the core site function is viewing things and if you are logged in the most frequent action is voting on things easy solution to the lack of browser plugin says nogwell is to make a vim plug and handle that instead actually when i first streamed Like four years ago, it was summer of, oh, wow, there's the big animated thing. It's animated for me on the stream manager. That's pretty obnoxious. At least it was short. And then did it also do what it threatened to make the new goal? Nope. Cool. So if I like end the goal, does it? You've ended your goal. What a weird interface. All right. Let's make... What's a good number? 128 is a nice round number. nogweii Twitch's interface for streamers is wild for sure
So we will make a new goal. Is there going to be another animated? Yep, there it is. Wow, that's... Oh, well, whatever. I am playing around with Twitch here.

35:49nogweii Getting affiliate took a while too
So Kush... So I mentioned entrepreneurship. So one thing you can consider is... If you are in India, you seem to have fine English skills. kushbrahmbhatt Yea yea bro
kushbrahmbhatt I sleep at 4 AM
If you are comfortable working in India for American companies, which either means you have to flip your time schedule or you have to get them to be okay with you being 12 hours out of touch, it is very nice to be earning dollars and spending rupees. pushcx https://stripe.com/atlas for a US business
And you can do stuff like... slash Atlas for a US business. So you can create a US business entity with Stripe Atlas. Full disclosure, I used to work on Stripe Atlas. That's how I know it. And the costs for that, like the base cost of a business through stripe atlas if it does no business activity and makes no money is it's a couple hundred dollars us to sign up i don't remember what the current price is and then annually the state of delaware will want typically $300 US. kushbrahmbhatt Oh yea right
So it's not great to have a US entity unless you're actually going to use it because there's a significant fee. kushbrahmbhatt Yea yea W point
But if you have a US entity, you can run contracting through it and then it's really easy for US clients to pay you because US clients get nervous about they don't know how to send money overseas and they don't like feeling like there's nobody they can sue if everything goes terribly wrong. So having a US entity can be useful for that. Talk to a legal and tax advisor if you're curious. And then Stripe Atlas has a bunch of docs with more stuff on that. kushbrahmbhatt Yea bro, it's a W Advice
But that is a very nice career path if you really want to do Rails as opposed to have a local job. kushbrahmbhatt thanks bro
All right. So we have these three paths, one of which is reasonable, at least. And then... Oh, and Nogwill, getting affiliate took a while. I said it early on in the stream, but because I did some streaming a couple of years ago, and now a bunch of people have followed me on this stream today, apparently I will be a Twitch affiliate when I have streamed on five more individual days. So I guess that's about two weeks from now. So I have made myself some notes in the browser of like, there's a bunch of settings you can do and I don't know. I am not a huge emoji and animated stuff guy. And mostly the affiliate things seem to involve turning on lots of really obnoxious stuff. So we'll see what I actually turn on or down. All right. So three code paths.

38:45So the downsides... kushbrahmbhatt I used just Plain PHP and Vanilla CSS in the website I made for a Trust Organization and it's hard to move to Laravel
The downsides are not too bad for any of them. So one thing I like to look at when I'm considering the implementation options is which ones have really obvious downsides where I will immediately see the breakage and be able to address it versus months later we realize some math is working wrong. And the first two have that slightly scary thing. Honestly, maybe this is the... Number two is the shortest one, for sure. And flags... I can think of a couple of code paths that it would simplify. So there's like... What did I name that helper? Stories helper? No, where is it?

39:55kushbrahmbhatt Why don't you use VS Code? xD
Ah, so like... Ah, it's vote summary four, and it's on... story it's on the model instead of in a view helper so let's go ahead and go over the model story did my other vim tab just go away yeah cool i killed the rail server there let's turn that back on that's an interesting one i will have to debug that vim shortcut I should probably have a text file of, like, shit I have to do after the stream to fix stuff, so... Alright, so let's... Let's see, .. Fix that category bug in... Fake data task... If somebody wants to file on that... File that on our issue tracker. If, like, if you can repair that and file it, that would be great. Because I will just... File, not fix. And then, what was the other thing I was going to do? Fix my... What even is the key combination? So I've been using Vim for like... God, what am I at now? Since 1998? kushbrahmbhatt Bruh wtf 1998?
And so I have these keyboard config shortcuts, and I just don't know that I'm typing them anymore. Oh, yeah, it was Ctrl-W-Q... To not close Rails server tab. kushbrahmbhatt I was born in 2003
kushbrahmbhatt Damn
My use of Vim tabs is pretty new, so I occasionally will struggle to manage them. You're going to see that a bunch. Oh, yeah. I also was going to turn off.

41:44Oh, yeah. Yeah, Kush, you are significantly younger than my Vim RC, which is... 1,040 lines long. dpk0 what programming font is that? the italic in particular
And also, let's see. It has 68 plugins. Okay. kushbrahmbhatt Damn bro's Vim config is elder than 2000s kids
kushbrahmbhatt Haha
In my defense, some of those 68 plugins, you have to manually specify a lot of the dependencies. Plug isn't perfect about that. So some of those, like as many as three, are not actually plugins I'm using. nogweii Have you seen the plugins that turn the vim tabline into a file list?
Yeah, so my vimrc is old enough to vote or get drafted. dpk0, the programming font, the regular font is inconsolata and the italic is operator sans mono. Oh, let's add that to the FAQ. So we'll say font in setup. OK. Cool. Now I am not going to burn cycles trying to remember that I was going to do that thing. What I was trying to do was get over to the story model so that I'm in the story model. Cool. Yeah, it's so weird programming and talking out loud at the same time. I was looking for vote summary. There it went. so when you see a vote summary which is let's get back the browser if this story had flags and i was a moderator i am a moderator or a submitter you would see the like a little thing in parenthetical that was like oh there are two like minus two for me two comments and minus one for troll that kind of thing so that is what this function produces. And so that would have to get touched for numbers one and two and three. Yeah, that's going to be all of these. Have I seen the Vim plugins that turn the Vim tab line into a file list? I have not. I have no idea what you're referring to. And yeah. kushbrahmbhatt Peter Bhat Harkins
kushbrahmbhatt Damn
Let's see. kushbrahmbhatt W Bro
So this, we have the counts.

44:38kushbrahmbhatt I checked about of Lobste.rs
Kind of want to at least take the minus sign out of this, just so that I see it in my code diff, so that I remember it's here. So we said next if the vote is zero, which shouldn't happen in prod data. How do I have that? nogweii https://github.com/ap/vim-bufta… / https://github.com/vimoxide/vim… are examples
There is no such thing as a zero vote on a story, unless I choose paths one or two. There are two examples of buff tabline. Yeah, OK. So there are currently zero. Let's see if I can manage to open these links. All right. Drag that over. Nice. Look at me. nogweii I use neovim, so a Lua flavor of the same. Showing the list of buffers as if they were tabs
I am a professional streamer now. Oh, that's clever. yaymukund B) pro strem
The tabs already get the title of the file, like their story RB. I think it's just whatever the first buffer is. kushbrahmbhatt @yaymukund Yea man
nogweii Ah, yeah, this is quite the different workflow for sure
And I have an integrated Vim setup that's fairly nice for... Oh, what did I just fuck up? Those windows are in the wrong place, that's what. Tiling window manager. Sometimes things jump around when I'm I made a whole new layout for this. So I have an ultrawide monitor. It's 5K by 2K. So like you will see the mouse exit right and exit down all the time. And the stream is just this like 1080p section in the upper left. And then I have the stream manager and such off to the side. So yeah, I bounced off NeoVim earlier this summer. Yeah, we'll see. Let's see. So the other thing, I have some workflow, like if I look at the vim log. So here's the last couple of commits. And if I highlight one, I have a keystroke. I can type. And it, cool, it blew something up in it. As you can see, I got three new tabs here at the top of the screen. Don't scroll. Jesus. And so then it opens each as a Vim diff. So as I close them out, it's like, oh, when I wrote this, this is the code that changed. This is the old one on the left and the new one on the right because I moved that function around. And then the controller got two new lines of code. So that's a really easy way for me to use tabs to inspect Git history. So I don't really super... see any need to change what those titles are. This bash-l title is not helpful, but I know that I put the Rails server on the left because it's always the leftmost tab, and that's just fine. I used to use tmux for these things, but then I've been tinkering with just directly using tabs now that the Vim built-in terminal support is pretty bulletproof. It's a lot easier to copy and paste stuff in from Vim's terminal mode than it is from The TMUX, if you turn on the cursor scroll back mode. yaymukund I run my zsh inside nvim's terminal panes LUL
So anyways, oh, somebody asked a while ago why I don't use VS Code. Inertia, like I've been using Vim for 20 odd years when VS Code came out. So like, I'm fine. So this has the reason, this builds the string, this says plus, this is counts. Where is the minus sign for this? Another question. Does this have any tests? Probably not. No, no tests for this.

49:01All right. So let's see. New flags now have a score of zero.

...15You know, if I do this, I have to... Let's see. So what are the... yaymukund `!bash -` πŸ‘€ nice
I am leaning towards number three just because I'm trying to do the long-term maintainable thing. So that would be add a model for flags. Update vote thusly. Update...

...55Add a timebomb test to delete flags nogweii I spawn new windows for the same goal, which can get messy as I'm intentionally losing the organization of tabs. Pretty sure it's not "better" but it works for me. HypeLol
db and then update vote votes thusly and the nice thing about this is i have a really like central place for that concept of hide because there's that one let's see i'll just put this here one concern is

50:50Yeah, I've looked at... I have been like curious about ZSH for like a decade because the idea of it's Bash, but without 40 years of weird, crufty history sounds pretty great to me. But that's kind of a big, big change for me, given that I've been using Bash since like 95. It's, like, it's interesting and it's attractive, but there is so much muscle memory and so many dumb little bash scripts I have piled around. And I know DSH has mostly compatibility for, like, running bash scripts or porting them. Anyways. Yeah, Nagwa, when you say you spawn new windows for things, is that, like, window manager windows or is that Vim windows? nogweii vim windows, yeah
Because Vim used the word window before there were GUIs, and so, like... This is a window and this is a window, but neither of them has like a title bar and such. Oh yeah. Vim windows. Okay. Yeah, I would, I do that, but I really liked that side-by-side diff mode and I don't enforce a line length on the code base. So if, I make vertical splits I run out of room and so then it's like when there's four or five things they just pile up here and I have like five things split side by side that's just I just don't see enough of the code to understand things because I want to be able to read things above and below the changes.

52:30nogweii yup yup, I usually full screen my terminal to compensate hah
yaymukund Totally - I was more highlighting the similarity of us both running terminal from via nvim rather than zsh v. bash (terminal is such a personal thing!)
And again, just to remind, now that I've been going for about an hour, a chunk of this is intended to be like Lobster's office hours. pushcx https://lobste.rs/about#queries
And if you would like to see queries run against the production database, we can run queries against the production database of like how many scores have been voted on, how many stories have been voted on today, that kind of thing. nogweii @yaymukund fyi it's vanilla vim
I am happy to do that kind of stuff if it doesn't release PII or anything. I should put this link in the chat. Wouldn't that be nice? Look at me. dpk0 somehow comforting to know vim has exactly the same confusing terminology re window/buffer as Emacs
Oh, there goes the IRC channel again. Workflow. yaymukund @Nogweii oops
All right. So yeah. Create flags, time on test to leave flags from database. Oh yeah, this one. Where's the load model? That's weird. I don't remember the syntax. There it is. hejihyuuga !font
Inclusion in 1 comma negative 1, which this is just a missing validation. So I can, like, I will change this if we do the flag thing, but that's just, I don't know why the site doesn't have that. All right. Hedgie, what is bang font supposed to do? Is that... nogweii twitch has a history inherited from IRC
I thought Twitch had slash commands, not bang commands? hejihyuuga Twitch has slash commands, there are a bunch of third party bots that provide bang commands
jacobmanning3 I run arch. Hyperland
Yeah, let's... Let's run our little... This is what's in the CI test suite. It's a GitHub action. That's over in Checkyaml if you want. hejihyuuga I was hoping !font would make a bot tell me what font you were using
Ah, somebody runs Hyperland. You must spend more time mad at your config than I do. nogweii so bang commands from that community has made it's way over
Cool. Okay, so this says expected can't be blank is not included in the list. Oh, yeah, that's actually a really good failure. jacobmanning3 No.
Okay. Hedgie, let's see. All right, so Hedgie is asking a question I answered on stream a half an hour ago, so let's... hejihyuuga Oh I'm sorry!
I am only kidding, Jacob. I am glad that Hyperland doesn't give you a lot of trouble. Oh, yeah, I wrote down that I should put it in the FAQ. Honestly. nogweii especially since custom slash commands are relatively very new
How likely am I to shoot myself in the foot? Probably not very. Okay, so let's... Let's just say here is the FAQ. This can be up first. A lot of people have asked this.

56:06Let's unhide this and get it in here. I wanted to say in Consolata had a, yeah. hejihyuuga Apologies for the repeat question, thank you for answering @pushcx !
Yeah, I want the repo because that's where I grabbed it. And workflow. All right, we'll get the hang of it eventually. I just have to stream for 30 more hours. So this is in Consolata. The italics is Operator Sans Mono. I don't remember where I got that. I want to say this one's a commercial font. hejihyuuga yeah operator mono is commercial
It's been, I don't know, 15 years? That's got to be frustrating for them. hejihyuuga i think the license is like 200$
All right, so what did they call it? Operator Sans Mono. Yeah, see, I like this. Family's distinctive, they just call it italic, but they name the individual face, don't they? So here's their store page. Yeah, there we go. That is the page I'm thinking of. So we can put that away. And do they call the face something on that page? It's not. It's actually probably... Operator mono, but what's the face? Give me more context. They just call it their italic, okay. nogweii @pushcx expand the lobsters IRC bot to support Twitch's IRC extensions and respond to bang commands in this chat? LUL
Cool, so I don't remember, was there another fact people have already asked? What did I just say?

58:13yaymukund Has lobsters always been on... is this rails? gosh, my rails knowledge is frozen in 2013 / v3.2
Yep, that's fine. nogweii @yaymukund yup, started as rails
So let's put that in the fact and grab terminal, jump over here.

...35There we go. pushcx https://push.cx/stream
All right, so if you reload the blog about page, which is over here, you will now see that nice question about vim and all that. Has lobsters always been on Rails? Actually, JCS would put you on the spot. hejihyuuga @Nogweii I'm pretty sure Twitch provides an IRC interface for chat, so this might be relatively easy.
yaymukund haha, nice
It has in production always been Rails, but it's kind of my, one of my favorite little fun facts about the site is if you go way back, the very first commit message says initial work on conversion from PHP tree, which tells you that Joshua first tried to write the site in PHP and then did something reasonable instead of using Rails. And this was back in, what is this? June 16 of 2012, so a dozen years and six weeks ago. And I am so glad he chose Rails. gtfrvz @HejiHyuuga You have to respect more strict message limits, but yeah
And I don't know what he knows, but I'm pretty sure he was new, if not totally new, to both PHP and Rails.

01:00:04nogweii @HejiHyuuga indeed, it does. but with a bunch of extensions to support Twitch's things.
yaymukund php in 2012 must have been ... a little rough
I was poking around the Twitch learn how to stream pages and they were like, don't play copyrighted music because we'll send you to double hell. You know, let's look at how DMCA strikes work and we will shoot first and you can beg us to ask questions later kind of thing. And I really hope that the license I bought 15 years ago or something for Operator Mono allows me to stream the font. It did not occur to me until somebody asked, and I remembered that it's a commercial font, that I'm showing a commercial font on the stream. Maybe it's fine as long as I'm not making money. So where's that?

01:01:02Yeah, let's look into that. I don't know. dpk0 my guess is no, you’re not
All right, so... Yeah, PHP pre Laravel, which kind of knocked off Rails, was very rough. I did PHP professionally from 2001 to... God, when did I stop? 2008? 2008? Yeah, I want to say 2008. dpk0 font licences generally allow embedding even in PDF files etc. as long as it’s not, like, an editable document file
And then there's been a little bit of like contract work and maintaining old sites that are more like being mad at WordPress, being very, very mad at WordPress, porting my personal blog from WordPress, which involves rebuilding the whole theme and plugins. But then otherwise, I swear I don't do PHP. So we have this nice spec failing. Let's go ahead and update it. And this one we just expected to include. Can't be blank. And seeing include is kind of funny because on the first, on the tech test stream I did, I had a weird ass performance bug in a feature spec where using include instead of have content made the spec take 44 seconds to run. It was obnoxious. So let's, let's go ahead and rerun.

01:02:35Alright, we're going for a minute. Let me see if I can bribe the cat into appearing on stream. I don't know if you can hear this. I'm shaking his treat container.

...48He must be conked out in the other room. If he's dead asleep, he's not going to show up. Alright. So we expected can't be blank to include can't be blank. Yeah? And you failed on that? How is that? Oh, it's a nested thing. It's a nested array. Oh, you know what I should do? There should be... nogweii IIRC, other streamers use commercial fonts and hasn't been a problem
I don't know how to do it, but maybe it's a thing that would actually be really useful of if and when I get to Twitch affiliate status, do something clever when someone in the chat spots the bug for me because anybody could have seen that bug. So if we change this, like if you had recognized what that was in the RSpec output faster than me, it would have been nice to know. Ooh, we're even doing this on a holiday, Zeroday. So this forever, as long as I've had a Linux machine, it prints the Discordian date when I open up a new terminal. And that is kind of two things. It is number one, When I was a teenager, I really got a kick out of Discordianism. Clean build. And second, I break my bashrc and my bash login and my profile and my bash underscore login and the 19 other config files that run in incomprehensible ways when I open a terminal. That breaks fairly regularly. So I know if I open a terminal and don't see that, that something is broken. And so I will probably never delete it.

01:04:37All right, so let's commit that. Yeah. hejihyuuga i am now reading up on discordianism. first time learning about it
So this one, I want to add that. Add it. yaymukund ^^
And let's go ahead and make a commit.

01:05:16Cool. Yeah, that's fine. gtfrvz i've read the books two times. maybe it's time for a re-read
What was the command for this? Was it push up? gtfrvz but eh
No, it's not push.

...35There we go. Let's just push that up to GitHub. Cool.

...47So if that's live, good, good, good. I'm catching up on the scroll back. DPK0, I appreciate that you looked at the font license. I will have to reuse it. And Nagwe, I appreciate that you have seen that other streamers don't get dragged to copyright hell for fonts. Thank you. That's nice, because as you can probably guess, it made me a little nervous there. So Discordianism, the fun book is... What is it?

01:06:30pushcx https://en.wikipedia.org/wiki/P…
So this is very fun. Principia Discordia. I'll throw that link in the chat. The really funny thing about this book is it first came out in like 79 and somewhere in like 1983 somebody typed up the whole book and posted a text file to Usenet and I am going to just guess that this is early 80s because this file is kind of ubiquitous. I don't recommend reading the text file even though it's very easy to find because It doesn't have the illustrations, and there's a bunch of humor in it, but it is now literally, like, very hard to get this book, because if you go on Amazon, I'm not sure it's been printed in the last few years, but if you search for Principia Discordia... Yeah. So who is the publisher on these? Okay, so this one is a fake. hejihyuuga wikipedia says the publisher went out of business in 2006
This one is... off of the text file. And I know because I bought it like eight years ago. Amazon never removes fakes goods. So people have taken the text file, slapped a generic cover on it, and then posted it up on Amazon. And so if I scroll down these links, like this one is maybe real, like it actually has a legit cover. This one is the out of print Steve Jackson one. This one is bullshit. Unless it's Yeah, I don't know what this, who is Gregory Hill? So either that's somebody riffing on it or something. So it's just, it's very funny because Discordianism is kind of a joke religion. yaymukund Apparently Greg Hill = Malaclypse the Younger
And so this situation where the book is enormously pirated and there are all these Samizdat versions hanging around and you like almost can't buy a real copy of the book. I don't know. It's very on-brand for Discordianism. And I have hassled a number of used bookstore owners to try to find an early version because I would love to own a first edition or something of it. I only have the beat-up copy I found in 1995 or whatever it was. But I would like... And it is a very sad copy. So I would really like to have a classic copy. But if you go on WorldCat or the other book databases, you just find all of these... cheap knockoffs that are fake as hell. And they're all terribly printed and missing the illustration. I don't know. It's very funny to me. Greg Hill is Mel Eclipse the Younger? I have to doubt that one. I thought it was... Well, actually, Wikipedia's got it. Oh, Wikipedia says Greg Hill and Wendell... Oh, I'm thinking of... So the other place I know it from, what put me onto it, and I'm confusing those two authors for these two, is a book called Illuminatus? The Illuminatus Trilogy. You will find it in omnibus single book editions that are all quite nice, but it is a weird-ass novel where it's very, very seventies. And like every conspiracy theory is true all at the same time. And so like the novel series repeatedly returns to the show, the JFK assassination. And by the time you've seen it, five or six times. There are like nine shooters and Kennedy is a pincushion. It's just... It is deliberately weird. Yeah. Way off topic here. That's okay. I can be wrong about authors. It's my stream, I guess. Alright, so... With voting set... Where's that guard clause that put me on this validation? gtfrvz i've got a translated edition of principa discordia 1994 edition it seems
Was it... Oh, it was in the vote summary, wasn't it? Yeah, there was that guard clause. And... It's especially funny if I put that and line it up against voteThusley, because voteThusley says if the vote is zero, just delete the vote. So this is dead code now. I'm going to leave it alone because it may rework this method a bunch. And I don't like to touch something until I'm really ready to hit it. I don't want to split this change up. So we have these three different paths. GTFRVZ, what is your edition of Principia Discordia translated into? gtfrvz german
I didn't know there were official translations. But then, I'm an American, so I don't have to know other languages. Yeah, that's snarkier than I want to be on the stream. And I actually seem to know, like, four languages. Two of them reasonably well, so... Alright.

01:12:06See, this one is temptingly simple.

...15This one is very easy to reverse. drrobotics oh those fonts NotLikeThis :D
So one of the things here is this is kind of an experiment, and voting and flagging is a 12-year history of experiments that kind of didn't work. Dr. Robotics, if you go look at the stream fact, the link is up a little bit or it's in the about box under the stream. I just added the fonts. So... If voting is a series of experiments, maybe what I want to do is just do the simplest, dumbest one, which is number two, and then I can come back and do number three in like six months when it feels like, hey, this is actually measurably improving site temperature. hejihyuuga @DrRobotics https://push.cx/stream#what-am-…
Yeah, and then I would leave all the vote code alone. This is very attractive. I am nervous about vote code. And I'm nervous about it because it's so dang popular and so... I mean, this is a lot of conditionals in a row and it has as much tests as anything on the site. Actually, probably more tests than most anything on the site. That's a lot to break. And especially if I'm going to change my mind about it in six months. Let's do the dumb thing. Let's do the really simple thing. So we'll say... What are the steps? I would just update this. Does any other code have to change? So update score and calculate and calculated hotness. Yep, those both need to get updated. Update display in Vote summary. Oh, and you know the other nice thing about this is it changes stories, but it leaves comments alone. So I've just been thinking of flagging stories, but there is also comment flagging. And you can't really hide a single comment, you just hide the whole story. So what changes for comments?

01:14:53These methods are on story. You have a calculated confidence. Yeah. So here I would just drop the flags, keep this, and the scary equation stays the same. Okay.

01:15:31What else changes? Do you have a... Yeah, you also have a vote summary. Oh, there's the negative I was thinking of. Hey G, thank you for posting the link to the fonts.

01:16:02Is it hedgy or hagy? I'm a Midwesterner, so probably both are wrong, but... Hmm. Isn't it tempting to just do the simplest thing? Leave weird data in the database and not model things correctly? Isn't that attractive? Isn't that my professional responsibility to half-ass it? I think it is. I think it is. dpk0 sometimes you only need half of an ass
hejihyuuga pronounciation doesn't matter. I'm also american, and plagiarized my name from an anime I watched as a kid. I usually tell people "Hedgy", but I very much don't care haha.
All right, so let's just kind of tinker with this. So let's update that. So here, I'm going to take this and make a stream notes. And let's just yoink this over so that I don't lose it. Because otherwise, there is like a 90% chance I end up committing those notes. And that's not great. It looks tacky. So OK, there's half of this. And then let's go vote summary. So it's weird that vote summary The thing that was interesting about... I don't see the reasons... Does this really not put a minus in front of it? I thought it did. But maybe story is different from comments and I never noticed the inconsistencies till now? That is totally possible. I occasionally get these things where it's like, oh yeah, I've only been looking at the site for like 20 years. Or 14 years. So... Let's take this story, and then...

01:18:07Shored. Let's give it some flags. And first, since I'm logged in...

...23admin.id. Don't need to print that. And then let's save that. Yeah. Cool. And then let's go ahead and say let's add some flags. So we need a user to have flagged it. So let's just grab jerks. No. We'll say this as nogweii uh isn't it a symbol?
helpers in the Mr. Rogers sense equals user all order id desk limit five helpers dot each just looking at that method name what was it It's vote.vote thusly on story or comment for user because. God, that's a method name. Yeah. Let's see how good I am at bin pasting. So now if I do, that does nothing. Let's do this. Cannot make changes. All right, that's not how we paste things. Cool. I'm going to use the mouse anyways, because I don't remember my new hotkeys. Because I have been tinkering with the workflow. So generally, my general philosophy is like you should customize the hell out of your programming environment, but you should do it very, very slowly, like one config tweak a year, or I'm sorry, a month. I can't talk. One config tweak per week, if it's going to be like a new hotkey or a changed behavior or something. And I'm a little confused because I've had a whole bunch of upheaval in the last week or two to get ready for streaming stuff, which is part of why I'm struggling more than my usual fluency. And then these things just compound over the years and decades. nogweii irb line 4
Nogwell isn't what a symbol. nogweii `desc`
I'm jumping around a lot of code here. IRB line 4. Let's look at IRB 4.

01:21:01Oh. Yeah, that's what the exception is. You know, I just... I saw that I got back one line of output, and I was just like, cool, you loaded. And so I didn't even read the line of output, because I was in the middle of talking. I gotta get the hang of that. Of splitting my attention between... the running commentary and such. nogweii hooray, special cookie for me:P
So let's say negative 1. hejihyuuga yippee
Story ID is s.id.

...39Comment ID, so that's going to be nil. And then helper.id. Oh, let's make sure I actually remember what those are. I think, like, capital T would work? Yeah. So let's say... Just a random reason. Cool. That probably worked. So if I reload, the story should be owned by me. Why are you taking so long to load?

01:22:39Seriously, why are you taking so long to load?

...53Yes, Nogworld, thank you for spotting that bug that I didn't even see I had a bug. Please remind me of that in a couple of weeks when I am a Twitch affiliate and can do something useful. And if you want to figure out what the useful thing is, I think I saw a thing about custom emotes. There was a thing that you can put on the user. You have a little icon next to your name that's like a... Looks like a Cherry MX keycap, but that's probably not what it actually is. Yeah, I don't know. hejihyuuga You're probably thinking of the vip feature on twitch
I'll have to figure that out. All right, so this is the vote summary, and it does have negative numbers in it. nogweii it's a keycap, yeah. there can be a symbol for subscription length
nogweii or VIP
hejihyuuga Where you can designate chatters as "important" members of the community
So if it does have negative numbers, that's the Rails server output. I was wondering why it was taking so long. And yeah, that took 34 seconds. There must be some ridiculous query happening in there. It's only in dev mode. Occasionally, I've mostly turned it off, but occasionally dev mode tries to fill some expensive cache, and that's why I wasn't too panicked about the slow load. Oh, yeah. Hedgie, the roles thing, I saw it called roles. So, okay, Twitch community managing roles. I'm looking over at the other tab here. Sorry, there's nothing on screen. Let's see if I can type Nogwell's name correctly, because this filter is like every user on all of the site. Oh, it's not Nogwell. Man, I have a small font on it, so it's Nogway? Yeah. nogweii oh hah, yep
nogweii I do!
Hey buddy, you have like a cat avatar, right? hejihyuuga You can also use slash commands in twitch chat
hejihyuuga /vip @Nogweii
hejihyuuga Note, you have a very limited number of vips before you become an affiliate
i just do it here yeah i can block or report you or i can make you suspicious but i can't actually reward you from directly in the stream manager interface that's kind of a funny little bit of difference you can also use oh thank god there's a slash vip command all right and does it have oh it completes usernames cool All right. nogweii Test
I don't know if anybody got that message, but I have added Nagwe as a VIP of this channel because they caught a bug. And that's what I did actually on the text stream is somebody pointed out that the bottom line of the terminal was getting cut off and somebody else caught a different bug. So do it a bunch of that stuff. All right. Cool. And the... nogweii test again
Stream Manager doesn't like having its window moved around, because now the stream health graph is strobing. nogweii woo fancy icon
hejihyuuga congrats on vip!
hejihyuuga you got your cookie!
So let's just go ahead and close that, because I need to not have something strobing in the corner of my vision. My god, how do I get rid of this? nogweii @HejiHyuuga ty ty
Can I pop it out? Can I pop it back? Jeez. Nope, that's awful. All right. Cool. Let's just hope the stream stays healthy, because I'm not going to see it now.

01:26:28See? Look at that. I remembered to write things down. I'm getting the hang of this. So these are all the counts. Where is that... Does anybody see where this dash is coming from? Just literally the minus in minus 2, because it says grab the count. The count is not like a sum.

...57Push that over.

01:27:05I have a very limited number of VIPs before I become an affiliate. That's fine. I also have a very limited number of viewers. I'll just have to make fewer bugs. Or it could be like a FIFO queue, you know? Circular array. And then we'll just drop people as I need slots. nogweii r_counts[k] is an int
Let's make sure I'm looking at the right thing. Maybe this isn't even the right line of code, and I'm puzzling myself for no reason. Are we going to do another 30-second page load? What are you even doing? Seriously, what's happening here? Let's look at the previous one, because it's complete. hejihyuuga this stream might be the push i needed to learn ruby
Okay, so you did a... Oh, it's the fucking room. So we have this replying comments view that... How do I put this? It is a materialized view, and it points a couple of times to our biggest tables in the database. nogweii @HejiHyuuga it's a great language! I have over 10 years myself, it's been tons of fun
And so when it needs to get refreshed, it can take a significant delay, especially in my dev database, which doesn't have all of the indexes balanced and flushed and all that, because usually I don't have that much test data. All right. So let's put that back. Hedgie, yeah. Ruby is a really, really fun language. I've lost count of how many languages I know, but it's just very cozy. So we say ri to count. Okay. So what do we... Oh, here we go. So we're not counting the votes. We're summing them. That's where it is. All right. So if we just change that to say one, all of these will become positive numbers. And then I got rid of that X. So we shouldn't see any debugging stuff there. Yeah, it's funny. We were talking about PHP and Ruby earlier. And in like 2010, was it early 2005 i had worked for my college student government for a year and i made there were like 18 student organizations so i made 18 crud websites with like a blog and an events calendar and stuff and then i worked for my the graphic design shop inside the university and i made another couple of dozen and so then in early 2005 i had this set of php files that i was carrying around and polishing and getting ready for release and they had like a router so you could have nice clean URLs that didn't end in dot PHP and they would like take parts of the URL and pull them out so you could say like slash s slash oh this is the story ID grab it and then I used the active record model pattern to access the database and then I had a unit testing framework and then Daniel Katz- dhh so i'm in Chicago, and so we heard a little bit about rails at user groups before it was really released just word got around and. I was like, oh, oh, that's that thing I've been making, except I've been making it in PHP. And this is clearly at least like six months ahead of me. So if I just pick up Rails, it's like a cheat code. I will be six months ahead of where I am. And so I immediately dropped and never wrote another site with that PHP code because Rails was... just so, so close to what I had already envisioned. So that it was a very attractive way for me to learn Ruby. Like I had seen the language a little bit. It was a very niche language before Rails, but I had heard a couple of nice things. nogweii I learned Ruby because of RPG Maker XP, hah
And so seeing that someone had made the thing I wanted was kind of eerie. All right, so we have this.

01:31:32dpk0 Twitch stop dropping my connection when i switch tabs challenge (impossible)
hejihyuuga @Nogweii Is ruby an easy language to embed?
learned ruby because of repeat rpg maker xp oh that's pretty cool i assumed that would use either its own language or lua but like that it used ruby is pretty neat there's also dragon ruby that's pretty fun twitch stop dropping your connection when you switch tabs i think there's i think there's a button that you can make it pop out the video to picture in picture mode so it'll stay on top Not that you want me covering your browsing, but then at least it would quit pausing the connection. Is Ruby an easy language to embed? I don't know. Ask the guy who makes RPG Maker. nogweii @HejiHyuuga not so much, I think. It's not marketed/designed as one
I literally have no idea. If I really wanted to embed something, the first tool I would reach for would be Lua because there are so, so many success stories and it's a very well-trod path. dpk0 there’s the mruby embeddable implementation. never used it in the sense of embedding it myself, but have used it to configure the h2o web server
I otherwise don't know. I would actually research that, but no, I would first look at Lua. drrobotics i started rails because i couldnt figure out Java EE back in 2006
And NogwellDPK0, thank you for chiming in with your opinions. I appreciate it. Do I want to say something like, these are flags? It's kind of obvious from context. Everybody's seen this thing. So I'm thinking of whether I should change... I think just removing the minus makes it obvious enough that... You are no longer getting a hit to the score. Yeah, I think that's fine. OK. And do I want to take this opportunity to break this out? So one thing I don't love is that this is all on one line. And it looks especially bad with these generated long usernames. But no, don't change font size. All right, so I just reset the font size. Let me know if you can still read it or it needs to be smaller or larger. hejihyuuga still legible for me on desktop.
Let's look at the story list detail. And we have the summary. And so if I take this, what if I said, there's no one else that calls this, right? There'll be some spurious hits for comments, but this should be it for stories. hejihyuuga checked on mobile and it's good for me there too
Search index? Yeah. So these two are heinous inline partials, so they will get updated. So if I do that, then all this score stuff should go down on a next line. Oh, and that'll probably go to hell for story merging. So maybe I don't want to do that, but I would like to actually see what that looks like. He started Rails Dr. Robotics because he couldn't figure out They couldn't figure out Java EE back in 2006. Yeah, I ducked Java in the 2000s. I should have been after or instead of this break and then I don't need that. I do wanna indent for

01:35:06See, this is a layout thing. You can turn off the display of avatars. So it would make a lot of sense to have a next line indented to match that. But then I have to know the user setting for whether they're seeing avatars or not. One of these days, I will rebuild you a CSS grid. But it is definitely not this day. So let's just put that back. Let's just leave it alone. Flagging is rare. You don't need to make something that's rare super pretty, right?

...42So let's jump back. Where was I? I was here. This is why I made a to-do list. So I've updated the display in story and comment vote thusly.

01:36:04Yeah. Good. Oh, Hedgie, thank you for checking that things are actually reasonably readable. I just kind of guessed at a reasonable font size, and it's a little smaller than I usually keep it, but like, I don't know, just trying to balance visual readability here. Let's put this on this side and go ahead and get rid of the browser for a minute.

...41hejihyuuga no worries, thank you for the engaging stream while i work o7
So if you are a Windows or Mac user, the key term here is tiling window manager. That's how all of these are jumping around and flipping. And in part, like 50% because I'm old and predated and like 50% because I don't like it. There are no like swooshy animations where windows switch places or grow or shrink. I just want them to snap into place. I want them to do it instantly. And I am fine with it being a little ugly because... I look at it, you know, literally 10,000 times a day. I'm rearranging or resizing windows and I don't want to notice it. Animations are really nice when you want to draw attention to something or explain to an unfamiliar user what's happening, but they are kind of maddening in software that I touch frequently. So let's go model comment because I haven't broken the tests. Oh, that was a thing. Yeah, let's put that in the... post-stream. I have a nice fixed VimRC testing plugin. I have a testing plugin that I broke a couple of weeks ago when I was trying NeoVim. Maybe six weeks ago. i decided to give neo vim a try because i heard all these nice things for years and i was like sure i can probably get it to load my vim rc and then i had to tweak some things so it would load my vim rc and then i like blew up my vim plugins and i have been a little sad and mad and fixing those so that's been funny i will have to fix that because there's like a nice thing where i can the cursor on a test and run an individual test and it shows up here in the vim rather than me switching tabs so where's calculated confidence so we will take this blow away this

01:38:53Now, that's order of operations. So this goes away. And then we don't add flags in a second time. Hmm. I wonder if that was a bug. Because I thought this was double waiting flags, but then that was adding them again? Oh no, it was altering upvotes. Huh. Plus, huh? I wonder if that should have been minus. Okay, well, the nice thing about deleted code is that it doesn't have bugs in it anymore. So that's the only change I have to do there. So let's go ahead and save that and find out what specs break.

01:39:46So some people have joined the stream since I last introduced. pushcx https://push.cx/stream
We are working on the Rails code base for lobsters. Let me throw the link in. pushcx https://lobste.rs
So this is my blog where I have streaming info, It'll link you over to Lobsters, which is a Rails app that is live. And we are changing the way flagging and hiding stories works. That didn't break any tests? All right. Man, that should have broken a test. Let's add a test that that should have broken. Because the idea of like, that definitely should have been tested. Let's see what kind of specs we have here. Oh, did I break this plugin? Yep. Let's get back.

01:40:45What was it called? I used to have a plugin that would, like, grab all of these function signatures or test names, and then give me a short browsable list. nogweii are your dotfiles public?
And I just kind of wanted to get an overview of the test to see if I already had some voting stuff in here. So instead, I'm just going to scroll it. Are my dot files public? No, they're not. But that is something I could be persuaded to do. There's a... Subscribe and you can have my dot files and be mad at this VimRC. Like the VimRC is literally a thousand lines long. It's not something you're going to pick up and be like, let me drop this in and use it. And then there's going to be a lot of stuff that's like, why would you choose that key combination? And the answer is because I used a weird keyboard in 2005 and now it's built into my fingers.

01:41:58So do we have anything about votes and scores in here, or did it all go to the vote spec?

01:42:10hejihyuuga I just shuddered a little bit at "1000 line vimrc"
nogweii I mean, all of my neovim config adds up to 3.5k lines
The speed limit. Oh, I didn't even think about that when I was balancing these different implementations. hejihyuuga :O
I would have had to touch that. So let's add that here.

...30hejihyuuga maybe i'm not customizing my dev environment enough
I'm not sure I trust that speed limit code either. We've had a bug report or two.

...39Hedgie, just one tweak a week. Don't go nuts. You can't actually learn 20 keyboard shortcuts in a day. You just have to learn them like one or maybe two a week. All right, let's go look at the spec for votes. to see that to do right now. nogweii @HejiHyuuga as @pushcx says, go slow. Does the environment work for you, not get in the way? Then it's "enough".
So this is upvoting a story.

01:43:09Did I write all of the tests against story and none against comments? Yeah, I did. Yeah, there's literally no, is there any mention? Removes karma and upvote when downvoting. Oh, that's got to go on the to-do list. That's up here. Flags shouldn't touch user karma. I think that's in vote, so I'll just leave it like that.

...57The other part of what Nagwe is saying is getting in the way is you sort of have to develop a sense of noticing friction in your environment where when you want to run a test, does that take like one keystroke and a tenth of a second? Or does that take four keystrokes and three seconds? And there's that famous XKCD comic of, like, whether to automate things. What is that? hejihyuuga @Nogweii Yeah totally makes sense. I'm usually willing to put up with a lot, so I don't usually make a change until it causes a lot of friction. I think the entirety of my dotfiles comes in under 500 lines of code.
pushcx https://xkcd.com/1205/
Whether it's worth it to automate... Ah, there we go. I'll throw this in the Twitch chat. But the basic thing about... Editor customization and the value of it is how much time you shave off. It needs one more row for shaving off a tenth of a second. But when you do these things like five or 50 times a day, which as a programmer using your editor, you probably do, they pay for themselves basically instantly. They also have the side effect of making your desktop totally incomprehensible to other people. So if you regularly pair program at your workplace, it might be nice to shove them off in a conditional file of some kind so that you can reload the editor without them. But that's only if pairing is a big feature of your workplace. So when I was a consultant and I would pair a lot, we would just always use their editor setup because nobody... Very few people even used Vim, and then none of them wanted to learn any of my config. It was just never worth their time.

01:45:53Sorry if there's a little ground noise there. I was adjusting the desk. So this...

01:46:21Okay. So flags is just an attribute. Let's look at the comment underscore flags. That's fine. Oh, actually, that was the thing I just made a note about on the to-do list. Or no, it wasn't. I made the speed limit node down there doesn't change for this strategy, right? Yeah, there's only one mention of flags. We do still want them to speed limit. That's very reasonable behavior, yeah, okay. And then comment is,

01:47:22What uses this cache? There's so many layers of caching to get good performance out of relational databases. All right. I would rather try and leave it out of the score than change what's in this column. Let's leave the column to be true.

01:48:09Yeah. And then here, we calculated hotness. Where does this score get set?

...42Oh, that's what's happening. We're pulling it. So the vote thing has this score delta going on. So if I went and looked at the vote model. Model vote. Got to say it the other way or I can't type it, huh? Update score and calculate. So instead of saying that there is a score delta, you're going to go ahead and say, so like adding a vote or changing between upvoting and flagging can both change the number of flags and change the score. And it can be both. positive and negative, so that's what's going on with that delta. If I had a type system, I would constrain these to be negative 1 to 1, although the score delta can be 2 if you are flipping from a flag to an upvote. Anyways, I would constrain them. This is the short version, but I don't have that. I don't even have a rat and a string to swing it on. So we will just say the score delta... When you vote, we don't change the score

01:50:04I gotta write the truth table for this. So what's happening here is, when you score, you can either have no vote, you can have a vote of one, or you can have a flag. And afterwards, here you can either have yeah let's duplicate this we can go from no vote to one or we can go from no vote to flag and we can go from one to no vote we can go from one to flag see this is why this code is kind of painful and i swear in performance it's worth it but times like this it's not dpk0 am off for the evening. thanks – i’ve never watched a coding stream before but it’s been fun. maybe i’ll do one myself some time! hope these become regular :-)
nogweii What are your thoughts on RBS? On Stripe's Sorbet?
to no vote yes so there's my whole table and so the score Delta when you go from thanks for dropping in DBK please do if you look over at the schedule I am doing this twice a week for the indefinite future so there's one session here on Mondays and one on Thursdays What are my thoughts on RBS or Stripe Sorbet? dpk0 πŸ‘πŸ‘‹
So when I was working at Stripe, Sorbet was absolutely invaluable in a large code base. And it is expressive in much the same way that TypeScript or Haskell can be expressive. It has some weird corner cases for Ruby. And it's the way it gets used inside of Stripe. But I liked it a lot. I didn't quite like it so much that I wanted to apply it to the Lobster's code base. I do want to, it just doesn't seem like a good use of, I don't know, 100 hours. And there is a whole thing with incremental typing, but that's also a project I would just never finish. So we'll see. I'm also kind of... There's been... I don't know if rumors is the right word. I think it's kind of official that there will be a... more typing stuff coming in Ruby 4 because in 3 RBS became standard and I don't understand how Sorbet and RBS interoperate so I'm doing a little bit of like wait and see what comes I would like it to exist I would like something to be good and nogweii basically, they don't. Two different and separate ecosystems
I really don't like that RBS shoves your signatures off into another file. I understand that the two options are breaking syntax change, or Sorbet's kind of strange way of using syntax to make the types reasonably expressive in Ruby. And I can see why maps shied away from that kind of breaking change. It makes me sad that there doesn't seem to be a clear way forward. Oh no, RBS and Sorbet don't interoperate? I thought there was something where you could export your Sorbet signatures to RBS? Or wasn't there another type thing called RBI? My memory is getting hazy at this point. Alright, so if you go from no vote to 1, your score delta is 1. And here you're going to go 0, and then... If you go from 1 to no vote, it's minus 1. nogweii RBI is sorbet's detached type signatures, basically RBS files
If you go from 1 to flag, it's also minus 1, because that's not going to be a penalty anymore. If you go flag to 1, and if you go flag to no vote, that's nothing. Okay. So, is there a... All right, that's what I was thinking of. There's where I'm getting... confused and kind of miss me remembering. Oh, you know what would be fun? Sorry, getting a little ADHD, I guess, but I will put it over in my notes.

01:54:29hejihyuuga the fun parts of twitch streams are the "ADHD" moments haha
Let VIPs slash cool Twitch viewers change the terminal background color. That would be obnoxious, wouldn't it? nogweii oh ho ho ho that's a fun silly idea
hejihyuuga That's going to get so obnoxious so fast LUL
I can probably enforce some level of contrast, but I think I can change the color in a running terminal in Alacrity, so that would be hilarious to wire up. yeah it would get obnoxious fast and it's gonna have to have like a some kind of debounce on it because i don't need to get strobed in the face by chat when people disagree about what color it should be but someone was at the beginning of stream someone was joking about boy i wish i could send bits maybe that would be a good thing to do with the bits of you can change the Yeah, actually, that's great. hejihyuuga yeah i wanted to just give bits as a thank you haha
Like, you know, each bit lets you change the hue or the saturation or the luminance by one. So it's like 100 bits to substantially change the color. That's funny. That's terrible, but funny. All right. Distraction aside, is there a nice way of expressing this in code? We are saying that the score delta is... Let's put like values together. See, there's these two no votes where we care. Come here, hold on. All right. So what am I saying here? I am saying... If you... Yeah, so this guard clause says if there's no change, we don't go into any of that, which is why I didn't have to put those in the table. And like down here, I even assume it. So what we're saying is... hejihyuuga Twitch has it's own virtual currency called "channel points" that you accumulate by watching streams. Streamers can make rewards that cost channel points, and they're often used for things like changing background colors
The score delta is just whether the new vote... Alright, so... Let me write it in... It has a virtual currency called channel points you accumulate by watching streams. You can make rewards that cost channel points, and they're often used for things for... Hedgie, .. What's the... hejihyuuga Yes
nogweii yep yep
I've seen channel points mentioned and I think I have a friend that streams and is that the thing where under the chat box occasionally there's like a little present icon every like 15 minutes to keep you paying attention and you can click it and then you get the okay, thank you. nogweii you also get a passive 1/min no matter what
So if that's what that is, that seems very appropriate because that's not a like let's light money on fire to change the background and I linked it way back in the beginning of this but I'm probably leaning away from taking donations. So yeah, if it's free, that's pretty funny. Free is funny. hejihyuuga channel points are completely free
So what we're going to say is if new vote is 1, then your score delta is 1. hejihyuuga there are also autoclickers for the little present thing
Otherwise, if your old vote, which is v.vote in this context, is 1, then you get negative 1, and for all else, you get 0. Yes. That correctly encapsulates that truth table. Yes. Okay. Score deltas when flags no longer affect scores. Boom. so that jumped around because when i save code standard rb runs and formats things because i used rubocop for a while and then i ran out of the capacity to have opinions about new cops basically because every time i had to bump rubocop it was like here's nine new cops and you can think about them and decide and see which ones fit your code base and i was like That's an awful chore for something I don't care a lot about. And it's funny, because I had, like, a giant three-month running PR to add RuboCop and evaluate all its rules, and I just pitched them all when I could install StandardRB, so... May wonderful things happen to Justin Searls in his life. I love him so much for releasing StandardRB. In addition to... pushcx Justin Searls <- great talks on code
If you haven't seen... I'll put that name in chat, because... He gives so many fun talks on code, and they're just really smart. I found it really rewarding to read his gems. So anyways, there's a promo. I don't know if he streams on Twitch. That would be funny as hell. OK, so if we have that score delta, that updates. We were here because of calculated confidence with comment. I've gone on enough tangents, I gotta look at the diff. So yes, this is the calculated confidence. And then that's just visual. So that's fine. And then here, I added this new thing. Good. And here, that's just me breaking things. OK. Can I abandon this change?

02:00:31Cannot do a hard reset with paths. Okay, well at least it didn't just hard reset the whole repo. I would cry. I will throw that away. Oh no, I want, let's check out. CL. I'm trying to throw away this change without like accidentally throwing away all my data. There we go. That's much better. So now comment calculated. Now let's do, let's run those specs. Yes. Now watch, it's going to be zero specs fail again, even though I just changed behavior because no, that vote thusly also runs for stories. So something should finally fail. Like we have some tests here, right? Right? I always try when the test suite is running to predict what I think is going to happen. I have aspect failing. Well, that's a legit failure.

02:01:38Oh, actually, all the other stuff, though, was indeed...

...56So this should stay the same. Doesn't remove karma. I'm going to touch these things again when we get to the hiding part of this. So let's go look at model story. And let's start with calculate. So then the calculated hotness.

02:02:56All right, we're going to stop counting comment flags. Yeah. Honestly, it takes so much to have a base below zero here that this almost never fires. That's OK. Let's change that. And we'll standard reformat. Nope. That's fine. And then you mentioned flags here. Yes. So just here, so the upvotes. here, in which case, votes just is self.score. So let's go ahead and get rid of that variable.

02:04:01And now we're saying something even shorter. We're saying cpoints is The min. Oh, I never remember this Ruby interface. Is it... Wrong terminal. Is it like... Like that? Alright. I do remember it. Just requires creating an array. The minimum of a... Wrong line, buddy. Okay.

...45That's not bad. I like that. It's always nice when code gets a little bit more expressive. And as long as I am here and the code base no longer enforces a line length, we're going to smoosh that. I have been leaving these things alone for a long time because I don't want to make churn. But as long as I'm touching the function, just touch the function.

02:05:11OK. I like all that. Good. Oh, man. I see the temptation to stream for hours because the viewer count kind of slowly ticks up and every couple minutes somebody else hits follow. So I made that follow go with a nice round number of 128. badtuple Nothing like gamification
So it's like, oh, if there's a follower every five minutes, I just have to stay online for eight hours or something and we'll hit that. It's gamified, which I wonder where they got that idea in their game streaming platform. hejihyuuga I've heard some popular streamers say success on Twitch is dictated by how long you can stream for
nothing like yeah bad tuple nothing like gamification so there's a a wonderful podcast called odd lots and if somebody could dig up the odd lots podcast url that would be great they just had an episode like a day or two ago with a vp at hasbro and the Boy, did they come in very, very businessy. And which is fair. It's like a business and finance podcast. But there wasn't a lot of love of the game until the last couple of minutes of the interview. hejihyuuga Is it this? https://www.bloomberg.com/oddlo…
And at one point they were describing Monopoly Go, which is incredibly successful in the monetary sense mobile game. Yes, that is the Odd Lots podcast. nogweii https://omny.fm/shows/odd-lots/…
And the Hasbro guy was like, yeah, so we took the Monopoly game and we gamified it, which was just a hilarious bit of business jargon because Monopoly is a game. And what he meant was we put all those... hejihyuuga they mobile-ified it LUL
badtuple It's also one of the most "gamified" games already since it's literally just increasing one number and things that multiply the number
nogweii @HejiHyuuga biggest success criteria is consistency, really. make a schedule, stick to it.
like, gotcha, pay-to-win, mobile game, like, the economics that everybody hates, that's what he means by gamification, and they slapped it on top of Monopoly, because in a lot of mobile game designs, the designing, the monetization is designing the gameplay, so it was just, it was a hilarious little slip for him to say that, we were gamifying Monopoly. I laughed like hell at that. Biggest success criteria is consistency. Yes. So I made a schedule. I even put it on Twitch. I am going to try and be consistent, but I already know September 1st I'm going to be offline because I'm going to the middle of nowhere with some friends. So there will not be the opportunity to stream. But no regrets. As for streaming a lot as a... Hedgie said, yeah, my friend keeps telling me about this guy named Pirate Software who streams 12 hours a day for six days a week. I don't know how he's not dead. That's a lot of performance and not a lot of doing anything else with your life. infinisil This seems like a chill stream, and I'm doing some regular coding streams myself, so I'm interested to see how to do it well :D
But I guess that's what it takes to be number one, is to be extreme. It's like when you look at the Olympic athletes and they're all... like have weird genetic quirks and they're strange in some way. Well, yeah, of course, you don't get to be the best in the world if you're not weird as heck in some dimension. So it's not surprised there's an outlier. Oh, hey, Infinisil, I recognize your username. hejihyuuga i think this is @pushcx's first official stream too
hejihyuuga nvm 6th
If you are interested in how to do streaming well, this is not the right stream to be on because this is like the sixth time I have streamed and one of those or two of those was a tech test and didn't count. badtuple eh, everyone learns together :)
Yeah. Yeah. So, Hedgie, the way I get to six is that in 2020, I did like four or five streams and then wandered off because there was kind of a lot going on in 2020. But this is all kind of set up from scratch because, you know, all the old config broke in the years, just bit rot. So let's get back to this. So this I've updated calculated hotness. Now there is update score. I can't type. Yes. hejihyuuga !lurk gotta head to a work meeting
So this is the one that gets called from the vote model and we do want this and we changed the score Delta that's gonna come in. We changed the flag Delta and story we just coalesce. hejihyuuga (!lurk is a common bang command that chatters use when they want to say they won't be chatting, but have stream up)
votes and common ideas no and vote equals no single equals in sequel yeah now we're only gonna count the upvotes and so once this deploys yeah scores will jump around a little you know there's also the we've talked a little about the history one of my favorite little bits in the code base is this method recalculate all hotnesses on the story model because it kind of tells a story of when the site was originally getting developed clearly joshua was tinkering a bunch with the formula for story ranking and didn't get it right on the very first try and wanted to be able in prod to like refresh things and so there is this code that you would never write today because now the production database has what tens of thousands of stories in it and you wouldn't iterate them like this you would run a mass query or just not do it so it's just kind of a funny little bit of the code i should probably remove it at some point but I don't know. I always have an affection for seeing those kinds of things in a code base that tell you a lot about where the code came from, where it's been. On the other hand, I suppose it is a foot gun for the sister sites. I hope they don't pull it. So let's look at that. So I updated that. I updated that. Leave all the vote code alone. I didn't? No. This one is update vote score... update score delta in thusly i'm not typing that name okay let's look at this see if the build runs so the three parts of the build are the specs that are going to take a second to run standard which should just lint and then breakman which is an automated scanner for vulnerabilities and you can see that this is kind of a manual process by how often I break push broken code to GitHub. Good. So, aside from the MySQL error, these are the errors I wanted to see. I wanted to see them because I knew there were at least a bunch of tests of scoring. Thank you. So, we have... This one... Oh. Oh, story scores can't go negative anymore. Oh, that's really interesting. So there's a bunch of code around that I forgot about. So, let's put that on the list.

02:13:16When stories go to negative scores, they kind of get faded out, which I think is good. I kind of want to preserve that behavior. That's actually a pretty nice UI, but it's based on scores. Oh, and you know, we even saw it here. Let me, so if I grab the browser up, you see how this is kind of faded. If I look at the homepage of the dev instance, this should be really clear. And you're hitting replying comments and taking 30 seconds. So I just have to vamp. But this list detail gets a opacity. Thank you. opacity applied to it because it's at a negative score and it's just a little thing of saying like yeah this story's probably not great and so it kind of visually stands out like here's another one and if i switch over to slash newest of course a heavily downvoted story generally won't appear on the home page And now it's just a heavily flagged or a heavily hidden story. So I've got to think about the behavior. I still want to have the fading. So all of these removed by submitters are a consequence of the way fake data inserts stuff. What page are you going to be on? So you are, this is before, so 27 days ago. I have to paginate it in a bit.

02:15:08Let's just guess that there's, like, not 56. I wanted 5 or 6. Not both. Because I want to find this one story in the list so that I can show that it has a substantially grayed-out view.

...30Okay. Not 5. How about 15?

...43There's something I should fix on stream. There's something I tried to fix on stream four years ago, and it got weird and complicated. Oh, that could be good as a triumphant return to streaming of go and fix that thing that's just been broken for four years because I bounced off it. I kind of like that. As George Lucas said, it rhymes. infinisil Why is it so slow?
The history rhymes.

02:16:18In Finisil, it's slow because of the replying comments view that's populating this. In development mode, it busts the cache. And so if the cache isn't getting filled in the background, it takes a while to load. And I could just like that out. But where are we? Layout, application. Where is it?

...56It's the inbox count. So if I just said, if false, false. So these are all old. I want the previous page. Oh, there must be a second call to it that I'm not immediately thinking of.

02:17:26But we looked at the Rails server log, and it's literally like a 30-second query. I have been considering unmaterializing that view, or turning it into a select, because... It really is awful slow. In development mode, and it blew up production once when we migrated to the current host, I tried to use MySQL instead of MariaDB, and there is an optimization where MariaDB will push where conditions down into materialized views, and MariaDB MySQL doesn't have that. And so we were basically down for a couple hours before it. That was awful and stressful to find that prod difference that way.

02:18:18triggered it maybe it'll be in the rails log so if i look at replying yeah see look at that replying comment count took 16 000 milliseconds and where were you called from at models user 598 oh it calls unread replies count for the other part of the all right so let's put that back and then nogweii @pushcx fyi only seeing the browser, not code
Instead of changing it here, that one, that one, this becomes zero, and this becomes zero. My finger on the wrong key. Oh look, now pages load in a normal amount of time. See, so I'm really happy to have replying comments, but the way it keeps having these little sharp edges, I find pretty painful. So here's what I wanted to show like three minutes ago, the The story is highlighted out. And now that I'm looking at it, the instant thing I want to do would have let me demo it faster. But wait, Firefox, let's fix that UI size. There's a DPI setting somewhere. It's on my to-do list. So here it has the class negative three. I think there's also a negative five score I can add. Yeah, and then it's even more grayed out. And those don't wanna lose. They really are, So they show up in list detail.

02:20:43Oh, yeah. And they also always trigger this CSS bug. That's OK.

...58So... I guess what I could do is just base it on hides, but then... No, that's an absolute. I could do score minus hides, but then... That's giving back a score. Oof.

02:21:26yeah oh i didn't put that sorry i didn't put the editor back up where the stream can see it so it's here in the the story view it says if the store is if the score is negative it adds these css classes and if this became something like story.hides.count is greater than or equal to one well then as soon as see it's not offset by score anymore by upvotes and so then just stories instantly go gray as soon as one person's not interested in them and that's not great and if i make that flags same issue and it re-incentivizes flagging stuff because you're mad at it so it really wants to stay as something like infinisil Perhaps a low multiplier for hides/flags?
score minus flags which is to say upvotes minus flags at this point but oh i don't want to cache another column so do i want to just turn that feature off that's not great so that applies for any of these three approaches perhaps a low multiplier for hides or flags I think really it's... Where this is most useful... I guess I'm just saying the math in a different way, but like when a story has few upvotes and many people are like, wow, there's a problem here. Which says... Wouldn't it be the worst thing if it was a little easier to trigger?

02:23:29So this isn't going to blow up performance because the upvotes, this is score, which is already cached. And then hides is already selected because... And I'm going to go see it in the SQL. Yeah, because we have to pull that out because the list detail says the number of people that are hiding. And so... It's not adding an n plus 1 there. And then this votes is already grabbing the number of flags, which we didn't touch anyways. So yeah, I don't think I'm going to kill performance. I didn't get back out of select mode. All right. Let's put it on the story model. If it is resubmit, do we have anything related to negative here? No. All right. This is where I wish I had my plugin working for finding names so I could figure out what to put it next to. Putting it next to current flagged and current uploaded is pretty good. That's reasonable for now, I can fix it later. Moving a function up and down is trivial. So let's say... Yeah. So we will say that Neg is the score minus the hides, which I think I have to count, minus the flags, and that one's just an integer. And is this association named hides? Has many... Oh, it's called, like, hidden stories, right? Hidings. Hidings. Okay. Okay.

02:25:57Where did I implement for presentation? So there is a scope on story called for presentation. I've got a few windows open, huh? That includes some stuff. Yeah, so this is going to have to change to include hidings.

02:26:27It's a little funny. No, it's just that moderators see it. That's it. Okay. So close that. Even those out a little. infinisil Are the hidings also for hidden tags? I'm guessing just for an individual story
And this becomes or equals, so it only runs once. I have a nice middleware for... catching n plus one queries so i think we'll be okay on that front it'll raise if there is one and then if neg is let's just say is one or we're just gonna do this math if neg is greater than or equal to five say i'm doing this so yeah i know that i could do something clever but i would rather do something obvious and easy to maintain and change

02:27:49I'm putting this CSS stuff in the model because it is based on very model-y things like the score and the number of related records, and also because we live in a fallen world where there is no perfection. So I don't feel bad about making things worse. So we will just say...

02:28:20We will print story.negativity. Come on. Let's at least make it negativity class. Yeah. Say what I'm doing.

...45And then these all go away.

...55Good. So that's reasonable. All right. Let's reload this view here and see if... Hey, look. So you remember I mentioned I have a middle one for knowing that I didn't add 1 plus n queries. Hidings are not for hidden tags. So the code base calls it tag filtering. So what Infinisil is talking about here is you can go to... Oh, let's not do it in prod.

02:29:30even if you are not a user of the site you can filter out stories with certain tags on it and there is a lot of garbage in here because that fake data thing made a bunch of lorem ipsum stuff but you can say like oh i just don't want stories on formal methods because i like having bugs and if you're not logged in it saves in a cookie if you are logged in it saves to the database all right so we hit that we did get badtuple nice of you to think of logged out users
Why don't you tell me where the story collection was loaded, because then I would know exactly what to fix to make sure I'm calling the right preload. Bad tuple, yeah. The story filtering working for logged out users, I can't take credit. That's JCS's code, and I've barely touched it. But yes, it's a very nice feature for logged out users. We have a couple of those things that shove stuff in cookies. And it seems worth it for people who don't have invites or don't want to log into the site because they don't like logging into things. Yeah, Codebase has a bunch of little quirks for, like, the site is made for programmers, and programmers have these particular weird opinions, so let's make it nice in the way that they will find satisfying. So there's some very specific stuff. So if we go to home controller line 87, where are we loading, I don't know, that's, where are we loading it? badtuple Code's offscreen btw
It's gotta be a, yeah, from stories newest, which is over in the story repository. Yeah, so we grab the newest. Why don't you say for presentation on you? Nothing in this story does, okay. And then here, nothing here does? How are we not buried in N plus ones? Oh, is this on single story?

02:32:00Oh, code's off screen. Man, there is something where I need a way to make it so that the VIP users can flash the screen. Because if I don't glance over at the chat for a second, I'm not going to think about it. So I'm digging around to say, OK, so here in the controller, when we load newest, we just say paginate stories.newest. And that's calling over to the story repo to retrace. And that says all this. And all of these are going to have n plus 1 queries in them. So this needs to be on story base, because now it's going to show up every time. Why didn't the for presentation scope do that? Because I think it's only used when loading a single story, right? So if I go look at the stories controller, Alright, so for presentation is like for single presentation. It's avoiding n plus ones there. This is for when we're loading mass loading stories. Yeah, this is just a limitation of active record. But it's one of those that feels like you are just doing the wrong thing, and if you just always did the right thing, which is to say it's a library limitation, because it shouldn't feel like that. The easy way should be the right way. All right, so model story base. Here's this. Include hidings. And if I bring the browser up, watch me forget to put the browser away again. This doesn't fail. I was supposed to succeed. All right, let's swap back. See, I remembered. And look at the Rails server log. Rails server log says, yeah, so here's where the exception was. So who loaded the story? See, this did pull hidden stories. I'm wondering if this is, difference between spy user for stories hash no stories paginator map triggered it we also loaded it up here

02:35:19hejihyuuga !unlurk
Well, this is a good one for spot the bug. If anyone who, and you can play along at home with the Rails repo that's up on GitHub, but for some reason, the story repo is adding the correct preload for hidden stories, even though we only need the count. However, it's happening twice and then it's not in the association is then each call to negativity class is triggering it. So this data didn't get pushed down into the storage that are in the collection. All right, let's take a look at that. So the base says we wanna include these things and that's fine.

02:36:24And the story paginator says, do all this stuff for presentation. That's also fine.

...43And then the story repo calls base, calls it on newest. should be what triggers that load to hiding so why aren't why isn't the pre-loaded info because it's pre-loading hidings and i'm asking for their count that's what it is so where'd it go so if i had said hiding size they would probably all be loaded and we wouldn't have that bug yeah oh that's ugly to have to know that so so what's happening here is also it's not working but rails has these associations on the model so i can say like story.hidings and for that individual story it will get all the hidings records if i say that relationship.count it will trigger a select count star and so even though it already pre-loaded this it doesn't know that for count it could just look at this and there is the there is the ability to say dot size which is if you know it's loaded just say give me the size of the number of records you have right that's the difference let's ask the docs there's something we haven't seen on stream yet so here where's that size method

02:38:50Yeah, so if it's loaded, it just says, here's your length. Otherwise, it triggers the count. hejihyuuga this is reminding me that I need to start using offline docs more often
It's always nice when the code actually looks like exactly how you would say it. So either I can call that size to know it's not, to know how it's preloaded, which... infinisil Being able to expand the code from the docs is neat
Yeah, I guess that's fine. I guess that's just what I've got to do. All right. So I'm going to put the docs away. And we will call that size here. Now that I'm satisfied, that's roughly correct. And then we will... Re-rearrange all my windows so I can see what I'm doing. Let's close this because it's fine. Let's close. I'm going to edit that in a minute. Let's put it on top. And close that because it's fine. And I want to add some debug info, which is the story.score. No, let's just say score is story.score. I want to see that it's doing the math right, because I suspect it's not. Minus hiding size is hiding size minus flags. Let's actually label it. All right, and let's bring the browser back.

02:40:33infinisil The problem seems to be that the score isn't negated
It would help if I said story dawg. Let's get the right context here. What are you mad about? Oh, I changed the... I changed the titles, not the actual variables.

02:41:01Yeah, you know, if you catch a bug and you're a VIP, your channel points for messing with the background color should go double or something. I should really incentivize spotting the bug before I do. So that story was named something magnum. Ah, here it is. So... nogweii get the absolute value of @neg ?
The score... Oh, this is now... hejihyuuga Twitch plays Bug Fixes LUL
wrong, because nobody has voted and busted the cache. So let's bust the cache. Twitch is playing bug fixes, and I'm paying bug insertions. So now the score is 1. So this was just old cache, because I hadn't voted on it. And there are no hidings, and there are five flags. This didn't say.

02:42:04nogweii you're checking greater than but going down into negatives
I want to just print it. I don't want to open the inspector, especially with everything a weird scale. I'm checking greater than, but going down into the negatives. Look who just became a VIP.

...23Whoa. Why do these have negative one? Yeah, because I'm doing it in exactly the wrong way. Yeah. So...

...41Do I want to just say negative like that? Because that's directly what the logic used to be. No, missed the button. Where's that quote mark coming from? Oh, it's the debug puts quotes around the string. Yeah, you know, Nagwe, if I hadn't already made you a VIP, you just did it again. nogweii LUL all good
Maybe there's something like a time-limited VIP so I can say you get considered a VIP for the next 30 days. hejihyuuga LUL
And then at some point, you know, VIP level 10, you just get to SSH into my machine and change the code out from under me because you're coding better than I am.

02:43:39I don't know who this very round guy is that's in the emoji you keep using. So if there is a cultural meaning to this guy, I don't know what it is. All right, there we go. That looks good. nogweii it's the image replacement for "L U L" (no spaces)
nogweii aka, lol but twitch
Let's go ahead and take out the debug. the image replacement for lul with no space oh okay lol but twitch all right thank you for explaining see look at this i'm i am learning twitch culture okay you know as a fun culture fact thing you can't use emoji and story titles on lobsters because i was just like no i can't look at that infinisil Reminds me of those anarchy repos that automatically merge any PR
Before I added that, one person did it and I saw it and I was like, absolutely not. And 30 minutes later, I had made the patch. If you go and dig back and find that. Anarchy repos that automatically merge any PR. Yeah, I will try to not actually do that to prod. hejihyuuga There is some culture behind the emoji, but it's used 100% of time just to convey laughter
Oh, that's something I could do on stream is review pull requests and talk about my train of thought because... There is some amount of it that is coding advice, and then a lot of it is, is this code right for promoting the site norms and cultures? So thank you, Hedgie. And actually, I think Nagwe explained it first. brekkjern You just made me want to write the best post ever that has to be posted to the site, but the title will just be emojis
All right. So if I have that.

02:45:21Where did I put my stream notes? Are they here? No, I put them in the root directory. Stream notes. All right, yes. So this, that's fine. Probably fails the test suite in some way, but it's fine for now. And then flags shouldn't touch user karma. Oh, that's in the vote model. Helps if you spell it right. So Karma is... Ooh, actually I already fixed it, because I changed score delta in that way, non-invasively. Free code. It's always nice when code is well-factored enough that I think I have to update something and it's actually already correct. Oh, hey Brechturn. nogweii @pushcx speaking of norms/culture, is "Don't editorialize the title" actually a rule? I don't see it on the site.
The title will just be emojis. Brechturn, so we just had this post. Yeah, I'm not logged into prod on my Twitch Firefox profile. brekkjern eeeeeeeeeeeeeeeeeeeeeeeeee
What was the subject line with all the E's?

02:46:39There was like a, yeah, Brechturn, you're thinking of it. Like we just had, there it is. I knew somebody would just use E's. brekkjern I read it :)
There was a story that was kind of... Man, can't scroll. They tested the limits of the titles. Oh, I didn't realize that showed to logged out users. Huh. Huh. I had no idea that showed to logged out users, actually. pushcx https://lobste.rs/s/qcsc40
It's been so long since I've been logged out of the site. So let's at least throw this link into the Twitch chat. So anyways, you're going to do a weirder and worse version of that if it's like 120 emojis. hejihyuuga Someone is going to post a story with an emoji title, and they'll promptly get a polite message from pushcx saying "no thank you" /joke
Also the same day as this story, somebody submitted another story where it's one of these weird repos with a joke name, and I considered merging them, but Try not to be the no fun police. Occasionally I am the no fun police, but not all the time. Excuse me. Okay. All right, so I said I would go for like two or three hours. We're at two hours and 45 minutes. And if we can bring this PR home, I will feel really good about it. PR, he said, as if he didn't just push straight to master. So let's look at where those tests are at. Because there was... all the tests in model vote and spec vote and actually the this thing that might be failing because i commented out the thing but seeing a sql syntax error is so weird i'm gonna have to brekkjern I personally don't like the merging practice. I miss so many good posts because the follow up posts gets merged into a post that fell off the front page and I normally have no incentive to go back and look at older posts
just see what that is so let's go ahead and run just the story specs yeah and this one just from the wording of it i want to see how it has a negative score implemented because it probably doesn't have it by hidden stuff so hedgy

02:49:02There's actually, when you submit a story, there's a validation here, and it uses this regex to grab anything that looks like a graphical code point and prohibit it. It just creates an error, and you see title may not contain graphic code points. So someone cannot submit it, and I would consider it a bug if they could. hejihyuuga gotcha!
Yeah, Brickturn, I... I've been thinking a lot about how story merging works. There's actually an open bug about story merging that says, hey, so my primary griping in that issue is that the database model for story merging is an endless source of bugs. But if we improve it, by separating out the concept of a story title from the links and the texts that people submit, we can put things back together in a nicer way, and we could do things like put a title on a story, like put a number at the end of a story title that says how many other links are merged into it, or tell someone, hey, if you upvoted this, there's more links on stories you've upvoted. Because right now, mostly the way to discover merged stories is you are still interested in the conversation on the first one, and you see the new comments. There might be better UI unlocked by fixing the database model in other ways, but that's just what has come to mind right now. hejihyuuga would it make sense for story merging to keep the new links on the front page, but link to a common thread?
Okay. Okay, so let's look at that. Story spec, was it 359? 459? hejihyuuga Or is part of the goal behind merging to keep the front page clean
394. turing_complete thanks for your work on lobsters. <3
So this one, yeah, so these are no longer correct, because even with these flags, it would have a score of one. Oh wait, this is, am I in the right spec file? Spec models, story spec 394. How is the model creation throwing an exception? My turn complete. Thanks for dropping by the stream. foxboron Thanks for the stream!
Running lobsters is a joy for me. I have joked about it as it's like I have a backyard party that kind of never leaves. It's just run 24-7 for the last, like, seven years. That's how I explain it to my... Oh, hey, Fox. To my non-technical family members. And if you think of that like... you know, that warm glow of, you know, I'm hosting a party and lots of friends are here and everybody's having a pretty chill time. It's that. It's just that continuously for a couple of years. Oh, I do have an error in my SQL syntax. Okay. hejihyuuga that's such a great way to describe it
So in 360, where I update the... All right, we're on a bug race again of who wants VIP status for finding the bug before me. So let's open up... close this and then open up the story model and in calculated hotness i'm dropping down into here so it must be that i changed the c points yeah so this sum this active record sum basically i only want to run that for this so if i said cpoints equals hedgy there is a longer comment about it somewhere on the site so if you search for like backyard in the comments on lobsters you'll find that one so this one's a query and it's a different type so if we say hejihyuuga found it https://lobste.rs/s/hhoopi/lobs…
nogweii probably want to expand the `base` check to a full conditional, and only call .sum when base is more than 0
really who cares if I keep the intermediate value in scope so like this part is the relation and then the rest of this is like if base is greater than equal to zero C points comments equals comments dot sum comments score plus one and I shouldn't retype because I probably typoed but it's already done and then this becomes comments No, comments. Oh no, it's still got to be a sum, because it's still expecting that it's calling the sum. So let's lean on undo for a second. This is just one, right?

02:55:00What is it expressing? unrealincident Not sure if this has come up, but your mic sounds like it's cutting out completely when you're not talking, so the background noise cuts too, which I'm finding really distracting. I don't mind the background noise, it's the cutting in and out part that's frying some part of my brain
is a saying that if the sum of the mods from the tags and whether it's the user is negative which is to say so if you're posting something and it's tagged like rant and culture at the same time oh unreal incident sorry it must be the I know what that must be. I put on a noise gate and it might be a little aggressive. Let me tweak that. We had some issues at the beginning of the stream where the whole thing was just choppy. So if I... Let's just turn the noise gate off and see how that goes. Do I have a...

02:56:02Yeah, I don't know a way...

...16So hopefully I've stopped chopping, and when I stop talking, the white noise that's my AC doesn't totally disappear. And if that is good, I will leave it that way. And then y'all can tell me if you can hear. unrealincident Yeah, it's fine now, thanks!
If you can, I will have to tinker more with the settings. Yeah. All right. So we've got this. And I will listen back to the recording for myself. nogweii you could also get a music license and use that to fill the air
As awful as it is to listen to myself. So this is just saying if you are submitting a bunch of stuff with negative hotness mod tags... Oh, a music license. Yeah, I... And I saw a page on the Twitch creator pages about how to find licensed musics, and it was like, good luck. It did link something, but... I don't know. My attention being scattered between narrating and coding and keeping half an eye on the chat room is tough. I think if I added music, I might totally lose my mind. So I guess I would have to wire it up so only you hear the music, which is kind of weird to me. Yeah, I don't know. I don't know how that works.

02:57:41So this is basically saying... if you are submitting a story that is tagged as culture or one of the other negatives, and we can look at those. brekkjern Nightmode is a music label that allows their music to be played on stream for free. Decent music too.
foxboron My main reason for not streaming my own development is my complete inability to narrate what I'm doing.
So these hotness modifiers are some of the story tags. Are they not printed on this page? foxboron I'm 99% sure I'd zone out and not say anything for an hour without realizing
They should be. Why are they not printed on this page? That's rude. Let's go back to localhost stories new. They're definitely over here. So over here, it shows you like roughly how many people are filtering. And if I say, yeah, like set, this tire has a hotness mod of minus 0.25.

02:58:42hejihyuuga There's a musician who makes music especially licensed to be used on stream for free. Their name is Harris Heller, and their music is pretty ubiquitous on twitch (among streamers who care about music licensing)
nogweii @Foxboron random question: Is an MR to a package to update it not cool, in your opinion?
so the code is saying look i brought the code back i didn't forget the code is saying that if the sum of the hotness mods is negative you don't get a bonus from the comments and so really what it is saying is if base is less than zero c points is zero otherwise you get a bonus for it that's that's really it and fox having the the chat open and trying to like as a point interact with people and acknowledge the things y'all are saying helps keep me from just totally shutting up because otherwise it would be so easy and it helps enormously that there's a couple dozen people here instead of you know one or zero okay oh and i deleted some expression so that's a bug so this becomes yoink and then come here let's put that in there Let's do that. Let's blow that away and let standard IB fix the spacing. Done.

03:00:12Nagwe, what is an MR to a package to update?

...25foxboron @pushcx They are asking me if they can send Merge Requests (Gitlab PRs) to Arch packages
nogweii MR is "Merge Request", Gitlab's term for what Github calls PR.
Hedgie, thank you for that reference, but I think I'm going to leave music off the stream. It's also a little nicer for, as somebody was commenting, they were just kind of watching with half an ear as they're doing their day, or they can just kind of watch it go by. If there's music, then you have to totally mute it and you can't listen to your own jam. nogweii and yeah, Arch uses Gitlab to manage the package's PKGBUILD
Oh, GitLab PRs. Cool. Cool. Thank you. I guess that says how much I've used GitLab, which is I've browsed around but never submitted stuff on any GitLab instances. So this should fix that failing spec. Let's run it. And I've touched enough other code that we may see a different failure, but calculated hotness should at least not be throwing errors about invalid SQL.

03:01:22foxboron @Nogweii Preferably fix bugs? bumping pkgver with no comments isn't super usefull for us. If you bump pkgver + fix bugs thats best.
good and then we have some vote specs to update so over here and this is this is just a pet peeve of mine for browsing the code has to be on the left and the spec has to be on the right that's it you cannot put a spec on the left side of the screen unless it's the only thing you're looking at i don't know why i'm just just hung up on it so that first one was 21 was failing So yes, if you go from negative one to one, that's fine, and the score, well, the score should start out, the score should start out at one, because the submitter has voted on it, it stays at one, so the score doesn't go down when they flagged it, and then afterwards, the score should be two. Yes. We're going to do these one at a time, I think.

03:02:49And if that was that easy, yeah, let's just do the rest. nogweii @Foxboron I'd absolutely add an explanation to the MR about why the pkgver bump. But yeah it's kinda drive-by
So line 32, when you go from negative 1 to 1, you start out at 1 and you also stay at 1. Yes. And then 64. If you go from 0 to negative 1, you start out there and you stay there because flagging doesn't foxboron @HejiHyuuga In 2020 when I did the online Arch Conference I actually used an entire playlist from Harris Heller with lowfi rain songs to match the artwork someone made. It was great
nogweii and not everyone would put in the effort to include a comment. So as a general rule, probably not the best.
I almost want to update these to just match that truth table I wrote. Alright, last one was 72. So it starts out at 2 and it only drops to 1. So that ought to be all of those specs.

03:03:46And it gives me a second to read the chat.

...56Fox, are you an Arch committer?

03:04:04Do you have a hat on the site for it that I gave you and I don't even remember? foxboron @pushcx You did
Yes, you are an Arch Linux developer. You know, Fox, OBS has a plugin called Browser and It doesn't build, and there is some kind of build hell happening in the various AUR packages that try to package it. If you're bored, that could be a thing to contribute to. It is cool and in Arch. hejihyuuga hahaha it came full circle
Let's run the whole thing. foxboron This is the second time I've heard obs complains this week... :)
And it seems that the browser plugin for OBS is where all of the neat interactive overlays come from because everybody just shoves everything through a web browser. That's how software development works. I understand Vim is going to package up Chromium soon. That's a joke. Applying comments spec. Oh, I see why this one's failing. foxboron The browser plugin is a small trashfire, and the current maintainer doesn't *really* want to deal with it
This one is... So I mentioned there's this materialized view called Replying Comments. It has a bunch of judgment calls in it like, hey, if the story is flagged to hell, maybe let's not show Replying Comments in there because that's probably a flame war happening. And so it tries to dial down the heat on it by not showing those. But then we changed how scoring works. Oh no, and we changed how scoring works. And so now these stories aren't going to have a negative score. They're going to have a negative... All right, so let's go look at the view definition. Yeah. So this says neither the story or the score has a negative score. And what this really now wants to say, we're going to... Revise the view. I spent a lot of time wanting to delete. Applying comments v10 SQL. Oh man, this is getting exciting. The browser plugin is a small trash fire. Oh, I'm sorry to hear it. And I'm sorry to dump my complaint on you. I hope that came across as like friendly griping as opposed to trying to point you just at my pet project because I run this other thing and I'm a streamer now. I don't know. It actually looked like an incredibly hairy mess of dependencies. And I love whoever has taken on packaging OBS for Arch. I talked to one person. What was his username? It was like mm4numeral4pl. I'm misremembering. foxboron No worries :) People have been complaining about it for a year or two now.
I talked to him on Libera about a different package of his related to OBS. And I was like, hey, why did you remove this thing? And he pointed me to the diff and he was like, well... And he said it a lot nicer, but the gist was that packaging is an unending hellscape of torment where you are mediating a gladiator fight between different package authors who don't know each other. So I was like, cool, I'm just going to not try and take a dependency on that and just be happy that what I have works. Because... Hey, it's all free.

03:07:55So this is the similar kind of update as I did to that negativity class. Except here, it's even worse. Because this one... I mean... This is literally a 50-line SQL statement. I don't want to add a join to it to join the hidings. I don't want to add math to it because it's already slow enough, as we have seen on this stream. And I don't want to delete this restriction that something has a negative score. Because if it has a negative score, it's uncommon enough that it is a real strong indication that something is wrong. So... boy, I have my option of three things I don't want to do. Let's think about that a sec. Does anybody else see another option? Does it make sense how I've described how this works? I can pull it up here in the... So as a logged in user, this inbox link will take me to replying comments, which are Wow, that's some actual prod data there. Whoops. Don't pay attention to those people who have messaged me five years ago. Yes, my inbox on prod is full of gold crap. Oh man, there should definitely be like a stream-specific emote for when I fuck up and put prod data on the screen, and then everyone can spam it and make fun of me. And you should get bits for it. I'm aware that I can't grant bits. So I guess it would have to be channel points. I don't know if when I have that, I can just grant that to people. All right. Oh, this is also... This is another thing. It's not sensitive broad data, so... you don't get to spam the emoji for it but the gist of it is is replying comments is everywhere I have posted a story and people have made top-level replies or if I have posted a comment and people have made comments this page collects them up and so it's a really nice way to see your active discussions and foxboron The obs-browser situation is that the CEF version is modified so you either need to make a new package just for OBS, or vendor the complete source and build it inside the package along with OBS. And I doesn't seem like that will change upstream
While it is great to see active discussions in one convenient, collected place, it is not great if those active discussions are going off the rails and things are getting heavily flagged and people are having fistfights and, you know, it's like that community meme where the guy walks back in with the pizza and the whole room is on fire. Like, I don't want to put those on there and say, why don't you go back and contribute to it? The OBS browser is the CEF version is modified. So you either need to make a new package for OES. I don't know what CEF is. I saw it go by when I was fighting packaging or vendor the complete source and build it inside the package along with OBS. And it doesn't seem like that will change upstream. I don't know what CEF means to understand that. Can you explain? And I'm going to mute a second so I can blow my nose.

03:11:23arh68 CEF is like a chromium embed framework right
brekkjern You need a channel point sink of some sort too. Something we can use them on. I suggest being able to redeem them to ban someone from the site for a week.
foxboron Chromium Embedded Framework, which I assume is some stripped down version of Chromium for embedded work
hejihyuuga @Brekkjern LUL
okay chromium is chromium embed framework oh my god if that's what cef is i can see why that becomes incredibly difficult because oh my god the idea of packaging a browser and its dependencies and its 10 million options all right i i understand why that is a ongoing source of pain and god bless whoever is maintaining that or even just packaging that and Breck as for being able to redeem channel points to ban someone from the site for a week before you hopped on we were talking about I just had a funny idea it would be great if you could redeem channel points and each channel point lets you change the hue saturation or value of the background color of my terminal by one in any direction think that could be a lot of fun i would have to have some kind of gate on it to maintain a minimum amount of readability of contrast ratio between the foreground text but god would be funny if the thing was just slowly going rainbow as people threw bits i don't know i like that and i've seen i've seen streamers where you know they're playing a video game and people brekkjern I would start a movement to keep the colour hot pink constantly
like play send bits and they like drop down on the stream and they fill in like with little physics and stuff. hejihyuuga It's an overlay on stream
But I get the impression that that is an overlay that's on the stream as opposed to like visible on the desktop of the streamer. And I would like it to be really annoying and in my face. I think that would be hilarious. hejihyuuga sounds like you know what your next sideproject is LUL /joke
yeah yeah it's an overlay on the stream no see i need it to be an x window integration so it just prints in front of me wouldn't that be nice and awful all right so issue with replying comments you don't want to send people into a flame war But now, the flags column doesn't have, no, the score column include flags.

03:14:10I don't want to join against hiding. because perf. Honestly, the database is pretty fast, so maybe this is okay. That actually feels a little weird. How do I explain that? You might not see a comment on replying comments if lots of people have hidden this story that it feels slightly disconnected like I see how we got there but it doesn't I it makes sense in a path-dependent sense but I can't explain it de novo so that's not great and one of the things is like these behaviors at least have to be reasonably intuitive where if you look at a story and you see like oh it's got eight flags on it you go hey okay and I so I don't want an expression score minus flags because perf again do I want to just use flags directly like and say if there's a bunch of flags Honestly, maybe I just bite the bullet on this one. It's literally an integer addition of two columns. It's got to be affordable, right? Like what could go wrong? So this would change.

03:15:59infinisil Channel points to automatically type a select key on your keyboard. End up with occasional typos, and a compromised computer if you go on a break!
I do this practice of like writing out my options and what I'm mad about all the time in Scratch files because otherwise... it's hard to think through things so it's actually working out very nicely for stream channel points to automatically type a select key on your keyboard that's that is hilarious and this is actually my personal desktop and I've done some stuff to try and minimize how much personal stuff that we can see on stream but no that one gets like like let's read his banking statements out of the directory that they're saved in. That would be bad. So let's say stories score minus stories flags is greater than zero. And comments score minus comments flags is greater than zero. Ooh, it's actually three places. Like, that's... brekkjern RCE through Twitch channel points sounds like a fantastic vuln
reasonable does this respect oh weird replying comments doesn't respect hidings that's just a bug that's just a missing and not exists

03:17:33hejihyuuga @Brekkjern HAHAHAHAHA
What's the table name? Is it Hidden Stories?

...43Yes, it's Hidden Stories. hejihyuuga @Brekkjern would it really be a vulnerability if it's by design
From Hidden Stories. You know, for as often as I do it, I was talking about how to know... Yeah, I don't need Twitch plays Vim on my computer, Breck, but I will absolutely tune in to your Twitch stream to play your Vim or VS Code.

03:18:10foxboron @Brekkjern You did not see when Twitch tried installing Arch Linux?
badtuple community challenge: exit
So, a thing to automate would be like, how do I go from... a model to look up the table name to show me the table definition i need like a one keystroke to do that maybe i will hack that out before the next stream because i've already done it like three times today and i have that slowly developed intuition of like hey if i do it three times a day for 20 years i've been doing rails maybe i should automate that I know there are Rails plugins, gems that will plug in and like at your model, it will add the table definition or a simplified version of the table definition in a comment to the top of your model. I think that is clever, but I don't like the churn of it. And I would rather that be an editor thing. So let's say this join stories on

03:19:14brekkjern @Foxboron Nope. Heard of it, but I try to avoid getting infected by Arch stuff whenever possible :P
Yeah. H dot... What is it called here? H dot story ID equals stories dot ID. Yeah, actually, it's fine. I don't need to do a join in here. I can join to the outer stories. Yes. Where not exist, select one from hidden stories. H on story, stories ID, where... And then I care that it is H user ID is, what's the name of the current user? c.userid. That's a bug fixed. Twitch tried to install Arch. I hope they used a VPS in the same way, like, you know, bless, I hope he used a condom. Hmm. foxboron @Brekkjern can't get infected when chat spends hours trying to get an install going
Alright, let's see, and...

03:20:35Because a single comment obviously makes five lines of SQL reasonable. All right. So there's...

...55arh68 can ON filter like that ? or do ya need where
Okay, I think that might be it. Did I have anything else? Can onFilter like that or do I need a where? Yeah, and you can see the on... happening i do it up here from read ribbons join comments on it is the equivalence for the join and i think in every sql database of the last 20 years they are entirely equivalent back in the 90s they used to do it a little bit differently let's capitalize where there was a performance difference but they're obviously equal in relational algebra so they convert Honestly, yeah, that looks fine. Anyways, ARH, I appreciate you trying to find bugs. It's how you get to be a channel VIP. Okay. Boy, I touch replying comments so rarely, I don't remember what the command is to migrate it. No, it's not. Is it scenic? Or is it called view? What is it called? Do I just... No, that didn't run or I would have changes to db schema and I don't. What is this command to bump the views? So I define that SQL file. And because it is defining the database, I have to have some kind of migration. Oh, is that what it is? Is it just that I make a migration and call it? Yeah, there we go. That's what it is. So let's make a migration and say, What are we doing? Update applying comments for hiding. That's a reasonable name. And then, yoink. Here's one of the last times, the last time I updated that. So let's just go look at that. And Okay, so we can just call replace view. So let's grab that and migrate. What did I call it? Hiding 10. Okay, and then it just becomes break db migrate. And then it's a SQL syntax error, right? There's no way I typed that much SQL correctly on the first try. Oh, maybe ARH 68 was right about I can't on like that. On HStoryId equals StoriesId, what are you mad about? That is a very non-specific error message, MariaDB.

03:24:28What it even looks like up here. arh68 like no Join tho
Okay, who sees the bug? We're going to select one. We're doing an exists query. Oh, I left off the join. Like, no join. Yep, you got it. All right. I didn't understand what you were saying. So we've got to say where... Yeah, clean that out. Yeah, I had had the story in there, and then I realized I didn't need to join it again because it's up at the top of the query. And so we can just join the inner to the outer in an Ouroboros of SQL. Unknown column C user ID and where clause.

03:25:27What is C? I thought C was comments. so we are finding the read ribbons. The read ribbon is the user who is viewing the reply comments. So maybe I just want to join against that because that's where we say the read ribbons, let's look for all the user IDs that appear in this comments that user ID. parent comment oh right because you are not seeing this is not trying to select the comment and then find the children it's trying to directly find the children and filter by the parents so this wants to say that the hider is the parent comments user ID yeah and we'll find out if the scope is correct for that It is. Good. So, with that swapped out... Let's run the suite. I think we're on the home stretch on this. The only thing missing is that... hiding doesn't penalize the score. And I have to think about that. If it's penalizing the score column, or if it's penalizing just the hotness.

03:27:31infinisil If you have some spare time, I'd love to hear some thoughts on the invite tree. How useful is it for moderation? Anything you'd want to change?
Hello. itscryne Heyyo Just came back from trying to capture a photo of the perseids but the clouds had other plans for me. But now that I've seen that there's an interesting stream to watch I'm less disappointed :D
Oh, so this is the first time using the new view. So it is getting its internal cache filled. So that's going to take forever. Howdy, it's Grime. I'm sorry you missed the Perseids. Hopefully you were somewhere that had an Aurora a day or two ago. That was a little wild. It didn't come all the way down to Chicago, but I saw some photos from... the middle of Michigan that were pretty nice. Big int is out of range. Because I did math. I did math. That's the reason not to do math.

03:28:19itscryne I'm from souther germany, yep we had some awesome aurora
Why are these things big ints? itscryne s/souther/southern/
I thought only the... Bigint unsigned values out of range in comments score minus comments flags. We don't actually have that many votes that a single comment should need that. But this is a story. Neither of you are Biggants, so this must be MariaDB doing some internal type coercion so that it can be in progress. Rather than do math that way, we don't actually care about what this formula is. We just care if they're different so we can express greater and less than like this. foxboron Heading off, good luck with the stream!
and that's probably better than computing an intermediate value that we don't care about. So let's rerun the migration. Take care Fox, I'll see you around the site. You can see how often I tweak these views, okay.

03:29:59Okay. now let's see if the suite wants to run and this is it hydrating that view again oh this is gonna hurt in prod because again to hydrate the view a little is gonna touch all the biggest tables in the database and join them against each other that's comments and user and read ribbons and votes. I sometimes wonder, I did this on stories where I moved the story text out to its own database table just to make the stories table narrower in the database. So, you know, like a record in the database is only going to be, I don't know, 400 bytes instead of being many kilobytes potentially, or variable size. I get tempted to do that to comment too sometimes. Oh, good. It blows up in some weird way. I like weird bugs. Oh, okay. It's not more SQL. So this is fine. We did change this behavior. Yeah, so now this is going to be... This second one is definitely related to how we're considering score. Number one, I have to see the context. Not listed when the commenter has not flagged the child in the story. So let's look at the second one first.

03:31:56Grab this again. So that's 93. And let's go fix that one.

03:32:09On a story with a negative score. Yep. And the way I enforced that was I added two flags. And so here... hejihyuuga Bye @foxboron
It expected the score to be 0, and the score is not. But what we want to say is we expect the score to be less than the story.flags because that is what the conditional now says. It helps if I include the name of the test command instead of just bundle exec a single file.

...56Why are we taking 30 seconds? Okay. Undefined message, less than. This is me at the limit of RSpec matchers. Does anybody know if it's LT or less underscore than? I use these so rarely that I don't remember the actual name of the matcher. And this is also why I occasionally get a little annoyed at RSpec, because it's its own language. Is not listed when. Yeah. All right. So let's go to the docs. Do I have it here in Zeal? RSpec. No, I don't have it here in Zeal. Let's go to the Googles.

03:34:05Whoa. Really? That's less than or equal to? And let's make sure this isn't 15 years old. Hey, it's only 8 years old. It's probably still correct. hejihyuuga stack overflow is saying "expect().to be < value"
adriantdoav key word probably
So we will say to be less than story flags, which doesn't need parens.

...43hejihyuuga I don't know any ruby so can't evaluate how true that is
adriantdoav holy smokes, did not see that coming
Adrian I appreciate the contribution but no it looks like it is the less than or equal like that so our spec is trying to be a very very expressive way of writing tests like you notice I don't say like assert score is greater less than flags like that because that just becomes true or false in which case the error message is like expected true got false and so rspec really wants you to pass in both values and so it has a very complicated very complicated whole API for that. Yeah. And occasionally you get stuff where it's like, I don't know if that's beautiful or awful. And for folks who don't write Ruby, it is doing parentheses are optional and they are really not ambiguous if there's only one thing. So it is doing this. If you think about it, expect is returning an object that has a to method, and these things are chaining down until the evaluation happens. There's a lot of magic. When it's expressive, I like it. When it's this much magic, I look at it and I'm like, how is that even valid syntax? What was the other bug? 34 and 107. OK. So let's grab that. No, it's not Control-C. And then let's go look at 34, because I don't remember what was wrong with it.

03:36:57Wow, that's the simplest possible replying comment. Boy, that shouldn't be failing. That sounds like a bug.

03:37:08adriantdoav we all love a bit of syntactical sugar
That's an interesting one.

...16adriantdoav don't even know if that is a word
We expected that comment 1 would be an empty array. Yeah, that really shouldn't be failing. So we're applying comments. What must be filtering it out? Well, what's the difference between the old version of dbViews replying comments 9 and dbViews replying comments 10. So the default one should not... I bet it's making a story with a zero score and zero is not less than zero. I bet this is test data is missing an initial vote. And so if I said, story score is r.story.score. And flags is r.story.flags. If that is 0, 0, that's the bug. And I'll change less than to less than or equal, probably.

03:38:54Why are you so slow? Why didn't you even print my debugging? You are mad at my... It's not called R? How is it not called R? I used it on the... Oh. Helps to initialize variables after you use them. Yeah. Something is going on now since I regenerated the view that I wonder if I have to run like an analyze table on my dev database or something. The whole thing is just kind of chugging here.

03:39:43Score is 1 and flags is 0. Did I write the greater than or less than backwards? Yes, I did, because I'm trying to say has more flags. I wrote this exactly backwards.

03:40:11Is that a good tiebreaker? Should it be less than or equal? So when a story appears, it has one vote from the original submitter, and the flags is zero, so that's fine. If it catches one flag immediately, it's probably better that the comments disappear, and Cpoints will shove it up, because we just saw that whole hotness thing. Yeah, that's okay. So greater than is probably fine. And Adrian, yeah, syntactical is totally a word. Let's see if 34 wants to pass and then I'll run the whole thing because, oh, I got to run that. Didn't run db migrate. Let's redo the migration to recreate the view. So this first test command is going to take a hot second to run and initialize the view. And I have a ton of test data. So the reason I have a ton of test data and managed to flash real stuff on screen once or twice is I populate my dev instance, my dev database with data from prod so that, and that specifically via, backup system so I don't take it directly from prod I use the backup system and I restore out of that because that way I know the backup and restore system which is two independent systems sometimes I know that that whole pipeline is working and then we do have the fake data task I don't usually use it but I'm going to have to for streaming. And I started setting up a second database for it and then I forgot about it because I didn't put it in my checklist for pre-streaming to switch over to it. Hey, look at that. Isn't a green test suite the most beautiful thing? hejihyuuga We love green suites
I think so. Happy little green dots. Let's run the whole thing.

03:42:42oops let's let's take some debugging out of the test ah good the whole suite is green again all right so where did i leave that puts great and then let's look at my stream notes so i did all that the last thing is that i don't does one Oh boy, I ran way over the time I expected, but I'm still having fun. So I'm going to keep going and try and hit the end of this PR. It's a lesson in sizing work, I guess. So the way that voting and flagging work is they go in through... this voteThusley method on a story or a comment, and then it trickles down, we figure out the deltas, and then we call updateCounters on the user to update the score, and then on the target, which is the story or the comment, we update the score and we calculate. And so that, only in story, not in comment anymore, only in story, we are going to want to integrate a count of the number of hidings from people who have not flagged the story, or who have not interacted in the story. So that becomes... this sum, which actually is not a coalesce anymore. This is really just a count from votes. Yeah. Oh, MariaDB makes those the same. So let's just express it that way. And the vote is 1. And then so we are going to subtract. And this is going to be a little more complicated. We want to... Where story ID is stories.id. That needs a new line.

03:45:17And please don't ask why I occasionally do the all caps keywords and then occasionally just don't bother. I don't have any justification for it. It's just a quirk. I got it consistent in the view, but I don't know why I didn't here. We want to say, and it's hidden by... How did I do that in the view? Yeah, and not exists.

03:46:12infinisil Inconsistently inconsistent capitalization!
Yep, you got me in a finicillitis. Inconsistently inconsistent, where user ID from hidden stories H, where let's call that hider. That is a hiding. What is the noun form of the act of hiding something? I don't know, hiding user ID equals comments user ID. Can I just union these like this? I'll write a test. One from votes where we need to filter correctly, where And comments.storyId is storiesId. The explain out of this is going to be bonkers. And votes.storyId equals stories.id. That's not going to do what I... I don't remember in votes. There's an implementation detail here where the votes table includes the story ID, but I don't remember if it includes the story ID when it's a vote on a comment because it might just be set to null. and it is a nullable so maybe I did that I don't remember that so let's say select count from votes where comment id is not null and stories story id is null okay so it looks like if you have if it's voting on a comment it also includes the story id I wouldn't mind seeing that code, would I? Let's build confidence. If I vote and I am voting on a comment, it's going to call this vote thusly. So let's look at a comment. It's going to be on comments controller. Yeah, okay, it includes story ID. All right, so that's what I thought I saw in the database. That's what the code looks like it's doing. All right, good. So I don't have to have another join. And so really, I can just say if you are voting, if you have any votes from that user, and this accounts for whether they have voted on story. Let's comment that.

03:49:30OK. And then do this so I can say, subtract number of hidings where hider didn't vote or comment. and then having set it that way yeah let's just not try and be clever and union that we'll say and not exists this and then we will put it in the order i described it in because i like to match these things makes it just a little bit easier to read so we are saying

03:50:31we're saying that the score subtracts off the number of hidings where it is this story being hidden and the hider hasn't done either of these things. And the one quirk of this is it only gets calculated when Yeah, so then hiding a story. If we hide a story for a user, we need to trigger this to update the cache. So this needs to say, why are you... So a thing that happens a bunch in this code base is it passes around IDs instead of just model objects. And I think this is just a quirk of the original author didn't know that Rails is pretty clever about using the right thing in the right place. And we are into some old functionality that hasn't been touched in ages. So we will say controller hidden, no, controller stories. Oh, it's kind of overloaded.

03:51:56Yeah, is this the only place we call hidden story? let's look so it gets called here comment uses it story model uses it but these are not creating things and the stories controller that we're looking at and that's it for app code so okay i can change this interface without blowing anything up so we will just pass Let's just double check that with a... Oh, story repository spec uses it? I didn't catch that at first. Alright, let's... That's an easy one to update. So we will change you... How did I end up in the same file?

03:53:02So here we will change this to just pass the object.

...11Good. And then here we will pass the object, story and user, user and story. Why are these not in the same order? Who does that? Don't blame that. Don't do a git blame, it's probably me. Story is story and user is user. And then we'll do the same thing here.

...39Throw that out. Swap. And then here, I don't want to touch that interface just yet, because this has already become kind of a sprawling commit. So I'm just going to pass those over like that. And then here. Here's the last place, story and user. OK. And so now this can say story dot, what's the name of this? Update score and recalculate. Bang. And we're not changing anything. We're just telling it to go count again.

03:54:35That's, aside from me using the wrong syntax for a comment, that's not super useful. Because I feel like this clause in the middle is big enough you kind of can't miss it. Yeah. Okay. That looks pretty good. Let's run the suite. I'm going to have to add a test for hiding a story knocks the score down. Because that is definitely new behavior. But I would like to see everything green first. And I think it will be. Here's that running the spec prediction. Nope. Oh, that could be a fun game. You get channel points if you correctly predict whether the build will fail or pass. Unknown column, columns, USRD and where close. Okay, so this guy...

03:55:35Hiding user is... Oh, it's not the comments user ID. It's... Where... What am I joining against? I'm trying to say...

03:56:12votes.userId. Woof. That was a minute. All right. And then this one... Let's...

...51That looks correct.

03:57:16infinisil (asking again since you didn't see it earlier) If you have some spare time, I'd love to hear some thoughts on the invite tree. How useful is it for moderation? Anything you'd want to change?
Oh, and Finn is still asking about the invite tree and thoughts on it. So the primary purpose of the stream was to do like office hours and demystify stuff on the site. The invite tree is incredibly powerful and useful. And it has the one big drawback that needing an invite is most painful for people for whom the site is most valuable. Like if you're at the start of your career, Or your interest in programming you are least likely to know anyone and you will get the most out of being on the site So I don't love that but oh my god, it cuts down on so much spam if you Go to like any subreddit and you go to the new page You can just watch it roll in and you are even missing a ton of stuff that got through the auto moderator We would be kind of buried by spam as for anything I would want to change I I kind of have changed a lot of the things I want. I daydream about reopening the invite queue. arh68 LUL talkin about the devil
Oh, look, a second spammer. Wait, do I remember where the button is for getting rid of spam on here? Someone is making my point here. Goodbye, spammer. So if you have open signup, you just get spammers like that. That was convenient, actually. Briefly, the site had an invite queue. I'm thinking ahead to merging this code. I'm talking over myself where people could say, hey, I would like to request an invite for the site and then users could see the pending request and say, oh, let me click the link this person added and decide if I want to invite them. The problem there was It's kind of a funny problem, but the users were a little too kind-hearted and people would just go down the list and be like, it would be great if more people joined, invite, invite, invite. And they would just click the links instantly without reflecting on, hey, could this person be a spammer? And so JCS had to turn that back off because there was a significant bit of spam that came out of that. However, there were also some good users that came out of that. So turning it off kind of sucks in that way. Like I want all the good things and none of the bad things. So I was thinking a lot about it and it actually thematically ties into this code I've been working on today of wouldn't it be nice if there was a cost to penalizing the score of a story. And in this case, the cost is you have to click hide having not interacted with the story. If you interacted with the story, like you were maybe just trying to punish the score of it, let's not do that. there's a workflow here of if you hide the story and then you vote on stuff it still counts then every vote would have to oh no actually when you vote This gets run. Yeah, that's fine. There isn't a different control flow. Cool. So it kind of imposes a cost if you want to bump the score down. Then you don't see the comments on that story anymore. And that's sort of nice because there is a real phenomena where you kind of hate read something, you know, where you're like, oh, I really don't like this story about Rust or I don't like this story about... graphic design, but oh, they're really getting into it in the comments. So now you kind of can't have that guilty pleasure if you want to affect the score. And so that's what I mean by having a cost. And so the way I would have been daydreaming, this is all very speculative and not at all planned. Because I come up with an idea and then I let it marinate for a year and then I implement it. is what if I brought back the invite queue and it became clearer to the inviter that you will be responsible for this person you invite so rather than seeing a table of people waiting for invites you have the option to pull exactly one person out of the queue and then you are the only person who will look at that requested invite and then you can choose to approve or deny it. So that gives me a chance to put a little more copy around it. But then also for new users, when they start interacting with the site by submitting stories and submitting comments, those go to a queue where their inviter has to look at them to say yes or no. And this is a pretty mild thing, I think. Maybe it'll even be, it'll walk the invite chain up and say, does anybody in this chain think this is a good idea? And it could probably default to yes after some amount of time. But in that way, it would really drive home to the inviter like, oh, I'm going to be held responsible. I need to be thoughtful about this person I'm inviting. So that is a very speculative thing I'm considering for changing the invite tree to make it easier to join the site. The other way to join the site very easily is to catch a bug on stream and I'll send you an invite or do a pull request against the repo. Okay, so we did this. I wanted to have a spec on it. infinisil Thanks for sharing, that's a neat idea!
Let's put this on story.

04:03:48Thanks, Infinisil. Please feel free to kibitz it or kick it around. That's why I'm thinking out loud about this stuff. There isn't a lot of... magic. So it is reasonable to put this after here. So let's say describe, update, score and recalculate.

04:04:15Let's just grab a story. And I don't actually care about these things. So it can just be the short syntax. And then we will say, it has one score from submitters automatic upvote. This is just like a smoke test kind of thing. So we will expect the story score to equal one. fix the indentation standard rb and then yeah that's fine did i spell it wrong submit that is a perfectly good word spell checker so what i actually want to test is it counts hiding as an each user hiding it as how do I want to phrase this see this is the other thing about the way our spec wants these things to be sentences catches me up on grammar so it deducts from score when users hide. There we go. And then also it doesn't deduct from score if hiding user commented and voted on the story or voted on any comment. There we go. So we'll kind of fill that out and then Oh, I haven't finished this one. So now we will say, let's make a, well, let's just call the model. Yes. So let's say hidden story, because as much as possible, I like to go through the same interface as the controller and such. hiddenStory.hideStory for user. And then we will just create a new user because I don't care who they are. I only care that they haven't interacted. And that will trigger the thing. And now we expect the score to equal 0. Yeah.

04:07:17So in the specs I outlined, I didn't write any specs for the unhiding version because it is simple and bulletproof enough that I'm not really worried about adding coverage for that. If there was like money involved, I would, but all right. So this calls wrong number of arguments one, given expected two. from hidden story, hide story, and it's mad specifically about line nine, which must be this, right? All right, anybody want to spot the bug before I do? Line nine.

04:08:07Oh, that helps if I pass in the story, huh? That ought to be it. Nobody gets VIP for that. I saw it first.

...25Boy, I'm going to have to write a rule around, like, I have to actually see it in the chat. And it's going to be very subjective. Expected 1 to equal 0. So that's a bug. I will brb. Got to get the door. I'm stepping away from stream for 30 seconds.

04:09:22All right, my spouse came home from work having forgotten their keys and I had to get the door and then the cat wanted attention. So, did anybody spot the bug while I was up? I should have left the code up so you all could see it. But this one we expected that there would be a hidden story and there wasn't. So, let's go ahead and say, move this down and look at this query because it's going to be a problem in the query, right? arh68 what exactly is the "submitter's upvote" ? like is that real or implied
oh let's filter that down because that's going to run for a bunch of specs let's filter down to the one we're looking at that'll also drop the the pending specs out which i appreciate that it shows this but i don't need to see it every time so What is the submitters upvote? So it's implied when someone submits a story, they automatically upvote it. And that automatically happens as the story is created in the background and a million tests depend on it. So I'm not worried that that's a bug, especially because the bug is it expected one to be zero. So it was one, the smoke test assertion passed. This one failed. So update stories. itscryne Re invites etc: I've sometimes thought about "aquiring" (don't know a better word for what I mean) a lobsters Invite for some time but never really got to it, mostly because I'm quite a lurker. And I don't think I could add "enough" content? value? to the site to justify me getting an invite from someone I don't _really_ know. And currently I'm satisfied with "read-only"-lobsters ;)
See, this looks right. Score equals and then subtract.

04:11:05Yeah, all the injected values look right. Let's see what happens if I run this in the Rails database.

...23What was that? annaprank69 Hi brother, nice minimal classic setup
specialku hello, my lobsters :)
test story I was using earlier. annaprank69 Wait a minute, are you a lobsters dev?
That test story I was using earlier had the word Magnum in its title, didn't it? There it is. Let's grab that ID.

...53Am I a lobsters dev? Yes. I administrate the site, and I guess I am the primary maintainer of the codebase. And I'm the big typo-er in chief. hejihyuuga He is the lobsters dev
Anna, if you look at the... Welcome, Anna. specialku there can only be one
And if you look at the about box that is under the stream, there are a bunch of links to what's going on and who am I. God, I hope I'm not the lobsters dev. I am really hoping to encourage more people to PR stuff. Special coup, that is unfortunately often true. All right. So then let's run this query.

04:12:40And we're going to say where the ID is. annaprank69 Can I get an invite?
So that should run. Why are you not running clean? Oh, because I got chopped off. itscryne @specialku I thought "always two there are"?
And then, Anna, the best way to get an invite to the site is to drop by the Lobster's chatroom, which is not the Twitch chatroom, and share a personal link or two. Or, if you can fix a bug here live on stream, I will help.

04:13:21annaprank69 It seems reasonable
hejihyuuga If you know someone on lobsters you can get one from them too
annaprank69 @HejiHyuuga I'm a lone wolf Kappa
am i doing wrong did i copy and paste oh this is like some painful terminal issue where a line got cut off because that is just invalid i can see it i can see it right there that like all right all right let's let's stop struggle busting that way and all right so let's

04:14:01specialku the font though o_O
I can't actually just call the inner... So I'm trying to find a good seam for debugging here. The font is in the fac that is also linked from the about. If it is too small, tell me. So I'm trying to find a seam to count. So for some reason it is not counting the hiding that was just inserted. And this method calls save before it calls update or calculate. So here, if I said there should be one in the database, right?

04:15:00I use the italics for constants like strings and symbols. So they kind of stand out. And like the most common syntax error I have is an unclosed string. So when half of the screen goes italic, I know very quickly what the bug is. annaprank69 Is it vim or nvim?
So yes, there's one hidden story in the database. specialku I am sorry, I am not of much help here
And then

...27It is regular Vim, not NeoVim. I bounced off NeoVim a couple of weeks ago.

...51specialku do you do the hjkl thing on vim?
Let's just dump it out. Something is not what I'm expecting. So we create a hidden story for the story and user. It does get saved because we saw a 1. Over here, we say that there is a hidden story where its ID is the outer stories ID.

04:16:18And there isn't that other stuff. And there shouldn't be that other stuff because this is a test database with test data. Yes, I do use HJKL. I don't know the last time I touched arrow keys in Vim. I started using Vim for realsies in 1998. So at this point, it's all muscle memory. specialku I have never used vim "for realsies" :)
hejihyuuga I started using a modal editor at the start of last year, and have since found myself trying to use hjkl everywhere else
guess I should add like the number of tree rings on my vimrc to the fact because it's come up a couple of times already here on the second string okay so it created a hidden story it's got the id all right let's let's simplify the sql query let's just say with none of this stuff. Let's just select the count. And I don't know why standard re-indented that, but I don't think about indentation. annaprank69 Anyway, I wanted to compliment you on the website, which I've been visiting for years, and the idea of invites, which, even though sometimes inconvenient, really fosters a sense of community and responsibility towards one another.
I really don't want to worry my pretty little head around indentation and other style rules. specialku story_spec does that mean tests?
Life's too short. Oh, thanks, Anna. I will post the VOD in a couple of days, but like a half an hour before you joined, Infinisil and I had a big conversation about the values and drawbacks of the invite tree. specialku oh nice, 1 example, 1 failure so you have unit test (:
But it really is as fast as drop by the chat room and say like, hi, this is me. Here's my GitHub profiler blog. And if you do that in the US workday, there's usually someone around who's like, hey, you look like you're not a gigantic jerk. Let me send you an invite. The other way is if you write a blog or something and someone submits one of your posts to your projects.

04:18:27Why are you being bad? The score is, select all the votes, minus, count all the hidden stories. Where ID is 1, story ID is 1, story ID is 1.

...48Is it Could it be that it's because I did a join and we're seeing relational multiplication? What if I just put the story ID in line there too? That's weird and awful enough that I would believe it. That kind of thing has bitten me before.

04:19:24Why does it say paper jam when there is no paper jam?

...38Oh, oh, I see the bug. Oh, I see the bug. I am disappointed. Everybody should have seen this before me. This was an easy one. Right, so we can put this back. hejihyuuga This is my first time watching software development on twitch, and I'm enjoying it more than I thought I would
specialku I don't even know what a paper jam means
I called story update score, wrong line of code. Where's the spec? I inserted the thing. Oh, Paper Jam, that was a reference to the movie Office Space, which, speaking of things that are from 1998, is also an older movie. It is a documentary about programming inside of companies. hejihyuuga I'm from 1998 :D
specialku oh wow please don't say office space is an older movie :(
So this was the bug as I didn't reload the story from the database. So this, when you bypass the active record model interface and you directly write queries to mung data like this, the models don't know that you did that. And so they don't update. And so this code was not broken at all. It's just literally, I didn't remember to reload the record in the test. And as soon as this should go green, yes, please, pretty please. Hey. All right, where was that puts? Let's get rid of that. Yoink. The sequel is fine the whole time. Put that back the way it was. Why has it changed since reading? No, it didn't. Is somebody else editing the code under me? I know we joked about having enough, you redeem enough channel points and you get to contribute code by logging into my machine, but I don't think I turned that on. All right, so that was just a mechanical refactoring, but now my confidence is shot, so I want to see the test go green before I advance. For me, tests are a lot about building confidence, so I run them very frequently when I don't understand what's happening, and then it kind of fades back out. specialku how many points is enough to get ssh access to your machine? is 102 enough?
Where did I leave that puts? Hidden story? There it is. Go away. So now... Now I feel like I can go ahead and fill in this. So we're going to say that... annaprank69 recording @w Kappa
We are going to say that user is create user. hejihyuuga I'd assume about 22 @specialku /joke
And then also we're going to say comment equals create a comment on this story by the hiding user. Let's call them something. We'll call them the hider.

04:22:43Good. Why are you out? I don't actually need to save the comment. I just need it to be in the database. And so now the store should still be one. Let's see if I write all those sub queries correct. How many points is enough to get SSH access to my machine is 102 enough. Special coup, I regret to say you cannot have any points yet because I am not an affiliate. I have to stream on five more different days this month. So I guess next week-ish. Why are you recording a macro, man?

04:23:33specialku oh I thought you meant lobsters points :D
Let's do two at once. That's not going to jinx it, right? So we will say that The user voted on this story, so... Vote thusly. This method keeps coming up. So we will have them upvote this. This needs to say... They are allowed to still flag things. Yes.

04:24:15specialku anyone can flag, right? even people who recently joined?
where and vote equals one so if you weren't in the beginning of the stream a big strategy here is that flags are partly votes they are sort of down votes and we're changing what that is so this is going to say vote thusly on oh god this function signature okay vote on story id nil hider.id reason is nil there we go so let's upvote the story and then we don't need a comment in this annaprank69 Wait are you using vim as terminal multiplexer with :term command?
specialku does lobsters even have downvotes?
And then hide that, and we expect the score to scale one. Yeah, that seems reasonable.

04:25:31Yes, I am using Vim as my terminal multiplexer. My opinion on Vim and other stuff is just live in your editor. The more you live in your editor, the more you can customize it. And I think, no, Special Coup, the site has not had downvote for years and years, maybe eight or so. annaprank69 I started to use it like this a month ago
specialku oh ok
People just use them to punish people they disagreed with, which did not improve discussions. This is... So if they upvote the... Oh, it's wrong because if they upvote the story, the story score goes up. Yeah. Yeah, that's that one. So now let's create a comment for them to vote on.

04:26:37And this comment has to be on the story. And then we will pass... comment ID, so then they upvote it. And so then the score should stay one. That ought to be everything. Yeah, special downvotes and flags are complicated and they are technically related and they constantly get tinkered with because the site has a million little nudges to try and specialku but why not hide the upvote if we are going to ignore their upvote?
nudge people to act in the right ways and not incentivize bad behavior like flagging or downvoting people you disagree with. And so this whole tweak is if flags don't affect scores on things, hopefully people will use them to punish people they disagree with or dislike less. And I want to minimize that because it happening more often and it leads to clutter on the mod dashboard but hiding which has a cost now works cool so and i think that's it i think i just finished hejihyuuga Yippee
Why not hide the upvote if we're going to ignore their upvote? We don't ignore their upvote. So flags are implemented as a negative vote. That's why they have that effect. They're still in the table. And we possible SQL injection. Oh, because I tweaked this and it's still got the ID. So we got to say... man, I would have been ashamed if I broke the build. I was just like, I didn't touch anything security sensitive. So break man is inspecting and saying, only uses story ID, which is an integer and came out of the DB. So there's no potential SQL injection here. Yes. So BreakMan looks for common patterns where it's really easy to add security vulnerabilities. And on this one, it caught that I was doing string interpolation in something that goes to hejihyuuga that's cool
database directly and so it knew that the code had that previously that's what that bit about remove the old fingerprint was and changing the string changed the fingerprint of that code and so it made me look at it again and then also remove the old one as defunct so that's that was protecting me very nicely And the thing I did was safe, which is why I was able to write that message pretty quick. So, was there anything else? No, we did this. And then we did all this. We did all the steps. Let's review the diff.

04:29:53So let's look at git here. So there's the migration. That was dead simple, so we're just going to add that. hejihyuuga I think I might have to incorporate the way you note take into my workflow
why is there an untracked oh yeah that's the new version of the view and we diffed that against the previous version of the view so i'm happy with that code app controllers this is me changing that interface so that's fine this is Comments. So this is where we changed that flags don't get counted. And this is where I updated the display to not have a negative number. And this is a very high touch surface, so users should see it immediately. Being able to mostly assume power users is pretty great. The flip side of that is we look enough like Hacker News or Reddit that people just sort of assume we work the same way on a lot of features. which is not the case. For example, I cannot push stories up and down the homepage whether I think they're cool. I mean, I can vote like any other user, but that's it. specialku oh yeah, hn has that feature
This is that cache update. Good. This is the n plus one query. that prosopite warned us about. This is the new, let's do CSS in the model. What even is clarity? That's fine. specialku can you merge and split threads?
That's fine. This is all looking good. I'm mostly looking for, did I leave a puts in? Can I merge and split threads? No, that's never been a feature actually. There was for a while a thread, a feature called dragoning. And specialku you know how on hn they can merge different posts?
you go back you'll have to dig in the git log for it but it was possible for a moderator to say like here be dragons on a sub thread and then it would only get displayed at the bottom of the page and it only got used a couple of times and then some guy who named himself after assembly language argued really persuasively that it wasn't a benefit and JCS the site creator removed it yeah so when you say threads i didn't know if you were meaning like all of the comments under a story or one subtree of responses so when you say thread do you mean all four of these or like just these two that are like a thread we can merge stories which brings all of their comments together but we it is not a feature to split threads out of specialku yes, bringing all the comments from one post to another
So there's a thing on Reddit where everybody replies to the highest upvoted comment so that their comment has a better chance of being seen. And in that case, being able to reparent comments would be nice. But there are better ways to whack people with a stick to disincentivize that behavior. And Lobster's is small enough that I can just whack people with a stick rather than... And honestly, we get few enough comments that people aren't tested. Ooh, let's not commit this thing. This one, this one I don't want. That was a thing I did for perf in development mode. So good thing I'm reviewing. This is me adding that big score delta thing. Good. What else we got? Yeah, bringing all the comments from one post to another. I didn't understand that from your question because we call that story merging and think about it in the context of stories. Yeah, that's a nice simplification. So is that. That's the same thing. That is the security thing I just did. That's the view. Replying comments spec. This was, yep, I remember that change. This was that interface change. That interface change really could have been its own little commit. Update score and recalculate. This is what we were just in. So I feel fine with that. Vote spec. Oh, this was all those fiddly versions to match the vote table that I also just merged. So yes, yes, everything is staged. Cool. Let's create a commit and we will call this... Where is... Where is that comment where I explained what the heck we were doing here? Should we? There we go. specialku and now to see if you use present tense in the first line or not :D
So I explained what we're doing in a comment. I had this up at the beginning of the stream, but I lost it. So we will just grab the comment ID. And we will put this in the URL. Story scoring. Flags no longer. See, the purity of this line at 78 columns. All right. Have story scores affected by hiding, not by flagging. annaprank69 :set cc=120, solved Kappa
And then we can just say longer explanation.

04:35:46specialku ok so you do use present tense. nice
And then just link directly to that. Yeah, I could set that column out to 120, but a lot of tools assume that the first line of your commit message is like 72 or whatever. Yeah, I use present tense and imperative and I'm pretty good about it on commit messages. And, specialku my commits are often "wip" :D
I don't think I have to add anything because I'm linking to the comment. Cool. annaprank69 I was just joking. 78 cols is the de facto standard
And then let's push this up. And if you are in the Lobster's IRC channel, Mock Turtle is on a poll. It polls the RSS feed of commits every 10 minutes, so it can take up to 10 minutes for me adding the commit before you see it in the IRC room. deploy. Do I want to deploy? Wouldn't that be a fun way to end like a first stream? I think that's good. Let's do that. kaychub Do it do it do it!
Probably won't leak anything. specialku is there a "fake" lobsters where we can play around and not get whacked with a stick?
Yeah, this seems safe. So I don't have Ansible in here, do I? Whoa.

04:37:00specialku like a development build?
I do have an Ansible call in here. Okay.

...07and you want the root password for prod let's make sure the twitch window isn't focused and drop that in cool so we are now deploying lobsters to prod like literally right now this is going and hopefully i don't just blow up prod specialku you have backups, right?
Ansible is not, is there a fake lobsters? No, there's absolutely not a staging server. You can run it in development pretty easy for a Rails app. Do I have backups? Yeah, yeah. specialku nice
You can see that in our lobsters Ansible repo, restic runs, I think it's four times a day now to backup the database.

...59arh68 cool PopGhost
see ansible is so slow it's i think it even with all the settings it like builds up and tears down a connection between these and even if you reuse it does some kind of compilation step hey look there's the database migration that ran and then it so this restart puma is going in the background it's doing a phased restart specialku I don't mind automated tasks being slow. I just want them to be reliable.
where one by one it's going to restart those workers. Is it allowed to? Is that a bug? So usually when there's a migration... No, when there's a migration I don't have to hard stop Puma. That should be fine. Right, site's not gonna start throwing 502s.

04:39:06specialku like if it does extra steps I don't mind at all
specialku as long as it doesn't make me think
Let's look at, all right, so here's the prod puma. So there are 20 puma workers and the systemctl logs, you can just see it booting one worker at a time so it doesn't overload the server. And so they are rolling out. So half of the workers have now restarted. So if you hit reload, you have a 50-50 chance of seeing the old code or the new code. The web server just runs on one VPS, so we don't do any kind of blue-green deploy or partial rollout behind a feature flag. You just YOLO. All right, good. If the log isn't full of errors, we're fine. So.

04:40:04So aside from talking moderation and invites a bit, which is a great use of office hours, thanks Infinisil, that was the code. kaychub Do users ever hide stories just cause they're not relevant to the user? Or is that pretty rare?
We changed it so that flags don't reduce story or comment score anymore, but hiding a story does reduce its score if the user has not otherwise interacted with the story or its comments. So it kind of has a cost to it. And then...

...34specialku I don't quite understand this concept of cost
Oh yeah, users hide stories just because they're not interested and relevant. And I see that as a benefit of this change of if something is really boring, it is okay that its score goes down. I think that's generally a benefit. And then I have a bunch of stuff to do after the stream is over, like fix some Vim stuff that I broke when I was trying out NeoVim. And then this thing is a WAN affiliate. I have a list of like stuff, like I should hire an artist to make custom emojis. specialku do you have a certain amount of hiding you can do?
It's okay to like show the Twitch dashboard on stream, right? They're not like, you cannot, specialku Don't show the keys :D
annaprank69 You must not show earnings from twitch as far as I know
kaychub Oh! Ok, so score _is_ supposed to represent popularity (to some approximation). I guess I'm not sure what else it would be haha
specialku you guys have earnings?
have transparency about this stuff I'm gonna assume it's okay what could go wrong surely I won't get in trouble for it don't show the keys yeah generally doesn't and you know the fact that the dashboard has lots of like clicks to expose the keys Oh, and I can't show earnings. Well, I don't have any of those. That's what we're talking about. I don't know that I want any of those. So here on the dashboard, it has this affiliate achievement thing. And I've kind of blown past 50 followers. This must be out of date because I hit 100 followers, 90 something followers on stream. What did it say? 126 on stream. specialku oh, yeah I think you can show partner progress
And I made the goal 128. So it's going to hit that next time it goes. If two more people want to click follow while I'm here, you'll see the cute little goal animation right away. But stream for eight hours. So I just did half of that. Stream on seven different days is the hard one. So this was two. This is out of date. So affiliate. specialku follower goal met
Oh, thank you for clicking follow. Like and subscribe. Ha ha. Cool. I was going to say that. Damn it. I'm the worst YouTuber. So that is the follower goal. I set it to a nice round number. I'll have to change it to 256 and call that good. Yeah, let's end on a high note. I wrote some code. I didn't break production. I answered some questions. unknownsector Met your goal :) Thanks for the stream, enjoyed lurking
I only showed a little bit of stuff I didn't mean to show. Legit. Cool. Thanks for hanging out, everybody. specialku thank you, pushcx
I'm going to get another glass of water, and then I will come back and look at the chat. But feel free to... Hi, Unknown Sector. Thanks. pushcx later chatting https://lobste.rs/caht
Feel free to send me a note here or in the main IRC chat room, and I will look at that stuff. So let me put a link. Later chatting. Lobsters. Can I edit? pushcx later chatting https://lobste.rs/chat
God damn it. See, I'm, like, tired from performance anxiety, so I'm making dumb typos all the time now. annaprank69 No, you can't edit, Twitch Chat is IRC
Can I delete my own message without banning myself? Yeah, I'm ending this on such a high note. Nailed it, Peter. I don't know how to delete a message. annaprank69 IRCv3 *
Twitch chat is not IRC under the hood anymore. I know it originally was, and when I streamed four years ago, I did use that gateway to bring things in IRCv3. For that one... I just wrote a blog post about that. Shoot, what's the URL for it? I don't even know my own blog. pushcx https://push.cx/discord-vs-irc-…
So on the blog, I just recently, there it is. So the Lobster's chat room is like a dozen years old now. nine years old and we constantly kick around the idea of do we want to move to discord or something else and so i like collected up years of notes on comparing irc versus discord and ircv3 gets a mention at the end oh man i think ending on man irc what a thing like that's that one is hashtag on brand that's good all right streamed for way longer than i expected but this was a lot of fun so i am going to stream again thursday morning 9 a.m u.s central time i filled in the twitch schedule things if you want to see it in your time zone if you don't live in chicago there are a couple of places in the lobsters code base where like the site just runs on chicago time so that's about that arh68 take it easy y'all HahaGingercat
annaprank69 I hope to see you again on Twitch
Oh, hey, and I even remember where the stop streaming button is. Bye folks.