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::collections::HashSet; | |
use nom::bytes::complete::tag; | |
use nom::character::complete::space1; | |
use nom::multi::separated_list0; | |
use nom::sequence::{separated_pair, tuple}; | |
use nom::IResult; | |
#[derive(Debug)] | |
struct Card { |
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
fn main() { | |
let input = std::fs::read_to_string("input").unwrap(); | |
let map: Vec<Vec<char>> = input.lines().map(|l| l.chars().collect()).collect(); | |
// Scan through all the positions and see if we find a digit. If | |
// we do, look for a special character next to it (recursively | |
// looking right). | |
let mut p1 = 0; | |
for x in 0..map.len() { | |
let mut y = 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
import Data.List.Split (splitOn) | |
import qualified Text.Parsec as Parsec | |
data Round = Round {red :: Int, green :: Int, blue :: Int} deriving (Show) | |
data Game = Game {rounds :: [Round], id :: Int} deriving (Show) | |
parseColor :: Parsec.Parsec String () (Int, String) | |
parseColor = do | |
count <- Parsec.many1 Parsec.digit |
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
import Data.List.Split (splitOn) | |
data Round = Round {red :: Int, green :: Int, blue :: Int} deriving (Show) | |
data Game = Game {rounds :: [Round], id :: Int} deriving (Show) | |
parseColor :: String -> (Int, String) | |
parseColor s = (read (head parts) :: Int, last parts) | |
where | |
parts = words 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
import Data.Char (isDigit) | |
import Data.List (concat, isPrefixOf) | |
import Data.Maybe (catMaybes) | |
main :: IO () | |
main = do | |
input <- readFile "input" | |
let calibrations = lines input | |
putStrLn $ "p1: " ++ show (part1 calibrations (filter isDigit)) | |
putStrLn $ "p2: " ++ show (part1 calibrations p2filter) |
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
diff --git a/.SRCINFO b/.SRCINFO | |
index 314521a..93d49ee 100644 | |
--- a/.SRCINFO | |
+++ b/.SRCINFO | |
@@ -1,6 +1,6 @@ | |
pkgbase = istio-bin | |
pkgdesc = An open platform to connect, manage, and secure microservices | |
- pkgver = 1.7.4 | |
+ pkgver = 1.8.0 | |
pkgrel = 1 |
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
package main | |
import ( | |
"bytes" | |
"fmt" | |
"os" | |
) | |
func main() { | |
if len(os.Args) < 2 || len(os.Args[1]) != 25 { |
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
package main | |
import ( | |
"archive/tar" | |
"compress/gzip" | |
"crypto/md5" | |
"fmt" | |
"io" | |
"log" | |
"os" |
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
<link rel="import" href="../core-icon-button/core-icon-button.html"> | |
<link rel="import" href="../core-toolbar/core-toolbar.html"> | |
<link rel="import" href="../core-header-panel/core-header-panel.html"> | |
<polymer-element name="my-element"> | |
<template> | |
<style> | |
:host { | |
position: absolute; |
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
<link rel="import" href="../core-icons/core-icons.html"> | |
<link rel="import" href="../core-icons/iconsets/av-icons.html"> | |
<link rel="import" href="../paper-fab/paper-fab.html"> | |
<link rel="import" href="../core-item/core-item.html"> | |
<polymer-element name="my-element"> | |
<template> | |
<style> | |
:host { |