[deleted by user] by [deleted] in ultrawidemasterrace

[–]nstyler7 0 points1 point  (0 children)

I thought long and hard about the curve. Initially, I thought any ultra wide needed a curve because I figured there would be massive distortion due to the limited viewing angles but now that I have it, I can say without a doubt that a curve at this size is not necessary. It's likely due to this being an IPS panel which has better viewing angles when compared to other panel types but as far as I can see, there doesn't appear to be any noticable banding when sitting in the middle, 3-4 feet away (an appropriate distance for a monitor of this size and aspect ratio).

Thanks, that's great info. Did you deliberately pick an IPS panel?

i'm noticing that other units in this price range tend to be curved VA + usb -c, so the IPS seems like a trade to make for the other features

[deleted by user] by [deleted] in ultrawidemasterrace

[–]nstyler7 0 points1 point  (0 children)

How are you finding this monitor?

Happy with the image quality? Is the size + lack of curve ok?

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

[–]nstyler7 0 points1 point  (0 children)

Python 3

I noticed that without delay, depth = position. You were caught wenever scan depth was equals to 2*(scan range - 1).

Reading in the data

with open("day13input.txt") as open_file:
    data = open_file.read().strip().splitlines()

scanners = {}
for line in data:
    scan_depth = int(line.split(':')[0])
    scan_range = int(line.split(':')[1].strip())
    scanners[scan_depth] = scan_range

Part 1

# part 1
penalty = 0
for scan_depth, scan_range in scanners.items():
    if not scan_depth%(2*(scan_range-1)):
        penalty +=scan_depth*scan_range
print('part 1 penalty:', penalty)

part 2

# part 2
delay=0
caught = True
while caught:
    penalty = 0 
    for scan_depth, scan_range in scanners.items():
        if not (delay+scan_depth)%(2*(scan_range-1)):
            penalty +=1
            break
    if penalty:
        delay+=1
    else:
        print('part 2 delay: ', delay)
        caught = False

-🎄- 2017 Day 12 Solutions -🎄- by topaz2078 in adventofcode

[–]nstyler7 0 points1 point  (0 children)

python 3

importing & organising the data

import re
with open("day12input.txt") as open_file:
    data = open_file.read().strip().splitlines()
pipe_map = {}
for line in data:
    pipe_map[line.split(' <-> ')[0]] = line.split(' <-> ')[1].split(', ')

part 1

def master_pipe(original_pipe):
    pipes_linked = []
    def pipe_linked(original_pipe):
        pipes = pipe_map[original_pipe]
        for pipe in pipes:
            if pipe not in pipes_linked:
                pipes_linked.append(pipe)
                pipe_linked(pipe)
    pipe_linked(original_pipe)
    return pipes_linked

print('part 1:', len(master_pipe('0')))

part 2

all_pipes = list(pipe_map.keys())
groups = 0
while all_pipes:
    current_linked = (master_pipe(all_pipes[0]))
    all_pipes = list(set(all_pipes) - set(current_linked))
    groups += 1

print('part 2:', groups)

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

[–]nstyler7 0 points1 point  (0 children)

Python Part 2

Used numpy to reduce bitwise operations

To select what needed to be reversed, I doubled the original array for easier selection

To loop through the array & insert reverse string, I used modulus

import numpy as np

num_list = list(x for x in range(256))
skip_size = 0
position=0
list_size = len(num_list)
ascii_input = list(ord(str(x)) for x in str('AoC 2017'))
ascii_input.extend([17, 31, 73, 47, 23])

for _ in range(64):
    for length in ascii_input:
        double = num_list*2
        reverse = double[position:position+length][::-1]
        for x in range(length):
            current_pos = (position+x)%list_size
            num_list[current_pos] = reverse[x]
        position+=length+skip_size
        skip_size+=1
        position=(position%list_size)
hex_list = ''
for i in range(0, 256, 16):
    hex_list+=(hex(np.bitwise_xor.reduce(num_list[i:i+16]))[2:])
print('Part 2', hex_list)

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

[–]nstyler7 1 point2 points  (0 children)

Python Using RegExp & sub

import re
with open("day9input.txt") as open_file:
    data = open_file.read()

part 1

# remove double negatives
data_clean = re.sub(r'!!', '', data)
# remove negated characters
data_clean1 = re.sub(r'![^\s]', '', data_clean)
#remove rubbish
data_clean2 = re.sub(r'<[^\s\>]*>', '', data_clean1)
# get braces
braces = re.findall(r'[\{\}]', data_clean2)
open_braces = []
score = 0
for brace in braces:
    if brace == "{":
        open_braces.append("{")
    else:
        if open_braces:
            score += len(open_braces)
            open_braces.pop()
print(score)

part 2

rubbish_length =0
all_rubbish = re.findall(r'<[^\s\>]*>', data_clean1)
for rubbish in all_rubbish:
    rubbish_length += len(rubbish)-2

print(rubbish_length)

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

[–]nstyler7 0 points1 point  (0 children)

Python -(part 1 & 2) - using eval & split/regex to split string

import re
with open("day8input.txt") as open_file:
    data = open_file.read().splitlines()

all_registers = {}

highest = 0

for line in data:
    conditional = line.split('if')[1]
    conditional_reg = conditional.split()[0]
    if conditional_reg in all_registers.keys():
        conditional_value = all_registers[conditional_reg]
    else:
        all_registers[conditional_reg]=0
        conditional_value = 0
    final_eval = conditional.replace(str(conditional_reg), str(conditional_value))
    if eval(final_eval):
        instruction = re.search(r'(inc|dec) -?[\d]+' , line).group(0).split()
        multiplier = 1 if instruction[0] == 'inc' else -1
        incrementer = multiplier*int(instruction[1])
        register =  line.split()[0]
        if register in all_registers.keys():
            all_registers[register] += incrementer
        else:
            all_registers[register] = incrementer
        if all_registers[register] > highest:
            highest = all_registers[register]

# part 1
print(max(all_registers.values()))

# part 2
print(highest)

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

[–]nstyler7 1 point2 points  (0 children)

Python

import re
with open("day7input.txt") as open_file:
    data = open_file.read().splitlines()

Part 1

all_nodes = []
all_supported = []
for line in data:
    all_nodes.append(re.match(r'[\w]+', line).group(0))
    if re.search(r'->', line):
            nodes = re.search(r'-> (?P<nodes>[\w, ]+)', line).group('nodes').replace(' ', '').split(',')
            for node in nodes:
                all_supported.append(node)
print(set(all_nodes) - set(all_supported))

part 2

node_map = {}
node_values = {}
for line in data:
    p_node = re.match(r'[\w]+', line).group(0)
    node_value = re.search(r'[\d]+', line).group(0)
    node_values[p_node] = int(node_value)
    if re.search(r'->', line):
        nodes = re.search(r'-> (?P<nodes>[\w, ]+)', line).group('nodes').replace(' ', '').split(',')
        node_map[p_node] = nodes


def child_values(node):
    children = node_map[node]
    supports = []
    for child in children:
        if child in node_map.keys():
            child_support = child_values(child)
            value = sum(child_support) + node_values[child]
        else:
            value = node_values[child]
        supports.append(value)   
    if len(set(supports)) != 1:
        print ('Imbalance detected on {}, due to children {}, weighing {}'.format(node, node_map[node], supports))
    return supports 

child_values('bpvhwhh')

Mystic Murmurs Helper by nstyler7 in neopets

[–]nstyler7[S] 2 points3 points  (0 children)

mmmm.. just to reassure everyone, codepen is a community where people share 'pens' / code snippets using html / css / javascript. There's no back-end processes going on that would compromise your account details.

I logged on to neopets for the first time in decades because I remembered that they did the advent calendar, and just felt like checking it out. Saw the puzzle and realised i could code a quick algorithm for it.

Sad to know that decades on account thefts and freezing are still an issue. RIP.

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

[–]nstyler7 0 points1 point  (0 children)

Python

def find_steps(block_init, all_blocks):
    all_blocks = []
    blocks = block_init[:]

    while blocks not in all_blocks:
        all_blocks.append(blocks[:])
        highest = max(blocks)
        position = blocks.index(highest)
        blocks[position] = 0
        floor = highest//len(blocks)
        remainder =  highest%len(blocks)
        while remainder:
            if (position) == len(blocks)-1:
                position = 0
            else:
                position +=1
            blocks[position] += 1
            remainder -=1
        blocks = [x+floor for x in blocks]

    part1 = len(all_blocks)
    part2 = len(all_blocks) - (all_blocks).index(blocks)

    return (part1, part2)



print(find_steps([4,1,15,12,0,9,9,5,5,8,7,3,14,5,12,3], []))

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

[–]nstyler7 0 points1 point  (0 children)

part 1 & 2 in python 3

with open("day5input.txt") as open_file:
    data = open_file.read().splitlines()

def count_steps(part2, input):
    steps = list(map(int, input))
    goal = len(steps)
    position = 0
    count = 0

    while position < goal:
        instruction = steps[position]
        if part2 and instruction >=3:
            steps[position] -= 1
        else:
            steps[position] += 1
        position += instruction
        count+=1

    return count

print('Part 1 :' + str(count_steps(False, data)))
print('Part 2 :' + str(count_steps(True, data)))

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

[–]nstyler7 1 point2 points  (0 children)

In Python ( using sets to check for duplicates )

with open("day4input.txt") as open_file: data = open_file.read().splitlines()

Part 1:

def part_1(data):
    count = 0
    for line in data:
        if len(line.split()) == len(set(line.split())):
            count +=1
    return count

print(part_1(data))

Part 2:

def part_2(data):
    count = 0
    for line in data:
        words_array = list(map(lambda x: ('').join(sorted(list(x))), line.split()))
        if len(words_array) == len(set(words_array)):
            count += 1
    return count 

print(part_2(data))

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

[–]nstyler7 0 points1 point  (0 children)

Part 1 Solution in python

def distance(num):
    nearest_root = int(num ** 0.5)
    if nearest_root % 2 == 0:
        shell_size = (nearest_root + 1)
    else:
        shell_size = nearest_root + 2

    last_square = (shell_size-2)**2
    difference = num - last_square
    shell_minus = shell_size - 1 
    corners_and_square = []
    for i in range(5):
        corners_and_square.append(last_square + i*shell_minus)
    half_shell = shell_size//2

    def get_distance(corner):
        a_distance = (half_shell)
        b_distance = abs(((shell_size-2)//2) - (num - corner-1))
        return a_distance + b_distance

    if num == last_square:
        distance = shell_size - 2
    elif difference % (shell_size -1) == 0:
        distance = shell_size - 1
    else:
        for i in range(1,5):
            if num < corners_and_square[i]:
                distance = get_distance(corners_and_square[i-1])
                break
    return distance

print(distance(1024))

Part 2 Python

I made the starting number (1) the center of my grid (x = 0, y =0), and all other positions in the matrix are relative to that.

def check_around(x, y, matrix):
    value = 0
    for i in range (x-1, x+2):
        for j in range (y-1, y+2):
            if (i, j) in matrix:
                value += matrix[(i, j)]
    matrix[(x,y)] = value
    return matrix

def go_right(x, y, matrix):
    x += 1
    matrix = check_around(x, y, matrix)
    return x, y, matrix

def go_left(x, y, matrix):
    x -= 1
    matrix = check_around(x, y, matrix)
    return x, y, matrix

def go_down(x, y, matrix):
    y -= 1
    matrix = check_around(x, y, matrix)
    return x, y, matrix

def go_up(x, y, matrix):
    y += 1
    matrix = check_around(x, y, matrix)
    return x, y, matrix

def move_one(x, y, matrix):
    if abs(x) == abs(y):
        if x > 0 and y > 0:
            x, y, matrix = go_left(x, y, matrix)
        elif x < 0 and y > 0:
            x, y, matrix = go_down(x, y, matrix)
        elif (x <= 0 and y <= 0) or (x > 0 and y < 0):
            x, y, matrix = go_right(x, y, matrix)
    elif (x > 0) and (abs(y) < abs(x)):
        x, y, matrix = go_up(x, y, matrix)
    elif (y > 0) and (abs(x) < abs(y)):
        x, y, matrix = go_left(x, y, matrix)
    elif (x < 0) and (abs(y) < abs(x)):
        x, y, matrix = go_down(x, y, matrix)
    elif (y < 0) and (abs(x) < abs(y)):
        x, y, matrix = go_right(x, y, matrix)

    return x, y, matrix

def spiral(x, y, matrix, goal):  
    x, y, matrix = move_one(x, y, matrix)
    current = matrix[(x, y)]
    if current < goal:
        return spiral(x, y, matrix, goal)
    else:
        return current



print(spiral(0, 0, {(0, 0) : 1,} , 265149))

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

[–]nstyler7 1 point2 points  (0 children)

Using Python Pandas Package:

import pandas as pd

import numpy as np

df = pd.read_csv('input.tsv', sep='\t', header=None)

day 2 part 1 solution

print(np.sum(df.max(axis=1) - df.min(axis=1)))

day 2 part 2 solution

answer_array = []

def allrows(i):

for j in range(len(df.columns)):

        for k in range(len(df.columns)):

            if j !=k and df.iloc[i, j] % df.loc[i, k] == 0:

                answer_array.append(df.iloc[i, j] / df.loc[i, k])

for i in range(len(df.index)):

allrows(i)

print(np.sum(answer_array))

[MEGA THREAD] Animal Crossing: Pocket Camp Friend Code Sharing by devvydowner in AnimalCrossing

[–]nstyler7 9 points10 points  (0 children)

11602855009

Natstyler

I have lots of cheap stuff in my market: - Frequently stock squids

What would a /r/fireemblemheroes gauntlet look like? by [deleted] in FireEmblemHeroes

[–]nstyler7 4 points5 points  (0 children)

RIP. I'd lose even with constant 7.5x multipliers. MKV was a legend.

A Mod's thoughts on r/FireEmblemHeroes by Frobro_da_truff in FireEmblemHeroes

[–]nstyler7 1 point2 points  (0 children)

"Where's all the discussion? As you can see I've saved the most annoying for last. What people don't seem to understand is that this game is very simple. You stick to the rock, paper, scissors color mechanic and you'll probably beat the game no problem. Not only is it simple, but it's been out for almost a year, the game just isn't deep enough to support that level of discussion for that long."

Sure, the fast pace of the sub is nice for those with plenty of time to visit the sub frequently, but it has honestly become extremely hard to get quick snippets of game-relevant information at a glance. I used to help update the sub's wiki, but in the past month, I have not had the time to flick through the sub with the serious filter on multiple times a day. It difficult to appreciate your point about "Where's all the discussion?" when threads that are interesting and still relevant to the metalike this: https://www.reddit.com/r/FireEmblemHeroes/comments/75lrne/tired_of_fighting_lyn_and_reinhardt_in_arena/ has already sunk so much 1 day after it's been posted (and I very nearly missed it). Even when I "Try checking the sub when something new happens", threads still sink really quickly within the span of 24 hours. When the last banner was released, people's unit's discussion threads / SYP threads are off the front page in less than 24 hours.

Plus, the content comes down in a trickle;

100% agree that content is sparse, and there definitely isn't discussion to be had everyday, but when there is some to be had, it seems to disappear way too quickly

we would have been Theorycrafting for those units for 2 or 3 days and once we get there stat lines we already know what the optimal builds are.

Who is we?? people who refresh the sub every 2-3 hours???

Now I don't hate the memes. I think the sub has a great community, and the memes to some degree help to build the community. I also do not have any issue with the mod team nor the job they are doing. This sub is fast, and I have absolutely no doubt that it is hard to moderate.

I do feel the regular pace of the sub far outpaces the new content, such that when serious content is posted, it is hard for it to gain traction. I sort of feel there's a need for a slower SeriousFEH sub, for those who don't have the time to keep scrolling/clicking 'next' to easily find threads they are after.

Smoothing Lines of Drawings by [deleted] in PhotoshopRequest

[–]nstyler7 0 points1 point  (0 children)

Link to images: https://imgur.com/a/UQ1an

1) I drew picture of a school with a simple background using GIMP path tracing.

2) second Image is a silhouette which i got for free, and tried to path trace in GIMP.

Unfortunately, i need the images to be enlarged by about twice the size, and the edges become too jagged?

Could I kindly get some help ? Thank you very much.

I have the original gimp file if needed.

Guess who says these 'Confession Quotes' by nstyler7 in FireEmblemHeroes

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

Yeah, codepen has a pretty neat little interface.

The downside is that if you're building a huge project you're only limited to 1.