This file contains hidden or 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.io.IOException; | |
import java.nio.file.Files; | |
import java.nio.file.Paths; | |
import java.util.ArrayList; | |
import java.util.HashMap; | |
import java.util.stream.Stream; | |
public class Robot { | |
private static int gridX; | |
private static int gridY; |
This file contains hidden or 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 sys | |
class Room: | |
def __init__(self, name, description): | |
self.name = name | |
self.items = [] | |
self.exits = [] | |
self.description = description | |
def __str__(self): |
This file contains hidden or 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 ast | |
import sys | |
class Vending_Machine: | |
def __init__(self, products, change): | |
self.products = products | |
self.change = change | |
def reset_products(self): | |
print("Let's reload the products") |
This file contains hidden or 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
#include "simpletools.h" | |
#include "ping.h" | |
#include "abdrive.h" | |
#define PAUSE 950 | |
#define speed 50 | |
#define pid_fac 2 | |
#define SIDE 40 | |
#define NORTH 0 | |
#define EAST 1 | |
#define SOUTH 2 |
This file contains hidden or 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 Text.ParserCombinators.Parsec hiding (spaces) | |
import System.Environment | |
import System.IO | |
-- Data types | |
data Formula = Proposition Char | |
| Negation Formula | |
| Binary Connective Formula Formula |
This file contains hidden or 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
package comp207p.main; | |
import org.apache.bcel.classfile.ClassParser; | |
import org.apache.bcel.classfile.Code; | |
import org.apache.bcel.classfile.JavaClass; | |
import org.apache.bcel.classfile.Method; | |
import org.apache.bcel.generic.*; | |
import org.apache.bcel.util.InstructionFinder; | |
import org.apache.bcel.verifier.structurals.ControlFlowGraph; |
This file contains hidden or 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 pandas | |
import matplotlib | |
import matplotlib.pyplot as plt | |
from matplotlib.backends.backend_pdf import PdfPages | |
matplotlib.style.use('ggplot') | |
df = pandas.read_excel('results.xls') | |
df.set_index("Candidate Number", inplace=True) |
This file contains hidden or 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
select p.product_id | |
from Products as p | |
where p.available_from < (NOW() - INTERVAL 1 MONTH) | |
and p.product_id not in ( | |
select o.product_id | |
from Orders as o | |
where o.dispatch_date > (NOW() - INTERVAL 1 YEAR) | |
group by o.product_id | |
having sum(o.quantity) >= 10 | |
) |
This file contains hidden or 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 | |
from typing import List | |
import math | |
import random | |
class RandomGen: | |
""" | |
Class for a random generator that selects a number from a given list. |
This file contains hidden or 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 next_num import RandomGen | |
import math | |
import unittest | |
# I would have used pytest for writing tests | |
# as it provides me decorators like parametrize | |
# but for the sake of the assignment I'm just sticking | |
# with the standard library :) |
OlderNewer