A good c++ prgram fro project.

Status
Not open for further replies.

sai_cool

Journeyman
Guys,

I have to do a project for my computer science exam.

I want to do somethin nice, but without using any graphics.

pls gimme some ideas. i would really appreciate it..

thanks...
 

saurabh kakkar

D i s t i n c t l y Ahead
search on internet abt cryptography and its algos like Des ,Rsa ,caesar cipher etc nd implement these algos in C++
 

DigitalDude

PhotonAttack
compression is easier than cryptography...

after writing compression programs you can lay your hands on cryptography :D


_
 

DigitalDude

PhotonAttack
@Sai_Cool

dude we can only show the puzzle :p you have to seek and find the way out of it :p ;)

come back again if you have any problems in the code or if you are stuck somewhere :D

if you are really that clueless try this


EDIT:

lol dheeraj chill yaar :lol: I understand your feelings thats why I have my present signature :p

Text compression? simple. write whatever you want on an a4 sheet, and crush it into a ball.

I laughed so hard :p


_
 
Last edited:

dheeraj_kumar

Legen-wait for it-dary!
Hey all, I'm sorry I blew off my steam, but I'm not sorry about what I said. I feel my feelings are justified.

Anyway sai_cool, I'm sorry if I made a big thing of your simple request, but you better start learning, mate.

Just as I said in my rant, google "text compression" and check the first page. They have lots of information including sample code.


<off topic>

@DigitalDude
Geeks are supposed to watch sci-fi movies, not Chutti-TV.
 

QwertyManiac

Commander in Chief
Hmmm..

sai_cool - Basic text compression works on the morse-code principles. An E in a morse code is just one character (Reason is because E is used most often of all characters). While a Q has a higher length.

E = .
Q = --.-

Now you can see why this is acceptable - E is used a lot and needs to be transmitted quick and Q hardly appears generally and is not that important so its given a longer length representation.

Similarly text compression can be done in 3 steps:

1. Get the input. Now check the input for all its characters and find the probability of each. Like if the length is 4 ("ABCA") then A's probability of occurance is 2/4, B's and C's is 1/4 each.

2. Assign unique code words for each of these characters. Like for example am gonna assign a binary bit 0 for A and 10 for B and 11 for C. You can see that when I thus make the string in binary compressed form as 0.10.11.0 the total length reduces to 6 bits (This binary format 010110) from 4 bytes (Each character is a byte) of ABCA.

(Neglect the dots, they are for better visualizing)

3. To decode this format you have to make the decoder know what symbol is assigned to what. And once your decoder knows that its easy for you to decode.

What I've just demonstrated above is the Variable Length (Size of the unique code word for each character changes) method. This is the most basic style of text compression. There are 2-3 algorithms to assist you in generating the code word table, they are Huffman Coding method and Shannon-Fano coding method.

Explaining them to you is beyond the scope of this post since they are relatively simple methods you can check in the links provided and ask certain large doubts if you've got them.

(Assuming you know how trees work, else learn basic data structures first and then get into such programming levels)

Tip: Shannon Fano coding is fairly easier than Huffman coding.
 
OP
S

sai_cool

Journeyman
Thanks Qwerty!

i know file handling, so i think i can go ahead with the project.
Thanks for explaning the concept behind it.
Now u are a good guy, unlike that Dheeraj !
 

dheeraj_kumar

Legen-wait for it-dary!
Some mod deleted my looong reply to you, I guess. Too offensive? sorry mods :)

Anyway, I made my point quite clear. I highly suggest you read through my post once again. I dont mind being rude and arrogant as long as people learn something. I frankly shouldnt have cared if you leeched or not, nevermind *shrugs shoulders*

have fun, and learn something pl0x.

and hey, i dont really care about being branded as an idiot or a bad guy. my way of life is "dont care whatever the other person thinks about you unless its a she, and she is good looking, and she is single"

so, who cares about what a little noob says? :D
 
OP
S

sai_cool

Journeyman
yaar, lets jus leave it at this. i have already finished and submitted my project. thanks for all the help/.
 
Status
Not open for further replies.
Top Bottom