Die Suche ergab 34 Treffer

von m.hosseinian
9. Jul 2015 11:54
Forum: Archiv
Thema: Visitor Pattern
Antworten: 5
Zugriffe: 690

Re: Visitor Pattern

have you studied the second part of Inheritance slide series? (which is not discussed on the lecture!)
von m.hosseinian
8. Jul 2015 19:23
Forum: Archiv
Thema: Late Binding - Decorator Pattern
Antworten: 2
Zugriffe: 373

Re: Late Binding - Decorator Pattern

Here is my solution: trait Account { val accType: String def getType: String = accType + " Account" def printHistory: String = getType + ": History of " + getType + " transactions" } class CheckingAccount extends Account { val accType: String = "Checking" } class SavingAccount extends Account { val ...
von m.hosseinian
7. Jul 2015 14:32
Forum: Archiv
Thema: July 16th
Antworten: 3
Zugriffe: 423

July 16th

Hello, Could you clarify what is going to be discussed on 16th of July, the lecture session? If there will be new topic(s) to be discussed, could you please upload the material earlier? (Like along with the material of this week's session) This session is so close to the exam date, so preparing the ...
von m.hosseinian
5. Jul 2015 13:53
Forum: Archiv
Thema: Closures.
Antworten: 4
Zugriffe: 512

Re: Closures.

1. The 1st is same as you have pointed out. The closure can access any local variable. 2. The 2nd is that in case of Java 7 anonymous functions, you have to know the name of the method of anonymous class that you will calling from the other method/class (where we want to use it) Whereas in Scala cl...
von m.hosseinian
5. Jul 2015 12:20
Forum: Archiv
Thema: Closures.
Antworten: 4
Zugriffe: 512

Re: Closures.

Besides the syntactic sugar the closures carry over anonymous classes, the only technical difference I see is modifying mutable variables. this code snippet tells the best: object Closure extends App { var i = 0 def inc() = { def incImpl(): Int = { i = i + 1; i } incImpl() } println(inc) //> 1 print...
von m.hosseinian
3. Jul 2015 12:53
Forum: Archiv
Thema: Last year's trial Exam, Strategy pattern: SortableCollection
Antworten: 1
Zugriffe: 641

Last year's trial Exam, Strategy pattern: SortableCollection

Hi, I was solving last year's trial exam question about strategy pattern for SortableCollection. The question says that we have to scratch a "trait" for this capability, also the sort function should return a new collection object. Applying the strategy pattern, I came up with the design below: Unti...
von m.hosseinian
26. Jun 2015 09:47
Forum: Archiv
Thema: Mistake in 5-RP2
Antworten: 0
Zugriffe: 380

Mistake in 5-RP2

Hi,

Comparing what is said for Iterate function on the slides with that of official documentation of REScala: "REScala/blob/master/doc/manual/manual.pdf", you can find some inconsistencies. I guess the official version makes more sense, however.

BR,
Moe
von m.hosseinian
15. Jun 2015 19:18
Forum: Archiv
Thema: Stopwatch Panel not correctly redrawn.
Antworten: 5
Zugriffe: 679

Re: Stopwatch Panel not correctly redrawn.

And why moving the repaint outside to the top isn't a good practice. The repaint method should be called in the correct context. If you move it from the Panel to the MainFrame, the whole Panel is repainted even if you just want to repaint one Panel within the MainFrame. This is actually no problem ...
von m.hosseinian
15. Jun 2015 14:35
Forum: Archiv
Thema: Stopwatch Panel not correctly redrawn.
Antworten: 5
Zugriffe: 679

Re: Stopwatch Panel not correctly redrawn.

Hi all, here is how to solve the problem. You have to add a call in the paintComponent method to the paintComponent method of the super class. override def paintComponent(g: Graphics2D) { super.paintComponent(g) // <-- add this call to the method .... } regards, Michael Thanks Michael, it works pre...
von m.hosseinian
13. Jun 2015 23:59
Forum: Archiv
Thema: REScala Signal
Antworten: 3
Zugriffe: 377

Re: REScala Signal

Hello All, In the following (boldfaced) line I am getting compilation error. The file has the import statement: import rescala._ val v = Var(1) val newSig = Signal{ v() + 1 } The error says - Not found: value Signal Can anyone tell me the reason of this problem? Thanks! Hi, does your project point ...
von m.hosseinian
13. Jun 2015 23:47
Forum: Archiv
Thema: Stopwatch Panel not correctly redrawn.
Antworten: 5
Zugriffe: 679

Re: Stopwatch Panel not correctly redrawn.

Hi all, just a heads up if someone else encounters the problem that the panel contents are not cleared before they are redrawn and neither the red button flashes nor the time is displayed correctly. Moving the following: ticks += { _: Unit => repaint() } out of the declaration of contents and into ...
von m.hosseinian
13. Jun 2015 12:11
Forum: Archiv
Thema: Mid-term exam, question 3-b (super call in Scala vs. Java )
Antworten: 1
Zugriffe: 639

Mid-term exam, question 3-b (super call in Scala vs. Java )

Hello,

Since the answer to this question didn't get brought up in the session that results were discussed, could you please let us know about the correct answer?

Best regards,
Moe
von m.hosseinian
29. Mai 2015 17:59
Forum: Archiv
Thema: Mid-Term exam results
Antworten: 1
Zugriffe: 672

Re: Mid-Term exam results

Hi,

"The question about "How you will get your personal exam points?", we will announce later."

When will this "later" be, approximately?

Cheers,
Moe
von m.hosseinian
11. Mai 2015 21:52
Forum: Archiv
Thema: Utils object in the code template
Antworten: 2
Zugriffe: 447

Re: Utils object in the code template

Hi Mohammad, "see the Utils object in the code template for a helper method" this actually refers to Utils.java that comes with the exercise code template under src/main/java/ex02/common/. There some handy helper methods are defined. Regards, Lukas Owh! Sorry for silly question :-p... By the way, t...
von m.hosseinian
11. Mai 2015 21:06
Forum: Archiv
Thema: Utils object in the code template
Antworten: 2
Zugriffe: 447

Utils object in the code template

Hello,

There are several points in the exercise sheet that tell us:
"see the Utils object in the code template for a helper method"

Actually I have no experience working with SWING/Java AWT therefore, I am not sure where to look at, can you help me a little bit on that?

Regards,
Mohammad

Zur erweiterten Suche