from deep_neural_network import *
# point classical training data (cross entropy with softmax activation)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from functools import lru_cache, reduce | |
from collections import Counter | |
f_memo = {0: 1} | |
@lru_cache(maxsize=None) | |
def F(n): | |
'''Compute Factorial''' | |
if n in f_memo: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from functools import lru_cache | |
def p_single(n, k=0): | |
k = k or n | |
'''Return total number of partition for integer N of length k''' | |
dp = [[0 for j in range(k+1)] for i in range(n+1)] | |
for i in range(n+1): | |
for j in range(k+1): | |
if i == 0 and j == i: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Sochima Biereagu (@kodejuice), 2023 | |
# I use this script to know the amount of stocks i need to buy given a certain amount | |
# I have weighted all the stocks listed here | |
# The stocks listed are mostly Nigeria, China, Japan, India stocks plus some other stocks in US | |
# Last updated: July 2024 | |
""" | |
Usage | |
python weighted_stocks.py [amt] [...categories] |
This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[{"verse":"1 Chronicles 1:1 (KJV)","text":"Adam, Sheth, Enosh,"},{"verse":"1 Chronicles 1:2 (KJV)","text":"Kenan, Mahalaleel, Jered,"},{"verse":"1 Chronicles 1:3 (KJV)","text":"Henoch, Methuselah, Lamech,"},{"verse":"1 Chronicles 1:4 (KJV)","text":"Noah, Shem, Ham, and Japheth."},{"verse":"1 Chronicles 1:5 (KJV)","text":"The sons of Japheth; Gomer, and Magog, and Madai, and Javan, and Tubal, and Meshech, and Tiras."},{"verse":"1 Chronicles 1:6 (KJV)","text":"And the sons of Gomer; Ashchenaz, and Riphath, and Togarmah."},{"verse":"1 Chronicles 1:7 (KJV)","text":"And the sons of Javan; Elishah, and Tarshish, Kittim, and Dodanim."},{"verse":"1 Chronicles 1:8 (KJV)","text":"The sons of Ham; Cush, and Mizraim, Put, and Canaan."},{"verse":"1 Chronicles 1:9 (KJV)","text":"And the sons of Cush; Seba, and Havilah, and Sabta, and Raamah, and Sabtecha. And the sons of Raamah; Sheba, and Dedan."},{"verse":"1 Chronicles 1:10 (KJV)","text":"And Cush begat Nimrod: he began to be mighty upon the earth."},{"verse":"1 Chronicl |
I hereby claim:
- I am kodejuice on github.
- I am kodejuice (https://keybase.io/kodejuice) on keybase.
- I have a public key whose fingerprint is 4EF1 0FDD F84F 3BCC 8E0C 1888 F5FB A1CC C744 DCF9
To claim this, I am signing this object:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
A minimal code perfomance tester for C++ that aids in measuring the execution speed of parts of your program, | |
it reports the (operatations per second) as opposed to the traditional (time taken to run) approach, | |
the programs repeatedly runs the given function for a couple of seconds, | |
and returns the number of operations it could perform in a single second (cycles per second). | |
See Example/Sample usage at bottom of code |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
char * brain_fuck(char * code, char * input){ | |
const int BUFSIZE = 30000; | |
int * ptr = (int *) malloc(BUFSIZE * sizeof(int)), | |
i_sz = strlen(input), c_sz = strlen(code), | |
idx = -1, j = 0, o = 0; | |
char cmd, * output = (char *) malloc(BUFSIZE); | |
while (idx++ < c_sz){ | |
cmd = code[idx]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Object.prototype[Symbol.iterator] = function* (){ | |
let c = 0; | |
const [key, values] = [Object.keys(this), Object.values(this)]; | |
while (c < keys.length) { | |
yield [keys[c], values[c++]] | |
} | |
} | |
// usage | |
let obj = { |