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 buffer::Buffer; | |
use std::fmt::Debug; | |
use std::io::{self, BufRead, BufReader, Write}; | |
use std::ops::Deref; | |
trait Process: Debug { | |
fn process<'a, B>(&mut self, input: B, output: &mut (impl Buffer<'a> + Write + ?Sized)) | |
where | |
for<'b> B: BufRead; | |
} |
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
pub fn buildPacket() []const u8 { | |
// Define the packet components | |
const dest_mac: [6]u8 = [_]u8{ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; // Destination MAC | |
const src_mac: [6]u8 = [_]u8{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; // Source MAC | |
const ethertype: [2]u8 = [_]u8{ 0x08, 0x00 }; // EtherType (IPv4) | |
const payload: [46]u8 = [_]u8{0} ** 46; // Payload (46 bytes of zeroes) | |
// Combine all components into a single array | |
const packet: [60]u8 = [_]u8{ | |
// Destination MAC |
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
#include <stdio.h> | |
#include <stdint.h> | |
#include <stdbool.h> | |
typedef struct t__int32_t_s | |
{ | |
int32_t *b; | |
uint32_t *first; | |
uint32_t *length; | |
uint32_t total_length; |
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
generic I/O benches: | |
Running benches/benchmark.rs (target/release/deps/benchmark-ae59633aa8fa8e87) | |
Gnuplot not found, using plotters backend | |
Benchmarking limbo/Prepare statement: 'SELECT 1': Collecting 100 samples in estimated 5.0117 s (1.8Mlimbo/Prepare statement: 'SELECT 1' | |
time: [2.8154 µs 2.8430 µs 2.8732 µs] | |
thrpt: [348.05 Kelem/s 351.74 Kelem/s 355.19 Kelem/s] | |
Found 5 outliers among 100 measurements (5.00%) | |
2 (2.00%) high mild | |
3 (3.00%) high severe |
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
#include <stdio.h> | |
#include <stdint.h> | |
typedef struct t__int32_t_s | |
{ | |
int32_t *b; | |
uint32_t *first; | |
uint32_t *length; | |
uint32_t total_length; |
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
namespace NSMain; | |
entity Func { | |
invariant $lf != ""; | |
field lf: String; | |
factory static enqueue(f: fn() -> String): | |
{ lf: String } | |
{ | |
return { lf = f() }; |
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
using Underscores | |
using Transducers | |
using WebAssemblyCompiler | |
function fpwasm(f) | |
z = Iterators.countfrom() |> Map(x -> 2x) |> TakeWhile(x -> x < 10) | |
j = reduce(+, z) | |
return j | |
end |
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
#include <stdlib.h> | |
#include <stdint.h> | |
#include <stdio.h> | |
// Define the list structure | |
typedef struct Prims_list__uint32_t { | |
enum { Prims_Cons, Prims_Nil, Prims_Null } tag; | |
union { | |
struct { | |
struct Prims_list__uint32_t *tl; |
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 tokio::io::{AsyncBufReadExt, AsyncWriteExt, BufReader}; | |
use tokio::net::TcpStream; | |
async fn read_stream(stream: TcpStream) -> Result<(), Box<dyn std::error::Error>> { | |
let mut buf_reader = BufReader::new(stream); | |
let mut is_200_response = false; | |
let mut is_sse_mode = false; | |
loop { | |
let mut line = String::new(); |
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
# Allow a user in the wheel group to query the smb0 device | |
#perm smb0 0660 | |
# Allow members of group operator to cat things to the speaker | |
#own speaker root:operator | |
#perm speaker 0660 | |
perm /dev/dri/card0 0666 |
NewerOlder