This file contains hidden or 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 cats.effect.laws.util.TestContext | |
| import cats.effect.{ContextShift, IO, Timer} | |
| import org.scalactic.source.Position | |
| import org.scalatest.{Assertion, AsyncFunSpec, AsyncTestSuite, Matchers} | |
| import org.scalatest.exceptions.TestFailedException | |
| import scala.concurrent.duration._ | |
| import scala.concurrent.{ExecutionContext, Future} | |
| import scala.reflect.ClassTag |
This file contains hidden or 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
| with table_stats as ( | |
| select psut.relname, | |
| psut.n_live_tup, | |
| 1.0 * psut.idx_scan / greatest(1, psut.seq_scan + psut.idx_scan) as index_use_ratio | |
| from pg_stat_user_tables psut | |
| order by psut.n_live_tup desc | |
| ), | |
| table_io as ( | |
| select psiut.relname, | |
| sum(psiut.heap_blks_read) as table_page_read, |
This file contains hidden or 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
| class A | |
| class A2 extends A | |
| class B | |
| trait M[X] | |
| // | |
| // Upper Type Bound | |
| // | |
| def upperTypeBound[AA <: A](x: AA): A = x |
This file contains hidden or 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
| /** | |
| * Scala hex / decimal binary calculator | |
| * (c) Mark Lister 2012 | |
| * Licence Apache 2. | |
| */ | |
| class BaseN(b: BigInt, val baseN: Int) extends BigInt(b.underlying) { | |
| def n(x: Int) = new BaseN(b, x) | |
| /** |