# This Newbie Wants To Know

**URL:** <https://www.ruby-forum.com/t/this-newbie-wants-to-know/124931>\
**Category:** Rails\
**Created:** [January 3, 2008, 8:39pm UTC](https://www.ruby-forum.com/t/this-newbie-wants-to-know/124931 "2008-01-03T20:39:52Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![trucker](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ecae2f/32.png) [@trucker](https://www.ruby-forum.com/u/trucker)\
**Post date:** [January 3, 2008, 8:39pm UTC](https://www.ruby-forum.com/t/this-newbie-wants-to-know/124931/1 "2008-01-03T20:39:52Z")

</div>

Hi All:

I’m a Reading Instructor who just discovered Ruby on Rails. I would like  
to know if it is possible to design a prog in Ruby on Rails that would  
be able to count the number of words contained in a text document,  
determine how long it takes for a student to read the entire document  
and then give the student her/his WPM (Word Per Minute Rate)?

If this is possible – where should I start. I am just learning so I  
don’t have a clue. Any help or suggestions would be greatly appreciated.

Thanks.

---

<div class="post-metadata">

**Author:** ![trucker](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ecae2f/32.png) [@trucker](https://www.ruby-forum.com/u/trucker)\
**Post date:** [January 3, 2008, 8:52pm UTC](https://www.ruby-forum.com/t/this-newbie-wants-to-know/124931/2 "2008-01-03T20:52:14Z")

</div>

> I’m a Reading Instructor who just discovered Ruby on Rails. I would like  
> to know if it is possible to design a prog in Ruby on Rails that would  
> be able to count the number of words contained in a text document,  
> determine how long it takes for a student to read the entire document  
> and then give the student her/his WPM (Word Per Minute Rate)?
> 
> If this is possible – where should I start. I am just learning so I  
> don’t have a clue. Any help or suggestions would be greatly appreciated.

If the student was willing to click a “I’ve started reading” button and  
a  
“I’ve finished reading” button then you could use javascript to figure  
out  
the time it took.

Rails can certainly count the words in the document, but so could every  
other language out there. That is to say, you don’t _need_ rails to do  
this, but yeah, you could do it.

---

<div class="post-metadata">

**Author:** ![trucker](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ecae2f/32.png) [@trucker](https://www.ruby-forum.com/u/trucker)\
**Post date:** [January 3, 2008, 8:53pm UTC](https://www.ruby-forum.com/t/this-newbie-wants-to-know/124931/3 "2008-01-03T20:53:25Z")

</div>

Howdy William,  
Are you talking about a plain text document (i.e., not Micrsoft Word  
but one that’s posted to a website in plain text)?

You could easily do something like this. You could do the word count  
using the information here:

> **[O'Reilly Media - Technology and Business Training](https://www.oreilly.com/)**
>
> Gain technology and business knowledge and hone your skills with learning resources created and curated by O'Reilly's experts: live online training, video, books, our platform has content from 200+ of the world's best publishers.

You could then use JavaScript to see how long it takes a student to  
read the document and press a button.

To start I’d suggest getting a book on Rails. My site has a  
bibliography of books on it ([http://blog.mrneighborly.com/](http://blog.mrneighborly.com/)) that  
should get you started. 🙂

–Jeremy

On Jan 3, 2008 2:39 PM, William M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> don’t have a clue. Any help or suggestions would be greatly appreciated.
> 
> ## Thanks.
> 
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).
> 
> >

–  
[http://www.jeremymcanally.com/](http://www.jeremymcanally.com/)

My books:  
Ruby in Practice

> **[Ruby in Practice](https://www.manning.com/books/ruby-in-practice)**
>
> Like Ruby itself, Ruby in Practice will make you more productive. The book shows you practical techniques and strategies for small projects and large-scale environments. A cookbook-style reference, it gives you concrete examples of systems...

My free Ruby e-book

> **[Site not found · DreamHost](http://www.humblelittlerubybook.com/)**
>
> The owner of this domain has not yet uploaded their website.

My blogs:

> **[Site not found · DreamHost](http://www.mrneighborly.com/)**
>
> The owner of this domain has not yet uploaded their website.

[http://www.rubyinpractice.com/](http://www.rubyinpractice.com/)

---

<div class="post-metadata">

**Author:** ![trucker](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ecae2f/32.png) [@trucker](https://www.ruby-forum.com/u/trucker)\
**Post date:** [January 3, 2008, 9:09pm UTC](https://www.ruby-forum.com/t/this-newbie-wants-to-know/124931/4 "2008-01-03T21:09:51Z")

</div>

Hi Jeremy:

Thank you so much for your input and sharing your resources. I will get  
started with using them.

BTW can you tell me how the command line would look to make this happen?

Thanks again.

Jeremy McAnally wrote:

> Howdy William,  
> Are you talking about a plain text document (i.e., not Micrsoft Word  
> but one that’s posted to a website in plain text)?
> 
> You could easily do something like this. You could do the word count  
> using the information here:  
> [O'Reilly Media - Technology and Business Training](http://safari.oreilly.com/9781593271480/Inumber_symble_12_counting_words_in_a_file_word_co)
> 
> You could then use JavaScript to see how long it takes a student to  
> read the document and press a button.
> 
> To start I’d suggest getting a book on Rails. My site has a  
> bibliography of books on it ([http://blog.mrneighborly.com/](http://blog.mrneighborly.com/)) that  
> should get you started. 🙂
> 
> –Jeremy
> 
> On Jan 3, 2008 2:39 PM, William M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> wrote:
> 
> > don’t have a clue. Any help or suggestions would be greatly appreciated.
> > 
> > ## Thanks.
> > 
> > Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).
> > 
> > >
> 
> –  
> [http://www.jeremymcanally.com/](http://www.jeremymcanally.com/)
> 
> My books:  
> Ruby in Practice  
> [Ruby in Practice](http://www.manning.com/mcanally/)
> 
> My free Ruby e-book  
> [http://www.humblelittlerubybook.com/](http://www.humblelittlerubybook.com/)
> 
> My blogs:  
> [http://www.mrneighborly.com/](http://www.mrneighborly.com/)  
> [http://www.rubyinpractice.com/](http://www.rubyinpractice.com/)

---

<div class="post-metadata">

**Author:** ![trucker](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ecae2f/32.png) [@trucker](https://www.ruby-forum.com/u/trucker)\
**Post date:** [January 3, 2008, 9:06pm UTC](https://www.ruby-forum.com/t/this-newbie-wants-to-know/124931/5 "2008-01-03T21:06:42Z")

</div>

Hi Philip:

Thanks a lot for your reply. I am interested in learning how to prog in  
Rails and would like to what I need to do to make it happen. Can you  
tell me what the commands would be to make it happen.

Thanks.

Philip H. wrote:

> > I’m a Reading Instructor who just discovered Ruby on Rails. I would like  
> > to know if it is possible to design a prog in Ruby on Rails that would  
> > be able to count the number of words contained in a text document,  
> > determine how long it takes for a student to read the entire document  
> > and then give the student her/his WPM (Word Per Minute Rate)?
> > 
> > If this is possible – where should I start. I am just learning so I  
> > don’t have a clue. Any help or suggestions would be greatly appreciated.
> 
> If the student was willing to click a “I’ve started reading” button and  
> a  
> “I’ve finished reading” button then you could use javascript to figure  
> out  
> the time it took.
> 
> Rails can certainly count the words in the document, but so could every  
> other language out there. That is to say, you don’t _need_ rails to do  
> this, but yeah, you could do it.

---

<div class="post-metadata">

**Author:** ![trucker](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ecae2f/32.png) [@trucker](https://www.ruby-forum.com/u/trucker)\
**Post date:** [January 20, 2008, 10:36am UTC](https://www.ruby-forum.com/t/this-newbie-wants-to-know/124931/6 "2008-01-20T10:36:26Z")

</div>

On Thu, 03 Jan 2008 20:39:52 +0100, William M. wrote:

> I’m a Reading Instructor who just discovered Ruby on Rails. I would like  
> to know if it is possible to design a prog in Ruby on Rails that would  
> be able to count the number of words contained in a text document,

thufir@arrakis ~/foo $  
thufir@arrakis ~/foo $ cat foo  
I’m a Reading Instructor who just discovered Ruby on Rails. I would like  
to know if it is possible to design a prog in Ruby on Rails that would  
be able to count the number of words contained in a text document,  
thufir@arrakis ~/foo $  
thufir@arrakis ~/foo $  
thufir@arrakis ~/foo $ wc foo  
3 42 211 foo  
thufir@arrakis ~/foo $

wc (word count) is built into linux and will do that 🙂

newlines: 3  
words: 42  
bytes: 211

-Thufir

---

<div class="post-metadata">

**Author:** ![trucker](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ecae2f/32.png) [@trucker](https://www.ruby-forum.com/u/trucker)\
**Post date:** [January 20, 2008, 10:41am UTC](https://www.ruby-forum.com/t/this-newbie-wants-to-know/124931/7 "2008-01-20T10:41:44Z")

</div>

On Thu, 03 Jan 2008 21:06:42 +0100, William M. wrote:

> Thanks a lot for your reply. I am interested in learning how to prog in  
> Rails and would like to what I need to do to make it happen. Can you  
> tell me what the commands would be to make it happen.

I think that once you get a rails app which up and running, which has  
files to click on for the student, that adding the clock, word count and  
other features will be child’s play.

There will be a steep learning curve to get to that point, though.  
However, go for it!

There are multiple threads here discussing the various merits of this or  
that book, but keep in mind that this is a great list for support.  
Also,  
there’s an IRC list which is quite helpful.

-Thufir

---

<div class="post-metadata">

**Author:** ![trucker](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ecae2f/32.png) [@trucker](https://www.ruby-forum.com/u/trucker)\
**Post date:** [January 20, 2008, 1:32pm UTC](https://www.ruby-forum.com/t/this-newbie-wants-to-know/124931/8 "2008-01-20T13:32:11Z")

</div>

You really don’t need Rails for this task although its true you could  
make it in Rails if you want. As some other people said, you can do this  
using HTML and Javascript alone unless I am missing a requirement.

You could either learn Rails (or just Javascript) on your own or you  
could just find someone technically savvy to do it for you. Based on  
your description making this would only take me about a couple of hours  
and I am sure it would be the same for any other novice-intermediate  
programmer.

If you are going to go the simple HTML + Javascript route, start by  
learning HTML since it is so easy even for a total novice. Once you have  
laid out the page in HTML (setting up how you want it to look visually),  
learning the javascript to have word counts and timing reading (with a  
start/finished button) shouldn’t be too hard.

It almost seems like this would be overkill for using Rails unless you  
need to store results or collect some sort of data / graph / visualize  
data in which it might make more sense.

Either way, good luck.
