Search Results

Search found 3 results on 1 pages for 'palimondo'.

Page 1/1 | 1 

  • Cost of using repeated parameters

    - by Palimondo
    I consider refactoring few method signatures that currently take parameter of type List or Set of concrete classes --List[Foo]-- to use repeated parameters instead: Foo*. This would allow me to use the same method name and overload it based on the parameter type. This was not possible using List or Set, because List[Foo] and List[Bar] have same type after erasure: List[Object]. In my case the refactored methods work fine with scala.Seq[Foo] that results from the repeated parameter. I would have to change all the invocations and add a sequence argument type annotation to all collection parameters: baz.doStuffWith(foos:_*). Given that switching from collection parameter to repeated parameter is semantically equivalent, does this change have some performance impact that I should be aware of? Is the answer same for scala 2.7._ and 2.8?

    Read the article

  • The cost of nested methods

    - by Palimondo
    In Scala one might define methods inside other methods. This limits their scope of use to inside of definition block. I use them to improve readability of code that uses several higher-order functions. In contrast to anonymous function literals, this allows me to give them meaningful names before passing them on. For example: class AggregatedPerson extends HashSet[PersonRecord] { def mostFrequentName: String = { type NameCount = (String, Int) def moreFirst(a: NameCount, b: NameCount) = a._2 > b._2 def countOccurrences(nameGroup: (String, List[PersonRecord])) = (nameGroup._1, nameGroup._2.size) iterator.toList.groupBy(_.fullName). map(countOccurrences).iterator.toList. sortWith(moreFirst).head._1 } } Is there any runtime cost because of the nested method definition I should be aware of? Does the answer differ for closures?

    Read the article

  • Publishing artifacts with sources on archiva

    - by Palimondo
    At work I'm dipping my toes in managing project dependencies with maven. We use Apache Archiva (1.2.1) as a local repository and proxy. I'm adding artifact for open source project, that is not published on any public repository. I've learned that to publish the sources I should use the Classifier field on Upload artifact page. The sources are then listed alongside the jar and pom when I browse the repository. But when I update my maven dependencies I get only the jar and pom from the repository. I noticed that sources are also missing when the archiva proxies for me the downloads from other public repositories. I didn't find any configuration options in Archiva's admin pages to serve the sources... What am I missing? Update: I was missing the fact that artifact sources have to be downloaded manually. I.e. the maven client has to request them, which is controlled by command line option -DdownloadSources=true. Maven Integration for Eclipse has a preference setting to always download them as described in Resolving artifact sources. Archiva then serves the sources for local artifacts or proxies the request to remote repositories and caches the sources for future requests.

    Read the article

1