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 numpy as np | |
import gzip | |
import matplotlib.pyplot as plt | |
def runGeneration(query, iterations): | |
i = 0 | |
g = "" | |
gen = query | |
while i < iterations: | |
g = "" |
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
type NULL_TNODE = TNode | null; | |
class TNode{ | |
private parent:NULL_TNODE; | |
private children:[NULL_TNODE] | null; | |
private val:string; | |
constructor(parent:NULL_TNODE, val:string){ | |
this.parent = parent; | |
this.children = null; | |
this.val = val; |
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
// Online Java Compiler | |
// Use this editor to write, compile and run your Java code online | |
class Employee{ // <-- entity class | |
private String fname; | |
private String lname; | |
private int age; | |
private String address; | |
public Employee(){} |
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
# Online Python compiler (interpreter) to run Python online. | |
# Write Python 3 code in this online editor and run it. | |
class Node(object): | |
def __init__(self, name, value, next=None): | |
self.name = name | |
self.value = value | |
self.next = next | |
def set_next(node): | |
self.next = node |
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 pygame | |
import random | |
import time | |
# A program that visualizes a normal distribution | |
# Author: Chirath Nissanka | |
class VisualizeProbability(object): | |
def __init__(self): |
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 numpy as np | |
from scipy.special import softmax | |
# encoder representations of four different words | |
word_1 = np.array([1, 0, 0]) | |
word_2 = np.array([0, 1, 0]) | |
word_3 = np.array([1, 1, 0]) | |
word_4 = np.array([0, 0, 1]) | |
# stack the word embeddings into a single array |
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 turtle import * | |
#color here is the line color and the fill color | |
color('black','purple') | |
ypos = 400 | |
n = 4 | |
#Team names can be declared here | |
groupa = ['TEAM A', 'TEAM B', 'TEAM C', 'TEAM D'] |
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 numpy as np | |
def isNumber(c): | |
return c in ['0','1','2','3','4','5','6','7','8','9']; | |
def parseNumber(n, isNeg): | |
if (isNeg): | |
return int(n) * -1; | |
else: | |
return int(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
#Trivial Word Bag implementation using Python | |
import string | |
doc1 = "John likes to watch movies. Mary likes movies too."; | |
doc2 = "Mary also likes to watch football games."; | |
documents = [doc1, doc2] | |
def transform(s): | |
return s.translate(str.maketrans('','',string.punctuation)).lower() |