Skip to content

Instantly share code, notes, and snippets.

View ttldtor's full-sized avatar
🎩
Sir Manticore

ttldtor ttldtor

🎩
Sir Manticore
View GitHub Profile
@ttldtor
ttldtor / meta.c
Created September 19, 2025 23:01
meta C
#include <stdio.h>
typedef struct true_t {
char _;
} true_t;
true_t TRUE;
typedef struct false_t {
char _;
xychart
    title "Sales Revenue"
    x-axis [jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec]
    y-axis "Revenue (in $)" 4000 --> 11000
    bar [5000, 6000, 7500, 8200, 9500, 10500, 11000, 10200, 9200, 8500, 7000, 6000]
    line [5000, 6000, 7500, 8200, 9500, 10500, 11000, 10200, 9200, 8500, 7000, 6000]
In file included from C:/msys64/mingw64/include/c++/14.1.0/bits/stl_construct.h:62,
from C:/msys64/mingw64/include/c++/14.1.0/bits/stl_iterator.h:78,
from C:/msys64/mingw64/include/c++/14.1.0/bits/ranges_base.h:37,
from C:/msys64/mingw64/include/c++/14.1.0/bits/ranges_util.h:34,
from C:/msys64/mingw64/include/c++/14.1.0/tuple:44,
from C:/msys64/mingw64/include/c++/14.1.0/functional:53,
from C:/w3/dxfeed-graal-cxx-api/include/dxfeed_graal_cpp_api/internal/CEntryPointErrors.hpp:12:
In function 'constexpr void std::__advance(_InputIterator&, _Distance, input_iterator_tag) [with _InputIterator = ranges::basic_iterator<ranges::adaptor_cursor<__detail::_Node_const_iterator<pair<const __cxx11::basic_string<char>, variant<dxfcpp::tools::ConnectTool, dxfcpp::tools::DumpTool, dxfcpp::tools::HelpTool, dxfcpp::tools::LatencyTest, dxfcpp::tools::PerfTestTool, dxfcpp::tools::QdsTool> >, false, true>, ranges::iter_transform
enum TimeZone { LOCAL, GMT };
// https://stackoverflow.com/a/58037981/21913386
// Algorithm: http://howardhinnant.github.io/date_algorithms.html
int daysFromEpoch(int y, int m, int d) {
y -= m <= 2;
int era = y / 400;
int yoe = y - era * 400; // [0, 399]
int doy = (153 * (m + (m > 2 ? -3 : 9)) + 2) / 5 + d - 1; // [0, 365]
int doe = yoe * 365 + yoe / 4 - yoe / 100 + doy; // [0, 146096]
@ttldtor
ttldtor / lfll.rs
Last active March 29, 2024 18:04
Lock-free LinkedList in Rust
use std::sync::{Arc, atomic::{AtomicPtr, Ordering}};
use std::ptr;
struct Node<T> {
data: T,
next: AtomicPtr<Node<T>>,
}
pub struct LockFreeLinkedList<T> {
head: AtomicPtr<Node<T>>,
.POSIX:
.SUFFIXES:
.PHONY: all clean
OBJ = obj
BIN = bin
COMMON_CFLAGS = -O2 -DUSE_PTHREADS -std=c99 -D_POSIX_SOURCE \
-D_POSIX_C_SOURCE=200809L -fPIC -I../include
COMMON_LDFLAGS = -pthread
LIB_NAME = DXFeed
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#include <boost/variant.hpp>
#include <boost/variant2.hpp>
#include <iostream>
#include <memory>
#include <mutex>
#include <type_traits>
#include <variant>
struct Error {};
sudo apt-get install xrdp
sudo cp /etc/xrdp/xrdp.ini /etc/xrdp/xrdp.ini.bak
sudo sed -i 's/3389/3390/g' /etc/xrdp/xrdp.ini
sudo sed -i 's/max_bpp=32/#max_bpp=32\nmax_bpp=128/g' /etc/xrdp/xrdp.ini
sudo sed -i 's/xserverbpp=24/#xserverbpp=24\nxserverbpp=128/g' /etc/xrdp/xrdp.ini
bc1q779qrrmy22aqtvc00khnmefjuycprg292smpac.ttldtor5