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
ifneq ($(KERNELRELEASE),) | |
obj-m := kernel_crasher.o | |
else | |
KDIR := /lib/modules/$(shell uname -r)/build | |
PWD := $(shell pwd) | |
default: | |
$(MAKE) -C $(KDIR) M=$(PWD) modules | |
endif |
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
const std = @import("std"); | |
// primitive of the event loop. | |
// Ctx is typically a pointer to *This and data a pointer to the Users data. | |
// destroyData is called after the event has finished and must clean up the event to avoid leaks. | |
const Event = struct { | |
ctx: *anyopaque, | |
data: *anyopaque, | |
name: []const u8, | |
destroyData: *const fn (*anyopaque, *anyopaque) void, |
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
package themap | |
import ( | |
"runtime" | |
"sync" | |
"sync/atomic" | |
) | |
type Hashable interface { | |
comparable |
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
const {spawn} = require('child_process'); | |
const child = spawn('/bin/bash'); | |
process.stdin.on('data', function(data) { | |
child.stdin.write(data); | |
}); | |
child.stdout.on('data', function(data) { | |
process.stdout.write(data); | |
}); |
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::{ | |
collections::{HashMap, VecDeque}, | |
io, | |
ops::{Add, Mul}, | |
}; | |
#[derive(Debug)] | |
enum AST { | |
Const(f64), | |
Func(String, Box<AST>), |
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
.global main | |
.set print_hex_msb4mask, 0xf000000000000000 | |
.data | |
print_hex_chars: | |
.ascii "0123456789abcdef" | |
.text | |
syscall4: | |
movq %rax, %rax |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using UnityEngine; | |
[RequireComponent(typeof(MeshFilter))] | |
public class GameHandler : MonoBehaviour | |
{ | |
Mesh mesh; |
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 <stdint.h> | |
#include <stdlib.h> | |
#include <stdbool.h> | |
typedef uint64_t u64; | |
typedef struct Table | |
{ | |
u64 nullValue; | |
bool hasNull; |
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
const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890+@".split(""); | |
const maxBase = n => { | |
let r = ""; | |
while (n) { | |
r += chars[n & 63]; | |
n = n/64|0; | |
} | |
return r; | |
}; |
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::collections::BinaryHeap; | |
use std::fmt::Debug; | |
use std::vec; | |
use std::{collections::HashMap, io, time::Instant}; | |
#[derive(Debug)] | |
struct NGramMeta<T: Clone + PartialEq> { | |
bind: T, | |
document: Vec<String>, | |
freq: f64, |
NewerOlder