Programming Leftovers
-
Noel Rappin ☛ Object Constellations
Last time, I talked about ways to use dynamic typing to manage objects and business logic in your code. Doing so involves leaning into the object system, going beyond just “one class for each noun” and creating objects to model different states within the business logic directly.
In a basic Object-Oriented design, you might have an object called User. This object, by itself, represents the entire concept of a user within the system. In this design, specific states of a user — admin, unauthorized, deleted, subscriber, what have you — are all represented by the single class User.
That’s one way to model users. But you could also have the User class be a home for the underlying data and manage some or all of the state of a user by creating wrapper classes like AdminUser, UnauthorizedUser, DeletedUser… even NullUser. At this point, the idea of a “user” is now spread among multiple classes. I’ve started calling this an “object constellation”, feel free to call it whatever you want.
-
Rlang ☛ Mastering Conditional Logic and Small Change Operators in C
As a beginner C programmer, understanding conditional logic and small change operators is essential for writing efficient and dynamic code. In this in-depth guide, we’ll explore the power of the conditional operator (?:), increment (++), and decrement (–) operators, providing examples and best practices to level up your C programming skills.
-
Rlang ☛ era 0.5.0: chronological ordering and extremes
Essentially these are all wrappers for base functions (sort(), min(), max() and range()) that are aware of the directionality of the era system attached to the vector: “CE” years are counted forwards, “BCE” years are counted backwards, etc. I decided to implement them as prefixed functions instead of S3 methods for yr vectors because I didn’t want to suprise people when they used e.g. max() expecting the numerical maximum and got the chronologically latest value instead.
-
Johan Halse ☛ Baby unit tests
I've never really enjoyed writing code in typed languages! The best I can say about them is that "it's fine, I guess" but the general feeling I have is that types mostly get in the way of my productivity. Instead of just doing what I want to do, I'm stuck either doing plumbing work to hold my values and pass them around, or I'm casting things back and forth where I know things are correct but the compiler doesn't. That, to me, is the dullest part of programming: knowing where you want to end up, but having to take a long detour there by solving the string of weird sudoku puzzles the compiler presents you with. Very often, it's ceremony for the sake of ceremony. I'd rather just pinky-swear that something is an integer or whatever and get on with my life.
-
Rlang ☛ Mastering Conditional Logic and Small Change Operators in C
As a beginner C programmer, understanding conditional logic and small change operators is essential for writing efficient and dynamic code.
-
ID Root ☛ How to Increase Maximum Execution Time in PHP
In the world of web development, PHP stands as a cornerstone language, powering millions of websites and applications. However, one common challenge developers face is managing the execution time of PHP scripts. The maximum execution time is a crucial setting that dictates how long a script can run before the server terminates it.
-
System76 ☛ Teen-Driven Hack Club launches High Seas Coding Challenge
More than 5,200 teens have logged over 11,000 hours building projects for High Seas, a coding challenge that rewards their effort with sweet prizes — including 15 System76 Launch Keyboards.
At System76, our mission is to liberate the computer and build tools that empower you to make something inspiring — whether that's the next great invention or a fun website for your friends.
That's why we’re excited to support Hack Club and their High Seas adventure. Hack Club is a distributed network of more than 40,000 teenagers in over 119 countries who are building, tinkering, and collaborating with one another on projects.
-
LWN ☛ Plans for CHICKEN 6
CHICKEN Scheme, a portable Scheme compiler, is gearing up for its next major release. Maintainer Felix Winkelmann has shared an article about what changes to expect in version 6 of the language, including better Unicode support and support for the R7RS (small) Scheme standard.
-
Python
-
ID Root ☛ How To Remove Image Background Using Python
In the world of digital media, the ability to remove backgrounds from images is a crucial skill, especially for graphic designers, marketers, and content creators. Whether you are looking to create stunning visuals for e-commerce products, social control media posts, or presentations, background removal can enhance the quality and focus of your images.
-
ID Root ☛ How To Install NumPy on AlmaLinux 9
NumPy, short for Numerical Python, is a fundamental package for scientific computing in Python. It provides support for large, multi-dimensional arrays and matrices, along with a collection of mathematical functions to operate on these arrays. Installing NumPy on AlmaLinux 9 is essential for data scientists, engineers, and anyone involved in numerical analysis.
-
ID Root ☛ How To Screen Recording using Python
Screen recording has become an essential tool for various applications, ranging from creating tutorials to capturing gameplay. With the rise of online learning and remote work, knowing how to record your screen can be incredibly beneficial.
-
-
Rust
-
Diziet ☛ Ian Jackson: The Rust Foundation's 2nd bad draft trademark policy
tl;dr: The Rust Foundation’s new trademark policy still forbids unapproved modifications: this would forbid both the Rust Community’s own development work(!) and normal Free Software distribution practices.
-
-
Standards/Consortia
-
Johnny Decimal ☛ 22.00.0094 Don't type the date by hand
For the record, this is the ISO 8601 date standard. Once you get in to date formatting you'll see that around, so it's good to know what it is.
-