Die Suche ergab 106 Treffer

von AizazZaidee
14. Jul 2018 14:14
Forum: Software Engineering - Design and Construction
Thema: Exam Task Identify Design Pattern
Antworten: 10
Zugriffe: 626

Re: Exam Task Identify Design Pattern

so there's Decorator Pattern
.
Where is that?
von AizazZaidee
14. Jul 2018 14:13
Forum: Software Engineering - Design and Construction
Thema: Exam Task Identify Design Pattern
Antworten: 10
Zugriffe: 626

Re: Exam Task Identify Design Pattern

If I remember correctly professor said there will be one more design pattern than the points so to help students if someone miss one design pattern.so it's 14 points then should be 15 design patterns !!!
von AizazZaidee
14. Jul 2018 14:08
Forum: Software Engineering - Design and Construction
Thema: Exam Question: Visitor vs. Pattern Matching
Antworten: 1
Zugriffe: 258

Exam Question: Visitor vs. Pattern Matching

In Scala, pattern matching can be used to more elegantly model simple visitor patterns. In this task you are supposed to transform a given example from a visitor pattern to using pattern matching. The following code example shows evaluation and printing of simple arithmetic expressions using a visit...
von AizazZaidee
14. Jul 2018 13:00
Forum: Software Engineering - Design and Construction
Thema: Exam Task Identify Design Pattern
Antworten: 10
Zugriffe: 626

Exam Task Identify Design Pattern

trait Statement { var errorListeners = Set.empty[(Statement) => Unit] def registerErrorListener(f: (Statement) => Unit) = {errorListeners += f} def fireInterpretationError(stat: Statement) = {errorListeners foreach( f => f(stat))} def interpret(env: Map[Symbol , Int]): Statement def accept(visitor:...
von AizazZaidee
14. Jul 2018 08:56
Forum: Software Engineering - Design and Construction
Thema: Mid-Term Exam WS 15/16 Task 1d)
Antworten: 5
Zugriffe: 805

Re: Mid-Term Exam WS 15/16 Task 1d)

They all are working, I tried in side scala Worksheet. :? :shock: :shock:

full size image => https://ibb.co/dxG5p8
von AizazZaidee
12. Jul 2018 19:24
Forum: Software Engineering - Design and Construction
Thema: .
Antworten: 2
Zugriffe: 224

Re: .

I don't have rights to do so :-/
von AizazZaidee
12. Jul 2018 17:56
Forum: Software Engineering - Design and Construction
Thema: Signal[List[Int],rescala.parrp.ParRP] to List[Int] How?
Antworten: 7
Zugriffe: 317

Re: Signal[List[Int],rescala.parrp.ParRP] to List[Int] How?

I think s1.sum() is enough, I have tried it with latest API, I think documentation and slides are not updated.
von AizazZaidee
12. Jul 2018 17:43
Forum: Software Engineering - Design and Construction
Thema: Exam WS 15/16 - Question 2 - c)
Antworten: 3
Zugriffe: 193

Re: Exam WS 15/16 - Question 2 - c)

I would have said like this but I don't know which is correct.
feature : Mixins
Consequence: Static binding
von AizazZaidee
12. Jul 2018 16:04
Forum: Software Engineering - Design and Construction
Thema: Unable to understand exam question Path dependent types
Antworten: 3
Zugriffe: 191

Re: Unable to understand exam question Path dependent types

Thanks, I tried the code but didn't compiled I thought Intellij will do so automatically but that is not the case. (but not in case of runtime exceptions, I get it thanks)
von AizazZaidee
12. Jul 2018 15:22
Forum: Software Engineering - Design and Construction
Thema: Unable to understand exam question Path dependent types
Antworten: 3
Zugriffe: 191

Unable to understand exam question Path dependent types

Look at the following code example. The lines that start with [ ] contain definitions that might or might not type-check. Please mark every line that type-checks with a ÿ and every line that does not type-check with an x. case class Board(length: Int, height: Int) { case class Coordinate(x: Int, y: ...
von AizazZaidee
12. Jul 2018 12:13
Forum: Software Engineering - Design and Construction
Thema: Signal[List[Int],rescala.parrp.ParRP] to List[Int] How?
Antworten: 7
Zugriffe: 317

Re: Signal[List[Int],rescala.parrp.ParRP] to List[Int] How?

Yeah I know the only problem here is Scala. Well suppose I have following val event1 = Evt[Int]() val signal1 = event1.last(10) How can I can get of all the values in signal1? val event1 = Evt[Int]() val signal1 = event1.last(10) val sum = signal1.change.map(diff => diff.pair match { case // Signal[...
von AizazZaidee
12. Jul 2018 11:41
Forum: Software Engineering - Design and Construction
Thema: Signal[List[Int],rescala.parrp.ParRP] to List[Int] How?
Antworten: 7
Zugriffe: 317

Re: Signal[List[Int],rescala.parrp.ParRP] to List[Int] How?

Yeah I guess I am doing something wrong, I am trying to sum all the values of the Signal/Event. I am not sure how to do it.
von AizazZaidee
12. Jul 2018 11:23
Forum: Software Engineering - Design and Construction
Thema: Signal[List[Int],rescala.parrp.ParRP] to List[Int] How?
Antworten: 7
Zugriffe: 317

Signal[List[Int],rescala.parrp.ParRP] to List[Int] How?

How can I convert rescala.reactives.Signal[List[Int],rescala.parrp.ParRP] to List[Int] import rescala.Evt val event = Evt[Int]() event(10) event(10) event(10) val f = (x: Int, y: Int) => (x + y) val signal = event.list().map{ matcher => matcher match { case _ => print(f) //not working } }
von AizazZaidee
11. Jul 2018 14:10
Forum: Software Engineering - Design and Construction
Thema: Linearization Steps - Query Related to Exam Solution Method
Antworten: 15
Zugriffe: 610

Linearization Steps - Query Related to Exam Solution Method

trait A class B trait C extends B with A trait D extends B trait E extends D with A with C class F extends D with E Linearization of Class F: (F, E, C, A, D, B, AnyRef, Any) Any <- AnyRef <- B <- D <- A <- C <- E <- F and super call stack will be: F-> E -> C-> A -> D -> B -> D -> A -> C -> E - F Is ...
von AizazZaidee
11. Jul 2018 13:31
Forum: Software Engineering - Design and Construction
Thema: ex04: anyone remember why OCP is violated in this exercise?
Antworten: 4
Zugriffe: 289

Re: ex04: anyone remember why OCP is violated in this exercise?

Because you have to put instanceOf checks as some classes are overriding this method and some are not. (if you have to differentiate b/w which are overriding and which are not not.) it maybe a violation but not necessarily.

Zur erweiterten Suche