345 private links
Instead of doing a single join, an innocent looking for loop can end up doing tons and tons of separate queries, resulting in much slower execution.
The 1+N problem occurs if a database request is made for every item returned by the first query.
The programming language Arcadia doesn't have recursion or loops, so the problem can not exist.
A track of the timezones with their name, description and alias
Using DEBUG compilation slows down the compilation by nearly ~40 times.
Why ?
LLVM represents variable locations through DBG_VALUE records. Heavy function inlining can create hundreds of thousands of these records in a single function.
WebAssembly’s Register Stackify pass moves values from virtual registers onto the operand stack to produce compact, efficient wasm. While moving instructions, it repeatedly scans basic blocks to find and update debug records. Those linear scans are repeated for many definitions, while the pass also leaves invalidated records behind and creates new records for duplicated cheap computations. The result is quadratic work on increasingly large instruction lists.
As example:
Module: repro total codegen
Current Rust: 52.58s
LLM fix:7.12s
Author fix: 1.99s
<details>popover- grouped
<details> command&commandfor- native input pickers
<datalist>loading="lazy"hidden until-found
and serving a complete web app
find . -iname '*.flac' -print0 | while IFS= read -r -d '' f; do
opusenc --bitrate 160 "$f" "${f%.*}.opus"
doneNote it's useful to use "pixelated" image rendering for QR Code for examples. Another way is to distribute the QR Codes as SVGs.
1) Useful for vertical spacing for content. The spacing of two paragraphs become natural.
2) It's precise to build the paper line effect with a background-size: 100% 1lh;.
3) When the image should scale, the lh is perfect to align the image with an amount of line:
.content img {
float: left;
height: calc-size(auto, round(up, size, 1lh));
}
Note calc-size is not widely supported, so let's build an alternative:
.content img {
float: left;
aspect-ration: 1; // put the ratio of the image here, or remove a `width` limitation
height: 5lh
}
4) Faded content with a max-height
5) Size an icon based on the line height
Hacker news discussion: https://news.ycombinator.com/item?id=44370426
There are different measure of time. Civil time is used in our contemporary society because talking in epoch (seconds since 1st Jananuary 1970) because it's too complicated. The best civil time to use currently is UTC.
While considering precise time keeping, a location can change its timezone (UTC+X) with a short or long notice. One used 14 days for example.
Another rule is leap seconds that are inserted.
The IANA timezone database is preferred to update local date time.
Some pitfalls and cases where JSON has a default behavior.
Date, BigInt, circular dependencies, undefined property are not preserved and leads to different behaviors.
Serialization executes code and toJSON().
Take care of prototype pollutions (for example a __proto__ property).
There are also optimization with Message Pack that provides a compact ninary representation and CBOR.
Full of great explanations about securing (hardening) Rust code.
- treat panic behavior as part of your API. Decide explicitly whether panics should unwind or abort, and avoid uncontrolled panics.
- enable stricter Clippy lints (such as indexing and arithmetic checks) when panic freedom is important.
- use a panic hook to shutdown gracefully, set reports, cleanup, collect diagnostics and
- sanitize panic (and logging) messages while logging.
veilis a good crate for that. - avoid unbounded recursion. Prefer iterative algorithms or use depth limits.
- releases builds behave differently. They should be accordingly tested.
- audit dependencies with cargo-audit and cargo-deny
- secure allocation (for defense-in-depth when using unsafe code or FFI) with
mimallocor similar. Measure performance before enabling it globally. - use minimal runtime images if needed (rust distroless). It reduces the attack surface.
- use multi-stage builds with
cargo-chef,--lockedand proper.dockerignore - avoid alpine musl lib c as it introduces subtle runtime differences; at least be aware of them.
- use Linux
landlockto restrict filesystem access even after compromission - never run as root unless absolutely necessary. Drop as much Linux capabilities as possible.
- use Miri to detect undefined behavior, invalid pointer usage and unsafe-ode bugs.
- handle SIGTERM/SIGINT properly. Stop accepting new work, finish inflight requests, flush buffers and then exit cleanly
- protect external dependencies (database, API, cache) with circuit breakers so repeated failures don't cascade
- put explicit limits on everything: upload size, request bodies, queues, timeouts, thread counts,
- expose two health endpoints: a liveness probe and a readiness probe. The liveness probe checks if the process is alive at all, while the readiness probe checks if the process is healthy enough to handle traffic.
- Use fuzzing (
cargo-fuzz,honggfuzz), coverage (cargo-llvm-cov), unsafe detection (cargo-geiger), and memory-analysis tools alongside Rust's compile-time guarantees.
The entire element such as a card is interactive as a button for visual users. The button or link remains correct for the rest of the users.
One of the recommendation is to use a 3-day cooldown before using new versions. Crazy.
- Stop allocating useless strings: to_string(), .clone(), HashMap borrow the string
- Optimize
hashmaplookups withhashmap.entry().or_insert(0) += 1instead of 3 lookups: in an if condition, insert operation and update. - Use as much core as possible: rewrite loops as iterators and then use rayon with
par_lines. remove()in array is a costly O(n) operation. If order is not important, preferswap_remove.
- Rust doesn't prevent TOCTOU (Time-of-Check to Time-of-Use) race conditions (file path resolution → use file handlers directly)
- Panics are denial-of-service vulnerabilities when handling untrusted input.
- In case of a well established tool, compatibility is a security feature.
- Resolve external information before crossing trust boundaries.
- The interactions with the operating system is a security boundary in Rust. The developer has to be careful.
The post goes in-depth for many cases.
The standard is available at https://www.itu.int/rec/T-REC-X.680/
It's used in many applications such as SNMP, CMIP, LSAP. Ididn't encounter a use case yet.
As stated in the video, the ASN.1 GNU library is under-documented and hard to use without examples. The idea, concept and design is well done though.