Skip to content

Instantly share code, notes, and snippets.

@pegerto
pegerto / pynash.ipynb
Last active March 26, 2021 00:31
pynash.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pegerto
pegerto / pynash.ipynb
Last active March 26, 2021 00:28
pynash.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pegerto
pegerto / nb.ipynb
Last active June 10, 2018 09:56
Small Naive Bayes classifier for text documents, with Lapace Smoothing
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
# Python 3 
import operator
from collections import Counter

class NaiveBayes:
    def _tokenize(self, text):
        return text.split(" ")
Schema stockPrice = SchemaBuilder.struct()
.name("com.thirdparty.StockPrice").version(2).doc("Stock price update")
.field("market", Schema.STRING_SCHEMA)
.field("stock", Schema.STRING_SCHEMA)
.field("price", Decimal.builder(127).build())
.build();
Struct update = new Struct(stockPrice)
.put("market", "PSN")

Keybase proof

I hereby claim:

  • I am pegerto on github.
  • I am pegerto (https://keybase.io/pegerto) on keybase.
  • I have a public key whose fingerprint is E621 B8C0 4CF6 1F69 D387 613B 8F78 CF49 8555 957D

To claim this, I am signing this object:

@pegerto
pegerto / GatlingJSONBody.scala
Last active February 27, 2019 13:23
gatling transform extracted body to json example
/**
* Created by pegerto on 16/05/2016.
*/
class TestSimulations extends Simulation{
/**
* get a coma separated string http://pastebin.com/raw/WDensHUa
* then
* - covert to json
* - post json body: ( nc -l 8080 to see the output)