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
[package] | |
name = "try-polars-diff" | |
version = "0.1.0" | |
edition = "2021" | |
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | |
[dependencies] | |
anyhow = "1.0.76" | |
chrono = { version = "0.4.31", features = ["serde"] } |
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
/* | |
datetime,usage,user | |
2023-12-12T01:23:45-0500,1000.0,a | |
2023-12-12T01:23:45-0500,1000.0,b | |
2023-12-12T01:23:45-0500,2000.0,c | |
2023-12-13T01:23:45-0500,1000.0,a | |
2023-12-13T01:23:45-0500,1000.0,b | |
2023-12-13T01:23:45-0500,2000.0,c | |
2023-12-14T01:30:30-0500,2000.0,a | |
2023-12-14T01:30:30-0500,0000.0,b |
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 math | |
from pathlib import Path | |
from typing import Optional | |
import click | |
import numpy as np | |
import torch | |
from torch import nn | |
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 clap::{Args, Parser, Subcommand}; | |
/// Doc comment | |
#[derive(Debug, Parser)] | |
struct Cli { | |
#[command(subcommand)] | |
command: Command, | |
} | |
#[derive(Debug, 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
// This implementation allows a single producer to fan out | |
// messages to multiple consumers, so that only one consumer | |
// gets each value. | |
// | |
// The trick is to send a oneshot channel to the producer, | |
// and it responds over that. | |
use tokio::sync::{mpsc, oneshot}; | |
#[tokio::main] | |
async fn main() { |
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
// I want component A to have a counter that increases on button click, | |
// and I want to be able to use routes to go to B and C, but | |
// I don't want the counter of A to forget its state when I visit B or C | |
// and then return to A. | |
// | |
// The index.html and Cargo.toml are in comments at the top | |
// of this yew source file. | |
/* | |
<!DOCTYPE html> | |
<html> |
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
((lambda () | |
(show-paren-mode 1) | |
(menu-bar-mode -1) | |
(scroll-bar-mode -1) | |
(tool-bar-mode -1))) | |
(defun visiting-bro-sources () | |
"Is this buffer visiting a bro source file?" | |
(interactive) | |
(if (locate-dominating-file default-directory "bro-path-dev.in") |
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 python2.7 | |
'''flippity.py | |
This is a stupid simple way to make sure that make-maintained | |
generated code gets served based on its dependencies. | |
In the example below, flippity.js is created by transpiling | |
flippity.ts, as specified by the makefile. | |
Usage:: |
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
;;; Used with GNU Emacs 24.3.1 (x86_64-apple-darwin, NS apple-appkit-1038.36) of 2013-03-13 on bob.porkrind.org | |
;;; Miscellaneous notes: | |
;;; | |
;;; This is nice for debugging on type error: | |
;;; (message (prin1-to-string (type-of (car paths))))) | |
(setq line-move-visual nil) | |
(menu-bar-mode -1) | |
(tool-bar-mode -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
#! /usr/bin/env python2.7 | |
from multiprocessing import Pool, Queue | |
import os | |
from sys import argv | |
import tarfile | |
BLACKLIST = ['.git'] | |
EXTENSIONS = ['.tgz', '.tar', '.tar.gz', '.tar.bz2'] | |
N_PARALLEL = 10 |