sajran

joined 2 years ago
1
submitted 7 months ago* (last edited 7 months ago) by [email protected] to c/[email protected]
 

This setup is a result of months of learning about NixOS and tinkering. There is always something more to polish but I'm at a point where I'm actually satisfied.

Screenshot of desktop with floating terminal window and sway notification center

Screenshot of desktop with tiled firefox and terminal emulator running btop windows

[–] [email protected] 1 points 8 months ago

Ah, I didn't think about this. Thanks for the explanation!

[–] [email protected] 2 points 8 months ago* (last edited 8 months ago) (2 children)

I like the problem solving description, I actually went through a similar learning process leading to bitset recently. It was very satisfying!

However, I just have to ask a question: What is the reason you didn't just use UUID?

[–] [email protected] 4 points 9 months ago

Since you have all your shutil.copytrees and sys.path manipulation at the top level of the test modules, they are executed the moment those modules are imported. unittest likely imports all discovered test modules before actually executing the tests so the set up of both modules is executed in random order before the tests are run. The correct way to perform test setup is using setUp and setUpClass methods of unittest.TestCase. Their counterparts tearDown and tearDownClass are used to clean up after tests. You probably will be able to get this to work somehow using those methods.

However, I'm fairly certain that this entire question is an example of the XY problem and you should be approaching this whole thing differently. Copying the modules and their mock dependencies into a temporary directory and manipulating sys.path seems like an absolute nightmare and it will be a massive PITA even if you get it to a working state. I don't know what problem exactly you're trying to solve but I think you should really read up on unittest.mock and even more importantly on dependency injection.

[–] [email protected] 5 points 9 months ago

This is great news but I just have to say it: we need Proton Drive on Linux. Still very happy though.

[–] [email protected] 6 points 10 months ago (1 children)

Very interesting experiment. Thanks for sharing! Maybe I'll find some time to run the benchmarks on my Pixel 7 in the upcoming days.

[–] [email protected] 4 points 11 months ago (2 children)

But... How do you even know you can smell ants? Why did you try it? Or can you smell them from meters away?

[–] [email protected] 2 points 11 months ago* (last edited 11 months ago)

But... How do you even know you can smell ants? Why did you try it? Or can you smell them from meters away?

[–] [email protected] 13 points 11 months ago

I might be wrong but I assumed it's perfectly obvious to OP and it's the kind of joke where something is funny because you stretch the meaning to read it literally. I chuckled actually, despite it making perfect sense.

[–] [email protected] 4 points 11 months ago

Of course, but when indentation has a syntactic meaning the formatter often won't be able to fix it.

[–] [email protected] 1 points 11 months ago

It's probably more prone to mistakes like that, true. But in practice I really never witnessed this actually being a problem. Especially with tests and review.

[–] [email protected] 1 points 11 months ago

Yeah, that's definitely a good point. But it's a minor thing. Adjusting indentation takes 2 keystrokes in vim, I barely notice it.

[–] [email protected] 21 points 11 months ago (7 children)

So I'm going to say what I always say when people complain about semantic whitespace: Your code should be properly indented anyway. If it's not, it's a bad code.

I'm not saying semantic whitespace is superior to brackets or parentheses. It's clearly not. But it's not terrible either.

As someone who codes in Python pretty much everyday for years, I NEVER see indentation errors. I didn't see them back when I started either. Code without indentation is impossible to read for me anyway so it makes zero difference whether the whitespace has semantic meaning or not. It will be there either way.

 

Was very excited about this but turns out I can only use DuckDuckGo app, not DuckDuckGo in Firefox. I'm afraid this feature won't really be usable for me since I rely on FF add-ons and synchronization.

 

cross-posted from: https://lemmy.ml/post/9581183

My first ever bulid and I'm so excited! It's not trivial to build a perfect keyboard just from parts you can order in Europe. This is one doesn't look exactly how I imagined it but I love it anyway. If anyone is interested - it's a Sofle Choc V3 kit from 42. Keebs.

The first few days were a bit hard but after just a week of using it I was able to beat my monkeytype high score. I'm still not really fluid in using it for programming and vim in general though.

 

My first ever bulid and I'm so excited! It's not trivial to build a perfect keyboard just from parts you can order in Europe. This is one doesn't look exactly how I imagined it but I love it anyway. If anyone is interested - it's a Sofle Choc V3 kit from 42. Keebs.

The first few days were a bit hard but after just a week of using it I was able to beat my monkeytype high score. I'm still not really fluid in using it for programming and vim in general though.

view more: next ›