8 Replies - 5170 Views - Last Post: 08 February 2009 - 11:26 AM

#1 begdev   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 08-February 09

writing compression algorithm

Posted 08 February 2009 - 08:51 AM

so at this website: http://www.dogma.net...arith/part1.htm if you scroll about 1/4 the way down it says:

"The algorithm to accomplish this for a message of any length is is shown below:

Set low to 0.0
Set high to 1.0
While there are still input symbols do
get an input symbol
code_range = high - low.
high = low + range*high_range(symbol)
low = low + range*low_range(symbol)
End of While
output low

im doing a school project on different types of compression algorithms and i need to know 2 things:

what do i write this program in (language and program) as well as how do i apply this to a file and then get the compressed file...

or if i even have the right idea?
thx.

Is This A Good Question/Topic? 0
  • +

Replies To: writing compression algorithm

#2 ayman_mastermind   User is offline

  • human.setType("geek");
  • member icon

Reputation: 127
  • View blog
  • Posts: 1,860
  • Joined: 12-December 08

Re: writing compression algorithm

Posted 08 February 2009 - 10:25 AM

@begdev, what is your programming language first of all?
Was This Post Helpful? 0
  • +
  • -

#3 begdev   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 08-February 09

Re: writing compression algorithm

Posted 08 February 2009 - 10:36 AM

View Postayman_mastermind, on 8 Feb, 2009 - 09:25 AM, said:

@begdev, what is your programming language first of all?


thts the thing, idk what language he's programming in.
it just says that to compress it you'd need that code, and that's where my question comes in.

i put the link of where i read it from, so maybe thtll help u understand, because i don't get it.
Was This Post Helpful? 0
  • +
  • -

#4 William_Wilson   User is offline

  • lost in compilation
  • member icon

Reputation: 207
  • View blog
  • Posts: 4,812
  • Joined: 23-December 05

Re: writing compression algorithm

Posted 08 February 2009 - 10:38 AM

The algorithm looks like pseudo code thus can be interpreted into any language. Do you know any languages?
Was This Post Helpful? 0
  • +
  • -

#5 ayman_mastermind   User is offline

  • human.setType("geek");
  • member icon

Reputation: 127
  • View blog
  • Posts: 1,860
  • Joined: 12-December 08

Re: writing compression algorithm

Posted 08 February 2009 - 10:43 AM

Quote

QUOTE(ayman_mastermind @ 8 Feb, 2009 - 09:25 AM) *

@begdev, what is your programming language first of all?


thts the thing, idk what language he's programming in.
it just says that to compress it you'd need that code, and that's where my question comes in.

i put the link of where i read it from, so maybe thtll help u understand, because i don't get it.

In the website, the writer is not using a programming language, he is just using pseudo code to show you the theory... once you know the theory, and the way , you will have to apply it in your own programming language ;)
Was This Post Helpful? 0
  • +
  • -

#6 begdev   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 08-February 09

Re: writing compression algorithm

Posted 08 February 2009 - 10:55 AM

ooo. ok then. well that changes a lot. i sorta know java, but i don't know how to apply this in java, and then after i have done that, how do i apply it to a file or the text or something. i guess i have to do a little more research.

what i'm trying to do is have like differnt types of compression except they have to have the same variable just differnt amounts of it, whatever it is. any help there???

(i mentioned it was for school, but answering the question above, isn't giving me the answer. just sayin)
Was This Post Helpful? 0
  • +
  • -

#7 ayman_mastermind   User is offline

  • human.setType("geek");
  • member icon

Reputation: 127
  • View blog
  • Posts: 1,860
  • Joined: 12-December 08

Re: writing compression algorithm

Posted 08 February 2009 - 11:11 AM

well if you know java then check out these links about file compression in java: http://java.sun.com/...ng/compression/
www.acm.org/crossroads/xrds6-3/ovp63.html
http://www.roseindia...ssingFile.shtml
hope this helps, good luck ;)
Was This Post Helpful? 1
  • +
  • -

#8 begdev   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 08-February 09

Re: writing compression algorithm

Posted 08 February 2009 - 11:13 AM

View Postayman_mastermind, on 8 Feb, 2009 - 10:11 AM, said:

well if you know java then check out these links about file compression in java: http://java.sun.com/...ng/compression/
www.acm.org/crossroads/xrds6-3/ovp63.html
http://www.roseindia...ssingFile.shtml
hope this helps, good luck ;)


thank you! those links were pretty helpful, the entire project is due in about a year, i'm just trying to get a good start on it so i'm not scrambling at the last minute. thx again!
Was This Post Helpful? 0
  • +
  • -

#9 ayman_mastermind   User is offline

  • human.setType("geek");
  • member icon

Reputation: 127
  • View blog
  • Posts: 1,860
  • Joined: 12-December 08

Re: writing compression algorithm

Posted 08 February 2009 - 11:26 AM

Your welcome, and good luck in your project ;)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1