markh's recent activity

  1. Comment on Roughly ten games into the NHL season: what are your thoughts on the season so far? How is your team doing? Any surprises? in ~sports.hockey

    markh
    Link
    Kings fan. Things seem to be going pretty well so far. Goaltending might be an issue but Talbot has stepped up. The big positive is how good Byfield looks, he’s really taken huge strides since...

    Kings fan. Things seem to be going pretty well so far. Goaltending might be an issue but Talbot has stepped up. The big positive is how good Byfield looks, he’s really taken huge strides since last year.

    Also, playing LA is no longer a defensive, low-scoring affair. LA leads the league in goals scored (and we haven’t even played San Jose)! It’s a lot of fun watching this team.

    Finally, shout out to Thousand Oaks native Trevor Moore! What a year he’s having so far.

    3 votes
  2. Comment on Injured person reportedly dies after Cruise cars block first responders, according to reports from the San Francisco Fire Department in ~transport

    markh
    Link Parent
    Why not?

    Obviously, the short answer is the CEO but we can't just prosecute a job creator like that.

    Why not?

    9 votes
  3. Comment on Starbucks’ Pumpkin Spice Latte turns twenty, beloved by millions and despised by some in ~food

    markh
    Link
    A 16oz Pumpkin Spice Latte has 50 grams of sugar. That is an insane amount. I’m sure it’s delicious, but holy cow.

    A 16oz Pumpkin Spice Latte has 50 grams of sugar. That is an insane amount. I’m sure it’s delicious, but holy cow.

  4. Comment on MLB trade deadline discussion thread in ~sports.baseball

    markh
    Link
    If the Dodgers do land Verlander, he and Lynn would be quite the improvement for that rotation. Add in Kershaw, Urias, and Miller and you have a formidable five man group. I was at the game on...

    If the Dodgers do land Verlander, he and Lynn would be quite the improvement for that rotation. Add in Kershaw, Urias, and Miller and you have a formidable five man group.

    I was at the game on Saturday and Joe Kelly got a standing ovation when he came into the game, too. Fun atmosphere.

  5. Comment on Ruud vs. Djokovic - Who are you picking? in ~sports

    markh
    Link
    Those first two sets of the Alcaraz/Djokovic match were probably the best tennis I've seen in a very long time. What a treat, and a shame that Alcaraz' body broke down like it did. I think...

    Those first two sets of the Alcaraz/Djokovic match were probably the best tennis I've seen in a very long time. What a treat, and a shame that Alcaraz' body broke down like it did.

    I think Djokovic beats Ruud in the final, but I also think that Ruud has answered a lot of questions by making three of the last five finals. Djokovic will likely finish as the best male tennis player of all time.

  6. Comment on Apple / iOS rant in ~tech

    markh
    Link
    Well, I'll give a counterpoint here: accessibility features are so much better on iPhone/Apple devices that Android, Windows, and Linux shouldn't even be considered. These complaints also seem...

    Well, I'll give a counterpoint here: accessibility features are so much better on iPhone/Apple devices that Android, Windows, and Linux shouldn't even be considered.

    These complaints also seem very specific to you. I've had an iPhone for a decade now and I've never had a problem. It just works, and I love it for that exact reason.

    9 votes
  7. Comment on Day 6: Custom Customs in ~comp

    markh
    Link
    Elixir! Took me a while to realize what part two was asking for. Parts One and Two defmodule Day6 do def one do File.read!("inputs/six.txt") |> String.split("\n\n") |> Enum.map(&String.replace(&1,...

    Elixir! Took me a while to realize what part two was asking for.

    Parts One and Two
    defmodule Day6 do
      def one do
        File.read!("inputs/six.txt")
        |> String.split("\n\n")
        |> Enum.map(&String.replace(&1, "\n", "", global: true))
        |> Enum.map(&String.split(&1, "", trim: true))
        |> Enum.map(&MapSet.new(&1))
        |> Enum.map(&MapSet.size(&1))
        |> Enum.reduce(&(&1 + &2))
      end
    
      def two do
        File.read!("inputs/six.txt")
        |> String.split("\n\n")
        |> Enum.map(&String.split(&1, "\n", trim: true))
        |> Enum.map(&parse/1)
        |> Enum.map(&MapSet.size/1)
        |> Enum.reduce(&(&1 + &2))
      end
    
      def parse(input) do
        input
        |> Enum.map(&String.graphemes(&1))
        |> Enum.map(&MapSet.new(&1))
        |> Enum.reduce(&MapSet.intersection/2)
      end
    end
    
    4 votes
  8. Comment on Day 5: Binary Boarding in ~comp

    markh
    Link
    Day 5! This one was fun, although I had to figure out how to slide an array in Elixir. Elixir defmodule Day5 do def one do File.read!("inputs/five.txt") |> String.split("\n") |> Enum.map(&parse/1)...

    Day 5! This one was fun, although I had to figure out how to slide an array in Elixir.

    Elixir
        defmodule Day5 do
          def one do
            File.read!("inputs/five.txt")
            |> String.split("\n")
            |> Enum.map(&parse/1)
            |> Enum.max()
          end
    
          def parse(input) do
            [[r, s]] = Regex.scan(~r/([F|B]{7})([R|L]{3})/, input, capture: :all_but_first)
    
            row = r
            |> String.replace("F", "0")
            |> String.replace("B", "1")
            |> String.to_integer(2)
    
            seat = s
            |> String.replace("L", "0")
            |> String.replace("R", "1")
            |> String.to_integer(2)
    
            row * 8 + seat
          end
    
          def two do
            [[x, _]] = File.read!("inputs/five.txt")
            |> String.split("\n")
            |> Enum.map(&parse/1)
            |> Enum.sort()
            |> Enum.chunk_every(2, 1, :discard)
            |> Enum.filter(fn [x, y] -> y - x == 2 end)
    
            x + 1
          end
        end
    
    4 votes
  9. Comment on Day 4: Passport Processing in ~comp

    markh
    Link
    Elixir, Day 4 Parts 1 and 2 defmodule Day4 do def one do File.read!("inputs/four.txt") |> String.split("\n\n") |> Enum.map(&parse/1) |> Enum.count(&valid_keys?/1) end def two do...

    Elixir, Day 4

    Parts 1 and 2
    defmodule Day4 do
      def one do
        File.read!("inputs/four.txt")
        |> String.split("\n\n")
        |> Enum.map(&parse/1)
        |> Enum.count(&valid_keys?/1)
      end
    
      def two do
        File.read!("inputs/four.txt")
        |> String.split("\n\n")
        |> Enum.map(&parse/1)
        |> Enum.reject(fn x -> !(valid_keys?(x)) end)
        |> Enum.count(&valid_values?/1)
      end
    
      def parse(input) do
        input
        |> String.split(~r/\s+/, trim: true)
        |> Enum.map(&(String.split(&1, ":")))
        |> Enum.map(fn [k, v] -> {String.to_atom(k), v} end)
        |> Map.new()
      end
    
      def valid_keys?(data) do
        Enum.all?([:byr, :iyr, :eyr, :hgt, :hcl, :ecl, :pid], fn key -> Map.has_key?(data, key) end)
      end
    
      def valid_values?(data) do
        Enum.all?(data, fn {key, value} -> valid_value?(key, value) end)
      end
    
    
      def valid_value?(:hgt, value) do
        case Regex.scan(~r/(\d+)(\w+)/, value, capture: :all_but_first) do
          [[val, "cm"]] ->
            String.to_integer(val) in 150..193
          [[val, "in"]] ->
            String.to_integer(val) in 59..76
          _ ->
            false
        end
      end
    
      def valid_value?(:byr, value), do: String.to_integer(value) in 1920..2002
      def valid_value?(:iyr, value), do: String.to_integer(value) in 2010..2020
      def valid_value?(:eyr, value), do: String.to_integer(value) in 2020..2030
      def valid_value?(:hcl, value), do: Regex.match?(~r/#[0-9a-f]{6}/, value)
      def valid_value?(:ecl, value), do: value in ["amb", "blu", "brn", "gry", "grn", "hzl", "oth"]
      def valid_value?(:pid, value), do: Regex.match?(~r/^(\d){9}$/, value)
      def valid_value?(_, _), do: true
    end
    
    3 votes
  10. Comment on <deleted topic> in ~tech

    markh
    Link Parent
    Spectacle is the most important app on MacOS.

    Spectacle is the most important app on MacOS.

    1 vote
  11. Comment on A Missouri bill intended to bar libraries from stocking “age-inappropriate sexual material” for children could land librarians who refuse to comply with it in jail in ~books

    markh
    Link
    Of all the things to target, and with everything available freely on the internet, libraries are somehow an issue in 2020?

    Of all the things to target, and with everything available freely on the internet, libraries are somehow an issue in 2020?

    10 votes
  12. Comment on What's your favourite live album? in ~music

  13. Comment on Len Gon Give It To Ya (mashup of X Gon Give It To Ya by DMX with Steal My Sunshine by Len) in ~music

    markh
    Link
    It’s as if someone made this specifically for me. Thank you for sharing this.

    It’s as if someone made this specifically for me. Thank you for sharing this.

    1 vote
  14. Comment on What display theme do you use ? in ~talk

  15. Comment on TV Tuesdays Free Talk in ~tv

    markh
    Link
    I just started season three of The Handmaid’s Tale. Really dark show but it’s really good if you’re into that kind of thing.

    I just started season three of The Handmaid’s Tale. Really dark show but it’s really good if you’re into that kind of thing.

    2 votes
  16. Comment on What are you reading these days? in ~books

    markh
    Link
    I picked up On Writing by Stephen King and it’s been great so far. If you’re interested in learning more about King, his upbringing, his writing, or how to write in general, I recommend it.

    I picked up On Writing by Stephen King and it’s been great so far. If you’re interested in learning more about King, his upbringing, his writing, or how to write in general, I recommend it.

    1 vote
  17. Comment on Fitness Weekly Discussion in ~health

    markh
    Link
    Any recommendations for healthy pescatarian or vegetarian meal ideas?

    Any recommendations for healthy pescatarian or vegetarian meal ideas?

    2 votes
  18. Comment on What programming/technical projects have you been working on? in ~comp

    markh
    Link Parent
    Have you looked into Michael Hartl’s Rails Tutorial? It’s a really great, free resource for learning Rails and building a full project!

    Have you looked into Michael Hartl’s Rails Tutorial? It’s a really great, free resource for learning Rails and building a full project!

    1 vote
  19. Comment on How to track President Trump (tracking of government employees using cell phones) in ~news

    markh
    Link Parent
    Sure, but given that the technology already exists, it seems unlikely that even making it illegal is enough to deter those who really want it. Instead, I suggest we make it public. Really, really...

    Sure, but given that the technology already exists, it seems unlikely that even making it illegal is enough to deter those who really want it.

    Instead, I suggest we make it public. Really, really public. That’ll get people to care about who is tracking them. What’s the inverse of “out of sight, out of mind”?

    1 vote
  20. Comment on “Join Reddit to keep reading” - an account is now required to read comment threads on the mobile website in ~tech

    markh
    Link Parent
    If they did, I’d stop using Reddit altogether. There are still some valuable communities on the site - niche programming, sports, and fitness communities come to mind - but Reddit as a whole isn’t...

    If they did, I’d stop using Reddit altogether. There are still some valuable communities on the site - niche programming, sports, and fitness communities come to mind - but Reddit as a whole isn’t “cool” anymore, and it never will be ever again.

    7 votes