Skip to content

Instantly share code, notes, and snippets.

View willemneal's full-sized avatar
🎯
Focusing

Willem Wyndham willemneal

🎯
Focusing
View GitHub Profile
import glob ## needed for listing files in folder
import math
import string ## needed to remove punctuation
MAC = "\r\n"
PC = "\n"
def makeDictionary(folderName):
trainingFiles = glob.glob("./emails/" + folderName + "/*.txt")
#returns list of filenames in folder that end in .txt
wordDictionary = {}
@willemneal
willemneal / Decorator.pony
Created May 27, 2016 19:36
Actor A sends a message to Actor B but it is intercepted by D. This can be generalized to have decorators that can catch messages.
actor A
let _b: B
let _d: D
let e: Env
new create(env: Env)=>
_b = B(env)
_d = D(env)
e = env
### Keybase proof
I hereby claim:
* I am willemneal on github.
* I am sirwillem (https://keybase.io/sirwillem) on keybase.
* I have a public key ASC_Axokj2FDXEGP3SPv9fh6rPH-vYzEOC7OLFmddbDYgwo
To claim this, I am signing this object:
@willemneal
willemneal / main.wat
Created February 8, 2019 21:51
Main Function wat file
(module
(type $t0 (func))
(type $t1 (func (param i32 i32) (result i32)))
(type $t2 (func (result i32)))
(type $t3 (func (param i32 i32 i32) (result i32)))
(type $t4 (func (param i32 i32 i32 i32)))
(type $t5 (func (param i32) (result i32)))
(type $t6 (func (param i32 i32 i32)))
(type $t7 (func (param i32 i32 i32 i32 i32) (result i32)))
(type $t8 (func (param i32 i32 i32 i32 i32)))
@willemneal
willemneal / token.md
Last active April 26, 2023 19:25
Token generated by GPT

Here is the complete implementation of Interface for Token:

impl Interface for Token {
    fn allowance(&self, from: Address, spender: Address) -> i128 {
        self.allowances.get(&(from, spender)).unwrap_or(0)
    }

    fn increase_allowance(&mut self, from: Address, spender: Address, amount: i128) {
        from.require_auth();
@willemneal
willemneal / md
Created May 12, 2023 18:03
Quicksort in rust by GPT4
Sure, here's a markdown document with an example of a functional implementation of quicksort in Rust, along with a Mermaid diagram and some documentation.
```markdown
# QuickSort in Rust
Quicksort is a divide and conquer algorithm. It works by selecting a 'pivot' element from the array and partitioning the other elements into two sub-arrays, according to whether they are less than or greater than the pivot. The sub-arrays are then recursively sorted.
## Mermaid Diagram
```mermaid