HackerTrans
TopNewTrendsCommentsPastAskShowJobs

rustypotato

no profile record

Submissions

Learn Rust: Derive the Borrow Checker, Don't Memorize It

jadnohra.com
3 points·by rustypotato·4 mesi fa·0 comments

comments

rustypotato
·2 anni fa·discuss
Performance review, as per the linked post of theirs: http://rachelbythebay.com/w/2021/02/19/perf/
rustypotato
·2 anni fa·discuss
> But when developers put AI in consumer products, people expect it to behave like software, which means that it needs to work deterministically. If your AI travel agent books vacations to the correct destination only 90% of the time, it won’t be successful.

This is the fundamental problem that prevents generative AI from becoming a "foundational building block" for most products. Even with rigorous safety measures in place, there are few guarantees about its output. AI is about as solid as sand when it comes to determinism, which is great if you're trying to sell sand, but not so great if you're trying to build a huge structure on top of it.
rustypotato
·2 anni fa·discuss
I hand-write a work journal. Just an A5 notebook and a few pens of different colors. Definitely an essential piece of my dev toolkit. I've especially come to love the free-form nature of hand-writing, which allows me to visualize more of my thoughts than a digital text editor.

The journal has served two main purposes. One, I can write and annotate free-form pseudocode at exactly the level of abstraction I need without getting distracted by the errors produced by the code editor. It's really helped me work through the difficult parts of coding puzzles before I ever touch the keyboard to implement.

Two, I have a scientific notebook for debugging. I write down a hypothesis, design a small experiment, document the steps and complications as I go, and write down what the actual result was; then repeat the cycle. Putting it all in writing keeps it straight so I don't chase my tail, and I have something to look back on if I need to explain the bug and how it was solved to my coworkers.
rustypotato
·2 anni fa·discuss
I also took the class that uses this OS at MIT. Absolutely fantastic. I was just browsing the class website today actually, and you can totally kinda take the class yourself. The site has all the lecture notes, the labs, and even a version of xv6 in a repo with branches for all the labs, along with instructions for getting it all working yourself. It's kinda amazing how open it is.

The first lab: https://pdos.csail.mit.edu/6.1810/2023/labs/util.html

I do plan to work through the whole thing myself again at some point soon.
rustypotato
·2 anni fa·discuss
Logical properties have been amazing to work with. They're meant to make CSS rules generalize across languages with different text directions, but thinking in terms of block, inline, start, and end naturally guides me into styles that are more responsive. I think it's given me a much better conceptual model and understanding of CSS.
rustypotato
·2 anni fa·discuss
The site actually has some tutorials for creating these sorts of animations with a specific focus on perfectly looping gifs [1]. Looks like it's all done with Processing [2].

[0]: https://bleuje.com/tutorials/ [1]: https://processing.org/
rustypotato
·3 anni fa·discuss
It's probably easier to express this sort of scale as a linear function y = mx + b, where y is the font size and x is the screen size. If you have:

  minFont = 12
  maxFont = 18
  minScreen = 320
  maxScreen = 2400
Then you calculate the slope (m) using the ol' (y - y) / (x - x):

  m = (maxFont - minFont) / (maxScreen - minScreen)
Then plug one of the (font, screen) pairs into the equation and solve for b. Use that as --linear-font-size.

Once you have the linear equation for your font size, you use clamp() to bound the screen size between the min and max that you set before.

  font-size: clamp(var(--minScreen), var(--linear-font-size), var(--maxScreen))
I think this basically has the same effect as the blog post produces, but it fits in my head better when the dynamic part is expressed as the equation for a line.