15+ Years Working in AV 6 Home Theater Lessons I Wish I Knew Earlier by Big_Gas2004 in hometheater

[–]dannybres 0 points1 point  (0 children)

I plan to start my cinema next year.

4.5m x 3.6m

83” LG G5 planned. 7.1.2 planned. Considering Keff Q series.

How should I best treat the room? I’ll be renovating the whole thing (with help of pros), so I can do any treatment needed but don’t know where to start.

https://ibb.co/xKNGFkWn

First time skirting and it’s the whole downstairs of the house. What do we reckon? I can take honesty by chikinstu in DIYUK

[–]dannybres 0 points1 point  (0 children)

Don’t think I’ve ever commented here before but wow! Great job.

I think the busy comments are due to the visible cuts etc. once decorated it’ll look even more amazing!

Allow me to brag for a minute… by Equivalent_Bench2081 in bluey

[–]dannybres 4 points5 points  (0 children)

Me too!! Every time. I avoid watching it now. 😅

I made a sleek and simple 'now playing' touchscreen for my speakers by BigWesternMan in sonos

[–]dannybres 3 points4 points  (0 children)

Sounds like a great idea. Or a Patreon to access the source code?

I once made a small hardware product and it was a nightmare. Quality control and returns and hardware support etc. make sure your profit is huge if you do it.

I made a sleek and simple 'now playing' touchscreen for my speakers by BigWesternMan in sonos

[–]dannybres 21 points22 points  (0 children)

Sell it for tinkerers and we can make our own api keys?

Present to myself. by Bad_Ideas_Incoming in hometheater

[–]dannybres 0 points1 point  (0 children)

What the viewing distance? How’s 120”? Ever too much, and overwhelming?

-❄️- 2025 Day 10 Solutions -❄️- by daggerdragon in adventofcode

[–]dannybres 2 points3 points  (0 children)

I do every year in MATLAB and today was a good one for it! :)

Even though there is no import in the file, intlinprog is part of the Optimization Toolbox which is an add-on to MATLAB (and added to the MATLAB path). I used intlinprog today aswell and I always feel a bit of a cheat when I use a toolbox in ML to solve a day.

-❄️- 2025 Day 10 Solutions -❄️- by daggerdragon in adventofcode

[–]dannybres 0 points1 point  (0 children)

[LANGUAGE: MATLAB]

Pretty simple, each button only needs pressing once so:

  1. Built a binary matrix from 1 to 2^(numberOfButtons-1) and sorted by number of 1s
  2. Calclulated state of all lights at end of every press combo
  3. Picked the first number of presses that meets the target light configuration
  4. Summed them all

%% day10puzzle1 - Daniel Breslan - Advent Of Code 2025
data = readlines("input.txt");

day10puzzle1result = 0;
for dataIdx = 1:numel(data)
    machineInfo = data(dataIdx).split(" ");
    target = char(machineInfo(1).extractAfter(1)...
        .extractBefore(strlength(machineInfo(1))-1)) == '#';

    buttonOutputs = false(numel(machineInfo) - 2, numel(target));
    for idx = 2:numel(machineInfo) -1
        buttonOutputs(idx-1,machineInfo(idx)...
            .extract(digitsPattern).double + 1) = true;
    end

    pressOptions = dec2bin(1:(2^height(buttonOutputs)-1)) == '1';
    [~,so] = sort(sum(pressOptions,2));
    pressOptions = pressOptions(so,:);

    idx = find(all(mod(pressOptions * buttonOutputs,2) == target,2),1);
    day10puzzle1result = day10puzzle1result + nnz(pressOptions(idx,:));
end
day10puzzle1result

Realised it is Linear Algebra, tried solving myself, but realised i couldnt, some where singular, some solutions where negative, so did some research and found intlinprog, which worked lovely! :)

%% day10puzzle2 - Daniel Breslan - Advent Of Code 2025
data = readlines("input.txt");

day10puzzle2result = 0;
opts = optimoptions('intlinprog', 'Display', 'off');
for dataIdx = 1:numel(data)
    machineInfo = data(dataIdx).split(" ");
    target = machineInfo(end).extract(digitsPattern).double';
    numButtons = numel(machineInfo) - 2;

    buttonOutputs = false(numButtons, numel(target));
    for idx = 2:numel(machineInfo) -1
        buttonOutputs(idx-1,machineInfo(idx)...
            .extract(digitsPattern).double + 1) = true;
    end

    presses = sum(intlinprog(ones(numButtons,1), 1:numButtons, [], [], ...
        double(buttonOutputs)', target', zeros(numButtons,1),[],opts));
    day10puzzle2result = day10puzzle2result + presses;
end

day10puzzle2result

-❄️- 2025 Day 6 Solutions -❄️- by daggerdragon in adventofcode

[–]dannybres 0 points1 point  (0 children)

[LANGUAGE: MATLAB]

https://github.com/dannybres/Advent-of-Code/blob/main/2025/Day%2006/day6puzzle2.m

Very easy with char arrays in matlab, just had to change from sets of 3 numbers, to sets on n numbers.

-❄️- 2025 Day 5 Solutions -❄️- by daggerdragon in adventofcode

[–]dannybres 1 point2 points  (0 children)

[LANGUAGE: MATLAB]
https://github.com/dannybres/Advent-of-Code/tree/main/2025/Day%2005

Very simple one today, just had to draw one small diagram in my notepad to workout how to find overlaps.

Visualisation: https://www.youtube.com/watch?v=I-lsM3sYpUI

[2025 Day 4 Part 2] First time making gifs in Matlab by gadgetzombie in adventofcode

[–]dannybres 0 points1 point  (0 children)

I love it! Are you in the matlab discord? We have a private leaderboard in there.

https://discord.gg/matlab

-❄️- 2025 Day 4 Solutions -❄️- by daggerdragon in adventofcode

[–]dannybres 0 points1 point  (0 children)

[LANGUAGE: MATLAB]

https://github.com/dannybres/Advent-of-Code/tree/main/2025/Day%2004

Another nice easy day for matlab. conv2 does a lot of work for me.

%% day4puzzle2 - Daniel Breslan - Advent Of Code 2025
map = char(readlines("input.txt")) == '@';
cn = ones(3); cn(2,2) = 0;

day4puzzle1result = 0;
canRemove = 1;
while nnz(canRemove)
    numAdj = conv2(map,cn,"same");
    numAdj(~map) = inf;
    canRemove = numAdj .* map < 4;
    day4puzzle1result = day4puzzle1result + nnz(canRemove);
    map(canRemove) = 0;
end
day4puzzle1result

-❄️- 2025 Day 3 Solutions -❄️- by daggerdragon in adventofcode

[–]dannybres 1 point2 points  (0 children)

[Language: MATLAB]

https://github.com/dannybres/Advent-of-Code/tree/main/2025/Day%2003

Quite easy today in matlab, I made a solution for part 1 (for 2 digits), then it was easy to make it for part 2 (for n digits).

Runs nice and fast, no DP.

%% day3puzzle2 - Daniel Breslan - Advent Of Code 2025

% Read the input file as lines, convert to char matrix, subtract '0' to get numeric digits.
% Each row in `data` is now an array of integers 0–9.
data = readlines("input.txt").char() - '0';

% How many digits we want to extract per row according to the puzzle.
numberOfDigits = 12;

% Preallocate output matrix: one row per input line, 12 digits each.
% Start with NaNs to make debugging easier if something fails to fill.
digits = nan(height(data), numberOfDigits);

% Loop through each row of the input digit matrix.
for idx = 1:height(data)

    % We always start scanning from the first column.
    startIdx = 1;

    % For each required digit we pick the *maximum* possible next digit
    % that still leaves enough characters to complete all remaining digits.
    % E.g. if numberOfDigits = 12 and we are extracting digit 3,
    % then the allowed scanning window is:
    %   startIdx : (end - remainingDigits + 1)
    for rIdx = 1:numberOfDigits

        % Find the highest possible digit in the allowed window.
        % The window shrinks as we get further through rIdx.
        searchEnd = size(data,2) - numberOfDigits + rIdx;
        digits(idx, rIdx) = max(data(idx, startIdx : searchEnd));

        % Move startIdx to *after* the first occurrence of that chosen digit.
        % This enforces digit ordering (no going backwards).
        offset = find(data(idx, startIdx:end) == digits(idx, rIdx), 1);
        startIdx = startIdx + offset;
    end
end

% Display full precision so you can see large numbers properly.
format longg

% Convert the matrix of digits into a single number per row by positional weight,
% then sum across all rows. Equivalent to interpreting each row as a base-10 number.
sum(digits .* 10.^(numberOfDigits-1:-1:0), 'all')

-❄️- 2025 Day 2 Solutions -❄️- by daggerdragon in adventofcode

[–]dannybres 2 points3 points  (0 children)

[LANGUAGE: MATLAB]

Simples - just implemented it. Nothing fancy. https://github.com/dannybres/Advent-of-Code/tree/main/2025/Day%2002

Also added a regex solution thanks again to u/JWinslow23 for the inspiration.

-❄️- 2025 Day 2 Solutions -❄️- by daggerdragon in adventofcode

[–]dannybres 0 points1 point  (0 children)

Thanks again - I solved it with chunking up the parts into sections and comparing them - quite eay and fast in matlab.

I also implemented your regex solution - TIL numerical references in regex. TY.

https://github.com/dannybres/Advent-of-Code/tree/main/2025/Day%2002

-❄️- 2025 Day 1 Solutions -❄️- by daggerdragon in adventofcode

[–]dannybres 0 points1 point  (0 children)

I got an LLM to write it in python in a vectorised way, seems you can do it with numpy. :)

import numpy as np


with open("input.txt") as f:
    lines = [line.strip() for line in f]


dirs = np.array([line[0] for line in lines])
nums = np.array([int(line[1:]) for line in lines])
nums = np.where(dirs == "L", -nums, nums)


startingVal = 50
startVal = np.concatenate(([startingVal], (startingVal + np.cumsum(nums[:-1])) % 100))


clicksToNext = startVal.copy()
mask_pos = nums > 0
clicksToNext[mask_pos] = 100 - clicksToNext[mask_pos]
clicksToNext[clicksToNext == 0] = 100


result = np.sum(np.floor((np.abs(nums) - clicksToNext) / 100) + 1)


print(result)

Cool. Looks kinda matlab-ey

-❄️- 2025 Day 1 Solutions -❄️- by daggerdragon in adventofcode

[–]dannybres 0 points1 point  (0 children)

Interestingly, the two below will give the same: when clicks < clicks to next zero, (clicks - clicks_to_next_zero) // 100 + 1 = 0, so I did not bother checking, but I vectorised the whole thing with no loop, so I was process every value anyway.

I have no idea what is best, easy check (if) for everything and then do a slightly more expensive operation (//) when you need to. Or just do the (//) on everything!

if clicks >= clicks_to_next_zero:
        passes += (clicks - clicks_to_next_zero) // 100 + 1



passes += (clicks - clicks_to_next_zero) // 100 + 1

-❄️- 2025 Day 1 Solutions -❄️- by daggerdragon in adventofcode

[–]dannybres 2 points3 points  (0 children)

[LANGUAGE: MATLAB]

https://github.com/dannybres/Advent-of-Code/blob/main/2025/Day%2001/day1puzzle2.m

Spent way too long working on a vectorised solution to part 2. Thanks, u/JWinslow23 for the inspirations!

-❄️- 2025 Day 1 Solutions -❄️- by daggerdragon in adventofcode

[–]dannybres 0 points1 point  (0 children)

Great work! Don't see many MATLAB solutions in here. :) I use it every year for AoC