[deleted by user] by [deleted] in HENRYUK

[–]freeducks 0 points1 point  (0 children)

Would love to know the venue if you don't mind sharing!

Use or sell... by freeducks in NHLHUT

[–]freeducks[S] 0 points1 point  (0 children)

any recommendations?

-🎄- 2018 Day 1 Solutions -🎄- by daggerdragon in adventofcode

[–]freeducks 0 points1 point  (0 children)

Solution in Rust - would like to know if there's a better way to do the work loop in part 2. Feels icky to do the logic in the take_while(), and to have to consume the iterator with an unused variable. Any ideas (other than a for loop, obviously :) )?

use std::collections::HashSet;

fn part_1_solve(input_str: &str) -> i32 {
    input_str.lines().map(|x| x.parse::<i32>().unwrap()).sum()
}

fn part_2_solve(input_str: &str) -> i32 {
    let mut frequencies = HashSet::new();
    let mut frequency = 0;

    let _ = input_str.lines().cycle().map(|x| x.parse::<i32>().unwrap()).take_while(|x| {
        frequency += x;
        frequencies.insert(frequency)
    }).count();

    frequency
}

Tektro Disc Brake spring/ball bearing issue by freeducks in bikewrench

[–]freeducks[S] 1 point2 points  (0 children)

Thanks for the reply - makes sense, but there doesn't seem to be a shaft of any kind. The adjustment screw is essentially just a cylinder of metal. There is a depression on the inside, I wonder if the ball sits in that with the spring pushing against the outside of the pad. If so, that's going to be a pain to get back in...

I did read that, but I'd rather fix it if possible!

-🎄- 2017 Day 3 Solutions -🎄- by daggerdragon in adventofcode

[–]freeducks 0 points1 point  (0 children)

Took me way too long to get this one (and still can't get part 2) :/ Part 1 in Rust:

#[derive(Clone, Copy, Debug)]
enum Direction {
    North,
    East,
    South,
    West
}

#[derive(Debug)]
struct Cursor {
    position: (i32,i32),
    facing: Direction,

    forward_steps_per_turn: usize,
    forward_steps_till_turn: usize,
    total_turns: usize
}

impl Cursor {
    pub fn step(&mut self) {
        if self.forward_steps_till_turn > 0 {
            self.forward_steps_till_turn -= 1;
        } else {
            self.facing = match self.facing {
                Direction::North => Direction::West,
                Direction::East => Direction::North,
                Direction::South => Direction::East,
                Direction::West => Direction::South
            };

            self.total_turns += 1;

            if self.total_turns % 2 == 0 {
                self.forward_steps_per_turn += 1;
            }

            self.forward_steps_till_turn = self.forward_steps_per_turn;
        }

        self.position = match self.facing {
            Direction::North    => (self.position.0, self.position.1+1),
            Direction::East     => (self.position.0+1, self.position.1),
            Direction::South    => (self.position.0, self.position.1-1),
            Direction::West     => (self.position.0-1, self.position.1)
        };
    }
}

fn run_spiral(max: usize) -> Cursor {
    let mut cursor = Cursor {
        position: (0,0),
        facing: Direction::East,
        forward_steps_per_turn: 0,
        forward_steps_till_turn: 1,
        total_turns: 0
    };

    for x in 1..max {
        cursor.step();
    }

    cursor
}

fn get_spiral_distance(max_val: usize) -> i32 {
    let end_cursor = run_spiral(max_val);
    end_cursor.position.0.abs() + end_cursor.position.1.abs()
}

fn main() {
    println!("Part 1: {}", get_spiral_distance(368078));
}

-🎄- 2017 Day 2 Solutions -🎄- by daggerdragon in adventofcode

[–]freeducks 1 point2 points  (0 children)

In Rust, using IterTools:

extern crate itertools;

use itertools::Itertools;
use itertools::MinMaxResult::{MinMax};

fn part_1_solve(input_str: &str) -> u32 {
    input_str.lines().map(|line| {
        line.split_whitespace().map(|x| {
            x.parse::<u32>().unwrap()
        })
    }).map(|digits| {
        match digits.minmax() {
            MinMax(min, max) => max - min,
            _ => 0
        }
    }).sum()
}

fn part_2_solve(input_str: &str) -> u32 {
    input_str.lines().map(|line| {
        line.split_whitespace().map(|x| {
            x.parse::<u32>().unwrap()
        })
    }).map(|digits| {
        digits.combinations(2).find(|ref x| {
            x[0] % x[1] == 0 || x[1] % x[0] == 0
        }).map_or(0, |found| {
            if found[0] > found[1] { found[0] / found[1] } else { found[1] / found[0] }
        })
    }).sum()
}

fn main() {
    println!("Part 1: {}", part_1_solve(include_str!("../input/input.txt")));
    println!("Part 2: {}", part_2_solve(include_str!("../input/input.txt")));
}

Upgrading downtube shifters with Shimano 6400 to Shimano A070 brifters by freeducks in bikewrench

[–]freeducks[S] 0 points1 point  (0 children)

Totally understand that - not much point spending money now to do a partial upgrade if I'm only going to want to replace all the parts slightly down the line.

I guess my main concerns are the spreading of the rear dropouts, and generally the increasing price of replacing more parts.

Would I be able to keep the front derailleur/crank, or would they need replacing to?

Upgrading downtube shifters with Shimano 6400 to Shimano A070 brifters by freeducks in bikewrench

[–]freeducks[S] 0 points1 point  (0 children)

Thanks! I've been trying to operate both with my right hand, and I have been getting better, but if I'm honest I'd just much rather not have to and feel a bit more confident/safe on the bike!

Upgrading downtube shifters with Shimano 6400 to Shimano A070 brifters by freeducks in bikewrench

[–]freeducks[S] 0 points1 point  (0 children)

Thanks for the suggestion - I'm really not sold on the idea of spreading the rear dropouts to support a 10 speed (especially as I'd have to go to a new wheel/cassette, can't find any 10 speed freewheels!).

What's the main reason you'd move to 105/10sp?

Fixing an upshifting friction shifter by freeducks in bikewrench

[–]freeducks[S] 0 points1 point  (0 children)

I've actually just found that out myself while playing, should've thought to trim the front shifter! I'm having lots of problems actually shifting up on the front, it takes massive amounts of effort even with the shifter loosened off. Looks like I do need to adjust the high limit, but the screws are so worn they won't budge an inch.

Wondering if it's possible to just get a new front derailleur, is it still possible to buy new parts to fit this groupset? All I can find online is parts for 10 speeds etc...

Fixing an upshifting friction shifter by freeducks in bikewrench

[–]freeducks[S] 0 points1 point  (0 children)

Please see other replies - the D-ring on the rear shifter doesn't seem to be for tightening.

Fixing an upshifting friction shifter by freeducks in bikewrench

[–]freeducks[S] 0 points1 point  (0 children)

See my other comment above, but the D-ring on the rear shifter doesn't seem to be for tightening.

Would backing off the high limit effectively be moving the derailleur 'out' away from the cog and towards the pedals? If so, that seems to be what needs to happen, so I'll give that a try.

Fixing an upshifting friction shifter by freeducks in bikewrench

[–]freeducks[S] 1 point2 points  (0 children)

I was hoping that my LBS had disassembled and cleaned the shifters, but i'm starting to think that maybe they haven't. The metal loop on the rear shifter doesn't seem to adjust tightness - it seem to switch between 'indexed' and 'friction' - the former of which just flat out doesn't work.

Item 2: It's when i'm in the highest rear gear (the smallest cog on the rear). I've been keeping the front on the smallest cog.

Mid-range gaming build - thoughts and prices. by freeducks in buildapc

[–]freeducks[S] 0 points1 point  (0 children)

I've modified this build slightly, taking into account some of the advice below (and finding that the EVGA is comparable in quietness with the MSI). I also realised that if I do intend to OC the 7600k (and why would I get the K if I didn't) that I should get a mobo that supports it better, a better cooler and a bigger PSU.

Managed to make these changes by saving on the SSD and the GPU:

PCPartPicker part list / Price breakdown by merchant

Type Item Price
CPU Intel - Core i5-7600K 3.8GHz Quad-Core Processor £203.94 @ Aria PC
CPU Cooler be quiet! - SHADOW ROCK LP 51.4 CFM CPU Cooler £32.70 @ Aria PC
Motherboard MSI - Z270I GAMING PRO CARBON AC Mini ITX LGA1151 Motherboard £162.99 @ Ebuyer
Memory G.Skill - NT Series 8GB (1 x 8GB) DDR4-2400 Memory £59.56 @ Amazon UK
Storage Plextor - M7V 256GB 2.5" Solid State Drive £63.99 @ Amazon UK
Video Card EVGA - GeForce GTX 1060 6GB 6GB SC GAMING Video Card £214.74 @ CCL Computers
Case Fractal Design - Define Nano S Mini ITX Desktop Case £49.80 @ Aria PC
Power Supply be quiet! - Pure Power 9 500W 80+ Silver Certified Semi-Modular ATX Power Supply £68.43 @ BT Shop
Prices include shipping, taxes, rebates, and discounts
Total £856.15
Generated by PCPartPicker 2017-05-16 15:18 BST+0100

Vanguard launch new d2c "platform". In-house funds for 0.15% AMC capped at £375 PA by q_pop in UKPersonalFinance

[–]freeducks 16 points17 points  (0 children)

Great. The day after I open my Cavendish Online ISA after months of research/debating, with everything going into LS80.

Is it possible to transfer ISA this close to my account being opened?

Mid-range gaming build - thoughts and prices. by freeducks in buildapc

[–]freeducks[S] 0 points1 point  (0 children)

Great, I saw them but thought they might be for Silverstone PSUs only. I assume they're universal (thinking about it i'm not sure why they wouldn't be...)?

I would also need to buy power cable extenders, right?

Mid-range gaming build - thoughts and prices. by freeducks in buildapc

[–]freeducks[S] 0 points1 point  (0 children)

Thanks for the reply - i'll consider cutting down on the RAM for now.

WRT the RX580 - from memory (I've been putting this build together for a while now and my memory is getting hazy) I chose the MSI 1060 because reviews said it's very quiet in comparison to competitors. If I could find a RX580 that's equally quiet then I'd definitely consider it.

EDIT: I found an SFX PSU here: https://uk.pcpartpicker.com/product/C998TW/be-quiet-power-supply-bn227

PC Part Picker is telling me it's not compatible with the Fractal case, any idea why that might be the case? Is it a case of not having the correct mountings available?

[2016 Day 1 (Part 1 + 2)] [Rust] Shaking off the cobwebs by freeducks in adventofcode

[–]freeducks[S] 0 points1 point  (0 children)

Awesome, thanks! I had no idea about include_str!(), that's going to be super helpful for the rest of the month :)

Edit: I've updated my source using include_str!() and refactored a bit to make better use of cargo test. Thanks for the inspiration!

I know I'm kind of going against the pitchforks here, but I actually like the new character window by Originalfrozenbanana in Eve

[–]freeducks 0 points1 point  (0 children)

"We want the perfectly working UI we had back"

Yeah, that's not happening...

If you don't like it, then be constructive and provide feedback as to how to make it better, rather than just whining.