cassidy, to homeassistant
@cassidy@blaede.family avatar

Alright nerds, I have a question. I would like to set up a standard way to get a derived value back from a number of sensors; for example, given a sensor’s PM2.5, PM10, Ozone, CO, SO2, and/or NO2 reading, I would like to return an estimated air quality index (AQI). Ideally I could also have a standard way to map any given AQI value to a category string, e.g. 10 = Good, 75 = Moderate, 175 = Unhealthy, etc.

codechimp,
@codechimp@mastodon.online avatar

@cassidy Maybe some macro templates would help, you could define the logic to create the AQI as a function for each sensor type then have a parameter passed in of the sensor to calculate.
https://www.home-assistant.io/blog/2023/04/05/release-20234/#macros-for-your-templates… (1/2)

badrihippo, to emacs
@badrihippo@fosstodon.org avatar

Just learnt how to use in ! :emacs: 🚀

CppCon, to HowTo
@CppCon@mastodon.social avatar

We have released a new CppCon 2023 Video!

Lightning Talk: Writing a Better std::move – by @foonathan- CppCon 2023
https://youtu.be/hvnl6T2MnUk

jnpn, to random
@jnpn@mastodon.social avatar
jnpn,
@jnpn@mastodon.social avatar

and lastly, maybe emacs macros could benefit from some interactive refinement editor, many times you need to run it a few times to realize you missed a state. It would be cool to be able to prototype them live.

hywan, to rust
@hywan@fosstodon.org avatar

How I [the author of the article] reduced (incremental) Rust compile times by up to 40%, https://www.coderemote.dev/blog/faster-rust-compiler-macro-expansion-caching/.

The idea is pretty simple but clever: cache the output of proc macros, if it hasn’t changed, no need to recompile the associated code.

The author explains the caveat of this approach as not all proc macros are pure.

danjac, to random
@danjac@masto.ai avatar

The reason I suspect Tailwind is popular is due to the requirements placed on developers by designers and PMs. I have seen many cases of clean CSS end up a mess - even devolving to style attributes - because every page just has to be a unique work of art with each paragraph and form input its own little delightful flourish.

Developers in general like clean, reusable code. Tailwind is neither. But with such stakeholders sometimes you just want the job done by Friday afternoon.

webology,
@webology@mastodon.social avatar

@carlton @danjac I have been learning in harder with templatetags, but I think we are overdue for some improvements there.

Maybe you are right with "declaring tags at the template level", but I'd be curious what that looks like. I know Jinja2 supports this with macros, but I have always struggled with those. https://jinja.palletsprojects.com/en/3.1.x/templates/#macros

gregorni, to nano
@gregorni@fosstodon.org avatar

When you learn you can record macros in nano using Shift+.(period)

doctormo, to cpp
@doctormo@floss.social avatar

I've created a macro that allows Value-Parameterized Tests (P Tests) to know where their constructor is and so can report what the actual line of code in your test suite you need to pay attention to.

I couldn't find anyone anywhere who had solved this yet. Although I admit my design isn't perfect, it does however follow the escalating complexity pattern so regular test writers have the easiest interface.

Which makes me very happy.

interpipes, (edited ) to microsoft
@interpipes@thx.gg avatar

ETA: Seems we found someone - thanks for boosts! ❤

Dear fedi, does anyone in my extended network know about excel macros - and how they might have changed between office 2013 and present day o365 builds - and feel up to the task of modernising/rewriting some sheets for a customer so they can move to current office (which just complains when the old documents are opened) without upending their entire workflow? This work would of course be paid! (Please boost for reach)

janriemer, to rust

Just published a new version of my declarative macro match-commutative to crates.io :awesome:

https://crates.io/crates/match-commutative

You are now able to specify an if guard expression at the end of the match arm, just like in std .

See the CHANGELOG for details:
https://gitlab.com/janriemer/match-commutative/-/blob/main/CHANGELOG.md?ref_type=heads

chris, to python German

Weil böse sind, kommt jetzt für , oder wie kommt man auf so eine Idee?

devontechnologies, to productivity
@devontechnologies@devontechnologies.com avatar

Even as our DEVONthink databases continue to grow, there are always certain documents or groups we deal with daily. Here is a way to create a launch palette in the popular @KeyboardMaestro utility to quickly jump to an item in your database. https://www.devontechnologies.com/blog/20230808-palette-keyboard-maestro?utm_content=buffer0e4c6&utm_medium=social&utm_source=twitter.com&utm_campaign=buffer

oblomov, to random
@oblomov@sociale.network avatar

There's a lot of hate for C++ going around the Fediverse these days, understandably. There is many reasons to hate C++, ranging from its C roots to the breadth and width of modern revisions of the language and their standard library, so extensive that it has become progressively harder for any individual developer to have a complete understanding of the whole thing.

oblomov,
@oblomov@sociale.network avatar

That being said, I'm actually among the perverts that are fascinated by (even though I'm well aware of its limitations pertaining readability and maintainability). Which is why I took @tess venting as an opportunity to challenge myself into writing a workable approach to generic properties for C++ objects with a common interface:

http://wok.oblomov.eu/tecnologia/cpp-template-properties/

rml, to random
@rml@functional.cafe avatar

tfw when you tell a schemer that your programming language's macro system is hygienic even though it fails to pass The Macro Writer's Bill of Rights, and they just hit you with that Indiana stare

ramin_hal9001,
@ramin_hal9001@emacs.ch avatar

@rml

The Macro-Writer's Bill of Rights:

  1. Provide a powerfu pattern language
  2. Allow arbitrary transformations
  3. Unify high- and low-level macros
  4. Respect lexical scoping
  5. Permit controlled capture
  6. Support local macros
  7. Support modular use of macros
  8. Correlate source and object code
  9. Guarantee certain optimizations

titociuro, to random
@titociuro@mstdn.social avatar

Looks like I’m going to double down on . The use-cases I’m seeing so far are blowing my mind. Super powerful… and the simplicity of the resulting code. 🤯❤️

Konenpanien, to random
@Konenpanien@pixelfed.social avatar

On a beautiful sunny day, ladybugs live intensely the last days of spring.
The lady beetle (Hippodamia variegata) are distributed throughout Europe, North Africa and Asia, but are absent from the Far North. They live in fields, meadows, at the edges of forests and along the North Sea and the Baltic Sea.

josephduffy, to random
@josephduffy@mastodon.social avatar

I've been playing with a lot recently and have just posted my first macro: Renamed.

Apply it to a symbol and it'll generate the equivalent symbol with a different name, making it easy to rename something and deprecate it to avoid breaking API.

Macros in Swift still aren't finalised but it's been fun learning how they work! I'm working on others but this is the simplest and most complete.

https://github.com/JosephDuffy/Renamed

  • All
  • Subscribed
  • Moderated
  • Favorites
  • megavids
  • InstantRegret
  • magazineikmin
  • thenastyranch
  • modclub
  • everett
  • rosin
  • Youngstown
  • slotface
  • ethstaker
  • mdbf
  • kavyap
  • osvaldo12
  • DreamBathrooms
  • anitta
  • Durango
  • ngwrru68w68
  • tester
  • khanakhh
  • love
  • tacticalgear
  • cubers
  • GTA5RPClips
  • Leos
  • normalnudes
  • provamag3
  • cisconetworking
  • JUstTest
  • All magazines