Skip to content

Instantly share code, notes, and snippets.

View libertylocked's full-sized avatar

libertylocked

View GitHub Profile
import java.util.ArrayList;
import javax.swing.JFrame;
public class MazeFrame
{
public static void main(String[] args) throws InterruptedException
{
int width = 15;
int height = 10;
JFrame frame = new JFrame();
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity Latch4bit is
Port ( D : in STD_LOGIC_VECTOR(3 downto 0);
E : in STD_LOGIC;
Q : out STD_LOGIC_VECTOR(3 downto 0));
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity Mux4to1 is
Port ( S : in STD_LOGIC;
A : in STD_LOGIC_VECTOR(3 downto 0);
B : in STD_LOGIC_VECTOR(3 downto 0);
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity Counter2bit is
Port ( Up, CLR : in STD_LOGIC;
Q : out STD_LOGIC_VECTOR(1 downto 0));
end Counter2bit;
/**
* It is okay to use ArrayList class but you are not allowed to use any other
* predefined class supplied by Java.
*/
import java.util.ArrayList;
public class CompressDecompress
{
/**
* Get a string representing a Huffman tree where its root node is root
import java.util.Random;
public class ShowPath
{
public static void main(String[] args)
{
int point = 0;
BinaryNodeInterface<Character> root = generateTree();
@libertylocked
libertylocked / project-1.c
Created January 25, 2015 21:32
COE 449 project 1
/*
project-1.c
As you develop and test this file:
use this command to compile: (you can name the executable whatever you like)
gcc -W -Wall -Wextra -O2 project-1.c -o project-1.exe
use this command to execute: (you will of course test on both input files)
@libertylocked
libertylocked / mygetline.c
Last active August 29, 2015 14:14
coe 449 lab 3
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
// YOU FILL IN THE CODE BODY FOR THIS FUNCTION BELOW MAIN
char * mygetline( char **buffer, FILE * instream ); // JUST A PROTOTYPE. FUNCTION BODY IS BELOW MAIN
// MAIN IS GIVEN AS-IS DO NOT MODIFY
int main( int argc, char *argv[] )
@libertylocked
libertylocked / FpsCounter.cs
Last active February 20, 2016 08:35
[XNA] FPS counter with multiple features. Published under MIT license.
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
'use strict'
function* fibGen(limit) {
let prevVal = 0, currVal = 1;
let nextVal = 0;
while (!limit || currVal <= limit) {
yield currVal;
nextVal = currVal + prevVal;
prevVal = currVal;
currVal = nextVal;