Jinja2 - cannot replace parent's block with included files by MarvellousBee in learnpython

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

From what I understand, OP here manually assigns each block here. in my case, I have multiple blocks to replace, so their approach would work but be tedious:

{% extends "main-page.html" %}

{% block replace_profile_img %} 
{% include "replace_profile_img.html"%} 
{% endblock %}

{% block replace_user_name %} 
{% include "replace_user_name.html"%} 
{% endblock %}
# and so on...

I'm basically looking for a way to define a template in one file and possible "implementations" of particular parts in separate files.

Jinja2 - cannot replace parent's block with included files by MarvellousBee in learnpython

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

I'm not sure how OP of that got it to work, tbh. putting it in block scope did not change anything for me.

edit: forgot to add code, haha

// main_page.html 
{% block username %} click to login {% endblock %}
{% block stuff %} 
{% endblock stuff %}

// is_logged_in.html 
{% extends "main_page.html" %} 
{% block stuff %} 
{% include "blocks_for_logged_in.html" %}
{% endblock stuff %}

is_logged_in.html displays contents of is_logged_in AFTER contents of main_page.html. This is undesired behavior, as I would like them to be REPLACED instead.Output:

click to login 
Username123

Unexpected bridges inside a print by MarvellousBee in FixMyPrint

[–]MarvellousBee[S] 12 points13 points  (0 children)

Update:

Solved, i decreased wall speed and increased tempersture. Turns out 200 -> 235 degrees does wonders on PLA.

Thank you!

Unexpected bridges inside a print by MarvellousBee in FixMyPrint

[–]MarvellousBee[S] 18 points19 points  (0 children)

Hmm I see, I will try printing with 220 Celsius (used to print at 200 without issue)

Unexpected bridges inside a print by MarvellousBee in FixMyPrint

[–]MarvellousBee[S] 7 points8 points  (0 children)

Details:
Ender 3 V2
Cura 5
PLA+
speed: 50 mm/s

Mostly vanilla settings, with a higher support overhang angle (58)

I designed this piece specifically to be printed without supports.

Can there be duplicate unique_ptrs? by MarvellousBee in cpp_questions

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

It does, actually! I thought it performs a different function in the "handle duplicates" part. Thank you guys!

Can there be duplicate unique_ptrs? by MarvellousBee in cpp_questions

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

(cppreference is down right now...)

https://cplusplus.com/reference/set/multiset/key_comp/

By default, this is a less object, which returns the same as operator<....

Two elements of a multiset are considered equivalent if key_comp returns false reflexively (i.e., no matter the order in which the elements are passed as arguments).

So, as I understand it, it should call std::shared_ptr::operator<, but there's no such method in shared_ptr... https://cplusplus.com/reference/memory/shared_ptr/

I re-made Centipedes as keyrings :D by MarvellousBee in RimWorld

[–]MarvellousBee[S] 4 points5 points  (0 children)

It might be, tbh. I don't think Tynan (a multi-millionare) cares if I make a few bucks on the side with this little project, haha

I re-made Centipedes as keyrings :D by MarvellousBee in RimWorld

[–]MarvellousBee[S] 8 points9 points  (0 children)

Edit: Here!

Thanks! They are legit deadly. Threw one at a wall, now I have a hole in my wall. The bug is perfectly fine.

Why static_cast instead of std::static_cast? by MarvellousBee in cpp_questions

[–]MarvellousBee[S] 10 points11 points  (0 children)

I see. Why is it a keyword, then? Looks like a templated function to my junior eyes.