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 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/DirectiveEditorService.scala | Scala | gpl-3.0 | 4,184 |
package app
import scalajs.js, js.Dynamic.{global => g}, js.JSConverters._
import wav.devtools.sbt.httpserver.buildservice.BuildService
object App extends js.JSApp {
implicit def `f2->undefjs`[P1,P2,R](f: (P1,P2) => R) =
Some(f: js.Function2[P1, P2, R]).orUndefined
def onBuildEvent(project: String, event: S... | wav/sbt-httpserver | examples/build-services-sjs/src/main/scala/app/App.scala | Scala | apache-2.0 | 541 |
package jp.co.dwango.s99
import org.scalacheck.Properties
import org.scalacheck.Prop.{forAll, BooleanOperators}
class P02Check extends Properties("P02") {
property("penultimate()") = forAll { (s: List[Int]) =>
(s.length >= 2) ==> (P02.penultimate(s) == s(s.length - 2))
}
}
| dwango/S99 | src/test/scala/jp/co/dwango/s99/P02Check.scala | Scala | mit | 284 |
package fr.winbee
import org.scalatest.{Matchers, FlatSpec}
abstract class UnitSpec extends FlatSpec with Matchers
| Winbee/gnuCashExtractor | src/test/scala/fr/winbee/UnitSpec.scala | Scala | gpl-2.0 | 117 |
/*
* Copyright 2015 Priyesh Patel
*
* 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... | ItsPriyesh/Litho | src/me/priyesh/litho/core/AndroidBridge.scala | Scala | apache-2.0 | 2,158 |
package org.bfn.ninetynineprobs
object P33 {
def isCoprimeTo(a : Integer, b : Integer) =
P32.gcd(a, b) == 1
}
| bfontaine/99Scala | src/main/scala/P33.scala | Scala | mit | 119 |
package play.api.mvc
import scala.language.reflectiveCalls
import java.io._
import scala.xml._
import play.api._
import play.api.libs.json._
import play.api.libs.iteratee._
import play.api.libs.iteratee.Input._
import play.api.libs.iteratee.Parsing._
import play.api.libs.Files.{ TemporaryFile }
import Results._
im... | noel-yap/setter-for-catan | play-2.1.1/framework/src/play/src/main/scala/play/api/mvc/ContentTypes.scala | Scala | apache-2.0 | 26,039 |
/**
* For copyright information see the LICENSE document.
*/
package entice.server.controllers
import entice.server._, Net._
import entice.server.world._
import entice.server.utils._
import entice.server.scripting._
import entice.protocol._
import com.twitter.util.Eval
import akka.actor.{ Actor, ActorRef, ActorLogg... | entice/old-server | src/main/scala/entice/server/controllers/Command.scala | Scala | bsd-3-clause | 3,675 |
/***********************************************************************
* Copyright (c) 2013-2020 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... | aheyne/geomesa | geomesa-accumulo/geomesa-accumulo-datastore/src/main/scala/org/locationtech/geomesa/accumulo/audit/AccumuloEventWriter.scala | Scala | apache-2.0 | 2,967 |
package $package$.util
import scopt.OptionParser
case object Config
object ConfigParser extends OptionParser[Config.type](BuildInfo.name) {
head(BuildInfo.name, BuildInfo.version)
}
| ChrisKaminski/github-scala-app.g8 | src/main/g8/app/src/main/scala/$package$/util/Config.scala | Scala | mit | 187 |
/*
* 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... | SRGOM/scalatest | scalatest/src/main/scala/org/scalatest/MatchersHelper.scala | Scala | apache-2.0 | 14,961 |
package controllers
import play.api._
import play.api.mvc._
import models._
import play.api.data._
import play.api.data.Forms._
import play.api.data.format.Formats._
import play.api.Play.current
import play.api.libs.concurrent.Akka
import play.api.libs.json._
import play.api.libs.concurrent.Execution.Implicits._
impor... | TPTeam/reactive_mongo_example | app/controllers/SonController.scala | Scala | mit | 2,781 |
package knot.net.tcp
import knot.core.Provider
import knot.core.cell.Cell
import knot.net.Tcp
object TcpWorker {
def provider(tcp: Tcp) = Provider(new TcpWorker(tcp))
}
/**
* this cell is tcpserver or tcpclient
*/
class TcpWorker(val tcp: Tcp) extends Cell {
val loop: NioEventLoop = {
val l = NioEventLo... | defvar/knot | knot-net/src/main/scala/knot/net/tcp/TcpWorker.scala | Scala | mit | 657 |
import org.scalatest._
class LeapTest extends FunSuite {
test ("vanilla leap year") {
assert(Year(1996).isLeap)
}
test ("any old year") {
pending
assert(!Year(1997).isLeap)
}
test ("century") {
pending
assert(!Year(1900).isLeap)
}
test ("exceptional century") {
pending
asse... | nlochschmidt/xscala | leap/src/test/scala/leap_test.scala | Scala | mit | 348 |
object Test {
type StrHead[X <: Tuple] = X match {
case (x <: String) *: _ => x // error
}
// Futher minimized
type M[X] = X match {
case (x) *: _ => Int
}
// The exception can also be reached with normal pattern matching
1 match {
case _: Option[(x)] => ()
}
}
| som-snytt/dotty | tests/neg/7043.scala | Scala | apache-2.0 | 292 |
/*
* Copyright 2009-2017. DigitalGlobe, 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 ... | ngageoint/mrgeo | mrgeo-mapalgebra/mrgeo-mapalgebra-image/src/main/scala/org/mrgeo/mapalgebra/RawFocalMapOp.scala | Scala | apache-2.0 | 9,374 |
/*
* Copyright 2010 LinkedIn
*
* 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... | jinfei21/kafka | src/kafka/server/KafkaConfig.scala | Scala | apache-2.0 | 4,017 |
package services.sitedata
import javax.inject._
import scala.concurrent.Future
import utils.Awaits
import models.sitedata.AccessMailAccount
import dao.sitedata.AccessMailAccountDao
import dao.sitedata.IAccessMailAccountDao
trait IAccessMailAccountService extends BaseService2[AccessMailAccount]{
def insert(accessmai... | tnddn/iv-web | portal/rest-portal/app/services/sitedata/AccessMailAccountService.scala | Scala | apache-2.0 | 2,080 |
package net.randallalexander.restaurant.chooser.model
import io.circe._
import io.circe.generic.semiauto._
import net.randallalexander.restaurant.chooser.model.Ethnicity._
import net.randallalexander.restaurant.chooser.model.KindOfFood._
/*
maybe calculate pricePerPerson when request is made instead?
....
how a... | randallalexander/restaurant-chooser | service/src/main/scala/net/randallalexander/restaurant/chooser/model/Restaurant.scala | Scala | mit | 3,065 |
/*
* 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/controllers/application/tnrb/GiftsMadeBeforeDeathControllerTest.scala | Scala | apache-2.0 | 7,439 |
package net.javachallenge.util.settings
/**
* Object containing default values for the application.
*/
object Defaults {
/**
* The default environment for the application.
*/
val ENV: Environment = Production
/**
* The default XML parser for settings.
*/
val XML_SETTINGS_PARSER_CLASS_NAME = "net... | AI-comp/JavaChallenge2012 | src/main/scala/net/javachallenge/util/settings/Defaults.scala | Scala | apache-2.0 | 948 |
/**
* Copyright (C) 2013 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... | joansmith/orbeon-forms | src/main/scala/org/orbeon/oxf/fb/PublishOps.scala | Scala | lgpl-2.1 | 2,300 |
package slinky.core.annotations
import slinky.core.FunctionalComponent
import slinky.web.ReactDOM
import org.scalajs.dom
import org.scalatest.funsuite.AsyncFunSuite
@react object SimpleFunctionalComponent {
case class Props[T](in: Seq[T])
val component = FunctionalComponent[Props[_]] { case Props(in) =>
in.... | shadaj/slinky | tests/src/test/scala-2/slinky/core/annotations/ReactAnnotatedFunctionalComponentTest.scala | Scala | mit | 2,568 |
/*
* Derived from https://github.com/spray/spray/blob/v1.1-M7/spray-http/src/main/scala/spray/http/parser/BasicRules.scala
*
* Copyright (C) 2011-2012 spray.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... | hvesalai/http4s | core/src/main/scala/org/http4s/parser/Rfc2616BasicRules.scala | Scala | apache-2.0 | 2,929 |
package org.akoshterek.backgammon.data
class TrainEntry (val positionId: String, val reward: Array[Double]) {
} | akoshterek/MultiGammonJava | multi-gammon-util/src/main/java/org/akoshterek/backgammon/data/TrainEntry.scala | Scala | gpl-3.0 | 112 |
package org.jetbrains.plugins.scala
package lang.psi.types
import com.intellij.psi.PsiClass
import org.jetbrains.plugins.scala.extensions.{PsiClassExt, PsiElementExt, PsiParameterExt}
import org.jetbrains.plugins.scala.lang.psi.api.base.ScPrimaryConstructor
import org.jetbrains.plugins.scala.lang.psi.api.statements.pa... | loskutov/intellij-scala | src/org/jetbrains/plugins/scala/lang/psi/types/ValueClassType.scala | Scala | apache-2.0 | 1,473 |
package org.denigma.preview.routes
import akka.http.scaladsl.model._
import akka.http.scaladsl.server.{Directives, Route}
import org.denigma.preview.templates.MyStyles
import scalacss.Defaults._
class Head extends Directives
{
lazy val webjarsPrefix = "lib"
lazy val resourcePrefix = "resources"
def mystyles ... | denigma/akka-http-extensions | preview/backend/src/main/scala/org/denigma/preview/routes/Head.scala | Scala | mpl-2.0 | 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 ... | nickpan47/samza | samza-core/src/main/scala/org/apache/samza/checkpoint/OffsetManager.scala | Scala | apache-2.0 | 17,434 |
/*
* 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 | app/models/YesOrNoQuestion.scala | Scala | apache-2.0 | 683 |
/** I use spark package to hack all those private Spark classes */
package org.apache.spark
package zpark
import java.net.InetSocketAddress
import scalaz.{-\\/, \\/, \\/-}
import scalaz.concurrent.{Task, Strategy}
import scalaz.stream._
import scala.concurrent.duration._
import ReceiveY._
import wye.Request
import j... | mandubian/zpark-ztream | src/main/scala/nio.scala | Scala | apache-2.0 | 9,855 |
package scala.meta
package taxonomic
import org.scalameta.data._
import org.scalameta.unreachable
@data class TaxonomicException(artifact: Artifact, message: String, cause: Option[Throwable])
extends Exception(s"failed to resolve $artifact because $message", cause.orNull) with ScalametaException {
def this(artifact... | beni55/scalameta | scalameta/taxonomic/src/main/scala/scala/meta/taxonomic/Exceptions.scala | Scala | bsd-3-clause | 529 |
// scalac: -Werror -Xlint:deprecation
//
object Test {
def foo(i: Int, l: Long): Unit = {
val i_f: Float = i // deprecated
val i_d: Double = i // OK
val l_f: Float = l // deprecated
val l_d: Double = l // deprecated
}
def imp: Unit = {
implicitly[Int => Float] // deprecated
implicitly... | lrytz/scala | test/files/neg/deprecated_widening.scala | Scala | apache-2.0 | 2,059 |
package ua.com.serious_panda.settings
import java.awt.event.{ActionEvent, ActionListener}
import java.util.Locale
import javax.swing._
import javax.swing.event.{ChangeEvent, ChangeListener}
import com.jhlabs.awt.ParagraphLayout
/**
*
* Created by aleo on 03.08.14.
*/
case class Property[T](key: String, defaultVal... | aleo72/serious_panda.settings | src/main/scala/ua/com/serious_panda/settings/Property.scala | Scala | apache-2.0 | 8,746 |
/*
* 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/performance-test-runner | src/main/scala/uk/gov/hmrc/performance/simulation/PerformanceTestRunner.scala | Scala | apache-2.0 | 2,400 |
/*
* 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/amls-frontend | test/connectors/AmlsNotificationConnectorSpec.scala | Scala | apache-2.0 | 4,694 |
/*
* 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... | intel-analytics/BigDL | scala/dllib/src/test/scala/com/intel/analytics/bigdl/dllib/nn/ops/IsFiniteSpec.scala | Scala | apache-2.0 | 1,082 |
package edu.gemini.seqexec.server
import java.util
import java.util.logging.Logger
import edu.gemini.seqexec.server.tcs.{BinaryYesNo, BinaryOnOff}
import squants.time.Seconds
import collection.JavaConversions._
import edu.gemini.seqexec.server.TcsController._
import edu.gemini.epics.acm.{CaAttributeListener, CaServi... | arturog8m/ocs | bundle/edu.gemini.seqexec.server/src/main/scala/edu/gemini/seqexec/server/TcsControllerEpics.scala | Scala | bsd-3-clause | 17,158 |
package org.allenai.common
import scala.collection.Iterator
import scala.io.{ Codec, Source }
import java.io.InputStream
import java.nio.{ ByteBuffer, CharBuffer }
/** Input stream wrapping a Source object, using the codec to convert characters to bytes. Not
* thread-safe.
*/
class SourceInputStream(val source: ... | ryanai3/common | core/src/main/scala/org/allenai/common/SourceInputStream.scala | Scala | apache-2.0 | 1,905 |
import scala.language.existentials
import scala.reflect.runtime.universe._
import internal._
object Test {
trait ToS { final override def toString = getClass.getName }
def f1 = { case class Bar() extends ToS; Bar }
def f2 = { case class Bar() extends ToS; Bar() }
def f3 = { class Bar() extends ToS; object Bar... | yusuke2255/dotty | tests/pending/run/existentials3-new.scala | Scala | bsd-3-clause | 2,616 |
/*
* 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 ... | aljoscha/flink | flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/nodes/physical/batch/BatchPhysicalPythonCorrelate.scala | Scala | apache-2.0 | 2,559 |
/*
* 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 ... | pgandhi999/spark | core/src/main/scala/org/apache/spark/BarrierTaskContext.scala | Scala | apache-2.0 | 10,073 |
package com.soteradefense.dga.graphx.louvain
import org.apache.spark.SparkContext
import org.apache.spark.SparkContext._
import org.apache.spark.graphx._
import scala.reflect.ClassTag
import org.apache.spark.broadcast.Broadcast
import org.apache.spark.graphx.Graph.graphToGraphOps
import scala.math.BigDecimal.double2bi... | 623401157/spark-distributed-louvain-modularity | dga-graphx/src/main/scala/com/soteradefense/dga/graphx/louvain/LouvainCore.scala | Scala | apache-2.0 | 13,983 |
package io.youi.font
import io.youi.drawable.{Context, TextDrawable}
import io.youi.paint.{Paint, Stroke}
import io.youi.spatial.BoundingBox
trait Text {
def font: Font
def text: String
def size: Double
def maxWidth: Double
def kerning: Boolean
def boundingBox: BoundingBox
def lineHeight: Double = font... | outr/youi | gui/src/main/scala/io/youi/font/Text.scala | Scala | mit | 984 |
/*
* 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... | Myllyenko/incubator-toree | sparkr-interpreter/src/main/scala/org/apache/toree/kernel/interpreter/sparkr/SparkRProcess.scala | Scala | apache-2.0 | 2,748 |
package com.github.j5ik2o.dddbase.dynamodb
import monix.eval.Task
trait AggregateBaseReadFeature extends AggregateIOBaseFeature {
protected def convertToAggregate: RecordType => Task[AggregateType]
}
| j5ik2o/scala-ddd-base-functional | nosql/dynamodb/src/main/scala/com/github/j5ik2o/dddbase/dynamodb/AggregateBaseReadFeature.scala | Scala | mit | 206 |
import bio._
import org.scalatest.FlatSpec
import org.scalatest.matchers.ShouldMatchers
package bio.test {
import bio.attribute._
import org.scalatest.Matchers
class GappedSequenceSpec extends FlatSpec with Matchers {
import bio.DNA._
"A DNA GappedSequence" should "instantiate from a String" in {
va... | bioscala/bioscala | src/test/scala/bio/sequence/gappedsequence_spec.scala | Scala | bsd-2-clause | 2,059 |
package com.twitter.finagle.mysql
import com.twitter.concurrent.AsyncStream
import com.twitter.finagle.Service
import com.twitter.finagle.stats.StatsReceiver
import com.twitter.logging.Logger
import com.twitter.util.{Closable, Future, Time}
/**
* A closable async stream of projected rows from a CursoredStatement.
*... | mkhq/finagle | finagle-mysql/src/main/scala/com/twitter/finagle/mysql/CursoredStatement.scala | Scala | apache-2.0 | 7,364 |
// Copyright: 2010 - 2017 https://github.com/ensime/ensime-server/graphs
// License: http://www.gnu.org/licenses/gpl-3.0.en.html
package org.ensime.util
import java.io.File
class DiffUtilSpec extends EnsimeSpec {
"DiffUtil" should "compare original and revised contents and produce a diff in the unified format" in {... | fommil/ensime-server | core/src/test/scala/org/ensime/util/DiffUtilSpec.scala | Scala | gpl-3.0 | 971 |
/* sbt -- Simple Build Tool
* Copyright 2010 Mark Harrah
*/
package sbt
package inc
import java.io.File
import Relations.Source
import Relations.SourceDependencies
import xsbti.api.{ Source => APISource }
import xsbti.DependencyContext
import xsbti.DependencyContext._
/**
* Provides mappings between source files,... | som-snytt/xsbt | compile/inc/src/main/scala/sbt/inc/Relations.scala | Scala | bsd-3-clause | 38,575 |
/**
* ====
* This file is part of SensApp [ http://sensapp.modelbased.net ]
*
* Copyright (C) 2011- SINTEF ICT
* Contact: SINTEF ICT <nicolas.ferry@sintef.no>
*
* 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.library.system/src/main/scala/net/modelbased/sensapp/library/system/HttpSpraySupport.scala | Scala | lgpl-3.0 | 2,288 |
/**
* 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... | Mszak/kafka | core/src/main/scala/kafka/admin/AdminUtils.scala | Scala | apache-2.0 | 22,620 |
import sbt.Keys._
import sbt._
object HmrcBuild extends Build {
import uk.gov.hmrc.DefaultBuildSettings._
import uk.gov.hmrc.SbtAutoBuildPlugin
import uk.gov.hmrc.versioning.SbtGitVersioning
val nameApp = "accessibility-driver"
val appDependencies = Seq(
"org.seleniumhq.selenium" % "selenium-java" % "... | kristapsmelderis/accessibility-driver | project/HmrcBuild.scala | Scala | apache-2.0 | 1,218 |
/*
* Wire
* Copyright (C) 2016 Wire Swiss GmbH
*
* This program 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.
*
* This progr... | wireapp/wire-android-sync-engine | zmessaging/src/main/scala/com/waz/utils/wrappers/DBProgram.scala | Scala | gpl-3.0 | 1,907 |
/*
* Copyright 2008-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... | jeppenejsum/liftweb | examples/JPADemo/JPADemo-spa/src/main/scala/net/liftweb/jpademo/model/Author.scala | Scala | apache-2.0 | 1,103 |
package epic.sequences
import epic.framework.Example
import epic.trees.Span
/**
* A tagged sequence has a sequence of tags and a sequence of words that are in
* one-to-one correspondence. think POS tags etc.
* @author dlwh
*/
case class TaggedSequence[+L, +W](tags: IndexedSeq[L],
w... | maxim-rabinovich/epic | src/main/scala/epic/sequences/TaggedSequence.scala | Scala | apache-2.0 | 807 |
package edu.uchicago.cs.encsel.query.tpch
import java.io.File
import edu.uchicago.cs.encsel.query.{HColumnPredicate, RowTempTable}
import edu.uchicago.cs.encsel.query.operator.HorizontalSelect
object HorizontalScan extends App {
val schema = TPCHSchema.lineitemSchema
// val inputFolder = "/home/harper/TPCH/"
... | harperjiang/enc-selector | src/main/scala/edu/uchicago/cs/encsel/query/tpch/HorizontalScan.scala | Scala | apache-2.0 | 965 |
package domala.jdbc.models
import domala._
case class Person(
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
id: ID[Person] = ID.notAssigned,
name: Option[Name],
age: Option[Int],
address: Address,
departmentId: Option[Int],
@Version
version: Int = -1
)
| bakenezumi/domala | core/src/test/scala/domala/jdbc/models/Person.scala | Scala | apache-2.0 | 283 |
package com.mesosphere.cosmos.converter
// TODO(version): Can this be given more structure (e.g. name and type of field that failed, package, etc.)?
final case class ConversionFailure(message: String) extends RuntimeException(message)
| movicha/cosmos | cosmos-json/src/main/scala/com/mesosphere/cosmos/converter/ConversionFailure.scala | Scala | apache-2.0 | 236 |
package com.krux.hyperion.dataformat
import com.krux.hyperion.aws.AdpDynamoDBExportDataFormat
import com.krux.hyperion.common.{ BaseFields, PipelineObjectId }
/**
* Applies a schema to an DynamoDB table to make it accessible by a Hive query. Use
* DynamoDBExportDataFormat with a HiveCopyActivity object and DynamoDB... | hoangelos/hyperion | core/src/main/scala/com/krux/hyperion/dataformat/DynamoDBExportDataFormat.scala | Scala | apache-2.0 | 1,304 |
package com.twitter.finagle.http.exp.routing
import scala.util.control.NonFatal
/**
* A named parameter for matching an HTTP Request. A [[Parameter]] may be associated with
* different discriminators that make up a route - a URI path, query params, header params, and
* cookie params.
*
* @see [[https://swagger.i... | twitter/finagle | finagle-http/src/main/scala/com/twitter/finagle/http/exp/routing/Parameter.scala | Scala | apache-2.0 | 3,400 |
package org.http4s
package server
package blaze
import cats.effect.{ConcurrentEffect, Timer}
import java.nio.ByteBuffer
import javax.net.ssl.SSLEngine
import org.http4s.blaze.http.http2.{DefaultFlowStrategy, Http2Settings}
import org.http4s.blaze.http.http2.server.{ALPNServerSelector, ServerPriorKnowledgeHandshaker}
i... | aeons/http4s | blaze-server/src/main/scala/org/http4s/server/blaze/ProtocolSelector.scala | Scala | apache-2.0 | 2,681 |
/*
* 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 ... | shuangshuangwang/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/jdbc/JDBCTableCatalog.scala | Scala | apache-2.0 | 7,621 |
// Copyright (c) 2013-2020 Rob Norris and Contributors
// This software is licensed under the MIT License (MIT).
// For more information see LICENSE or https://opensource.org/licenses/MIT
package doobie.free
import cats.~>
import cats.effect.kernel.{ CancelScope, Poll, Sync }
import cats.free.{ Free => FF } // alias ... | tpolecat/doobie | modules/free/src/main/scala/doobie/free/preparedstatement.scala | Scala | mit | 40,055 |
package org.scaladebugger.api.lowlevel.requests.filters
import com.sun.jdi.ThreadReference
import org.scaladebugger.test.helpers.ParallelMockFunSpec
import org.scalamock.scalatest.MockFactory
import org.scalatest.{FunSpec, Matchers, ParallelTestExecution}
class ThreadFilterSpec extends ParallelMockFunSpec
{
private... | chipsenkbeil/scala-debugger | scala-debugger-api/src/test/scala/org/scaladebugger/api/lowlevel/requests/filters/ThreadFilterSpec.scala | Scala | apache-2.0 | 667 |
/*
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... | cchepelov/scalding | scalding-core/src/test/scala/com/twitter/scalding/FileSourceTest.scala | Scala | apache-2.0 | 11,997 |
package core.sysevents
import scala.language.implicitConversions
sealed trait Sysevent {
def id: String
def componentId: String
def >>>(f1: => Seq[FieldAndValue])(implicit ctx: WithSyseventPublisher, system: SyseventSystem): Unit = ctx.evtPublisher.publish(system, this, ctx.commonFields match {
case x if... | intelix/eventstreams | es-core/es-sysevents/src/main/scala/core/sysevents/Sysevent.scala | Scala | apache-2.0 | 2,452 |
// Databricks notebook source
// MAGIC %md
// MAGIC
// MAGIC # [SDS-2.2, Scalable Data Science](https://lamastex.github.io/scalable-data-science/sds/2/2/)
// COMMAND ----------
// MAGIC %md
// MAGIC Archived YouTube video of this live unedited lab-lecture:
// MAGIC
// MAGIC [![Archived YouTube video of this live un... | raazesh-sainudiin/scalable-data-science | db/2/2/005_RDDsTransformationsActionsHOMEWORK.scala | Scala | unlicense | 10,257 |
package com.arcusys.learn.models.view
/**
* Created by Iliya Tryapitsin on 19.03.14.
*/
@deprecated
object CurriculumViewModel {
}
| ViLPy/Valamis | learn-portlet/src/main/scala/com/arcusys/learn/models/view/CurriculumViewModel.scala | Scala | lgpl-3.0 | 135 |
package edu.gemini.spModel.io.impl.migration.to2015B
import java.io.{StringReader, StringWriter}
import edu.gemini.pot.sp.{ISPObservation, ISPProgram, ISPTemplateFolder, ISPTemplateGroup, SPComponentType}
import edu.gemini.shared.util.immutable.{None => JNone}
import edu.gemini.spModel.io.impl.migration.MigrationTest... | spakzad/ocs | bundle/edu.gemini.spModel.io/src/test/scala/edu/gemini/spModel/io/impl/migration/to2015B/TargetConversionTest.scala | Scala | bsd-3-clause | 4,036 |
/*
* Copyright 2017-2018 Azad Bolour
* Licensed under GNU Affero General Public License v3.0 -
* https://github.com/azadbolour/boardgame/blob/master/LICENSE.md
*/
package controllers
import javax.inject._
import controllers.GameApiJsonSupport._
import controllers.GameDtoConverters._
import com.bolour.boardgame... | azadbolour/boardgame | scala-server/app/controllers/GameController.scala | Scala | agpl-3.0 | 7,980 |
/*
Copyright (c) 2015, Raymond Dodge
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 fo... | rayrobdod/script | src/main/scala/com/rayrobdod/script/parser/AttrsToUseFun.scala | Scala | bsd-3-clause | 1,859 |
/***********************************************************************
* Copyright (c) 2013-2020 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... | aheyne/geomesa | geomesa-fs/geomesa-fs-tools/src/main/scala/org/locationtech/geomesa/fs/tools/status/FsGetSftConfigCommand.scala | Scala | apache-2.0 | 1,279 |
package org.jetbrains.plugins.scala.lang.autoImport.generated.worksheet
import org.jetbrains.plugins.scala.lang.autoImport.{ImportConversionFixTest, WorksheetFiles}
class ImportConversionFixWorksheetTest extends ImportConversionFixTest with WorksheetFiles
| JetBrains/intellij-scala | scala/worksheet/test/org/jetbrains/plugins/scala/lang/autoImport/generated/worksheet/ImportConversionFixWorksheetTest.scala | Scala | apache-2.0 | 258 |
/*
* 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 ... | pronix/spark | sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/LiteralExpressionSuite.scala | Scala | apache-2.0 | 5,419 |
/*
* Copyright 2016 Guy Van den Broeck and Wannes Meert (UCLA and KU Leuven)
*
* 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
*
* Un... | UCLA-StarAI/Forclift | src/test/scala/edu/ucla/cs/starai/forclift/learning/TestWeightLearningWebKB2Monotone.scala | Scala | apache-2.0 | 4,037 |
package paperdoll.core.effect
import Predef.identity
import shapeless.{ Coproduct, CNil, :+:, Inl }
import scalaz.{ Monad, Leibniz, Forall, Unapply }
import scalaz.syntax.monad._
import paperdoll.queue.Queue
import paperdoll.core.layer.{ Layer, Layers, Subset }
import scalaz.Functor
import paperdoll.core.nond... | m50d/paperdoll | core/src/main/scala/paperdoll/core/effect/Effects.scala | Scala | apache-2.0 | 9,805 |
package com.splicemachine.spark2.splicemachine
object ThisVersionSpecificItems {
val schema = SparkVersionSpecificItems.schemaWithoutMetadata
val jdbcBadDriverNameException = SparkVersionSpecificItems.connectionNotCreated
}
| splicemachine/spliceengine | splice_spark2/src/test/spark2.4/com/splicemachine/spark2/splicemachine/ThisVersionSpecificItems.scala | Scala | agpl-3.0 | 229 |
/*
* Wire
* Copyright (C) 2016 Wire Swiss GmbH
*
* This program 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.
*
* This progr... | wireapp/wire-android-sync-engine | zmessaging/src/test/scala/com/waz/utils/DbLoader.scala | Scala | gpl-3.0 | 1,242 |
package lv.ddgatve.scp
import java.io.BufferedReader
import java.io.IOException
import java.io.InputStreamReader
import com.jcraft.jsch.UserInfo
class CliUserInfo extends UserInfo {
// this method is never called
override def getPassphrase(): String = {
return null;
}
// this method should return the p... | kapsitis/demografija-lv | src/main/scala/lv/ddgatve/scp/CliUserInfo.scala | Scala | apache-2.0 | 1,232 |
/*
* 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/SparkStrategies.scala | Scala | apache-2.0 | 30,257 |
/**
* 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... | tnachen/kafka | core/src/main/scala/kafka/tools/ConsumerShell.scala | Scala | apache-2.0 | 3,886 |
package com.originate.scalypher.test.where
import com.originate.scalypher.where.HasNoRelationships
import com.originate.scalypher.path.{AnyNode, CypherNode}
import com.originate.scalypher.types.IdentifiableMap
import org.scalatest._
class HasNoRelationshipsSpec extends WordSpec with Matchers {
"return a query to ... | Originate/scalypher | src/test/scala/where/HasNoRelationshipsSpec.scala | Scala | mit | 1,569 |
package scalasthlm.alpakka.playground
import java.io.File
import java.nio.file.FileSystem
import org.apache.ftpserver.{ConnectionConfigFactory, FtpServer, FtpServerFactory}
import org.apache.ftpserver.listener.ListenerFactory
import org.apache.ftpserver.usermanager.PropertiesUserManagerFactory
import scalasthlm.alpa... | ScalaSthlm/alpakka-integration-patterns | playground/src/main/scala/scalasthlm/alpakka/playground/FtpServerEmbedded.scala | Scala | apache-2.0 | 1,252 |
package net.devkat.collection
/**
* http://stackoverflow.com/questions/9850786/is-there-such-a-thing-as-bidirectional-maps-in-scala
*/
object BiMap {
private[BiMap] trait MethodDistinctor
implicit final object MethodDistinctor extends MethodDistinctor
}
case class BiMap[X, Y](map: Map[X, Y]) {
def this(tuples... | devkat/scala-ocm | core/src/main/scala/net/devkat/collection/BiMap.scala | Scala | apache-2.0 | 617 |
/*
* Element.scala
* Elements of Figaro models.
*
* Created By: Avi Pfeffer (apfeffer@cra.com)
* Creation Date: Jan 1, 2009
*
* Copyright 2013 Avrom J. Pfeffer and Charles River Analytics, Inc.
* See http://www.cra.com or email figaro@cra.com for information.
*
* See http://www.github.com/p2t2/figaro f... | jyuhuan/figaro | Figaro/src/main/scala/com/cra/figaro/language/Element.scala | Scala | bsd-3-clause | 24,130 |
/*
* 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 ... | Dax1n/spark-core | core/src/main/scala/org/apache/spark/util/Clock.scala | Scala | apache-2.0 | 2,308 |
package models.admin
import scalaz._
import Scalaz._
import scalaz.effect.IO
import scalaz.EitherT._
import scalaz.Validation
import scalaz.Validation.FlatMap._
import scalaz.NonEmptyList._
import cache._
import db._
import models.Constants._
import io.megam.auth.funnel.FunnelErrors._
import com.datastax.driver.core... | indykish/vertice_gateway | app/models/admin/Licenses.scala | Scala | mit | 3,983 |
package squants
object Platform {
/**
* Helper function to achieve uniform Double formatting over JVM, JS, and native platforms.
* Simple Double.toString will format 1.0 as "1.0" on JVM and as "1" on JS
* @param d Double number to be formatted
* @return
*/
private[squants] def crossFormat(d: Double)... | typelevel/squants | jvm/src/main/scala/squants/Platform.scala | Scala | apache-2.0 | 427 |
package com.tribbloids.spookystuff.integration.join
import com.tribbloids.spookystuff.actions.Wget
import com.tribbloids.spookystuff.extractors.Col
/**
* Created by peng on 25/10/15.
*/
class InnerWgetJoinIT extends InnerVisitJoinIT {
override lazy val driverFactories = Seq(
null
)
override def getPag... | tribbloid/spookystuff | integration/src/test/scala/com/tribbloids/spookystuff/integration/join/InnerWgetJoinIT.scala | Scala | apache-2.0 | 354 |
object Test {
def main(args: Array[String]): Unit = {
val j = new J_2()
println(j.bar1())
println(j.bar2())
println(j.bar3())
}
}
| som-snytt/dotty | tests/run/t4317/S_3.scala | Scala | apache-2.0 | 150 |
/*
* 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... | monifu/monifu | monix-reactive/jvm/src/test/scala/monix/reactive/compression/CompressionIntegrationSuite.scala | Scala | apache-2.0 | 1,119 |
package scodec
package codecs
import scalaz.\/
import scalaz.syntax.std.either._
import scalaz.syntax.std.option._
import java.nio.{ ByteBuffer, ByteOrder }
import scodec.bits.{ BitVector, ByteOrdering, ByteVector }
private[codecs] final class ShortCodec(bits: Int, signed: Boolean, ordering: ByteOrdering) extends C... | danielwegener/scodec | src/main/scala/scodec/codecs/ShortCodec.scala | Scala | bsd-3-clause | 1,297 |
package com.idealicious
import java.io.{FileWriter, IOException}
// http://examples.javacodegeeks.com/core-java/writeread-csv-files-in-java-example/
class CSVWriter(val data: Seq[Journal], val header: Seq[String], val delimiter: String = ",", val newLine: String = "\\n") {
def write(path: String) = {
var fw: Fi... | aksiksi/impact | src/main/scala/com/idealicious/CSVWriter.scala | Scala | mit | 937 |
/**
* 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... | chirino/activemq-apollo | apollo-network/src/main/scala/org/apache/activemq/apollo/broker/network/NetworkManager.scala | Scala | apache-2.0 | 10,095 |
package wow.realm.protocol
import scala.language.implicitConversions
/**
* Class used to indicite which opcode a payload is associated to
*
* @param opCode opcode
* @tparam A payload type
*/
case class OpCodeProvider[A](opCode: OpCodes.Value)
object OpCodeProvider {
/**
* Implicit cast from opcode to... | SKNZ/SpinaciCore | wow/core/src/main/scala/wow/realm/protocol/OpCodeProvider.scala | Scala | mit | 566 |
package org.scalarules.finance
/**
* Aggregates the implicits of the finance DSL. A simple import og org.scalarules.finance.nl._ will bring all implicits
* into scope.
*/
package object nl extends FinanceDsl {
}
| scala-rules/finance-dsl | src/main/scala/org/scalarules/finance/nl/package.scala | Scala | mit | 220 |
/*
* scala-swing (https://www.scala-lang.org)
*
* Copyright EPFL, Lightbend, Inc., contributors
*
* 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... | scala/scala-swing | src/main/scala/scala/swing/RadioButton.scala | Scala | apache-2.0 | 757 |
package teststep
package modules
object Errors {
val base = """The correct use is:
| teststep <path to source directory>
| teststep <path to source file> <path to key-value map>
| teststep <path to source directory> <path to key-value map>
""".stripMargin
val e1 = s"Missing arguments.\\n$base"... | ssfc/test_step | src/main/scala/teststep/modules/Errors.scala | Scala | apache-2.0 | 1,073 |
/*
* Copyright 2015 Nicolas Rinaudo
*
* 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... | nrinaudo/scala-csv | core/shared/src/test/scala/kantan/csv/ops/CsvSourceOpsTests.scala | Scala | mit | 3,004 |
package plots
import java.io.File
import javafx.application.Application
import javafx.scene._
import javafx.scene.chart._
import javafx.scene.control._
import javafx.scene.input._
import javafx.scene.layout._
import javafx.stage._
import scala.io.Source
import javafx.collections.ObservableList
import scala.collection.... | nativelibs4java/Scalaxy | Fx/Example/Grapher/src/main/scala/Plotter.scala | Scala | bsd-3-clause | 4,386 |
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.