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_]+)"); |
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 <string> | |
#include <filesystem> | |
#include <vector> | |
#include <cstdio> | |
#include <cstdlib> | |
struct EventPos { | |
size_t ind = 0; | |
size_t size = 0; |
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
fn bit_mask_index(mask:u64) -> Option<usize> { | |
match mask { | |
0 => None, | |
1 => Some(0), | |
2 => Some(1), | |
4 => Some(2), | |
8 => Some(3), | |
16 => Some(4), |
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
size_t find_unset_bit(size_t num) { | |
return ~num & (num + 1); | |
} | |
size_t find_first_set_bit(size_t num) { | |
return num & -num; | |
} |
NewerOlder