Skip to content

Instantly share code, notes, and snippets.

View kayvank's full-sized avatar
🏠
@127.0.0.1

Kayvan ≅ کیوان kayvank

🏠
@127.0.0.1
View GitHub Profile
@kayvank
kayvank / build.sbt
Created July 9, 2020 00:28
sbt-sample
import Dependencies._
import NativePackagerHelper._
import com.typesafe.sbt.packager.docker._
import com.typesafe.sbt.GitVersioning
import TodoListPlugin._
ThisBuild / resolvers ++= Seq(
"Apache Development Snapshot Repository" at
"https://repository.apache.org/content/repositories/snapshots/",
Resolver.mavenLocal
Map(3a0024001447373333353132 -> List(7.709459459805918, 7.8108108110592775, 7.391891892283194, 7.493243243536553, 5.942708333265634, 6.020833333185698, 5.697916666647324, 5.776041666567388, 5.733668341709829, 5.809045226055691, 5.497487437231127, 5.57286432157699, 7.314102563997921, 7.410256410053105, 7.012820512776264, 7.108974358831447), 2d0048001147373239303438 -> List(9.431034483054937, 5.3965517243001475, 14.025641023871069, 8.025641024617322), 40003b001247373333353132 -> List(4.279617477289208E-6, 1.2015849069376464E-5, 1.5294117648905088, 4.294117647050432, 1.3928571429986714, 3.910714285631921), 3f0032000251363131363432 -> List(4.591603053552664, 4.473282442797697, 4.534351145212424, 4.530534351137937, 3.8557692307306626, 3.756410256318171, 3.807692307703071, 3.804487179345762, 3.3792134831724763, 3.2921348314386285, 3.3370786517542856, 3.334269662856819, 4.105802047841151, 4.0, 4.05460750864328, 4.051194539197871), 4b005b000250483553353520 -> List(4.2526690391853, 4.2526690391853, 4.199288256217254,
@kayvank
kayvank / sudo lspci -nnk
Created April 10, 2020 18:44
thinkpad p1 GPU Nvidia graphic
00:00.0 Host bridge [0600]: Intel Corporation 8th Gen Core Processor Host Bridge/DRAM Registers [8086:3ec4] (rev 0d)
Subsystem: Lenovo Device [17aa:229f]
Kernel driver in use: skl_uncore
00:01.0 PCI bridge [0604]: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor PCIe Controller (x16) [8086:1901] (rev 0d)
Kernel driver in use: pcieport
00:02.0 VGA compatible controller [0300]: Intel Corporation UHD Graphics 630 (Mobile) [8086:3e9b] (rev 02)
Subsystem: Lenovo Device [17aa:229f]
Kernel driver in use: i915
Kernel modules: i915
00:04.0 Signal processing controller [1180]: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Thermal Subsystem [8086:1903] (rev 0d)
@kayvank
kayvank / journalctl -xe
Last active April 9, 2020 20:59
opensuse-tumbleweed displaylink stopped working with the last opensuse update
laptop: thinkpad p1, Intelxeon, nvidia GPU
➜ uname -r
5.6.0-1-default
cat /etc/os-release
---------------start cut&paste ----------------
NAME="openSUSE Tumbleweed"
# VERSION="20200402"
ID="opensuse-tumbleweed"
module Main where
import Split.LibSplit
main :: IO()
main = do
input <- getLine
let result = ourSplit input
print result
---------------------------
module Main where
import Split.LibSplit
main :: IO()
main = do
input <- getLine
let result = ourSplit input
print result
---------------------------
@kayvank
kayvank / mpg
Created February 19, 2020 08:23
mpg
{
"pid": "1a003a001747373333353132",
"ts": "2020-02-19T07:26:16.337Z",
"body": {
"r": 123,
"sf": 123,
"o": 1,
"sp": 60,
"cc_st": 60,
"cc_sp": 60,

Questions

1. Explain the performance of the following programs

def findElement(e: String, dict: Map[String, Any]): Option[Any] =
dict.get(e) 

Regardless of Map implementation, maps are key value. dict.get is a key look up that returns Some(value) or None. The performance characteristic is eC, Effectively Constant. Depending on Map implementation the performance characteristic is O(1) for hash map, O(log n) for tree implementations like.

@kayvank
kayvank / gist:625af454231de65bdd3721ae49fb2981
Created June 4, 2019 16:25
rnode runtime exception on new Suse Linux installation
cat /etc/os-release
---------------------------
NAME="openSUSE Tumbleweed"
# VERSION="20190601"
ID="opensuse-tumbleweed"
ID_LIKE="opensuse suse"
VERSION_ID="20190601"
PRETTY_NAME="openSUSE Tumbleweed"
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:opensuse:tumbleweed:20190601"
@kayvank
kayvank / gist:f48f7783ce141a6864dc14fc7b8f96cd
Created April 17, 2019 16:46
artis.rsong.io manifest.json sample
{
"header": {
"application": "artist.rsong.io",
"version": "0.1.0",
"api_key": "",
"timestamp": 1554989839552
},
"title": "Some title",
"sub_title": "Some subtitle",
"user": {