壓縮軟體課程設計
㈠ 怎樣在網上下載有壓縮包的文件嗎例如:課程設計等。
右鍵點擊另存為;如果你的右鍵菜單里有迅雷下載,就用迅雷下載試試
㈡ C++課程設計「基於哈夫曼編碼的數據壓縮/解壓程序」
This may be help:
http://www.diybl.com/course/3_program/c++/cppjs/20071024/79743.html
㈢ 空氣壓縮機課程設計方案
你這個問題太亂了,想要請人幫忙,要把問題搞明白點
㈣ 誰有空氣壓縮機的課程設計,畢業設計最好。急!!!
空氣壓縮機的文獻資料我有一些,但這方面范圍太大了,你能再說的具體點么,留個郵箱,我發給你吧,上邊那些都是代寫,請忽略
㈤ 急求c#掃雷課程設計壓縮文件,包含程序源代碼,注釋,可以直接到vs2008運行出遊戲sln文件,最好有報告。
大牛,我非常鄭重的告訴你,首先,任何語言都可以編寫《掃雷》程序,專區別只是復雜屬度的不同,但都可以達到這個結果是絕對沒有爭議的;
其次,編寫《掃雷》可真的不如普類《掃雷》那麼易噻誒,絕不是任何有三腳貓的語言學者就可以做到的,你看看這個游戲的大小,大概在幾個KB左右,如果稍微懂點計算機知識的人,就知道,編寫其代碼最少也要上千行,不可能一宿就完成;
最後,奉勸你,若真想編出這個游戲來,從現在開始,虛心刻苦的學習你的C家家,一步一個腳印踏實的走下去,保持一顆恆心;
水到渠成,是必然的事情,到最後不用任何人教你,自己就會,否則的話,神仙也教不會你
另外,站長團上有產品團購,便宜有保證
㈥ 能發個auto cad07破解版的壓縮包給我嗎急寫課程設計謝啦!
去VERY CD 搜
㈦ JAVA課程設計報告:將當前窗體壓縮成ZIP文件(附上源代碼)。
樓主,看java.io包裡面的Serializable API 文檔和ObjectInputStream
ObjectOutputStream
㈧ java課程設計:將當前的窗體對象壓縮成zip文件 。
將窗體和窗體涉及到的類的class文件放在一個包中
在與該包同目錄下建個1.txt文件,內打開該文件,在裡面寫入Main-Class:(這容有個空格)包名.類名(主函數所在的那個類)最後回車點保存。
在dos命令行里,進入該包所在的目錄,
輸入jar -cvfm 名稱.jar(給你打包後的包取個名字)1.txt(配置文件) 包名(存放你要打包的類的包)
㈨ 哪位能幫我啊我最近在做課程設計,題目是哈弗曼壓縮解壓程序!用C++做,還要設計類!
------------------------------------------------------------------
HuffTree.h 文件:
/*
* 四川大學.軟體學院
*
* 文件名稱: HuffTree.h
* 摘 要: 利用有序表,建立哈夫曼樹
*
* 作 者: 高雲翔
* 完成日期 :2008.11.14
*/
#ifndef HUFFTREE_H
#define HUFFTREE_H
//由於SAList類要用到HuffTree類,此處即為虛定義
class HuffTree;
//有序表類的聲明
class SAList {
int fence;
int maxSize;
int listSize;
public:
SAList(int size = 0);
~SAList();
HuffTree* *listArray;
void setStart();
void next();
int getLength();
bool insert(HuffTree* item); //排序插入
HuffTree* remove();
bool lessThan(HuffTree* x, HuffTree* y);
};
//哈弗曼樹結點的類聲明
class HuffTreeNode {
public:
unsigned char value;
unsigned long int weight;
unsigned int leftOrRight; //若為左兒子,則值為0,若為右兒子,則值為1
HuffTreeNode *parent;
HuffTreeNode *leftChild;
HuffTreeNode *rightChild;
bool isLeaf;
};
//哈夫曼樹的聲明
class HuffTree {
public:
HuffTreeNode* subRoot;
HuffTree();
HuffTree(unsigned char val, unsigned long int freq);
HuffTree(HuffTree* l, HuffTree* r);
HuffTree* buildHuffTree(SAList *sal, SAList * );
};
#endif
--------------------------------------------------------------------
HuffTree.cpp文件:
//哈夫曼樹的實現
#include <iostream>
#include "HuffTree.h"
//有序表類的聲明
SAList::SAList(int size) {
maxSize = size;
listSize = fence = 0;
listArray = new HuffTree*[maxSize];
}
SAList::~SAList(){
delete []listArray;
}
void SAList::setStart() {
fence = 0;
}
void SAList::next() {
if(fence <= listSize)
++fence;
}
int SAList::getLength() {
return listSize;
}
//排序插入
bool SAList::insert(HuffTree* item) {
if (listSize == maxSize)
return false;
HuffTree *current;
for (fence=0; fence<listSize; fence++) {
current = listArray[fence];
if(!lessThan(current, item))
break;
}
for (int i=listSize; i>fence; i--) {
listArray[i] = listArray[i-1];
}
listArray[fence] = item;
++listSize;
return true;
}
HuffTree* SAList::remove() {
if(listSize == fence) {
return NULL;
}
HuffTree *temp = listArray[fence];
for(int i=fence; i<listSize-1; ++i) {
listArray[i] = listArray[i+1];
}
--listSize;
return temp;
}
bool SAList::lessThan(HuffTree* x, HuffTree* y) {
return x->subRoot->weight < y->subRoot->weight;
}
//哈夫曼樹的實現
HuffTree::HuffTree() {
subRoot = new HuffTreeNode;
subRoot->weight = 0;
}
HuffTree::HuffTree(unsigned char val, unsigned long int freq) {
subRoot = new HuffTreeNode;
subRoot->value = val;
subRoot->weight = freq;
subRoot->isLeaf = true;
}
HuffTree::HuffTree(HuffTree* l, HuffTree* r) {
subRoot = new HuffTreeNode;
subRoot->leftChild = l->subRoot;
subRoot->rightChild = r->subRoot;
subRoot->leftChild->parent = subRoot->rightChild->parent = subRoot;
subRoot->weight = l->subRoot->weight + r->subRoot->weight;
subRoot->isLeaf = false;
}
HuffTree* HuffTree::buildHuffTree(SAList *sal, SAList *) {
HuffTree *temp1, *temp2, *temp3;
temp1 = temp2 = temp3 = new HuffTree;
for(int i=sal->getLength(); i>1; i--) {
sal->setStart();
temp1 = sal->remove();
temp2 = sal->remove();
temp1->subRoot->leftOrRight = 0;
temp2->subRoot->leftOrRight = 1;
temp3 = new HuffTree(temp1, temp2);
if(temp1->subRoot->isLeaf)
->insert(temp1);
if(temp2->subRoot->isLeaf)
->insert(temp2);
sal->insert(temp3);
}
return temp3;
}
------------------------------------------------------------------
HuffmanCodeing.h文件:
/*
* 四川大學.軟體學院
*
* 文件名稱: HuffmanCodeing.h
* 摘 要: 利用哈夫曼樹,對文件內容進行哈夫曼編碼與解碼
*
* 作 者: 高雲翔
* 完成日期: 2008.11.21
*/
#ifndef HUFFMANCODING_H
#define HUFFMANCODING_H
#include <iostream>
#include "HuffTree.h"
using namespace std;
//棧結構
struct Link {
unsigned int element;
Link *next;
Link(const unsigned int &elemval, Link *nextval = NULL);
Link(Link *nextval = NULL );
};
struct LStack {
Link* top;
int size;
LStack()
~LStack()
void clear();
bool push(const unsigned int &item);
bool pop(unsigned int &it);
};
//緩沖區
struct Buffer {
unsigned char byte; //表示位元組,每個位元組由8個位組成
unsigned int bits; //表示位(比特)
void clear(); //清空緩存區
};
//臨時保存葉子結點的數域
struct Save {
unsigned char ch;
unsigned long int val;
};
class HuffmanCoding {
private:
SAList *list, *;//有序表
HuffTree* tree; //哈夫曼樹
Buffer buffer; //緩存區
LStack *stack; //棧
Save save; //臨時保存葉子結點的數域
FILE *sourceFile; //表示源文件
FILE *targetFile; //表示目標文件
unsigned long int total; //表示要進行編碼的文件的總位元組數(number < 4290000000)
unsigned long int ch[257]; //表示可以編碼的所有字元,其下標表示對應的字元,對應下標的數組值表示該字元的權值
unsigned int numOfLeaf; //表示需要建立葉子結點的個數
public:
void code(); //對文件內容進行編碼
void decode(); //對文件內容進行解碼
void buildSAList(); //建立有序表,並將建立有序表的信息保存到目標文件
void write(unsigned int c); //利用建立的緩存,向目標文件中輸出字元
void exportSAList(); //壓縮文件中導出有序表
unsigned int read(); //利用建立的緩存,從壓縮文件提取字元
};
#endif
---------------------------------------------------------------------
HuffmanCoding.cpp文件:
//哈夫曼編碼、解碼的實現
#include <fstream>
#include <iostream>
#include "HuffmanCoding.h"
using namespace std;
Link::Link(const unsigned int &elemval, Link *nextval) {
element = elemval;
next = nextval;
}
Link::Link( Link *nextval) {
next = nextval;
}
void LStack::clear() {
while(top != NULL){
Link *temp = top;
top = top->next;
delete temp;
}
size = 0;
}
bool LStack::push(const unsigned int &item) {
top = new Link(item, top);
size++;
return true;
}
bool LStack::pop(unsigned int &it) {
if(size == 0) return false;
it = top->element;
Link *temp = top;
top = top->next;
size--;
delete temp;
return true;
}
void Buffer::clear() {
bits = 0;
byte = 0;
}
void HuffmanCoding::code() {
char *sourceFileName = new char[];
char *targetFileName = new char[];
total = 0;
numOfLeaf = 0;
cout << "請輸入源文件的文件名:(支持最大文件為4.29G)";
cin >> sourceFileName;
sourceFile = fopen(sourceFileName, "rb");
//判斷源文件是否存在,不存在則要求用戶重新輸入
while (sourceFile == NULL) {
cout << "您輸入的源文件不存在!" << "\n請重新輸入:";
cin >> sourceFileName;
sourceFile = fopen(sourceFileName, "rb");
}
fgetc(sourceFile);
//判斷文件內容是否為空,若為空則退出程序
if (feof(sourceFile)) {
cout << "文件內容為空!";
system("PAUSE");
exit(-1);
}
cout << "請輸入目標文件的文件名:";
cin >> targetFileName;
targetFile = fopen(targetFileName, "wb");
//判斷目標文件是否可以建立
while (targetFile == NULL) {
cout << "目標文件無法建立!" << "\n請重新輸入:";
cin >> targetFileName;
targetFile = fopen(targetFileName, "wb");
}
cout << "文件壓縮中...\n\n";
buildSAList(); //建立有序表,並保存編碼信息
tree = tree->buildHuffTree(list, ); //利用已建立的有序表,建立哈夫曼樹
//開始編碼,並將編碼後的內容輸出到目標文件
rewind(sourceFile); //將文件指針重新指向文件內容起始處
unsigned char tempChar = fgetc(sourceFile); //取文件內容的下一個字元
unsigned int tempInt;
HuffTreeNode *tempTreeNode;
stack = new LStack();
buffer.clear(); //清空緩存區
//當文件內容全部被掃描完,循環結束
while (!feof(sourceFile)) {
//搜索匹配tempChar的葉子的值
for (int i=0; i< ->getLength(); i++) {
if (tempChar == ->listArray[i]->subRoot->value) {
stack->clear();
tempTreeNode = ->listArray[i]->subRoot;
while (tempTreeNode != tree->subRoot) {
stack->push(tempTreeNode->leftOrRight);
tempTreeNode = tempTreeNode->parent;
}//end while
while (stack->pop(tempInt)) {
write(tempInt);
}
break;
}//end if
}//end for
tempChar = fgetc(sourceFile);
}//end while
//如果緩存區還有剩餘的位,則添加0到緩存區,直到夠滿8個位建立個字元,並向目標文件寫入該字元
if (buffer.bits > 0) {
for (unsigned int i=buffer.bits; i<8; i++)
write(0);
}
cout << "文件壓縮完畢" << endl;
delete stack;
delete list;
fclose(sourceFile); //關閉文件流
fclose(targetFile);
}
void HuffmanCoding::decode() {
char *sourceFileName = new char[];
char *targetFileName = new char[];
total = 0;
numOfLeaf = 0;
cout << "\n請輸入壓縮文件的文件名:";
cin >> sourceFileName;
sourceFile = fopen(sourceFileName, "rb");
//判斷源文件是否存在,不存在則要求用戶重新輸入
while (sourceFile == NULL) {
cout << "您輸入的壓縮文件不存在!" << "\n請重新輸入:";
cin >> sourceFileName;
sourceFile = fopen(sourceFileName, "rb");
}
fgetc(sourceFile);
//判斷文件內容是否為空,若為空則退出程序
if (feof(sourceFile)) {
cout << "文件內容為空!";
system("PAUSE");
exit(-1);
}
cout << "請輸入目標文件的文件名:";
cin >> targetFileName;
targetFile = fopen(targetFileName, "wb");
//判斷目標文件是否可以建立
while (targetFile == NULL) {
cout << "目標文件無法建立!" << "\n請重新輸入:";
cin >> targetFileName;
targetFile = fopen(targetFileName, "wb");
}
cout << "文件解壓中...\n\n";
rewind(sourceFile); //將源文件指針重新指向文件起始處
exportSAList(); //導出葉子結點有序表
tree = tree->buildHuffTree(list, ); //利用已建立的有序表,建立哈夫曼樹
//解碼開始
buffer.clear(); //清空緩存區
unsigned int tempInt;
HuffTreeNode *tempTreeNode;
while (total > 0) {
tempTreeNode = tree->subRoot;
while(!tempTreeNode->isLeaf) {
tempInt = read();
if(tempInt == 0) {
tempTreeNode = tempTreeNode->leftChild;
}
else {
tempTreeNode = tempTreeNode->rightChild;
}
}
fputc(tempTreeNode->value, targetFile);
total--;
}
cout << "文件解壓完畢" << endl;
delete list;
fclose(sourceFile);
fclose(targetFile);
}
//按字元掃描源文件,統計源文件出現的字元及其權值
//利用統計出的字元和和其權值建立葉子結點有序表,並將統計出的信息保存到目標文件
void HuffmanCoding::buildSAList() {
unsigned char tempChar;
HuffTree *temp;
//初始化儲存字元的數組
for (int i=0; i<257; i++)
ch[i] = 0;
rewind(sourceFile); //將文件指針重新指向文件內容起始處
tempChar = fgetc(sourceFile); //取文件內容的下一個字元
//當文件內容全部被掃描完,循環結束
while (!feof(sourceFile)) {
++ch[tempChar];
++total;
tempChar = fgetc(sourceFile);
}
//計算應該建立的葉子結點總數
for(int j=0; j<257; j++) {
if(ch[j] > 0)
numOfLeaf++;
}
//將源文件的字元總數及葉子結點總數保存到目標文件
fwrite(&total, sizeof(unsigned long int), 1, targetFile);
fwrite(&numOfLeaf, sizeof(unsigned int), 1, targetFile);
//建立葉子結點有序表
list = new SAList(numOfLeaf);
= new SAList(numOfLeaf);
//依次掃描ch,將權值不為0的字元插入到葉子結點有序表中
//並將此字元及其權值保存到目標文件
for(int k=0; k<257; k++) {
if(ch[k] > 0) {
temp = new HuffTree(k, ch[k]);
list->insert(temp);
save.ch = k;
save.val = ch[k];
fwrite(&save, sizeof(save), 1, targetFile);
}
}
}
//利用建立的緩存,向目標文件中輸出字元
void HuffmanCoding::write(unsigned int c) {
++buffer.bits;
buffer.byte = (buffer.byte << 1) + c; //將byte左移一位,並在末位加上c
//如果byte的8個位都被寫滿,則向目標文件輸出byte,並清空緩存區
if (buffer.bits == 8) {
fputc(buffer.byte, targetFile);
buffer.clear();
}
}
//從壓縮文件中導出葉子結點有序表
void HuffmanCoding::exportSAList() {
HuffTree *temp;
fread(&total, sizeof(unsigned long int), 1, sourceFile);
fread(&numOfLeaf, sizeof(unsigned int), 1, sourceFile);
list = new SAList(numOfLeaf);
for(int i=0; i<numOfLeaf; i++) {
fread(&save, sizeof(save), 1, sourceFile);
temp = new HuffTree(save.ch, save.val);
list->insert(temp);
}
}
//從壓縮文件中讀取一個比特
unsigned int HuffmanCoding::read() {
if(buffer.bits == 0) {
buffer.bits = 8;
buffer.byte = fgetc(sourceFile);
}
if(buffer.byte & (1<<(buffer.bits-1))) {
buffer.bits--;
return 1;
}
else {
buffer.bits--;
return 0;
}
}
-------------------------------------------------------------------
Driver.cpp文件:
#include "HuffmanCoding.h"
int main() {
HuffmanCoding h;
h.code();
h.decode();
system("PAUSE");
return 0;
}
一共5個文件,文件名已經給你了,你直接拷貝就可以,絕對我自己的原創,我還沒給別人看過,希望你能利用好這段代碼
㈩ EDA課程設計壓縮BCD碼轉換器設計(十進制數轉換為二進制數) 求程序
LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;
USE IEEE.STD_LOGIC_UNSIGNED.ALL;
ENTITY yimaqi IS
PORT (ain:IN STD_LOGIC_VECTOR(3 DOWNTO 0);
dout:OUT STD_LOGIC_VECTOR(6 DOWNTO 0));
END yimaqi;
ARCHITECTURE one OF yimaqi IS
BEGIN
PROCESS(ain)
BEGIN
CASE ain IS
WHEN "0000"=>dout<="0111111";
WHEN "0001"=>dout<="0000110";
WHEN "0010"=>dout<="1011011";
WHEN "0011"=>dout<="1001111";
WHEN "0100"=>dout<="1100110";
WHEN "0101"=>dout<="1101101";
WHEN "0110"=>dout<="1111101";
WHEN "0111"=>dout<="0000111";
WHEN "1000"=>dout<="1111111";
WHEN "1001"=>dout<="1101111";
WHEN "1010"=>dout<="0111001";
WHEN "1011"=>dout<="1011110";
WHEN "1100"=>dout<="1011100";
WHEN "1101"=>dout<="1010100";
when "1110"=>dout<="1111011";
WHEN OTHERS=>dout<="0000000";
END CASE;
END PROCESS; END one;
解碼器顯示程序,參考一下