Skip Navigation

Posts
7
Comments
113
Joined
5 mo. ago

Hi, I’m Amy.

✨ New 🏳️‍⚧️ improved ♀️ version 👩‍❤️‍👩 out 🏳️‍🌈 now! 🎊

I live in Japan. Talk to me about Haskell, Scheme, and Linux.

日本語も通じます。

  • That's really pretty! Nice work.

  • Oh, this is an excellent question.

    Yeah, everything that had been general background malaise became a lot more specific once I knew I was trans. It became a lot easier to pinpoint "I don't like this about myself". Which sucks, because I felt bad, but was also good because I could do something about it. Mostly that was "wait for HRT to sort it out". And, mostly, HRT has fixed it. Or just time in general, like growing my hair out or losing weight.

    The other thing I noticed is I tend to have a single thing that really bothers me, and everything else is a lot less of a bother. Once that's dealt with, the next most important thing becomes apparent, and so on. At first I didn't know whether I wanted bottom surgery, because I was so upset just looking male in general. But once my face softened up and my hair started to grow out, it suddenly became very obvious to me that surgery would be necessary.

    The absolute worst thing when I was just starting out was my face looking like a man. I tried makeup, and that just made me look like a man in makeup. But, slowly, it started working: a bit of mascara made me feel better. Then foundation started smoothing out my face, rather than highlighting the masculine features. Eye shadow and lipstick started looking good.

    Time-wise, I think the absolute worst period for me was about three months in. Six months, I started to see the effects of HRT. Nine months, I started passing as a woman. Twelve months, I could see it for myself.

  • Totally. The amount of shit I can just shrug off with a "that sucks, oh well" now that would have had me spiraling before is incredible.

    It kind of feels like I had life on hard mode up till now.

  • I don't really know why, but I always felt it ought to be this. (I haven't seen the drama it's from, but the plot looks... interesting)

  • Good luck!

  • Nicely done. You found just the right shade, too!

  • Yay <3 I like the top!

  • I wet my hair and use kao water treatment to get rid of the tangles. Then an obscene amount of LA Looks Extreme Sport gel (anything is fine though) and lightly blow dry with a diffuser. Then air dry the rest of the way. Just before I go out I scrunch with my fingers to break up the gel and voila!

  • Yay, more lesbians!

  • Haskell

    Oh, this one was easy (dynamic programming at last!). Still haven't figured out the right way to approach yesterday's part two, though.

     Haskell  
        
    import Data.List  
    import Data.Map (Map)  
    import Data.Map qualified as Map  
    
    readInput =  
      Map.fromList  
        . map ((\(name : outs) -> (init name, outs)) . words)  
        . lines  
    
    part1 input = go "you"  
      where  
        go "out" = 1  
        go name = maybe 0 (sum . map go) $ input Map.!? name  
    
    part2 input = let (both, _, _, _) = pathsFrom "svr" in both  
      where  
        pathsFrom =  
          (Map.!)  
            . Map.insert "out" (0, 0, 0, 1)  
            . Map.fromList  
            . (zip <*> map findPaths)  
            $ Map.keys input ++ concat (Map.elems input)  
        findPaths n =  
          let (both, dac, fft, none) =  
                unzip4 $ maybe [] (map pathsFrom) (input Map.!? n)  
           in case n of  
                "dac" -> (sum both + sum fft, sum dac + sum none, 0, 0)  
                "fft" -> (sum both + sum dac, 0, sum fft + sum none, 0)  
                _ -> (sum both, sum dac, sum fft, sum none)  
    
    main = do  
      input <- readInput <$> readFile "input11"  
      print $ part1 input  
      print $ part2 input  
    
      
  • That's not quite the key observation...

    Many of the productions end in an element which does not appear on the left-hand side. That acts as a flag which tells you where to look for substitutions.

  • Haskell

    This is pretty ugly. I got rather fed up after trying out various heuristics when the test case passed but actual data didn't.

     Haskell  
        
    import Control.Arrow  
    import Data.Function  
    import Data.Ix  
    import Data.List  
    import Data.Ord  
    
    readInput :: String -> [(Int, Int)]  
    readInput = map ((read *** (read . tail)) . break (== ',')) . lines  
    
    pairs = concatMap (\(x : xs) -> map (x,) xs) . init . tails  
    
    toRange ((a, b), (c, d)) = ((min a c, min b d), (max a c, max b d))  
    
    onTiles loop rect = cornersInside && not crossingEdges  
      where  
        cornersInside =  
          let ((a, b), (c, d)) = rect  
           in inside (a, d) && inside (c, b)  
        verticalEdges = sortOn (Down . fst . fst) $ filter (uncurry ((==) `on` fst)) loop  
        inside (x, y) =  
          let intersecting ((a, b), (_, d)) = a <= x && inRange (min b d, max b d) y  
           in maybe False (uncurry ((>) `on` snd)) $ find intersecting verticalEdges  
        crossingEdges =  
          let ((a, b), (c, d)) = rect  
           in any (crossingLoop . toRange) $  
                [ ((a, b), (c, b)),  
                  ((c, b), (c, d)),  
                  ((c, d), (a, d)),  
                  ((a, d), (a, b))  
                ]  
        crossingLoop ((a, b), (c, d))  
          | a == c = anyEdge (\((e, f), (g, h)) -> f == h && f > b && f < d && g > a && e < c)  
          | b == d = anyEdge (\((e, f), (g, h)) -> e == g && e > a && e < c && h > b && f < d)  
        anyEdge = flip any $ map toRange loop  
    
    main = do  
      input <- readInput <$> readFile "input09"  
      let rects = pairs input  
          loop = zip (last input : input) input  
          go = print . maximum . map (rangeSize . toRange)  
      go rects  
      go $ filter (onTiles loop) rects  
    
      
  • Oh gosh, I remember this one. Working backwards is a good idea. In addition, you can just look at the start of the string when trying substitutions. I don't think that's valid in general, but it worked for me in this case.

    There's another trick you can do if you look carefully at the input data. I didn't implement it in my solution because I didn't spot it myself, but it essentially makes the problem trivial.

  • egg_irl

    Jump
  • "Of course I'd love to transition and be a woman, it's just that I'm not trans."

    That was also my logic for a looong time.

  • Haskell

    I was late to the part on this one and forgot to post my solution :3

     Haskell  
        
    import Data.List  
    
    readInput = map readMove . lines  
      where  
        readMove (d : ds) =  
          let n = read ds :: Int  
           in case d of  
                'L' -> -n  
                'R' -> n  
    
    part1 = length . filter ((== 0) . (`mod` 100)) . scanl' (+) 50  
    
    part2 = fst . foldl' count (0, 50)  
      where  
        count (z, p) d =  
          let (q, r) = (p + d) `divMod` 100  
              a = if p == 0 && d < 0 then -1 else 0  
              b = if r == 0 && d < 0 then 1 else 0  
           in (z + abs q + a + b, r)  
    
    main = do  
      input <- readInput <$> readFile "input01"  
      print $ part1 input  
      print $ part2 input  
    
      
  • Thank you! ☺️

  • Haskell

    They're getting interesting now!

     Haskell  
        
    import Control.Monad  
    import Data.List  
    import Data.List.Split  
    import Data.Ord  
    import Data.Set qualified as Set  
    
    readPos = (\([x, y, z] :: [Int]) -> (x, y, z)) . map read . splitOn ","  
    
    pairs = init . tails >=> (\(x : xs) -> map (x,) xs)  
    
    dist (x1, y1, z1) (x2, y2, z2) =  
      (x2 - x1) ^ 2 + (y2 - y1) ^ 2 + (z2 - z1) ^ 2  
    
    connect circuits (a, b) =  
      let (joined, rest) =  
            partition (\c -> a `Set.member` c || b `Set.member` c) circuits  
       in Set.unions joined : rest  
    
    main = do  
      boxes <- map readPos . lines <$> readFile "input08"  
      let steps =  
            (zip <*> tail . scanl' connect (map Set.singleton boxes)) $  
              sortOn (uncurry dist) (pairs boxes)  
      print . product . take 3 . sortOn Down . map Set.size $  
        (snd . last . take 1000 $ steps)  
      let Just (((x1, _, _), (x2, _, _)), _) =  
            find ((== 1) . length . snd) steps  
       in print $ x1 * x2  
    
      
  • Out drinking with friends, some guy we met at the bar was fawning over me. Admittedly he was a bit drunk but still, I couldn't quite believe it. I guess this is a thing that's going to happen from now on.

    Why can't there be more lesbians where I live :/

  • My current go-tos:

    • Part of Your World (Jodie Benson)
    • Kiss Me (Sixpence None The Richer)
    • Eternal Flame (The Bangles)
    • 翼の折れたエンジェル (中村あゆみ)

    I really want to do some Ado songs, but she goes a bit above my range, sadly :/