Checks whether system is using dark mode or not.
Signature:
using fnShouldAppsUseDarkMode = bool (WINAPI*)(); // ordinal 132
import collections, random, sys, textwrap | |
# Build possibles table indexed by pair of prefix words (w1, w2) | |
w1 = w2 = '' | |
possibles = collections.defaultdict(list) | |
for line in sys.stdin: | |
for word in line.split(): | |
possibles[w1, w2].append(word) | |
w1, w2 = w2, word |
Here are some rough notes on building Kirikiri SDL2 for iOS and Android.
Please note that these may or may not be incomplete. Improved documentation is being planned, but not started yet.
For iOS, the startup directory will be searched in <app name>.app/Contents/Resources/
.
For Android, the startup directory will be searched in the root of the assets directory embedded in the apk. For best performance, the file should be stored uncomompressed.
Startup folder candidates:
Telegraph News Politics
Copied from https://www.telegraph.co.uk/politics/2020/03/14/must-do-everything-power-protect-lives/
14 March 2020 • 9:30pm
#!/bin/bash | |
PROJ="/path/to/your/project/" | |
NAME="MyAwesomeGame" | |
SVER="1.0.0" | |
GODOT="/Applications/Godot.app/Contents/MacOS/Godot --path ${PROJ}/src" | |
### | |
# Mac OSX (RELEASE) |
#include <stdio.h> | |
#include <SDL2/SDL.h> | |
#ifdef __EMSCRIPTEN__ | |
#include <emscripten.h> | |
#endif | |
static int count = 0; | |
static SDL_Surface* screen = NULL; | |
static SDL_Texture* sdlTexture = NULL; | |
static SDL_Renderer* sdlRenderer = NULL; |
COW, short for copy on write, is a way to implement mutable strings so that creating strings and logically copying strings, is reduced to almost nothing; conceptually they become free operations like no-ops.
Basic idea: to share a data buffer among string instances, and only make a copy for a specific instance (the copy on write) when that instance's data is modified. The general cost of this is only an extra indirection for accessing the value of a string, so a COW implementation is highly desirable. And so the original C++ standard, C++98, and its correction C++03, had special support for COW implementations, and e.g. the g++ compiler's std::string
implementations used COW.
So why was that support dropped in C++11?
In particular, would the same reason or reasons apply to a reference counted immutable string value class?
// Uncompressed version of | |
// https://gist.github.com/munificent/b1bcd969063da3e6c298be070a22b604 | |
#include <time.h> // Robert Nystrom | |
#include <stdio.h> // @munificentbob | |
#include <stdlib.h> // for Ginny | |
#include <stdbool.h> // 2008-2019 | |
const int HEIGHT = 40; | |
const int WIDTH = 80; |
// | |
// cc sdl-metal-example.m `sdl2-config --cflags --libs` -framework Metal -framework QuartzCore && ./a.out | |
// | |
#include <SDL.h> | |
#import <Metal/Metal.h> | |
#import <QuartzCore/CAMetalLayer.h> | |
int main (int argc, char *args[]) | |
{ | |
SDL_SetHint(SDL_HINT_RENDER_DRIVER, "metal"); |