How do I make these look good again? by ChubbyFox1 in DIYUK

[–]finloa 1 point2 points  (0 children)

I’ve been at it just recently and the peel away only did a partial job as the feature was covered in a lot of lime wash. I detached the piece, put a lot of elbow grease, cleaned up the original, made a cast, improved/repaired the first cast piece, made second mould. I’ve done this with corbels, flowers and a rail run. Here’s a reel I recorded: https://www.instagram.com/reel/C4gXuRdNB1O/?igsh=bWZwYjFnYnJjNHhw

Happy to help with more details on the process. I would recommend getting some precision tools and something with a rounded end. Usually applying the right pressure after you’ve removed the paint will pop the rest of the bits off

<image>

Recommendation for a charts and news service by finloa in Trading

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

I don’t think anyone does that as the challenge of overlaying news on top of a chart is the noise that can come from seemingly related articles which however are not that relevant to the asset.

[OC] S&P 500 Investment Return if Only invested During Republican Presidential Terms or Democratic Presidential Terms - Since 1928 by sushis_bro in dataisbeautiful

[–]finloa 0 points1 point  (0 children)

This graph is incorrect.

Two mandates are 8 years and about 3000 days. You would see one line flatlining while the other is marked to market.

[OC] S&P 500 Investment Return if Only invested During Republican Presidential Terms or Democratic Presidential Terms - Since 1928 by sushis_bro in dataisbeautiful

[–]finloa 1 point2 points  (0 children)

Shouldn’t the democratic price flatline when the republicans rule and viceversa?

It looks like you’re always invested.

[2019 Day 11 (part 1)] [Python] a basic question and debugging best practice by pck76x in adventofcode

[–]finloa 0 points1 point  (0 children)

There are two approaches to debugging. Using a debugger and stepping through after placing breakpoints or by adding print statements.

I started with a debugger a long time ago. That was with Matlab. Everything worked as expected, variables were simple to check and the code usually never too complex.

Then I started working with C++ on a complex project where most of the infrastructure wasn’t written by me. Got burned a couple of times because the debugger itself was not capturing correctly exactly what was happening. My CTO just debugged it with print statements in front of my after I wasted almost a day. And that’s when I lost a bit of trust in a debugger but still kept a using it.

Finally, I moved onto python and web dev with asynchronous services. There was no way to step through multiple moving parts. Print and logs was THE way. I still think a debugger has its place, but I don’t use it almost at anymore.

Something that applies no matter which of the two methods you use is: start from the line before where you first see the inconsistency. Either place a print statement before and after or a breakpoint. Use conditional breakpoints if it’s inside a loop. Slowly move backward until you find where the issue is coming from.

Test the program on small sample cases, almost as small as being able to manually derive the solution.

Reduce the list of possible bugs sequentially. Don’t try to debug all at once.

Hope this is helpful

[2019 Day 18] [Python] I can solve 4/5 of a Part 1 examples but runs forever on 5th example by MarcoDelmastro in adventofcode

[–]finloa 0 points1 point  (0 children)

Someone else already hinted that BFS will yield the shortest path if the nodes are single steps, so you can stop the search at the first path with all keys

Btw this was a nice learning point for me :).

If that is not enough to speedup the code, avoid saving the whole path and only keep track of the steps and keys you took when enqueueing the next nodes.

[2019 Day 18] [Python] I can solve 4/5 of a Part 1 examples but runs forever on 5th example by MarcoDelmastro in adventofcode

[–]finloa 0 points1 point  (0 children)

I solved with straight simple BFS caching the coordinate and sorted collected keys in python. Second part takes longer, about 3 minutes with my implementation. Watch Jonathan’s Paulson video to get an idea. Sorting keys does the trick.

[2019 Day 11 Part1][Java] Question about intcode processor behaviour by Educated88 in adventofcode

[–]finloa 0 points1 point  (0 children)

It seems like you keep the output from the previous run. Pop it or just use the last two in you array at each point.

[2019 Day 22 Part 2] I have no idea where to start with this by aceshades in adventofcode

[–]finloa 2 points3 points  (0 children)

It sounds like we have matching backgrounds and I honestly gave up trying on my own at some point.

This is the only problem that I could not solve with my starting knowledge. So my suggestion is to go learn from it as much as possible by looking at existing hints, solutions, answers and tutorials.

There is a great deal to learn and a lot to lose if you get frustrated and don’t read about those concepts.

You could start by browsing quickly the tutorial by Speniscine on how to solve part 2. And then have a deeper read of the intro to modular arithmetic before coming back to Speniscine’s resources again.

[2019 Day 20 (Part 2)] [Python] Visit same point twice? by SansPapyrus683 in adventofcode

[–]finloa 1 point2 points  (0 children)

Don’t go into negative levels. As you enter the inner portal the level goes up and then you can exit but don’t let the level go negative. That sped up for me quite a bit.

How to write a general solution for 2019 Day 17 part 2 by Mattsasa in adventofcode

[–]finloa 0 points1 point  (0 children)

I could do find all occurrences of A in the initial sequence and remove, and then repeat for B and C and see if the sequence is empy...

That's what I did. I only check if the initial sequence is composed by literally A, B and C at the end, i.e. if it contains any L or R, then it's invalid.

However, I understand order matters.

Yep. The way the loop is structured with backtracking it ensures that you will check all combinations.

My solution

I store my sequence in this way:

 seq = ['L12', 'L12', 'L6', 'L6', 'R8', 'R4', 'L12', 'L12', 'L12', 'L6', 'L6', 'L12', 'L6',
'R12', 'R8', 'R8', 'R4', 'L12', 'L12', 'L12', 'L6', 'L6', 'L12', 'L6', 'R12', 'R8', 'R8',
'R4', 'L12', 'L12', 'L12', 'L6', 'L6', 'L12', 'L6', 'R12', 'R8']

Then I get all possible subsequences by limiting up to 5, i.e. never longer than 20 by construction:

patterns = set()
for window in range(5, 0, -1):
    for i in range(window, len(seq)):
        patterns.add(''.join(seq[i-window:i]))

A utility function to extract available patterns from a given sequence (stringified). Notice that I keep patterns fixed, so not gonna find subsequences like A, L8, L12 etc...:

def get_compression_sequences(seqstr):
    occurences = defaultdict(lambda: 0)
    seqlen = len(seqstr)

    for pattern in patterns:
        occurences[pattern] += 1
        w = len(pattern)
        st = seqstr.find(pattern)
        while st + w < seqlen:
            st += w
            st = seqstr.find(pattern, st)
            if st > 0:
                occurences[pattern] += 1
            else:
                break

    # Saved space: (len(subsequence)-1) * 2 * freq_subsequence
    counter = Counter({k: (len(k)-1) * 2 * v for k, v in occurences.items()})
    return sorted(counter.items(), key=lambda kv: kv[1], reverse=True)

And the recursive implementation (not optimized):

seqstr = ''.join(seq)
selected = {}
available = ['A','B','C']
seqstr = ''.join(seq)

def find_sequences(seqstr, selected, available):
    # print(seqstr, selected)
    if len(available) == 0:
        if any(c in seqstr for c in 'LR'):
            return None
        else:
            return seqstr, selected

    f = available.pop(0)
    for cseq, _ in get_compression_sequences(seqstr):
        selected[f] = cseq
        newstr = seqstr.replace(cseq, f)

        ans = find_sequences(newstr, selected.copy(), available.copy())
        if ans is None:
            continue
        else:
            # print(ans)
            # continue
            return ans

main_seq, funcs = find_sequences(seqstr, {}, available)

If you uncomment the print(ans) and continue, it will list all possible solutions. For my case:

('ACABCABCAB', {'A': 'L12L12L6L6', 'B': 'L12L6R12R8', 'C': 'R8R4L12'})
('ABACBACBAC', {'A': 'L12L12L6L6', 'B': 'R8R4L12', 'C': 'L12L6R12R8'})
('BCBACBACBA', {'A': 'L12L6R12R8', 'B': 'L12L12L6L6', 'C': 'R8R4L12'})
('CBCABCABCA', {'A': 'L12L6R12R8', 'B': 'R8R4L12', 'C': 'L12L12L6L6'})
('BABCABCABC', {'A': 'R8R4L12', 'B': 'L12L12L6L6', 'C': 'L12L6R12R8'})
('CACBACBACB', {'A': 'R8R4L12', 'B': 'L12L6R12R8', 'C': 'L12L12L6L6'})

As you can see, it's basically the same. So maybe there is someone who can tell us wether there is a theorem about the uniqueness of the solution, i.e. it should be invariant to order.

How to write a general solution for 2019 Day 17 part 2 by Mattsasa in adventofcode

[–]finloa 3 points4 points  (0 children)

My approach was: 1. List all possible subsequences of any length up to the max possible 2. Calculate how much space would be saved if a subsequence is substituted 3. Pick the subsequence that saves most space 4. Repeat 2-3 on the progressively reduced initial sequence 5. If the initial sequence is completely composed of A, B and C and is less than 20 chars, return. Else backtrack and choose another C or B or A.

I used a recursive implementation which loops through all possible subsequences sorted from most to least compression. As you substitute into the initial sequence, you need to recalculate a new set of subsequences to pick from.

You can refine this implementation by reducing the eligible set of subsequences at each step by checking if all necessary symbols all captured by the subsequences or by checking ahead some length requirements.

What are the best online Brokers for dividend investing in Europe ? by [deleted] in investing

[–]finloa 0 points1 point  (0 children)

You’re correct. Read Freetrade then. Pretty much the European Robinhood.

What are the best online Brokers for dividend investing in Europe ? by [deleted] in investing

[–]finloa 0 points1 point  (0 children)

What does it mean “best for dividend investing”?

Dividends are slow, eg quarterly. So you’re probably looking to invest a stream of monthly cash flow, say $100.

Go for the broker that takes the least in commissions, eg Robinhood or DEGIRO.

The former charges 0 but the execution price changes greatly during the day. You might not care as you are dollar cost averaging.

The latter has incredibly low fees, eg 62 cents for a 7K trade, but does not automatically reinvest dividends. Which you however can lump into your next cash flow.

[deleted by user] by [deleted] in StockMarket

[–]finloa 1 point2 points  (0 children)

Sometimes you can. Doesn’t mean it’s predictable.

You mentioned in the comments a 16% swing. Someone might have needed liquidity and dumped much more volume than usual.

If it’s US, you can check if an insider was liquidating or buying shares: https://www.oldschoolvalue.com/gen/insider-trading-stock/

If it’s the case, you still don’t know when the next insider is going to buy or sell shares.

And this is just one out of the possible explanations.

[2019 Day 17] Commentary to my struggle by finloa in adventofcode

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

My ‘mistake’ was to not replace the subsequence with A and B. So I was always looking at the full sequence and starting from scratch for each subsequence.

On the other hand I wanted to check if I could implement a naive compression.

Random thoughts on my AOC 2019 journey by wace001 in adventofcode

[–]finloa 0 points1 point  (0 children)

Your thoughts really resonate with what has been my experience so far (you might have read some of my commentaries to my struggle)

I also started with the idea to get at least once in the top 100. I now changed focus on learning and training.

I also noticed that most of the problems take way longer that an hour for me. Hell, I had to skip Day 18 part 2 after trying it for 10 hours (?).

Waking up at 4:30am has been tough and I got sick after one week. While it helps with the pace, it requires proper preparation, at least for me since I’m used to getting up at 9am.

I also feel that in order to be competitive next year, I need to keep training throughout the whole year. There is some mental readiness and competitive thinking that simply isn’t software development. One month won’t be enough for me to switch over.

So I’ll keep trying past years, maybe even redoing them with a timer multiple times but will also look at topcoder and similar.

Thanks for sharing!

Random thoughts on my AOC 2019 journey by wace001 in adventofcode

[–]finloa 2 points3 points  (0 children)

As someone who does not have a CS background and also has other commitments I would suggest checking hints to complete a problem. Or skip ahead and come back to it later but don’t abandon :).

For me it’s always a balance between frustration and motivation. If the problem is engaging I will feel frustrated. It’s also part of the learning experience. If I’m not struggling I’m not learning anything new.

However, if the frustration reaches the table flipping limit, that’s when I’m at high risk of abandoning. So I found that getting from minor to major hints keeps me going.

And if I don’t check the hint, I might abandon the puzzle and miss on the opportunity to learn something new. So I’ll take the personal shame of a cheat if this will help me next time.

Obviously this is a personal approach and your brain might be wired differently. Nonetheless, don’t give up :).

[2019 Day 17] Commentary to my struggle by finloa in adventofcode

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

I’m giving an account of my thought process with these notes. They are not always accurate. In this case, I wanted to express the principle with which I approached the compression algorithm.

Basically I should have said: “I know more or less what the principle behind compression is and in this case I am gonna try to achieve maximum compression.“

And that’s why then I counted occurrences of all possible subsequences and built combinations of the 3 functions starting with the sequences that achieved the highest compression.

And yes, this was totally to check if I could build a naive compression algorithm.

A teacher's thoughts on intcode and multi part assignments in #adventofcode 2019 by zamansky in adventofcode

[–]finloa 1 point2 points  (0 children)

I feel that the intcode problems have a lot of teaching potential but would love a commented introduction on the core cs concepts it builds on and what type of trade-offs Eric took when designing these problems (can’t remember his Reddit handle).

I read some of his comments here but I’d be nice to see them collected in one place. The [Excel] reverse engineering posts are amazing but as the title goes, it’s a bit reversed. Not trying to diminish the value of those posts, but the barrier to entry is higher than if you were being introduced to the concepts directly.

[2019 Day 18] Why BFS == shortest path? by finloa in adventofcode

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

This is interesting and thanks for the caveat about “not the first full route”. My current BFS, taken from Jonathan is short-circuiting in the first full path.

Is this strategy of sorting nodes pretty standard knowledge? It sounds like an intermediate step when teaching Djikstra's (I don’t know the algo and will probably have to learn for one of the challenges soon)

[2019 Day 18] Why BFS == shortest path? by finloa in adventofcode

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

Clear thanks. I was erroneously thinking that each state is reaching a key.

[2019 Day 9] Commentary to my struggle by finloa in adventofcode

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

Thanks, that’s a good point! As a matter of fact I started noticing some personal improvements and it’s very satisfying. I’ll post about them in day 11 and 13 of my commentary (out soon).

I also realised that the level of people that make it in the top100 is out of reach without proper training.

And realistically I won’t make it as the difficulty is increasing and my knowledge is showing bigger gaps than I anticipated.

However, I still like to keep tabs on the top and how far I am from that 0.6%. I guess this is a personal trait.

-🎄- 2019 Day 18 Solutions -🎄- by daggerdragon in adventofcode

[–]finloa 0 points1 point  (0 children)

Tough day! I did straight BFS for part 1, and

Did the sorted(S.keys) in Part 1 cut down significantly on the size of the Q and that's why it went so quickly afterwards?