Giter VIP home page Giter VIP logo

huffmancode's Introduction

@author Fangzhou Xiong
@time 02/12/2016


Usage:

java -jar Huffman.jar encode "[encoding text]" <path/output file name> 
java -jar Huffman.jar decode <path/output file name>

Format of the output file:
<Table of Code to each charactor>
**
<Code>

I.E

$ cat ./output 
l 10
o 110
r 1110
d 1111
h 000
e 001
  010
w 011
**
00000110101100100111101110101111

This is the layout of the file intern:
|
|____Huffman
| |____bin
| | |____edu
| | | |____iit
| | | | |____xfz
| | | | | |____CodeRow.class
| | | | | |____CS401ArrayImpl.class
| | | | | |____CS401PriorityQueue.class
| | | | | |____FileIterator.class
| | | | | |____Huffman.class
| | | | | |____HuffmanCode.class
| | | | | |____HuffmanTree$TreeNode.class
| | | | | |____HuffmanTree.class
| | | | | |____TestClass.class
| | | | | |____Where.class
| |____src
| | |____edu
| | | |____iit
| | | | |____xfz
| | | | | |____CodeRow.java
| | | | | |____CS401ArrayImpl.java
| | | | | |____CS401PriorityQueue.java
| | | | | |____FileIterator.java
| | | | | |____Huffman.java
| | | | | |____HuffmanCode.java
| | | | | |____HuffmanTree.java
| | | | | |____TestClass.java
| | | | | |____Where.java
|____Huffman.jar
|____readme.txt

An already compiled jar file in the ./Huffman.jar
———————————————

###########################
[HOW TO RUN THE PROJECTS]
###########################

* To run this project, you should best use JDK 1.7 or above and Junit Library.
* Before running the application in cmd, make sure you have CLASSPATH setted right.

You can run the project with IDE or with out IDE:

[Run the project with IDE]
_______________________________
To run the project with IDE, simply import the project as JAVA_PROJECT.
Before you run the project, please read the homework instruction above, and if you are running project concerning calculating the runtime, please add these argument into the VM argument variants in IDE:

-Djava.compiler=NONE

[Run the project without IDE]
_______________________________

If you do not have IDE. After unzip the compressed file, you can compiler the java file your self (find the <filename>.java according to the layout above) by running the common:
java <javafilename>.java

For files in a package, you should:
1. first get the class filed.
2. Then you should create a MANIFEST.MF File with format like:

Manifest-Version: 1.0  
Created-By: anytime  
Class-Path: .  
Main-Class: edu.iit.xfz.Huffman

3. Put the MANIFEST.MF with the class file and create the jar packet with command:
jar cvfm [packetName].jar MANIFEST.MF -C [path to projects] .  

And when you have the class file, run the command:
java -jar -Djava.compiler=NONE <javafilenameonly>.jar

check the console for result.




huffmancode's People

Contributors

matthewxfz avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.