- install clojure
- instal rlwrap
- install emacs 29.1
- optional install lazydocker
- install emacs-doom from https://github.com/doomemacs/doomemacs#install
But before you doom yourself, here are some things you should know:
But before you doom yourself, here are some things you should know:
| package com.my.helpers | |
| import io.github.serpro69.kfaker.faker | |
| import mu.KLogging | |
| import org.apache.avro.SchemaBuilder | |
| import org.apache.avro.generic.GenericData | |
| import org.apache.avro.generic.GenericRecord | |
| import org.apache.avro.reflect.ReflectData | |
| import org.apache.parquet.avro.AvroParquetWriter | |
| import org.apache.parquet.hadoop.ParquetFileReader |
| import java.util.Arrays; | |
| import reactor.core.publisher.Flux; | |
| import reactor.core.scheduler.Schedulers; | |
| Flux.fromIterable(Arrays.asList(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20)) | |
| .groupBy(x -> x.hashCode() % 5) | |
| .parallel(10) | |
| .runOn(Schedulers.parallel()) | |
| .flatMap(g -> g.collectMap(y -> {log.info(" g: "+g.key()+" y: "+ y); return y;}).log("subscr")) | |
| .subscribe(); |
| interface DaoOperationsSyntax { | |
| val dao: DaoDatabase | |
| fun User.queryUser() = | |
| dao.query("SELECT * from Users where userId = ${this.id}") | |
| fun Company.queryCompany() = | |
| dao.query("SELECT * from Companies where companyId = ${this.id}") | |
| } |
| Latency Comparison Numbers | |
| -------------------------- | |
| L1 cache reference 0.5 ns | |
| Branch mispredict 5 ns | |
| L2 cache reference 7 ns 14x L1 cache | |
| Mutex lock/unlock 25 ns | |
| Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
| Compress 1K bytes with Zippy 3,000 ns 3 us | |
| Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
| Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
| import akka.actor.{ActorSystem, Props} | |
| import akka.stream.{ActorMaterializer, OverflowStrategy} | |
| import akka.stream.scaladsl.{Flow, Sink, Source} | |
| import com.typesafe.config.ConfigFactory | |
| import jetbrains.exodus.entitystore.{PersistentEntityStoreImpl, PersistentEntityStores} | |
| import jetbrains.exodus.env.{Environments, Store} | |
| import org.apache.commons.lang3.SerializationUtils | |
| import collection.JavaConverters._ |
| /* "org.jetbrains.xodus" % "xodus-openAPI" % "1.2.3", | |
| "org.jetbrains.xodus" % "xodus-entity-store" % "1.2.3", | |
| */ | |
| object XodusApp extends App { | |
| import jetbrains.exodus.bindings.StringBinding.{entryToString, stringToEntry} | |
| import jetbrains.exodus.env.StoreConfig.WITHOUT_DUPLICATES | |
| val env = Environments.newInstance("data") |
| /* library dependecies | |
| "org.xerial" % "sqlite-jdbc" % "3.23.1", | |
| "org.tpolecat" %% "doobie-core" % "0.5.3", | |
| "org.tpolecat" %% "doobie-hikari" % "0.5.3", // HikariCP transactor. | |
| "org.tpolecat" %% "doobie-specs2" % "0.5.3", // Specs2 support for typechecking statements. | |
| "org.tpolecat" %% "doobie-scalatest" % "0.5.3", // ScalaTest support for typechecking statements. | |
| */ | |
| object TryDoobie extends App { | |
| import doobie._ |
| #!/bin/sh | |
| #http://www.thegeekstuff.com/2011/01/advanced-regular-expressions-in-grep-command-with-10-examples-%E2%80%93-part-ii/ | |
| # GENERAL | |
| # print lines begining with range of letters | |
| grep ^[A-D] table.txt | |
| # REGEX |