Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
nnsigmoid
~~~~~~~~~
A simple neural network using the sigmoid
function in Python.
:copyright: Pancubs.org
@sonnyksimon
sonnyksimon / schema.py
Last active January 7, 2020 19:15
sql: Another way of using SQLALchemy
import sql
from settings import engine
sql.Table.engine = engine
class Blog(sql.Table):
id = sql.String(255)
title = sql.String(255)
body = sql.String(4096)
Desirability -> Design -> Implement -> Test -> Review -> Commit
"Comments lie."
- A cynical but smart and good looking programmer.
@sonnyksimon
sonnyksimon / dfs.py
Last active July 6, 2020 16:55
depth-first search in Python
# Using a dictionary to act as an adjacency list
graph = {
'A' : ['B','C'],
'B' : ['D', 'E'],
'C' : ['F'],
'D' : [],
'E' : ['F'],
'F' : []
}
import platform
import subprocess
def ping(host):
""" Returns True if host (str) responds to a ping request. """
if platform.system().lower() == 'windows':
param = '-n'
else:
param = '-c'
command = ['ping', param, '1', host]
declare
l_message varchar2(32767);
l_script_id varchar2(255);
c integer := 0;
l_inserts number := 0;
l_selects varchar2(1);
begin
eba_dbtools_design_schema_pub.init_collections;
begin
co3325
co3326
co3354
co3355
@sonnyksimon
sonnyksimon / probability.py
Last active January 13, 2021 19:13
Calculate the probability of atleast one match after x tries
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# SPDX-License-Identifier: MIT
#
""" Calculate the probability of atleast one match after x tries"""
from __future__ import print_function
import argparse
@sonnyksimon
sonnyksimon / isNotANumber.js
Created January 13, 2021 19:02
js isNotANumber
const isNotANumber = (v) => {
const n = Number(v);
return n !== n;
}
export default isNotANumber;