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
from collections import Counter | |
moves = Counter(map(int, input().split())) | |
max_num = max(moves.values()) | |
min_num = min(moves.values()) | |
max_res = max(x for x, c in moves.items() if c == max_num) | |
min_res = min(x for x, c in moves.items() if c == min_num) |
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
#!/bin/bash | |
# Runs Ankama Launcher on a steam deck by using existing Proton runtime. | |
# | |
# /!\ You must ensure that you have a Proton instance installed through | |
# steam before running this script. | |
DOWNLOAD_URL="https://launcher.cdn.ankama.com/installers/production/Ankama%20Launcher-Setup-x86_64.AppImage" | |
STEAM_COMMON="/home/deck/.local/share/Steam/steamapps/common" | |
# Init compatdata dir | |
CURR_DIR=`dirname ${BASH_SOURCE[0]}` |
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
FROM lscr.io/linuxserver/plex AS ffmpeg-builder | |
ENV DEBIAN_FRONTEND noninteractive | |
RUN apt-get update | |
RUN apt-get install -y \ | |
libass-dev libaom-dev libxvidcore-dev libvorbis-dev libv4l-dev libx265-dev \ | |
libx264-dev libwebp-dev libspeex-dev librtmp-dev libopus-dev \ | |
libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev \ | |
libsnappy-dev libsoxr-dev libssh-dev libxml2-dev gcc ffmpeg libvpx-dev |
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
use std::io::prelude::*; | |
use std::{env::args, fs::File}; | |
use swf::read_swf; | |
fn main() { | |
let swl_path = args().nth(1).expect("missing path"); | |
let swl = { | |
let mut file = File::open(&swl_path).expect("can't open swl file"); |
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
from collections import Counter | |
def load_pg_request(path): | |
return { | |
osm_id: (key, subclass) | |
for osm_id, key, subclass in map( | |
lambda line: map(str.strip, line.split("|")), open(path) | |
) | |
} |
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
// Grammar for opening hours description as defined in OSM wiki: | |
// https://wiki.openstreetmap.org/wiki/Key:opening_hours/specification | |
// Time domain | |
input_time_domain = _{ SOI ~ time_domain ~ &EOI } | |
time_domain = { rule_sequence ~ ( any_rule_separator ~ rule_sequence )* } | |
rule_sequence = { selector_sequence ~ (space ~ rules_modifier)? } |
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
#!/usr/bin/env python3 | |
import gzip | |
import json | |
import os | |
from shapely.geometry import mapping, shape | |
# File for admin data outputed by Cosmogony | |
COSMOGONY_DATA = 'admins.json.gz' |
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 <iostream> | |
#include <vector> | |
#include <set> | |
#include <tuple> | |
using namespace std; | |
int tree_size(int s, int parent, vector<set<int>> &G) { | |
int count = 1; | |
for(int t : G[s]) |
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 <iostream> | |
#include <vector> | |
#include <set> | |
#include <tuple> | |
using namespace std; | |
#define graph vector<set<int> > | |
int tree_size(int s, int parent, graph &G) { |