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 numpy import exp, array, random, dot | |
class neural_network: | |
def __init__(self): | |
random.seed(1) | |
# We model a single neuron, with 3 inputs and 1 output and assign random weight. | |
self.weights = 2 * random.random((3, 1)) - 1 | |
def __sigmoid(self, x): | |
return 1 / (1 + exp(-x)) |
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
import re | |
#Character Classess | |
#Passport number | |
pattern = r"[A-Za-z][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]" | |
while True: | |
num = "Last Name: Doe \n" | |
num += "Other names: John \n" | |
num += "DOB:22-Jan-1990 \n" |
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
import re | |
#Character Classess | |
#email extraction / validation | |
#Email Address | |
pattern = r"([\w\.-]+)@([\w\.-]+)(\.[\w\.]+)" | |
while True: |
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
# Author: John Ifegwu | |
import time | |
import math | |
class Node: | |
def __init__(self, key, value, weight): | |
self.key = key | |
self.value = value | |
self.weight = weight |
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
import java.util.*; | |
import java.text.CharacterIterator; | |
//Author: John Ifegwu | |
public class Program | |
{ | |
// Determine if set2 is a subset of set1 with Computational Complexity of O(n^ 2) | |
public static boolean isSubset(char[] set1, char[] set2) | |
{ |
NewerOlder