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
package main | |
import ( | |
"errors" | |
"fmt" | |
"log" | |
"math/rand" | |
"sync" | |
"time" | |
) |
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 std::{collections::HashSet, rc::Rc}; | |
#[derive(Debug, PartialEq, Eq, Hash)] | |
pub enum Type { | |
Int, | |
String, | |
Boolean, | |
Array(Box<Type>), | |
Function(Vec<Type>, Box<Type>), // parameter types, return type | |
} |
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
abstract sig Type {} | |
sig Primitive extends Type {} | |
sig Resource extends Type {} | |
fact { | |
one Primitive | |
} | |
sig Function { |
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
; nasm -fmacho64 numbers.asm && gcc numbers.o -o numbers && ./numbers | |
global _main | |
extern _printf | |
extern _scanf | |
extern _fopen | |
extern _fgets | |
extern _atoi | |
section .text |
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
""" | |
Goal: try to find a functions f(x) and g(x) such that f(g(x)) is increasing and g(f(x)) is decreasing. | |
(This program does not solve the puzzle.) | |
""" | |
import math | |
fns = [ | |
(lambda x: 0, "0"), |
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
#!/bin/bash | |
set -euxo pipefail | |
# Ensure AWS CLI is installed | |
if ! command -v aws &> /dev/null; then | |
echo "AWS CLI is not installed. Please install it and configure it." | |
exit 1 | |
fi | |
# List all APIs and delete them |
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 gpui::prelude::*; | |
use gpui::*; | |
struct Counter { | |
count: usize, | |
} | |
impl Render for Counter { | |
fn render(&mut self, cx: &mut ViewContext<Self>) -> impl IntoElement { | |
let mut button = div() |
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
#![feature(test)] | |
extern crate test; | |
use test::Bencher; | |
const SIZE: usize = 2 << 10; | |
#[bench] | |
fn bench_zeroed_memory(b: &mut Bencher) { | |
b.iter(|| { |
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
2024-01-19T20:18:48.186Z cli called | |
2024-01-19T20:18:48.210Z main called | |
2024-01-19T20:18:48.215Z importing command | |
2024-01-19T20:18:48.245Z calling imported command | |
2024-01-19T20:18:48.245Z compile called | |
2024-01-19T20:18:48.245Z globbing finished | |
2024-01-19T20:18:48.245Z setting up synthesis dir | |
2024-01-19T20:18:48.269Z finished setting up synthesis dir | |
2024-01-19T20:18:48.269Z loading wingc | |
2024-01-19T20:18:48.277Z invoking wingc |
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
2024-01-19T20:39:52.816Z cli called | |
2024-01-19T20:39:52.854Z main called | |
2024-01-19T20:39:52.861Z importing command | |
2024-01-19T20:39:52.909Z calling imported command | |
2024-01-19T20:39:52.909Z compile called | |
2024-01-19T20:39:52.909Z globbing finished | |
2024-01-19T20:39:52.910Z setting up synthesis dir | |
2024-01-19T20:39:52.913Z finished setting up synthesis dir | |
2024-01-19T20:39:52.913Z loading wingc | |
2024-01-19T20:39:52.944Z invoking wingc |
NewerOlder