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
import os | |
import net.mbedtls | |
const x = mbedtls.is_used // just silence a V warning, since we are using only the C functions from net.mbedtls, but not any pub V fn etc | |
type FnRNG = fn(p_rng voidptr, output &u8, output_len usize) int | |
fn C.mbedtls_pk_parse_public_keyfile(pk &C.mbedtls_pk_context, path &u8) int | |
fn C.mbedtls_pk_encrypt(pk &C.mbedtls_pk_context, const_input &u8, ilen usize, output &u8, olen &usize, osize usize, f_rng FnRNG, p_rng voidptr) int | |
fn C.mbedtls_pk_decrypt(pk &C.mbedtls_pk_context, const_input &u8, ilen usize, output &u8, olen &usize, osize usize, f_rng FnRNG, p_rng voidptr) int |
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 <windows.h> | |
[typedef] | |
struct C.MOUSEINPUT { | |
dx i64 | |
dy i64 | |
mouseData u32 | |
dwFlags u32 | |
time u32 | |
dwExtraInfo &u64 = unsafe { nil } |
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
import json | |
import os | |
import time | |
import math | |
import runtime | |
fn main() { | |
println('Started...') | |
sw := time.new_stopwatch() | |
content := os.read_file('./wordle_min.json')! |
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
// Writen by Attractive Chaos; distributed under the MIT license | |
// This is a modifed copy of https://raw.githubusercontent.com/kostya/benchmarks/master/matmul/matmul.c , with libnotify usages removed | |
#include <math.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#ifdef __clang__ | |
#define COMPILER "clang" | |
#else | |
#define COMPILER "gcc" |
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
import os | |
import time | |
struct Seeker { | |
mut: | |
graph map[int][]int | |
already_found map[int][][]int | |
all_solutions [][]int | |
} |
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
module main | |
#define SOKOL_IMPL | |
#define SOKOL_GLCORE33 | |
#flag -I @VMODROOT | |
#flag -lX11 -lGL -lXcursor -lXi -lpthread | |
#flag -lm | |
#include "thirdparty/sokol_gfx.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 <iostream> | |
#include <stdlib.h> | |
#include <SDL.h> | |
#include <experimental/random> | |
#include <vector> | |
const int WIDTH = 1360, HEIGHT = 760; | |
const int H_WIDTH = WIDTH / 2; | |
const int H_HEIGHT = HEIGHT / 2; | |
const int STARS_COUNT = 5000; |
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
module main | |
import json | |
pub type Node = C.cJSON | |
struct UseJson { | |
x int | |
} |
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
import time | |
type Task = fn (data voidptr) | |
pub fn (t Task) str() string { | |
return 'Task{ ${ptr_str(t)} }' | |
} | |
fn task_default(data voidptr) { | |
// println('task_default: $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
module main | |
import gg | |
import gx | |
struct App { | |
mut: | |
gg &gg.Context = 0 | |
radius f64 = 10.0 | |
} |
NewerOlder