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

Advanced Functional Programming with Scala - Notes

Copyright © 2016-2017 Fantasyland Institute of Learning. All rights reserved.

1. Mastering Functions

A function is a mapping from one set, called a domain, to another set, called the codomain. A function associates every element in the domain with exactly one element in the codomain. In Scala, both domain and codomain are types.

val square : Int => Int = x => x * x
@kayvank
kayvank / rnode-eval-error.md
Last active April 19, 2018 07:27
To run Rholang that is stored in a plain text file

Rchain

Rholang

executing Rholang source code

To run Rholang that is stored in a plain text file

Looks as if some required features are missing from the rchain/rnode. Using the instruction against the source code rholang/exmaples I could only get a successful run for:

@kayvank
kayvank / RholangContractProxy.scala
Last active August 26, 2018 03:17
Proxy service to deploy & propose a Rholang contract
package coop.rchain.service
import coop.rchain.domain.{Err, ErrorCode, DeployAndProposeResponse}
import coop.rchain.repo.RholangProxy
import coop.rchain.utils.Globals._
import scala.util.{Failure, Success, Try}
object RholangContractProxy {
@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.
@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 / rnode errro
Created January 9, 2019 19:44
rnode-error .log
////////// Here is the SHA
commit d701296c098bb009ce834e31448ac42e13570772 (HEAD -> dev)
Merge: 9430de7e8 54034288e
Author: kayvank <kayvan@q2io.com>
Date: Mon Jan 7 17:03:09 2019 -0800
////////////////////////
////////////// platform: //////////
NAME="openSUSE Tumbleweed"
# VERSION="20181224"
@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.
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 / 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": {
@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"