#include <stdio.h>
#include <assert.h>
unsigned trailing_zeros(unsigned n) {
// fill in this 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
pub fn add(a: i32, b: i32) i32 { | |
return a + b; | |
} |
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
[nix-shell:~/dev/zig/build]$ ./zig test ../std/os/path.zig --test-filter resolve | |
Test 1/1 os.path.resolve...OK | |
[nix-shell:~/dev/zig/build]$ ./zig test ../std/os/path.zig | |
/home/andy/dev/zig/std/buffer.zig:105:24: error: container 'Buffer' has no member called 'initFromBuffer' | |
var buf2 = %%Buffer.initFromBuffer(&buf); | |
^ | |
/home/andy/dev/zig/std/buffer.zig:106:15: error: no member named 'eqlBuffer' in 'Buffer' | |
assert(buf.eqlBuffer(&buf2)); | |
^ |
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
const std = @import("std"); | |
const example = | |
\\1abc2 | |
\\pqr3stu8vwx | |
\\a1b2c3d4e5f | |
\\treb7uchet | |
; | |
pub fn main() !void { |
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
andy@ark ~/tmp> gcc -o hello hello.c | |
andy@ark ~/tmp> strace ./hello | |
execve("./hello", ["./hello"], 0x7ffe96b5ddb0 /* 62 vars */) = 0 | |
brk(NULL) = 0x2129000 | |
access("/etc/ld-nix.so.preload", R_OK) = -1 ENOENT (No such file or directory) | |
openat(AT_FDCWD, "/nix/store/xg6ilb9g9zhi2zg1dpi4zcp288rhnvns-glibc-2.30/lib/tls/haswell/x86_64/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) | |
stat("/nix/store/xg6ilb9g9zhi2zg1dpi4zcp288rhnvns-glibc-2.30/lib/tls/haswell/x86_64", 0x7fff2bd55cc0) = -1 ENOENT (No such file or directory) | |
openat(AT_FDCWD, "/nix/store/xg6ilb9g9zhi2zg1dpi4zcp288rhnvns-glibc-2.30/lib/tls/haswell/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) | |
stat("/nix/store/xg6ilb9g9zhi2zg1dpi4zcp288rhnvns-glibc-2.30/lib/tls/haswell", 0x7fff2bd55cc0) = -1 ENOENT (No such file or directory) | |
openat(AT_FDCWD, "/nix/store/xg6ilb9g9zhi2zg1dpi4zcp288rhnvns-glibc-2.30/lib/tls/x86_64/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or dire |
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 export fn _start() void {} |
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
const std = @import("std"); | |
// Although this function looks imperative, note that its job is to | |
// declaratively construct a build graph that will be executed by an external | |
// runner. | |
pub fn build(b: *std.Build) void { | |
// Standard target options allows the person running `zig build` to choose | |
// what target to build for. Here we do not override the defaults, which | |
// means any target is allowed, and the default is native. Other options | |
// for restricting supported target set are available. |
- drop db2json.js into your groovebasin instance
- stop your groove basin instance so that it does not write to the db while you are dumping its data
node db2json.js
(use the same node.js version as groove basin is using, and it also wants to use the same leveldown dependency you already have installed). It hard-codes the input asgroovebasin.db
.groovebasin.db.json
is created which is 100% of the information from the database, in JSON format. It is one giant map of every key-value pair.
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
int main(int argc, char **argv) { | |
struct SoundIo *soundio = soundio_create(); | |
if (!soundio) { | |
fprintf(stderr, "out of memory\n"); | |
return 1; | |
} | |
int err; | |
if ((err = soundio_connect(soundio))) { | |
fprintf(stderr, "unable to connect: %s\n", soundio_strerror(err)); | |
soundio_destroy(soundio); |
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
-----BEGIN PGP PUBLIC KEY BLOCK----- | |
mQINBFv8SrUBEADCku6WktTc1g+iyE9ZCtMv4kWqSHyQxFaEV8V5J2EAkjAzgr6w | |
NLmHGmNmXm8EzCWnwn/KfHJCeXTcgma/FtIF7hJfWB0xktA7WENUVc3qtT0cY9z3 | |
9jh6J3TW3m9hcN7szSyEqGvPMVCvd5pERZXfof9OaRqtNak3GBOcklHYrVJ0KCtA | |
quR0t9NYrdOQikmBy4c9GaDsq/6H39LPuuj/vm7M+MHrw5dlKh+HPeUP9jMbFoXU | |
ohz97RSy8T2lUQDQx1EisAJNvdpU3mzAlWy2pEH+pKCBs5L0vPV/tvH1J5Pd489s | |
7VcdM9AolIuHvV0qCDAG7fcWujV5R5w48vznvfi6R3DN8O2iVrYdOWn2Bm60HdGm | |
XxGQswb6/MfThpFzQUNQpvnXxdbt2vefUTmM4suid6ki/jLfsiY1rqcNdEcriYFx | |
J6ma4SvZOB7OB2DG9bjWSItDIa2HqW37o//FYoFHJO0L+v5qjemYx5QrpL2wCpnY |