We install certutil
and pk12util
if necessary:
sudo apt install libnss3-tools
On Linux, Chromium uses the NSS Shared DB. Check if you have the ~/.pki/nssdb
directory:
ls $HOME/.pki/nssdb
<configuration> | |
<if condition='"prd".equals(property("environment")) | |
|| "stg".equals(property("environment"))'> | |
<then> | |
<property name="APPLINK_LOG_LEVEL" value="warn"/> | |
</then> | |
<else> | |
<property name="APPLINK_LOG_LEVEL" value="debug"/> | |
</else> |
import scala.io.Source | |
val listOfLines = Source.fromFile("filename.txt").getLines.toList |
object MergeSort { | |
// recursive merge of 2 sorted lists | |
def merge(left: List[Int], right: List[Int]): List[Int] = | |
(left, right) match { | |
case(left, Nil) => left | |
case(Nil, right) => right | |
case(leftHead :: leftTail, rightHead :: rightTail) => | |
if (leftHead < rightHead) leftHead::merge(leftTail, right) | |
else rightHead :: merge(left, rightTail) |
import java.util | |
import org.apache.kafka.clients.consumer.KafkaConsumer | |
import scala.collection.JavaConverters._ | |
object ConsumerExample extends App { | |
import java.util.Properties |
import org.apache.kafka.common.serialization.Deserializer | |
import play.api.libs.json.Json | |
class JsValueDeserializer extends Deserializer[JsValue] { | |
private val encoding = "UTF8" | |
override def configure(configs: util.Map[String, _], isKey: Boolean): Unit = { | |
// nothing to do | |
} |
We install certutil
and pk12util
if necessary:
sudo apt install libnss3-tools
On Linux, Chromium uses the NSS Shared DB. Check if you have the ~/.pki/nssdb
directory:
ls $HOME/.pki/nssdb
import scala.util.{Success, Failure} | |
val seq=Seq(Success(1), Failure(new Exception("bang")), Success(2)) | |
// all emit List(1, 2) | |
seq.map(_.toOption).flatten | |
seq.flatMap(_.toOption) | |
seq.filter(_.isSuccess).map(_.get) | |
seq.collect{case Success(x) => x} |
It outputs a json-style tree of all towers/programs that are not balanced.
You need to get the value of the last tower that is unbalanced, but has no unbalanced sub-towers.
To get a good visualization do the following:
puzzle7.py
with this version$ ./aoc 7 2 -v
Using the input in the repo you'll get this output:
I got to here after spending hours trying to deploy to an Elastic Beanstalk instance via CircleCi 2.0 so I thought I'd write up what worked for me to hopefully help others. Shout out to RobertoSchneiders who's steps for getting it to work with CircleCi 1.0 were my starting point.
For the record, I'm not the most server-savvy of developers so there may be a better way of doing this.
The current version of this document is here.
This document contains additional supporting material for the claims in this post (published 1 September 2019), in response to a cease and desist letter from John De Goes that I received on 6 July 2020.
Please see also this post for more information about De Goes deleting the FCoP repository on GitHub shortly before sending the cease and desist letter.