From civil penalties import unit

Streamed

scratch


topics
x $50M USD for Australia?
    https://theconversation.com/australias-social-media-ban-for-kids-under-16-just-became-law-how-it-will-work-remains-a-mystery-244736
    https://parlinfo.aph.gov.au/parlInfo/download/legislation/bills/r7284_first-reps/toc_pdf/24150b01.PDF;fileType=application%2Fpdf#search=%22legislation/bills/r7284_first-reps/0000%22
x Thanksgiving holiday read: https://lexi-lambda.github.io/blog/2019/11/05/parse-don-t-validate/
  PR review
x   action mailbox https://github.com/lobsters/lobsters/pull/1326

    https://github.com/lobsters/lobsters/pull/1388
  rails credentials
  story merging

strip_operators:
  formats
    foo -> foo
    can't -> can't
    foo ( bar -> foo bar
    foo ' bar -> foo bar

https://shows.acast.com/dead-code/episodes/015-twitching-hour-with-rachael-wright-munn


title:

post-stream:
    

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

Recording



02:19Oh God, we're having eight people for dinner. So including us, that's 10. So there is still plenty of prep to do, but I wanted to keep up the stream schedule. So speaking of the stream, this is Lobster's office hours. And let's grab the browser up. Is it the first thing? So Lobster's is a gsora_ good morning!
Social media website where people can talk to each other and Hey G Sora, good morning And what a funny morning so I saw in the news where would I just see that was it I Let's pull it off of here. Oh no, it wasn't here. It was... Yeah, I don't have bowling candy, do I? Really prepared. Totally professional. pushcx https://theconversation.com/aus…
So I was going to grab the wild bit of news. gsora_ oh hckrnews looks great wow
This was the... saw a couple links. And pop up aside, this was the most interesting version. pushcx https://hckrnews.com/
Yeah, I really like that. If you haven't seen hckr news, I don't know how I found it. But it's basically a filtered version of what we would call slash newest. And I don't know, it's... I really like that it has the horizontal line for here's where you last read. Although it is possible for things to pop in under it. It's uncommon. And they pop in under it because, you know, you view at 10 a.m. and then at 10.05 a.m. they make it to the front page and then you come back at 11 and so the line will be... Or wait. Maybe I'm saying this backwards. So after you've you anyways, the the order is based on when they're posted, not when they made it to the front page. And so it is occasionally possible for things to be under the line and new, but it's pretty rare. And I go on about that horizontal line because here on stream a couple of months ago, I added the horizontal last red line to slash newest. gsora_ re: the social media australia news, I don't know if I trust tiktok with my driver's license
And that was pretty straight based on this front page for Hacker News. I like it a bunch. It also just keeps me from refreshing the front page of Hacker News. I'm aware I nominally run a competitor. Maybe it's a nominal competitor. There's not a lot of actual competition in social media because everybody could be active on multiple sites, but people kind of assume that there is. gsora_ re: hckrnews i like the aesthetics, will try it for a while!
Also, if it was an actual competition, lobsters would be losing very, very badly. Or something like 1% or less on any metric you care to count, like traffic or number of stories or anything. But I enjoy reading Hacker News and occasionally post there. And I like the slash newest kind of approach because it keeps me from just rereading the homepage or digging back into stories to see more comments and more comments. It's also why I mostly read Lobsters by slash newest and active and the mod dashboard. So yeah, Jisora, this other link, I pulled up Hacker News at the start there because that was where I first saw it. And then I found this link that was a little bit better. And the most valuable thing that, man, I am not the king of journalism. I mean, not that I ever was, but I have actually worked in journalism. And so my pet peeve is if you are going to talk about a law, or talk about a court case you have to link to it for the love of pete so this one the where'd it go that was kind of bookkeeping stuff so i'm real i'm real cautious of playing lawyer especially cross-country because So much stuff that just looks like regular words turns out to be legal jargon and has special meaning. And so many laws and contracts assume some basic knowledge of some legal precept that I'm oblivious to. And so it's really easy to be like, well, why don't you X or to miss? something is implied i don't have a great example off the top of my head because i'm talking about things i don't know about but i've seen it enough times that you know i've asked a lawyer can we include this clause and they're like no that's illegal under the sobody so act of whoever and i'm like well really and they're like yes and then also it was litigated in smith vs ferguson and you know you just don't know this stuff but the The gist of this one is pretty short, and all commentators, whether they are legal or journalist or otherwise, seem to all be saying WTF at this. So I'm not super freaked out because there's a, like, We are ordering ourselves, what I believe is ourselves, the government, to come up with guidelines for reasonable steps to prevent, when it says age-restricted, it means 16 and under, or I'm sorry, it means under 16, from having accounts with age-restricted social media platforms. That is a new term this bill makes up and says it means anything that this bill applies to. And that's the meat of it. is right here and this part is pretty small so the term it invents is age-restricted social media platform and if the sole purpose or a significant purpose of the service is to enable social interaction between two or more users that's certainly true of lobsters the service allows end users which Why are they called end users instead of just users? I don't know. Allows users to link to or interact with the other end users i mean that's a like yes social interaction is interacting so this one's kind of redundant but yes the service allows users to post material on the service well i mean yes you can leave stories and comments and even direct messages on lobster so yes such conditions if any are set out in the legislative rules I don't know what this means. Maybe this is a, we're going to punt it to a, what's it called? The government office for making every forum into a nightclub. Whatever that bit about, you know, setup guidelines was earlier. So I don't know. I am admitting right up front, I don't know what part of this means. And this could be a pretty big escape hatch. But this is so weird of, we're just going to assume that gsora_ what is a penalty unit lol
social media is bad for people under 16 and where is it oh yeah there's a bunch of so it's in legal jargon here of 500 penalty units which sounds very very video gamey but The important bit is that translates to an Australian $50 million fine, which is $32 million to the United States, if they don't take reasonable steps to stop people under 16 from having accounts. So the penalty unit thing, my guess would be, like it sounds a little silly, but my guess is it's a way of standardizing penalties across legislation, like this is just an abstraction. This is the legal equivalent of a variable. I've thought for a long time that the law looks a lot like code if code had, if you could argue with the compiler because it was just a guy, and if you had basically no tooling and 400 years of legacy code to deal with. So, this is like, from civil penalties, import units. Yeesh.

12:47I suppose that'll, I don't know. Maybe there's a... Maybe they shouldn't have written the whole penalty unit thing and there's a Yagney thing, but maybe it'll be really, really helpful if they ever have to replace their currency entirely. They're going to drop Australian dollars and switch to the yen or something. And then all they have to do is update that one define, and I'm sure none of their legacy code will break. So this one's not super urgent. There's like a year before it takes effect. And there's this stuff about where the link to the PDF go. I want to put that in the notes. There's that stuff about we're going to pass it off to the other government department for research and implementation and guidelines and stuff. So we'll see what this looks like. But it's just so weird. I had to mention it. I'm aware that this is politics and I try and stay out of politics, but this one very directly affects the site. The whole thing where, some random government decides that it's going to make a law that applies to every website and every country is, it's not scaling well. And it's not that Australia, I mean, Australia is the size of, population wise, is the size of a medium US state. So this isn't, you know, a small Pacific atoll or something.

14:44The whole thing is very strange. I would like to not ban Australia. I would miss Australians. So all that aside, I wanted to do some pull request review. Oh, you know, let's swap that around. Do a little out of order. I can do the other small bit, which is this is Thanksgiving. The US holiday with, I mean, every US holiday everywhere has a complicated history. So we're going to skip the meaning of the holiday. and talk about the practical meaning of the holiday, which is have nice food with folks. Try and remember to enjoy things in your life. Don't ask lots of historical questions, because you probably won't like the answers.

15:42So hopping back here to code, there was no movement on this one since the last stream. That's OK. And then action mailbox, you might remember a week ago, I left a review for this one. So I wanted to check in on this because GMM had a minute to look at my couple of comments. I have glanced, but I didn't actually read his replies. So there was the one Okay, it says outdated, so presumably he incorporated that change. And then I would suppose he rebased because there is a bunch of stuff here. Yeah, force pushed. Sure. So let's give it a quick skim. The other thing, I don't see the comment, but it must have been rebased out, was there was a to-do comment left in the middle of the mailbox code. And if that is gone or explained, I will go ahead and Yeah, so the to do was right here. And I guess there wasn't anything extra. So we figure out if it's a comment, we figure out if the parent is a comment. If stuff is broken, we'll just kind of drop it in the bounced queue. We have to look at the man years ago, I made a ruby project to process mailing list archives because occasionally i like to read them and so it would take a directory well take email in a bunch of forms and then try and figure out the threading which was fairly complicated yes i've seen jwz's algorithm it is imperfect but a great start and then Every email client in the world. It's funny. Email is one of those long live standards where as soon as you open up the hood on something where you're like, this should be reasonable. If you click reply in an email, how do I know which email you're replying to? gsora_ what's email? you mean asynchronous slack?
And then you just immediately fall into 40 years of legacy compatibility. Actually, it's longer with email. It's gotta be about 50 now. Asynchronous Slack. Oh, man. Slack is one of those apps I find a different bug in every single time I use it. They drive me up the wall. They keep putting all of their energy into weird collaboration features and then the actual, but it's a chat room. I should be able to chat with people. gsora_ i generally had always a good time on slack (for work), it just works... provided you use it in the browser
chatting features just don't work and are buggy and like i can just watch the ui slide around the app taking 200 milliseconds at a time to like update three or four times as i change from one channel to the other it's just it is the weirdest case of management prioritization where I expect that they just keep wanting headline features to close deals instead of making the core thing work. Provided you use it in the browser. No, I can... I've seen so many browser bugs. Their app is jankier. I agree, the app is jankier than the browser version, but Oh.

20:00That's a totally reasonable couple of regular expressions. pushcx https://lexi-lambda.github.io/b…
Looking at these, I just reread that classic... Actually, that would be a good one. If you have the day off... Here's a classic five-year-old, but still just such an excellent blog post about... structure and code it's probably a little more complicated than you could read while listening to me verbal along so just mute me if you want to read it right now but otherwise save it for the it's a great holiday read i'll put it on the let's bring the show notes back up

...58She just really nails, with some clear examples, a great idea for how to think about code. And it's one of those where, as I've interacted with junior developers a bunch of times, they say, oh, well, you know, I'm writing X. And in my head, I can see like eight ways to write it and then I can't explain why I like one over the other and working with junior developers which I started doing more of maybe 15 years ago forced me to introspect a lot more and think about what it is that I like about a design versus another design and how do I explain that and explaining that forced me to get more rigorous about it and clear about the values even to myself. So working with junior developers really made me a better programmer. And this led to, mostly that led to the RailsConf talk I gave in, what was that, 2015? And this Lexi's post here is exactly in that same vein of let's think through explicitly what's going on with this intuitive design decision. so i i just love that post it's a favorite all right so this is this is the wild regular expression feature that i suggested so that's in that's fine i occasionally get tempted to uncomment action text and if we weren't a website that is aimed at programmers who are i feel like markdown is ubiquitous enough that pretty much every programmer is comfortable with it. But action text is a little tempting. All right, so there's that. There's this.

23:05Active storage attachments.

...13Oh, there's a topic. Didn't put it on the stream topic list. So I'll think about this. I'll put it down for after. Might be worth talking about Rails credentials. So I see a few viewers have picked up real quiet here on a holiday. But since this is Lobster's office hours, if you have any questions about the site or the Community or the code base feel free to ask any kind of questions. And even if you want to. should probably put it in the channel description right like the queries thing of if you want to run queries against production database. We can even do that. Then these tests are all the same. This is great. This is ready to go. There's that GitHub thing.

24:46This is actually, I'm thinking about this. This is safe to merge down, right? Because until I go in the Ansible repo and change over the, geez, Sora, any chance you're here? Or I'm sorry, GMEM. So many Gs. a hard time remembering the difference between gsor gmem and gwasniak all right yeah i can just merge this down because until i wire up postfix to deliver emails into it it's just going to sit here and hang out and then also i can test it from the command line myself by Putting an email in the post fix. No, go a step higher. Yeah, so I can test it in prod before. And I don't think there's anything wrong with this pull request. It's just before I change over, I would really like to see it work because there's always those prod plumbing issues. That was the work from a previous stream I deployed that I just remembered a minute ago was I occasionally joke about how some of these raise the hair on the back of my neck or feel like they're more likely to break in prod and had a funny experience where the one I thought was going to break prod was totally fine. And then the other one did break prod a bit. That's okay.

26:51Not really.

27:02Great. This is so nice to have this Rails plumbing done. It's funny, a big theme of

...20A big theme of these recent pull requests has been leaning more and more into Rails features because Rails has picked up features for things that we had to do custom. And

...50As much as I've been pushing hard for it, the one place I really am increasingly tempted to lean away from it is Flex. pushcx https://beta.phlex.fun/
Flex is a beta. The 2.0 release candidate just came out a couple of days ago. I know I've mentioned this on stream before. It's... let's see how did i put it in that other so it is a templating library for ruby that allows you to just sort of It would replace er be an er be is a big pile of strings and not integrate way. pushcx https://bsky.app/profile/push.c…
So I said it over on on blue sky that. There was this thread I really liked let's grab this i'll share this so folks can click around Joel dropper here is the primary author of flex and. I said it's just Ruby in all the right ways where it has less mental overhead because there's less stuff happening. You're not context switching between strings in multiple languages. It's composable because it's Ruby. It's reusable because it's Ruby. The tooling, instead of we get no linting on our ERB. I've been hesitant to add it because it's really complicated. the value is maybe not there. And then Joel also had a talk about safety where because flex really does not work by slapping strings together in the way ERB does, flex allows a lot better safety around cross-site scripting. So let me jump in. Come here. Where's my... I always hate these floating headers and footers that cover the page. So Flex has no dependencies. It's 2100 lines of standard Ruby. ERB is not 2150 lines and it is not small and straightforward. I've gone into the ERB code base a couple of times and it's not bad. I'm not trying to insult it, but it is complicated. It is a little bit of a climb and I've read a little bit of the flex code and it's just, there's very, very little magic. and so this person came along and had a couple of questions around what things look like so they wrote themselves a helper called simple table or maybe this is from some gem i've never heard of called simple table it doesn't matter where they passed in some records and then i guess they have columns this is the list of columns and then it's going to iterate over the records and print know for each record call record.employee or record.unit price and then build up a table which okay like this is fine but it's sort of like is this really erb at this point no this is pretty much just straight ruby the only erb feature that's getting used here is We're going to call these functions and slap them together. ERB almost might not as well be used here, but you have to have this special syntax before and after.

32:04Yeah, it's a partial. So this is, he says ERB, but he means action view here because this whole thing with how render builds on this stuff is, happening in action view not erb and so joel kind of ported his thing to all right well like if you just made a simple table component in flex this is what it would look like and it's basically the same code where it's like okay well we have all these records we're going to loop them we're going to call the block for each you can imagine what this is going to look like he doesn't give the components but once you've read the 101 for flex you can kind of write them in your head and he gave maybe a slightly better example where this is what the flex would look like and this is what the erb would look like and i think that he liked that in the erb you're just directly writing the HTML. It's kind of nice to be direct, but then again, you have to know this syntax and you have to know this syntax and all of this is string munging. And so like right here, either Action View and Brakeman protect you from CSS injection or they don't. and it's not at all visible and they have to know the context and you're kind of guessing that because this percent equals you could use it here in html text or you could use it here in like you know tr class equals column dot whatever and so joel did this really clever comparison where on the left here is the flex version of Well, if you kind of uncross your eyes, what actual feature is happening on these lines? And you can see that these method calls and the IVAR lookup and the block, these match that list of thead, tr, td, at column, .each with a block, right? You can see the shape of it matches. And he says, well, there's one language it's Ruby. You don't change to another language. It's a little bit of fib. You got to know that you're outputting HTML, but that's, that's okay. That's fine. I have our lookup. You do one of those, you have some method calls. So you're not using a lot of language features. This is a smaller vocabulary. And then on the right, here's the ERB version that Gregory gave where There's the raw string, the raw string. Then after this syntax, you're changing into this ERB context, and you have to know that ERB can handle what's effectively a string of Ruby that's going to get evaled. And then this end down here, you know, if you've never looked at the ERB source, it's worth looking at because something very clever is happening to make it possible to like eval code with a raw string in the middle and run this all together. If you haven't, it's really worth a read. I don't want to deep dive it now because I'm trying to keep this stream short because I've got to like put some buns in the oven and that kind of stuff. But just an enormous amount goes on under the hood to make that work. And it's weird to look at where you're switching languages. And I think Joel correctly highlights it here. Well, you're working in two languages and I think you were before, but you change in and out of the languages a bunch of times. You use a whole bunch of different elements. You've got different syntax. You've got the same amount of eye bars and lookups, but you've got all this extra stuff on top. So as much as I'm yassifying the app more and more to be closer and closer to just stock Rails, I keep getting tempted by Flex.

37:08One of the things that's really impressive about flex is and i've played with this a bit it's really easy to you don't have to do a big bang migration, you can do a partial migration like one component at a time. So that is the siren song that keeps singing to me and pulling me away from rails aside from the general annoyance with rails and. That one guy who keeps wanting attention. I'm not going to rant about him on stream. So got two pull requests from a first-time contributor, Ashwin47. Oh, what a super forum. Turn your Discord into an open forum. Oh, interesting.

38:11And I guess it's something that he is actively working on. That's pretty clever. I suppose he likes forums if he's over here contributing. So I peeked at his pull requests. And this first one is searching. where it's kind of a parsing hassle. But I've been trying to throw in different shapes of feature requests and bug fixes to the issue tracker. Because a lot of stuff just hangs out here and people don't pick it up. But the things that are kind of plumbing-shaped or have interesting CS puzzles people seem to pick up and like them. So I'm trying to post more of those. So this one was, it would be neat if when you search for stuff, it had mark tags around it to highlight it. But there is one big hassle, and I wrote about it here at Corner Case. If you search for not a single term, but a quoted term, that ignores punctuation that are in the original markdown, let alone output in the HTML. So if you search for a phrase that is split across elements, it would be really nice to still highlight that. search engine can't just be find the text in the page and highlight it.

40:15However, Ashwin left a comment that they missed that corner case. And so they he did do the kind of naive version of it.

...34So, you know, painting the bike shed a less nuclear color would be nice. That's fine. That's not a big deal. I like that he softened the corners on it though. So basically he takes the search terms and he makes a regular expression out of them.

41:08and then joins stuff together so that it gets one regular expression, which, all right, this is pretty reasonable. I'm a little suspicious of this and would wanna see a test or two that punctuation would work. It really encodes a assumption about terms I suppose regex.escape handles it, but then there was something else that didn't. So we added this highlight search terms helper. And then there's a bunch of stuff to thread it through the various functions or the various templates.

42:13And it really caught my eye that he calls strip operators here. I got to go look at the search model. So I started the darn Vim from the wrong buffer. Come here. I'm not going to chase that around all stream. That's my blog directory. I mean to start it from the lobster source code.

...50So we have a search parser that kind of parses an AST out of the search to find operators like searching in the title. And it splits things out into like terms and quoted, which are the parts of the search for how to search them. And then strip operators is my least favorite part of the code. So I was really surprised to see it mentioned because

43:25hejihyuuga Hello pushcx and chat
This is not the same abstraction as... I mean, this is the... Oh, hey, Hedgie. hejihyuuga Happy Thanksgiving to all who celebrate
So I was talking about one of the things I liked about Flex is it can do context-aware escaping. And this is sort of the opposite of that, where it's just kind of slapping strings around. And so... I'm just trying to match the database's ideas of what characters have to be escaped when you are searching in a string in Boolean mode, and then it's nested inside of quotes. It is so hard to trust this code. I've put enough tests around it that I'm comfortable with it in production, but that it's actually an unusually large amount of tests for our code base and I hate that SQL is a string instead of a structured thing. If somebody would like to port link to Ruby, that would be very nice. That's almost Ruby object mapper, but yeah. So I was really surprised that he calls that strip operators. hejihyuuga Linq is probably my favorite part of c#
I think he's trying to get to switch between what is the user searching inputting? Yeah. I mean, my favorite part of C sharp is how they keep stealing functional programming ideas from F sharp or not stealing, obviously, porting, migrating, translating. And link is one of those and it is such a good idea.

45:36I suppose this is the one place in the code. So it tracks the input, that's Q, the query variable. But it doesn't really have an internal abstraction layer of how that translates into a query. This class kind of is that abstraction layer. So I guess that makes sense that he called strip operators. To know what's the thing that's going to actually end up in the query.

46:18Just. There's something about it that rubs me the wrong way seeing. So let's think about what it's going to do. So if somebody searches for.

...49It translates, or I guess it escapes, what do we call it? Formats. Foo to foo. Kind of build up a table here. Like if you have an input with nothing interesting, it's just translated. If you have can't, let me get rid of these quotes or this is going to become confusing. That still becomes can't. if you search for like foo bar that turns into foo bar we do not pass that punctuation through and then obviously the the scary one is something more like this where if someone passed a single quote or a double quote through we really We don't even want to try matching the perfect level of escaping, especially because it's just going to get thrown away. And so when we're choosing what to highlight, when we're choosing what to highlight on the page, if come here let's go look at the text here again now i would like to see my example so if someone searched for types comma whatever

48:49Or if they just searched for types comma. The actual search executed would only look for the word types. And I think it's better to highlight and not include the comma. Because we're not actually using it anyways. So here in my demo. And I generated this demo by just editing the HTML in the inspector. You know, there's another possibility there of what is making some of these recent issues more attractive than others. And I guess one of the issues or one of the differences here is not just you're playing with the parser. It's kind of a CS problem, but also There's mockups. It is very clear what the output is going to be. So I made this by hand and I highlighted the period just because it was there and I was thinking of, well, if you found the start of the search term and then you found the end of the search term and you highlighted everything between you'd be fine but if they had highlighted just correctly and sometimes it's a little funny that that period would be hanging out here and if we imagine that they were quoting a fellow gen xer who ended with a ellipse you know so if this ended dot dot dot it would be a little more obvious that the dot is not getting highlighted, but that would be fine. It doesn't feel like it's incorrect or misleading. We're kind of indicating what actual search happened. I think I'm talking myself into the use of strip operators being okay. And the result of finding these terms without, yeah.

50:58Yeah. Okay. All right. So if strip operators is fine, little weird, but fine. And I see. would the parentheses get highlighted?

51:39Because they get escaped, but these get thrown away. Yeah, I don't understand that test. And I have to come back to that.

...56Yeah, I think my only gripe is

52:03gas strip operators is public it feels weird yeah all right so update the search model so that it exposes

...32I guess the thing that confuses me here is it's using params very directly instead of using the search.q. And it is readable, so yeah. Let's just go ahead and make that a suggestion. I guess the part that really There's like so many layers of abstraction happening.

53:14And then does it make sense for...

...25So strip operators works on a single strip. works on a single string, you can't actually pass in an array like he does.

...45Yeah.

54:08Yeah, I guess the thing that most bugs me is he's kind of recreating some of the search work. So here we build up this terms array when we're doing a comment search because there are many kinds of operator. And I think what we actually want is to say. Let's loop the parse tree. And for the term or catchalls, we'll call strip on it. And then, yeah, all right. So what was the name of that function? I can see it off screen.

56:03So. Actually, this should just be on the. Yeah.

57:34operators all right

58:25Maybe...

...37I'll let him come up with his own name.

...54There we are. Hopefully that kind of nudges him towards a functional style. I don't think I need to be explicit because I can see a few ways to do this. And if it's got a good abstraction on it, it's okay.

01:00:09There we go. I'm trying to I am hedging a little to avoid saying you have to deal with quoted for this PR versus I will take it without I'm not totally ready to commit because I can't imagine yet what the whole thing will look like.

...31This is this is a pretty decent start.

01:01:15We'll strip out that punctuation.

...29So.

01:03:03I guess part of this is, let me say that

...36The understanding of search syntax out of format term stays within the search. I can hear my spouse starting to knock around in the kitchen. So we're immediately starting to wind up towards the end of this stream, even if it's only been an hour. I'm not gonna hang up in the next five minutes, but in the next 30, So let me, yeah. Okay.

01:04:19I think if I look at the spec for the search model, I think the other thing would be This doesn't permit SQL injection.

...47This was such an unfun test to write because I am searching for inserting quotes into a string that is quoted multiple times. And then in the spec, I have to write quotes around my search. And so it's just how many layers of escaping are there? ah this one as a fun actually all these three oh i even left a comment these are real things people run vulnerability scanners against lobsters all the time and the way the vulnerability scanner works is it sees a box with the word search nearby and it starts stuffing random strings into it and it includes so it's trying to do sql injection here and these the thing that's happening with these random strings like this or these random values are the bot is checking to see if on the page that comes back from the submitting the search form do any of these appear Because if they appear, it kind of implies that you have misparsed the query.

01:06:25Yeah, here's the other one. So on the other hand, it also makes your queries really, really stand out in the web log when I see you searching for gibberish. I understand some of this is just the background radiation of the internet, but also this is... We're a nerd-oriented site, so nerds are like, I need an example site. So we get a lot of, like, the first web crawler someone has ever written, with no rate limiting, no robots TXT, no anything. Ugh. And we get people who are like, what's a vulnerability scanner? Oh, I just installed one. How do I use it? Oh, let me run it against this website that I was just looking at in the other tab. And then they run it against our prod, which is, it's real rude. That's also a good way to get your IP banned.

01:07:28And I'm real aggressive about if production throws an exception, I'm going to fix it. There isn't because our site traffic is low enough that you know I don't really worry about the is it a one in a million ram got hit by a cosmic Ray kind of error that thing happens at scale. doesn't happen at lobster scale. I have seen one or two things that were. strongly indicative hardware failure on the client.

01:08:04So at this point, vulnerability scanners don't throw 500s. They do make me annoyed if I see them though.

...31I don't want this here.

01:09:00chaelcodes Hi! What are you working on today?
pushcx https://github.com/lobsters/lob…
chaelcodes Is there supposed to be music?
well actually does he need any for sql injection for highlighting no as long as strip operators happens internally i think that's fine because this is just this is just highlighting yeah hey chill so i am reviewing this pull request right now which is my own feature request for highlighting search terms. Is there supposed to be music? No, why? Do you hear some?

...38Oh, I think... Chael, you're like a popular streamer, aren't you? chaelcodes No, it was just mentioned in the rules.
As opposed to, you know, me, a yutz. I think I started following you on Twitch recently because I heard a podcast interview with you. chaelcodes LUL
Was that you or was that somebody else? chaelcodes Thank you!
chaelcodes Yeah!
chaelcodes There's a bit of lag.
chaelcodes I'm on mobile.
you on the dead code podcast no it was just mentioned in the rules okay but you do stream code right okay yeah i've clicked over i have an off-screen browser i've clicked over your i see you do A bunch of stuff. You're on maternity leave. You aren't the person I just heard on the... Now I have to find it. So I ran into Jared Norman earlier this year at Madison Ruby. Ah, okay. Yeah, this is you. I did just hear an interview with you. pushcx https://shows.acast.com/dead-co…
chaelcodes Yes, that's me, lol
This is why I was following you, is you were just on this podcast and talking about how streaming has meant a bunch of opportunities in your career. gsora_ that's a very black metal podcast art
This was a really nice, let's share this in the chat and I'll stick it in the show notes. Anyways, thanks for dropping in.

01:11:25you know it's not just a very black metal piece of podcast art he actually commissioned a musician to make a little like metal bumper and so it has someone doing the screamy metal voice saying like dead code and then like playing really heavy distorted guitar so chaelcodes The intro is so rad
The first couple of episodes, he didn't know what a compressor was yet, I think. So the first couple, like the first three or four episodes, his metal intro is a little bit loud. I mentioned if you're sensitive to that. And then he started working with Mandy Moore, who is a... gsora_ listening to the intro right now, it slaps
sort of famous tech i mean to me tech podcast producer and as soon as she came on board his audio took a step up in quality yeah yeah it does slap oh do i actually have i think i have desktop audio wired up and i could probably play it but i'll i will just let's see if it works so if i unmute that and that gsora_ i can hear something!
I think it'll... A little excerpt. So, it's the... It is definitely not wired up correctly because you are hearing, especially if that was faint, you were hearing the, my monitor is playing the audio and then my microphone is picking it up as it reflects off of me. So I'm not gonna debug audio on stream. That's a little too painful. Also, it's gotta be a trip for, Chael codes to hear me playing an interview with her. chaelcodes YEAH
So in any case, where I was going with that Chael is if you want to start streaming after me, let me know. chaelcodes YEAH IT IS
And because I'm getting towards wrapping up in like 15, 20 minutes and I will throw over to you or raid. Yeah, when I had to start When I started giving conference talks and I was like, OK, well, now you have to watch your own conference talk so that you can improve. That's such a trip. chaelcodes Oh no, I'm feeding a baby and celebrating Thanksgiving.
And doing it with streams is even worse because it's just me talking to an empty room for hours. I've watched one or two of those streams. That's OK. Your baby can code on stream. congrats I hope you're having a good holiday actually. chaelcodes Hot tip - you don't HAVE to watch your talks. You can avoid them forever.
I am so i'm going to roll out in a bit because we are also hosting a thanksgiving and there's plenty of prep to do, although we didn't most of it over the last couple of days, I feel so adult like we weren't up all night the night before a big dinner party.

01:15:00No, I have to watch my talks so that I can get better at them. And I don't watch all of my stream playbacks because it's like, all right, if I'm doing like six hours of stream a week, that's already kind of a full workday of streaming every week. I don't need to double that. But I do watch bits of it to make sure that stuff came across. Or if I remember that I sounded particularly funny, I want to hear what that sounds like. chaelcodes I'm just kidding.
Or I'm just debugging my stream archives and then I have to like click play on things. Yeah. Yeah. All right. So this is, this is really nice. I should make more screenshots in my feature requests. Cause maybe that's the thing that people are like, yeah, I understand what this person wants.

...55I almost wonder if this should pass in the search object instead of extracting stuff and passing it in. I'll leave it as a note.

01:16:53So I'm going to say let's request some changes.

01:17:22Done.

01:18:11I guess they are termed terms, not yet quoted terms. Yeah, all right.

...36Oh, Chael, you know, if this is your first time tuning in, maybe I should have answered the what are you doing a little more broadly of. I run Lobsters, which is a big web forum for discussing programming. So we are reviewing code to search a site about code. Very meta. And on these streams also on off, they are kind of lobsters office hours. There is a link under the description to my about page where I kind of introduce things and have the archive for the stream and good. That's so great. All right. So Ashwin, Ashwin actually opened two pull requests. And this one, where am I on time? I think we can take a look at it. chaelcodes Thanks for the overview!
So as I mentioned, I like to make sure the site doesn't throw exceptions in prod. Oh, as long as I'm between pull requests, I am saying the bumper thing the same amount of times, but you know, four times in 90 minutes instead of four times in three hours. But if anybody has any questions about the site, the community, the guidelines, why things are the way they are, to talk about those happy to run queries against the prod database or otherwise i do code review and try and keep the code base moving and in good shape or at least break it less so something broke the stats page which has our nice graphs on it So if I start up my Rails server in the background, and let's go to, this will probably throw a 500. I mean, production is, so. Stats also yeah there we go is cached, because these are big queries that are like let's look at every comment in the database let's look at every story in the database. And as long as we're going to write. giant complicated queries let's not add any tests. i'm a little embarrassed that I didn't even add a smoke test to see that the stats page loads, so this is probably related to. a recent change I asked for replacing execute with select all. So I wonder if I change this back to execute, will this immediately go away?

01:21:47still thinking about it if it is thinking longer it's probably working yeah so this is what the stats page is supposed to look like so it is yeah i don't think i need to add that so then the fix that Ashwin made, I'm a little suspicious of it. So there's a thing I've talked about how sometimes I look at code and I'm like, ah, a junior developer wrote that. This one pinged that sense where instead of trying to fix the query or fix something downstream, and say, okay, well, the query is going to output a slightly different format. Let's change the way it consumes data. It says, well, let's loop over all of the data and inspect it and tweak things and then put it back and pass it off. And it's such a, it's a thing that junior devs do often where they don't try and find the root cause of something or change The output one place they just kind of look at data and munch it where the exception happens to occur.

01:23:35The exception occurs. Line 90. Who's 90? So grab all the data we turn into an array and we flatten it. Is this all right hang on so let's grab a console and let's say it's the model here user all right. Because I think this might be as simple as is stuff coming back as a hash or an array.

01:24:18What do you mean users out from users? Freaking.

...31I get it. This is like a weird trilogy thing where it doesn't play well with my pager.

...50And so I get just useless ASCII art stuff. Julia Evans just had a great string of posts on Blue Sky about how it is a guideline of writing shell stuff that you're supposed to detect if your pager is not a person, and then strip out your export pager equals see if this wants to do it all right that's better so what comes back is a result and then it has rows and this is an array of arrays if i said select oh part of that is should just say select one because i care about the structure i don't care how many i get so select all gets me a result with the columns one and if i say each i get hashes back okay but if i say execute I get an array back. So this is not a pull request I'm going to accept because what happened is we switched from execute to select all because Rails plumbing works a little different. We don't need to blow out the cache. But having made this change, this is never going to get an array back anymore. It shouldn't be possible.

01:27:10So if it's always going to come back as an array,

...25It's always going to come back as an array. No, it's always going to come back as a hash. Do I want to just call values on everything? Would that fix this? All right, so put it back into this state. And then down here, yield should grab the results.

01:28:08I might need an extra layer of 2a.values.flatten, but it's something more like that rather than for an instance of active record result. So I'm going to tweak that to say 2a. And then that should get me an array of hashes.

...54As I look at this, I'm not even sure what the flatten is doing there. It's breaking things.

01:29:15define method for an instance of array but the problem is that it's so this is going to throw an exception i just want to see the classes so these are all arrays

01:30:56This gives me multiple rows.

01:31:17This gets me two hashes.

...30This gets me two arrays.

...39So why does this not? This goes and selects this stuff out.

01:32:16Let's go in a debugger. I'm clearly wasting time with printf debugging. Debug. Debugger. There we go. It's data class. It's a hash.

...53gsora_ wow you can drop into the debugger like that? that's cool
yeah and i'm i'm such a old-school din lane guy that i rarely remember to just drop into a debugger there was a really nice talk at rocky mountain ruby i think where was that if you want to write a bunch of let's see make sure i'm muted

01:33:28Where was this? Oh, this must be a year or something ago. Come here. pushcx https://www.youtube.com/watch?v…
Where's the actual... Pry until you die. Here you go. This was a nice talk about features in Pry. And I started watching it and then I learned like five things and I went, my brain is full. I can't actually learn five things at once. So I have to come back and watch that again. All right, so that's it, right? Could not parse time.

01:34:25Yeah, I don't understand. kind of dinking around because i'm trying to i'm just going to get that ym exception aren't i because this is what the code already is yeah so this is not all right that's enough to say that this pull request isn't going to do it let's just punt it back i like i look at these things and i want to tweak it but

01:35:15Got to get it up on screen so I can actually say it correctly. Arrays and select all returns and array hashes.

...38Thanks for taking a bit. and learn that this is bad. This is the next isn't going to be changing the

01:36:23The data of the class of the array elements should always be ashes. I don't like this style of inspecting data in the middle and leaking it back. Please either. Either update the. Query I don't want to tell him to.

01:37:24There we go. I feel like a very, I hope I am being a competent open source maintainer by saying like, hey, yeah, you got this. It's really tempting, especially with this kind of like, oh, I almost have it bugged. Like I did not mean to rabbit hole for five or 10 minutes and try and fix it myself. What I should have said to encourage a contributor is just like, Yeah, the style's off. You're mostly there. I could have written this comment 10 minutes ago. As soon as I saw the difference between execute and select all, I should have just come back and said, please keep going. It's the wanting to do it myself. I am trying to get away from that and encourage more people to contribute to the code base. It is a heck of a lot more scalable than me trying to do everything myself. All right. So with that, I am going to roll out. This is going to be a very short stream, unless anybody has any last minute questions about the Lobster site or code base. And I understand from Tail Codes that she's going to start writing Rails and contributing to the code base. Oops, why is this bug still open? This is done. chaelcodes I already write Rails.
chaelcodes And I was considering contributing.
and given that we have 126 issues open and she has a baby in her arms probably she's only going to close half of them today that seems reasonable now so anyways i hope everybody has a nice holiday and if you don't celebrate thanksgiving because you're not an american The most important part of it is eating too much food and hanging out with your family. So I hope you can do that. That's about it. Oh, you already write Rails and you're considering contributing. gsora_ thank you pushcx! see you next time
Well, then I will try and not actually put you on the spot. I hope I don't put you off. I'm just being silly. chaelcodes Happy Thanksgiving!
But I am very welcoming to contributors if any of this stuff interests you. I mean, I break stuff on the site all the time. chaelcodes Bye!!
There is lots of stuff that's tagged good first issue, so you don't have to know much about the code base. And if you... want an invite to the site, just let me know and I will email you one so that you can poke around. I just have to get an email address for you if you're not already on the site. That is true for anybody. Please, please help me fix my bugs. Alrighty. Have a good holiday. Take care.