Marc Planard's latest activity

Solving leetcode in C++ and Rust in parallel (two solutions for every problem, switching the language you use first) seems to be an interesting and useful experience.

The contrast and language differences is highlighted as never: you see how much easier and compact is a binary tree traversal in C++, and you see how many possible issues are prevented by Rust compiler which enforces you to check and recheck every step in the very same function.
At the moment I've got quite a number of segfaults for corner cases in C++ solutions and still waiting for the first Rust one :)

Still not sure if the leetcode (or other competitive programming problems) are connected to our daily coding experience, but my personal feeling "In C++ you compile it right away and then fight with gdb to make it run; in Rust you fight with compiler and then happily use it right after it's compiled" is confirmed again.

0
Share
Share on Mastodon
Share on Twitter
Share on Facebook
Share on Linkedin

@mo8it I recognized the imitation, and I'm familiar neither with the English nor with the German version :)

0
Share
Share on Mastodon
Share on Twitter
Share on Facebook
Share on Linkedin

@LaurentChemla c'est cohérent avec le temps ici, on se paye les giboulées de Mars en ce moment.

0
Share
Share on Mastodon
Share on Twitter
Share on Facebook
Share on Linkedin

The best case for 's async-await comes from embedded:

"Rust's async/await allows for unprecedently easy and efficient multitasking in embedded systems. Tasks get transformed at compile time into state machines that get run cooperatively. It requires no dynamic memory allocation, and runs on a single stack, so no per-task stack size tuning is required. It obsoletes the need for a traditional RTOS with kernel context switching, and is faster and smaller than one!"

github.com/embassy-rs/embassy?

…See more
0
Share
Share on Mastodon
Share on Twitter
Share on Facebook
Share on Linkedin

@sgued thanks, i did both :)

0
Share
Share on Mastodon
Share on Twitter
Share on Facebook
Share on Linkedin

Hey another question...

I've written something like this:
```
impl Values {
fn from_iter(mut iter: impl Iterator<Item=f32>) -> Self {
...
}
}
```

is there a way to write it as an impl From<???> for Value ?

I haven't found a way to make it work...

1
Share
Share on Mastodon
Share on Twitter
Share on Facebook
Share on Linkedin

@teromene yeah I did that but all this is not very satisfying, and it adds an indirection... Thanks for the help though.

0
Share
Share on Mastodon
Share on Twitter
Share on Facebook
Share on Linkedin

@teromene ha, thanks, that makes it marginally less awkward :) .
But of course, my actual field is in fact a Vec<NaiveDateTime> so a straightforward deserialize_with=... is not cutting it yet 😅

1
Share
Share on Mastodon
Share on Twitter
Share on Facebook
Share on Linkedin

A little question: I have a json document storing datetime as "2024-01-23T09:50" . Deserialization with serde to chrono::NaiveDateTime fails because it expects seconds which are missing. Do I really have to implement my custom Deserializer module with #[serde(with = "my_date_format")] or is there a more straightforward way?

Edit: playground example: play.rust-lang.org/?version=st

1
Share
Share on Mastodon
Share on Twitter
Share on Facebook
Share on Linkedin

I'm having a conversation with a designer about icons. Making a screenreader read "camera" or "microphone" when an icon is shown is trivial with aria-label. But screenreader users are massively outnumbered by sighted users who might be confused by the meaning of a tiny image/ icon. The mighty Paul Annett explains more:

0
Share
Share on Mastodon
Share on Twitter
Share on Facebook
Share on Linkedin

When you write end-to-end tests, if you fake the real database with something else (like Sqlite), can you still call it an end-to-end test?

  • Yes (4)
  • No (7)
  • Sometimes (4)
0
Share
Share on Mastodon
Share on Twitter
Share on Facebook
Share on Linkedin
0
Share
Share on Mastodon
Share on Twitter
Share on Facebook
Share on Linkedin

@d33pjs depends of the application, but for a battery included web framework I would consider / Phoenix.
Otherwise , maybe with if applicable.

0
Share
Share on Mastodon
Share on Twitter
Share on Facebook
Share on Linkedin

@mart1oeil l'expérience client... Misère...

0
Share
Share on Mastodon
Share on Twitter
Share on Facebook
Share on Linkedin

@lefoodingue pour les gens un tout petit peu anxieux sur la géopolitique je recommande (pas) le téléfilm "Countdown to Looking Glass"...

…See more
0
Share
Share on Mastodon
Share on Twitter
Share on Facebook
Share on Linkedin

Rust version 😁

I don't care if Monday's blue
Tuesday's gray
Wednesday too
Thursday I don't care about you
It's Friday I'm in love

…See more
0
Share
Share on Mastodon
Share on Twitter
Share on Facebook
Share on Linkedin


« Structures de contrôle : de "goto" aux effets algébriques »
📌 Le cours du Pr Xavier Leroy, titulaire de la chaire Sciences du logiciel, commence la semaine prochaine.
⏰ Jeudi 25 janvier 2024
👉 college-de-france.fr/fr/agenda

0
Share
Share on Mastodon
Share on Twitter
Share on Facebook
Share on Linkedin

Happy 40th Birthday to probably one of the most important and influential computer games ever written, Elite.

theregister.com/2024/01/18/eli

0
Share
Share on Mastodon
Share on Twitter
Share on Facebook
Share on Linkedin

@leozin bha c'est un classique :) si l'ordinateur détecte l'écran mais que l'écran n'affiche rien c'est souvent qu'on lui demande une résolution qui n'est pas supportée. La question c'est pourquoi l'auto-détection se passe mal, normalement ça devrait pas arriver...

0
Share
Share on Mastodon
Share on Twitter
Share on Facebook
Share on Linkedin
Replies