I hereby claim:
- I am paholg on github.
- I am paho (https://keybase.io/paho) on keybase.
- I have a public key ASAr75NheLefKgANlGk7RS-daJj6cN7lfhgMc1ke6AiE3Ao
To claim this, I am signing this object:
use std::collections::HashSet; | |
use std::io::Write; | |
use std::path::Path; | |
use std::process::{Command, Output}; | |
use std::str; | |
use std::vec::Vec; | |
use std::{fs, io}; | |
use anyhow::{anyhow, bail}; | |
use clap::Parser; |
impl Solution { | |
pub fn search_range(nums: Vec<i32>, target: i32) -> Vec<i32> { | |
let (first, last) = find_first_last(&nums, target); | |
let first = first.map(|i| i as i32).unwrap_or(-1); | |
let last = last.map(|i| i as i32).unwrap_or(-1); | |
vec![first, last] | |
} | |
} | |
fn find_first_last(nums: &[i32], target: i32) -> (Option<usize>, Option<usize>) { |
#!/usr/bin/env ruby | |
class FirstLast | |
attr_reader :data | |
def self.find(data, target) | |
new(data).find(target) | |
end | |
def initialize(data) |
class Tree | |
attr_reader :head | |
def self.from_string(string) | |
tree = Tree.new(Node.new('COM')) | |
map = { 'COM' => tree.head } | |
string.split("\n").each do |line| | |
bodies = line.split(')') | |
orbitee = map[bodies[0]] |
use std::cell::RefCell; | |
use std::collections::HashMap; | |
use std::rc::Rc; | |
struct Tree<T> { | |
head: Rc<RefCell<Node<T>>>, | |
} | |
impl Tree<String> { | |
fn from_str(input: &str) -> Tree<String> { |
I hereby claim:
To claim this, I am signing this object:
#!/usr/bin/env python3 | |
import glob | |
# This path should be to the directory outside the ones we want to glob over. | |
base_path = "path/to/outer/folder/" | |
# Set `filename` here to whatever the file is that's contained in all these directories. | |
filename = "file" |
extern crate typenum; | |
use std::marker::PhantomData; | |
#[derive(Clone, Copy, Debug)] | |
struct Ranged<Min, Max> { | |
val: i64, | |
_marker: PhantomData<(Min, Max)>, | |
} |
use std::marker::PhantomData; | |
extern crate typenum; | |
use typenum::consts as tnc; | |
use typenum::int::Integer; | |
use std::ops::{Add,Sub}; |
#![feature(const_fn)] | |
extern crate dimensioned; | |
extern crate float_cmp; | |
use dimensioned::{Dim, Dimension, Zero, P1, N1}; | |
use dimensioned::si::{SI, m}; | |
use float_cmp::{ApproxEq, Ulps}; | |
type MeterPerSecond = SI<P1, Zero, N1>; |