code stringlengths 5 1M | repo_name stringlengths 5 109 | path stringlengths 6 208 | language stringclasses 1
value | license stringclasses 15
values | size int64 5 1M |
|---|---|---|---|---|---|
package sbt
package plugins
import sbt.librarymanagement.{ Configuration, Configurations }
import Def.Setting
/** A plugin representing the ability to build a JVM project.
*
* Core tasks/keys:
* - `run`
* - `test`
* - `compile`
* - `fullClasspath`
* Core configurations
* - `Test`
* - `Compile`
*/
o... | dansanduleac/sbt | main/src/main/scala/sbt/plugins/JvmPlugin.scala | Scala | bsd-3-clause | 1,016 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | MLnick/spark | sql/core/src/main/scala/org/apache/spark/sql/streaming/DataStreamWriter.scala | Scala | apache-2.0 | 13,567 |
class SCL5869(private[this] var param:Int) {
def <ref>param():Int = this.param
def param_= (param:Int) {this.param = param}
} | katejim/intellij-scala | testdata/resolve/failed/scope/SCL5869.scala | Scala | apache-2.0 | 129 |
/**
* Copyright 2015, deepsense.io
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed ... | deepsense-io/seahorse-workflow-executor | deeplang/src/test/scala/io/deepsense/deeplang/doperables/EvaluatorSpec.scala | Scala | apache-2.0 | 1,736 |
/*
Copyright (c) 2012, The Children's Hospital of Philadelphia All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of cond... | chop-dbhi/dataexpress | src/main/scala/edu/chop/cbmi/dataExpress/dataWriters/sql/SqlTableWriter.scala | Scala | bsd-2-clause | 5,553 |
package net.stsmedia.akka.http.models
import reactivemongo.bson.{BSONDocument, BSONDocumentReader, BSONDocumentWriter, BSONObjectID}
import spray.json._
/**
* Created by sschmidt on 14/11/14.
*/
case class User(id: BSONObjectID, name: String)
object User extends DefaultJsonProtocol {
implicit object UserReader e... | stsmedia/akka-http-server | src/main/scala/net/stsmedia/akka/http/models/User.scala | Scala | mit | 999 |
package io.udash.demos.jquery.views.functions
import io.udash.demos.jquery.views.FunctionView
import io.udash.wrappers.jquery._
import scalatags.JsDom.tags2
/** Based on examples from: <a href="http://api.jquery.com/add/">jQuery Docs</a>. */
object AddView extends FunctionView {
import scalatags.JsDom.all._
ove... | UdashFramework/scala-js-jquery | example/src/main/scala/io/udash/demos/jquery/views/functions/AddView.scala | Scala | apache-2.0 | 1,044 |
/*
* Copyright 2001-2013 Artima, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agre... | svn2github/scalatest | src/main/scala/org/scalatest/words/HaveWord.scala | Scala | apache-2.0 | 7,653 |
package com.seanshubin.scala.training.sample.data
import com.seanshubin.scala.training.core.Item
trait ItemFormatter {
def format(item: Item): String
}
| SeanShubin/scala-training | sample-data/src/main/scala/com/seanshubin/scala/training/sample/data/ItemFormatter.scala | Scala | unlicense | 156 |
import org.eclipse.jetty.server.Server
import org.eclipse.jetty.servlet.{ DefaultServlet, ServletContextHandler }
import org.eclipse.jetty.webapp.WebAppContext
import org.scalatra.servlet.ScalatraListener
object JettyLauncher {
def main(args: Array[String]) {
val port = if(System.getenv("PORT") != null) System.g... | DePauwREU2013/sjs-server | src/main/scala/JettyLauncher.scala | Scala | mit | 694 |
package jp.opap.material.data
import java.time.LocalDateTime
import java.time.format.DateTimeFormatter
import com.fasterxml.jackson.core.JsonGenerator
import com.fasterxml.jackson.databind.SerializerProvider
import com.fasterxml.jackson.databind.module.SimpleModule
import com.fasterxml.jackson.databind.ser.std.StdSer... | opap-jp/material-explorer | rest/src/main/scala/jp/opap/material/data/JsonSerializers.scala | Scala | mit | 2,135 |
/* *\\
** Squants **
** **
** Scala Quantities and Units of Measure Library and DSL **
** (c) 2013-2015, G... | typelevel/squants | shared/src/test/scala/squants/energy/EnergySpec.scala | Scala | apache-2.0 | 13,235 |
/**
* Copyright 2016 Rackspace US, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicab... | RackerWilliams/attributeMapping | core/src/test/scala/com/rackspace/identity/components/ExtractExtensionSuite.scala | Scala | apache-2.0 | 16,903 |
package com.twitter.finatra.http.tests.integration.doeverything.main.services
import com.google.inject.assistedinject.Assisted
import com.twitter.inject.annotations.Flag
import javax.inject.{Inject, Named}
import com.twitter.util.Duration
class ComplexService @Inject() (
exampleService: DoEverythingService,
defau... | twitter/finatra | http-server/src/test/scala/com/twitter/finatra/http/tests/integration/doeverything/main/services/ComplexService.scala | Scala | apache-2.0 | 753 |
/*
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "Licens... | Sotera/aggregate-micro-paths | spark/src/main/scala/org/xdata/analytics/spark/micropathing/MicroPathEngine.scala | Scala | apache-2.0 | 10,549 |
/*
Copyright 2017-2020 Erik Erlandson
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software... | erikerlandson/coulomb | coulomb-pureconfig-refined/src/main/scala/coulomb/pureconfig/refined/package.scala | Scala | apache-2.0 | 2,603 |
/*
* The MIT License
*
* Copyright 2014 Kamnev Georgiy ([email protected]).
*
* Данная лицензия разрешает, безвозмездно, лицам, получившим копию данного программного
* обеспечения и сопутствующей документации (в дальнейшем именуемыми "Программное Обеспечение"),
* использовать Программное Обеспечение без огра... | gochaorg/odt-export | src/main/scala/xyz/cofe/odtexport/xtest/NodePatternsVisitor.scala | Scala | mit | 5,131 |
package me.yingrui.segment.dict
import org.junit.Assert
import org.junit.Test
class POSArrayTest {
@Test
def one_Word_Could_has_Multi_POSes() {
val posArray = new POSArray()
val posV = POS("V", 1)
val posT = POS("T", 1)
val posN = POS("N", 3451)
posArray.add(posV)
... | yingrui/mahjong | lib-segment/src/test/scala/me/yingrui/segment/dict/POSArrayTest.scala | Scala | gpl-3.0 | 944 |
package mesosphere.marathon
package api
import javax.servlet._
import javax.servlet.http.HttpServletResponse
class CacheDisablingFilter extends Filter {
override def init(filterConfig: FilterConfig): Unit = {}
override def doFilter(request: ServletRequest, response: ServletResponse, chain: FilterChain): Unit = {... | gsantovena/marathon | src/main/scala/mesosphere/marathon/api/CacheDisablingFilter.scala | Scala | apache-2.0 | 742 |
package main.scala.overlapping.timeSeriesOld
import breeze.linalg.{DenseMatrix, DenseVector}
import main.scala.overlapping.containers._
import scala.reflect.ClassTag
/**
* Created by Francois Belletti on 9/23/15.
*/
object SecondMomentEstimator{
/**
* Compute the second moment of a Time Series RDD.
*
... | bellettif/sparkGeoTS | sparkTS/src/main/scala/overlapping/timeSeriesOld/SecondMomentEstimator.scala | Scala | bsd-3-clause | 1,440 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | chenc10/Spark-PAF | streaming/src/main/scala/org/apache/spark/streaming/StreamingContext.scala | Scala | apache-2.0 | 36,642 |
/**
* ====
* This file is part of SensApp [ http://sensapp.modelbased.net ]
*
* Copyright (C) 2011- SINTEF ICT
* Contact: SINTEF ICT <[email protected]>
*
* Module: net.modelbased.sensapp
*
* SensApp is free software: you can redistribute it and/or modify
* it under the terms of... | SINTEF-9012/sensapp | net.modelbased.sensapp.service.registry/src/main/scala/net/modelbased/sensapp/service/registry/data/SensorDataStructureRegistry.scala | Scala | lgpl-3.0 | 3,025 |
/*
Copyright 2012 Twitter, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distr... | AoJ/scalding | src/main/scala/com/twitter/scalding/Args.scala | Scala | apache-2.0 | 4,424 |
/*
Copyright 2015 Twitter, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distr... | sriramkrishnan/scalding | scalding-serialization/src/test/scala/com/twitter/scalding/serialization/JavaStreamEnrichmentsProperties.scala | Scala | apache-2.0 | 3,581 |
/*
* Copyright 2022 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | hmrc/vat-registration-frontend | test/views/returns/ClaimRefundsViewSpec.scala | Scala | apache-2.0 | 2,606 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | ueshin/apache-spark | mllib/src/main/scala/org/apache/spark/mllib/clustering/StreamingKMeans.scala | Scala | apache-2.0 | 11,970 |
/*
* Copyright 2021 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | hmrc/gmp-frontend | app/controllers/AssetsController.scala | Scala | apache-2.0 | 821 |
package com.blackboxsociety.net
import scalaz.{Reader => _, _}
import scalaz.syntax.bind._
import com.blackboxsociety._
import scalaz.concurrent._
import scalaz.concurrent.Task._
import scalaz.stream.{async => streamAsync, _}
import java.nio.channels._
import java.nio._
import java.io.IOException
import scodec.bits.By... | blackboxsociety/blackbox-core | src/main/scala/com/blackboxsociety/net/TcpClient.scala | Scala | mit | 3,703 |
package TAPLcomp.untyped
import scala.text.Document
// outer means that the term is the top-level term
object UntypedPrinter {
import TAPLcomp.Print._
def ptmTerm(outer: Boolean, t: Term): Document = t match {
case TmAbs(x, t2) =>
val abs = g0("\\\\" :: x :: ".")
val body = ptmTerm(outer, t2)
... | hy-zhang/parser | Scala/Parser/src/TAPLcomp/untyped/syntax.scala | Scala | bsd-3-clause | 746 |
package dtc.instances.moment
import java.time.{DayOfWeek, Duration, LocalDate, LocalTime}
import dtc.js.MomentZonedDateTime
import dtc.{Offset, TimeZoneId, Zoned}
trait MomentZonedDateTimeInstanceWithoutOrder extends Zoned[MomentZonedDateTime] {
def capture(date: LocalDate, time: LocalTime, zone: TimeZoneId): Mome... | vpavkin/dtc | moment/src/main/scala/dtc/instances/moment/MomentZonedDateTimeInstanceWithoutOrder.scala | Scala | apache-2.0 | 3,525 |
/*
* Copyright 2001-2015 Artima, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agre... | dotty-staging/scalatest | scalatest-test/src/test/scala/org/scalatest/prop/GeneratorSpec.scala | Scala | apache-2.0 | 209,065 |
package me.reminisce.stats.retrieving
import akka.actor._
import com.github.nscala_time.time.Imports._
import me.reminisce.stats.model.DatabaseCollection
import me.reminisce.stats.model.Messages._
import me.reminisce.stats.model.RetrievingMessages._
import me.reminisce.stats.retrieving.RetrievingService._
import me.re... | reminisceme/stats | src/main/scala/me/reminisce/stats/retrieving/RetrievingService.scala | Scala | apache-2.0 | 3,028 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | ArvinDevel/onlineAggregationOnSparkV2 | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/DateTimeUtils.scala | Scala | apache-2.0 | 26,854 |
/*
* This software is licensed under the GNU Affero General Public License, quoted below.
*
* This file is a part of PowerAPI.
*
* Copyright (C) 2011-2016 Inria, University of Lille 1.
*
* PowerAPI is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public Lice... | Spirals-Team/powerapi | powerapi-core/src/test/scala/org/powerapi/core/MonitorSuite.scala | Scala | agpl-3.0 | 23,926 |
package play
import sbt._
import sbt.Keys._
trait Keys {
val jdbc = "com.typesafe.play" %% "play-jdbc" % play.core.PlayVersion.current
val anorm = "com.typesafe.play" %% "anorm" % play.core.PlayVersion.current
val javaCore = "com.typesafe.play" %% "play-java" % play.core.PlayVersion.current
val javaJdbc =... | michaelahlers/team-awesome-wedding | vendor/play-2.2.1/framework/src/sbt-plugin/src/main/scala/PlayKeys.scala | Scala | mit | 4,925 |
package com.github.kmizu.mregex
import java.io.{PrintWriter, StringWriter}
class Dfa(val table: Array[Array[Int]], val start: Int, val finals: Set[Int]) {
import Nfa.Compiler.NumberOfAlphabets
def and(rhs: Dfa): Dfa = {
val newTable = Array.ofDim[Int](table.length * rhs.table.length, NumberOfAlphabets)
va... | kmizu/minimal_regex_matcher | src/main/scala/com/github/kmizu/mregex/Dfa.scala | Scala | mit | 2,897 |
/*
Copyright 2012 Twitter, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distr... | snoble/algebird | algebird-test/src/test/scala/com/twitter/algebird/SummingIteratorTest.scala | Scala | apache-2.0 | 2,245 |
package com.dominikgruber.fpinscala.chapter03
import org.scalatest._
class Exercise20Spec extends FlatSpec with Matchers {
"flatMap" should "duplicate elements" in {
val l = List(1, 2, 3)
val f = (i: Int) => List(i, i)
List.flatMap(l)(f) should be (List(1, 1, 2, 2, 3, 3))
}
} | TheDom/functional-programming-in-scala | src/test/scala/com/dominikgruber/fpinscala/chapter03/Exercise20Spec.scala | Scala | mit | 295 |
package rtmp.protocol
import akka.util.ByteString
/**
*/
abstract class BaseProtocol {
def handshake(input:Array[Byte]):Response
}
| vimvim/AkkaTest | src/main/scala/rtmp/protocol/BaseProtocol.scala | Scala | agpl-3.0 | 136 |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... | lhaiesp/samza | samza-core/src/main/scala/org/apache/samza/metrics/ContainerProcessManagerMetrics.scala | Scala | apache-2.0 | 3,730 |
package com.twitter.util
import java.util.Locale
import org.junit.runner.RunWith
import org.scalatest.WordSpec
import org.scalatest.junit.JUnitRunner
@RunWith(classOf[JUnitRunner])
class TwitterDateFormatTest extends WordSpec {
"TwitterDateFormat" should {
"disallow Y without w" in {
intercept[IllegalArg... | BuoyantIO/twitter-util | util-core/src/test/scala/com/twitter/util/TwitterDateFormatTest.scala | Scala | apache-2.0 | 1,229 |
package io.skysail.core.app.resources
import akka.pattern.ask
import io.skysail.core.akka.RequestEvent
import io.skysail.core.app.SkysailApplication
import io.skysail.core.app.menus.MenuItem
import io.skysail.core.resources.AsyncListResource
import io.skysail.core.server.actors.ApplicationsActor
import scala.concurre... | evandor/skysail-core | skysail.core/src/io/skysail/core/app/resources/MenusResource.scala | Scala | apache-2.0 | 837 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | aosagie/spark | external/kafka-0-10-sql/src/test/scala/org/apache/spark/sql/kafka010/KafkaContinuousSinkSuite.scala | Scala | apache-2.0 | 14,435 |
/*
* This file is part of the "silex" library of helpers for Apache Spark.
*
* Copyright (c) 2015 Red Hat, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.ap... | erikerlandson/silex | src/test/scala/com/redhat/et/silex/util/regexImplicits.scala | Scala | apache-2.0 | 1,106 |
/*
* Copyright 2012-2016 Netflix, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | wstrucke/edda | src/test/scala/com/netflix/edda/web/FieldSelectorParserTest.scala | Scala | apache-2.0 | 2,821 |
val p: Seq[Double] = Seq()
p.foldLeft("") {
(a, b) /*(B, Double) inferred*/ =>
/*start*/(a, b)/*end*/
0d
}
//(String, Double) | ilinum/intellij-scala | testdata/typeInference/bugs3/SCL2412.scala | Scala | apache-2.0 | 135 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | manishgupta88/carbondata | integration/spark2/src/test/scala/org/apache/spark/carbondata/restructure/vectorreader/ChangeDataTypeTestCases.scala | Scala | apache-2.0 | 9,462 |
package dispatch.classic.tagsoup
import dispatch.classic.{HandlerVerbs, Request}
import xml.parsing.NoBindingFactoryAdapter
import java.io.InputStreamReader
import org.xml.sax.InputSource
import org.ccil.cowan.tagsoup.jaxp.SAXFactoryImpl
trait ImplicitTagSoupHandlers {
implicit def handlerToTagSoupHandlers(h: Hand... | dispatch/dispatch | tagsoup/src/main/scala/TagSoupHttp.scala | Scala | lgpl-2.1 | 1,158 |
package org.http4s
package server
package middleware
package authentication
import org.http4s.headers.Authorization
import scalaz._
import scalaz.concurrent.Task
/**
* Provides Basic Authentication from RFC 2617.
* @param realm The realm used for authentication purposes.
* @param store A partial function mapping (... | hvesalai/http4s | server/src/main/scala/org/http4s/server/middleware/authentication/BasicAuthentication.scala | Scala | apache-2.0 | 1,329 |
/*
* Licensed to The Apereo Foundation under one or more contributor license
* agreements. See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* The Apereo Foundation licenses this file to you under the Apache License,
* Version 2.0, (the "License"); you ma... | equella/Equella | Source/Plugins/Core/com.equella.core/scalasrc/com/tle/web/bulk/workflow/operations/WorkflowMoveOperation.scala | Scala | apache-2.0 | 3,682 |
package org.jetbrains.plugins.scala.lang.scaladoc.generate
import javax.swing.JComponent
import javax.swing.event.DocumentEvent
import com.intellij.CommonBundle
import com.intellij.analysis.{AnalysisScope, BaseAnalysisAction, BaseAnalysisActionDialog}
import com.intellij.execution.configurations._
import com.intellij... | loskutov/intellij-scala | src/org/jetbrains/plugins/scala/lang/scaladoc/generate/ScaladocAction.scala | Scala | apache-2.0 | 4,148 |
package org.apache.mesos.chronos.scheduler.jobs.constraints
import java.util.regex.PatternSyntaxException
import org.specs2.mutable.SpecificationWithJUnit
class UnlikeConstraintSpec extends SpecificationWithJUnit
with ConstraintSpecHelper {
"matches attributes of type text" in {
val attributes = List(createT... | lionelnicolas/chronos | src/test/scala/org/apache/mesos/chronos/scheduler/jobs/constraints/UnlikeConstraintSpec.scala | Scala | apache-2.0 | 1,555 |
package de.sciss.mellite
import de.sciss.file._
import de.sciss.lucre.store.BerkeleyDB
import de.sciss.lucre.{Copy, Txn}
import de.sciss.nuages.Nuages
import de.sciss.nuages.Nuages.Surface
import de.sciss.proc.{Durable, Workspace}
// quick hack to copy a nuages-only database into a regular mellite session
object Impo... | Sciss/Mellite | app/src/test/scala/de/sciss/mellite/ImportNuages.scala | Scala | agpl-3.0 | 2,025 |
package colossus.extensions.util.bson.reader
import java.nio.ByteBuffer
import colossus.extensions.util.bson.element.BsonObjectId
case class BsonObjectIdReader(buffer: ByteBuffer) extends Reader[BsonObjectId] {
override def read: Option[BsonObjectId] = {
val name = readCString()
val value = readBytes(12)
... | fehmicansaglam/colossus-extensions | mongo/src/main/scala/colossus/extensions/util/bson/reader/BsonObjectIdReader.scala | Scala | apache-2.0 | 361 |
// code-examples/AdvOOP/overrides/final-class-wont-compile.scala
// WON'T COMPILE.
final class Fixed {
def doSomething = "Fixed did something!"
}
class Changeable1 extends Fixed // ERROR
| XClouded/t4f-core | scala/src/tmp/AdvOOP/overrides/final-class-wont-compile.scala | Scala | apache-2.0 | 195 |
import org.specs2.mutable.Specification
class FizzBuzzTwoSpec extends Specification {
"n % 3 or contains 3 == Fizz and n % 5, contains 5 == Buzz, both == FizzBuzz" should {
"for 1" in {
FizzBuzzTwo(1).take(1).toList.map(_.value) must beEqualTo(
List("1")
)
}
"for 1..10" in {
Fi... | dkowis/CodingDojo | KataFizzBuzz/src/test/scala/FizzBuzzTwoSpec.scala | Scala | mit | 960 |
package offGridOrcs
object ViewInspection {
def view(model: Model.Inspection): Seq[Sprite] = {
val titleAndDescription = getTitleAndDetails(model)
(viewBackground()
++ viewGrid(model)
++ viewTitle(titleAndDescription._1)
++ viewCloseButton()
++ viewDetails(titleAndDescription._2)
... | dcecile/off-grid-orcs | src/ViewInspection.scala | Scala | mit | 3,745 |
package ignition.core.utils
import java.sql.Timestamp
import org.joda.time.{DateTime, DateTimeZone, Period, Seconds}
import org.joda.time.format.ISODateTimeFormat
object DateUtils {
private val isoDateTimeFormatter = ISODateTimeFormat.dateTime().withZoneUTC()
implicit def dateTimeOrdering: Ordering[DateTime] = ... | chaordic/ignition-core | src/main/scala/ignition/core/utils/DateUtils.scala | Scala | mit | 1,469 |
package jsky.app.ot.gemini.editor.targetComponent.details2
import java.awt.{GridBagConstraints, GridBagLayout, Insets}
import javax.swing.JPanel
import edu.gemini.pot.sp.ISPNode
import edu.gemini.shared.util.immutable.{Option => GOption}
import edu.gemini.shared.util.immutable.ScalaConverters.ScalaOptionOps
import ed... | spakzad/ocs | bundle/jsky.app.ot/src/main/scala/jsky/app/ot/gemini/editor/targetComponent/details2/TargetDetailPanel.scala | Scala | bsd-3-clause | 2,870 |
package debop4s.rediscala.client
import java.lang.{Double => JDouble, Iterable => JIterable, Long => JLong}
import java.util.{List => JList, Map => JMap, Set => JSet}
import debop4s.rediscala._
import org.slf4j.{Logger, LoggerFactory}
import redis._
import redis.commands.Transactions
object JRedisClient {
def app... | debop/debop4s | debop4s-rediscala/src/main/scala/debop4s/rediscala/client/JRedisClient.scala | Scala | apache-2.0 | 1,642 |
package nz.wicker.autoencoder.math.optimization
/**
* Differentiable `Double`-valued function suitable for line-search
* algorithms. The domain of the function is some vectorspace `V`,
* and the corresponding gradient is also from `V`.
*/
trait DifferentiableFunction[V] extends (V => Double) {
/**
* Returns... | joergwicker/autoencoder | src/main/scala/nz/wicker/autoencoder/math/optimization/DifferentiableFunction.scala | Scala | gpl-3.0 | 507 |
package io.github.chikei.sbt.onelog
import java.io.PrintWriter
import com.zavakid.sbt.LogDepProcess.{ProcessContext, _}
import net.virtualvoid.sbt.graph.DependencyGraphKeys._
import net.virtualvoid.sbt.graph.{DependencyGraphPlugin, ModuleGraph, ModuleId}
import org.fusesource.scalate.TemplateEngine
import sbt.Keys._
... | chikei/sbt-one-log | src/main/scala/io/github/chikei/sbt/onelog/OneLog.scala | Scala | apache-2.0 | 7,339 |
package pw.ian.sysadmincraft.world
import org.specs2.mutable.Specification
class PillarManagerSpec extends Specification {
"spiralIndex" >> {
"should be unique" >> {
val list = (0 to 10000).map(PillarManagerUtils.spiralIndex)
list.toSet.size must_== list.size
}
}
} | simplyianm/sysadmincraft | src/test/scala/pw/ian/sysadmincraft/world/PillarManagerSpec.scala | Scala | isc | 297 |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... | ueshin/apache-flink | flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/sources/FieldComputer.scala | Scala | apache-2.0 | 2,353 |
package akkaviz.events
import akka.NotUsed
import akka.actor.ActorRef
import akka.stream.scaladsl.Flow
import akkaviz.events.types.{ThroughputMeasurement, ReceivedWithId, BackendEvent}
import scala.concurrent.duration._
object ThroughputMeasurementFlow {
def apply(period: FiniteDuration): Flow[BackendEvent, Throug... | blstream/akka-viz | monitoring/src/main/scala/akkaviz/events/ThroughputMeasurementFlow.scala | Scala | mit | 1,027 |
import akka.actor._
import akka.remote._
import akka.pattern.ask
import akka.pattern.pipe
import akka.util.Timeout
import scala.concurrent.duration._
import scala.concurrent.ExecutionContext.Implicits._
import scalafx.application.Platform
class ParticipantActor(
val control: tictactoeClientFrontWindowController#Co... | MagikarpBot/scala-akka-tictactoe | src/main/scala/ParticipantActor.scala | Scala | gpl-3.0 | 6,265 |
package com.gajdulewicz
import com.mongodb.casbah.WriteConcern
/**
* Created by gajduler on 09/12/14.
*/
object GeneratorApp {
def main(args: Array[String]) {
val writes: Int = 1 * 100 * 1000
val initWriter = new MongoWriter(bufferSize = 100000)
(1 to writes).foreach(id => {
val prof = Profile... | rafax/dbperf | src/main/scala/com/gajdulewicz/Main.scala | Scala | mit | 1,412 |
/*
* Copyright (c) 2012-2014 Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
* You may obtain a copy of the Apache License Version 2.0 at http://www.apach... | pkallos/snowplow | 3-enrich/scala-common-enrich/src/test/scala/com.snowplowanalytics.snowplow.enrich.common/utils/conversionUtilsTests.scala | Scala | apache-2.0 | 15,163 |
package redeyes.parser
import redeyes.doc._
import redeyes.util.Strings
import scalaz._
import scalaz.std.string._
import scalaz.std.vector._
import scalaz.syntax.monad._
import shapeless._
import shapeless.ops.hlist.{Comapped, ToList}
trait ParserModule { self =>
/**
* The abstract type representing the chan... | redeyes/redeyes | src/main/scala/redeyes/parser/parser.scala | Scala | mit | 16,643 |
package org.apache.spark.mllib.treelib.core
import org.apache.spark._
import org.apache.spark.SparkContext._
import org.apache.spark.rdd._
import java.io._
import java.io.DataOutputStream
import java.io.FileOutputStream
abstract class TreeModel extends Serializable {
/**
* The index of target feature
... | bigfootproject/spark-dectree | spark/mllib/src/main/scala/org/apache/spark/mllib/treelib/core/TreeModel.scala | Scala | apache-2.0 | 2,416 |
/** ********************************************************************************************
* Scaliapp
* Version 0.1
*
* The primary distribution site is
*
* http://scaliapp.alanrodas.com
*
* Copyright 2014 Alan Rodas Bonjour
*
* Licensed under the Apache License, Version 2.0 (the "License"); y... | alanrodas/scaliapp | src/main/scala/com/alanrodas/scaliapp/core/runtime/values.scala | Scala | apache-2.0 | 2,813 |
/*
* Copyright 2008 Juha Komulainen
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or ... | komu/solitarius | src/test/scala/solitarius/rules/SpiderSpecification.scala | Scala | apache-2.0 | 3,629 |
/**
* This file is part of SensApp [ http://sensapp.modelbased.net ]
*
* Copyright (C) 2011- SINTEF ICT
* Contact: SINTEF ICT <[email protected]>
*
* Module: net.modelbased.sensapp
*
* SensApp is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public L... | SINTEF-9012/sensapp | _attic/net.modelbased.sensapp.restful/src/main/scala/net/modelbased/sensapp/restful/ResourceHandler.scala | Scala | lgpl-3.0 | 3,255 |
package org.mrgeo.utils
object Memory {
def used(): String = {
val bytes = Runtime.getRuntime.totalMemory() - Runtime.getRuntime.freeMemory()
format(bytes)
}
def free():String = {
format(Runtime.getRuntime.freeMemory)
}
def allocated():String = {
format(Runtime.getRuntime.totalMemory())
... | tjkrell/MrGEO | mrgeo-core/src/main/scala/org/mrgeo/utils/Memory.scala | Scala | apache-2.0 | 667 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | maropu/spark | sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/BinaryComparisonSimplificationSuite.scala | Scala | apache-2.0 | 6,819 |
package im.tox.antox.fragments
import java.io.{IOException, File}
import java.text.SimpleDateFormat
import java.util.Date
import android.app.{Dialog, Activity}
import android.content.{Context, Intent}
import android.graphics.{BitmapFactory, Bitmap}
import android.media.ThumbnailUtils
import android.net.Uri
import and... | Astonex/Antox | app/src/main/scala/im/tox/antox/fragments/AvatarDialog.scala | Scala | gpl-3.0 | 5,589 |
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
/** @author John Miller
* @version 1.2
* @date Fri Jul 1 14:01:05 EDT 2016
* @see LICENSE (MIT style license file).
*/
package scalation.util
import scala.collection.mutable.{AbstractMap, Map, MapLike}
import scala.refle... | scalation/fda | scalation_1.2/src/main/scala/scalation/util/BpTreeMap.scala | Scala | mit | 11,622 |
val a: (Int) => Int = _.floatValue
//False | ilinum/intellij-scala | testdata/typeConformance/basic/FunctionFalseConformance.scala | Scala | apache-2.0 | 42 |
/**
* This file is part of mycollab-web.
*
* mycollab-web is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* mycollab-web is d... | uniteddiversity/mycollab | mycollab-web/src/main/scala/com/esofthead/mycollab/module/project/view/settings/RoleUrlResolver.scala | Scala | agpl-3.0 | 2,715 |
/*
* Copyright 2012 Twitter Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed t... | devcamcar/zipkin | zipkin-common/src/main/scala/com/twitter/zipkin/builder/ZipkinServerBuilder.scala | Scala | apache-2.0 | 3,608 |
/*
* Copyright 2012 Pascal Voitot (@mandubian)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable ... | mandubian/shapotomic | src/test/scala/ShapotomicTestSpec.scala | Scala | apache-2.0 | 4,142 |
object Initialization1 {
case class InitA() {
val x = y
val y = 0
}
}
| epfl-lara/stainless | frontends/benchmarks/extraction/invalid/Initialization1.scala | Scala | apache-2.0 | 82 |
package ru.dgolubets.jsmoduleloader.internal
import java.io.{BufferedReader, InputStreamReader}
import java.nio.CharBuffer
import scala.util.Try
/**
* Resource internal.
*/
private[jsmoduleloader] object Resource {
/**
* Reads resource string.
* @param resourceName Name of the resource
* @return
*/
... | DGolubets/js-module-loader | src/main/scala/ru/dgolubets/jsmoduleloader/internal/Resource.scala | Scala | mit | 1,005 |
package com.googlecode.kanbanik.api
import java.util
import com.googlecode.kanbanik.commands.ExecuteStatisticsCommand
import org.junit.runner.RunWith
import org.scalatest.junit.JUnitRunner
import org.kanbanik.statistics
import org.scalatest.FlatSpec
import net.liftweb.json._
import com.googlecode.kanbanik.dtos._
@Ru... | kanbanik/kanbanik | kanbanik-server/src/test/scala/com/googlecode/kanbanik/api/StatisticsLearningTest.scala | Scala | apache-2.0 | 1,949 |
package controllers
import java.util.UUID
import com.hbc.svc.sundial.v2
import com.hbc.svc.sundial.v2.models._
import dao.SundialDao
import model._
import play.api.Logger
import util.Conversions._
object ModelConverter {
/////////////////////////////////////////////////////////////////////////////////////////////... | gilt/sundial | app/controllers/ModelConverter.scala | Scala | mit | 24,794 |
package com.sksamuel.elastic4s
import org.elasticsearch.index.query.{HasParentFilterBuilder, HasChildFilterBuilder, NestedFilterBuilder, FilterBuilders}
import org.elasticsearch.common.geo.GeoDistance
import org.elasticsearch.common.unit.DistanceUnit
import com.sksamuel.elastic4s.DefinitionAttributes._
/** @author St... | l15k4/elastic4s | elastic4s-core/src/main/scala/com/sksamuel/elastic4s/filters.scala | Scala | apache-2.0 | 17,711 |
package com.twitter.finagle.service
import com.twitter.conversions.time._
import com.twitter.finagle.{ChannelClosedException, Failure, TimeoutException, WriteException}
import com.twitter.util.{
TimeoutException => UtilTimeoutException, Duration, JavaSingleton, Return, Throw, Try}
import java.util.{concurrent => juc... | zfy0701/finagle | finagle-core/src/main/scala/com/twitter/finagle/service/RetryPolicy.scala | Scala | apache-2.0 | 12,851 |
package lila.security
import scala.concurrent.duration._
import com.github.blemale.scaffeine.Cache
import lila.user.User
import lila.common.config.NetDomain
final class PromotionApi(domain: NetDomain) {
def test(user: User)(text: String, prevText: Option[String] = None): Boolean =
user.isVerified || user.isAd... | luanlv/lila | modules/security/src/main/Promotion.scala | Scala | mit | 1,806 |
package se.marcuslonnberg.scaladocker.remote.api
import java.io._
import org.kamranzafar.jtar.{TarEntry, TarOutputStream}
import scala.annotation.tailrec
object TarArchive {
def apply(inDir: File, out: File): File = {
val files = FileUtils.listFilesRecursive(inDir)
apply(files, out)
}
def apply(files... | marcuslonnberg/scala-docker | src/main/scala/se/marcuslonnberg/scaladocker/remote/api/TarArchive.scala | Scala | mit | 1,605 |
package service.sheet
import org.apache.commons.io.output.ByteArrayOutputStream
import org.apache.poi.hssf.usermodel._
import org.apache.poi.ss.usermodel.{BorderStyle, FillPatternType, IndexedColors}
import org.apache.poi.ss.util.{CellRangeAddress, RegionUtil}
import scala.util.Try
sealed trait Fraction
object Frac... | THK-ADV/lwm-reloaded | app/service/sheet/SheetService.scala | Scala | mit | 5,077 |
package spinoco.protocol.mail.header
import scodec.Codec
import spinoco.protocol.mail.EmailAddress
import spinoco.protocol.mail.header.codec.{EmailAddressCodec, commaSeparated}
/**
* RFC 5322 3.6.2.
*
* The "From:" field specifies the author(s) of the message,
* that is, the mailbox(es) of the person(s) or ... | Spinoco/protocol | mail/src/main/scala/spinoco/protocol/mail/header/From.scala | Scala | mit | 819 |
package com.gilt.thehand.rules.typed
import com.gilt.thehand.rules.conversions.ConvertsToLong
import com.gilt.thehand.rules.comparison.LessThan
import com.gilt.thehand.rules.SingleValueRuleParser
/**
* A typed implementation of the LessThan trait, specific to Long. This can be used for any non-decimal datatype.
*/
... | gilt/the-hand | src/main/scala/com/gilt/thehand/rules/typed/LongLt.scala | Scala | apache-2.0 | 788 |
/*
* Copyright 2012 Atlassian PTY LTD
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | simpleenergy/kadai | concurrent/src/main/scala/kadai/concurrent/IntRepeater.scala | Scala | apache-2.0 | 1,861 |
/*
* Copyright (C) 2013-2014 by Michael Hombre Brinkmann
*/
package net.twibs.util
import com.ibm.icu.util.ULocale
import net.twibs.testutil.TwibsTest
class SettingsTest extends TwibsTest {
test("Check version for run modes") {
val sys = SystemSettings.copy(runMode = RunMode.PRODUCTION)
sys.version shoul... | hombre/twibs | twibs-util-test/src/test/scala/net/twibs/util/SettingsTest.scala | Scala | apache-2.0 | 2,860 |
/*
* Copyright (C) 2018 Lightbend Inc. <https://www.lightbend.com>
* Copyright (C) 2017-2018 Alexis Seigneurin.
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright o... | gf53520/kafka | streams/streams-scala/src/main/scala/org/apache/kafka/streams/scala/StreamsBuilder.scala | Scala | apache-2.0 | 8,638 |
package model.repositories.anorm
import anorm.SqlParser._
import anorm._
import model.dtos._
object ConsFrequencyPerOrganizationParser{
val Parse: RowParser[ConsFrequencyPerOrganization] = {
str("date") ~
str("organizationName") ~
long("organizationId") ~
int("numberOfConsultations") ~
get[... | scify/DemocracIT-Web | app/model/repositories/anorm/ConsFrequencyPerOrganizationParser.scala | Scala | apache-2.0 | 633 |
/*
* Part of NDLA learningpath-api.
* Copyright (C) 2016 NDLA
*
* See LICENSE
*
*/
package no.ndla.learningpathapi.model.api
import org.scalatra.swagger.annotations._
import org.scalatra.swagger.runtime.annotations.ApiModelProperty
import scala.annotation.meta.field
// format: off
@ApiModel(description = "Inf... | NDLANO/learningpath-api | src/main/scala/no/ndla/learningpathapi/model/api/LearningStep.scala | Scala | gpl-3.0 | 1,972 |
package im.actor.server
import akka.actor.ActorSystem
import akka.stream.Materializer
import akka.util.Timeout
import cats.data.Xor
import eu.codearte.jfairy.Fairy
import im.actor.api.rpc.ClientData
import im.actor.api.rpc.auth.AuthService
import im.actor.api.rpc.peers.{ ApiOutPeer, ApiPeerType, ApiUserOutPeer }
impor... | ufosky-server/actor-platform | actor-server/actor-testkit/src/main/scala/im/actor/server/ServiceSpecHelpers.scala | Scala | agpl-3.0 | 6,013 |
/*
* Copyright 2016 The BigDL Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | yiheng/BigDL | spark/dl/src/test/scala/com/intel/analytics/bigdl/nn/mkldnn/MaxPoolingSpec.scala | Scala | apache-2.0 | 4,511 |
package graphique.backends.localbackend.imageserver
import java.nio.file.Path
import akka.actor.{Actor, ActorLogging, ActorRef, Props}
import akka.io.IO
import spray.can.Http
private[localbackend] class ImageServerManager(hostname: String, port: Int, imagePath: Path)
extends Actor with ActorLogging {
require(po... | amrhassan/graphique | src/main/scala/graphique/backends/localbackend/imageserver/ImageServerManager.scala | Scala | mit | 1,575 |
Subsets and Splits
Filtered Scala Code Snippets
The query filters and retrieves a sample of code snippets that meet specific criteria, providing a basic overview of the dataset's content without revealing deeper insights.