When I was in high school, I didn't realize difference of two squares literally meant "What's the difference between these two squares?"
Here's how we can visually show why x²-y²=(x-y)(x+y).
@systematicls There is one rule that can save you. Just one rule. Don’t work with a recruiter who has not been in that same niche area for less than 10 years. That is all. Rest will sort out.
yet another example of why I like types .. "capability types" for iteration in Rust ..
a simple Rust function, but I love the information density that the type gives ..
It says: I don’t care what the underlying source is (string chars, slice, deque, range over a collection, etc.). I only need the capability “can pull from both ends”.
What’s special in Rust is the combination of:
• expressing “two-ended traversal is available” as a static, checkable capability (DoubleEndedIterator), e.g. is_palindrome(std::io::stdin().lines()) simply won’t compile because `lines` can’t go backwards. That’s not a runtime surprise, it’s a type error.
• keeping it zero-cost (no virtual dispatch unless you opt in) and
• having it compose through all the out-of-the-box iterator adapters so you can build pipelines and still keep that capability.
So it’s not just “without allocation”, and not just the trait - it’s how those properties statically compose.
Note: C++20 bidirectional_range offers similar capabilities. But comparing ergonomics + safety in generic code, Rust often wins because the ownership/borrowing model prevents invalidation and aliasing bugs.
Code reviews catch issues early - naming, structure, ownership semantics.
Ben Deane's CppCon talk shares what he learned from years of doing them.
https://t.co/9tL3rIne9n
In my latest blog post, "Singleton done right in C++," you'll learn how to implement a singleton correctly, if you have to.
https://t.co/Z16OLapqfp
#cplusplus#cpp#cpp17
If you think knowing about data structures and algorithms is not important in software development, consider what is used in the Linux kernel:
1. Linked list and doubly linked list
2. B+ Trees
3. Interval trees
4. Red-Black trees used for scheduling, virtual memory management, and more
5. Priority sorted lists used for mutexes, drivers,
6. Radix trees, used for memory management and networking-related functionality.
7. Hash functions
8. Priority heap, used in the control group system
9. Bit arrays, used for dealing with flags, interrupts
10. Binary search, used for interrupt handling, register cache lookup
11. Hash tables, used to implement inodes, file system integrity checks
12. Depth first search, used in directory configuration
13. Breadth first search, used to check correctness of locking at runtime
14. Knuth-Morris-Pratt string matching
15. Merge sort on linked lists, used for garbage collection, file system management
16. Boyer-Moore pattern matching
17. Semaphores and spin locks.
I have worked in AI research prior to trading, deployed machine learning models to prod both in industrial applications & in trading
the only models other than OLS i have used that actually make serious money trading, are quantile regression & ridge regression
curious.
You can also do locally linear, PLS and some variations of Ridge based on priors. But yes simple models are the best and are being used on the model building side by pretty much all the multi billion stat arb shops. The signal itself could be anything plug and play but the actual predictive model is usually regression in some form.
@Adriksh 10 12 . Since c is a parameter this happens even post c++17 . NRVO does not work for parameters of function . If this were an automatic object NRVO would have kicked in. If you don’t want the 2 copies pass it in by reference
and now for some readings of user level RCU .. and a landmark paper that led to the implementation of liburcu - the user space RCU library, a Christmas Day evening read ..
Why RCU is difficult in user space ?
RCU, particularly its high-performance Quiescent-State-Based Reclamation (QSBR) variant, is easier in kernel mode because the kernel scheduler automatically detects quiescent states whenever a CPU context-switches, enters user mode, or idles, allowing grace-period tracking without any explicit cooperation from kernel code.
In user mode, applications lack this built-in mechanism, so threads must explicitly register and periodically report quiescent states (e.g., by calling specific functions), imposing invasive global constraints on the entire application. These requirements make user-level RCU harder to adopt broadly, as they complicate library design and require modifications to all potentially reading threads, which is impractical in many user-space programs.
User level implementations of RCU :
This paper contributes to user-level RCU by formally describing efficient and flexible implementations that overcome the limitations of prior approaches, which either imposed high read-side overhead or severely restricted application design. It presents multiple classes of RCU (including QSBR, memory-barrier, signal-based, and bullet-proof variants) with detailed algorithms, performance analysis, and comparisons to locking, directly forming the foundational basis for the liburcu library's core flavors and enabling its widespread adoption in user-space applications.
A #Hindu was lynched and burned alive in Bangladesh.
If this had happened anywhere else, the world would have screamed.
Why not now?
Stop Hindu Persecution
#Protect_Bangladeshi_Hindus
By default, the most popular Rust crate for Postgresql (tokio_postgres) waits for *2 hours!!* before timing out a dead connection.
All because of a bad decision from 1989 🧵👇️
@debasishg This was a good article. Yes Cache line alignment for head and tail is necessary to avoid false sharing . In addition Epoch based GC could also help avoid further avoid expensive instructions
https://t.co/e1Z0TEgZpK
One of the cool tricks I like about ring buffer implementation is avoiding false sharing via padding / alignment ..
In concurrent rings (especially SPSC), head and tail are frequently updated - possibly by different threads. If they share a cache line, you get false sharing: each thread’s updates invalidate the other’s cache line even though they’re touching different fields.
Typical fix:
• Put head and tail on different cache lines using padding/alignment, e.g. #[repr(align(64))] in Rust or explicit padding fields.
• Or store them in separate structs each cache-line-aligned.
This reduces cache-line ping-pong and stabilizes throughput/latency.
I think one important fact missed by all these naïve "If you have alpha why publish" people is, one could have several pieces of the puzzle and they could be missing a very important component and reading carefully curated material could inspire them to complete this missing piece of the puzzle.