What are the supported Swift String format specifiers?

The format specifiers for String formatting in Swift are the same as those in Objective-C NSString format, itself identical to those for CFString format and are buried deep in the archives of Apple Documentation (same content for both pages, both originally from year 2002 or older): https://developer.apple.com/library/archive/documentation/CoreFoundation/Conceptual/CFStrings/formatSpecifiers.html https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/Strings/Articles/formatSpecifiers.html But this documentation page itself is incomplete, … Read more

Releasing memory in Python

Memory allocated on the heap can be subject to high-water marks. This is complicated by Python’s internal optimizations for allocating small objects (PyObject_Malloc) in 4 KiB pools, classed for allocation sizes at multiples of 8 bytes — up to 256 bytes (512 bytes in 3.3). The pools themselves are in 256 KiB arenas, so if … Read more

ROW_NUMBER() in MySQ

I want the row with the single highest col3 for each (col1, col2) pair. That’s a groupwise maximum, one of the most commonly-asked SQL questions (since it seems like it should be easy, but actually it kind of isn’t). I often plump for a null-self-join: “Get the rows in the table for which no other … Read more

ReactJs CreateClass is not a function

Per the documents, you need to get the npm create react class package. From the command line of your project’s file path, you need to do npm install create-react-class –save, and then modify the code like this: You also need React DOM to render the components like this:

An unhandled lowlevel error occurred. The application logs may have details

This is because you haven’t set your secret key correctly. Double check your config/secrets.yml file: It should be something like this: production: secret_key_base: <%= ENV[“SECRET_KEY_BASE”] %> Then in your droplet, you can run bundle exec rake secret to get your secret key. There are options like dotenv which is a useful gem that loads the … Read more