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
#!/usr/bin/env python3 | |
# Problem creation auxiliary script. | |
# Run: chmod +x nztrain.py && ./nztrain.py | |
# Configure: model/model.py | |
# | |
# Do not move this script as it uses | |
# paths relative to its file location. | |
import importlib |
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 next_binary_power(int x) { | |
return 1 << (32 - __builtin_clz(x - 1)); | |
} | |
struct SegmentTree { | |
vector<int> nodes; | |
SegmentTree(int size) : nodes(next_binary_power(size) * 2, INT_MAX) {} | |
int query(int left, int right) { |
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
#!/usr/local/opt/[email protected]/bin/python3.8 | |
import objc | |
import time | |
from Foundation import * | |
from PyObjCTools import AppHelper | |
from pypresence import Presence | |
# References image assets | |
client_id = "511368737199357972" |
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
#![feature(test)] | |
extern crate test; | |
mod tree { | |
type BNode = Box<Node>; | |
pub enum Node { | |
If(BNode, BNode, BNode), | |
Minus(BNode, BNode), | |
Add(BNode, BNode), |
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
use std::process::Command; | |
const PREFIX: &str = r#"tell application "System Events""#; | |
const SUFFIX: &str = r#"to get the title of every window of every process"#; | |
const PERMISSION_ERROR: &str = "osascript is not allowed assistive access"; | |
#[derive(Debug, Copy, Clone)] | |
pub enum WindowTitleError { | |
NoAccessibilityPermission, | |
} |
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
use std::io::{Cursor, Write}; | |
use goblin::elf::{self, Elf}; | |
use goblin::mach::*; | |
use scroll::{IOwrite, Pwrite, SizeWith}; | |
use crate::PAGE_SIZE; | |
#[derive(Debug, Default)] | |
struct Segment { |
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
global start | |
KERNEL_BASE equ 0xFFFFC00000000000 | |
section .inittext | |
bits 32 | |
start: | |
mov esp, stack_top - KERNEL_BASE ; set up stack | |
mov edi, ebx |
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
language: cpp | |
before_script: | |
- mkdir cmake | |
- pushd cmake | |
- wget https://cmake.org/files/v3.8/cmake-3.8.0-Linux-x86_64.sh | |
- chmod +x cmake-*-Linux-x86_64.sh | |
- ./cmake-*-Linux-x86_64.sh --exclude-subdir --skip-license | |
- export PATH="${PWD}/bin:$PATH" | |
- popd |