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
| { | |
| "nodes": { | |
| "flake-utils": { | |
| "inputs": { | |
| "systems": "systems" | |
| }, | |
| "locked": { | |
| "lastModified": 1694529238, | |
| "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", | |
| "owner": "numtide", |
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
| const std = @import("std"); | |
| const Type = std.builtin.Type; | |
| pub fn Templates(comptime entries: anytype) type { | |
| const type_info = @typeInfo(@TypeOf(entries)).Struct; | |
| var enum_fields: [type_info.fields.len]Type.EnumField = undefined; | |
| for (type_info.fields, 0..) |field, idx| { |
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
| defmodule Mix.Tasks.Man do | |
| @moduledoc """ | |
| Print documentation for given Elixir term. | |
| """ | |
| @shortdoc "Show manual for term" | |
| use Mix.Task | |
| require IEx.Helpers |
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
| { | |
| "nodes": { | |
| "devenv": { | |
| "inputs": { | |
| "flake-compat": "flake-compat", | |
| "nix": "nix", | |
| "nixpkgs": "nixpkgs", | |
| "pre-commit-hooks": "pre-commit-hooks" | |
| }, | |
| "locked": { |
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
| all: test |
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
| defmodule BellmanFord2 do | |
| @moduledoc """ | |
| The Bellman–Ford algorithm is an algorithm that computes shortest paths from a single | |
| source vertex to all of the other vertices in a weighted digraph. | |
| It is capable of handling graphs in which some of the edge weights are negative numbers | |
| Time complexity: O(VLogV) | |
| """ | |
| @type distance :: %{Graph.vertex_id() => integer} |
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
| execve("/usr/bin/systemd-socket-activate", ["systemd-socket-activate", "-l", "8888", "--fdname=tcp", "-E", "ERL_FLAGS=-kernel inet_backend s"..., "_build/prod/rel/echo/bin/echo", "foreground"], 0x7ffd3b5a3308 /* 27 vars */) = 0 | |
| brk(NULL) = 0x56283b5e3000 | |
| arch_prctl(0x3001 /* ARCH_??? */, 0x7ffe23d58b00) = -1 EINVAL (Invalid argument) | |
| access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory) | |
| openat(AT_FDCWD, "/lib/systemd/tls/haswell/x86_64/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) | |
| stat("/lib/systemd/tls/haswell/x86_64", 0x7ffe23d57cb0) = -1 ENOENT (No such file or directory) | |
| openat(AT_FDCWD, "/lib/systemd/tls/haswell/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) | |
| stat("/lib/systemd/tls/haswell", 0x7ffe23d57cb0) = -1 ENOENT (No such file or directory) | |
| openat(AT_FDCWD, "/lib/systemd/tls/x86_64/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) | |
| stat("/lib/systemd/tls/x86_64", 0x7ffe23d5 |
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
| execve("/usr/bin/systemd-socket-activate", ["systemd-socket-activate", "-l", "8888", "--fdname=tcp", "-E", "ERL_FLAGS=-kernel inet_backend s"..., "_build/prod/rel/echo/bin/echo", "foreground"], 0x7ffece9f2b88 /* 27 vars */) = 0 | |
| brk(NULL) = 0x5584132d3000 | |
| arch_prctl(0x3001 /* ARCH_??? */, 0x7ffdd75bb450) = -1 EINVAL (Invalid argument) | |
| access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory) | |
| openat(AT_FDCWD, "/lib/systemd/tls/haswell/x86_64/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) | |
| stat("/lib/systemd/tls/haswell/x86_64", 0x7ffdd75ba6a0) = -1 ENOENT (No such file or directory) | |
| openat(AT_FDCWD, "/lib/systemd/tls/haswell/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) | |
| stat("/lib/systemd/tls/haswell", 0x7ffdd75ba6a0) = -1 ENOENT (No such file or directory) | |
| openat(AT_FDCWD, "/lib/systemd/tls/x86_64/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) | |
| stat("/lib/systemd/tls/x86_64", 0x7ffdd75b |
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
| Delivered-To: ****** | |
| Received: by 2002:a92:9c89:0:0:0:0:0 with SMTP id x9csp957441ill; | |
| Fri, 3 Apr 2020 13:35:23 -0700 (PDT) | |
| X-Received: by 2002:a17:907:212f:: with SMTP id qo15mr10368606ejb.326.1585945883463; | |
| Fri, 03 Apr 2020 13:31:23 -0700 (PDT) | |
| X-Google-Smtp-Source: APiQypLvOEHWpSbsJjaOLe+cYvK/167FB8mnZpkrXNCSDDR/YCarZ6oBWN9HNf3qrcV1TGUsRqsN | |
| X-Received: by 2002:a17:907:212f:: with SMTP id qo15mr10368495ejb.326.1585945881753; | |
| Fri, 03 Apr 2020 13:31:21 -0700 (PDT) | |
| ARC-Seal: i=1; a=rsa-sha256; t=1585945881; cv=none; | |
| d=google.com; s=arc-20160816; |
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
| defmodule TimeFormat do | |
| def format(seconds) do | |
| seconds | |
| |> :calendar.seconds_to_time() | |
| |> do_format() | |
| |> to_string() | |
| end | |
| defp do_format({0, m, s}), do: :io_lib.format("~B:~2..0B", [m, s]) | |
| defp do_format({h, m, s}), do: :io_lib.format("~B:~2..0B:~2..0B", [h, m, s]) |