RSSAmplifier

Blog

Pure Programmer

Case Studies in C++, Java, JavaScript, Perl, Python and Swift

wp.pureprogrammer.orgRSS feed ↗9 posts

Latest posts

Comparison of Orange Pi SBCs

The post reviews and compares several single-board computers (SBCs), focusing on the Orange Pi 5 Plus, Orange Pi RV2, and Orange Pi 6 Plus against the Raspberry Pi 5. Key specifications, performance benchmarks, and suitability for makers and desktop use are discussed, highlighting differences in core architecture and software support. The post Comparison of Orange Pi SBCs first appeared on Pure…

Computing Math Constants and Functions

This post explains high precision computation of mathematical functions, focusing on Taylor series expansions. The post Computing Math Constants and Functions first appeared on Pure Programmer .

Computing π (Revisited)

The Chudnovsky algorithm calculates π using a rapidly converging series, enabling high-precision computation. Various programming implementations optimize the algorithm via methods like multithreading, incremental computation, and binary splitting, enhancing speed and efficiency. Despite these advancements, challenges persist in calculating billions of digits due to memory constraints. The post…

Optimized and Extended Mandelbrot Set Program

The Mandelbrot Set Program utilizes perturbation theory for faster image computation with IEEE 754 precision floats. Optimizations include passing mpreal objects by reference, pre-allocating large objects outside loops, and storing double precision orbit points. The program’s setup requires libraries and supports threading for improving performance, offering RGB color customization. The post…

C++ Thread Pool

The ThreadPool class in C++ simplifies thread management by encapsulating thread launching, task queuing, and shutdown processes. It offers a reusable infrastructure for common threading use cases, enabling efficient task execution through lambda expressions and prioritized task handling. Examples illustrate initializing, using, and shutting down thread pools effectively. The post C++ Thread Pool…

C++ Multi-Threading Output Collator

This post discusses the creation of an OutputCollator class to manage and sequence outputs from multi-threaded tasks in a program that computes hexadecimal digits of π. It addresses the issues of out-of-order and interrupted outputs, ensuring that results are collated correctly before being displayed or stored. The post C++ Multi-Threading Output Collator first appeared on Pure Programmer .

Rule of Five

The text discusses resource management in C++ through the "Rule of Five," which emphasizes defining the destructor, copy and move constructors, and assignment operators for classes that manage resources. It illustrates this with a "MemoryGobbler" class and highlights best practices like using RAII and smart pointers for better memory management. The post Rule of Five first appeared on Pure…

Function Pointers, Functors and Lambdas in C++

C++ offers various callable entities including function pointers, functors, and lambdas. Function pointers, inherited from C, allow referencing functions by their address. Functors are class instances that simulate functions, enhancing safety. Lambdas, introduced in C++11, provide a concise way to define inline functions, enabling cleaner, stateful, direct function usage. The post Function…

Multi-Precision Mandelbrot Set Program

The Mandelbrot Set Program uses IEEE 754 double precision floating-point values, reaching limits at a radius of \(10^{-14}\). It allows higher precision using software options, such as the Gnu MP library, although at a performance cost. The program enables customization, like color settings and image dimensions, enhancing precision through extended floating point techniques. The post…