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
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": {
https://medium.com/@barnabe/partially-explained-casper-cbc-specs-part-two-protocols-from-the-abstract-cf144fcdac02
https://vitalik.ca/general/2018/12/05/cbc_casper.html
https://medium.com/@aditya.asgaonkar/bitwise-lmd-ghost-an-efficient-cbc-casper-fork-choice-rule-6db924e57d1f
https://ethresear.ch/t/bitwise-lmd-ghost/4749
@kayvank
kayvank / irc.md
Created February 11, 2019 16:33 — forked from xero/irc.md
irc cheat sheet

#IRC Reference

Not intended as a guide for newbies, more like a "cheat sheet" for the somewhat experienced IRC user, especially one who wields some power over a channel.

##The Basics

  • /join #channel
    • Joins the specified channel.
  • /part #channel
    • Leaves the specified channel.
@kayvank
kayvank / rnode errro
Created January 9, 2019 19:44
rnode-error .log
////////// Here is the SHA
commit d701296c098bb009ce834e31448ac42e13570772 (HEAD -> dev)
Merge: 9430de7e8 54034288e
Author: kayvank <[email protected]>
Date: Mon Jan 7 17:03:09 2019 -0800
////////////////////////
////////////// platform: //////////
NAME="openSUSE Tumbleweed"
# VERSION="20181224"
@kayvank
kayvank / the last 2 runs
Created September 19, 2018 18:25
rnode exception
07:28:37.783 [main] INFO c.r.n.configuration.Configuration$ - Using configuration file: /home/kayvan/.rnode/rnode.toml
07:28:38.338 [main] WARN c.r.n.configuration.Configuration$ - Configuration file /home/kayvan/.rnode/rnode.toml not found
07:28:38.414 [main] INFO c.r.n.configuration.Configuration$ - Starting with profile default
INFO - trying to open ports using UPnP....
INFO - No gateway devices found
INFO - No need to open any port
07:28:48.456 [node-io-18] INFO c.r.node.configuration.Configuration - flag --host was not provided, guessing your external IP address
07:28:48.716 [node-io-18] INFO c.r.node.configuration.Configuration - guessed 35.236.119.195 from source: AmazonAWS service
Using data_dir: /home/kayvan/.rnode
07:28:51.155 [node-io-18] INFO coop.rchain.casper.genesis.Genesis$ - Found default file /home/kayvan/.rnode/genesis/bonds.txt.
@kayvank
kayvank / gist:b17e043107df97167ef7dd959d722dd8
Created September 16, 2018 21:31
rnode does not respond to GRPC requests
16:28:21.906 [main] INFO c.r.n.configuration.Configuration$ - Using configuration file: /home/kayvan/.rnode/rnode.toml
16:28:22.193 [main] WARN c.r.n.configuration.Configuration$ - Configuration file /home/kayvan/.rnode/rnode.toml not found
16:28:22.264 [main] INFO c.r.n.configuration.Configuration$ - Starting with profile default
INFO - trying to open ports using UPnP....
INFO - No gateway devices found
INFO - No need to open any port
16:28:31.776 [node-io-18] INFO c.r.node.configuration.Configuration - flag --host was not provided, guessing your external IP address
16:28:31.976 [node-io-18] INFO c.r.node.configuration.Configuration - guessed 35.236.119.195 from source: AmazonAWS service
Using data_dir: /home/kayvan/.rnode
16:28:33.852 [node-io-18] INFO coop.rchain.casper.genesis.Genesis$ - Found default file /home/kayvan/.rnode/genesis/bonds.txt.