Re: A C tutorial
From: nrk (ram_nrk2000_at_devnull.verizon.net)
Date: 02/14/04
- Next message: Jerry Coffin: "Re: No call for Ada (was Re: Announcing new scripting/prototyping language)"
- Previous message: jacob navia: "Bounds checked arrays"
- In reply to: Richard Heathfield: "Re: A C tutorial"
- Next in thread: Mark McIntyre: "Re: A C tutorial"
- Reply: Mark McIntyre: "Re: A C tutorial"
- Reply: Richard Heathfield: "Re: A C tutorial"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 14 Feb 2004 21:35:07 GMT
Richard Heathfield wrote:
> Mark McIntyre wrote:
>
>> On Fri, 13 Feb 2004 19:38:11 +0000 (UTC), in comp.lang.c , Richard
>> Heathfield <dontmail@address.co.uk.invalid> wrote:
>>
>>>Yes, he did, but it's not as if I'm asking him to write a full reader.
>>>Just a simple little word-length histogram program.
>>
>> ??? 1.13 asks me to return the lower case of the program's input, or the
>> input unmodified, should that not be a letter.
>
> Would this be the Mark McIntyre edition of K&R2, then?
>
> K&R2, page 24: "Exercise 1-13. Write a program to print a histogram of the
> lengths of words in its input..."
>
>> but your one (1.12) is just as easy. I'll define a word break as any
>> whitespace character in the input, and off I go.
>
> Ex 1-12 asks you to print one word per line. Okay, so you say it's easy.
> So why not demonstrate that it's easy?
>
>>
>>> If pdf processing is so
>>>easy, he shouldn't find this to be a major challenge.
>>
>> Its not.
>
> Prove it.
>
>
>>
>>>But perhaps he has to
>>>open a file or something, in which case I agree that the restriction
>>>would be a bit harsh.
>>
>> Pipe is your friend. After all, you can't process a text /file/ via the
>> same program without it.
>>
>>>But 1-13 is a different matter.
>>
>> Its certainly a good attempt to change the subject from file readers to
>> something totally different. Nice try.
>
> Excuse me? It's not totally different /at all/. What's the matter - is it
> suddenly hard to process PDF files? I thought you said it wasn't.
>
> But okay, if you /think/ it's different, just show me a cat for PDF.
> Presumably that's easy too, right?
>
Actually, its not all that hard.
system("pdftotext file.pdf");
system("cat file.txt");
Smile. It's supposed to be funny. Seriously though, there is a utility
called pdftotext. It doesn't really do a great job in terms of rendering
readable text from pdf, but for purposes of solving the proposed exercise,
it should be enough to use this and pipe the output through your standard C
solution for text files :-)
-nrk.
-- Remove devnull for email
- Next message: Jerry Coffin: "Re: No call for Ada (was Re: Announcing new scripting/prototyping language)"
- Previous message: jacob navia: "Bounds checked arrays"
- In reply to: Richard Heathfield: "Re: A C tutorial"
- Next in thread: Mark McIntyre: "Re: A C tutorial"
- Reply: Mark McIntyre: "Re: A C tutorial"
- Reply: Richard Heathfield: "Re: A C tutorial"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]