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 |
|---|---|---|---|---|---|
/*
* 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... | lresende/incubator-toree | plugins/src/test/scala/org/apache/toree/plugins/PluginSearcherSpec.scala | Scala | apache-2.0 | 6,132 |
/**
* Created by scotts on 11/12/15.
*/
class EnergyMonitorRecord(val userId:Int, val usedAmount:Long, val time:Long)
| scottsappen/EnergyMonitorHBaseExample | src/main/scala/EnergyMonitorRecord.scala | Scala | apache-2.0 | 122 |
/*
* Copyright (c) 2014. Regents of the University of California
*
* 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 require... | fnothaft/avocado | avocado-core/src/main/scala/edu/berkeley/cs/amplab/avocado/partitioners/PartitionSet.scala | Scala | apache-2.0 | 3,291 |
package eu.ace_design.island.viewer.svg
import java.awt.geom.Line2D
import java.awt.{BasicStroke, Color, Graphics2D}
import eu.ace_design.island.map.{PropertySet, IsWater, IslandMap, Property}
/**
* An heat-map displays the map as polygons, and map a color to each face, based on a given property. Faces tagged
* as... | ace-design/island | engine/src/main/scala/eu/ace_design/island/viewer/svg/HeatMap.scala | Scala | lgpl-3.0 | 2,881 |
package org.au9ustine.merry.model.identicon
import java.net.InetAddress
import java.security.MessageDigest
import java.util.logging.Logger
import scala.util.Random
/**
* IdentIcon
*
* A Wrapper class for Donpark's original identicon implementation
*
* Created by au9ustine on Dec 31st, 2013.
*/
cla... | au9ustine/org.au9ustine.merry | src/main/scala/org/au9ustine/merry/model/identicon/IdentIcon.scala | Scala | apache-2.0 | 3,174 |
/**
* CSPFJ - CSP solving API for Java
* Copyright (C) 2006 Julien VION
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your op... | concrete-cp/concrete | src/main/scala/concrete/heuristic/variable/WDegOnDom.scala | Scala | lgpl-2.1 | 1,206 |
/*
* Copyright 2016 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... | ahudspith-equalexperts/ct-calculations | src/test/scala/uk/gov/hmrc/ct/box/ValidatableBoxSpec.scala | Scala | apache-2.0 | 12,405 |
/*
* 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 ... | apache/flink | flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/planner/plan/nodes/logical/FlinkLogicalValues.scala | Scala | apache-2.0 | 4,012 |
/*
,i::,
:;;;;;;;
;:,,::;.
1ft1;::;1tL
t1;::;1,
:;::; _____ __ ___ __
fCLff ;:: tfLLC / ___/ / |/ /____ _ _____ / /_
CLft11 :,, i1tffLi \\__ \\ ____ / /|_/ ... | S-Mach/aeondb | src/main/scala/s_mach/aeondb/impl/EmptyLocalProjection.scala | Scala | apache-2.0 | 1,071 |
package shop.model
import shop.infrastructure._
case class ShoppingItem(id: Option[Long], name: String, description: Option[String]){
def this(id: Long,name: String) = this(Some(id),name,None)
def this(name: String) = this(None,name,None)
def update(implicit registry: ComponentRegistry): Option[S... | flurdy/shoppinglist | shopservice/src/main/scala/model/ShoppingItem.scala | Scala | mit | 757 |
/*
* 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 ... | tophua/spark1.52 | core/src/main/scala/org/apache/spark/SparkFiles.scala | Scala | apache-2.0 | 1,534 |
// A contains a field A.theValue$$local accessible using the
// generated getter A.theValue()
class A(val theValue: Int) {
val theValueInA = theValue // use the constructor parameter theValue
def getTheValue = theValue // virtual call to the getter theValue()
}
// B contains a field B.theValue$$local accessible u... | yusuke2255/dotty | tests/run/paramForwarding.scala | Scala | bsd-3-clause | 2,531 |
/* sbt -- Simple Build Tool
* Copyright 2008, 2009, 2010 Mark Harrah
*/
package sbt
import java.io.ByteArrayInputStream
import java.net.URL
import org.apache.ivy.{ core, plugins }
import core.module.descriptor.{ DefaultDependencyDescriptor, DefaultModuleDescriptor }
import core.settings.IvySettings
import plugins.... | xeno-by/old-scalameta-sbt | ivy/src/main/scala/sbt/CustomXmlParser.scala | Scala | bsd-3-clause | 1,477 |
/*
* Copyright 2007-2010 WorldWide Conferencing, LLC
*
* 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 applica... | wsaccaco/lift | framework/lift-modules/lift-widgets/src/main/scala/net/liftweb/widgets/logchanger/LogLevelChanger.scala | Scala | apache-2.0 | 8,311 |
import java.util.Dictionary
object HelloWorld {
// Function arguments are typed
// Note the implicit return statement
def add(firstVal: Int, secondVal: Int): Int = firstVal + secondVal
def myName(): String = "Luke"
// This is a "curried" function that allows us to apply it's arguments at different times.
... | lukemerrett/LearningScala | learning/src/1-Basics.scala | Scala | mit | 4,604 |
/*******************************************************************************
Copyright 2009,2011, Oracle and/or its affiliates.
All rights reserved.
Use is subject to license terms.
This distribution may include materials developed by third parties.
***********************************************... | darkrsw/safe | src/main/scala/kr/ac/kaist/jsaf/scala_src/useful/ASTGenHelper.scala | Scala | bsd-3-clause | 2,947 |
package models
import play.api.libs.json._
case class JsonResponse(status:String, data:String) {
implicit val JsonResponseWrites = new Writes[JsonResponse] {
def writes(jsonresp: JsonResponse) = Json.obj(
"status" -> jsonresp.status,
"data" -> jsonresp.data
)
}
}
| odnanref/carros | app/models/JsonResponse.scala | Scala | apache-2.0 | 286 |
package com.automatak.render.dnp3.objects.generators
import java.nio.file.Path
import com.automatak.render.dnp3.objects._
import com.automatak.render._
import com.automatak.render.cpp._
import com.automatak.render.LicenseHeader
object GroupVariationFileGenerator {
def apply(path: Path) = {
implicit val indent... | thiagoralves/OpenPLC_v2 | dnp3/generation/dnp3/src/main/scala/com/automatak/render/dnp3/objects/generators/GroupVariationFileGenerator.scala | Scala | gpl-3.0 | 2,670 |
package com.anadathur.elastic.easymapping
import javax.lang.model.element.Modifier
import com.squareup.javapoet.MethodSpec.Builder
import com.squareup.javapoet._
class DefaultMappingGen extends TypeGenerator {
import scala.collection.JavaConversions._
val generators = List(
generateMappingType _,
generate... | ajaykumarns/easymapping | src/main/scala/com/anadathur/elastic/easymapping/generators.scala | Scala | apache-2.0 | 4,756 |
/*
*************************************************************************************
* Copyright 2011 Normation SAS
*************************************************************************************
*
* This file is part of Rudder.
*
* Rudder is free software: you can redistribute it and/or modify
* it under the... | armeniaca/rudder | rudder-web/src/main/scala/com/normation/rudder/web/services/DisplayNode.scala | Scala | gpl-3.0 | 43,100 |
package com.cdegroot.sgame
/**
* Minimal replacement for AWT Color class
*/
case class SGColor(red: Int, green: Int, blue: Int, alpha: Int = 255)
/**
* Some predefined colors
*/
object SGColor {
val Black = SGColor(0,0,0)
val White = SGColor(255,255,255)
val Yellow = SGColor(255,255,0)
val Green = SGColo... | cdegroot/sgame | src/main/scala/com/cdegroot/sgame/SGColor.scala | Scala | bsd-3-clause | 860 |
package pl.touk.nussknacker.engine.definition.parameter.validator
import pl.touk.nussknacker.engine.api.definition
import javax.validation.constraints.{Max, Min, NotBlank}
import pl.touk.nussknacker.engine.api.definition.{MaximalNumberValidator, MinimalNumberValidator, NotBlankParameterValidator, ParameterValidator}
... | TouK/nussknacker | interpreter/src/main/scala/pl/touk/nussknacker/engine/definition/parameter/validator/ValidatorsExtractor.scala | Scala | apache-2.0 | 1,229 |
package dbtarzan.db
import java.nio.file.Path
import akka.actor.{ActorContext, ActorRef, Props}
import akka.routing.RoundRobinPool
import dbtarzan.config.connections.ConnectionData
import dbtarzan.config.password.EncryptionKey
import dbtarzan.db.actor.{CopyActor, DatabaseActor}
import dbtarzan.localization.Localizati... | aferrandi/dbtarzan | src/main/scala/dbtarzan/db/ConnectionBuilder.scala | Scala | apache-2.0 | 2,889 |
package xyz.hyperreal.prolog
import java.io.{File, PrintStream}
import jline.console.ConsoleReader
import jline.console.history.FileHistory
import xyz.hyperreal.bvm.VM
import xyz.hyperreal.char_reader.CharReader
import xyz.hyperreal.recursive_descent_parser.{Failure, Success}
object Main extends App {
REPL()
de... | edadma/funl | prolog/src/main/scala/xyz/hyperreal/prolog/Main.scala | Scala | mit | 5,948 |
/*
* 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 ... | sujen1412/sparkler | sparkler-app/src/main/scala/edu/usc/irds/sparkler/pipeline/ParseFunction.scala | Scala | apache-2.0 | 4,648 |
package org.jetbrains.plugins.scala
package lang
package psi
package api
package toplevel
package templates
import org.jetbrains.plugins.scala.lang.psi.api.base.ScConstructor
/**
* @author Alexander Podkhalyuzin
* Date: 22.02.2008
* Time: 9:24:03
*/
trait ScClassParents extends ScTemplateParents {
def constructor ... | triggerNZ/intellij-scala | src/org/jetbrains/plugins/scala/lang/psi/api/toplevel/templates/ScClassParents.scala | Scala | apache-2.0 | 357 |
package com.rasterfoundry.batch.removescenes
import com.rasterfoundry.batch.Job
import com.rasterfoundry.database.util.RFTransactor
import cats.effect.IO
import cats.syntax.apply._
import cats.syntax.either._
import doobie._
import doobie.implicits._
import doobie.implicits.javasql._
import doobie.postgres.implicits.... | raster-foundry/raster-foundry | app-backend/batch/src/main/scala/removeScenes/RemoveScenes.scala | Scala | apache-2.0 | 2,512 |
/*
* 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... | JerryYanWan/BigDL | spark/dl/src/test/scala/com/intel/analytics/bigdl/optim/DistriOptimizerSpec.scala | Scala | apache-2.0 | 17,936 |
import android.Keys._
import sbt.Keys._
import sbt._
import scala.collection.JavaConversions._
object BuildDependencies {
val appCompat = aar("com.android.support" % "appcompat-v7" % "21.0.0")
val cardView = aar("com.android.support" % "cardview-v7" % "21.0.0")
val suppo... | ryanbrozo/android-sbt-starter.g8 | src/main/g8/project/build.scala | Scala | mit | 2,468 |
/***********************************************************************
* Copyright (c) 2013-2018 Commonwealth Computer Research, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and... | ddseapy/geomesa | geomesa-index-api/src/main/scala/org/locationtech/geomesa/index/planning/FilterSplitter.scala | Scala | apache-2.0 | 14,131 |
/*
* Copyright (C) 2020 MapRoulette contributors (see CONTRIBUTORS.md).
* Licensed under the Apache License, Version 2.0 (see LICENSE).
*/
package org.maproulette.data
/**
* A class primarily of case classes that is used in place of java's enums. This is better for pattern
* matching. Enum's in Scala are really... | mgcuthbert/maproulette2 | app/org/maproulette/data/Actions.scala | Scala | apache-2.0 | 10,839 |
package com.xiaoguangchen.spa
import com.typesafe.config._
import com.xiaoguangchen.spa.annotation.Column
import java.sql.Connection
/**
* author: Chester Chen
* Date: 1/23/13 9:15 AM
*/
class BaseTest {
val config = ConfigFactory.load()
val database = getDatabaseVendor
def getDatabaseVendor:Database = ... | chesterxgchen/spa | src/test/scala/com/xiaoguangchen/spa/BaseTest.scala | Scala | apache-2.0 | 1,828 |
package br.ufmg.cs.util.sorter
// command line parsing
import br.ufmg.cs.util.ParamsParser
// utils
import br.ufmg.cs.util.Common
import org.apache.log4j.{Logger, Level}
// spark
import org.apache.spark.{SparkConf, SparkContext}
import org.apache.spark.SparkContext._
import org.apache.spark.storage.StorageLevel
imp... | viniciusvdias/fim-spark | src/main/scala/br/ufmg/cs/util/sorter/KeySorter.scala | Scala | apache-2.0 | 3,738 |
/*
* Copyright (c) 2014-2021 by The Monix Project Developers.
* See the project homepage at: https://monix.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... | monixio/monix | monix-tail/shared/src/test/scala/monix/tail/TypeClassLawsForIterantIOSuite.scala | Scala | apache-2.0 | 2,079 |
package com.lljv.analytics.analyzerengine
import java.util.Date
case class TextAnalysisSamples(
Samples: Array[TextAnalysisSample],
TimestampLatest: Option[Date],
KafkaKey: Option[String]
)
| dotdeb/Science-Finder | Analytics/AnalyzerEngine/src/main/scala/com/lljv/analytics/analyzerengine/TextAnalysisSamples.scala | Scala | apache-2.0 | 198 |
package io.eels.component.avro
import io.eels.schema.{ArrayType, Field, IntType, StructType}
import io.eels.Row
import org.apache.avro.SchemaBuilder
import org.scalatest.{Matchers, WordSpec}
class AvroSerializerTest extends WordSpec with Matchers {
val avroSchema = SchemaBuilder.record("row").fields().requiredStri... | stheppi/eel | eel-components/src/test/scala/io/eels/component/avro/AvroSerializerTest.scala | Scala | apache-2.0 | 3,887 |
package konstructs.shard
import konstructs.api.Position
import konstructs.Db
case class ShardPosition(m: Int, n: Int, o: Int) {
def local(chunk: ChunkPosition): ChunkPosition =
ChunkPosition(
chunk.p - m * Db.ShardSize,
chunk.q - n * Db.ShardSize,
chunk.k - o * Db.ShardSize
)
}
object Sha... | konstructs/server | src/main/scala/konstructs/shard/ShardPosition.scala | Scala | mit | 809 |
import java.util.{Calendar, GregorianCalendar}
case class Meetup(month: Int, year: Int) {
private val thirteenth = new GregorianCalendar(year, month - 1, 13)
private val first = new GregorianCalendar(year, month - 1, 1)
private val nextMonth = first.addMonths(1)
def teenth(day: Int): Calendar = thirteenth.nex... | nlochschmidt/xscala | meetup/example.scala | Scala | mit | 1,452 |
/*
* 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 ... | wgpshashank/spark | mllib/src/test/scala/spark/mllib/regression/LogisticRegressionSuite.scala | Scala | apache-2.0 | 3,412 |
/*
* Scala (https://www.scala-lang.org)
*
* Copyright EPFL and Lightbend, Inc.
*
* Licensed under Apache License 2.0
* (http://www.apache.org/licenses/LICENSE-2.0).
*
* See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*/
package scala.runtime.java8
@... | martijnhoekstra/scala | src/library/scala/runtime/java8/JFunction0$mcJ$sp.scala | Scala | apache-2.0 | 515 |
package us.my_family.metrics.networking
import java.net.InetSocketAddress
import java.nio.ByteBuffer
import java.nio.channels.DatagramChannel
import java.nio.charset.Charset
import java.util.concurrent.Executors
import java.util.concurrent.ThreadFactory
import java.util.concurrent.TimeUnit
import scala.util.Try
impor... | thrykol/metrics-client | client/src/main/scala/us/my_family/metrics/networking/UdpConnection.scala | Scala | gpl-3.0 | 2,156 |
package autolift.cats
import cats.{Functor, Foldable}
import autolift.{LiftForAll, LiftForAllSyntax, LiftForAllContext}
//TODO: syntax is currently forAll vs forall. Make consistent?
trait CatsLiftForAll[Obj, Fn] extends LiftForAll[Obj, Fn] with Serializable
object CatsLiftForAll extends LowPriorityCatsLiftForAll {
... | wheaties/AutoLifts | autolift-cats/src/main/scala/autolift/cats/LiftForAll.scala | Scala | apache-2.0 | 1,219 |
import scala.math.Ordering
import scala.reflect.ClassTag
trait Sam { def apply(x: Int): String }
trait SamP[U] { def apply(x: Int): U }
class OverloadedFun[T](x: T) {
def foo(f: T => String): String = f(x)
def foo(f: Any => T): T = f("a")
def poly[U](f: Int => String): String = f(1)
def poly[U](f: Int => U):... | lrytz/scala | test/files/pos/overloaded_ho_fun.scala | Scala | apache-2.0 | 1,840 |
/*
* Copyright © 2014 TU Berlin (emma@dima.tu-berlin.de)
*
* 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 app... | emmalanguage/emma | emma-lib-flink/src/test/scala/org/emmalanguage/lib/ml/KFoldFlinkSpec.scala | Scala | apache-2.0 | 1,677 |
/*
* Copyright 2009-2010 LinkedIn, 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 ... | linkedin/norbert | cluster/src/test/scala/com/linkedin/norbert/jmx/JMXUnregisterSpec.scala | Scala | apache-2.0 | 919 |
package org.multibot
import org.pircbotx.cap.SASLCapHandler
object Multibottest {
val cache = InterpretersCache(List("#scala", "#scalaz", "#scala/scala"))
val PRODUCTION = Option(System getenv "multibot.production") exists (_.toBoolean)
//should be def so that security manager is enabled
private def gitterPas... | OlegYch/multibot | src/main/scala/org/multibot/Multibottest.scala | Scala | apache-2.0 | 2,122 |
package coder.simon.ch2
/**
* @author simon
*/
object E23 {
def curry[A, B, C](f: (A, B) => C): A => (B => C) = a => (b => f(a, b))
def uncurry[A, B, C](f: A => (B => C)): (A, B) => C = (a, b) => f(a)(b)
def compose[A, B, C](f: B => C, g: A => B): A => C = a => f(g(a))
} | erlangxk/fpscala | src/main/scala/coder/simon/ch2/E23.scala | Scala | mit | 282 |
/*
* Scala.js (https://www.scala-js.org/)
*
* Copyright EPFL.
*
* Licensed under Apache License 2.0
* (https://www.apache.org/licenses/LICENSE-2.0).
*
* See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*/
package java.util.regex
import scala.annotati... | scala-js/scala-js | javalib/src/main/scala/java/util/regex/Matcher.scala | Scala | apache-2.0 | 7,208 |
package edison.cli
import java.io.FileNotFoundException
import edison.cli.actions.{ ResultRecorder, SampleGenerator }
import edison.cli.io.IO
import edison.model.domain._
import edison.util.IntBytes.IntBytes
import edison.util.SmartFreeSpec
import edison.yaml.project.ParseError
import org.scalamock.scalatest.MockFact... | pawel-wiejacha/edison | service/src/test/scala/edison/cli/EdisonCliTest.scala | Scala | mit | 3,841 |
package models.support
case class UserId(v: Long) {
override def toString = "Us"+v
}
case class OrganizationId(v: Long) {
override def toString = "Or"+v
}
case class CourseId(v: Long) {
override def toString = "Co"+v
}
case class GameId(v: Long) {
override def toString = "Ga"+v
}
case class QuizId(v: Long)... | kristiankime/web-education-games | app/models/support/Ids.scala | Scala | mit | 559 |
/**
* This file is part of mycollab-services.
*
* mycollab-services 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.
*
* mycolla... | uniteddiversity/mycollab | mycollab-services/src/main/scala/com/esofthead/mycollab/schedule/email/SendingRelayEmailNotificationAction.scala | Scala | agpl-3.0 | 1,203 |
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2015-2021 Andre White.
*
* 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
*
* https://www.apache.org/licenses/LICENSE... | adarro/ddo-calc | subprojects/common/ddo-core/src/main/scala/io/truthencode/ddo/model/feats/AmaunatorFeatBase.scala | Scala | apache-2.0 | 1,004 |
/*
* 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/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/orc/OrcTable.scala | Scala | apache-2.0 | 2,643 |
/*
* 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/torch/CAddTableSpec.scala | Scala | apache-2.0 | 3,513 |
package framian
package csv
import spire.algebra._
import spire.std.string._
import spire.std.double._
import spire.std.int._
import spire.std.iterable._
import shapeless._
import java.io.{File, BufferedReader, FileReader}
class CsvSpec extends FramianSpec {
val csvRoot = "framian/src/test/resources/csvs/"
val ... | tixxit/framian | framian/src/test/scala/framian/CsvSpec.scala | Scala | apache-2.0 | 5,673 |
/*
* 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 ... | WeichenXu123/spark | external/kafka-0-10-sql/src/test/scala/org/apache/spark/sql/kafka010/KafkaMicroBatchSourceSuite.scala | Scala | apache-2.0 | 96,231 |
package io.getquill.context.sql.norm
import io.getquill.Spec
import io.getquill.context.sql.testContext._
import io.getquill.context.sql.testContext
class JoinSpec extends Spec {
"join + filter" in {
val q = quote {
qr1.leftJoin(qr2)
.on((a, b) => a.i == b.i)
.filter(_._2.map(_.i).forall(... | getquill/quill | quill-sql/src/test/scala/io/getquill/context/sql/norm/JoinSpec.scala | Scala | apache-2.0 | 4,140 |
package org.jetbrains.plugins.scala.debugger.exactBreakpoints
import com.intellij.debugger.SourcePosition
import com.intellij.debugger.engine.SourcePositionHighlighter
import com.intellij.psi.PsiDocumentManager
import com.intellij.util.DocumentUtil
import com.intellij.xdebugger.XDebuggerUtil
import org.jetbrains.plugi... | ghik/intellij-scala | test/org/jetbrains/plugins/scala/debugger/exactBreakpoints/ExactBreakpointTest.scala | Scala | apache-2.0 | 10,420 |
/*
* 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/iht-frontend | test/iht/views/ihtHelpers/custom/GenericOverviewTableItemTest.scala | Scala | apache-2.0 | 2,676 |
package com.ponkotuy.proxy
import java.net.InetSocketAddress
import javax.net.ssl.SSLSession
import io.netty.handler.codec.http.{HttpRequest,HttpResponse}
import io.netty.handler.codec.http.HttpHeaders
import org.littleshoot.proxy._
import com.ponkotuy.util.Log
class LoggingActivityTracker extends ActivityTrackerA... | ttdoda/MyFleetGirls | client/src/main/scala/com/ponkotuy/proxy/LoggingActivityTracker.scala | Scala | mit | 1,966 |
package com.datastax.spark.connector.japi
import scala.reflect.runtime.universe._
import com.datastax.spark.connector.types.{NullableTypeConverter, TypeConverter}
import com.datastax.spark.connector.{CassandraRowMetadata, UDTValue => ConnectorUDTValue}
final class UDTValue(val metaData: CassandraRowMetadata, val colu... | ponkin/spark-cassandra-connector | spark-cassandra-connector/src/main/scala/com/datastax/spark/connector/japi/UDTValue.scala | Scala | apache-2.0 | 789 |
/*
* 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 ... | zzcclp/carbondata | integration/spark/src/main/scala/org/apache/spark/sql/secondaryindex/events/AlterTableColumnRenameEventListener.scala | Scala | apache-2.0 | 8,104 |
package org.jetbrains.plugins.scala
package lang
package psi
package api
package statements
import com.intellij.psi.PsiClass
import org.jetbrains.plugins.scala.lang.psi.api.base.types.ScTypeElement
import org.jetbrains.plugins.scala.lang.psi.api.toplevel.ScTypeParametersOwner
import org.jetbrains.plugins.scala.lang.ps... | jastice/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/lang/psi/api/statements/ScTypeAliasDefinition.scala | Scala | apache-2.0 | 3,058 |
package ch.uzh.dyndco.algorithms.mgm
import collection.mutable.Map
import collection.mutable.Set
import com.signalcollect.AbstractVertex
import ch.uzh.dyndco.problems.MeetingConstraints
import scala.collection.mutable.MutableList
import com.signalcollect.Graph
import com.signalcollect.StateForwarderEdge
import ch.uzh.... | danihegglin/DynDCO | src/main/scala/ch/uzh/dyndco/algorithms/mgm/MGMGraph.scala | Scala | apache-2.0 | 1,664 |
package dc.json
import spray.json.DefaultJsonProtocol
case class CheckpointRow(id: String,
key: (Int, String),
value: Checkpoint)
object CheckpointRow extends DefaultJsonProtocol {
implicit val checkpointRowFormat = jsonFormat3(CheckpointRow.apply)
} | MagnusAk78/dynamic-checklist-server | tools/src/main/scala/dc/json/CheckpointRow.scala | Scala | gpl-3.0 | 305 |
/*
* Copyright (c) 2013-2016 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... | bigdecisions/snowplow | 2-collectors/scala-stream-collector/project/BuildSettings.scala | Scala | apache-2.0 | 2,476 |
import sbt._
object Version {
final val Scala = "2.11.8"
final val ScalaTest = "3.0.0"
}
object Library {
val scalaTest = "org.scalatest" %% "scalatest" % Version.ScalaTest
}
| beikern/functional-programming-scala | project/Dependencies.scala | Scala | apache-2.0 | 187 |
def contains[T](elem: T): Boolean = this match {
case Niil => false
case head ::: tail => head == elem || tail.contains(elem)
}
| grzegorzbalcerek/scala-exercises | Liist/stepLiistContains.scala | Scala | bsd-2-clause | 132 |
package de.choffmeister.auth.common.util
private[auth] object SequenceUtils {
def compareConstantTime[T](s1: Seq[T], s2: Seq[T]): Boolean = {
var res = true
val l = Math.max(s1.length, s2.length)
for (i <- 0 until l) {
if (s1.length <= i || s2.length <= i || s1(i) != s2(i)) {
res = false
... | choffmeister/auth-utils | auth-common/src/main/scala/de/choffmeister/auth/common/util/SequenceUtils.scala | Scala | mit | 346 |
package com.mindcandy.data.kryo.serializer
import com.esotericsoftware.kryo.io.{ Input, Output }
import com.esotericsoftware.kryo.{ Kryo, Serializer }
import com.googlecode.javaewah.{ EWAHCompressedBitmap => CBitSet }
import java.io.{ DataInputStream, DataOutputStream }
import scalaz.syntax.id._
class CBitSetSerializ... | lvicentesanchez/fast-gt-perfect | src/main/scala/com/mindcandy/data/kryo/serializer/CBitSetSerializer.scala | Scala | mit | 667 |
package ilc
package feature
package maps
trait Types extends base.Types {
case class MapType(keyType: Type, valType: Type) extends Type {
override def traverse(f: Type => Type): Type = copy(f(keyType), f(valType))
}
}
| inc-lc/ilc-scala | src/main/scala/ilc/feature/maps/Types.scala | Scala | mit | 227 |
/*
* Copyright 2015 - 2016 Red Bull Media House GmbH <http://www.redbullmediahouse.com> - all rights reserved.
*
* 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... | RBMHTechnology/eventuate | eventuate-adapter-vertx/src/main/scala/com/rbmhtechnology/eventuate/adapter/vertx/VertxBatchConfirmationSender.scala | Scala | apache-2.0 | 1,970 |
/*
* 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 ... | someorz/spark | sql/core/src/test/scala/org/apache/spark/sql/streaming/FlatMapGroupsWithStateSuite.scala | Scala | apache-2.0 | 42,956 |
package codesniffer.deckard.search
import java.io.File
import java.lang.reflect.Modifier
import java.util
import java.util.concurrent.atomic.{AtomicInteger, AtomicLong, AtomicReference}
import codesniffer.core._
import codesniffer.deckard.vgen.{SkipLocksVecGen, DirScanConfig, SrcScanner, Context}
import code... | xkommando/CodeSniffer | deckard/src/main/scala/codesniffer/deckard/search/NodeCount.scala | Scala | lgpl-3.0 | 3,859 |
package views.vrm_assign
object Error {
final val StartAgainId = "start-again"
} | dvla/vrm-assign-online | app/views/vrm_assign/Error.scala | Scala | mit | 84 |
package igor
import igor.experiment.{Experiment, Stage}
/**
* @author jda
*/
class PrecomputeFeatures(val corpusPath: Int) extends Stage {
override def run(experiment: Experiment): Unit = {
logger.info("Hello, world!")
}
}
| dlwh/igor | src/test/scala/igor/PrecomputeFeatures.scala | Scala | apache-2.0 | 235 |
package shield.actors.config.domain
import akka.actor.{ActorSystem, Props}
import akka.testkit.{TestActorRef, TestKit, TestProbe}
import org.scalatest.{BeforeAndAfterAll, MustMatchers, WordSpecLike}
import shield.actors.ShieldActorMsgs
import shield.config.Settings
class StaticDomainWatcherSpec extends TestKit(ActorS... | RetailMeNot/shield | src/test/scala/shield/actors/config/domain/StaticDomainWatcherSpec.scala | Scala | mit | 858 |
/**
* 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... | snadakuduru/camel | components/camel-swagger/src/main/scala/org/apache/camel/component/swagger/RestApiListingCache.scala | Scala | apache-2.0 | 1,836 |
/**
* Copyright 2011 Havoc Pennington
* derived from Salat,
* Copyright 2010-2011 Novus Partners, Inc. <http://novus.com>
*
* 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://w... | havocp/mongo-scala-thingy | src/main/scala/com/ometer/ClassAnalysis.scala | Scala | apache-2.0 | 13,725 |
package com.twitter.finagle.stream
import com.twitter.concurrent._
import com.twitter.conversions.time._
import com.twitter.finagle.builder.{ClientBuilder, ServerBuilder}
import com.twitter.finagle.{Service, ServiceProxy, TooManyConcurrentRequestsException}
import com.twitter.util._
import java.net.{InetAddress, InetS... | mosesn/finagle | finagle-stream/src/test/scala/com/twitter/finagle/stream/EndToEndTest.scala | Scala | apache-2.0 | 11,272 |
/*
* 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/hive/src/main/scala/org/apache/spark/sql/hive/HiveStrategies.scala | Scala | apache-2.0 | 11,720 |
package com.faacets
package object families {
def write {
Acin2004.write
CGLMP2002.write
AcinCGLMP2005.write
CollinsGisin2004.write
Grandjean2012.write
Mermin1990.write
Sliwa2003.write
}
}
| denisrosset/faacets-families | src/main/scala/families/package.scala | Scala | bsd-3-clause | 222 |
package de.csmath.scalog
import de.csmath.scalog.Types._
import de.csmath.scalog.substitution.Substitution
object Unifier {
def apply(t1: Term, t2: Term): Option[Substitution] = (t1,t2) match {
case (Var(_),_) if t1 == t2 =>
Some(Substitution())
case (Var(x),Var(_)) =>
Some(Substitution(Map(Var... | lpcsmath/scalog | src/main/scala/de/csmath/scalog/Unifier.scala | Scala | bsd-2-clause | 1,512 |
// scalac: -Werror -Wunused:nowarn -Xsource:3
//
class C extends java.lang.CharSequence {
def charAt(x$1: Int): Char = ???
def length: Int = ???
def subSequence(x$1: Int, x$2: Int): CharSequence = ???
}
// Welcome to the Happy J
class J { override def toString = "Happy J" }
| scala/scala | test/files/pos/nullary-override-3.scala | Scala | apache-2.0 | 282 |
package eu.phisikus.plotka.framework.fsm
import scala.beans.BeanProperty
/**
* It represents a finite-state machine (Mealy machine)
*/
trait StateMachine {
/**
* Call this function to make state machine aware of a new event.
*
* @param event event to be published
*/
def push(event: Event): Un... | phisikus/plotka | framework/src/main/scala/eu/phisikus/plotka/framework/fsm/StateMachine.scala | Scala | bsd-3-clause | 423 |
package io.github.marad.swt.builder
import org.eclipse.swt.SWT
import org.eclipse.swt.widgets._
import scala.util.DynamicVariable
trait Controls {
protected def context: DynamicVariable[Composite]
def label() : Label = new Label(context.value, SWT.NONE)
def label(style:Int) : Label = new Label(context.value, ... | marad/scala-swt-builder | src/main/scala/io/github/marad/swt/builder/Controls.scala | Scala | lgpl-3.0 | 1,244 |
/**
* Copyright (c) 2015, Cloudera, Inc. All Rights Reserved.
*
* Cloudera, Inc. licenses this file to you 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/LIC... | cloudera/spark-timeseries | src/main/scala/com/cloudera/sparkts/PythonConnector.scala | Scala | apache-2.0 | 2,964 |
class Hi(name: String) {
def hi = "Hi "+name+"!"
}
| grzegorzbalcerek/scala-book-examples | examples/TraitParams1.scala | Scala | mit | 53 |
package blended.updater.config
import org.scalatest.FreeSpec
import org.scalatest.prop.PropertyChecks
class ProfileSpec extends FreeSpec with PropertyChecks {
import TestData._
"Profile maps to SingleProfile" in {
forAll { profile: ProfileGroup =>
val singles = profile.toSingle
assert(singles.si... | lefou/blended | blended.updater.config/shared/src/test/scala/blended/updater/config/ProfileSpec.scala | Scala | apache-2.0 | 653 |
package examples
object properConstantFunction extends App {
// https://apocalisp.wordpress.com/2010/04/21/a-proper-constant-function-in-scala/
def const[A, B](a: A) = (b: B) => a
// problems
// 1. b is always evaluated
// 2. it is not properly quantified
// > const(7)(error("too strict"))
type Id[A]... | adilakhter/scalaznoob | src/main/scala/examples/properConstantFunction.scala | Scala | apache-2.0 | 375 |
package remote
import java.net.URL
import java.net.HttpURLConnection
import java.util.Scanner
object `package` {
def get(url: String): String =
try {
val conn =
(new URL(url)).openConnection.asInstanceOf[HttpURLConnection]
conn.setInstanceFollowRedirects(false)
conn.setRequestMethod("... | earldouglas/xsbt-web-plugin | src/sbt-test/container/multi-module-multi-webapp/remoteweb/src/main/scala/remote.scala | Scala | bsd-3-clause | 600 |
package chandu0101.scalajs.react.components.materialui
import chandu0101.macros.tojs.JSMacro
import japgolly.scalajs.react._
import materialui.Mui
import scala.scalajs.js
case class MuiRaisedButton(onBlur: js.UndefOr[ReactEventH => Unit] = js.undefined,
labelStyle: js.UndefOr[js.Any] = js... | mproch/scalajs-react-components | core/src/main/scala/chandu0101/scalajs/react/components/materialui/MuiRaisedButton.scala | Scala | apache-2.0 | 2,117 |
package com.telrikk.archivist.storage
case class Parent (`type`: String)
| Telrikk/Archivist | src/main/scala/com.telrikk/archivist/storage/Parent.scala | Scala | mit | 74 |
package playground
import org.scalatest.FunSuite
class FactorialPlaygroundTests extends FunSuite {
test("Factorial of method with TailRecursion 3 should return 6"){
assert(new FactorialPlayground().fact(3) == 6)
}
test("Factorial of 3 should return 6"){
assert(new FactorialPlayground().factNoTailRecu... | sagasu/scalaPlayground | sbt/src/test/scala-2.11/playground/FactorialPlaygroundTests.scala | Scala | apache-2.0 | 340 |
/**
* 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... | mohanaraosv/servicemix | itests/src/test/scala/org/apache/servicemix/itests/CamelTestSupport.scala | Scala | apache-2.0 | 1,778 |
package com.twitter.server.handler
import com.twitter.conversions.DurationOps._
import com.twitter.finagle.Service
import com.twitter.finagle.http.{Request, Response, Status, Uri}
import com.twitter.io.Buf
import com.twitter.jvm.CpuProfile
import com.twitter.server.util.HttpUtils.newResponse
import com.twitter.util.lo... | twitter/twitter-server | server/src/main/scala/com/twitter/server/handler/ProfileResourceHandler.scala | Scala | apache-2.0 | 1,747 |
package io.gatling
import io.gatling.core.check.CheckBuilder
import io.gatling.tcp.check.TcpCheck
package object tcp {
type TcpCheckBuilder = CheckBuilder[TcpCheck, String, _, String]
}
| snripa/gatling-tcp-extensions | src/main/scala/io/gatling/tcp/package.scala | Scala | mit | 190 |
package edu.rice.habanero.actors
import java.util.concurrent.atomic.AtomicBoolean
import edu.rice.hj.runtime.util.ModCountDownLatch
import scala.actors.Actor
/**
*
* @author <a href="http://shams.web.rice.edu/">Shams Imam</a> (shams@rice.edu)
*/
object ScalaActorState {
val actorLatch = new ModCountDownLatch(0... | shamsmahmood/savina | src/main/scala/edu/rice/habanero/actors/ScalaActor.scala | Scala | gpl-2.0 | 1,986 |
/*
* 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 ... | ddna1021/spark | sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/PredicateSuite.scala | Scala | apache-2.0 | 17,394 |
package templemore.sbt
import _root_.sbt._
import java.io.File
/**
* @author Chris Turner
*/
class JRuby(val classpath: PathFinder,
val scalaLibraryPath: Path,
val defaultArgs: List[String],
val jRubyHome: Path,
val gemPath: Path,
val maxMemory: String,
... | skipoleschris/cucumber-sbt-plugin | src/main/scala/templemore/sbt/JRuby.scala | Scala | apache-2.0 | 1,526 |
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.