Notices

Overclockers Forums > Software > Programming Tips and Tricks
Programming Tips and Tricks
Forum Jump

Finally, useful programming!

Post Reply New Thread Subscribe Search this Thread
 
 
Thread Tools
Old 04-08-02, 08:16 PM Thread Starter   #1
Krusty
Insane Overclocking Clown

 
Krusty's Avatar 

Join Date: Sep 2001
Location: Orange County

10 Year Badge
 
Exclamation Finally, useful programming!


Hello all you programming noobs, programming gurus, and wannabe programming gurus!

I just felt like telling all the people out there that have not hit upper division programming courses to hold on a bit. After two years of writing useless code that simply serves as a programming exercise, I have finally reached a programming assignment in which I can actually see a purpose for.

My assignment, due next week, is a practice in huffman coding. Huffman coding is a form of file compression. My assignment basically involves writing my own file compression program.

Sure, programs like winzip and winrar already exist, but now I can have one of my own. Should I call it WinKrusty? I dunno.

Anyways, I just felt like making a useless post to tell everyone in earlier stages of learning to program that you, one day, will have interesting and difficult assignments.

__________________
There are 10 types of people in this world: Those who understand binary and those who don't.
Krusty is offline Heatware Profile   QUOTE Thanks
Old 04-08-02, 08:27 PM   #2
JigPu
Inactive Pokémon Moderator

 
JigPu's Avatar 

Join Date: Jun 2001
Location: Vancouver, WA

10 Year Badge
 
Call it Squishy!

Man, I've been wanting to try to find some code on Huffman algorithms to attempt my own compression. Haven't found anything on the net though, and even if there was, I highly doubt it would be written in BASIC

You know, with the compression, you could technicaly even make your own compressed picture format... Something like a GIF or JPEG... only made by yourself!

JigPu

__________________
.... ASRock Z68 Extreme3 Gen3
.... Intel Core i5 2500 ........................ 4 thread ...... 3300 MHz ......... -0.125 V
2x ASUS GTX 560 Ti ............................... 1 GiB ....... 830 MHz ...... 2004 MHz
.... G.SKILL Sniper Low Voltage ............. 8 GiB ..... 1600 MHz ............ 1.25 V
.... OCZ Vertex 3 ................................. 120 GB ............. nilfs2 ..... Arch Linux
.... Kingwin LZP-550 .............................. 550 W ........ 94% Eff. ....... 80+ Plat
.... Nocuta NH-D14 ................................ 20 dB ..... 0.35 C°/W ................ 7 V


"In order to combat power supply concerns, Nvidia has declared that G80 will be the first graphics card in the world to run entirely off of the souls of dead babies. This will make running the G80 much cheaper for the average end user."
"GeForce 8 Series." Wikipedia, The Free Encyclopedia. 7 Aug 2006, 20:59 UTC. Wikimedia Foundation, Inc. 8 Aug 2006.
JigPu is offline   QUOTE Thanks
Old 04-08-02, 09:32 PM   #3
XWRed1
Senior Member

 
XWRed1's Avatar 

Join Date: Oct 2001

 
You should be innovative and do a lossy compression algorithm.
XWRed1 is offline   QUOTE Thanks
Old 04-08-02, 10:03 PM Thread Starter   #4
Krusty
Insane Overclocking Clown

 
Krusty's Avatar 

Join Date: Sep 2001
Location: Orange County

10 Year Badge
 
Quote:
Originally posted by JigPu
Call it Squishy!

Man, I've been wanting to try to find some code on Huffman algorithms to attempt my own compression. Haven't found anything on the net though, and even if there was, I highly doubt it would be written in BASIC

You know, with the compression, you could technicaly even make your own compressed picture format... Something like a GIF or JPEG... only made by yourself!

JigPu
actually, both JPEG and MP3 use huffman algorithms in their compression. I don't really know basic, but I would suspect it to be very difficult to do since it involves trees. To make a tree, you need to dynamically allocate memory and use pointers (or reference stuff in java).

I have looked into bmp format before when attempting to do some graphics stuff in assembly. I thought I might be able to read the data and find my own way to output it. I guess I could make my own data type, but finding out how to convert it from other images and create the images would be a real pain in the butt at the moment.

__________________
There are 10 types of people in this world: Those who understand binary and those who don't.
Krusty is offline Heatware Profile   QUOTE Thanks
Old 04-08-02, 10:04 PM Thread Starter   #5
Krusty
Insane Overclocking Clown

 
Krusty's Avatar 

Join Date: Sep 2001
Location: Orange County

10 Year Badge
 
Quote:
Originally posted by XWRed1
You should be innovative and do a lossy compression algorithm.
lossy?

__________________
There are 10 types of people in this world: Those who understand binary and those who don't.
Krusty is offline Heatware Profile   QUOTE Thanks
Old 04-08-02, 11:48 PM   #6
Istari1
Member

 
Istari1's Avatar 

Join Date: Mar 2002
Location: Raleigh NC

 
Quote:
Originally posted by Krusty


lossy?
Losing data. Actually a lossless would be better. Maybe I have it backwards, its been a while but lossy just means that you cant revert back t the original file/image because some data is lost in the compression. Lossless (which is very rare with any type of good compression) is what you would want, but is extremly hard to achieve and actually compress the data in any worthwhile way.

Josh
Istari1 is offline   QUOTE Thanks
Old 04-08-02, 11:50 PM   #7
Istari1
Member

 
Istari1's Avatar 

Join Date: Mar 2002
Location: Raleigh NC

 
On the same thread, you would be amazed how much coding you do in college that you find useless can actually be put to a good use. hashing for example is alot of fun to mess with. I actually managed to out do my prof's hashing function for these GPS records so now he uses my code in his examples. Hashing a 80 MB text file is quite a sight, and quite time consuming even on an Xp 1900+

Josh
Istari1 is offline   QUOTE Thanks
Old 04-09-02, 02:33 AM   #8
XWRed1
Senior Member

 
XWRed1's Avatar 

Join Date: Oct 2001

 
Lossy compression is something like a jpeg, mp3, or divx. Data is lost.

Lossless is something like rar or zip, no data is lost.

It was a joke, really. Lossless compression is a bad idea for meaningful data. Imagine if you stuff a word file into a lossy compression algorithm, the document would be corrupt since is has lost data that can't be recovered.

And once you start discarding the data willfully in the name of compression, you can go just about as far as you want. True compression was master long ago, with delete commands
XWRed1 is offline   QUOTE Thanks
Old 04-09-02, 11:08 AM Thread Starter   #9
Krusty
Insane Overclocking Clown

 
Krusty's Avatar 

Join Date: Sep 2001
Location: Orange County

10 Year Badge
 
Quote:
Originally posted by Istari1


Losing data. Actually a lossless would be better. Maybe I have it backwards, its been a while but lossy just means that you cant revert back t the original file/image because some data is lost in the compression. Lossless (which is very rare with any type of good compression) is what you would want, but is extremly hard to achieve and actually compress the data in any worthwhile way.

Josh
The huffman algorithm is lossless. Part of my testing is to compress and uncompress a 300MB executable file and a 100MB zip file. They still gotta work when I'm done.

__________________
There are 10 types of people in this world: Those who understand binary and those who don't.
Krusty is offline Heatware Profile   QUOTE Thanks
Old 04-18-02, 11:39 PM   #10
Phleg
Registered



Join Date: Apr 2002

 
Your compression algorithm needs to increase the file size =) Call it an anti-piracy mechanism
Phleg is offline   QUOTE Thanks
Old 04-21-02, 06:28 PM   #11
Terra Knight
Registered

 
Terra Knight's Avatar 

Join Date: Feb 2002
Location: Toronto, Ontario, Canada

 
I think what Phleg is getting at is an encryption program.
Terra Knight is offline   QUOTE Thanks
Old 04-21-02, 06:31 PM   #12
Phleg
Registered



Join Date: Apr 2002

 
Not at all! I'm rationalizing that, if somebody is going to have to download a 500MB file, and "ununcompress" it to a 4kb .txt file, I doubt they'd be grabbing larger files
Phleg is offline   QUOTE Thanks
Old 04-21-02, 07:59 PM   #13
Terra Knight
Registered

 
Terra Knight's Avatar 

Join Date: Feb 2002
Location: Toronto, Ontario, Canada

 
Lol... alright, you win!
Terra Knight is offline   QUOTE Thanks
Old 05-02-02, 03:16 PM   #14
Krieger
Member



Join Date: Jan 2002
Location: North of Boston, MA

 
I have a book kicking around with some very interesting compression algoithms in it for C. If anyone would like(it would take a bit) I can write up some of the code samples and upload them. Oh WinZip uses Huffman compresion as well. And for the record, at least as of a couple of years ago, someone has the copyright and patent for huffman compression. There is also sliding window compression and a few others. Just let me know if any of you are intrested in the code. Also I did a huffman coding in one of my first programming classes, though it was towards the end. And it was gone over again in a descret math(basically a glorified logic class) class.
Krieger is offline   QUOTE Thanks
Old 05-02-02, 06:14 PM Thread Starter   #15
Krusty
Insane Overclocking Clown

 
Krusty's Avatar 

Join Date: Sep 2001
Location: Orange County

10 Year Badge
 
Quote:
Originally posted by Krieger
I have a book kicking around with some very interesting compression algoithms in it for C. If anyone would like(it would take a bit) I can write up some of the code samples and upload them. Oh WinZip uses Huffman compresion as well. And for the record, at least as of a couple of years ago, someone has the copyright and patent for huffman compression. There is also sliding window compression and a few others. Just let me know if any of you are intrested in the code. Also I did a huffman coding in one of my first programming classes, though it was towards the end. And it was gone over again in a descret math(basically a glorified logic class) class.
Huffman is still alive and teaching at a University somewhere. It would probably be him that would have a copyright for it.

Oh, and discrete math sucks my (__|__)! I just finished 2 quarters of it. I can't stand proofs. Now I'm on to a statistics class. I can't believe how much integration is used in these classes.

__________________
There are 10 types of people in this world: Those who understand binary and those who don't.
Krusty is offline Heatware Profile   QUOTE Thanks

Post Reply New Thread Subscribe


Overclockers Forums > Software > Programming Tips and Tricks
Programming Tips and Tricks
Forum Jump

Thread Tools Search this Thread
Search this Thread:

Advanced Search


Mobile Skin
All times are GMT -5. The time now is 01:14 PM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
You can add these icons by updating your profile information to include your Heatware ID, Benching Profile ID or your Folding/SETI profile ID. Edit your profile!
X

Welcome to Overclockers.com

Create your username to jump into the discussion!

New members like you have made this the best community on the Internet since 1998!


(4 digit year)

Why Join Us?

  • Share experience
  • Max out your hardware
  • Best forum members anywhere
  • Customized forum experience

Already a member?