Welcome to the Treehouse Community
Looking to learn something new?
Forum Contest: Reading and Displaying Data (Part 1)
This time around we have a two part Forum Contest! One part for the developer, and the other for the designer.
After you've watched the video, please read the details below carefully. We're looking forward to your entries!
Download a copy Ralph Waldo Emerson’s Essays, First Series in text format
Programmatically read and analyze the text, we only want words.
Eliminate some of the most used words in the english language by using this list
Count the occurrence of each word across the entire document
Output to the screen in a readable fashion
- total word count after filtering
- highest occurring word
- longest word(s) and its / their length
- sort the list from most occurring to least occurring then output that data to the screen as an unordered list
How to Enter:
Post your code to a public gist on github
Paste the url of the gist below this post.
All entries must be submitted by April 6th at 11:45pm ET. Here's a timezone chart so you can see what time that is for your locale.
The entries will be judged by Treehouse teachers based on both code quality and best overall data set. One winner will receive a free month of Treehouse Gold on us! :) We'll announce the winner on April 7th and reveal the next contest.
Eventually we will want to make this data JSON This way we can give the findings over to next week's contest participants to analyze and display.
Good Luck, and Have Fun!
I'll give it a shot with Objective-C.
bring it on. its going to be fun , #thumbs up
Stephen Mariano Cabrera5,932 Points
For the purposes of judging does it matter what language we use?
Mohamad El-Husseini278 Points
Here is my Ruby solution. This is the same gist broken down by URL for ease of access:
And the program output: https://gist.github.com/abitdodgy/e3201365dd8328efbfd3#file-output-txt
One thing: For some odd reason the gist is eating my JSON, but I assure you the JSON is there. Running the program should output it.
Will we be penalised for code organisation? For example, I can split the classes into separate files, but for the sake of convenience, I'm keeping everything in the same file.
Mohamad El-Husseini - "Will we be penalised for code organisation?" Oh totally. That's Huge.... Seriously though, this is not an issue at all. It is way easier for this to keep it all in a single script. Looks good.
Jonathan Petersen45,548 Points
Here is my Java version. Uses the treehouse hosted text files, and outputs JSON after the Stats. It is about as organized as I can get it with a single class. -> https://gist.github.com/jpete/9967105
By the way you have to click view raw to see the JSON output. It is all there. Here is the link to the raw post -> https://gist.githubusercontent.com/jpete/9967105/raw/98e718bea077ed3232a3c386b788b2ebfe54246f/TthParseReport+-+Output
Patrick Leary2,812 Points
Oleg Drobin2,867 Points
Here is my implementation:
I'm displaying the JSON in my html file.
Congrats to Oleg Drobin who is our winner for this weeks forum contest!
This data will be used in this weeks contest which will be posted soon.
I would like Oleg to please take the time to go back and comment his code so that other students may learn from what he has done.
Please post that as another gist, as a comment to this answer.
Great work everyone! There were so many awesome submissions with such a great range of languages.