Avatar for wjrh

wjrh

Member since Apr 2013 • Last active Apr 2021
  • 27 conversations
  • 409 comments

Most recent activity

  • in Bristol
    Avatar for wjrh

    Do any of you Bristolians out there have any gravel routes you wouldn't mind sharing? I've recently started taking my long haul trucker on some rides with a bit of mud. I am well versed with all the lovely road cycling, but really have little knowledge of where is good when you want to throw in some forest paths.

    Any advice is appreciated, cheers!

    • 2 comments
    • 155 views
  • in Bristol
    Avatar for wjrh

    Do any of you Bristolians out there have any gravel routes you wouldn't mind sharing? I've recently started taking my long haul trucker on some rides with a bit of mud. I am well versed with all the lovely road cycling, but really have little knowledge of where is good when you want to throw in some forest paths.

    Any advice is appreciated, cheers!

  • in Bikes & Bits
    Avatar for wjrh

    I really want this, shame £800 is a little steep. Or am I missing something?

    • 3 comments
    • 238 views
  • in Mechanics & Fixin'
    Avatar for wjrh

    Not that anyone probably cares, but would recommend doing this, shorter strut keeps fender really rigid. Plus shorter struts save important grams on this weight weenie build.

  • in Mechanics & Fixin'
    Avatar for wjrh

    I want to mount a VO fender to my LHT. I have a front rack that means my preferred eyelet is taken. I could use a longer bolt and attach to the same eyelet, or bend the strut and attach to the less ideal eyelet.

    Anyone see anything really dumb in attaching the strut to my front rack? Obviously I then couldn't run the fender without the rack, but I don't see this an issue.

    See pic for deets.
    Thank you!

  • in Miscellaneous and Meaningless
    Avatar for wjrh

    Thank you for this! Really useful. I'm planning to carry Haskell on past the advent of code, I feel like it is not a quick language to get competent in!

    Out of interest, in what capacity do you teach into Haskell?

  • in Miscellaneous and Meaningless
    Avatar for wjrh

    My solution to day 3 in Haskell. AoC is the first thing I have ever written in Haskell and it shows! I am an aerodynamics engineer who uses MATLAB and Python to basically just deal with matrix operations. It's been tricky to adjust to a functional way of thinking & where everything is not just a matrix of doubles!

    main = do
        input <- fmap lines $ readFile "input_day03.txt"
        print $ countLetters (tail $ countTrees (every 1 input) [0,3..]) '#'
        print $ product $ countAllTrees input [1,1,1,1,2] [1,3,5,7,1]
    
    countTrees :: [String] -> [Int] -> String
    countTrees [] _ = []
    countTrees (x:xs) (y:ys) = [x !! (y `mod` length x)] ++ countTrees xs ys
    
    countLetters :: String -> Char -> Int
    countLetters str c = length $ filter (== c) str
    
    every :: Int -> [String] -> [String]
    every n (x:xs) = [x] ++ every n (drop (n-1) xs)
    every _ [] = []
    
    countAllTrees :: [String] -> [Int] -> [Int] -> [Int]
    countAllTrees input (x:xs) (y:ys) = 
            [countLetters (tail $ countTrees (every x input) [0,y..]) '#'] 
            ++ countAllTrees input xs ys
    countAllTrees _ [] _ = []
    
  • in Miscellaneous and Meaningless
    Avatar for wjrh

    Anyone else doing this is Haskell? I'm pretty new to it and had to fight my way through the first two days!

Actions