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 <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
#include <stdint.h> | |
// allows a set for a number over field of 64 bit blocks of bits | |
void set_bit_for_number(size_t* nums, size_t key) { | |
const size_t tabs = key / 64; | |
const size_t rem = key % 64; | |
printf("Setting block %zu, bit %zu, mask %zu\n", tabs, rem, 1 << rem); |
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 <iostream> | |
#include <set> | |
#include <vector> | |
#include <thread> | |
#include <mutex> | |
#include <random> | |
#include <chrono> | |
#include <atomic> | |
constexpr int BITS_PER_LEVEL = 6; |
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
use std::fs::File; | |
use std::io::prelude::*; | |
use std::io::SeekFrom; | |
use std::fs::OpenOptions; | |
#[derive(Debug)] | |
struct Seg(usize, usize); | |
impl Seg { | |
fn contains(&self, text:&[u8], term:&[u8]) -> bool { |
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 <stdio.h> | |
#include <stdlib.h> | |
#include <stdint.h> | |
#include <stddef.h> | |
#include <unistd.h> | |
#include <fcntl.h> | |
#include <string.h> | |
#include <sys/mman.h> | |
#include <errno.h> | |
#include <inttypes.h> |
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 <stdio.h> | |
#include <mach/mach.h> | |
#include <mach/mach_host.h> | |
int main() { | |
// Get the host's CPU statistics | |
host_cpu_load_info_data_t cpu_info; | |
mach_msg_type_number_t count = HOST_CPU_LOAD_INFO_COUNT; | |
kern_return_t kr = host_statistics(mach_host_self(), HOST_CPU_LOAD_INFO, (host_info_t)&cpu_info, &count); | |
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 <stdlib.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <stdint.h> | |
#include <stddef.h> | |
#include <limits.h> | |
#include <assert.h> | |
#include <sys/event.h> | |
#include <sys/time.h> |
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 <CoreServices/CoreServices.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
void fsevent_callback( | |
ConstFSEventStreamRef streamRef, | |
void *clientCallBackInfo, | |
size_t numEvents, | |
void *eventPaths, |
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
// | |
// GameScene.swift | |
// FunScape | |
// | |
// Created by Joshua Weinstein on 4/26/25. | |
// | |
import SpriteKit | |
import GameplayKit |
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
//: A SpriteKit based Playground | |
import PlaygroundSupport | |
import SpriteKit | |
let sceneView = SKView(frame: CGRect(x:0 , y:0, width: 640, height: 480)) | |
class GameOverScene : SKScene { | |
var label = SKLabelNode(fontNamed: "Chalkduster") | |
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 <regex> | |
int main(int argc, char const *argv[]) | |
{ | |
const std::string foo = "hello \n sir \n"; | |
std::vector<EventPos> pairs; | |
generateEvents(foo, '\n', pairs); | |
std::printf("%zu\n", pairs.size()); | |
const std::string sample = "remote= bar foo=4 six=bar fhhfghfgdhgdf do=555"; | |
const std::regex sampleRex("([a-zA-Z0-9_]+)\\s*=\\s*([a-zA-Z0-9_]+)"); |
NewerOlder