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
version: "3.6" | |
services: | |
postgres: | |
image: postgres:15 | |
restart: always | |
volumes: | |
- db_data:/var/lib/postgresql/data | |
- type: bind | |
source: ./docker/postgres/chinook.sql |
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
int main(int argc, char** argv) | |
{ | |
seastar::sharded<buffer_pool_service> buffer_pool_service; | |
seastar::app_template app; | |
app.add_options()( | |
"db-file", boost::program_options::value<std::string>()->default_value("db.dat"), "Database file"); | |
return app.run(argc, argv, [&] -> seastar::future<int> { | |
seastar::engine().at_exit([&buffer_pool_service] { return buffer_pool_service.stop(); }); |
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
BasedOnStyle: Microsoft | |
ColumnLimit: 120 | |
PointerAlignment: Left | |
AlwaysBreakTemplateDeclarations: Yes | |
SortIncludes: CaseSensitive | |
AlignArrayOfStructures: Right | |
AlignConsecutiveAssignments: Consecutive | |
AlignConsecutiveBitFields: Consecutive |
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
const std = @import("std"); | |
const PAGE_SIZE = 4096; | |
const BUFFER_POOL_NUM_PAGES = 1000; | |
///////////////////////// | |
// DISK MANAGER | |
///////////////////////// | |
const IoUringDiskManager = struct { |
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
@ApplicationScoped | |
public class PersonRepositoryAsyncAwait { | |
@Inject | |
PgPool pgPool; | |
public Person findById(Long id) { | |
RowSet<Row> rowSet = pgPool | |
.preparedQuery("SELECT id, name, age, gender FROM person WHERE id = $1") | |
.executeAndAwait(Tuple.of(id)); |
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
class IoUringExample { | |
private static int QUEUE_DEPTH = 8; | |
private static MemorySession session = MemorySession.global(); | |
private static GroupLayout myStructLayout = MemoryLayout.structLayout( | |
Constants.C_INT.withName("foo"), | |
Constants.C_INT.withName("bar")); | |
private static VarHandle myStruct$foo = myStructLayout.varHandle(MemoryLayout.PathElement.groupElement("foo")); | |
private static VarHandle myStruct$bar = myStructLayout.varHandle(MemoryLayout.PathElement.groupElement("bar")); |
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
$ ctags --language-force=C -x --_xformat="%N:%{typeref}:%{signature}" --kinds-C=p libfoo.h |
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 quay.io/fedora/fedora:38 | |
# Install requirements for building OpenJDK from source | |
RUN dnf install -y \ | |
file \ | |
diffutils \ | |
alsa-lib-devel \ | |
cups-devel \ | |
fontconfig-devel \ | |
freetype-devel \ |
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 ubuntu:22.10 AS builder | |
# Allow configuring LLVM download URL | |
ARG LLVM_DOWNLOAD_URL=https://github.com/llvm/llvm-project/releases/download/llvmorg-14.0.0/clang+llvm-14.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz | |
ARG LLVM_EXTRACTED_FILE_NAME=clang+llvm-14.0.0-x86_64-linux-gnu-ubuntu-18.04 | |
# Install dependencies | |
RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y \ | |
git \ | |
curl \ |
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 https://github.com/L-v-M/async/blob/main/cppcoro/include/cppcoro/allocator.hpp | |
#pragma once | |
#include <cstdint> | |
#include <iostream> | |
#include <memory> | |
#include <vector> | |
class FixedAllocator | |
{ |