Programming Leftovers
-
Jesse Duffield ☛ Encapsulation Is Not Free – Pursuit Of Laziness – A blog by Jesse Duffield
TLDR: When you stick an explicit interface between two things, it may reduce the friction of changing the implementation but always at the cost of adding friction whenever you change the interface
-
Buttondown ☛ Programming Jigs
But more to the point, what I love about my "programming jigs" is how I can assemble them from whatever software tools I have lying around my terminal; sed, awk, jinja2, the python standard library, UltiSnippets, vim macros, etc. Even if the jig is only useful for one day or one PR, the more jigs I make, the quicker I get at identifying what sort of jig will solve my immediate task.
-
Rlang ☛ Taming the Nameless: Using the names() Function in R
names() can be used in two ways:
1. Extracting Names: Want to see what names are already assigned? Simply use names(your_object). This will return a character vector showing the current names.
2. Assigning Names: Want to give your elements some meaningful titles? Use names(your_object) <- c("name1", "name2", ...). Here, c() creates a character vector with your desired names, and the assignment operator (<-) puts them in place.
-
Jesse Duffield ☛ Why Can't Programmers Agree on Anything? – Pursuit Of Laziness – A blog by Jesse Duffield
The more you read up on software engineering topics online, the more you appreciate just how little agreement there is within the profession.
Some examples of topics which are (often surprisingly) contentious: [...]
-
[Old] University of California, Berkeley ☛ Rotation by Shearing
What follows are my own notes on Alan Paeth's ``A Fast Algorithm for General Raster Rotation,'' as published in the proceedings of Graphics Interface '86. This is a very popular algorithm for image rotation, used by many libraries such as ImageMagick, pnmrotate, etc. Initially I hoped that this scheme would be suitable for use in scientific data processing where arrays must be rotated, but now I believe that this scheme is unsuitable due to the poor interpolation. I also question whether this is any faster than bilinear interpolation when run on general purpose hardware (due to the large amount of data movement); however I do not yet have any quantitative measurements. These concerns aside, the decomposition of a rotation into three shears is interesting in its own right. — Tobin 2002-07-07
-
[Old] Anti Software Software Club LLC ☛ cohost! - "Rotation with three shears"
Shears are very simple graphics operations to do - you just render the sprite, but shifting the lines or columns a bit each time. But rotations are gnarly things that involve lots of maths and interpolation and so on. So how could you possibly construct one from the other?
-
Josh Justice ☛ Simple Design: Fewest Elements
This is the third post in a series about the Four Rules of Simple Design.
“Fewest elements” means that if there is a way to accomplish the same functionality with fewer programming elements, prefer the option with fewer.