Here's what I do:
pyenv install $NEW_VERSION
pyenv uninstall $OLD_VERSION
pyenv global $NEW_VERSION
pyenv rehash # idk if this is needed
pip install pipx
pipx reinstall poetry
// Grab all Ruff rule categories from the Ruff docs. | |
// Run this in the browser console on https://docs.astral.sh/ruff/rules/. | |
const R = await import("https://esm.sh/ramda@0.29.1"); | |
R.pipe( | |
R.tail, | |
R.pluck("innerText"), | |
R.map(R.match(/\(([A-Z0-9]+(?:, *[A-Z0-9]+)*)\)/)), | |
R.map(R.last), | |
R.chain(R.split(", ")), |
Here's what I do:
pyenv install $NEW_VERSION
pyenv uninstall $OLD_VERSION
pyenv global $NEW_VERSION
pyenv rehash # idk if this is needed
pip install pipx
pipx reinstall poetry
gh api graphql --cache 1h --jq '.data.repository.milestone.issues.edges[] | {(.node.number|tostring): [.node.assignees.edges[].node.login] | length}' --paginate -f query='query ($endCursor: String) { | |
repository(owner: "microsoft", name: "vscode") { | |
milestone(number: 8) { | |
issues(first: 1000, states: [OPEN], after: $endCursor) { | |
edges { | |
node { | |
number | |
title | |
assignees(first: 10) { | |
edges { |
Given a string, return the shortest "unambiguous abbreviation" of that string. | |
Assume that your input string is a non-empty string consisting of lowercase letters (a-z) and spaces. | |
Example: | |
UnambiguousAbbreviation("peter piper picked a peck of pickled peppers") = "pet pip picke a pec o pi p" | |
Initially, the word bank looks like: |
use rand::distributions::Uniform; | |
use rand::Rng; | |
use rayon::prelude::*; | |
use std::time::Instant; | |
fn main() { | |
let dis = Uniform::from(0..=6_u8); | |
for trials in (1..).map(|x| 10usize.pow(x)) { | |
let start = Instant::now(); |
cityNames = {"New York", "Geneva", "Nairobi", "Vienna", "The Hague"} | |
cities = Interpreter["City"] /@ cityNames | |
populations = #[EntityProperty["City", "Population"]] & /@ cities | |
Print[NumberForm[Total[populations], DigitBlock -> 3]] (* 15,376,617 people *) |
unit sub MAIN(UInt :s(:$sides) = 120, UInt :r(:$rolls) = 1_000); | |
sub roll-die { (1..$sides).roll } | |
my $coprimes = 0; | |
for ^$rolls { | |
my $a = roll-die(); | |
my $b = roll-die(); |
unit sub MAIN(); | |
use XML; | |
use XML::Query; | |
sub get-urls($file-name) { | |
my $xml = from-xml-file($file-name); | |
my $xq = XML::Query.new($xml); | |
my $urls = $xq('outline[type=rss]').elements.map(*<xmlUrl>); |
#include <iostream> | |
#include <utility> | |
#include <vector> | |
#include <numeric> | |
auto SumNumbers(const std::vector<int>& numbers) -> std::pair<int, int> { | |
int even_sum = 0; | |
int odd_sum = 0; | |
for (const int number : numbers) { |