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
| as -o popcnt.o popcnt.s | |
| gcc -c popcount.c | |
| gcc popcnt.o popcount.o -o popo |
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 sys | |
| import json | |
| input_file = sys.argv[1] | |
| output_file = sys.argv[2] | |
| f = open(input_file, "r").read() | |
| if len(f) == 0: | |
| raise Exception("emputee file") | |
| file_of_cells = json.loads(f) |
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<arm_neon.h> | |
| #include<stdio.h> | |
| #include<time.h> | |
| #include<stdlib.h> | |
| #include <mach/mach_time.h> | |
| #include<math.h> | |
| #include<unistd.h> | |
| int calculatePaddedLength(int n) { | |
| int pad = (4 - (n % 4)) % 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
| gcc sgemm_ref.c -o sgemm_ref | |
| sudo ./sgemm_ref |
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<stdatomic.h> | |
| #include<pthread.h> | |
| extern int atomic_adder(atomic_int*); | |
| extern int atomic_adder_simple_32(atomic_int*, int y); | |
| int simple_adder(int* x) { | |
| int y = *x + 1; |
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
| # Load lldb with the executable you want to debug first | |
| # lldb --file your-exe | |
| # load this command script | |
| # command script import run_program.py | |
| # this script installs a command rp that will run your executable and print the list of fn calls in the exe | |
| import lldb | |
| def run_program(debugger, command, result, internal_dict): | |
| target = debugger.GetSelectedTarget() |
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
| ``` | |
| thompson_nfa git:(thomson_nfa_zig) ✗ zig test src/main.zig | |
| src/main.zig:127:45: error: use of undeclared identifier 'q_items' | |
| try r.ensureTotalCapacity(p.items.len + q_items.len); | |
| ^ | |
| ➜ thompson_nfa git:(thomson_nfa_zig) ✗ vim src/main.zig | |
| ➜ thompson_nfa git:(thomson_nfa_zig) ✗ zig test src/main.zig | |
| src/main.zig:129:33: error: use of undeclared identifier 'q_items' | |
| r.appendSliceAssumeCapacity(q_items); | |
| ^ |
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
| #!/usr/bin/env bb | |
| (defn what-to-do [arg] | |
| (condp | |
| = arg | |
| "save" :save | |
| arg)) | |
| (defn save-a-command | |
| [db db-location args] |
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
| (ns transducertutorial.core) | |
| ;; a Reducing function is one that takes | |
| ;; an accumulator and an item | |
| ;; and returns a new accumulator with the item processed | |
| (defn my-reducing-fn | |
| [accumulator item] | |
| (conj accumulator item)) | |
| ;; conj is smart enough to know how to how to add the item to the |
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::io; | |
| use std::io::Write; | |
| use std::{thread, time}; | |
| use std::process::{Command, Stdio}; | |
| use rand::Rng; | |
| use libc; | |
| use nix::{ioctl_read_bad, convert_ioctl_res}; | |
| fn get_tty_rows_columns() -> Result<(i32, i32), String> { |
NewerOlder