This file contains hidden or 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
# Info from: https://discourse.haskell.org/t/pre-hftp-ghc-nightly-releases/5094/5 | |
$ URL='https://gitlab.haskell.org/ghc/ghc/-/jobs/artifacts/master/raw/ghc-x86_64-linux-fedora33-release.tar.xz?job=x86_64-linux-fedora33-release' | |
$ ghcup install ghc -u $URL head |
This file contains hidden or 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 <fcntl.h> // open, O_CREAT, O_RDWR, AT_FDCWD, AT_STATX_SYNC_AS_STAT | |
#include <stdio.h> // printf | |
#include <sys/stat.h> // statx, STATX_ALL | |
#include <unistd.h> // pwrite | |
#define TMPFILE "test.txt" | |
int | |
main() | |
{ |
This file contains hidden or 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
// How can we make this program well-defined without sacrificing efficiency? If the destination type | |
// is a trivially-copyable implicit-lifetime type, this can be accomplished by copying the storage | |
// elsewhere, using placement new of an array of byte-like type, and copying the storage back to its | |
// original location, then using std::launder to acquire a pointer to the newly-created object, and | |
// finally relying on the compiler to optimise away all the copying. However, this would be very | |
// verbose and hard to get right. For expressivity and optimisability, a combined operation to | |
// create an object of implicit-lifetime type in-place while preserving the object representation | |
// may be useful. This is exactly what std::start_lifetime_as is designed to do | |
template<class T> |
This file contains hidden or 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
# Makefile to compile and run Java sources manually | |
# because JDK 20 Valhalla support is not yet available in IntelliJ IDEA | |
JAVA_VERSION = 20 | |
JAVAC = /home/user/downloads/jdk-20-vahalla-20-75/bin/javac | |
JAVA = /home/user/downloads/jdk-20-vahalla-20-75/bin/java | |
JAVA_COMPILE_OPTIONS = --enable-preview --release $(JAVA_VERSION) | |
JAVA_OPTIONS = --enable-preview | |
JAVA_MAIN_CLASS = org.example.Database |
This file contains hidden or 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
// If in Node.js, need DOMParser. | |
if (typeof DOMParser === "undefined") { | |
global.DOMParser = require("xmldom").DOMParser; | |
} | |
// If Node.js is pre-v17.5, need fetch from node-fetch too. | |
if (typeof fetch === "undefined") { | |
global.fetch = require("node-fetch"); | |
} | |
const CLANG_FORMAT_FLAG_URL = "https://clang.llvm.org/docs/ClangFormatStyleOptions.html" |
This file contains hidden or 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
#!/bin/bash | |
# This script is used to dump the warnings from the clang compiler | |
# into a file, and let you view/dump the diff between the warnings. | |
# $ clang-dump-warnings.sh <enable-diffs> <compiler-flags> | |
# Example: | |
# $ clang-dump-warnings.sh true -Wall -Wextra -Werror -Wno-unused-parameter |
This file contains hidden or 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
{ | |
"version": 3, | |
"cmakeMinimumRequired": { | |
"major": 3, | |
"minor": 23, | |
"patch": 0 | |
}, | |
"configurePresets": [ | |
{ | |
"hidden": true, |
This file contains hidden or 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
pub fn HeapPage_init(self: *HeapPage) void { | |
self.page.header.lsn = 0; | |
self.page.header.num_records = 0; | |
self.page.header.free_space_end = @intCast(u16, PAGE_SIZE); | |
} | |
pub fn HeapPage_getFreeSpace(self: *HeapPage) u16 { | |
return self.page.header.free_space_end - HEADER_SZ - self.page.header.num_records * SLOT_SZ; | |
} |
This file contains hidden or 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
$ sudo dnf install flex | |
$ | |
$ git clone git://gcc.gnu.org/git/gcc.git gcc-dev | |
$ cd gcc-dev | |
$ | |
$ ./contrib/download_prerequisites | |
$ mkdir build && cd build | |
$ | |
$ ../configure -v \ | |
--build=x86_64-linux-gnu \ |
This file contains hidden or 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
# Created with: $ diagtool tree | |
-Wall | |
-Wextra | |
-Wpedantic | |
-Warray-bounds-pointer-arithmetic | |
-Wbind-to-temporary-copy | |
-Wcalled-once-parameter | |
-Wcast-align |