View ilog2_test.c
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 <math.h> | |
#include <stdint.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <gmp.h> | |
#include <mpfr.h> | |
int ilog2(uint64_t x) { return 63 - __builtin_clzll(x); } |
View mpfr_log2.c
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 <stdlib.h> | |
#include <gmp.h> | |
#include <mpfr.h> | |
int main (void) | |
{ | |
mpfr_t x, y; |
View index.html
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
<script> | |
window.onerror = () => alert("Hello, World!"); | |
function hello(x) { | |
if(typeof x === 'undefined') { | |
alert(x.f()); | |
} | |
} | |
hello(); | |
</script> |
View bigint.zig
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 testing = std.testing; | |
pub const Limb = u64; | |
pub const Metadata = packed struct { | |
// positive is set as true for n >= 0, false for n < 0. | |
positive: bool, | |
len: u63, | |
}; |
View dynamic_error_msg.zig
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 Context = struct { | |
canceled: bool = false, | |
err: [4096]u8 = undefined, | |
pub fn formatErr(self: *Context, comptime fmt: []const u8, args: anytype) error{NoSpaceLeft}!void { | |
var fbs = std.io.fixedBufferStream(self.err[0..]); | |
var writer = fbs.writer(); | |
try std.fmt.format(writer, fmt, args); |
View create_union_enum.zig
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 expect = std.testing.expect; | |
const cell = struct { | |
v1: ?*Variant, | |
v2: ?*Variant, | |
}; | |
const Variant = union(enum) { | |
int: i32, |
View create_union_enum.zig
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 expect = std.testing.expect; | |
const cell = struct { | |
v1: ?*Variant, | |
v2: ?*Variant, | |
}; | |
const Variant = union(enum) { | |
int: i32, |
View create_union_enum.zig
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 expect = std.testing.expect; | |
const Variant = union(enum) { | |
int: i32, | |
boolean: bool, | |
// void can be omitted when inferring enum tag type. | |
none, |
View build.log
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
$ zig test src/main.zig | |
./src/main.zig:11:28: error: cannot store runtime value in compile time variable | |
const d: u32 = c; | |
^ |
View mytask.yaml
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
--- | |
- name: My playbook | |
hosts: localhost | |
vars: | |
zabbix_agentd_d_dir: >- | |
{% if ansible_facts['os_family'] == 'RedHat' -%} | |
/etc/zabbix/zabbix_agentd.d | |
{%- else -%} | |
/etc/zabbix/zabbix_agentd.conf.d | |
{%- endif %} |
NewerOlder