PDA

View Full Version : برنامه hafman



vatal
دوشنبه 09 آذر 1383, 00:44 صبح
با سلام ... :oops:

کسی از دوستان اینجا برنامه Hafman رو داره .... ممنون میشم اگه

در اختیار من بگذارید ! :گیج: :cry:

lionking_1360
سه شنبه 01 دی 1383, 12:31 عصر
سلام
Email بزن برات بفرستمش

vatal
شنبه 05 دی 1383, 10:48 صبح
با سلام :sunglass: :موفق:

این هم Email :samand20@yahoo.com

:موفق: :موفق: :موفق:

afshin61
دوشنبه 26 اردیبهشت 1384, 20:20 عصر
برا من هم بفرست لطفا"

afshinvblog@yahoo.com

:موفق:

Armanprogrammer
سه شنبه 03 خرداد 1384, 16:53 عصر
اگر میشه برای من هم بفرستین ARMAN.AMIRKAMALI@GMAIL.COM

rezaTavak
چهارشنبه 04 خرداد 1384, 07:55 صبح
سلام

منظور زیپ کردنه؟

که توی سایت Zlib هست:

http://www.zlib.net/

http://www.gzip.org/


http://www.gzip.org/gz124src.zip

small_programmer
جمعه 06 خرداد 1384, 07:32 صبح
خوب آقا لطف کن همین جا بگذار وقت خودت هم گرفته نمیشه :D
:strange:

rezaTavak
شنبه 07 خرداد 1384, 08:09 صبح
کس به ما نمیگه منظور ایشون چیه؟ همن زیپ کردن است؟

kaj_siyah
سه شنبه 01 آذر 1384, 00:40 صبح
من برنامه کد هافمن را لازم دارم لطفا برام بفرستین
E_mail:teoman_1358@yahoo.com

mzjahromi
سه شنبه 01 آذر 1384, 08:51 صبح
آره الگوریتم هافمن یه جور الگوریتم فشرده سازی که بر اساس تعداد رخداد و ... عمل فشرده سازی رو انجام میده

آسمان آبی
جمعه 16 دی 1384, 13:02 عصر
من هم لازم دارم اگه میشه برای من هم بفرستید
متشکرم

آسمان آبی
جمعه 16 دی 1384, 13:03 عصر
من هم لازم دارم اگه میشه برای من هم بفرستید
متشکرم

Iran-PC
جمعه 16 دی 1384, 13:20 عصر
goftman_new@yahoo.com

PLZ
Tanks

آسمان آبی
سه شنبه 20 دی 1384, 10:25 صبح
با سلام
اگر امکان داره برای من هم بفرستید لازمش دارم
خیلی ممنون
hanieh_md@yahoo.com

mahraz
جمعه 23 دی 1384, 12:45 عصر
سلام من احتیاج فوری به سورس برنامه هافمن دارم
خواهش می کنم به ایمیل زیر واسم بفرستید
marghoolak_20@yahoo.com

mohamad.alijani
شنبه 24 دی 1384, 12:39 عصر
در مورد روش فشرده سازی هافمن می خواستم بدونم (استاد یه تحقیق راجع به اون داده)

yaran891
جمعه 30 دی 1384, 11:16 صبح
تو این سایت همه چی برای همه است

mahraz
یک شنبه 02 بهمن 1384, 16:22 عصر
من دارم
ایمیل بفرست
marghoolak_20@yahoo.com

زهرا حسین ابادی
دوشنبه 15 اسفند 1384, 09:25 صبح
لطفا برنامه هافمن کد را برایم بفرستید تشکر .
lina_1550@yahoo.com

xxtmgh
دوشنبه 15 اسفند 1384, 17:38 عصر
برنامه کدهافمن به زبان ++Cرا من هم لازم دارم لطفا برایم بفرستید :گریه: :گریه:
mghsdk@yahoo.com

amir master
پنج شنبه 18 اسفند 1384, 18:08 عصر
خوب بزارید اینجا تا ملت استفاده کنند

javad-khfan
شنبه 20 خرداد 1385, 23:14 عصر
اگه لطف کنید کد هافمن را برای من بفرستید لازم دارم
javad_neg@yahoo.com

من این برنامه را قبل از امتحان پایان ترم یعنی تاریخ 26/3/1385 لازم دارم اگه کسی داره حتما بفرسته ممنون
javad_neg@yahoo.com

Arash_j13
یک شنبه 21 خرداد 1385, 03:46 صبح
این کد رو استادمون به عنوان نمونه نوشته درستی یا غلط بودنش گردن خودش



// This is a sample program by 'Arash Ostadzadeh' intended as a
// solution for Ex #5-'Simplified Huffman Coding'

// <notes for students>
// review each section carefully and try to understand its function.
// remember there is often a simple solution to problems, you just
// have to find it! so take your time when encountering one.
// certainly 'Programming is an ART'. try to develop your art of computer
// programming by excessive effort.

// for example in this problem in order to get rid of the complexity
// of manipulating bits directly, I have used a temporary file with
// each character (byte) representing a bit of '0' or '1' and then
// converted the temp file to the real output.

// one more thing: I have put a small bug in this program intentionally
// which doesn't affect the overall functionality of the program.
// the first student who will report that bug will get a bonus for
// his/her midterm exam.
// goodluck.

#include <stdio.h>
#include <iostream.h>
#include <alloc.h>

typedef struct // structure outline to keep track of unique symbols in file
{
char symbol;
int rep;
} table;


unsigned char power_2(int);
void sorttable(table *, int);
void writetotempfile(int, int, FILE *, unsigned long *);
void converttemptohuff(FILE *, FILE *);


void main(int argc, char **argv)
{
table *stb;
int syms,inputsize,counter;
unsigned long outputsize;
char inchar;
FILE *in,*out;

if (argc!=3) { cout<<"invalid number of parameters"; return;}

if ( !(in=fopen(argv[1],"rb")) )
{ cout<<"can not open input file"; return;}

if ( !(out=fopen("temp.huf","wb")) )
{ cout<<"can not create temp file"; return;}

if( !(stb=(table *)malloc(sizeof(table)*255)) )
{ cout<<"error in memory allocation"; return;}

syms=inputsize=outputsize=0;

inchar=fgetc(in);
while ( !feof(in) ) // make the symbols table from input file
{
for (counter=0;counter<syms;counter++)
if (inchar==stb[counter].symbol) { stb[counter].rep++; break; }

if ( counter==syms )
{
stb[counter].symbol=inchar;
stb[counter].rep=1;
syms++;
}

inputsize++;
inchar=fgetc(in);
}

stb=(table *)realloc(stb,syms*sizeof(table));
sorttable(stb,syms); // sort the table in descending order
// of the number of occurances for each symbol

fseek(in,0,SEEK_SET);
inchar=fgetc(in);
while ( !feof(in) ) // make the temporary file
{
for(counter=0;counter<syms;counter++)
if ( inchar==stb[counter].symbol )
{
writetotempfile(counter,syms,out,&outputsize);
break;
}
inchar=fgetc(in);
}
outputsize/=8; outputsize+=syms+3; // adjast the "outputsize" 'cos every
// 8 characters in temp file is equal
// to a byte in real output file.
// for the last incomplete byte we have
// to count it as 1 also.
// 3=1(incomplete byte)+2(leading bytes)
fclose(in);fclose(out);

if ( !(in=fopen("temp.huf","rb")) ) // change the roles of opened files!
{ cout<<"can not open temp file"; return;}

if ( !(out=fopen(argv[2],"wb")) )
{ cout<<"can not create output file"; return;}


fputc(char(inputsize),out); // write leading info in output file
fputc(char(syms),out);
for (counter=0;counter<syms;counter++) fputc(stb[counter].symbol,out);

converttemptohuff(in,out);
fclose(in);fclose(out);

cout<<"compression ratio = "<<(int)(outputsize/(float)inputsize*100)<<" %";

} // end of main()

void converttemptohuff(FILE *input, FILE *output)
{
unsigned char otmp=0,itmp;
int pos=7;

itmp=fgetc(input);
while( !feof(input) )
{
if (itmp=='1')
otmp=otmp | power_2(pos);
itmp=fgetc(input);
if (pos==0)
{
fputc(otmp,output);
pos=7;
otmp=0;
continue;
}
pos--;
}

if ( pos!=7 ) fputc(otmp,output);
}

void writetotempfile(int no_zeros, int no_syms, FILE*tmp, unsigned long *osize)
{
int i=0;
for ( ;i<no_zeros;i++) fputc('0',tmp);

(*osize)+=no_zeros;
if ( no_zeros<no_syms-1 || no_syms==1 )
{ fputc('1',tmp); (*osize)++; }
}

void sorttable(table *t, int size)
{
table temp;
int i,j;

for(i=size-1;i>0;i--)
for (j=0;j<i;j++)
if ( t[j].rep<t[j+1].rep)
{ temp=t[j]; t[j]=t[j+1]; t[j+1]=temp; }

}

unsigned char power_2(int n)
{
unsigned char c,res=1;

for (c=0;c<n;c++) res<<=1;
return res;
}

http://ostadzadeh.mshdiau.ac.ir/adv_prog.htm#Source%20code%20examples

setareh*******soheil
سه شنبه 25 اردیبهشت 1386, 14:36 عصر
من هم برنامه کد هافمن را لازم دارم لطفا برای من هم بفرستین
E_mail:ptlr136@gmail.com

حسین محمدی
سه شنبه 25 اردیبهشت 1386, 16:03 عصر
برای من هم ایمیل بزن: hsysdevelop@yahoo.com
ممنون

Arash_j13
سه شنبه 25 اردیبهشت 1386, 20:35 عصر
همین بالا نوشتم نگاه کنید ایمیل نمی خواد

RAZIYE
دوشنبه 21 خرداد 1386, 09:14 صبح
من برنامه کد هافمن را لازم دارم لطفا برام بفرستین خیلی فوریییییییییییییییییییییی یییییییییی

elhamohsen
چهارشنبه 23 خرداد 1386, 13:26 عصر
با سلام :sunglass: :موفق:

این هم Email :samand20@yahoo.com

:موفق: :موفق: :موفق:


منم وحشتناک به هافمن نیاز دارم کمک میخام
is every body to help me?????????????:ناراحت:

ali zarei
دوشنبه 18 تیر 1386, 09:55 صبح
man kodhaye algorithm hafmano lazem daram mamnoon misham baram befrestid
ssnarsis1365@yahoo.com

emad_67
دوشنبه 18 تیر 1386, 21:28 عصر
یه کد تو 5 یا 6 پست قبلی گذاشته شده ولی در کل این تاپیک خیلی قدیمیه برا در خوست یه تاپیک جدید بزنید بهتره البته الان نه دیگه ها:چشمک:

ali_15_17
سه شنبه 09 مرداد 1386, 23:15 عصر
لطفا اگر کسی سورس کد هافمن به زبان c و یا ++c را دارد برای من هم ایمیل کند و یا لینکش را و یا خور برنامه را در اینجا قرار دهد

بسیار سپاسگذار وممنون خواهم بود

ali_15_17@yahoo.com

aliandel2003
جمعه 30 آذر 1386, 19:37 عصر
کسی از دوستان اینجا برنامه Hafman رو داره .... ممنون میشم در اختیار من بگذارید

elhammobini
شنبه 28 اردیبهشت 1387, 15:46 عصر
سلام
میخواستم ازتون خواهش کنم که برنامه هافمن را برای من هم بفرستید
پیشاپیشششش متشکرم
Email:em6582@yahoo.com:قلب: