This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Requesting c++20 standard in gcc commandline does not ensure that it is supported or will be used, | |
# dumping the __cplusplus reveals that gcc completely ignores this request without any warning or error | |
# Such problems leads to similar error messages: | |
# main.cpp:1:24: error: ‘bit_cast’ is not a member of ‘std’; did you mean ‘bad_cast’? | |
# | |
# | |
# This shell script prints | |
# #define __cplusplus 202002L | |
# or | |
# #define __cplusplus 201709L |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat > main.cpp <<- EOM | |
#include <gtest/gtest.h> | |
TEST(group, name) | |
{ | |
printf("Hello!\n"); | |
} | |
EOM | |
cat > CMakeLists.txt <<- EOM |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM node:10-alpine | |
RUN mkdir -p /src/app | |
WORKDIR /src/app | |
COPY package.json /src/app/package.json | |
RUN npm install | |
COPY . /src/app | |
EXPOSE 3000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdint.h> | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <assert.h> | |
#include "testrle.h" | |
typedef uint8_t UINT8; | |
typedef int INTN; | |
typedef void VOID; | |
#define ASSERT assert |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set -e | |
set -x | |
# FAT12 - min 64KB: | |
# dd if=/dev/zero of=test.img count=64 bs=1K | |
# mkfs.vfat -v -F 12 -S 512 -s 4 test.img | |
# FAT16 - min 9MB: | |
# dd if=/dev/zero of=test.img count=9 bs=1M | |
# mkfs.vfat -v -F 16 -S 512 -s 4 test.img | |
# FAT32 - min 256MB (cannot allocate): | |
# dd if=/dev/zero of=test.img count=256 bs=1M |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdint.h> | |
#include <stdbool.h> | |
#include <string.h> | |
extern "C" uint32_t LED_BUFFER[]; | |
extern "C" uint8_t MODE; | |
extern "C" int32_t TICKMS; | |
enum {Width = 32}; | |
uint32_t image[Width][8] = {0}; | |
uint32_t color = 0xab00cd; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdint.h> | |
#define LED_BUFFER ((uint32_t*)0x20000304) | |
#define REFRESH_BUFFER ((uint32_t*)0x20006754) | |
uint8_t buttonMap[8][8]; | |
uint8_t image[8][8]; | |
uint32_t getPixel(int x, int y) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdint.h> | |
#define LED_BUFFER ((uint32_t*)0x20000304) | |
#define REFRESH_BUFFER ((uint32_t*)0x20006754) | |
#define draw(p) { \ | |
uint8_t f = (9 - p / 10) * 10 + p % 10; \ | |
LED_BUFFER[f] = c; \ | |
REFRESH_BUFFER[f] = REFRESH_BUFFER[f] & 0xF8; \ | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fs=require("fs"); | |
var input = fs.readFileSync("input.s").toString().split("\n"); | |
var re = new RegExp("^ ([0-9a-f]{7}):\t(.*?)\t(.*)$") | |
var undef32 = new RegExp("; <UNDEFINED> instruction: 0x([0-9a-f]{8})$"); | |
var comment = new RegExp("^(.+\t.+\t);( .*)$") | |
var wrong = ["vrev64.32", "stmia", "movs r0, r0", "lsrs", | |
"vshr.u32", "illegal", "UNDEFINED", "<und>", ".s", ".u", "hlt ", | |
"vst2", "mrrc2", ".f", "cdp2", "bhi.n", "vtbl.8", "mrc", "mcr", "undefined", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Library/SerialPortLib.h> | |
#include <Library/PrintLib.h> | |
VOID EFIAPI InternalPrintMessage(IN CONST CHAR8 *Format, ...) | |
{ | |
CHAR8 Buffer[1024]; | |
VA_LIST Marker; | |
VA_START (Marker, Format); | |
AsciiVSPrint (Buffer, sizeof (Buffer), Format, Marker); | |
VA_END (Marker); |