Deron Fuller

Greenhorn
+ Follow
since Mar 03, 2009
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Deron Fuller

I believe the difference is that Traits allow you to define abstract members as well as full method definitions.

I've only recently begun to learn scala but I think this link is a good summation of scala's abstract classes and traits from a java programmers point of view.

http://www.codecommit.com/blog/scala/scala-for-java-refugees-part-5

14 years ago
***SOLVED***

The problem was, I was a good little soldier and installed Scala via apt-get. However, as of the date of this post, the current version in the Ubuntu/Debian repositories isn't the most recent stable release. It's 2.7.3 and the latest version from the Scala site is 2.7.6. I uninstalled Scala and downloaded the latest tarball from Scala and installed it. Interpreter works as expected now.

Make sure you link or set the path for 'scala' and 'scalac'
14 years ago
I'm usually pretty good at searching and finding answers but I couldn't come up with anything on this one. My Scala interpreter works fine except if I want to repeat a command. When I use the up-arrow key, I get an escape character. My operating system is Ubuntu 9.04 and I usually use bash for my terminal but I've also tried this with xterm and get the same results.

Any clues as where I might look.

Thanks in advance.

~deron
14 years ago
I figured out my problem. I get lazy with variable declaration and I simply made my Map static and it returned correctly. I think some experienced java programmers might frown on that because of the extra memory allotted but it worked for me.

15 years ago
What I had tried to add to build the Map was an alternate of the genCode() method I have above and add the 2 methods to access it. It compiled but passes an empty map. I know I'm having a problem initializing and saving the map correctly but I'm a little lost as to where. This also touches on the idea of searching the tree. I can search a tree that's sorted on values but this is created using a priority queue which sorts by frequency which makes it a little harder for me to figure out a good way to search it and return the value but that won't matter if I can simply pass back an array or map of the characters and their codes.

15 years ago
I've done lots of research and reading on these forums and have found helpful advice but this is the first time I've needed to post for help. We'll add this to the hordes of questions on Huffman programs. I have a class that successfully builds a Huffman tree and generates the code. What I'm having trouble with is returning an Array or a Map of those codes. Almost all of the examples I've seen are about printing the codes which I can do successfully but what would help me, is how to build a map of the codes and return them. I'm sure I'm missing something simple but this has me at my wits end. I'll post what I have now. I have tried to create an ArrayList and a TreeMap and insert the values of the character and code but when I return them I get empty data.

If it matters this is for an assignment but I've done what I think is the hard part I feel like I'm stuck on something very simple.

Any help would be appreciated.

15 years ago