blitz's recent activity

  1. Comment on Shostakovich's symphony played by a starving orchestra (7th, "Leningrad") in ~music

    blitz
    Link
    If anyone wants to listen to it, one recording I really like is Andris Nelsons with the Boston Symphony Orchestra. Spotify Apple Music I'd love to hear the versions that other people like, if any!

    If anyone wants to listen to it, one recording I really like is Andris Nelsons with the Boston Symphony Orchestra.

    Spotify
    Apple Music

    I'd love to hear the versions that other people like, if any!

    1 vote
  2. Comment on What is this Gemini thing anyway, and why am I excited about it? in ~tech

    blitz
    Link Parent
    Because Drew is a software nerd, he's interested in building new things and exploring new ideas! Everyone in software has used HTTP and REST for ages, so it can be fun to work on something novel,...

    Because Drew is a software nerd, he's interested in building new things and exploring new ideas! Everyone in software has used HTTP and REST for ages, so it can be fun to work on something novel, even if it's not the most efficient use of time or resources. He also talks about how complicated the web has become, and creating a custom simplified protocol might help to prevent the scope-creep that took the web from nice simple hypertext document to the bloated billion dollar behemoths we have now.

    2 votes
  3. Comment on What is this Gemini thing anyway, and why am I excited about it? in ~tech

    blitz
    Link
    I've downloaded and compiled Drew's gmni client and have been browsing the 'geminispace'. It's pretty neat! As the web continues to get filled with profitseeking and blogspam it's nice to find...

    I've downloaded and compiled Drew's gmni client and have been browsing the 'geminispace'. It's pretty neat! As the web continues to get filled with profitseeking and blogspam it's nice to find spaces with a high level of personality and creativity.

    I've been browsing the posts on midnight.pub, and I stumbled upon this very amusing choose your own adventure page:

    https://portal.mozz.us/gemini/midnight.pub/posts/641

    5 votes
  4. Comment on What games have you been playing, and what's your opinion on them? in ~games

    blitz
    Link Parent
    I second this. I played Webbed a bunch this weekend and it was fantastic! I actually wanted to share a link to it as a top level post but this is almost as good a place to do it. :)

    I second this. I played Webbed a bunch this weekend and it was fantastic! I actually wanted to share a link to it as a top level post but this is almost as good a place to do it. :)

    4 votes
  5. Comment on There's no "right" way to play a game, and Twitch streamers are sick of being shamed for playing on easy in ~games

    blitz
    Link Parent
    One game I'd like to give a shout-out to is the Witcher 3 for really making Hard and up worth playing on. The game has a lot of depth in the combat and in potions and in monster weaknesses and...

    One game I'd like to give a shout-out to is the Witcher 3 for really making Hard and up worth playing on.

    The game has a lot of depth in the combat and in potions and in monster weaknesses and strengths. On the easier difficulties you can basically just rush head first into any encounter and whack them with your metal sticks until they die, ignoring all the lore and the bestiary and all the prep that witchers canonically have to do to fight.

    When I started playing on Death March I really had to change the way I played to survive. Suddenly I had to search for the crafting recipes for the potions I needed to help me fight specific monsters, I had to read the bestiary entries in order to understand how to better fight them, I had to spend time upgrading my armor and equipment. It felt many times more immersive than it felt on lower difficulties. (Although, I also remember dying to the first pack of wolves you come across when you're going to talk to the first Nilfgaardian in the game like fifty times as well)

    7 votes
  6. Comment on What have you been listening to this week? in ~music

    blitz
    Link
    The YouTube Algorithm recommended to me a channel that has a bunch of songs from the Soviet-Afghan war. I'm a huge fan of folk music, and topical folk music specifically, so it's been super...

    The YouTube Algorithm recommended to me a channel that has a bunch of songs from the Soviet-Afghan war. I'm a huge fan of folk music, and topical folk music specifically, so it's been super interesting going through these songs. I speak Russian well enough that I don't really need the subtitles, but they're nice for sharing with non-Russian speakers.

    https://www.youtube.com/watch?v=jLeIx8rrlSc
    https://www.youtube.com/watch?v=UGdZ10b6E8Q
    https://www.youtube.com/watch?v=Chr8u3Whk_0

  7. Comment on If I'm using Cloudflare for my domains, do I need to bother with LE? in ~comp

    blitz
    Link
    You can't really answer this question without looking at your threat model. Why are you setting up SSL in the first place? Is it just to get that positive browser feedback for clients? Then yeah,...

    You can't really answer this question without looking at your threat model. Why are you setting up SSL in the first place?

    Is it just to get that positive browser feedback for clients? Then yeah, you don't need to set up SSL behind Cloudflare, but you're not getting the full benefit of SSL either.

    You'll get a partial benefit, since one of the easiest places to do a man in the middle attack is when you're local to a client, i.e. setting up a rogue access point that modifies or captures traffic that the victim might connect to. Cloudflare Flexible HTTPS alone will protect you from that.

    If you're handling sensitive information, though? I still think it's worth setting up a fully signed and verified key chain all the way to the origin server. Attacks that would target the backend are more sophisticated, but they can and do still happen. One possible attack that can occur is if somehow the DNS records that cloudflare sees are wrong, and cloudflare sends requests to the wrong origin server temporarily. This is called DNS cache poisoning. Though Cloudflare is unlikely to be attacked successfully, it's important to know that Cloudflare itself does not have to be compromised for your server to be compromised; all that's needed is for Cloudflare to see the wrong A record when it looks up the domain name for the origin server, which can happen any number of different ways.

    A properly signed certificate will help protect from that, a self signed certificate will not.

    In my mind it's worth having the assurance that the whole chain is encrypted and signed; especially since setting up a signed certificate is easier than ever with LE these days.

    7 votes
  8. Comment on Russia may fine citizens who use SpaceX’s Starlink Internet service in ~tech

    blitz
    Link Parent
    Maybe there's a good method, but it could also just be being set up as a secondary charge. If it's hard to detect, lots of people will probably get away with using it without repercussion, but if...

    Maybe there's a good method, but it could also just be being set up as a secondary charge. If it's hard to detect, lots of people will probably get away with using it without repercussion, but if you commit some sort of crime and they come and search your house and find one of these units there, that gives them the ability to tack on some extra punishment.

    There's lots of laws on the books in many countries that function like this, including (in some states, I think) seatbelt laws. An officer can't pull you over for not wearing a seatbelt, but if you get pulled over and it's observed you're not wearing a seatbelt, you get an extra ticket.

    9 votes
  9. Comment on What did you do this weekend? in ~talk

    blitz
    Link
    I already posted about it in one of the COVID related threads, but I built and put up a site for tracking vaccination progress in Colorado! The official state dashboard leaves a lot to be desired...

    I already posted about it in one of the COVID related threads, but I built and put up a site for tracking vaccination progress in Colorado! The official state dashboard leaves a lot to be desired so I started scraping their data and displaying myself:

    https://vaxtrack.co/

    I had some other graphs involving vaccination speed vs new daily cases but I was getting the data from CovidActNow.org and their data is licensed CC-BY-NC-ND, and I'm not sure if graphing the data with other data creates a derivative work, so I've taken those down and written to them for permission to use their data.

    If they say no or don't write back I'm sure I can find some other source for daily cases, it's just their API is very fast and convenient.

    7 votes
  10. Comment on Weekly coronavirus-related chat, questions, and minor updates - week of January 4 in ~health.coronavirus

    blitz
    (edited )
    Link Parent
    FYI, the first version of these graphs is live now. Edit: I read the license for the data I was using to plot cases, and it specifies no derivatives. Gotta ask for permission or find a new source!

    FYI, the first version of these graphs is live now.

    Edit: I read the license for the data I was using to plot cases, and it specifies no derivatives. Gotta ask for permission or find a new source!

    1 vote
  11. Comment on Weekly coronavirus-related chat, questions, and minor updates - week of January 4 in ~health.coronavirus

    blitz
    Link Parent
    That’s definitely in the plan!

    That’s definitely in the plan!

    1 vote
  12. Comment on Weekly coronavirus-related chat, questions, and minor updates - week of January 4 in ~health.coronavirus

    blitz
    Link
    Yesterday I hacked together a dashboard of vaccination info in the state of Colorado, since I found the official Colorado vaccination dashboard mostly unusable: https://vaxtrack.co/ If anyone has...

    Yesterday I hacked together a dashboard of vaccination info in the state of Colorado, since I found the official Colorado vaccination dashboard mostly unusable:

    https://vaxtrack.co/

    If anyone has any feedback, I'd be glad to hear it!

    6 votes
  13. Comment on What have you been listening to this week? in ~music

    blitz
    Link
    Odin's Raven Magic is an amazing live performance of the eponymous ancient norse poem, interjected with some melodic instruments and some funky electronic shit. I don't normally go for this kind...

    Odin's Raven Magic is an amazing live performance of the eponymous ancient norse poem, interjected with some melodic instruments and some funky electronic shit. I don't normally go for this kind of album but it works.

    Christmas Vibes, a nice jazzy take on the familiar Christmas songs.

    Songs of Comfort and Hope - Yo-Yo Ma, Kathryn Stott. I'm a big fan of Ma. He performed the Bach cello suites live on youtube during the first wave of the pandemic and talked a lot about songs that gave him comfort, so it's no surprise he put out an album of these songs.

    1 vote
  14. Comment on SpaceX successfully flies, nearly lands Starship SN8 prototype vehicle after 12.5km suborbital test flight in ~space

  15. Comment on SpaceX successfully flies, nearly lands Starship SN8 prototype vehicle after 12.5km suborbital test flight in ~space

    blitz
    Link Parent
    And some “engine-rich exhaust” :)

    And some “engine-rich exhaust” :)

    1 vote
  16. Comment on SpaceX successfully flies, nearly lands Starship SN8 prototype vehicle after 12.5km suborbital test flight in ~space

    blitz
    Link Parent
    Do you think the engines were supposed to go out one by one like that? And on restart only two of them lit. I wonder if engine reliability was the limiting factor today. Can’t wait for the Scott...

    Do you think the engines were supposed to go out one by one like that? And on restart only two of them lit. I wonder if engine reliability was the limiting factor today.

    Can’t wait for the Scott Manley video where he guesses what went wrong, and then the following press release in which he is shown to have been mostly right!

    1 vote
  17. Comment on Day 9: Encoding Error in ~comp

    blitz
    Link
    I had a lot of trouble figuring out how I could take an iterator in Rust and split it across two loops, since most of the methods on iterators take ownership of the iterator. Thankfully, I...

    I had a lot of trouble figuring out how I could take an iterator in Rust and split it across two loops, since most of the methods on iterators take ownership of the iterator. Thankfully, I stumbled upon by_ref!

    Also, I know that I'm parsing the lines to nums twice, for some reason takeing after collecting and recreating the iterator wasn't working, and I'm too sleepy to figure out why.

    lib.rs
    use std::collections::VecDeque;
    
    pub struct DataWindow(VecDeque<u64>);
    
    impl From<Vec<u64>> for DataWindow {
        fn from(vec: Vec<u64>) -> DataWindow {
            DataWindow( VecDeque::from(vec) )
        }
    }
    
    impl DataWindow {
        fn is_sum(&self, num: u64) -> bool {
            let DataWindow( dq ) = self;
    
            for x in 0..dq.len() {
                for y in x..dq.len() {
                    if dq[x] + dq[y] == num {
                        return true;
                    }
                }
            }
    
            return false;
        }
    
        pub fn read_next(&mut self, num: u64) -> bool {
            let ret = self.is_sum(num);
            let DataWindow( dq ) = self;
    
            dq.pop_front();
            dq.push_back(num);
    
            ret
        }
    }
    
    pub fn compute_min_max_sum(mut nums_acc: Vec<u64>) -> u64 {
        nums_acc.sort();
    
        nums_acc.first().unwrap() + nums_acc.last().unwrap()
    }
    
    main.rs
    use std::io;
    use std::io::prelude::*;
    use std::env;
    
    use day9::*;
    
    fn part1(lines: &Vec<String>, preamble_len: usize) -> u64 {
        let mut nums = lines.iter().map(|x| x.parse::<u64>().unwrap());
    
        let preamble: Vec<u64> = nums.by_ref().take(preamble_len).collect::<Vec<u64>>();
        let mut dw = DataWindow::from(preamble);
    
        for n in nums {
            if !dw.read_next(n) {
                return n;
            }
        }
    
        panic!();
    }
    
    fn part2(lines: &Vec<String>, target: u64) -> u64 {
        let nums: Vec<u64> = lines
            .iter()
            .map(|x| x.parse::<u64>().unwrap())
            .collect();
    
        for (i, x) in nums.iter().enumerate() {
            let mut target_acc = *x;
            let mut nums_acc = Vec::new();
    
            for j in 1..(nums.len() - i) {
                let num = nums[i + j];
                target_acc += num;
                nums_acc.push(num);
    
                if target_acc == target {
                    return compute_min_max_sum(nums_acc);
                }
            }
        }
    
        panic!();
    }
    
    fn main() {
        let stdin = io::stdin();
        let lines: Vec<String> = stdin
            .lock()
            .lines()
            .collect::<Result<_, _>>()
            .unwrap();
    
        let args: Vec<String> = env::args().collect();
        let preamble_len = args[1].parse::<usize>().unwrap();
    
        let part1_ans = part1(&lines, preamble_len);
        let part2_ans = part2(&lines, part1_ans);
    
        println!("Part 1: {}", part1_ans);
        println!("Part 2: {}", part2_ans);
    }
    
    2 votes
  18. Comment on Day 8: Handheld Halting in ~comp

    blitz
    Link Parent
    It’s so cool to read other people’s rust solutions to the same problems every day. I completely forgot about implementing traits for my own structs! I’ll try and remember next time.

    It’s so cool to read other people’s rust solutions to the same problems every day. I completely forgot about implementing traits for my own structs! I’ll try and remember next time.

    3 votes
  19. Comment on Day 8: Handheld Halting in ~comp

    blitz
    Link
    I love this kind of thing! I think Rust lends itself to building interpreters particularly well :). lib.rs #![feature(str_split_once)] use std::collections::HashSet; #[derive(PartialEq, Eq, Copy,...

    I love this kind of thing! I think Rust lends itself to building interpreters particularly well :).

    lib.rs
    #![feature(str_split_once)]
    use std::collections::HashSet;
    
    #[derive(PartialEq, Eq, Copy, Clone)]
    pub enum BootCodeOperation {
        Acc,
        Jmp,
        Nop,
    }
    
    pub type InstructionArgument = i64;
    
    #[derive(PartialEq, Eq, Copy, Clone)]
    pub struct BootCodeInstruction {
        pub operation: BootCodeOperation,
        pub argument: InstructionArgument,
    }
    
    impl BootCodeInstruction {
        pub fn from_line(line: &str) -> BootCodeInstruction {
            let (op_str, arg_str) = line.split_once(' ').unwrap();
    
            let operation = match op_str {
                "nop" => BootCodeOperation::Nop,
                "acc" => BootCodeOperation::Acc,
                "jmp" => BootCodeOperation::Jmp,
                _ => panic!("Invalid op code")
            };
    
            let argument = arg_str.parse::<i64>().unwrap();
    
            BootCodeInstruction { operation, argument }
        }
    }
    
    pub type Program = Vec<BootCodeInstruction>;
    
    pub fn load_program(lines: &Vec<String>) -> Program {
        lines.iter().map(|x| BootCodeInstruction::from_line(x)).collect()
    }
    
    pub struct State {
        program: Program,
        instruction_pointer: usize,
        acc: i64,
    }
    
    impl State {
        pub fn new(program: Program) -> State {
            State { program, instruction_pointer: 0, acc: 0 }
        }
    
        pub fn tick(&mut self) -> (i64, Option<usize>) {
            let current_instruction = self.program[self.instruction_pointer];
    
            match current_instruction.operation {
                BootCodeOperation::Acc => {
                    self.acc += current_instruction.argument;
                    self.instruction_pointer += 1;
                },
                BootCodeOperation::Jmp => {
                    self.instruction_pointer = (
                        self.instruction_pointer as i64 + current_instruction.argument
                    ) as usize;
                },
                BootCodeOperation::Nop => {
                    self.instruction_pointer += 1;
                }
            }
    
            let next_instruction = match self.instruction_pointer >= self.program.len() {
                true => None,
                false => Some(self.instruction_pointer),
            };
    
            (self.acc, next_instruction)
        }
    }
    
    pub fn loop_detecting_runner(mut state: State) -> (bool, i64) {
        let mut executed_instructions = HashSet::new();
    
        while let (acc, Some(next_instruction)) = state.tick() {
            if executed_instructions.contains(&next_instruction) {
                return (true, acc);
            } else {
                executed_instructions.insert(next_instruction);
            }
        }
    
        (false, state.acc)
    }
    
    main.rs
    use std::io;
    use std::io::prelude::*;
    
    use day8::*;
    
    fn part1(lines: &Vec<String>) -> i64 {
        let program = load_program(&lines);
        let state = State::new(program);
    
        let (_loop_detected, acc) = loop_detecting_runner(state);
    
        acc
    }
    
    fn part2(lines: &Vec<String>) -> i64 {
        let program = load_program(&lines);
    
        for (i, instr) in program.iter().enumerate() {
            let mut new_program = program.clone();
            match instr.operation {
                BootCodeOperation::Nop => {
                    new_program[i].operation = BootCodeOperation::Jmp;
                },
                BootCodeOperation::Jmp => {
                    new_program[i].operation = BootCodeOperation::Nop;
                },
                BootCodeOperation::Acc => {},
            }
    
            let state = State::new(new_program);
    
            let (loop_detected, acc) = loop_detecting_runner(state);
    
            if !loop_detected {
                return acc;
            }
        }
    
        panic!();
    }
    
    fn main() {
        let stdin = io::stdin();
        let lines: Vec<String> = stdin
            .lock()
            .lines()
            .collect::<Result<_, _>>()
            .unwrap();
    
        println!("Part 1: {}", part1(&lines));
        println!("Part 2: {}", part2(&lines));
    }
    
    4 votes