No more Blub for me, thank you, Vicar.
SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
Joe Harry wrote:Isn't Week4 supposed to be about Collections as per the Syllabus below?
https://www.coursera.org/course/progfun
The Week4 video lectures says that it is about Types and Pattern matching. I'm a bit surprised about this.
No more Blub for me, thank you, Vicar.
No more Blub for me, thank you, Vicar.
SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
Matthew Brown wrote:Got the decoding working, though I did resort to decoding it manually as a debugging aid! The encoding can wait .
Checks whether the list `trees` contains only one single code tree
SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
Joe Harry wrote:What is meant by Singleton? I do not get this comment on the singleton method.
No more Blub for me, thank you, Vicar.
SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
Matthew Brown wrote:This line
evaluates to
Note that isn't creating a List of Tuples. It's creating a list containing two items. One is a Char, the second is an Int, but it's probably inferring List[Int] (because Char can be automatically converted to an Int).
No more Blub for me, thank you, Vicar.
SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
Joe Harry wrote:Did you guys had to sort anything for the combine implementation?
I tried to sort my resulting List using the sortWith method as below:
But seems like the sorting won't happen!
* The parameter `trees` of this function is a list of code trees ordered by ascending weights.
No more Blub for me, thank you, Vicar.
Matthew Brown wrote:I sorted it using sortBy() because it was easy, but after sleeping on it realised that it's not necessary, as Chris says, so I'm planning to change it when I'm next working on it.
This node is then added back into the remaining elements of `trees` at a position such that the ordering by weights is preserved.
SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
Matthew Brown wrote:May be a silly question, but you are remembering to use the return value of sortWith, aren't you, because the list you call it on is unaffected?
Joe Harry wrote:Mine fails even though I do a sortWith by passing the head and tail as I've mentioned in my post above!
No more Blub for me, thank you, Vicar.
Matthew Brown wrote:What I mean is - List is immutable. The method returns a new List with the required order. If that's where you're going wrong, it's the equivalent mistake to:
SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
Matthew Brown wrote:Since you're only supposed to call combine() with a list already sorted by weight, I don't think the behaviour is defined. My implementation would produce the second of those.
SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
Joe Harry wrote:I still have untill, createCodeTree and decodedSecret pending. Could you guys throw some light on untill and decodedSecret?
SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
Wen Tong Lin wrote:HI everyone,
I was wondering if you guys use recursion, pattern matching in implementing times() method? Because my solution is (again) very imperative.
SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
Wen Tong Lin wrote:HI everyone,
I was wondering if you guys use recursion, pattern matching in implementing times() method? Because my solution is (again) very imperative.
No more Blub for me, thank you, Vicar.
Don't get me started about those stupid light bulbs. |