Web compress

Discuss about the puzzles, but without giving the solutions please !!!

Web compress

Postby admin » Sun May 01, 2011 7:01 pm

The purpose of this puzzle is to write a simple data compression to compress specific type of data: code programs and English text (for the comments).


User avatar
admin
Site Admin
 
Posts: 333
Joined: Thu Dec 23, 2010 1:27 am

Re: Web compress

Postby jodoherty » Mon May 02, 2011 7:02 am

The problem mentions that "the compressed data must only contain he characters for newline (\n, \r), tab (\t) and the ASCII characters from 32 to 126 (inclusive)", but what about the data to be compressed? What character encoding will be used? Will it also be limited to a subset of characters like the output?
User avatar
jodoherty
 
Posts: 4
Joined: Tue Jan 18, 2011 6:12 am

Re: Web compress

Postby admin » Mon May 02, 2011 9:13 am

The input data is also limited to the set of ASCII characters specified.
User avatar
admin
Site Admin
 
Posts: 333
Joined: Thu Dec 23, 2010 1:27 am

Re: Web compress

Postby avD.ZeeK » Sun May 22, 2011 10:55 am

The data to compress or decompress is passed to the standard input (stdin).


I am confused here, the input data will also contain '\n' when the testcase has another line. How do I determine the end of input data?..
Please help me here

ZeeK
User avatar
avD.ZeeK
 
Posts: 5
Joined: Fri May 20, 2011 6:04 pm

Re: Web compress

Postby admin » Mon May 23, 2011 5:30 am

When you read all the data from standard input, you will get an EOF (End Of File) which can be tested in different ways depending on the languages (feof for example, or in python, you could just call read() which would read everything, etc...).

If you a language specific question about detecting an EOF, please ask it in the language forums.

Good luck
User avatar
admin
Site Admin
 
Posts: 333
Joined: Thu Dec 23, 2010 1:27 am

Re: Web compress

Postby Wayne Colvin » Tue Aug 09, 2011 1:36 pm

I can't submit a shell script? Arghhhhhh
Oh well.
User avatar
Wayne Colvin
 
Posts: 5
Joined: Thu Jan 20, 2011 6:20 pm

Re: Web compress

Postby David Berthelot » Wed Aug 10, 2011 10:40 pm

No but most shell scripts commands are available in Perl/Ruby/Python/PHP extension modules...
User avatar
David Berthelot
 
Posts: 43
Joined: Sun Jan 16, 2011 5:06 pm


Return to Puzzles

Who is online

Users browsing this forum: No registered users and 0 guests

cron