Numbers that should have decimals in them

Streamed

scratch


topics:
  ? write tests for https://github.com/lobsters/lobsters/pull/1303 with Nogweii
x bug https://github.com/lobsters/lobsters/issues/1301
  bug https://github.com/lobsters/lobsters/issues/1268
x twitch meta: wheedling for api key
x show off transcript

electronic mail -> e-mail -> email
o'caml -> ocaml

strip_short_terms
  remove 1 and 2 character terms
  don't remove the t in: can't
  don't remove the c in: c++

https://mariadb.com/kb/en/full-text-index-overview/
https://stackoverflow.com/questions/43319480/fulltext-index-match-string-with-period-mysql

ansible steps for the main part of the deploy: roles/lobsters/tasks/main.yml

post-stream:
  stream title: numbers that should have decimals in them
  wire up SOMETHING to show in vim when I make someone a VIP
  chat transcript needs to show when someone becomes a VIP
  email byroot about heap inspection
  fix name on RailsServerTab vimrc
    

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

Recording



01:19hejihyuuga hello mr pushcx
hejihyuuga hope you're having a lovely afternoon
Hi, folks. Oh, welcome back, Heiji Hyuga. We're just getting started, so if you could let me know if my audio is having any issues again, I would appreciate it. hejihyuuga sounding good to me
But as ridiculous as it is, I have opened the volume control panel over on another window, and hopefully that will do it. sounding good good yeah so i really think i missed who said it or at least i don't recall off the top of my head who said it but it really did sound like a a buffer under run i found a way to get that recorded so i could hear it and it really did sound awful so i appreciate folks working through it with me and then hejihyuuga nice!
It seems that having the volume control app open in the background is enough to give it priority so it doesn't underrun and have that awfully cracky sound. So thank heavens the audio is better. Let's see. hejihyuuga thank you for putting in the work to improve stream quality
So I got a couple of topics lined up. hejihyuuga much appreciated
And maybe that's a good place to go into meta stuff as folks are trickling in, because I only just tweeted two seconds ago. pushcx https://push.cx/stream
If we go up to push the extreme, which is my personal archive. Let me go ahead and throw the link in the chat for folks. I made a archive page for these streams and there's some more to-do lists. Why not show off what I'm planning to do? And then I have some archives pages. And so like here yesterday was where I had all that pain with the audio. So I pulled in those scratch pad notes, there's the recorded video, and then there's a nice big transcript. Oh, and I messed up the timestamp layout. I'll have to fix that after the stream. But it also brought in the chat history. So I had some fun hacking this out yesterday. And we can Control-F for volume. No, they said something about when the white, ah, it was James Little. So here in the chat is when James Little figured out at least a workaround, not a... hejihyuuga oh wow that's so cool
a solution or a proper diagnosis but at least a workaround and yeah there's the stream motto if something is worth doing it's worth doing badly so over on another tab i have that going so there's yeah there's about a hundred lines of terrible hacky ruby to take this transcript god it's killing me this Let's see if I can just fix that real fast. I thought I fixed this layout. What happened to my nice little outdent? I must have messed with the CSS class and broken it, because now it only has monospace instead of also having the outdent so that these hang out in the left margin. Because wouldn't that look nicer?

04:37hejihyuuga how have you liked your first week of (consistent) streaming
so if i made another window here and i just go ahead and see it's driving me up the wall i don't want to put it on the to-do list for after the stream i will just show you some of the terrible ruby well actually how have i liked my first week of consistent streaming quite a bit i've really looked forward to these and i've had a lot of fun doing them i like coding i like sharing the stuff i know i like jangomandalorian Hey! how are you? How is everyone! happy Monday
making sure that people understand that there is nothing magic that goes into running this stuff. And in fact, you can do things pretty rough and ready, and they work out fine. hejihyuuga hey @jangomandalorian how are you!
So like last week, I got a big kick out of somebody asking like, hey, what does the deployment look like? Can you tell me about that? And I was like, we're just going to do it on stream. Let's just go ahead and push the button to deploy. I like that. That's a lot of fun. jangomandalorian @HejiHyuuga ๐Ÿ‘‹๐Ÿผ
Hey Django, welcome back. I remember you were here a couple of days ago. dpk0 i think youโ€™re a good streamer too!
So was I. So let's go ahead and grab a terminal. Let's go over to the blog. I'll see, look, it's dirty. dpk0 i havenโ€™t actually really watched coding live streams before, but itโ€™s nice to have you on in the background while doing other stuff
So if I run rake deploy, and it deploys, and I go ahead and reload, Oh, there we go. So I must have just done something weird to the styling on my last deploy before the stream, but now those time codes are off in the left menu. Oh, hey, DPK. It's nice to be somebody's background music. I have always wanted to be, you know, the professional technical development version of an elevator, and I am the elevator music. No. It's funny, I've seen like two coding live streams. hejihyuuga @dpk0 that's where i am with this too. I don't typically watch software dev on twitch. But I like lobste.rs, pushcx seemed cool so i stopped in, and i've really enjoyed it
I think I got the idea from Gary Bernhardt did it a little in like 2020 when everyone was shut in their houses. And then I did it for four or five times then. And then I was just like, you know, I'd like to get back to it. This is a lot of fun. dpk0 oh yeah, grb is probably the last time i watched a coding live stream too
And why not? So I already lost track of my, oh, here's my scratch file. So I showed off the transcript. Yeah, I'm really happy with that, actually. The transcript, it's really fun having the chat there. dpk0 i remember he wrote a compiler (target language JS) live to show people how compilers work
One of my favorite bits was, I don't know if he's going to be able to make it But on the last stream, I tried to volunteer, or Nagwe volunteered to take a look at an endpoint. And then I joked about, oh, you just install OBS and click Start Streaming. And then I click Raid to send people over. And he was like, oh, god, no. And I like that you can just kind of read that back and forth. It's a little funky because I'm older. What it reminds me of a lot is There was a role-playing game called Shatter Run in the early 90s. And I want to say maybe mid to late 90s, the fourth edition of that came out. And it had these really fun setups where it would give you a little lore text of people having conversations, like their cyberpunk future, which is our cyberpunk present, although we have slightly fewer elves and orcs and magic. But a lot of the other stuff is there. They... would have someone have a document about, oh, here's this corporate thing. And then in the margins, they would have their little hacker characters kibitzing on it. And it feels very much like that. So I have fun nostalgia just looking at this stuff. Oh, yeah. And DPK remembers better than I do what it was that Bernhardt wrote. Yeah, I sure don't remember what that code was. I've liked all of his Destroy All Software stuff. And I used to force coworkers to watch it back in the day when those were fresh coming out. dpk0 Mac OS (Safari) also canโ€™t play mkv, by the way. this is very stupid because it is basically just the container support thatโ€™s missing, all the actual patented codecs that go in the mkv are supported
haven't played with execute program his other thing but I really think the world of his work so yeah so I showed off the transcript so we can just go ahead and mark that as done I have a Yeah. A little behind the scenes thing. I wrote a little file watcher to watch the scratch file and post it live to the archive page, but somehow I messed up the file names and it didn't want to run. I got an exception out of it just before stream. So maybe in the future I will do that. And then the, that kind of leads into the, the Twitch meta of I have been hassling limb to try and get an API key. They. dpk0 (i speculate the reason is that mkv is so often used in movie piracy, which would be even stupider)
have some security controls around anti-fraud and i seem to have tripped them and so they don't want to give me an api key and so i am trying to like find an employee i know or even talk customer support into it and i've i only just barely got customer support out of copying and paste me hejihyuuga does "no affiliate" mean "you don't have affiliate yet" or "you've decided against becoming an affiliate"
me answers out of the documentation which it feels like an accomplishment with at this point when you have a big company and like you get a human response instead of just something that is very clearly a canned response that's just pattern matching the three keywords in your email. So I made it to that. And I'll answer you in a second. Hey, G, the

10:13See, it's funny, I'm changing gears and trying to read chat at the same time I'm talking. So hopefully with Twitch, I can get an API key at some point soon. hejihyuuga sorry for breaking your train of thought haha
Fingers crossed that some of the ridiculous avenues I'm trying work out. And then I can do like fun integrations, like put chat up here next to the scratch file so that it's in the video recording and I have other sillier ideas. Some of those are on the archive page, which was linked higher up in chat, but it's just pushcxstream. But we had joked in the first or the second stream that it would be really fun to let people change the color of the background. I don't know why. I just think that would be really funny to just see that slowly shifting as people do things. And then I have really appreciated the chat pointing out when I have bugs in the code because I don't know, what are we running, like 30% of the time people spot it before me, which is pretty good. And so if they could insert Vim pop-ups, that would be pretty hilarious. Oh, Stack Overflow doesn't like me linking to things. It's just a view of... a Vim screenshot of opening a little terminal, opening a little pop-up over the Vim terminal. It looks especially early 90s, where before GUIs, all of the terminal kits used to have these little ASCII art windows on top of things. And I like the idea of getting back to that and letting people pop stuff up. So hopefully I can get an API key and do that other stuff. So Heiji, you asked about no affiliate. I looked at how being an affiliate works and I saw, I know someone who is a Twitch partner and I've gotten to ask her a bunch of questions about like how streaming works and doesn't. And she's given me a bunch of advice, which I've really appreciated. dpk0 itโ€™s been too long (nearly 10 years) since iโ€™ve done Ruby for me to reliably spot many bugs here, so iโ€™ll probably not get the VIP status for being a super-amazing bug spotter
And one of the things that she pointed out was if you become a Twitch affiliate or Twitch partner, you have to show full screen video ads and so they have a what do you call it they have pre-roll ads so when somebody first starts watching they have to sit through 30 to 90 seconds of ads but you can turn that off if you schedule ad breaks where every half an hour at or hour you break into you know, 30 seconds to three minutes of commercials. And either way, that all sounds pretty awful. So I'm not going to turn on the affiliate stuff. I'm not going to apply to be an affiliate or a partner. I don't think that would improve anything. There are some features that are nice, like the bits and points. hejihyuuga That makes sense, I figured you'd eventually get to the point where you decided against being an affiliate. It seemed like a lot of your goals with the stream went against what being an affialiate would make you do
But if I can get an API key, I can kind of do terrible versions of those. So that would be fun. Yeah. dr3ig 1min ads per hour is not too bad
gaberguz ads--
yeah getting to the point where i don't really have huge goals for the stream like my biggest fun yeah drag gay burgers you're you're pretty much right on on my same feelings about ads like i don't enjoy watching them so why would i enjoy inflicting them on people i talked to one of my buddies who watches a lot of streams and he was like yeah it's fine it's free money and i was like but it's not free like the whole audience pays and i don't really love that and i don't need it so why why do it and i i like the idea of just dpk0 advertising shits in your brain
hanging out, having a fun time coding. My high level goal is it's just kind of fun to interact with people. bsandro VoHiYo
jangomandalorian Maybe you can open a way to โ€œsupportโ€ the stream but not trough twitch
dpk0 that seems very much opposed to the philosophy of the Lobsters website
I like that I can demystify a lot of stuff about lobsters and generally just show how stuff works. And it's very real coding of it's just me sitting here and rambling and making typos rather than something big and fancy. Oh, hey, B Sandro. I don't remember where I know your username from, but I know it. hejihyuuga adblockers used to work on twitch, then they aggressively developed anti-adblock features. So now i pay for their subscription that removes ads :)
Anyways, yeah, I don't think anybody needs to support the stream. I'm doing all right. So I was hoping that Nagwe would be able to drop by, maybe for Thursday. They've been hacking on a pull request, actually two. So if we go over to, why do I have sponsored? Speaking of ads, Firefox has put, I thought I turned all of this stuff off. Firefox. Suggestions. Why would I want suggestions? GFY. That's awful. hejihyuuga Those ads are on by default. Making a new profile might've re-enabled that setting
I mean, I'm griping about Mozilla in my archive pages if you look at them in Firefox next to the video. I gripe about that. And I saw somebody point out that maybe MKV isn't supported because it gets used a bunch by pirates. I would guess it's just... There are 10 million things that Firefox could spend time on. This one's pretty low on the ranking, but I'm pretty annoyed at them for a design decision they made with iOS Firefox. And so I just kind of vented in the sidebar of my own pages rather than, you know, take the time to work around their thing and transcode the video to some other format. I am sure it's a matter of a couple of commands, but not a couple of you know it gets to be down at the bottom of the list because i'm annoyed i'm allowed to have those feelings not allowed to brigade though that would be rude nobody be mean to firefox i think they're just kind of they get a lot of emotion because they are incredibly intimate software like firefox is something that people spend hours a day using and it mediates incredibly personal stuff and so It really pushes a button when something changes or breaks. So I admit that that is what I'm doing as I am having a big emotional reaction. That's okay. We can channel it in healthy directions. So let's go to the pull requests. Oh, now you want to complete, huh? And we have two here from Nagwe, who was working on an endpoint that came up on the stream on last Thursday, four or five days ago? Yeah. talking about, hey, it would be nice if there was an endpoint that someone's extension or even just a script could hit and say, hey, here's this URL to a blog post. Has it appeared on lobsters? If so, can I have the URL? And I was hoping Nogway could drop by, maybe next stream. And so in the meantime, until they are able to drop in and we can work on tests, because our spec is You know, it's one of those, if I had a spare 200 hours, I might remove RSpec. I really like some of the stuff it does with feature specs where you get fairly, more than fairly, you get very robust and powerful feature tests, but RSpec has kind of an enormous API and there are lots of ways to misuse it. And there are lots of ways to See, my biggest concern with API design with stuff like RSpec is if you can do a little bad thing that solves a problem, you kind of build your own slippery slope for your project to slide down because hejihyuuga Does the "lookup stories by url" do any url normalization? Or is it just an exact match
especially as you visit things again months later or other members of your team visit it's very tempting to pick up the existing code and just slightly tweak it or integrate with it and in our spec you can let's jump over to if we looked at something like the spec story Does the lookup stories by URL do any URL normalization? Yes, I hope so. I have asked Nogway to do that, and I believe they did that in their PR. And we have a whole extras, utils, a whole module called... I mean, it's called utils, but there's just the one thing in here, I think. Oh, no, there's two more little things in here. But there's this big, big method of what does it mean to normalize a URL? And it's stuff like... hejihyuuga nice!
strip off h dot html or dot htm on the end of things and there are i thought it was script off dot html entirely i don't remember this thing has like 40 test cases actually that might be a good no it's actually as long as i'm griping about our spec it's not a good test case i love these tests because they're very comprehensive so we're going to show off those tests real quick Oh, it's shorter than I remembered. I must be thinking of a different method. What am I thinking of? Why aren't the specs here? This code moved around a little, so maybe I left the test somewhere else. Ah, yeah, here we go. It has its own test file. This is the one I'm thinking of. Let me just close the thing I was looking for. Good, good. Wrong keyboard shortcut. gaberguz love the font!
dpk0 you can just run ffmpeg with `-vcodec copy -acodec copy output.mp4` to convert those mkvs into a format that Safari will like, at least. because the actual streams are already H.264/AAC, just needs putting in the right container. Firefox should be fine with that too, maybe
hejihyuuga @gaberguz https://push.cx/stream#what-am-…
am i doing of him all right vim is a little confused about what i want to see but we have this really nice big testing table yeah the font is in consolada for the roman and then operator sans mono for the italic or cursive oh this came up on the first stream thank you for the reminder gabriel goes the i had joked you know a lot of streamers get dmca copyright notices for including copyrighted music or other people's content and like midway like an hour into the stream i was like hey wait a minute i wonder if i would get in trouble for streaming with this font because i know it has commercial licensing i had to pay i want to say 200 bucks for it in 2016 or 17 whenever i started using it And so I actually went and I emailed the font company and I was like, hey, I read your license and it talks about if you use our font in ads and stuff, you have to pay us extra. But if you're just using it on your computer, it's fine. But everything they had was about producing documents and producing still images. And so I sent them and I was like, hey, it's just me with my programming editor and I have this non-commercial streaming. Is that okay? Because I would rather just ask you guys rather than get sued into a smoking crater. And I got back a thing. And the guy was pretty friendly, but he was like, yeah, I don't really know anything about streaming, but you sound like you're fine. And that's good enough for me. So that was kind of a fun little thing. And... Hey, G, thank you for linking the FAQ about what my display is. gaberguz he was like... "wait you *read* our license???"
I've tried not to go on about that, but the... Oh, this was a fun one. Speaking of the setup, usethis.com. So this is a really fun, nerdy site about diving into how developers set things up. And so if we just pick some random person, they write these long posts about, here's all of the different tools I use and all the different config and why I think about the hardware this way. And this guy, yeah, Gaber, he was genuinely surprised I was writing it about license. I think most people just pirate their fonts and they have to sue them. And so someone writing in to be like, let me make sure that I'm not doing it wrong, was maybe a nice surprise. A lot of legal stuff is like that. If you just use the contract as a reason to talk to someone and get it nailed down, it's so much easier to deal with this stuff upfront. So anyways, I love this. Oh, end of that thought about uses this was that the guy who runs that site reached out to me and said, hey, why don't you fill in our survey and we'll put you on the site? And I was like, okay. But I want to kind of get my streaming setup a little nailed down. There's lots of rough edges. And between every stream, I spend like an hour tinkering with this setup. So I figure that'll stop after the first month. I don't know. Editing a Vim config is its own kind of pleasure. And I don't want to spend all my time doing that fun meta stuff, like eating Doritos, instead of actually doing the coding. So let's look at my break with our spec. If we look at specs story, let's put that up. Like there are really two very different styles of testing happening here. Like on the left there's, oh, well there's this input and I want this output, which is really nice because normalize is a pure function. It just takes a string and gives back a string. So that kind of thing is very easy to test. And then, Over on the FIM. FIM is fighting me. What did I do to the keyboard? All right. I guess I'm just going to be struggling with FIM today because I must have tweaked something in the config and broke it just before stream. That was great. You should definitely tinker with stuff right up until you go live so you have no margin of error, Peter. Okay. So on the right, there's the story spec for the model. And it's going to necessarily be more complicated because Rails uses the ActiveRecord design pattern. It even calls its modeling library ActiveRecord. And so that code is just incredibly coupled to the database. And so you see all of these tests have to call save. Are they technically still unit tests? Yeah, they are to me because there is an irreducible unit of work even if it means we're crossing the boundary into the database and other stuff. But RSpec has all of this extra syntax. dpk0 do you have vim running inside a terminal multiplexer inside vim there?
And I do legit like that it has this syntax where instead of saying def story requires a URL, you can do this, but it's not the way I want to write method names. Do I have Vim inside a terminal multiplexer inside Vim? No, it's... Oh, maybe I accidentally do. It's possible. So one of the things about switching over to... Yeah, it's inside of Vim. All right. One of the things about switching over to using Vim is my terminal multiplexer, which is something I only changed over, gosh, I don't know, three, four months ago. And then I used Tmux for 15 years, and I used Screen for 10 or something before that. And so I've been still relearning my keyboard shortcuts, but every once in a while, And I think what I did there, which, yeah, dpk, I think this is going to count as catching a bug. Let's test. Is sometimes I go and say, hey, vim, give me another tab with a terminal. And then I'm like, oh, I'm in a terminal. Let me just start up vim. And then I have vim in vim. And I think that's what's happening. So if I vertically split, yeah, I can't move between them. And if I exit out and I just make a regular tab and I vertically split, yep, okay. So... On our last stream, someone reminded me that there is a chat command I can type, and now dpk is a VIP because he caught a bug. Excuse me, I don't know your pronouns, because they caught a bug. dpk0 yay!
dpk0 (she)
So let's go back to RSpec. hejihyuuga woooo
Spec, model, story. hejihyuuga congrats dpk0
See, wouldn't it be great if I could have little fireworks on the stream? Oh, excuse me, DBK. Thank you. She. If I could have little fireworks or confetti on Vim, I think that would be really funny. When I typed slash VIP in the chat to make somebody a VIP, it automatically happened in Vim. So I have all these weird integrations I would like to hack out and wire up. and i just need that api key twitch if you're listening i can be trusted with an api key i'm totally normal haha so you can see like in the story test there is one that is very much like normalize url where we have something that is almost a pure function and check out how that goes but then other of these especially once you start getting into contexts and describe blocks and as far as i remember describe blocks are context they're just slightly different phrasing so that's one of the things i don't love about the rspec api is it has this is going to sound very pythonic and not very ruby but i worked professionally in python for years and i took some of their good ideas brought them back to ruby but hejihyuuga i currently work professionally in python :(
I don't love in Ruby when there are such thin syntactic sugars that there are like four ways to say something that are equivalent and so I don't remember offhand if describe fetching titles do like if I wrote of course the quote goes back here if I wrote this is it the same as this and I just don't remember if they're exactly the same and I Whenever there are these things that have synonyms, I guess what I'm objecting to is synonyms, having two names for the same thing. If they did something different and I remembered what that thing was, I would probably like that there's two, but I don't remember. And so I'm mildly distrustful. espartapalma Hi
And this isn't, you know, this is like code smell in that it's something I can only kind of articulate, but is just the voice of experience, hopefully more than it is my own personal opinion. And then the other gripe I have about RSpec is it's so easy to share data between tests. hejihyuuga welcome in @espartapalma
Like this let, if you don't know. Hi, welcome Esparta Palma. God, let me bump up the font size. Yeah, I got Nogway's name wrong for like two hours because I kept reading the II at the end as L, so I called them Nogwell. That's not a good host. I can do better than that with a bigger font size. Let's just close this other window off here. Good. You can't see, but off screen of what you can see, I have a ultra wide monitor. And so there's like, what is it? jameslittle230 Howdy! Coming off some meetings
About three times as wide as this terminal is and twice as tall as this terminal is. So there's more window off to the side and that's where I hide all the Twitch stuff. hejihyuuga HenloThere @jameslittle230
And I hopefully don't flash it on screen anymore now that I've spent way too much time scripting my thing oh james hello i was just talking about you earlier so i'm gonna jump back so james in the archive jameslittle230 woot!!
pushcx https://push.cx/stream/2024-08-…
you get featured back here because you figured out the audio issue yeah so i made these archives and transcripts yeah so james if you come back to here this is so meta because this link is going to show up in the next streams archive and look back anyways so you can Control F for James Little. I swear it's good when that audio settings window is open and bad when it's closed. And that was it. Like, James, that's it. Like, we have nice audio because over in the background, that window is open, making sure the buffer doesn't underrun. Ridiculous. But thank you very much, James. Did I make you a VIP for that? Because if not, that definitely counts as fixing a bug. hejihyuuga woo nice james!
James L-I-T-T. Come here. I'm fighting Twitch. There we go. James is now a VIP. He fixed a bug, or diagnosed a bug, so that counts as a... Do you all see when I make someone a VIP? hejihyuuga you're the only one who sees that
It tells me you have added James as a VIP of this channel, but I don't know if that shows in the chat to everyone. I hope so. I think that's worth celebrating. And if I could just get that darn Twitch API... Oh, I'm the only one who sees that. hejihyuuga we see their badge the next time the new vip chats though
gaberguz their avatar changes.
Yeah, then I definitely need to wire up something ridiculous. Of so screen. Wire up something to show and then when I make someone a VIP. Oh yeah, and then probably the chat transcript needs to show when someone becomes a VIP. So put that in my notes for later. jameslittle230 wow thanks! Did you figure out why the window keeps the buffer healthy or are we just chalking it up to the ghosts in the machine?
So yeah, this let is defining test data that then is available through all of these tests. And so it's super convenient, but then you have to be super responsible about sharing that data in a proper way. And it's so tempting when you have a whole bunch of tests that share lots of data. It's very, very tempting to say, well, rather than make my own data like this, well, I'm just going to tweak. And none of the other tests see you know so you start with something like this and then it just becomes like well none of the other cats care about the title and so i'll specify that and then six months later you or your co-worker comes back and it's like well none of the tests care about the tags so i'll do that and then you end up with these things where like 20 tests coupled to them and you can't change any of these And I don't like APIs that make it tempting to do the wrong thing. Because while I am a perfect paragon of moral rectitude, no, it's actually just me 12 hours later when I'm tired. I just kind of slop it. I just want to hack the code and make it work. hejihyuuga you could be describing one of the test suites at my job right now :(
And it shouldn't be easy to do the wrong thing. It should be easy to do the right thing. So James asks, did I figure out why the window keeps the buffer healthy, or are we just chalking it up to ghosts in the machine? There is a useful mental model for this. Let's go to the loop shop.org.

33:46No auto company, huh? So there's this classic book, Zen and the Art of Motorcycle Maintenance. I want to say it first came out in the late 60s, early 70s. And boy, it's very dated. It's one of those books that's really interesting to read as a teenager because you're like, wow, this is full of character lessons. And then If you read it in your 30s, you're like, wow, this guy is so incredibly messed up. And what a terrible, irresponsible person. And how did I not pick up on this as a teenager? So it's rewarding to revisit, is what I'm saying. But I've always liked, he talks about going on this long road trip with his kid. And the motorcycles, especially back in the late 60s, early 70s, were not as reliable as they are today. He had to do things like manually adjust the spark plug timing as they changed altitude. jameslittle230 Can confirm, read it as a teenager and thought it was so profound
That's just, that was normal maintenance then. dpk0 iโ€™ve been meaning to read it for the first time. (i am now 30)
And he talked about how sometimes a repair sprawls because a lot of repair is just diagnosing. And diagnosing a problem is kind of exhausting, especially if it takes know minutes or hours to reproduce the problem and some of these problems that he runs into on his motorcycle are like once the bike is hot this thing happens well so that means you have to ride the bike for a half an hour to get it hot and then you have to observe the problem and then stop and then wait another half an hour for the bike to cool back off and then you can try and fix it and it's like what are you doing with all of that time? And it's taxing your patience. And I liked the way he put it. He called them gumption traps. dr3ig stubbornness
And gumption is this wonderfully old-fashioned word for fortitude or character or just so many things. And so he called them gumption traps. And so I think of them like the volume that has a buffer. I'm sorry, the input source has a buffer underrun when the window is an option. arh68 the gumption trap probably the best part of that book lol
that sort of open-ended weird and I know that Linux audio is like four different subsystems standing on a trench coat together the old Linux audio subsystems never go away they just get another layer on top and so I know that there's at the very top there's pipe wire and then there's pulse audio under it and then there's also under that and then there's you know oh it could be kernel drivers and so there's like jameslittle230 Old audio subsystems never die, they just fade away (using a well-eased gain automation)
five six layers of stuff it could be and so i probably don't want to dig into that until i'm well rested and not busy and i have a couple hours to bang my head against it and get mad and frustrated and yeah our r68 i really agree that the best part of this book is the idea of gumption traps the worst part of that is the child rearing advice my god don't be a dad like that guy And I don't mean to make fun of him. He had a lot of stuff going on there. And it sounded like a family condition. So... So I think of that audio problem that I had on stream. I am so optimistic. Do you hear me talking about it in the past tense? I hope that is a solved-ish problem where I can just go ahead with the workaround of, fine, I put it on my streaming checklist, open the volume control, and put it in the background. And then hopefully at some point in the next few weeks when I'm feeling a little better rested, I will go back and like, all right, let me see if I can recreate this. I was able to reproduce it locally. A big fun of the debugging session last stream was that when I put in the monitor for OBS, I literally don't hear the buffer under run, even as other people heard it. So that made debugging super fun. yeah so for happier debugging you know if i had a spare 100 hours it is not a gumption trap it's just a big project i would start converting these tests away from our spec maybe to mini test just because it has such a smaller api and as neat as stuff like this is if you have ever looked at how that gets implemented with You know, this returns a matcher object, returns a predicate, or compares against a predicate. The end result is kind of nice, but I don't think the juice is worth the squeeze in part because it's such a hard hill to climb for beginners. Oh my gosh, there's so much special syntax and it is kind of neat that it becomes its own language, but it's also... know ruby is a whole language to learn and if our spec is also a whole language now you have to learn two languages just to touch this code that's that's hard and our rails is absolutely its own domain specific language so suddenly we're into three and then we're into you know you have to do desperate things like start streaming on twitch and become an internet personality if you want to attract contributors to your repo pushcx https://github.com/lobsters/lob…
Oh, look, look at all of these issues that are tagged good first issue in case someone wanted to get inspired by watching me stream and think, boy, wouldn't it be neat to work on this code base? See what I did there?

39:35So speaking of good first issue. I'm going to grab one of these bugs off of the pile. hejihyuuga well it worked, i've been working on allocating some time for lobsters contributions LUL
And I want it to start with 1301, I think. So let's go here. Go take a look at 1301. We don't need that open anymore. Oh, yeah. So this one, I think I touched on this. Oh, hey, Yeah, it would be wonderful if you made some time for Lobster's contributions. Please and thank you. There are lots of things to investigate. And it's funny because this is something I'm going to be getting the hang of as I stream is... Finding projects that are roughly a couple hours long, given that, you know, I go into digressions and have these conversations with folks as much as I'm coding. And so everything takes like twice as long. It's a very pleasant twice as long. That's not a complaint. But then also, I don't want to just pick all of the low hanging fruit off of the issues. I think I think it is very healthy for a project that posts public feature requests and bugs to have kind of a mix of very small to medium sized projects to attract contributors so they can kind of pick stuff that touches on an area of expertise or if they are feeling ambitious, they can take on something big and difficult. So. I'm going to take on this one because, and this is, again, this is very meta streaming session. Watch this. I brought in my browser window on the other side so I could tag this thing. It bugs me when they're not tagged. This is a bug that I introduced on the first stream. And so I especially thought it might be fun to attack it. I tweaked so that the threads would show things a little bit different. So we're going to review that code. And it turned out that a whole bunch of threads went missing. Why did he link to the web archive? Let's look at this current one. Yeah, this looks complete. tumdum3 how is it going with the jit related leak?
Oh, I understand they were comparing Yeah, so some of these replies went missing. So we're going to look at the threads. How's it going with the JIT-related leak? Byroot was helping a whole bunch with that drop by two streams ago. And so I've been feeling guilty for a week because I haven't touched it for a week. The place it is at, that is, it's on the Shopify repo number 556, if anybody is curious or wants to throw a link in the chat. I have got a heap dump of the bloated puma worker, which was its own little project to figure out a big enough heap size to get it to dump. However, I have never looked at a Ruby heap before and it is full of like all of the strings from the app. And so it's kind of like made out of toxic waste. So it has to be me, or it has to maybe be me personally, like physically pairing with someone, which is difficult to get to. byby42 byroot here: happy to help you go through them whenever you want
And so that one has been kind of intimidating and I haven't jumped into it. I just need to set aside a couple of hours to play with it some more. I made the, Oh. Hey, Byron. Well, I really appreciate that you are willing to go through those dumps with me. And can you email me? Because I don't think I have an email address for you. I'm peter at push.cx. dpk0 if i have a feature suggestion for Lobsters which has too many details to fit in a Twitch chat, is it better to make a meta post on the site or open an issue in the issue tracker?
byby42 You can email me on my GitHub email address.
And then maybe we can do something with like Zoom or something, taking a look at it, because I can't. dump the strings out, especially not live on stream. And I know you mentioned that it's possible to filter out with JQ, but again, I've never done that. So it's just a little intimidating, but I would like to pick that back up sometime soon. All right, I will email you. Let's put it on my to-do list.

44:15Keep inspection, that's a fun phrase. If you have a feature suggestion for lobsters that has too many details to fit in a Twitch chat, is it better to make a meta post or open an issue? I think it is probably better to make a meta issue because then people get to kick it around and discuss it, which is generally quite rewarding. I try to open a GitHub issue once it's pretty clear that something is wanted. And the tension there is, you know, say Alice comes by the repo and Alice says, boy, I wish lobsters has this feature. And she posts a feature request on the issue tracker. And then even before anybody can respond, maybe Bob comes by and goes, oh, great. I will pick this up and start working on it. And then Peter has to come along, and he is basically Mallory in this scenario, for anyone who knows Alice and Bob. And he has to say, oh, we don't want that feature request. It has this other problem with it, or it won't fit well with the site, or in some reason, it doesn't work. And then Bob, the contributor's time, Bob is very rare and precious. Not a lot of people contribute. But unfortunately, Bob has had his time wasted in this scenario. So that's why I really appreciate it when people post feature requests either in the IRC chat or as meta tags on the site, or just email me. I am always happy to talk about stuff. Rather than put it somewhere where I have to play bad cop very promptly or maybe waste somebody's time. I try to treat contributors as precious. I am not as what's the word? I guess punctual at reviewing PRs as I would like to be. Sometimes they get forgotten for a minute and I know that's bad and I am working on it. I am trying to make better use of the GitHub notifications tab and otherwise just make sure reviewing PRs is something I look at every day because it is the best way to convert potential people into regular contributors. So fingers crossed. So if we have comments missing from the thread page, And I know which comment they're linking to. It's going to be the one where, what did you think? Come here. Am I getting a funny redirect? All right. So I said I deployed this change. And then if we look at my thread page, deployed. It appears here on the archive.org version. And if I take this off, it's still there. So the behavior has changed since the bug report. Now I am not suspicious about the bug report. I don't think this is mistaken. I think this is a real bug because I saw it when JMiven first reported it a couple of days ago and then it has disappeared. So that just means it's going to be a really fun bug rather than them being mistaken. I am pretty sure this is not a mistaken bug report. And I think the place I want to start, because it's fairly new, is, well, let's just go look at the Git log. Oh, I can't pass that argument, huh? Hang on. Let me make sure I don't have any. spare branches showing around that I don't wanna show. Yeah, all right, that's fine. Sometimes I have branches that I wanna work on without sharing. I'll have to think more about what that's gonna look like. So what this probably is, is this commit. Don't show comments on deleted stories. Like if there ever was a smoking gun commit message for, Hey, on user threads, you can't see some comments. And you know, I changed something exactly like that nine days ago. Like, come on. So let's take a look at this change. So what I said was Oh man, speaking of suspicious stuff, I even noted that the code could be brittle. So this is a good place to be suspicious. So the change touched the comments controller where we said, if they're a moderator, there's no filter. If they're a regular user, we filter. And we said when we're looking through user threads, we expect to see stuff. Oh, the diff looks like this because I grabbed this whole function and I moved it out of the comment spec over to the user thread spec just to make a specific one. So this one's fine. I can close this tab because we're not going to be in there. If you're curious, just watch these tab titles. That tells you the file name we're in. the top of the window. So when we have the user threads page, this was the existing spec. And then this was. checking that the story was deleted, and then we don't expect to see that comment. Hmm. Well, you know, this code actually looks pretty legit to me. This is how I would write it. If we have a logged in user who is a moderator, we don't add a filter. If they do, isDeleted has to be false. I can't immediately see why that would fire for, let's bring it back up on screen, for this thread, which is on a story that was, not only is it not deleted, it was never deleted. And so I don't think there's any issue there. Let's change this.

51:02I wonder if this is something related to being accessible to user. This sounds like it may do the same thing as the story filter. So it's possible there's some kind of redundancy happening. So in a minute, I will run to SQL on this. But first, I want to see what accessible to user is doing. So let's look at that. Oh, shush, Viv.

...34So accessible to user is a very similar scope, but it's operating on the comment level where it says, if the user is a moderator and this, I am slowly accepting the nil propagation operator. So this could be very similar to the code in the other file. Then we say all, otherwise we say active. And then the big difference here is rather than say, where with an empty hash, this is using scope composition. So these are active record scopes. They're like little snippets of SQL, and you can compose them. So we are saying active, and something is active if it's not deleted and it's not moderated. And the story model mirrors this. So if I look at the story model, let's go up to its scope. It has scopes. Yeah, and it has this whole not deleted. And this one looks a little bit different because it says if you are a moderator, you get all. If it's filter out, those where it's deleted. But you are allowed to see your own. And this has been a nice feature for users. So let's go ahead and I would like to swap in this code and say, OK, over on comments controller, what line was I editing? So this is the, I guess I already closed the diff view. I could just say,

53:34instead of this, which is basically re-implementing it, where story colon. There is a way to compose these scopes. The hassle here is we are starting from comment, but this is a filter on story. And so I want to say where not deleted. Is it story.notdeleted for this user. But I'm reluctant to make even this change because I haven't reproduced the bug. And not only have I not reproduced the bug, my tests are green.

54:23It's a feature user thread spec. And when the spec is green, boy, especially for bug hunting, I want to have I want to have a failing spec.

...42So before I make this change, let's revert that.

...51There's where I was. I was able to undo a little too far because I have Vim set to remember undo across sessions. And so the last time I touched this file apparently was making that change. So that's why it suddenly was reverting to a previous version of it. So we'll hang on to this new code, but we'll leave this the same for now. Let's just inspect this at the console. I want to see what SQL this outputs. And when I see the SQL, I don't know, maybe it'll tell me something about this. Let's say the showing user, if we are showing me, and then we'll go ahead and say this is nil as if we are not logged in. And if I paste this, oh, are you doing like one per line? Did I get the wrong thing in the clipboard? Let's grab the right thing in the clipboard. Yank and then I broke it up on multiple lines. All right. That's awful. What's the quickest way to get this is just got to get rid of that comment now, huh?

56:30join all of that, yank to the end of the line, paste. All right. And then I can go ahead and put all that back. Undefined. Okay. So that's the, let's grab that and say the story filter is, and this should just become great. And then if I run this to SQL, And I run puts because at least having line breaks would be a nice improvement. That gets me to this nice big query. So pulling comments out of the database has this whole big inner join and recursion because comments are a tree and relational databases are kind of ever so slightly allergic to trees. So this is a pretty good place for a bug like this to sneak in. So I can see the and story deleted is false here. And that actually looks correct. So we would select all the comments. There's the union for the recursion. epic_ninja_elephant Oh hai. First time catching you live doing this.
And comments recursive. Hello epic ninja elephant welcome, we are solving a bug we have not yet reproduced and even more frustratingly, it is not even visible in prod yet, and so. epic_ninja_elephant Did I hear you say comments are trees?
The example given in the bug report is no longer reproducible and that's interesting it kind of points to. something about the data has changed of comments have been upvoted more or the story has been older did yes you did hear me say that comments are trees if you look at the comments on lobsters look at that it's very tree shaped especially when you zoom out or at least what what programmers think of trees where things grow and branch downwards because that's what all trees do right epic_ninja_elephant We should obey gravity.
dr3ig did you try to look at threads logged out / from incognito ?
think we would have called them roots then at least they would match the direction we draw our diagrams and our comments but no we call them trees no one said programmers go outside too often so it's not too strange i guess that we get that metaphor wrong we should obey gravity absolutely not there was a whole musical about defying gravity did i try and look at the threads logged out from incognito yeah this one actually is logged out right Yeah, see, I see the, don't need the whole page. I see the login link. I have been looking at it logged out because I don't want to log in as stream because there's a lot of mod info that gets just interpolated into the regular view of the site. And I'm trying to splash too much of that kind of stuff. I am peeking at this real quick over in my personal browser just to make sure that I can't reproduce the bug when I'm logged in as the, ooh, ooh, ooh, this is actually super interesting. So what if I grab this? no there's no easy way to get this on the stream without showing personal stuff but when i am logged in the threads page is just literally blank that's that's a reproduction and it's especially odd that this spec doesn't have it because pushcx https://lobste.rs/~pushcx/threa…
epic_ninja_elephant Doing it.
arh68 7 hours ago ... A whitepaper researching how ...
it doesn't log in as the user if somebody here in the chat is a lobsters user so i'm wondering now is this me or is this a moderator like is this because i'm a moderator is this because i'm logged in can somebody pull up my user threads page if you are logged in as a regular lobsters user and tell me do you see just where's the threads epic_ninja_elephant I see comments.
arh68 as my user, i see the stuff
gaberguz same.
dpk0 i see comments
gaberguz lots of comments
dr3ig i see comments, i don't see the thread in question
should see this header regardless do you see a whole bunch of comments or do you see zero comments because logged in as the moderator right this moment i see zero okay so you see comments but i don't see comments all right so that says that this is wrong. So there are at least two bugs here. epic_ninja_elephant The bugs are multiplying.
So let's go ahead and reproduce one of these. dr3ig and i'm not logged in
So let's say a scenario, a moderator looks at user threads. So how similar are we? Let's do these things. And then we will say log in as Create a user who is a moderate. Yeah. Moderator. I was thinking a second, does it matter if they are a moderator or an admin and it should be enough to just be a moderator? Cause that's what the code is testing. I'm okay with that kind of knowledge. I don't like writing totally black box, black box testing because it forces me to get really explicit about stuff that I don't care about and avoid the shortcuts that I know about. So.

01:02:31OK. dr3ig nvm, ignore my prev comments
So this is the most basic spec. And what I am hoping is that this fails, because if this spec fails, let's go ahead and run it. No, I don't remember my own. I don't remember my own. Where's my mapping? Call test nearest hack, comma, tt, test nearest. Oh, it's, see, I thought I made it comma TN. I made it comma TTC. This is why you never change keyboard shortcuts. There we go. Look at that. See, it's running inside Vim and like a little terminal on the side. Living the dream. Totally normal to reimplement all this stuff rather than use a GUI editor. That's responsible. All right, that's... Undefined method. login as is it did i call it stub login is that what it is is it stug spec features yeah i called it stub login yes just misremembered the name let's rerun that oh Dreg, you're saying that when you look at my user threads page, you don't see that comment about deployment? Oh good, it failed. It's always nice when you expect a test to fail and it does fail. dr3ig no, sorry, i was mistaken
That's super positive. arh68 task failed successfully SeemsGood
Or, Dreg, are you saying... Oh, okay. dr3ig drake
How do I pronounce your username? Like, I keep saying your name and I'm guessing it's Dreg, but... Oh, Drake, I see. All right, so on this one, this is the bug I am seeing, where there are no comments on the page. And I can probably recreate that really quick by saying, instead of story filter, where story? Oh, yeah, it's saying. Yeah, so it's generating 1 equals 0. So obviously, I shouldn't be getting any comments. So let's go ahead and change this to say, well, what if I pass true?

01:05:07That looks fine. So let's go ahead and change the behavior. And let's see if this spec wants to run. go ahead and close the old one rerun it survey says one green dot okay so there's part of the bug fixed I still can't reproduce the actual bug reported, but at least now as the moderator, I'm not seeing extra bugs. So let's go ahead and commit that because it's just fiddly enough that I don't want to risk breaking it. Yeah. So fix user threads for mods. Let's go ahead and run that. All right. So with that committed, So if you are logged in as a regular user, so maybe that's why I'm not seeing it in my browser is this side of the if is also wrong. So let's try and just write the spec, even though I can't reproduce it in the browser. I really like to reproduce these in browser. So a logged in user looks at user threads. So this one, this one I expect to pass because I haven't deleted the story even. I would like to see this green. dr3ig you are a :moderator still ?
So hopefully this will go green and then we can delete the story and the spec will go red. Because if that happens, then I've successfully recreated the bug.

01:07:02You are a moderator still. I mean, yes, I'm still a moderator of the site. So I've added a spec on the left here. We're here. Where am I? Line 40 is the new one that I'm adding right now. 48 is the one I wrote a minute ago and committed. Oh, I'm still a moderator. Shit, you're right. I see what you're saying there. I wasn't testing what I thought because I just duplicated the spec. Good catch. It is the kind of detail that's easy to miss when I'm yammering away. I had a friend in high school who worked for his college radio station and he was like, yeah, the biggest rule was no dead air. You're never allowed to stop talking for more than three seconds. And I feel a little bit like that. And I can see a lot of how it changed his speech patterns. All right. So that's green. Now we're going to say, let's just go ahead and delete that story. Hmm. Yeah, I'm just going to invent a moderator, have them delete it, and save. All right. What's the over-under here, folks? Who thinks that the spec is going to pass and thus we haven't recreated the bug? Who thinks the spec is going to fail and we have recreated the bug? I think personally, I'm leaning towards recreated the bug because that hash over in comments controller It was dodgy on the left side. I guess it's dodgy on the right side. That's plausible to me. I think it's going to fail. All right, let's run it.

01:08:56Hey, hey, that's great. It failed. It failed. All right, so the bug is successfully reproduced. That's wonderful. You know, if I sound excited, it's because it's not that often I can't recreate a bug in a browser. And this very specific case of you have to be a logged in user who is not a moderator is about, it's the only kind of bug on the site that is a pain in the butt for me to recreate because I'm always logged in with my account. So now that we have a proper failing spec, Let's go ahead and make that change. So I talked about I'm so suspicious of this when what I really want to say is where story, story.deleted for the user who is viewing. And I think I can combine scopes like this. All right. So let's grab this. And I closed my console. Let's go ahead and run this to SQL. epic_ninja_elephant Is this OpenBSD btw or some Linux?
See, this is some plausible looking output. I don't know why there isn't the whole nested union recursive table expression for getting the tree of comments. There's a one equals zero. Oh, it's not right. No. Because this is applying is deleted. Yeah, this applied the story. Oh, it's all happening in... Okay. Hello, sir. I don't know if you all heard that little meow there. No, this is Arch Linux. If you go to push.cx slash stream, there's a little info on my desktop. The... So we're checking that the comment story ideas in select stories at ID. So this looks like a valid query, but it also looks like the worst possible way to do this because this is select every story out of the database. And we have a hundred thousand and I'm not. gaberguz gotta run, thanks @pushcx !
So let's put, so I can get it without the quotes. I'm not sure that's going to create a reasonable plan. Sometimes the. Database Planner will make something reasonable out of that. But if this is going to hit all of the unknown column comments. Oh, it's mad about the line break in here. See you later, Gaber, guys. Oops. Impossible where. Oh, it's mad about this part. All right, so this is not valid. We're not going to do this. Hello, sir. Why don't you go sit in your usual spot? Hello. I have a cat on the desk, and he is sitting on the mouse. So if you see the mouse moving, funny, it is because the cat has his ass on. Yes, sir. You are very helpful on this stream. There is a filing cabinet over my shoulder. arh68 it's like that clip from criminal minds, where 2 ppl are typing on the same keyboard
And if he goes and he parks himself, maybe we'll see him. What if I bribe him? Come here, buddy. Oh, you know that sound, right? Why don't you come up on your favorite spot? No? No? Don't you want to be a star, sir? arh68 but w a cat HahaCat
You can stream on Twitch with me. Yeah, talk to the cat like he's a Victorian gentleman. We've got a real Jeeves and Wooster dynamic going. You know, it is not quite that clip from Criminal Minds because I have had to train him for the last couple of years to not put his paws on the keyboard. lfclm13154 the cat has hijacked the stream
And it is, we'll say, mostly worked. Not totally, but mostly worked. All right. All right, here we go. All right, everybody brace yourself. The stream is about to take a big, big step up in production quality and If you are tabbed away, you should tab back. epic_ninja_elephant Whoa.
atipls_ car cam
Boom. There we go. You see that? arh68 navcanRose
epic_ninja_elephant Pro-streamer.
Now we have the streamer in the corner. There's the cat. Yes. bsandro bsandrGood hello cat
Hello, anti-please. Yes, it is cat cam. Bro streamer. All right. So now with our big good luck charm, let's see if we can fix this query. We'll see if he settles. Sometimes he chills out up there. Now that it's kind of muggy summer months, he doesn't do it super often. But in the winter, he's often up there chilling over my shoulder and watching me code. So what I want is to combine this filter properly. And so I don't need the database console. I need the Rails console.

01:14:23I wonder if it's literally just that I don't have... No, it can't be a hash, can it? Because I don't have a key. arh68 what is accessible_to_user ? what's that mean
dr3ig can you move the cat cam higher up ?
If anybody is very comfortable with active record scopes, now would be a great time to pop up and talk about composing them. dr3ig it's covering the line a bit
What's accessible to user? Accessible to user is an active record scope where... Oh man, he looks so grumpy, doesn't he? What a good helper. Can I move the cat cam higher up? I think I can. All right, so if I grab this here, I'm pretty new to OBS. So this is, there we go. All right, Raz, good boy. So he will be up there. So Active Record has these concepts of scopes, which are little SQL snippets of a where clause and we can compose them and reuse them. And the issue here is I am composing comment scopes, but now I want to compose the one for the join table. And if worse comes to worse, I can just like... Yeah, no, can't do that. Missing a curly brace. I'm not actually missing a curly brace. I just don't have a key for that hash.

01:16:07There's something it doesn't like about it that's causing it to, instead of generate that whole comments tree, generate that 1 equals 0. All right, there goes the boss. You see that? Look at that. What a professional transition I did. I am a professional streamer now. That was fun. Oh, hello, good boy. He is considering curling up in my lap, which he's usually iffy on. And if he does that, my typing is going to get a lot worse because he always lays on my arm. So.

...59Join story. I think we are seeing his return. It's index. Associations. Yes, excellent. You know, I will have to get a little more light on him. As a black cat, he's very hard to see on that stream. Let me throw on the room light, see if that helps.

01:17:40Really, he's still a black cat. Maybe I'll paint him for the next stream. Yeah. okay buddy so we have this is a has many association and we're curious about composing it controlling association scope no that's a different kind of scope that's ruby module scopes not Active record query scopes.

01:18:34So what I'm trying to find is something more like active record compose scopes cross joins. I'm just trying to find an example Using named scope across go rails girls is actually a really nice site, man. It's funny when you look at, framework stuff and it's like, oh yeah, it's been around for like a decade. Okay. I remember when rails introduced scopes. So if we have an author and we joined books with scope, oh, it's dot merge. Merge is the API. All right. Let's try dot merge. oh what happened to my read line sad things all right so let's instead of saying where let's say dot merge see what that gets us that gets us another invalid one why why are we missing

01:19:46Oh, I know why it's failing. Showing user is nil again, because I had to restart this Rails console session. So it blew away that variable. Okay, so that gets us back that stuff. Okay, I was wondering why that wasn't working. So now if I say merge, good. I get the big recursive CTE. And then when I say and comments is moderated and is deleted is false. So this one applies to the comment. Yeah. Now see, this is not a valid query because this is the stories It's supposed to say stories.isDeleted because we already handled it out here of comments.isDeleted. So I'm not sure if that is the stories scope. Is the right place to fix that? Ah, it is here. It's because... Whenever you drop down into strings like this, Active Record can't do anything to compose them except... Kent is a strong word there. Active Record could parse everything as a sequel snippet, but that would be an enormous painful project and then a little bit too magic. so on this one let's just change it over to the syntax it wants where we lean on it more this is one of those cases where if you use your tools more they will be good oh it's the or yeah so we'll say where is deleted false or i think it's dot or where seeing now i'm doing a different kind of scope composition and i'm remembering a different dsl or, and now I don't have to specify that or the user ID is that. Okay. And there's a syntax error here. Okay. No, it's just standard RB being slightly out of sync that happens occasionally. So if I have that now let's try out load.

01:22:21Let's go ahead and make sure that's returning reasonable results. There is a whole test suite. Yes, I could run the test suite, but I just want a wrong number of arguments, given 0, expected 1. OK. So I misremembered. So we say or where.

...41So let's reload again and run that again. Yes, that's correct. And now let's try our actual thing. Ooh, look at that. Now it's joining against stories. This is one of those cases where you lean on the tools a little bit better. It's hard to lean on them sometimes because, I mean, you saw how many tries it took just to get the right API usage there. Here we go. So if I have that, and here i want to update to have here let's put all of you back on different lines how did i write it i said dot merge you know it took me the longest to learn the habit of copying and pasting trivial stuff instead of retyping it like literally five years to get in that habit But it saves so many things, especially in just literally this morning, I had like messages equals messages plus dot, dot, dot. And I was pulling my hair out. arh68 i never retype integer ids LUL painful
And what I couldn't see is that I had typed messages with three S. And so Ruby was like, yeah, sure. We'll just make another variable. There's no issue there. That was, there was a lot going on in that diff. And so there was like, I think I lost 20 minutes to that dumb typo. It was so irritating. But that's why you'll sometimes see me say stuff like story.nah, and then I will autocomplete something. Because if I autocomplete it, at least it'll be spelled right. Or at least it'll be misspelled right. Because it's just doing string substitution. So this all looks pretty good. I think we're in good shape. And I think this new spec is going to pass. Let's run it. I think this is going to pass. I never retype integer IDs. Yeah, yeah. Integer IDs was maybe the first one where I learned it because, oh, no, it didn't pass. Boo hiss. We'll tinker some more. We'll make sure I save the file. I did. So we said comment recent threads accessible. Merge story not deleted. And so it doesn't inner join. That actually looks legit. Let's go ahead and say, let's just inject a little debugging for our test.

01:26:03Bim, Bim, why are you fighting me? Did I open another nested one again? Come here. All right. I wonder how these emojis show up in the stream transcript. I never thought to look. So we expected, why does that query look right to me? Where stories is, oh, oh, this is actually good. This is, this is me updating. This is actually the current behavior. The spec is written backwards because when a moderator looks, they should see it. But when another user looks, they shouldn't. And then if we want to duplicate this scenario, so my usual approach to at their own user threads and so here when the comment is created by wait this reused the user oh no now it's looking at a different user's thread because the factory will implicitly make somebody so let's go ahead and close that All right, let's run the whole file.

01:27:47Let's hold on. Stop. Stop. Wait, they all pass. Let's accidentally close the wrong terminal. Come here. So this is saying. When a logged out user looks, logged in user, they, yeah, that's reversed. They should see their comment. That spec shouldn't have passed. And a logged in user looks at other user's threads. We expect it to not have that comment. Yes. And a moderator looks and they should see it. So these specs look like they're testing what I think they're testing. So let's go ahead and run that. I'm doing it manually because I want to see a nice wide terminal. Spec features user threads. OK.

01:29:10So the one just for the logged in user looking at their own threads is wrong, which is interesting. The other one is how many times did this get printed out? All right. Once per okay.

...28All right. So it's just this one spec, a logged in user looks at their own line. Am I on 40? So let's run just that spec. So I want to see only that query that it outputs. atipls_ is `user` the last created user? coming from django, seems a bit too magic to me ๐Ÿ˜…
It's possible this is test data with the factories where I haven't actually reused the same user model. Is user the last created user? Coming from Django, it seems a bit too magic for me. Yeah, it's coming from a factory service, which is for testing. So yeah, this is where user ID equals one, and I'll have to debug what that user ID is. So stub login as is my test helper and then create user as a call to the helper method or the factory. And if you look at the user factory here, that's down in the lower right, it says, oh, we have a factory named user. And then here's these attributes on it. And here's how we generate some fake data for them. And then we can have traits like, have they been banned? Well, then their attributes look like this. Are they the inactive user? Are they a moderator? So it's a really succinct way to create testing data because I can just say give me a user and I get a generic user and then I can tweak it as needed. And this one is saying create a comment and I care that the author is this same user. Well, the user is leaking test data so this variable is not assigned in this test where does it come from oh my god it's the thing this is funny it is the thing I was griping about earlier about it's easy to share test data almost too easy well this is kind of reaching up to the top level scope and so I have been creating one user. This probably has the user ID too. But then here, this is not a local variable. This is a method call up to that top level user. So that's the DSL biting me a little. So if I shadow that, yeah. I think that's it. Let's go ahead and run this.

01:32:39False. I'm not sure what user I'm using. I don't trust it now.

...53Here, let's just exclusively use that outside one. And this call is going to print that. And so we'll say, let's test user ID is user ID one.

01:33:14Let's see if we see that same ID in the BigQuery. Because that's what I'm suspicious about. Because I would have created exactly this behavior. There we go. I must not have saved the file there. Now we're green. User ID is 1. User ID is 1. Or maybe it wasn't letting me create a local variable to shadow, and it was just silently throwing it away. It was being a little too Ruby. Cool. So where was that other puts? Get rid of that. And let's run the whole file. And if the whole file is green, which I expect it is now, then we've reproduced the bug, we fixed the bug. And it is always kind of satisfying to fix a bug by replacing slightly janky things by leaning on the framework more. dr3ig should probably take care of "global" user in other tests ?
All right, that's good. arh68 green dots
Let's run the whole build. And I, you know, fingers crossed the whole little bit green. Dots, dots, dots, dots, dots, dots. Because the specs, even a unit spec can hit the database, they run kind of slow like this. Like you can see the whole suite took 21.4 seconds plus 1.74 to load. So call it 23 seconds. I have my... an unholy hack in my terminal setup. So it always shows me the time it took for the last command to run. So the whole build took 27 seconds. I would really like to put a decimal point in there. dr3ig just to make sure `user` is what you expect is
I would be a lot happier if that was 2.7 seconds, but I'll take what I can get. Trying to get the build faster. There's a gumption prep for you. All right, don't need these. All right, go ahead and close that. We're done with that. This is nicer. I like that improvement. Let's go ahead and review the git. So in comments controller, this line is dead code. 353, was it? Yeah, story filter is just dead code. No, I don't want to write to it if it's been changed. Come here. Let's get the latest version. All right. And now that diff looks like I want. All right. We will go ahead and add that. And in model story, we replaced the string query with the active records scope building, which is part of what made that nicer. And that'll, yeah, I was a little worried that One of the hassles I've run into there sometimes is when you replace those hacky things, sometimes things were depending on ever so slightly wrong behavior, but we didn't get any of that. The whole build was green. So surely nothing will go wrong in production, he said ominously. Then we added this spec and this spec, and I'm okay with a lot of code duplication in specs, tests or specs, whatever you call them. I really like them to be independent of each other, even though it means sometimes I miss editing like these two knots and lose a minute. Okay. So let's add that. That's everybody. Commit. What was that? What was that bug number? 1301. So...

01:37:27Slash user threads or logged in users. That seems reasonable. I don't have a strong preference about whether. Yeah, this way I'm kind of describing the bug, and I know people like to say like. Yeah, this is the clearest way to say it. I'm not going to overthink this commit message. I do try and do the imperative present tense thing. I think it helps. All right, since that one's a pretty annoying bug, let's go ahead and deploy.

01:38:17And yeah. So I'm just going to go ahead and let this deploy for a second and take a drink of water, but that's a bug fixed. If I bring up this, it should be automatically closed by the... No. Didn't get automatically closed by the commit. Did I type the number wrong? Arg. Arg. Oh, I know what it is. I know what it is. Stop the commit.

...48I got so into coding and getting ready to show the deployment... I forgot it helps to get push. Oh no, contains work. What did I merge? So let's go ahead and pull with rebase and see what it was. Yeah, there's all the different remotes from people who've committed bigger stuff.

01:39:17There's that. Oh, this. Someone gave a nice little pull request. Just a little one-liner yesterday. They were apparently reading the code and they caught that there was something redundant. And so they fixed it. That was really great. So now we can git push origin. Good. And now we can call Ansible. And now we can drop in this password. And also this should have good closed deploying. So speak of things that take longer than they should or could have a decimal point in their runtime the ansible deploy takes two or three minutes we'll see what this says even after it finishes the ansible command the the puma workers are refreshing you know like step-by-step fashion so When it says here that it has started a phased restart, what that means is it sent the signal to start a phased restart, and then production is going to restart the workers one at a time. So it sends the signal to restart one worker, and then it starts the next, I don't know, when that one reports in, so call it six to nine seconds later. And so the actual deploy is going to take another two or three minutes. Yeah, see, this is funny. When I run time on it, i get a minute four but it's a minute five yeah oh ansible this one is is very much in my let sleeping dogs lie i will gripe about it while it runs because you know i got a vamp got to fill that air time but boy do i not want to significantly change anything in our hosting setup because it's such a huge slog and we have a whole bunch of custom stuff So it becomes very easy to not see what you're doing or to break little bits of the site that people don't see very often. So I've got my mouse off screen because I am casually reloading my personal browser. That's the one I can't bring on because it has some mod stuff on it. And if you load lobsters, like right now, while I'm in the middle of the deploy, that phase restart is still running. And so, you know, there's 20 workers. And so every six seconds, your chance of getting the new worker that's refreshed goes up by 5%. And I did just see my deploy get fixed. So we're just about there. Yeah. 153 seconds. That's about what it takes. Great. So. Close that, can close that. Isn't it satisfying to close terminals and files at the end of a commit? I love it. So we fixed a bug. How are we doing on time? So I have been going for an hour 42 and I'm aiming at two to three hours so I can take on another bug and probably fix it, right? We're feeling confident. But this is also a really good time to say that if anybody has any questions about how the site works, or if you would like to run queries against the production database that tell interesting things, or grab the logs and count how many IPs we see every day, something like that, I am happy to run that kind of stuff. There is, let's bring it on stream a second. I don't need this tab. Do you have Firefox? Are you so busy? Here, let's... Doesn't want to auto-complete. pushcx https://lobste.rs/about#queries
Oh, now you remember. I can't write just the important bit. So I'll share this in the chat so everybody can read it. arh68 can I ask how many tables there are ?
But what I'm referring to is, I am happy to run queries against the prod database if they don't leak PII or like very personal user so and so. Can I ask how many tables there are? Yes. Yes, absolutely. That one I can answer even in development. Let's swap that out. Well, actually, maybe the best way to answer is to kind of show you something so you can see it. In Rails, there's this file db schema, and it's sort of a cached view of the database and also a tool for creating the database. It serves a lot of roles, but it's especially handy for if you just want to peek at the table structure. And so if I said, how many times does create table appear in db schema? My Vim plugin would work. That's great. That's not embarrassing. Create table in DB schema. So it looks like we got 25. And I happen to know also that at the end of this, there's one view. arh68 half a table, i guess
So whether you count that as a table or not, it is and it isn't. Lobsters is pretty focused. So if we say, look at which tables there are, you can kind of see that there's not a lot to the site. Stories is our god object. In every Rails app, users is also a god object. So we have a kind of duo theism going. And then the other stuff are, you know, Not that one. The private messages. Comments is another big table database. arh68 cool. how many indices ?
Yeah. And then there's just the one view. But if things are pretty chill, how many indices? Oh, we saw that. There are... So this is... No, these are just the foreign keys. So if I grep for index dv schema... It's going to say zero is not a plausible number 82 indexes. So what does that every table on average has three indexes that feels about right. Because a bunch of these tables like messages have one or maybe two, but then, if we go to. Like comments that get access to a bunch of different ways, it has like nine indexes because. There's the full text for searching. And then there are kind of all the different ways we find comments. Like if you find a comment, you're going to need to find its children, or you're going to need to sort by score. You're going to sort by the thread ID. So everything in computing is, you know, power law.

01:46:48arh68 seems very read-oriented SeemsGood
All right. Cool. Seems very read oriented. Yes. Yes. the, there is kind of a rule of thumb that I believe has its own Wikipedia page. so if we go to, what is it called? This is the 99 one rule. That's what I think of it as let's see if Wikipedia calls it the same thing. Oh, they call it the 1% rule. but it's a rule of thumb that, 90% of participants only consume 9% will change your update and 1% add content. This is actually. Lobsters is significantly more lopsided than this because we have the whole invite system to prevent spam, but it makes it harder for people to sign up to become contributors or creators. And so we are probably something more like. arh68 what is like the maximum comment size ?
it's hard to say filtering out bots but probably somewhere more like 95 4.5 you know generously rounding of the users who are actually logged in though this rule is pretty darn accurate for us and if you If you're interested in this kind of high-level view of the site, there's also a page called slash stats. pushcx http://lobste.rs/stats
Let's copy this over here. Why are you being so mean to me? There we go. HTTP. You can see Firefox hasn't finished loading if it didn't redirect to HTTPS. arh68 i remember reading facebook allowed like 32KB posts or something crazy
There's some charts and graphs. of site activity and you can get an idea for what it means for a user to be active and how many stories are submitted and comments posted this is not a we're a tech startup and every line must go up to the right this is it's very useful for the community to understand itself and understand if things are growing or shrinking and you know like everybody who had the covid times weirdness The maximum comment size, I'm not sure we impose one. So let's look at the model. We say, okay, so our maximum length for a comment is apparently 16 megs. That's maybe a little much. That could be shorter. Speaking of numbers that should have decimals in them. Man, oh, there we go. numbers that should have decimals in them. I'm going to put that in the stream archive as the title for this stream. byby42 IIRC that's actually characters, not bytes, so 4 times this is you use only emojis and such
I like it when people use funny quotes as titles for things. atipls_ related: what's the longest comment length?
It's like waiting for the drop in a movie what's the longest comment like good question let's take a look and let's go database what is it is it i can never remember with marie db if it's length or sterling i think it's length Comment from. Actually, I can throw max around there, can't I? arh68 length in bytes or codepoints SeriousSloth unicode fun lol
Oh, wow. Read line is weird on this machine. Select max length comment from comments. dr3ig 16mb is equivalent to .text size: medium in db schema
Looks like our longest comment is about 57 kilobytes long. And yeah, Drake, that is exactly, you have the correct trivia. That is exactly where that limit came from. dpk0 i have a very bad query i would like to run, although it would take a long time and have to be run as a linear scan from the Ruby end, with each step taking a while โ€ฆ
dpk0 how many lobsters users have passwords that were in the top 5 or 10 most commonly used passwords?
A while ago, I added or asked folks to help add some gems like database consistency and other kind of database-oriented linters because it's really easy to forget to do things like foreign keys in Rails. And then you get lousy performance years later once the table actually has data in it. You have a very bad query to run. How many lobsters users... Hmm. How many have most commonly used passwords? Boy, I would hope the number is zero. That is an interesting query. We do have the option of... revising the query and running it in development. And then I can run it in production or let it run in the background. Site traffic is highly correlated to the US workday. And so Mondays are the busiest time. I try not to deploy anything that can't do a phased restart. If we're going to have some downtime for deployment, I try and hold it till after the workday. This kind of query, I mean, we don't have that many users and computers are fast. even though yeah so we're at 17 000 users so there's not like a giant number of bcrypt hashes to do oh you write that query i'll run it and the reason i say that on is that one's kind of a finicky query so i would like you to write the first draft arh68 can we see the (start of the) 56,885 comment ? i just wonder
dpk0 4.83 hours at one second per bcrypt hash โ€ฆ
If you look at the Lobster's repo, it's pretty easy to check out and get set up, at least with the database. So getting a first draft of that. There goes my IP. That's OK. It's a residential IP. It rolls all the time. Can you see the start of the very long comment? Oh, 4.8 hours. dpk0 cool D:
Well, all right. dpk0 * :D
We'll send it to me and I will run it overnight sometime or on a weekend. Traffic is very low on the weekend. And it's just, you know what? That's going to be long. It's not going to be expensive. You know, it's going to pin one of the vCPUs on the database, but all of the rest of them are going to work. So as long as I run it outside of site core hours, it's not really going to drag down site performance. And I am happy to... You know, if anybody is mad that our pages took 4% longer to load, they can show me their contract with their SOA. All right. So I had said in my scratch notes that another one to look on stream would be 1268. dpk0 no, wait. that would be for one bcrypt hash per user. to check for five would be five times that โ€ฆ so yeah, two days for top ten
dpk0 maybe not
Ah, so this one I thought might be fun, and I kind of thought it was implausible that anybody else would want to dive into this because the search engine is a little complicated. Two days for the top 10? That's fine. I don't care if a query runs for two days. That one, you know, I will hold it till a Friday night, let that run over the weekend when traffic is lowest, but... Again it's it's totally fine or the other thing I can do is. One of the ways, so the the site takes database backups and I believe the current schedule is four times a day, it doesn't incremental backup and. in my local development environment, I have it configured so that I can load Restore from the database backup system to my local development, which is, it's both nice so that I can have prod data to tinker with or to test with, but then it's also very nice because it forces, it means that I am constantly exercising the database backup system and seeing that Restores work because Boy, if there is one thing I have learned the incredibly painful way, it is easy for backup systems to silently go into a fail mode where they stop taking new backups. And you don't notice because you only look at the backup system when you've actually lost data. And then you find out six months later that it stopped backing up, or it was corrupted, or you have a bunch of like, you have zip files, but they're all zero bytes in size. And then you are especially sad because you're looking at it during an outage. I restore prod data to my local machine as a way to kind of keep that code path working and know and have very high confidence that it's working, which is all the very long way to say, hey, if you write this query, I'll just run it on my local desktop, and then it won't touch perf. And I don't care if everything's in the background all weekend on my dev machine. It doesn't hurt anything. So this one is fun. I think it's kind of fun both because it's very nerdy of we have this specific topic that comes up on a programming site where you want to search for punctuation. And also it's kind of fun because the whole search engine I rebuilt a year ago, something like a year ago to properly parse searches so that we could have structured operators on it. So it's not just a full text search. You can say things like, I want to search only in the title, or I want to search by the story submitter, or you can search by the commenter. And I forgot to put it in the help text. Oh, no. Let's put that in the help text real quick. That one's so cheap, it's not worth putting on the list.

01:57:12This is the search page. That is the search model. View search. There we go. By story submitter.

...30And let's go ahead and say, or by comment author with. Come here.

...44And this one is commenter Bob. Cool. And that's so small, I'm just going to commit it as is. So add.

01:58:06Explain how to search by commenter. Good.

...23So with that done, this user, fanf2, I think that is their username on the site.

...38Nope. They must have an underscore or something different that I'm not remembering. So let's pick a different user. Honestly, if I just search for C++, yeah. So C is too small. I put in a little help text here of you can search for tag C. That only works if the story is tagged C, because individual comments aren't tagged. So here, what we're looking at is one of those feature requests where it's kind of easiest to start with the spec. So let's go to the spec search. And we can put it. I am debating, is this a user feature and we want to test it all the way from the outside? Or is this something I want to test? See, I know I'm going to implement it in the parser, and so it's tempting to write the lower level test, both because it'll perform better and it's also a little more specific. But then I think about that, plus, plus, and there's so many levels of coding involved, but none of them are broken. So let's go ahead and see if we can do it on the inside. So we have the search parser, which I made a custom matcher, which, boy, yeah, that's the one that writing this match sure is part of what pushed me over to maybe RSpec is more trouble than it's worth, because this was a lot of code to express what I wanted. And a bunch of this stuff, like the too primitive and the failure message, it's complexity creeping in from very big test suites where some of these things have performance implications.

02:00:31so we have all these different rules that the parser which uses a what is it it's not lalr it's the ruby parslet library which is hey parsing expression grammar i do it just infrequently enough that it's hard to remember the terms And it looks like I don't have a good test at this level for something like seer C plus plus so yeah let's go ahead and go back up to that other spec.

02:01:15can find zero. yeah. So. We will say it allows searches for C++. Yeah.

...41So we will grab a working test. And then we will say, let's put a comment in.

02:02:11All right. Did you do that? So if we go ahead and create a comment, and it's going to have text in it, and the text is going to say, sometimes I get a little spicy in these comments. We could say something like, you know, rust. is cooler than C++. But the debugging, I don't know. No need to go on. That's enough to find. And so then if we search for C++, we expect to get a 200 response, and we expect one result. So let's run it and watch this spec fail.

02:03:07If we could never have another, like, russ heated argument flame war that would be nice good so i'm not going to scroll up and see this whole thing but it is correctly saying that no the text did not appear on the page job's still running no it's not so there's an a very outside inspect so the way this goes is It goes into the search action and search creates a search model. And a search is kind of the user idea of a search where it has a query. It has some specifications like I want to search for stories or comments. What kind of order do I want them in? What page am I on? It includes the searcher because I am allowed to search for deleted comments, that kind of thing. And then the business end of it here is down in the search parser.

02:04:23In the search parser, if you have ever written a parser, this part is going to look pretty darn familiar. We have these rules and we are looking for any kind of structure to take apart. And we have an interaction here between the search parser and the search model. So the shortest version is to say that words terms, which is what the search engine calls it when you look for a term like poobar, that is two terms. Well, if we want to look for C++, What's happening here is term doesn't match that because it only says we allow word characters, underscores, hyphens, and single quote marks. And boy, that one was a bit of a struggle, but I wanted to be able to search for can't or don't. And it was adding that that kind of gave me the... arh68 like searching for O'Caml I guess
the confidence to not just punt on this bug and just say, no, it's a limitation of the search engine. I'm just going to suck it up. Because, oh, yeah, searching for OCaml is another one. Although, in practice, almost everybody types it as just one word without the apostrophe. arh68 so does the search for "c++" also not work ?
I think it's kind of like email, where the internal punctuation is just getting smoothed out of it by use. And this one you know we went like electronic mail and that lasted about 10 minutes to email to email and the same way we've got you know oh camel so camel to I don't know just camel. Probably not that last step. So does the search for C++ also not work? Yeah. I did it over here. arh68 like with ""
Maybe we're tabbed away, but if we search for C++ and this is in production, even, it just says it didn't even recognize any search terms because, and I like, this is one of the things I like about having a nerdy user base. Oh no, you can't even with quotes, it's still going to get stripped out. And I have this one. I literally had the... Because I knew this was going to come up. Say plus plus. Where did I have? Where did I write it?

02:07:15I have something going on with my ag integration where it doesn't allow me to do multi-word searches. And I guess it's just mad at me entirely now. So that's not right.

...37OK. Something weird and clever is happening that the literal string doesn't appear. I wonder what I did to generate that text so cleverly that I can't even search for it.

02:08:07So this is the help, the page number up here in the explanation where it's pulling out the search terms and showing the parse tree. I wonder if it's just one of those issues where the string got split across lines and so grep doesn't want to find it.

...37Yeah, one and two character terms are not indexed. Oh, oh, I couldn't find for the language because I had something cute in there. arh68 LUL
So if you search for Go, I have been annoyed forever and I let a pet peeve slip into the code. Where if you search for D, Go, ML, or C, which are all too short, Because you can't build a search engine down to two-letter words. It's got to be down to three. The language go, the name just drives me up the wall because takes one of the 50 most common words in english which is even of a different part of speech it's a verb not a noun and it reuses it reuses it as a verb and i stumble on it for i don't know the 10 years first 10 years i saw it i'm kind of used to it now but it was either this or i would rename the tag to golang and i figured this would be less disruptive So yeah, the other version of that is, you know, for the language use tag D and if you search dpk0 โ€˜goโ€™ is also a noun. โ€˜have a goโ€™, in a game you might say โ€˜itโ€™s your goโ€™
dpk0 quite apart from the Japanese board game
ml you get another little hint that's very specific i like putting these little kind of touches in oh i got i interrupted myself but i really like having a technical readership of the site means that i can do things like show the parse tree for the search and people will get what it's doing and how to better use the search engine as opposed to like let me explain how to search go is also a noun to have a go in a game of go you might say it's your go That's kind of a UK-ism. We don't, say, have a Go in the States. Yeah. arh68 go is such a terrible name but you just know they Had to do it
And I think I read somewhere that Go was named inside of Google specifically so that they could have a search command called go ogle. That's my best understanding of how that got named. And I think they have slightly PC-style cleaned up that maybe we're not going to name our whole programming language after a joke about ogling. Anyway.

02:11:21So the tempting thing for this is to say Let's just add plus to a term. So let's hang on call.

...40Let's get Rails running locally in the back. Oh, look at me nesting my VIMS again. All right, let's get out of the nested VIMS. That just causes me sadness.

...56Cancel you. All right, we're down to base metal. simulation and a simulation and let's go ahead and call rail server tab so this is a just some bim script that's going to run the rail server in the back ground except it's called jekyll i guess i got to fix that that's easy enough And then over here, we were over in the search parser. So it's tempting to do just this fix of add a plus. However, if we go back up a level to the search that actually takes the search tree and takes the parsed data of what the user searched for and turns it into a database query, this has yeah so this second one i know it's second because oh it's the first one what do i know so when you perform a comment search it goes ahead and like starts a base query and then it walks the parse tree And in the same way, this is a little similar to the previous bug I fixed. It builds up the active record query of, well, we're going to say this kind of join and this kind of where, and let's add these things on. And the thing it does very carefully is when it appends a term, it calls this strip operators. And it does this for both a term and when things are quoted.

02:14:04And the value of that is it prevents a bunch of SQL injection. Because at some point, we have to get down to the level of actually giving text to MariaDB. And it is really hard to avoid. SQL quoting, especially on these search operators, is fairly complicated. To permit that single quote as a search, I had to add it here, but then also to add the proper amount of escaping. And so there is, I believe I added. Let's check. Grab.

02:15:02Yeah, in the search spec, I added at least a couple of specs that... Why am I not? Oh, I'm not in the spec.

...23A couple of searches, and I should probably add a search for

...32OCaml or Ant.

...45I'm going to go ahead and add some more here.

02:16:07Another way of having these is in quotes. So if I searched for you can't, that also shouldn't error out. So just having the smoke test of did we generate valid SQL has a lot of value. If we run this one, it should still be green even with me adding test cases. If it's not, well, then we have two bugs. As a programmer, you always get to make work for yourself that way, right? Okay, that's good. All right.

...52And so what we want to say is that you can search comments for C++. And if I just run this particular spec, it might fail. So this is just a smoke test of if somebody searches for this, do we throw an exception because of invalid SQL? Yeah, it doesn't actually fail, which is a shame.

02:17:21I mean, it's not a shame. It would be failing in prod. arh68 can I ask which special operators the search can actually use? In Boolean Mode &c
But what I would like to express with a test that is very hard is, does this particular search permit SQL injection? And that's a arh68 like why inject anything, what even requires that
a nightmare of matching up the levels of quoting in the test with the levels of quoting in SQL and trying to parse out the generated SQL. Can you ask which special operators the search can actually use in Boolean mode? The answer is none. We do and searches, and that's it. And strip operators is deliberately written in a very aggressive manner, where if it doesn't match the whitelist, it's out of here. Because, oh, why inject anything? It's down here.

02:18:25arh68 i'm reading about like In Natural Language Mode vs Boolean
It's for, I believe it's quoted terms. So quoted terms, we have to pass the correct number of quotes down. arh68 I see
And if you're looking up in natural language mode versus Boolean, natural language mode is kind of not what we want because it does stemming fairly aggressively, and it doesn't match for technical terms. And then there was another reason. What was it? Boy, I don't remember that I wrote down a design doc about all of the stuff I saw along the way of building this search parser.

02:19:13I believe it was that I couldn't express ands and ors and eventually nots. Like you can see a negated, I would like to support that at some point. There's little hooks for it, but it's not even a term. A term the parser recognizes, yeah. So if I go back up to strip operators,

...48Before I do this, let's go over to console, search.new, what? Comments query C++. And then I think I can just say perform comment search to SQL. I'd like to see the generated SQL. Wrong number of arguments. Are you mad because I've already started changing code? No. This thing needs params. So params is passed as a hash, and then user is separate. So we'll search for this, and we are not going to pass a user because this is not dependent. Good. So you can see the stuff that is generated. And so if I search for, say, cat, oh, it's actually performing the search. It's not just

02:21:00I swear there was a moment, maybe I just inserted debugging. Yeah, so here's where if there's terms, we do this matching, we do all the joining, and then there's even more joining for tags. Then we have to count the results. This is the place I want to.

...26I'm going to get up a second, shut the door.

...33You may have heard voices in the other room. Hopefully not. So I just want that as debugging. So why did I do that? There's the reload bang.

...51I don't care about the results. So here's an example of the query that gets generated. match comments against and so then there is a plus which is part of the syntax of in boolean mode to say and so if i search for cat dog the plus is saying that it must be present and if i search for c plus plus i mean now that i've changed it it might pass that through or it might just Consider that invalid and eat the exception along the way. Yeah, so strip operators pulled that down to C. And then if I inspected the search object, I would see the various warning messages that end up showing here like no search term recognized. I'm not going to run down that path. But where we get to is if we get to, I can say reload and then search, proceed plus plus, and get something reasonable. Yeah. So I'm going to leave this puts in here because all reliable for def debugging. So if I updated strip operators to say that plus is allowed, it's going to see around so many levels of quoting. In a regular expression inside the brackets for a character class, I don't think I have to escape a plus. So it's not. Yeah. OK, so that worked where the plus plus came through, but then it lost the C because it has this strip short terms that also has to permit

02:23:57I don't see apostrophe in there. I wonder if apostrophe matches this character class. What if I search for can't?

02:24:11Oh, it didn't work. It stripped the T off. Wow. So no one has complained that you can't search for can't in prod. We'll fix that. So if it is only... two characters we strip it and it needs to permit i wonder why when did i recreate this this could just be expressed with saying one comma two And then there's no repetition. And then I can add apostrophe, which doesn't have a meaning inside the character class, doesn't have a meaning inside regular expression. Quoting. That's not fixed. Why is it not fixed? So we permit anything in the word character class.

02:25:32Oh, it's backslash B. Backslash B is matching the boundary. So an apostrophe is a boundary. And so then the T on can't. Boy. dr3ig maybe someone complained about can't; unfortunately we'll never know until we fix this
I've got to figure out a nice place to put a test seam so that I can write a reasonable spec of this instead of just running it in the console, because clearly this is going to be fiddly as heck and prone to breaking. If anybody has strong opinions about that. Maybe somebody complained about camp, but we can't find it. You know, you could check the GitHub issues. They don't use our search engine, which is probably smarter than.

02:26:21So we want to say, so for strip short terms,

...40And then the other behavior is don't remove the T in can't. Don't remove the C in C++.

02:27:01So this is actually pretty straightforward to write a spec. There's a reasonable seam there. As much as there is a. So we have. Three specs. There's a spec for strip operators. Cool. Let's go ahead and add a spec for. Short terms. It. Moves. short words that real db would ignore and this one will say we'll just make a search object and then we can invoke that method because it has no dependencies on internal stuff so we can say spec expect s dot script short terms with So if we say, I do, that's nothing.

02:28:29And if we say, so here's a failing spec that should still equal can't. If we say OCaml, it's pretty redundant with the previous test. But when a test is such a pure test like this, I don't mind that it's very, very brief. I don't mind repeating myself a little with real test data. So we expect C++, T equals C++. But we expect C, T equals nothing.

02:29:16So if I run this spec, we should see it fail pretty fast. The I do not will pass.

...32Expected can, yeah. So there's the fail I wanted. Oh, you know, these are all, this is two letters. That's fine. Say I wanted one with one letters and one with twos.

02:30:00So we'll say that. And when we call strip short terms, it's running on an individual word. So I'm actually not calling it correctly. It should never get a space. So let's go ahead and express that invariant.

...32This maybe wants to say something more general, like regular expression to see if there's any whitespace at all. But that's enough to start, so I can think about that. And then this one, if we said I, we get nothing. If we said do, oh, OK, then. also get nothing yeah and then can't oh camel good i feel like i almost want to have like i can't remember one off the top of my head but there are so many cheesy sci-fi names with apostrophes in the middle of them I almost want to have one of them, but I can't think of some word in Klingon that has two letters and then an apostrophe. If you do, you can share it, and I will add a silly test case. But that's enough for now. Let's go ahead and test that other behavior we added. Forces the invariant that it works on single terms. do, and let's just yonk. And so if we search for, I do expect that becomes this. I don't care what it raised, I just care that it raises. I mean, I guess it should be an argument error. All right. Let's test this file. Wrote code a lot. I expect the first spec we added for strip short terms. Man, I wrote myself a tongue twister to go ahead and pull that. And then lots and lots of specs blew up. Lots of specs. Oh, this is all failing because I have that debugging statement in there. This is what I have to say is. So what's happening with those failures is the. There's a little bit of magic. There is a lot of magic in Active Record. And one of them is that the built up query is called a relation. But when you start interacting with it and it gets evaluated and you call something that is kind of results oriented like dot first, it will go and execute the query and then return itself. And it makes itself unmodifiable. And by printing out the dot to SQL that counts enough as execution that the thing became immutable. And then later on attempts to add pagination blew up. Yeah, so now we're down to I changed behavior on SQL injection doesn't error on real searches okay now we're down to like real exceptions. Oh, and because that's an internal terminal it doesn't rewrap the vim terminal has some limitations and not rewrapping when the window size changes as one of them.

02:35:03arh68 i love it when it rewraps
xxsupercuberxx VoHiYo i enter and i hear relatable pain
But this one ought to pass, this new spec for that new restriction. Hello, SuperCuber. xxsupercuberxx yeah i think it doesnt rewrap cuz it becomes different lines in the buffer
Do you write Rails? Because, yes, we have plenty of pain. Or I guess if you write any kind of tests. So we expected it to raise runtime error block. Is it mad that it didn't raise? That doesn't seem to be what it's expressing.

...38Do I have to pass the name of the exception? Is that what it's... I very rarely test exceptions this way. And so there's one more place where I don't remember the syntax off the top of my head.

02:36:00nogweii you're still live! hello! PrideWave
Argument error, argument error. This is not a helpful failure.

...13Let's check for another expectation like this in the spec suite, because there is one, right?

...34dr3ig raise_error
Ah, it's not two. I get it. So by saying raise, I am raising right there. It's supposed to be raise error is the matcher. Yeah, Drake, you got there the same time I did.

02:37:01nogweii did you end up taking a look at my PR or focused on other things?
Okay, there is one fewer failure, including that last one. So we are in a... nogweii LUL
roughly correct state so this is good this is good and then these three are unimplemented and this one is now redundant with the first one so i'm going to drop it oh hey nagwe no because you weren't present i i talked up how great it was that you were contributing to lobsters and how you must be you know incredibly tall and generous and handsome, and all of these other positive things, like all contributors to lobsters are. But I said we would look at it on stream when you were around, because that seemed more fun. And so I fixed another bug. And then I am now making more bugs as I attempt to fix another bug of allowing users to, it's kind of debatable whether it's a bug or a feature request. If you can't search for C++, it's certainly a limitation. It is a correctly enforced limitation. It's just not one that users want. Ah, those darn users. nogweii "99 bugs on the wall, take one down pass it around, 102 bugs on the wall..." SingsNote
If we didn't have to take them into account, this would be so much easier. shurizzle Creating bugs is content for next streams
So all of this, yeah. creating bugs as content for next stream. You know, someone asked me if I thought AI was going to put programmers out of work, and I said, no, we're kind of extraordinary at making more work for ourselves.

02:38:47dr3ig i mean if they get rid of the users they might
So am I just expressing that s equals s to s, so that handles the nil, and I still want to strip to remove anything.

02:39:07If this is called with individual terms, I could just say if s.size equals 1 or s.size equals 2, return empty string, else s. re-implementing what that's doing without all of the regular expression stuff that seems like too much pain because it's not really hitting the right level of abstraction and if i don't remember correctly the script short term should only be given yeah see when it's a term that's an individual word a term all right that i think that's correct so now Does this spec pass? Wouldn't that be nice?

02:40:06yeah okay okay that's really good so now strip short terms removes the short stuff and leaves the long stuff and including can't no camel good all right now i am going to flip over and run this whole test file but in another terminal because whatever that other upstream failure was

...35it was pretty hard to see when it was wrapped across you know 30 columns instead of 100 and whatever this terminal is yeah there's our puts so the fact that that new assertion about being called with individual terms which spelled that the fact that That's getting triggered by an existing spec makes me think that that's not actually an invariant for the function. Search doesn't permit SQL injection. Oh, but maybe it's not. I think I actually just was testing weird things that invalidated the invariant, violated the invariant. That's a better way to put it. So here. This is the spec. Which spec is failing?

02:41:38There are some with. Let's fix that typo. That's so distracting.

...51Works on init. individual man i really typoed that word individual terms okay and now which one this is search spec 121. so if we go to 121 this one which this is doing this kind of simple table testing It's very nice, but has the hassle that you don't know which line of the test failed, and I don't want to write a whole other custom matcher.

02:42:46The cheap way to fix this to figure out which one is failing is to say,

...55Well, just print it. And whichever is the last one before the exception shows up, that's the one that's wrong.

02:43:12nogweii have you ever thought about integrating a debugger?
Let's go look. Oh, there's all this other output. Have I thought about integrating a debugger? Yeah, there is. I'm just not super comfortable with debuggers. So this one, it passed in go SQLite. Let's just run that individual spec. There's too much noise here.

...49I'm not super familiar with debuggers. I like to play computer in my head and run the program in my head and understand what's happening. I don't always feel like I understand if I'm running it in the debugger. And I see each run of the test suite, I try and make a prediction of, do I expect this test to succeed? Do I expect it to fail? What error message do I expect out of it? then that confirms or refutes my understanding of the program and for me that builds the really big mental model i can see how you can get there with most things so what's happening here is go sqlite is getting passed down to that character stripping thing, and the character stripping pulls out the hyphen, and then it passes go space SQLite, and then that assertion fails. So it is actually OK to have two character words. That's not a real invariant. I'm only like 75% on it, so I'm going to just comment it out for now. We might come back and do it later. But then it does mean that this approach is wrong again. But it's not totally wrong. I mean, the easy fix would be something like split on, is it backslash w is whitespace or lowercase w? nogweii lowercase
Let's say, I think there's a whitespace character class, right? Lowercase? All right. So let's go with lowercase. So if we split on that, and then we map each word. nogweii \w only matches ASCII whitespace, the character class supports more languages IIRC
Let's call it s. Just shadow everything. And then... I know this could be a Terminator. nogweii dunno if this search needs to be unicode
Oh, yeah, let's go ahead and... I think we're okay with just doing ASCII because MariaDB only speaks ASCII for this? Yeah, we do. So Lobsters is an English site, but characters slip in. People say asides in other languages. It would be nice to not smash their character set.

02:46:44Where's? Come here. Let me grab this up. So let's see. Ruby, if I search for whitespace, now search for regex. And then here, so backslash s is a whitespace character. That's the ASCII set. And then the character classes.

02:47:14This space. Non posix word.

...26I'm wondering if I should throw away word. Character properties, here we go. That's how I'm doing it. So I guess I want to say character property space. That seems the most universal one for this use. So swap that back. And I am actually happy to smash all white space to single spaces. I think that's OK. That's safe. It's kind of a balance between I want to preserve the user's input as much as possible versus I don't want the user inputting SQL injection.

02:48:20dr3ig `.filter { _1.size > 2 }`
Typo.

...27I have another typo. What don't I see? Dot filter. Ooh. Ooh, look at that. I see what you're doing there. And then we just rejoin it with a single space. standard rb you can space it out yeah i mean we're running three three one three three four in production so we definitely have that new style you know let's lean on ruby like that that's a fun one i've i like those implicitly named block arguments okay okay Let's see if the suite runs. That's not running in time. Oh, I closed the wrong thing. Come here. Cancel. No, not the one. I want the whole file. Hmm. Is it bad if I'm hoping for green? syntax error, unexpected plus. So that's positive, because that is the exact thing that we are trying to implement has come up. And if I were to take the plus out of here, because that's the line of code that's permitting it, I kind of rabbit-holed on tinkering with a couple of different things before getting back to the implementation there. Nagwe, assuming you're still present. Ah, nice, green. Nagwe, if you're still present, would you like to look at those PRs Thursday or in a minute? nogweii my schedule is very open
I don't know what your schedule is like. Because in the GitHub issue, you had said Tuesday, and I don't stream on Tuesdays. It's just a Monday, Thursday. Your schedule is very open. All right, let's plan on Thursday morning. We'll look at your PRs, and we'll write specs. nogweii Tuesday was a typo, Monday was the intention. But Thursday works, too!
And then so if we have this, good. So I can close that and go back to looking at this. See, look at that. That's the right query for that. The T didn't get stripped off. Tuesday was a typo. Monday was the intention. Okay. nogweii yup, no worries.
so i'm currently coming up on three hours which is you know in the two to three hour range is what i'm targeting for this and i do have after dinner plans with some friends so i can't stay on for five hours accidentally like i did a week ago i don't need to see this spec return i should probably add a default limit of like a hundred if you search for a word like can't you're gonna You're going to be waiting a while because there are a couple hundred thousand comments in production. So if this is allowed to search for plus, what if I just guess at how many levels of... It probably needs one fewer than apostrophe because it's not in apostrophes the way the other one is. I mean i'm just looking here, we can see what the test do in a minute, but if I search for C plus plus. Nothing I get an exception that is getting swallowed along the way.

02:52:39see if this gives anything more useful.

...51Lots of debugging, but still green. This is all very nice. We can even see the search happening for those. And they didn't throw exceptions. They just returned nothing. And they didn't even, I expected the print the SQL to fire. All right.

02:53:27change this to something innocuous. And it won't run, but maybe it'll let me see the query. Yeah. Okay. So it is going to see, and then we are getting that. So what if I just said, oh, thanks for standard RB helping a little there. So if I do that, okay, I can get C++. What does MariaDB think of this? Because it is possible that MariaDB doesn't like that syntax. I don't know what it thinks of quotes there, so I don't know how to avoid SQL injection. You just have an error. You're not allowed to do that. So I'm gonna be so annoyed if there's like no way to search for this. arh68 mat ch ???
arh68 SeemsGood
All right, so it is just mad at... Oh, oh no, it's the line break. Every time I paste stuff around, line break slips in. Yup, R, you got there too. Okay, so that's fine. And now if I said C++, syntax error, unexpected plus. Okay, what if I say, that the plus is allowed. What if I say it's really allowed? What if MariaDB won't ever let me search for a plus because it considers that a syntax error because it's got its own limitation? Hmm. arh68 +"c++" ?
Maybe it's not even possible, and this has just been a big rabbit hole.

02:55:33moogtrain first plus?
We can try that. We can try with quotes. So the first plus is... I moved train. The first plus is for... So that's false. The first plus is for in Boolean mode. You have to say plus in front of required terms. And this is a kind of failure because...

02:56:05Yeah, this database has a whole bunch of generated data, but then also real data. arh68 interesting
I refuse to believe that no one has mentioned C++. So at least it's not a syntax error, but this is not the syntax that MariaDB wants to see. So, I mean, I can try again with guess the right level of escaping, but that's not it. That's not it. So, hmm. dlamz what's the functional difference between MATCH and LIKE?
It's possible that I spent a bunch of time looking at the MariaDB docs and I didn't see anything saying that you can't search for punctuation at all, but it is totally possible that it throws it away. The functional difference between match and like is that dlamz ah
I don't remember no match uses the full text index, there is a. index on top of the query and match basically runs string dot include in a linear fashion checking every last thing and match actually uses the be tree index. yeah we go to. pushcx https://mariadb.com/kb/en/full-…
I should have linked this earlier on. Let me grab this and throw it in the chat and then also throw it in the scratch so that anybody who's looking at this can have that. So this and maybe I should have started here like an hour ago, but it really looks to me like there's no way with the MariaDB full text index to get it to search for punctuation. arh68 it's got the default ft_min_word_length ?
It's considering it, like I strip operators and strip out punctuation to avoid passing it bad stuff, but it looks like it's also internally doing that. And I don't know if I say, yeah, I can do an explain. Yeah, it's the default ftmin word length of three. And if you remember the MariaDB command to select out the option, I'm happy to look it up. But in production, what's happening now is it does not index one character and two character terms. That's why C++ was interesting because it's three, so we could support it.

02:58:48And so I'm kind of reduced to like, If I said Maria, DB, match, search for translation, regular expressions. Yeah, I know. Well, here's someone doing a similar thing. You need to be that specific. You can possibly change whether hyphen is public. See the specific settings. I think i've seen this I think i've seen this in Maria dp you can configure a custom character set. And in that character set you could redefine things like plus and hyphen to be considered word characters.

02:59:52arh68 "c++" would not be indexed cause it's only 3
arh68 but "c++20" might &c
Well, you couldn't have said how you dumped those. By default, collations tree space as punctuation. Yes, it is a custom collation. Now, three is indexed. If I search for comments that mention car. Oh, I don't need the explain. Actually, let's say cat. arh68 oh I see
Aside from having had one on screen, common Unix utility. Yeah, so you can see it actually ran in 1,200 comments mentioned cat. So three letters is fine. Yeah, plus 20, I would still expect, yeah, syntax error. And if I throw on the quotes, yeah, that's just not correct. Someone has mentioned it somewhere in lobsters, I'm sure. So this is... fmcalisto Hey hey
an issue I saw before of you can either modify the character set and create a custom character set to say that you, you know, it's literally the example I set out loud a minute ago. And then I remember looking into this Hey, FM Castillo, you're coming in at the end of the stream because we were just figuring out that this bug basically isn't possible without because MariaDB considers this thing. Yeah. Oh, that's not bad. So if we say show variables. Yeah, so I've just got the default there. pushcx https://stackoverflow.com/quest…
And I could go ahead and add a character set. Stack overflow answer is pretty great. I'm going to grab this for anybody who's curious and throw it in there and then also throw it in scratch. And let's come here. Yeah. So we're here and I want to say we're using. I want to say it's Latin one, but that might not be right. There's got to be a way to get that. I just wanted to look at one of these files and see what's involved. Oh, yeah, that's totally human editable. Oh, you love XML because it's always clear what things are, right? Oh, boy. Yeah, so here's the various collations.

03:03:00That is a very... So it is literally listing the various characters that fit into the character set of lower, upper... then this must be updating the word characters with various punctuation characters but it's copying the whole thing again oh boy so maintaining this maintaining this is going to mean duplicating this and then trying to remember to occasionally diff against this but at least it doesn't require recompiling MariaDB. Which, you know, I'm willing to make some weird config files and add them to Ansible and put them on the server. I am not willing to run my own MariaDB binary in prod. And this stack overflow answer is really excellent. The person has talked through all the various steps to add a custom character set.

03:04:26So they show looking around, grabbing the hex character equivalents. Got to figure out, I know there's stuff like, This for finding plus and hyphen here, or here is 2B and 2D. And so it would be grab that, find the right thing, insert it, and then recolate the index. Speaking of queries that are going to take hours to run, dr3ig i have an idea, let's rename tag:c++ to tag:cpp
it's not the the four day query that dpk wanted to run for checking common passwords but you know dpk are you still here no you another way to approach that query would just be to check it at login it doesn't get all the users it just gets the ones who are actively logging in but it's A lot easier when you can just see the password in plain text.

03:05:51nogweii I think C++ is not indexed since + isn't treated as a character and that leaves a 1 character string, "C"
Yeah, that's going to take a second.

03:06:02Yeah, Nagwa, you're correct that C++ is not indexed since plus isn't treated as a character. dlamz Django for instance bundles the top 10k most common passwords and rejects them at sign up I believe
arh68 ya this is the way
This whole fix with creating a customer character set, there's the Latin one character set. This ships with the coalition. Yeah, DLAMs, that is very nice. Django includes that. Rails really only recently, maybe two years ago, got serious and added a I mean, I want to call it a type, but it's not quite a type, but got a little more serious about the way it manages passwords so that it just does the right thing out of the box instead of, you know, gives you the Lego kit. It's kind of funny that that one was delayed a minute. So Nagoya, the way to, the thing I am considering to change this would be, all right, so take this file and add that. Whatever I said the ASCII values were for plus and hyphen, 2B and 2D. That's weird. I see 2B and 2D here. They are definitely not uppercase characters. So there's something more happening here. That is not something I'm going to do on stream because that's a weird amount of research. And I feel like we're at time. I think the thing to do would be to... go back to the GitHub issue and leave a useful comment about what the heck is going on here. Because this one turned out to not be, hey, let's tweak the MariaDB character and call it good. It's so much more. So can I bring this on screen? Yes. That is safe to bring on screen. All right. I have a whole setup in my window manager to try and make sure that I don't accidentally bring windows on screen. So I have to focus the window and hit a keystroke to mark it as acceptable to allow on stream. And then it appears kind of in a holding area, but obviously running a little better on this stream than the previous ones for the amount of weird shit I've flashed up. Oh, fuck. I actually wrote out this answer already. Boy, I should actually read these whole posts. Recreate a little effort. Okay, so.

03:09:19All right, so now let's figure out the state of my repo and what's worth saving and what's worth throwing away.

...39So this is punctuation stuff. This is a nicer version of this, and I think I want to keep it. This is debugging. This is also throwaway. These are more specs that I want to keep because Those are perfectly good test data. And then this is also acceptable. So despite spending a little while to remember the collation character set issue or solution, I ended up writing a bunch of useful specs. So this is pretty good. So let's... But none of the attempted code is worth saving. So I'm not going to make a branch and push it up. I'm just going to drop it on the floor. So let's grab some of this stuff. So this... Let's edit that. We don't need... Oh, got to split. Hold on. Let's try that again. So no... oh yes split yes no can you split that no because it's all new code let's edit that this is not a real invariant so we'll throw it away and then i ended up with let's i added too much to this one let's do that again

03:11:32split so this i don't want to stage definitely don't want that this is the one i wanted to edit and we can throw away that comment and that comment no all right so let's commit and every time i do like a patch ad i have to review it very closely that's fine So let's see issue number 1268. I can just say it up here.

03:12:28i see so much for imperative tense trying to explain why i got to where i did so what does this actually do this is better filtering search dot strip short terms this got better filtering and tests right that's all of the stuff that changed yeah it really is just more tests

03:13:05And I'm going to go ahead and commit mostly so I can drop this stuff on the floor. Yep. And now let's see if the build runs. And if this goes green, we'll be at a pretty good spot. If not, there may be a small fix or two needed. But this is mostly adding test code. It did change the implementation of strip short operators or strip short terms. And there's always the possibility that I managed to save a file and close it before standard got it. And it's embarrassing if I commit stuff that breaks the build. I try not to. But I do just enough weird stuff that I don't want to make my git push alias force the build to run. Cool. So there's two more commits. And let's just go ahead and push those. And I might as well deploy those. So I'm going to hit the button on deploy. If there's any last questions or anything, we're winding down here. This takes, I don't know, what was I griping? It takes two and a half minutes to run, two minutes to run. We'll see it here. All right, so that's fine.

03:14:33dr3ig is the ansible script designed to run on a brand new server box?
I can go ahead and close out the Rails server and never ended up using that. Scratch file's all done. So that'll go up on the stream notes. I'm going to get a glass of water, stretch myself out. But I made a whole, I joked about overengineering it. But on my blog, I really overengineered the whole transcript thing. Yes, the Ansible script is designed to run on a brand new server box, including we have two separate VPSs, one for running the web workers, which is Puma that you see going by now with Nginx in front. And then the other one is the database server that just runs MariaDB, because those things kind of scale separately. It is designed to run on a brand new server box, but that happens so infrequently. I would not be surprised. dr3ig so a lot of tasks are NOOP on each deploy?
I would be a little surprised if it worked on the first try, but that's okay because it is enough for disaster recovery. If this was a commercial thing that was constantly scaling up and down, it would just work because it would get exercised. And yes, a lot of tasks are no ops on each deploy. So in the Ansible output, if you're not familiar, if you see green, okay, that means it got to skip that test or task. Oof, can't talk anymore. If you see a yellow change, that means it detected that it needed to run stuff. And you can look at, what is it? Roles, lobsters. Tasks main.yaml. The Ansible repo is public. It's up on GitHub, so you can find that. And you can see how it considers a task to be changed and needing to run. And some of them are based on other tasks. That's about that. Got a good couple of fixes in. That was nice. All right. I'll give maybe another 30 seconds for any more questions or anything else, but otherwise we're pretty much there. Let's go ahead and grab that.

03:17:02Put that in the notes too. You can never have too many notes. All right. Well, thanks very much for joining me, folks. It's been a lot of fun to answer questions and code live and not too terrifying anymore now that we're a few into these. So thanks very much. arh68 PopGhost cool stream
And again, if you know anybody at Twitch I am trying to get an API key, please introduce them and introduce me to them and tell them I am safe and can be trusted with API keys. arh68 take it easy y'all
I want to make fun integrations. I want to make silly integrations. I'm not doing anything evil. Okay. Take care, folks.