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 |
|---|---|---|---|---|---|
/***********************************************************************
* 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-accumulo/geomesa-accumulo-raster/src/main/scala/org/locationtech/geomesa/raster/data/RasterQuery.scala | Scala | apache-2.0 | 956 |
/* Copyright 2009-2016 EPFL, Lausanne */
import leon.lang._
object ExpressionOrder1 {
def test1 = {
var x = 0
def bar(y: Int) = {
def fun(z: Int) = 1 * x * (y + z)
fun(3)
}
bar(2) == 0
}.holds
}
| regb/leon | src/test/resources/regression/verification/xlang/valid/ExpressionOrder1.scala | Scala | gpl-3.0 | 234 |
///////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2014 Adobe Systems Incorporated. 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 ... | alexanderfield/spindle | src/main/scala/QueryServiceActor.scala | Scala | apache-2.0 | 4,699 |
object Test {
implicit class Foo
implicit def Foo = new Foo
}
| som-snytt/dotty | tests/untried/neg/t5728.scala | Scala | apache-2.0 | 69 |
/*
* Copyright (C) 2005, The Beangle Software.
*
* This program 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 3 of the License, or
* (at your option) any later version.
*
* This... | beangle/data | hibernate/src/test/scala/org/beangle/data/hibernate/HibernateConfigTest.scala | Scala | lgpl-3.0 | 4,185 |
package com.dslplatform.test
import com.dslplatform.api.patterns.{PersistableRepository, Repository, SearchableRepository, ServiceLocator}
import com.dslplatform.test.simple.{Self, Selfy, SimpleRoot, SimpleSnow}
import org.specs2.mutable._
import org.specs2.specification.Step
class SnowflakeTest extends Specification... | ngs-doo/dsl-client-scala | http/src/test/scala/com/dslplatform/test/SnowflakeTest.scala | Scala | bsd-3-clause | 2,587 |
package spgui.widgets.itemexplorer
trait DirectoryItem {
val name: String
// TODO: will be a string/UUID
val id: String
}
case class Directory(name: String, id: String, childrenIds: Seq[String]) extends DirectoryItem
class RootDirectory(private var _items: Seq[DirectoryItem]) {
private val nestedItemIds = _it... | kristoferB/SP | spgui/src/main/scala/spgui/widgets/itemexplorer/RootDirectory.scala | Scala | mit | 2,494 |
package org.pgscala
package builder
package converters
object PGNullableIntegerConverterBuilder extends PGPredefNullableConverterBuilder {
val pgType = "integer"
val clazz = "java.lang.Integer"
val to = "Integer.toString(i)"
val from = "Integer.valueOf(i)"
}
| melezov/pgscala | builder/src/main/scala/org/pgscala/builder/converters/java/PGNullableIntegerConverterBuilder.scala | Scala | bsd-3-clause | 271 |
/*
* (c) Copyright 2016 Hewlett Packard Enterprise Development LP
*
* 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 b... | hpe-cct/cct-core | src/main/scala/cogx/compiler/gpu_operator/expression/UnaryFloatExpression.scala | Scala | apache-2.0 | 1,269 |
package twentysix.playr.wrappers
import twentysix.playr.ResourceCaps
import twentysix.playr.core.BaseResource
import play.api.mvc.EssentialAction
import twentysix.playr.core.ResourceUpdate
import twentysix.playr.RouteFilterContext
import play.api.mvc.Handler
import play.api.mvc.RequestHeader
import twentysix.playr.cor... | 26lights/PlayR | src/main/scala/twentysix/playr/wrappers/UpdateResourceWrapper.scala | Scala | bsd-3-clause | 2,445 |
/*
* Copyright (c) 2014-2018 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... | Wogan/monix | monix-reactive/shared/src/main/scala/monix/reactive/internal/operators/UncancelableObservable.scala | Scala | apache-2.0 | 1,448 |
/*
* 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 ... | tillrohrmann/flink | flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/planner/runtime/stream/sql/DeduplicateITCase.scala | Scala | apache-2.0 | 10,295 |
package fp_in_scala.chapter_03
import scala.annotation.tailrec
import scala.collection.immutable
object ListUtils {
def setHead[A](as: List[A])(newHead: A): List[A] = as match {
case Nil => Nil
case Cons(head, tail) => Cons(newHead, tail)
}
implicit def fromScala[A](scalaList: scala.List[A]): List[A] =... | jankeesvanandel/fp-in-scala | src/main/scala/fp_in_scala/chapter_03/ListUtils.scala | Scala | apache-2.0 | 3,421 |
package com.theseventhsense.datetime
import java.util.Date
/**
* Created by erik on 6/15/16.
*/
abstract class AbstractImplicits extends Serializable {
implicit def dateOrdering: Ordering[Date] =
Ordering.fromLessThan(_.getTime < _.getTime)
}
| 7thsense/utils-datetime | shared/src/main/scala/com/theseventhsense/datetime/AbstractImplicits.scala | Scala | mit | 256 |
/*
Copyright (c) 2017, Qvantel
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following di... | Doikor/jsonapi-scala | core/src/main/scala/com/qvantel/jsonapi/ApiRoot.scala | Scala | bsd-3-clause | 1,629 |
/*
* Copyright (C) 2016-2019 Lightbend Inc. <https://www.lightbend.com>
*/
package com.lightbend.lagom.sbt.scripted
import java.io.BufferedReader
import java.io.InputStreamReader
import java.net.HttpURLConnection
import com.lightbend.lagom.sbt.Internal
import com.lightbend.lagom.sbt.LagomPlugin
import com.lightben... | rcavalcanti/lagom | dev/sbt-scripted-tools/src/main/scala/com/lightbend/lagom/sbt/scripted/ScriptedTools.scala | Scala | apache-2.0 | 9,265 |
/*
Copyright 2013 Josh Conrad
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
di... | jmconrad/scala-groupcache | src/main/scala/groupcache/lru/CacheStats.scala | Scala | apache-2.0 | 1,148 |
/**
* Copyright (C) 2010 Orbeon, Inc.
*
* This program 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 option) any later version.
*
* This program i... | evlist/orbeon-forms | src/test/scala/org/orbeon/oxf/test/DocumentTestBase.scala | Scala | lgpl-2.1 | 1,888 |
package scala.scalajs.runtime
import java.lang.{Long => JLong}
/** Explicit box for longs when doing a reflective call.
* This class and its methods are only here to properly support reflective
* calls on longs.
*/
class LongReflectiveCall(value: Long) {
// Methods of java.lang.Long
def byteValue(): Byte =... | matthughes/scala-js | library/src/main/scala/scala/scalajs/runtime/LongReflectiveCall.scala | Scala | bsd-3-clause | 4,749 |
package ozmi.lambda_core.sql
import org.kiama.output._
sealed abstract class SqlExpr extends PrettyExpression
sealed abstract class Relation extends SqlExpr
case class ObjectRef (schemaName : Option[String], objectName : String) extends Relation
case class Rename (baseRel : Relation, newName : String) extends Relati... | ozmi/lambda_core | src/main/scala/ozmi/lambda_core/sql/SqlExpr.scala | Scala | mit | 2,006 |
package de.zalando.beard.performance
import com.github.jknack.handlebars.Handlebars
import com.github.jknack.handlebars.io.ClassPathTemplateLoader
import org.scalameter.api._
import scala.collection.JavaConverters._
/**
* @author dpersa
*/
object HandlebarsBenchmark extends Bench.LocalTime {
val loader = new Cl... | danpersa/beard | src/test/scala/de/zalando/beard/performance/HandlebarsBenchmark.scala | Scala | apache-2.0 | 1,094 |
// Solution-4.scala
// Solution to Exercise 4 in "Overloading"
class FunNumbers2 {
def f(i:Int, j:Int):Double = { i + j }
// This won't work (redefined function, different only in return type):
def f(i:Int, j:Int):Int = { i + j }
}
/* OUTPUT_SHOULD_CONTAIN
error: method f is defined twice
def f(i:Int, j:Int)... | P7h/ScalaPlayground | Atomic Scala/atomic-scala-solutions/24_Overloading/Solution-4.scala | Scala | apache-2.0 | 364 |
package org.jetbrains.plugins.scala.lang.psi.stubs
import com.intellij.psi.stubs.StubElement
import org.jetbrains.plugins.scala.lang.psi.api.base.ScStableCodeReference
import org.jetbrains.plugins.scala.lang.psi.api.toplevel.imports.ScImportSelector
import org.jetbrains.plugins.scala.lang.psi.stubs.impl.ScTypeElementO... | JetBrains/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/lang/psi/stubs/ScImportSelectorStub.scala | Scala | apache-2.0 | 696 |
package de.csmath.scalog
object Types {
sealed trait PrologType
trait Term extends PrologType
case class Var(name: String) extends Term with PlList
trait Const extends Term
case class Atom(name: String) extends Const
case class ConstInt(value: Int) extends Const
case class ConstStr(value: String) exten... | lpcsmath/scalog | src/main/scala/de/csmath/scalog/Types.scala | Scala | bsd-2-clause | 731 |
package gines.simulation
class Cell(val typ: CellType)
sealed abstract class CellType {
val name: String
}
case object School extends CellType {
val name: String = "School"
}
case object Work extends CellType {
val name: String = "Work"
}
case object Home extends CellType {
val name: String = "Home"
}
cas... | mikusp/gines | src/main/scala/gines/simulation/Cell.scala | Scala | gpl-3.0 | 391 |
package com.sksamuel.elastic4s.requests.searches.aggs
import com.sksamuel.exts.OptionImplicits._
case class MissingAggregation(name: String,
field: Option[String] = None,
subaggs: Seq[AbstractAggregation] = Nil,
metadata: Map[St... | stringbean/elastic4s | elastic4s-core/src/main/scala/com/sksamuel/elastic4s/requests/searches/aggs/MissingAggregation.scala | Scala | apache-2.0 | 659 |
package adtoyou.spark.analysis
import aiouniya.spark.MyRDDFunctions._
import aiouniya.spark.common.Constants._
import aiouniya.spark.common.MacPartitioner
import org.apache.hadoop.fs.{FileSystem, Path}
import org.apache.hadoop.hbase.client.ConnectionFactory
import org.apache.hadoop.hbase.io.ImmutableBytesWritab... | 7u/spark-learning | spark.learning/spark_test/src/main/scala/adtoyou/spark/analysis/MacImeiRestore.scala | Scala | apache-2.0 | 3,617 |
package org.scalacoin.util
import org.scalacoin.protocol.script.{ScriptPubKey, ScriptSignature}
import org.scalacoin.protocol.{CompactSizeUInt, CompactSizeUIntImpl}
import org.slf4j.LoggerFactory
/**
* Created by chris on 2/8/16.
*/
trait NumberUtil extends BitcoinSLogger {
/**
* Takes a hex number and conver... | TomMcCabe/scalacoin | src/main/scala/org/scalacoin/util/NumberUtil.scala | Scala | mit | 6,487 |
/*
* ******************************************************************************
* * Copyright (C) 2013 Christopher Harris (Itszuvalex)
* * [email protected]
* *
* * This program is free software; you can redistribute it and/or
* * modify it under the terms of the GNU General Public License
* * as p... | Itszuvalex/Femtocraft-alpha-1 | src/main/java/com/itszuvalex/femtocraft/industry/traits/IndustryBehavior.scala | Scala | gpl-2.0 | 1,623 |
package com.twitter.algebird
import scala.collection.compat._
object Scan {
/**
* Most consumers of Scan don't care about the type of the type State type variable. But for those that do,
* we make an effort to expose it in all of our combinators.
* @tparam I
* @tparam S
* @tparam O
*/
type Aux[... | twitter/algebird | algebird-core/src/main/scala/com/twitter/algebird/Scan.scala | Scala | apache-2.0 | 13,856 |
package net.sansa_stack.rdf.spark.qualityassessment.metrics.conciseness
import net.sansa_stack.rdf.common.qualityassessment.utils.NodeUtils._
import net.sansa_stack.rdf.common.qualityassessment.utils.vocabularies.DQV
import org.apache.jena.graph.{ Node, Triple }
import org.apache.spark.rdd.RDD
import org.apache.spark.... | SANSA-Stack/Spark-RDF | sansa-rdf-spark/src/main/scala/net/sansa_stack/rdf/spark/qualityassessment/metrics/conciseness/ExtensionalConciseness.scala | Scala | gpl-3.0 | 1,639 |
import scala.language.postfixOps
import scala.util._
import scala.util.control.NonFatal
import scala.concurrent._
import scala.concurrent.duration._
import ExecutionContext.Implicits.global
import scala.async.Async.{async, await}
/** Contains basic data types, data structures and `Future` extensions.
*/
package objec... | albertpastrana/reactive | nodescala/src/main/scala/nodescala/package.scala | Scala | mit | 6,172 |
/*
* 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 ... | sclearn/sclearn | sc/src/main/scala/io/github/sclearn/dataset/spark/util/Utils.scala | Scala | apache-2.0 | 4,737 |
package eu.pepot.eu.spark.inputsplitter.common.file.matcher
import java.io.{File, FileNotFoundException}
import eu.pepot.eu.spark.inputsplitter.helper.TestsHelper._
import eu.pepot.eu.spark.inputsplitter.common.file.{FileDetails, FileDetailsSet}
import org.apache.hadoop.fs.Path
import org.specs2.mutable.Specification... | mauriciojost/spark-input-splitter | src/test/scala/eu/pepot/eu/spark/inputsplitter/common/file/matcher/FilesMatcherSpec.scala | Scala | apache-2.0 | 2,025 |
package dotty.tools.scaladoc
sealed trait EngineQuery
case class EngineMatchersQuery(matchers: List[Matchers]) extends EngineQuery
case class BySignature(signature: String) extends EngineQuery
sealed trait Matchers extends Function1[PageEntry, Int]
case class ByName(query: String) extends Matchers:
val tokens = St... | dotty-staging/dotty | scaladoc-js/main/src/searchbar/engine/Matchers.scala | Scala | apache-2.0 | 1,154 |
/*
* Copyright (c) 2014-2016
* nonblocking.at gmbh [http://www.nonblocking.at]
*
* This file is part of Cliwix.
*
* Cliwix is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the... | nonblocking/cliwix | cliwix-core/src/main/scala/at/nonblocking/cliwix/core/validation/DefaultCompanyLiferayConfigValidator.scala | Scala | agpl-3.0 | 3,130 |
package org.openurp.edu.eams.teach.service
import org.beangle.commons.lang.time.YearWeekTime
import org.openurp.edu.base.Student
trait StudentTimeService {
def isOccupied(time: YearWeekTime, stds: Student*): Boolean
}
| openurp/edu-eams-webapp | core/src/main/scala/org/openurp/edu/eams/teach/service/StudentTimeService.scala | Scala | gpl-3.0 | 225 |
package org.apache.spark.sql.ext
import org.apache.spark.sql.catalyst.expressions._
import org.apache.spark.sql._
import scala.language.implicitConversions
// scalastyle:off
object functions {
// scalastyle:on
private[this] implicit def toColumn(expr: Expression): Column = Column(expr)
// TODO: Workaround fo... | mr1azl/spark-ext | sparkext-sql/src/main/scala/org/apache/spark/sql/ext/functions.scala | Scala | apache-2.0 | 441 |
package mesosphere.marathon
package core.deployment
import akka.Done
import akka.actor.{ ActorRef, Props }
import akka.event.EventStream
import akka.stream.Materializer
import mesosphere.marathon.core.deployment.impl.{ DeploymentActor, DeploymentManagerActor, DeploymentManagerDelegate }
import mesosphere.marathon.core... | janisz/marathon | src/main/scala/mesosphere/marathon/core/deployment/DeploymentModule.scala | Scala | apache-2.0 | 2,049 |
package es.udc.graph.utils
import breeze.linalg._
import breeze.numerics.{sqrt, pow, exp}
import breeze.stats.distributions.{ThreadLocalRandomGenerator, RandBasis}
import org.apache.commons.math3.random.MersenneTwister
import scala.math.Pi
/**
* Multivariate Gaussian
*
* Created by David Martinez Rego on 16/11/15.... | eirasf/KNiNe | src/main/scala/es/udc/graph/utils/MultivariateGaussian.scala | Scala | gpl-2.0 | 2,185 |
/*
* Copyright 2014–2020 SlamData 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... | slamdata/quasar | qsu/src/main/scala/quasar/qsu/QScriptUniform.scala | Scala | apache-2.0 | 26,516 |
package net.debasishg.codemesh.domain.trade
package model
import scalaz._
import Scalaz._
import \\/._
trait ContractNoteModel {this: TradeModel =>
val isAddressDefined = true
case class ContractNote(trade: Trade)
def makeContractNote(trade: Trade): \\/[String, ContractNote] =
if (isAddressDefined) right(C... | debasishg/codemesh14 | src/main/scala/net/debasishg/codemesh/contractnotemodel.scala | Scala | apache-2.0 | 373 |
package com.mesosphere.universe.v3.model
case class Images(
iconSmall: String,
iconMedium: String,
iconLarge: String,
screenshots: Option[List[String]]
)
| movicha/cosmos | cosmos-model/src/main/scala/com/mesosphere/universe/v3/model/Images.scala | Scala | apache-2.0 | 163 |
package org.greenrd.seraphim
import java.io.File
import com.typesafe.scalalogging.LazyLogging
import scala.sys.process.{Process, ProcessBuilder}
class GitRepo (val path: File) extends LazyLogging {
if (!path.exists()) {
path.mkdir()
}
require(path.isDirectory)
private def runProcess(processBuilder: Pr... | greenrd/project-seraphim | src/main/scala/org/greenrd/seraphim/GitRepo.scala | Scala | mit | 484 |
import scala.language.experimental.macros
import scala.reflect.macros.blackbox.Context
trait Iso[T, U] {
def to(t : T) : U
// def from(u : U) : T
}
object Iso {
implicit def materializeIso[T, U]: Iso[T, U] = macro impl[T, U]
def impl[T: c.WeakTypeTag, U: c.WeakTypeTag](c: Context): c.Expr[Iso[T, U]] = {
i... | folone/dotty | tests/untried/neg-with-implicits/macro-blackbox-fundep-materialization/Macros_1.scala | Scala | bsd-3-clause | 1,781 |
/*
* 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 ... | dbtsai/spark | sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala | Scala | apache-2.0 | 98,005 |
package io.peregrine
object ErrorHandler {
def apply(request: Request, e: Throwable, controllers: ControllerCollection) = {
request.error = Some(e)
ResponseAdapter(request, controllers.errorHandler(request))
}
} | dvarelap/stilt | src/main/scala/io/peregrine/ErrorHandler.scala | Scala | apache-2.0 | 225 |
/*
* Copyright 2012 Eike Kettner
*
* 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... | eikek/publet | publet/src/main/scala/org/eknet/publet/vfs/Resource.scala | Scala | apache-2.0 | 3,499 |
/*
* Copyright (C) 2013 Alcatel-Lucent.
*
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
* Licensed 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 cop... | molecule-labs/molecule | molecule-core/src/main/scala/molecule/stream/ichan/StatefulIChan.scala | Scala | apache-2.0 | 881 |
package scorex.network.message
import java.net.{InetAddress, InetSocketAddress}
import java.util
import com.google.common.primitives.{Bytes, Ints}
case class PeersMessage(peers: Seq[InetSocketAddress]) extends Message {
import scorex.network.message.PeersMessage._
override val messageType = Message.PeersType
... | beni55/Scorex-Lagonaki | src/main/scala/scorex/network/message/PeersMessage.scala | Scala | cc0-1.0 | 1,617 |
/**********************************************************************************************************************
* This file is part of Scrupal, a Scalable Reactive Web Application Framework for Content Management *
* ... | scrupal/scrupal | scrupal-utils/src/main/scala/scrupal/utils/ConfigHelpers.scala | Scala | apache-2.0 | 3,500 |
package org.apache.predictionio.examples.experimental.cleanupapp
import org.apache.predictionio.controller.IEngineFactory
import org.apache.predictionio.controller.Engine
import org.apache.predictionio.controller._
case class Query(q: String) extends Serializable
case class PredictedResult(p: String) extends Seriali... | alex9311/PredictionIO | examples/experimental/scala-cleanup-app/src/main/scala/Engine.scala | Scala | apache-2.0 | 549 |
/*
* Copyright (c) 2014 Paul Bernard
*
* 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... | quantintel/spectrum | financial/src/main/scala/org/quantintel/ql/instruments/options/Swaption.scala | Scala | apache-2.0 | 1,099 |
package org.elasticmq.rest.sqs.directives
import akka.http.scaladsl.server.{Directives, Route}
import org.elasticmq.rest.sqs.{ActorSystemModule, QueueManagerActorModule}
import org.elasticmq.util.Logging
trait ElasticMQDirectives
extends Directives
with RespondDirectives
with FutureDirectives
with Exc... | adamw/elasticmq | rest/rest-sqs/src/main/scala/org/elasticmq/rest/sqs/directives/ElasticMQDirectives.scala | Scala | apache-2.0 | 1,312 |
/*
* Copyright 2017-2022 John Snow Labs
*
* 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... | JohnSnowLabs/spark-nlp | src/main/scala/com/johnsnowlabs/nlp/Doc2Chunk.scala | Scala | apache-2.0 | 11,516 |
package se.culvertsoft.mgen.cpppack.generator.impl.classh
import scala.collection.JavaConversions.asScalaBuffer
import se.culvertsoft.mgen.api.model.ClassType
import se.culvertsoft.mgen.compiler.util.SourceCodeBuffer
object MkUsingStatements {
def apply(t: ClassType)(implicit txtBuffer: SourceCodeBuffer) {
i... | culvertsoft/mgen | mgen-cppgenerator/src/main/scala/se/culvertsoft/mgen/cpppack/generator/impl/classh/MkUsingStatememts.scala | Scala | mit | 455 |
package graphics
import java.awt.Color
import java.awt.Font
import java.awt.Graphics
import java.util.ArrayList
import game._
import structures._
/**
* Class for the Menu Screen functions.
* @author Sean Lewis
*/
object MenuScreen {
private def instructionStrings = Array(
"P: pause",
"R: reset",
"Ri... | splewis/GravityGolf | src/main/scala/graphics/MenuScreen.scala | Scala | mit | 2,293 |
/*
* Copyright 2014-2021 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... | brharrington/atlas | atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/SourceRef.scala | Scala | apache-2.0 | 995 |
package org.http4s
package headers
object `Content-Location` extends HeaderKey.Default
| ZizhengTai/http4s | core/src/main/scala/org/http4s/headers/Content-Location.scala | Scala | apache-2.0 | 89 |
/*
* 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 ... | michalsenkyr/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/SelectedField.scala | Scala | apache-2.0 | 5,983 |
/*
* Copyright (C) 2013 FURYU CORPORATION
*
* 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 option) any later version.
*
* This li... | Furyu/play-c3p0-plugin | src/main/scala/jp/furyu/play/c3p0/C3p0Plugin.scala | Scala | lgpl-2.1 | 8,008 |
package services
import scala.concurrent.Future
import javax.inject.Singleton
import play.api.Play.current
import play.api.libs.concurrent.Execution.Implicits.defaultContext
import play.modules.reactivemongo.ReactiveMongoPlugin
import play.modules.reactivemongo.json.collection.JSONCollection
import reactivemongo.bson... | jriecken/shorty | app/services/MongoCounterService.scala | Scala | mit | 1,563 |
package models
import anorm._
import scala.language.postfixOps
import java.sql.Connection
object PasswordDictionary {
def isNaivePassword(password: String)(implicit conn: Connection) =
SQL(
"select count(*) from password_dict where password = {password}"
).on(
'password -> password
).as(Sql... | ruimo/store2 | app/models/PasswordDictionary.scala | Scala | apache-2.0 | 355 |
package debop4s.core.parallels
import java.util.concurrent.{Callable, ThreadLocalRandom}
import debop4s.core.{JAction1, JFunction}
import scala.collection.Seq
/**
* 작업을 병렬로 처리하게 해주는 Object 입니다.
*
* @author 배성혁 [email protected]
* @since 2013. 12. 11. 오후 1:18
*/
object Parallels {
private[this] lazy v... | debop/debop4s | debop4s-core/src/main/scala/debop4s/core/parallels/Parallels.scala | Scala | apache-2.0 | 5,206 |
package se.culvertsoft.mgen.visualdesigner.view
import java.awt.Color
import java.awt.Graphics
import java.awt.Graphics2D
import java.awt.event.ActionEvent
import java.awt.event.FocusAdapter
import java.awt.event.FocusEvent
import java.awt.event.KeyEvent
import java.awt.event.MouseAdapter
import java.awt.event.MouseEv... | culvertsoft/mgen-visualdesigner | src/main/scala/se/culvertsoft/mgen/visualdesigner/view/Labeled.scala | Scala | gpl-2.0 | 5,267 |
package club.diybio.bank.domain
case class DNASeq(seq: String, features: Set[Feature] = Set.empty)
| denigma/plasmid-bank | shared/src/main/scala/club/diybio/bank/domain/DNASeq.scala | Scala | mpl-2.0 | 100 |
package glasskey.model.fetchers
import glasskey.model.ProtectedResourceRequest
import glasskey.resource.OIDCTokenData
import glasskey.util.{JWK, JWTTokenDecoder}
/**
* Created by loande on 3/4/15.
*/
trait IDTokenRequestParameter extends AccessTokenFetcher[Option[OIDCTokenData]] {
def decoder : JWTTokenDecoder
... | MonsantoCo/glass-key | glass-key-common/src/main/scala/glasskey/model/fetchers/IDTokenRequestParameter.scala | Scala | bsd-3-clause | 1,032 |
package sample.clustered
import language.postfixOps
import akka.actor._
import com.typesafe.config.ConfigFactory
import sample.clustered.ClusteredMessages.BackendRegistration
import akka.actor.Terminated
import sample.clustered.ClusteredMessages.StartVideo
//#frontend
class ClientShowVideo extends Actor {
var bac... | retroryan/streams-workshop | src/examples/sample/clustered/ClientShowVideo.scala | Scala | cc0-1.0 | 1,398 |
/*
* 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 ... | lxsmnv/spark | sql/core/src/test/scala/org/apache/spark/sql/DataFrameFunctionsSuite.scala | Scala | apache-2.0 | 43,430 |
package com.chaos.pingplusplus.exception
/**
* Created by zcfrank1st on 11/14/14.
*/
class APIConnectionException(message: String, cause: Throwable = null) extends PingappException(message, cause){}
| zcfrank1st/chaos-pingapp-scala | src/main/scala/com/chaos/pingplusplus/exception/APIConnectionException.scala | Scala | mit | 202 |
// Copyright (c) 2014 The omegaUp Contributors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import com.omegaup.libinteractive.target._
import com.omegaup.libinteractive.idl.Parser
import java.io.IOException
import java.io.BufferedReader
... | omegaup/libinteractive | src/test/scala/TargetSpec.scala | Scala | bsd-3-clause | 4,925 |
package com.cloudera.hue.livy.server
import com.cloudera.hue.livy.msgs.ExecuteRequest
import org.json4s.JValue
import scala.concurrent.{ExecutionContext, ExecutionContextExecutor, Future}
import scala.util.{Failure, Success}
class Statement(val id: Int, val request: ExecuteRequest, val output: Future[JValue]) {
se... | erickt/hue | apps/spark/java/livy-server/src/main/scala/com/cloudera/hue/livy/server/Statement.scala | Scala | apache-2.0 | 717 |
/*
Copyright (c) 2009, 2010 Hanno Braun <[email protected]>
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... | hannobraun/ScalableDynamics | src/main/scala/com/hannobraun/sd/math/Scalar.scala | Scala | apache-2.0 | 1,172 |
/*
* 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 ... | michalsenkyr/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/WholeStageCodegenExec.scala | Scala | apache-2.0 | 27,788 |
/*
* 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 ... | bravo-zhang/spark | sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/DataSourceReadBenchmark.scala | Scala | apache-2.0 | 41,887 |
/*
* 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 ... | zohar-mizrahi/flink | flink-libraries/flink-table/src/main/scala/org/apache/flink/table/plan/nodes/datastream/DataStreamCorrelate.scala | Scala | apache-2.0 | 4,756 |
package net.fwbrasil.smirror
import scala.reflect.runtime.universe._
import java.lang.reflect.Method
import java.lang.reflect.InvocationTargetException
trait SBehavior[C] extends Visibility[C, MethodSymbol] {
implicit val runtimeMirror: Mirror
val owner: SType[C]
val symbol: MethodSymbol
val name = sy... | fwbrasil/smirror | src/main/scala/net/fwbrasil/smirror/SBehavior.scala | Scala | lgpl-2.1 | 3,902 |
package pl.pej.trelloilaro.api.requestBuilder.builder.action
import pl.pej.trelloilaro.api.requestBuilder.RequestBuilder
trait EntitiesBuilder[T] { this: RequestBuilder[T] =>
def withEntities(value: Boolean) = withOnlyParam( "entities", value)
}
trait ActionEntitiesBuilder[T] { this: RequestBuilder[T] =>
def ... | tomaszym/trelloilaro | src/main/scala/pl/pej/trelloilaro/api/requestBuilder/builder/action/entities.scala | Scala | mit | 396 |
/*
* 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 ... | tejasapatil/spark | project/SparkBuild.scala | Scala | apache-2.0 | 34,244 |
/*
* 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 ... | witgo/spark | sql/core/src/test/scala/org/apache/spark/sql/connector/InsertIntoTests.scala | Scala | apache-2.0 | 19,019 |
package webdoc
import java.io.{InputStream, EOFException}
import scala.collection.immutable.{ListMap}
/**
* Object that tokenizes webdoc input
*/
case class Lexer(in:InputStream)
{
// Converts in to a String
private var text:String = ""
// Constants
private val escapeChar = '\\\\'
private val whit... | Anti-Alias/WebDoc | src/main/scala/webdoc/Lexer.scala | Scala | mit | 12,118 |
/**
* The MIT License (MIT)
* <p/>
* Copyright (c) 2016 ScalateKids
* <p/>
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the ... | ScalateKids/Actorbase-Client | src/main/scala/com/actorbase/driver/data/ActorbaseCollectionMap.scala | Scala | mit | 3,870 |
package com.ajjpj.adiagram_.model
import java.io.File
import javafx.stage.{Stage, FileChooser}
import scala.xml.XML
import com.ajjpj.adiagram_.ui.fw.{JavaFxHelper, Digest}
import javafx.stage.FileChooser.ExtensionFilter
import javafx.scene.control.Label
import com.ajjpj.adiagram_.ui.ADiagramController
/**
* @author... | arnohaase/a-diagram | src/main/scala-old/com/ajjpj/adiagram_/model/DiagramIO.scala | Scala | apache-2.0 | 4,054 |
package models.street
import models.audit.AuditTaskTable
import models.region._
import models.utils.MyPostgresDriver.simple._
import play.api.Play.current
import scala.slick.lifted.ForeignKeyQuery
case class StreetEdgeRegion(streetEdgeId: Int, regionId: Int)
class StreetEdgeRegionTable(tag: Tag) extends Table[Street... | ProjectSidewalk/SidewalkWebpage | app/models/street/StreetEdgeRegionTable.scala | Scala | mit | 2,555 |
/**
* Copyright 2013-2015, AlwaysResolve Project (alwaysresolve.org), MOYD.CO LTD
* This file incorporates work covered by the following copyright and permission notice:
*
* Copyright 2012 silenteh
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in complianc... | Moydco/AlwaysResolveDNS | src/main/scala/payload/Message.scala | Scala | apache-2.0 | 3,383 |
package com.github.tminglei.bind
import org.scalatest._
import java.util.ResourceBundle
class GeneralMappingsSpec extends FunSpec with Matchers with Constraints {
val bundle: ResourceBundle = ResourceBundle.getBundle("bind-messages")
val messages: Messages = (key) => Option(bundle.getString(key))
case class Te... | tminglei/form-binder | src/test/scala/com/github/tminglei/bind/GeneralMappingsSpec.scala | Scala | bsd-2-clause | 25,160 |
package io.buoyant.namer.consul
import com.twitter.finagle.stats.StatsReceiver
import com.twitter.finagle.{Addr, ConnectionFailedException, Failure}
import com.twitter.util._
import io.buoyant.consul.v1
private[consul] object DcServices {
/**
* We use a shared stats object so that counters/stats are not
* cr... | denverwilliams/linkerd | namer/consul/src/main/scala/io/buoyant/namer/consul/DcServices.scala | Scala | apache-2.0 | 4,368 |
package eventstore
package akka
import core.constants.MaxBatchSize
class ReadStreamEventsBackwardITest extends TestConnection {
implicit val direction: ReadDirection = ReadDirection.Backward
"read stream events forward" should {
"fail if count <= 0" in new TestConnectionScope {
readStreamEventsFailed(E... | EventStore/EventStore.JVM | client/src/test/scala/eventstore/akka/ReadStreamEventsBackwardITest.scala | Scala | bsd-3-clause | 4,207 |
package com.sksamuel.elastic4s.searches.suggestions
case class SuggestDefinition(suggestions: Seq[SuggestionDefinition]) | ulric260/elastic4s | elastic4s-core/src/main/scala/com/sksamuel/elastic4s/searches/suggestions/SuggestDefinition.scala | Scala | apache-2.0 | 121 |
package org.thp.cortex.services
import javax.inject.{ Inject, Singleton }
import scala.concurrent.Future
import scala.concurrent.duration.Duration
import play.api.Configuration
import play.api.cache.AsyncCacheApi
import play.api.libs.json.JsObject
import akka.NotUsed
import akka.stream.scaladsl.Source
import org.th... | CERT-BDF/Cortex | app/org/thp/cortex/services/OrganizationSrv.scala | Scala | agpl-3.0 | 2,867 |
package cromwell.logging
import java.time.OffsetDateTime
import java.time.format.DateTimeFormatter
import ch.qos.logback.classic.Level
import ch.qos.logback.classic.pattern.ThrowableProxyConverter
import ch.qos.logback.classic.spi.ILoggingEvent
import ch.qos.logback.core.LayoutBase
import common.util.TerminalUtil
ob... | ohsu-comp-bio/cromwell | engine/src/main/scala/cromwell/logging/TerminalLayout.scala | Scala | bsd-3-clause | 1,744 |
/*
* Copyright (C) 2015 Stratio (http://stratio.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://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by app... | diegohurtado/sparta | driver/src/main/scala/com/stratio/sparta/driver/factory/SparkContextFactory.scala | Scala | apache-2.0 | 5,026 |
import sbt.Keys._
import play.Project
object Build extends sbt.Build
{
val main = Project( "play-tmpltr", settings = play.Project.playScalaSettings ).settings(
name := "Play Tmpltr",
organization := "com.taig",
scalacOptions ++= Seq( "-feature", "-language:implicitConversions", "-language:existentials" ),
ver... | Taig/Play-Tmpltr | project/Build.scala | Scala | mit | 345 |
package com.github.vooolll.serialization.compatibility
import java.net.URL
import com.github.vooolll.domain.oauth.FacebookAppId
import com.github.vooolll.domain.profile.FacebookApplication
import com.github.vooolll.serialization.FacebookDecoders._
class ApplicationCompatSpec extends CompatibilitySpec {
val applic... | vooolll/facebook4s | src/test/scala/com/github/vooolll/serialization/compatibility/ApplicationCompatSpec.scala | Scala | apache-2.0 | 711 |
package uk.co.seansaville.ninetyninescalaprobs.lists
import uk.co.seansaville.ninetyninescalaprobs.UnitSpec
class Problem28Spec extends UnitSpec {
"lsort" should "sort a list of lists according to their lengths" in {
val testList = List(List(1, 2, 3), List(1), List(1, 2), List(1, 2, 3, 4))
assert(Problem28... | seansaville/99scalaprobs | src/test/scala/uk/co/seansaville/ninetyninescalaprobs/lists/Problem28Spec.scala | Scala | mit | 741 |
package chrome.omnibox.bindings
import scala.scalajs.js
class SuggestResult extends js.Object {
val content: String = js.native
val description: String = js.native
}
object SuggestResult {
def apply(content: String, description: String): SuggestResult = {
js.Dynamic.literal(
content = content,
... | amsayk/scala-js-chrome | bindings/src/main/scala/chrome/omnibox/bindings/SuggestResult.scala | Scala | mit | 391 |
package scalapb.compiler
import scalapb.compiler.EnclosingType.Collection
sealed trait Expression extends Product with Serializable {
def andThen(other: Expression) = (this, other) match {
case (Identity, e2: LiteralExpression) => e2
case (e1, Identity) => e1
... | scalapb/ScalaPB | compiler-plugin/src/main/scala/scalapb/compiler/ExpressionBuilder.scala | Scala | apache-2.0 | 6,512 |
package ch14
object ex03 {
def swap(a: Array[Int]) = {
a match {
case Array(x, y, z @ _*) => Array(y, x) ++ z
case _ => a
}
}
def main(args: Array[String]): Unit = {
val arr1 = Array(1)
val arr2 = Array(1, 2, 3, 4)
println(swap(arr1).toList)
println(swap(arr2).toList)
}
}
| tuxdna/scala-for-the-impatient-exercises | src/main/scala/ch14/ex03.scala | Scala | apache-2.0 | 318 |
package edu.nus.systemtesting.hipsleek
import java.nio.file.Path
import java.nio.file.Paths
import edu.nus.systemtesting.ExecutionOutput
import edu.nus.systemtesting.PreparedSystem
import edu.nus.systemtesting.Result
import edu.nus.systemtesting.Testable
import edu.nus.systemtesting.TestCaseConfiguration
import edu.nu... | rgoulter/system-testing | src/main/scala/edu/nus/systemtesting/hipsleek/ValidateableSleekTestCase.scala | Scala | mit | 4,626 |
///////////////////////////////////////////////////////////////////////////////
// TimeDocument.scala
//
// Copyright (C) 2011, 2012 Ben Wing, The University of Texas at Austin
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
/... | utcompling/fieldspring | src/main/scala/opennlp/fieldspring/poligrounder/TimeDocument.scala | Scala | apache-2.0 | 2,679 |
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.