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
[2373186.386] -> [email protected]_registry(new id wl_registry@2) | |
[2373186.403] -> [email protected](new id wl_callback@3) | |
[2373186.476] [email protected]_id(3) | |
[2373186.481] [email protected](1, "wl_shm", 1) | |
[2373186.488] -> [email protected](1, "wl_shm", 1, new id [unknown]@4) | |
[2373186.495] [email protected](2, "zwp_linux_dmabuf_v1", 3) | |
[2373186.500] -> [email protected](2, "zwp_linux_dmabuf_v1", 3, new id [unknown]@5) | |
[2373186.504] -> [email protected](new id wl_callback@6) | |
[2373186.506] [email protected](3, "wl_compositor", 4) | |
[2373186.509] -> [email protected](3, "wl_compositor", 4, new id [unknown]@7) |
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
[19315:19315:0120/180446.390531:ERROR:sandbox_linux.cc(374)] InitializeSandbox() called with multiple threads in process gpu-process. | |
[19276:19276:0120/180446.400579:ERROR:wayland_surface.cc(59)] Server doesn't support zwp_linux_explicit_synchronization_v1. | |
[19276:19276:0120/180446.566103:ERROR:wayland_surface.cc(59)] Server doesn't support zwp_linux_explicit_synchronization_v1. | |
[19315:19315:0120/180446.746157:ERROR:gl_surface_egl.cc(774)] EGL Driver message (Error) eglCreateImageKHR: _eglParseImageAttribList | |
[19315:19315:0120/180446.746279:ERROR:gl_image_egl.cc(37)] Error creating EGLImage: EGL_BAD_PARAMETER | |
[19315:19315:0120/180446.746442:ERROR:gpu_memory_buffer_factory_native_pixmap.cc(257)] Failed to create GLImage 3810x2880, RGBA_8888, usage SCANOUT | |
[19315:19315:0120/180446.754903:ERROR:gl_surface_egl.cc(774)] EGL Driver message (Error) eglCreateImageKHR: _eglParseImageAttribList | |
[19315:19315:0120/180446.755026:ERROR:gl_image_egl.cc(37)] Error creating EGLImage: EGL_BAD_PARAMETER | |
[19315:19315:0120/180446 |
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
00:00:00.000 [sway/main.c:327] Sway version 1.5-a1591c23 (Dec 9 2020, branch 'master') | |
00:00:00.002 [sway/main.c:154] Linux ROC01-HYMT373 5.9.13-zen1-1-zen #1 ZEN SMP PREEMPT Tue, 08 Dec 2020 12:10:52 +0000 x86_64 GNU/Linux | |
00:00:00.002 [sway/main.c:170] Contents of /etc/os-release: | |
00:00:00.002 [sway/main.c:154] NAME="Arch Linux" | |
00:00:00.002 [sway/main.c:154] PRETTY_NAME="Arch Linux" | |
00:00:00.002 [sway/main.c:154] ID=arch | |
00:00:00.002 [sway/main.c:154] BUILD_ID=rolling | |
00:00:00.002 [sway/main.c:154] ANSI_COLOR="38;2;23;147;209" | |
00:00:00.002 [sway/main.c:154] HOME_URL="https://www.archlinux.org/" | |
00:00:00.002 [sway/main.c:154] DOCUMENTATION_URL="https://wiki.archlinux.org/" |
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 testing | |
import shapeless.labelled.FieldType | |
import shapeless.{:+:, CNil, Coproduct, HNil, Inl, Inr, LabelledGeneric, Lazy, Witness, labelled} | |
trait EnumCodec[T] { | |
def encode: T => String | |
def decode: String => Option[T] | |
} |
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 testing | |
import org.scalatest.FunSuite | |
import shapeless.labelled.FieldType | |
import shapeless.{:+:, CNil, Coproduct, Generic, HNil, Inl, Inr, LabelledGeneric, Lazy, Witness} | |
trait EnumCodec[T] { | |
def encode: T => String | |
def decode: String => Option[T] | |
} |
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 cats._ | |
import cats.data._ | |
import cats.implicits._ | |
case class User(age: Int) | |
// notice F: FlatMap; fetchUser returning G[F[User]], and the use of flatTraverse | |
def complicatedFunction[F[_]: Traverse : FlatMap, G[_]: Applicative, A: Monoid](ids: F[Int], fetchUser: Int => G[F[User]], consume: User => A): G[A] = { | |
ids.flatTraverse(fetchUser) |
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 cats._ | |
import cats.data._ | |
import cats.implicits._ | |
case class User(age: Int) | |
def complicatedFunction[F[_]: Traverse, G[_]: Applicative, A: Monoid](ids: F[Int], fetchUser: Int => G[User], consume: User => A): G[A] = { | |
ids.traverse(fetchUser) | |
.map(_.foldMap(consume)) |
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 testing | |
import cats._ | |
import cats.data._ | |
import cats.implicits._ | |
object Main2 extends App { | |
case class Stats(warning: Int, error: Int) |
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
val keypad: Seq[Seq[Int]] = Seq(Seq(1, 2, 3), Seq(4, 5, 6), Seq(7, 8, 9)) | |
case class Pos(row: Int, col: Int) | |
sealed trait Dir | |
case object Up extends Dir | |
case object Left extends Dir | |
case object Right extends Dir | |
case object Down extends Dir |
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
def splitWhile[A](it: Seq[A])(pred: A => Boolean): (Seq[A], Seq[A]) = { | |
(it.takeWhile(pred), it.dropWhile(pred)) | |
} | |
def splitParenContentsAndRest(s: Seq[Char]): (Seq[Char], Seq[Char]) = { | |
assert(s.head == '[') | |
val parenCounts = s.scanLeft(0) { | |
case (parenCount, '[') => parenCount + 1 |
NewerOlder