Skip to content

Instantly share code, notes, and snippets.

View l0k18's full-sized avatar
🧡
Return to the Sauce

l0k1 l0k18

🧡
Return to the Sauce
View GitHub Profile
@l0k18
l0k18 / keybase.md
Created March 14, 2017 10:11
keybase verification

Keybase proof

I hereby claim:

  • I am l0k1-smirenski on github.
  • I am l0k1 (https://keybase.io/l0k1) on keybase.
  • I have a public key ASC4dpAOATnTu6tJpROyy_OD16qaqfIewZjw1GcKh68aIwo

To claim this, I am signing this object:

### Keybase proof
I hereby claim:
* I am l0k1-smirenski on github.
* I am lokiverloren (https://keybase.io/lokiverloren) on keybase.
* I have a public key ASBqAjWxAhhcGtELojXt5j1_wUBixSTgQk-a3AAPGle92Ao
To claim this, I am signing this object:
@l0k18
l0k18 / DIV_Whitepaper
Last active July 22, 2017 19:43
DIV Whitepaper
> |![](https://s17.postimg.org/waef6bisv/div_logo.svg.png) | <h1>DIV</h1>
> | --- | ---
> | | Monetising Governance, Content and Infrastructure in Decentralised, Distributed Social Networks
> | | Loki Verloren, July 2017
Abstract
===
DIV is a multi-tier Byzantine Fault Tolerant Database system designed to engage users, via monetisation incentives, in every aspect of the system, from open self-governance of code, curation, content creation, content hosting, search services, archiving, validation, query services, short and long messaging and extensible in the future to expand to include classified advertising, cryptocurrency exchange, custom databases from very large to small and extreme low latency for multiplayer gaming, privacy services, and whatever the community that grows out of it decides it wants to add.
Contents
@l0k18
l0k18 / DIV Whitepaper
Last active July 30, 2017 12:50
DIV Whitepaper
> |![](https://s17.postimg.org/waef6bisv/div_logo.svg.png) | DIV White Paper
> | --- | ---
> | | Monetising Governance, Infrastructure and Content for Decentralised Distributed Social Networks
> | | Loki Verloren, July 2017
Abstract
===
DIV is a multi-tier Byzantine Fault Tolerant Database system designed to engage users, via monetisation incentives, in every aspect of the system, from open self-governance of code, curation, content creation, content hosting, search services, archiving, validation, query services, short and long messaging and extensible in the future to expand to include classified advertising, cryptocurrency exchange, custom databases from very large to small and extreme low latency for multiplayer gaming, privacy services, and whatever the community that grows out of it decides it wants to add.
@l0k18
l0k18 / DIV_Whitepaper
Created July 23, 2017 18:12
DIV Whitepaper
> |![](https://s17.postimg.org/waef6bisv/div_logo.svg.png) | DIV White Paper
> | --- | ---
> | | Monetising Governance, Infrastructure and Content for Decentralised Distributed Social Networks
> | | Loki Verloren, July 2017
Abstract
===
DIV is a multi-tier Byzantine Fault Tolerant Database system designed to engage users, via monetisation incentives, in every aspect of the system, from open self-governance of code, curation, content creation, content hosting, search services, archiving, validation, query services, short and long messaging and extensible in the future to expand to include classified advertising, cryptocurrency exchange, custom databases from very large to small and extreme low latency for multiplayer gaming, privacy services, and whatever the community that grows out of it decides it wants to add.
### Keybase proof
I hereby claim:
* I am colibrae on github.
* I am l0k18 (https://keybase.io/l0k18) on keybase.
* I have a public key ASDLzw8Hvd8mXTEAurZrIFI1XJe_n-cudQmnT_9FVjaiawo
To claim this, I am signing this object:
### Keybase proof
I hereby claim:
* I am l0k1verloren on github.
* I am l0k18 (https://keybase.io/l0k18) on keybase.
* I have a public key ASDLzw8Hvd8mXTEAurZrIFI1XJe_n-cudQmnT_9FVjaiawo
To claim this, I am signing this object:
@l0k18
l0k18 / gist:61abbfdf2444a48c70a4e68208a95f3e
Created April 19, 2018 10:43
Parametric Polymorphism in Go idiom
# Parametric Polymorphism in Go idiom
For some reason, there does not exist a super simple example of how this is done in Golang, but it's completely doable, and gets you all the benefits of abstract parent types which you want to operate on multiple types of data, such as for example a binary tree. All the functions to navigate and add and remove nodes can be generalised and only a small subset of functions must be written to handle the specific data type.
First, the interface stuff:
```go
package parametric
// Data - the type here doesn't really matter, but you can't use interface{} and then create a function for it

Parametric Polymorphism in Go idiom

For some reason, there does not exist a super simple example of how this is done in Golang, but it's completely doable, and gets you all the benefits of abstract parent types which you want to operate on multiple types of data, such as for example a binary tree. All the functions to navigate and add and remove nodes can be generalised and only a small subset of functions must be written to handle the specific data type.

First, the interface stuff:

package parametric

// Data - the type here doesn't really matter, but you can't use interface{} and then create a function for it

Parametric Polymorphism in Go idiom

For some reason, there does not exist a super simple example of how this is done in Golang, but it's completely doable, and gets you all the benefits of abstract parent types which you want to operate on multiple types of data, such as for example a binary tree. All the functions to navigate and add and remove nodes can be generalised and only a small subset of functions must be written to handle the specific data type.

First, the interface stuff:

package parametric

// Data - the type here doesn't really matter, but you can't use interface{} and then create a function for it