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 2001-2014 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... | travisbrown/scalatest | src/main/scala/org/scalactic/EnabledEqualityBetween.scala | Scala | apache-2.0 | 855 |
package com.twitter.finagle.memcached.integration
import com.twitter.finagle.Address
import com.twitter.finagle.Memcached
import com.twitter.finagle.Name
import com.twitter.finagle.memcached.Client
import com.twitter.finagle.memcached.protocol._
import com.twitter.finagle.stats.SummarizingStatsReceiver
import com.twit... | spockz/finagle | finagle-memcached/src/test/scala/com/twitter/finagle/memcached/integration/SimpleClientTest.scala | Scala | apache-2.0 | 7,225 |
package com.github.opengrabeso.mixtio
package common.model
@SerialVersionUID(12L)
// median, 80% percentile, max
case class SpeedStats(median: Double, fast: Double, max: Double)
object SpeedStats extends rest.EnhancedRestDataCompanion[SpeedStats]
| OndrejSpanel/Stravamat | shared-js/src/main/scala/com/github/opengrabeso/mixtio/common/model/SpeedStats.scala | Scala | gpl-2.0 | 249 |
package org.scalacoin.marshallers.script
import org.scalacoin.marshallers.MarshallerUtil
import org.scalacoin.protocol.script.{ScriptPubKey}
import spray.json._
import DefaultJsonProtocol._
/**
* Created by chris on 12/27/15.
*/
object ScriptPubKeyMarshaller extends DefaultJsonProtocol with MarshallerUtil {
val r... | TomMcCabe/scalacoin | src/main/scala/org/scalacoin/marshallers/script/ScriptPubKeyMarshaller.scala | Scala | mit | 1,149 |
package unfiltered.response
import org.specs2.mutable._
object JsonSpec extends Specification with unfiltered.specs2.jetty.Served {
import unfiltered.response._
import unfiltered.request.{Path => UFPath}
import org.json4s.JsonDSL._
class TestPlan extends unfiltered.filter.Plan {
def intent = {
ca... | hamnis/unfiltered | json4s/src/test/scala/JsonSpec.scala | Scala | mit | 768 |
package grammarcomp
package equivalence
import grammar._
import repair._
import parsing._
import generators._
import CFGrammar._
import EBNFGrammar._
import BNFConverter._
sealed abstract class EquivalenceResult[T]
//object PossiblyEquivalent extends EquivalenceResult {
// override def toString = "Possibly correct!... | epfl-lara/GrammarComparison | src/main/scala/grammarcomp/equivalence/EquivalenceChecker.scala | Scala | mit | 1,203 |
package com.github.mrpowers.spark.examples
import org.apache.spark.sql.functions._
import org.apache.spark.sql.DataFrame
object PeopleProcessor {
def run(df: DataFrame): DataFrame = {
df.transform(withAge).transform(withSeniorCitizen)
}
def withAge(df: DataFrame): DataFrame = {
df.withColumn("age", ye... | MrPowers/spark-examples | src/main/scala/com/github/mrpowers/spark/examples/PeopleProcessor.scala | Scala | mit | 480 |
package me.m1key.audioliciousmigration.mining
import com.google.inject.Inject
import me.m1key.audioliciousmigration.persistence.mongodb.MorphiaMongoDbPersistenceProvider
import com.mongodb.BasicDBObject
class ArtistCountMining @Inject() (private val persistenceProvider: MorphiaMongoDbPersistenceProvider) {
private ... | m1key/audiolicious-migration | src/main/scala/me/m1key/audioliciousmigration/mining/ArtistCountMining.scala | Scala | gpl-3.0 | 756 |
//
// CompilationExceptions.scala -- Scala child classes of CompilationException
// Project OrcScala
//
// Created by jthywiss on Aug 11, 2010.
//
// Copyright (c) 2019 The University of Texas at Austin. All rights reserved.
//
// Use and redistribution of this file is governed by the license terms in
// the LICENSE fi... | orc-lang/orc | OrcScala/src/orc/error/compiletime/CompilationExceptions.scala | Scala | bsd-3-clause | 9,984 |
/*
* Copyright 2017 Datamountaineer.
*
* 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... | CodeSmell/stream-reactor | kafka-connect-voltdb/src/main/scala/com/datamountaineer/streamreactor/connect/voltdb/writers/CreateSqlFn.scala | Scala | apache-2.0 | 1,080 |
package de.frosner.ddq.reporters
import java.io.{ByteArrayOutputStream, PrintStream}
import de.frosner.ddq.constraints._
import de.frosner.ddq.core._
import de.frosner.ddq.testutils.{DummyConstraint, DummyConstraintResult}
import org.apache.spark.sql.DataFrame
import org.mockito.Mockito._
import org.scalatest.mock.Mo... | FRosner/drunken-data-quality | src/test/scala/de/frosner/ddq/reporters/ZeppelinReporterTest.scala | Scala | apache-2.0 | 4,050 |
/*
* 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 | sql/core/src/test/scala/org/apache/spark/sql/execution/command/PlanResolutionSuite.scala | Scala | apache-2.0 | 26,336 |
package ammonite.interp
object Parsers {
import fastparse.noApi._
import scalaparse.Scala._
import WhitespaceApi._
// For some reason Scala doesn't import this by default
val `_` = scalaparse.Scala.`_`
val ImportSplitter: P[Seq[ammonite.util.ImportTree]] = {
val IdParser = P( (Id | `_` ).! ).map(
... | alexarchambault/ammonium | amm/interp/src/main/scala/ammonite/interp/Parsers.scala | Scala | mit | 3,516 |
/*
* Copyright (C) Lightbend Inc. <https://www.lightbend.com>
*/
package play.libs.ws
import akka.actor.ActorSystem
import akka.stream.Materializer
import play.api.mvc.Results._
import play.api.mvc._
import play.api.test._
import play.core.server.Server
import play.libs.ws.ahc.AhcWSClient
import play.shaded.ahc.org... | mkurz/playframework | transport/client/play-ahc-ws/src/test/scala/play/libs/ws/WSSpec.scala | Scala | apache-2.0 | 1,501 |
/*
* 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 ... | suvam97/zeppelin | r/src/main/scala/org/apache/zeppelin/rinterpreter/RContext.scala | Scala | apache-2.0 | 11,392 |
package org.jetbrains.plugins.scala
package annotator
import org.jetbrains.plugins.scala.lang.psi.types.ScType
import com.intellij.lang.annotation.AnnotationHolder
import org.jetbrains.plugins.scala.ScalaBundle
import org.jetbrains.plugins.scala.lang.psi.types.{Unit => UnitType, Any => AnyType}
import quickfix.modifie... | consulo/consulo-scala | src/org/jetbrains/plugins/scala/annotator/FunctionAnnotator.scala | Scala | apache-2.0 | 5,269 |
package slick.jdbc.meta
import java.sql._
import slick.jdbc.{ResultSetAction, JdbcTypesComponent}
/** A wrapper for a row in the ResultSet returned by DatabaseMetaData.getProcedureColumns(). */
case class MProcedureColumn(
procedure: MQName, column: String, columnType: Short, sqlType: Int, typeName: String,
preci... | marko-asplund/slick | slick/src/main/scala/slick/jdbc/meta/MProcedureColumn.scala | Scala | bsd-2-clause | 1,325 |
/*
* Copyright (c) 2002-2018 "Neo Technology,"
* Network Engine for Objects in Lund AB [http://neotechnology.com]
*
* This file is part of Neo4j.
*
* Neo4j 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 Foundatio... | HuangLS/neo4j | community/cypher/cypher-compiler-2.3/src/main/scala/org/neo4j/cypher/internal/compiler/v2_3/planner/logical/planExpressionRewriter.scala | Scala | apache-2.0 | 1,536 |
/*
* product-collections is distributed under the 2-Clause BSD license. See the
* LICENSE file in the root of the repository.
*
* Copyright (c) 2013 - 2015 Mark Lister
*/
package com.github.marklister.collections.io
import java.io.Reader
class InputBuffer(br: Reader, val buffSize: Int = 8194) {
private [this... | CapeSepias/product-collections | shared/src/main/scala/collections/io/InputBuffer.scala | Scala | bsd-2-clause | 2,298 |
package aws.daleks.eager
import java.util.logging.Logger
import aws.daleks.util.Humid
trait Dalek {
val logger = Logger.getLogger(classOf[Dalek].getName)
def humidity = if (Humid.isDry) "[DRY]" else "[WET]"
def exterminate
def info(dalek:Dalek,msg:String) = logger.info(s"[$humidity] [$msg]")
} | ggallego/aws-daleks | src/main/scala/aws/daleks/eager/EagerDalek.scala | Scala | apache-2.0 | 305 |
/* __ *\
** ________ ___ / / ___ __ ____ Scala.js Test Suite **
** / __/ __// _ | / / / _ | __ / // __/ (c) 2013, LAMP/EPFL **
** __\ \/ /__/ __ |/ /__/ __ |/_// /_\ \ http://scala-js.org/ **
** /____/\___/_/ |_/... | xuwei-k/scala-js | test-suite/js/src/test/scala/org/scalajs/testsuite/jsinterop/ThisFunctionTest.scala | Scala | bsd-3-clause | 3,654 |
/*
* 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/test/scala/org/apache/spark/util/collection/BitSetSuite.scala | Scala | apache-2.0 | 4,961 |
// Copyright: 2017 https://github.com/cakesolutions/sbt-cake/graphs
// License: http://www.apache.org/licenses/LICENSE-2.0
package net.cakesolutions
import java.time.{Clock, ZonedDateTime}
import java.time.format.DateTimeFormatter
import scala.sys.process._
import scala.util._
import sbt.Keys._
import sbt._
import ... | cakesolutions/sbt-cake | src/main/scala/net/cakesolutions/CakeBuildInfoPlugin.scala | Scala | apache-2.0 | 5,449 |
package collins
package config
import play.api.{Application, Plugin}
import _root_.util.config.Registry
class ConfigPlugin(app: Application) extends Plugin {
override def enabled = true
override def onStart() {
if (enabled) {
Registry.initializeAll(app)
Registry.validate
}
}
override de... | Shopify/collins | app/collins/config/ConfigPlugin.scala | Scala | apache-2.0 | 364 |
package com.twitter.finatra.http.tests.integration.doeverything.main
import com.google.inject.{Module, Provides}
import com.twitter.finagle.http.{Request, Response}
import com.twitter.finagle.stats.StatsReceiver
import com.twitter.finagle.{Filter, Http}
import com.twitter.finatra.http.filters.CommonFilters
import com.... | twitter/finatra | http-server/src/test/scala/com/twitter/finatra/http/tests/integration/doeverything/main/DoEverythingServer.scala | Scala | apache-2.0 | 5,182 |
package com.lookout.borderpatrol.crypto
import com.lookout.borderpatrol.sessionx.{EncryptedDataEncoder, SignedId, Session}
import com.twitter.io.Buf
import com.twitter.util.Future
import com.twitter.finagle.memcached
import scala.util.{Success, Failure}
/**
* Session store that will store encrypted `Session[_]` dat... | lookout/borderpatrol | core/src/main/scala/com/lookout/borderpatrol/crypto/EncryptedSessionStore.scala | Scala | mit | 2,997 |
/*
* Copyright (C) Lightbend Inc. <https://www.lightbend.com>
*/
package com.lightbend.lagom.scaladsl.persistence.jdbc
import akka.actor.setup.ActorSystemSetup
import akka.actor.ActorSystem
import akka.actor.BootstrapSetup
import akka.cluster.Cluster
import com.lightbend.lagom.internal.persistence.ReadSideConfig
im... | lagom/lagom | persistence-jdbc/scaladsl/src/test/scala/com/lightbend/lagom/scaladsl/persistence/jdbc/JdbcPersistenceSpec.scala | Scala | apache-2.0 | 2,766 |
/*
* Copyright (c) 2012, 2013, 2014, 2015, 2016 SURFnet BV
* 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, thi... | BandwidthOnDemand/play-nsi-support | src/main/scala/nl/surfnet/nsiv2/soap/SoapWebService.scala | Scala | bsd-3-clause | 3,270 |
package org.jetbrains.plugins.scala.caches
import com.intellij.openapi.util.{Key, ModificationTracker, SimpleModificationTracker}
import com.intellij.psi.PsiElement
import org.jetbrains.plugins.scala.extensions.ObjectExt
import org.jetbrains.plugins.scala.lang.psi.api.ScalaFile
import org.jetbrains.plugins.scala.lang.... | JetBrains/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/caches/BlockModificationTracker.scala | Scala | apache-2.0 | 4,639 |
/*
* 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 ... | uncleGen/aliyun-emapreduce-sdk | external/emr-logservice/src/main/scala/org/apache/spark/streaming/aliyun/logservice/LoghubReceiver.scala | Scala | artistic-2.0 | 3,270 |
package com.yetu.oauth2provider
package utils
import java.security.SecureRandom
/*
* Generates a Bearer Token with the length of 32 characters according to the
* specification RFC6750 (http://http://tools.ietf.org/html/rfc6750)
*
* http://auconsil.blogspot.de/2013/06/create-bearer-token-in-scala.html
*/
object B... | yetu/oauth2-provider | app/com/yetu/oauth2provider/utils/BearerTokenGenerator.scala | Scala | mit | 832 |
package controllers
import java.nio.ByteBuffer
import javax.inject._
import actors.RootActor
import akka.actor.{ActorSystem, Props}
import boopickle.Default._
import models.{NewsLinkModel, NewsLinkStore}
import play.api.mvc._
import play.api.{Configuration, Environment}
import services.{ApiService, WebServiceParser}
... | IceGiant/internet-abridged | server/src/main/scala/controllers/Application.scala | Scala | apache-2.0 | 1,951 |
package uk.gov.bis.levyApiMock.data.levy
import scala.concurrent.{ExecutionContext, Future}
case class EmployerName(nameLine1: Option[String], nameLine2: Option[String])
case class Employer(name: EmployerName)
case class EmprefResponse(_links: Map[String, Href], empref: String, employer: Employer)
trait EmprefOps ... | SkillsFundingAgency/das-alpha-hmrc-api-mock | src/main/scala/uk/gov/bis/levyApiMock/data/levy/EmprefOps.scala | Scala | mit | 421 |
/*
* The MIT License
*
* Copyright (c) 2016 Fulcrum Genomics LLC
*
* 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 rights
* to us... | fulcrumgenomics/dagr | tasks/src/main/scala/dagr/tasks/picard/FixMateInformation.scala | Scala | mit | 1,703 |
/*
* 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 ... | aliyun/aliyun-emapreduce-sdk | emr-logservice/src/main/scala/org/apache/spark/streaming/aliyun/logservice/writer/LoghubWriter.scala | Scala | artistic-2.0 | 1,576 |
package com.github.kafka_tools.kafka
import kafka.producer.{Partitioner => P}
import kafka.utils.VerifiableProperties
/**
* Author: Evgeny Zhoga
* Date: 18.07.14
*/
class Partitioner(props: VerifiableProperties = null) extends P() {
def partition(key: Any, numPartitions: Int) = {
math.abs(key.asInstanceOf[Ke... | kafka-tools/kafka-logback-appender | kafka-logback-appender/src/main/scala/com/github/kafka_tools/kafka/Partitioner.scala | Scala | apache-2.0 | 360 |
/**
* Copyright (c) 2002-2012 "Neo Technology,"
* Network Engine for Objects in Lund AB [http://neotechnology.com]
*
* This file is part of Neo4j.
*
* Neo4j 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 Foundati... | dksaputra/community | cypher/src/main/scala/org/neo4j/cypher/internal/pipes/FilterPipe.scala | Scala | gpl-3.0 | 1,400 |
package io.youi.server.dsl
import io.youi.http.HttpConnection
sealed trait FilterResponse {
def connection: HttpConnection
}
object FilterResponse {
case class Continue(connection: HttpConnection) extends FilterResponse
case class Stop(connection: HttpConnection) extends FilterResponse
} | outr/youi | server/src/main/scala/io/youi/server/dsl/FilterResponse.scala | Scala | mit | 297 |
package scalasearch
import scala.util.matching.Regex
case class SearchResult(searchPattern: Regex, file: Option[SearchFile],
lineNum: Int, matchStartIndex: Int,
matchEndIndex: Int, line: Option[String],
linesBefore: Seq[String], linesAfter: Seq[S... | clarkcb/xsearch | scala/scalasearch/src/main/scala/scalasearch/SearchResult.scala | Scala | mit | 5,399 |
package universe
import universe.Globals.engine._
class Plant(implicit world: World) extends BoardElement {
val energy = Var(Plant.Energy)
val isDead = energy map (_ <= 0)
val age: Signal[Int] = world.time.hour.changed.iterate(0)(_ + 1)
val grows: Event[Int] = age.changed && {_ % Plant.GrowTime == 0}
va... | volkc/REScala | Examples/Universe/src/main/scala/universe/Plant.scala | Scala | apache-2.0 | 1,079 |
package shared.model
sealed trait Event {
def name: String
def timestamp: Long
}
case class Line(value: String, timestamp: Long = System.currentTimeMillis()) extends Event {
val name: String = Line.name
}
object Line {
val name = "line"
}
case class TestResult(status: String, errorMessage: String = "", tim... | DmytroOrlov/devgym | shared/src/main/scala/shared/model/Event.scala | Scala | apache-2.0 | 894 |
/*
* 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 ... | ioana-delaney/spark | mllib/src/test/scala/org/apache/spark/ml/classification/GBTClassifierSuite.scala | Scala | apache-2.0 | 15,540 |
object ValueFunctionOverloading {
def foo(x: Int): Int = x + 1
val foo: String => String = "" + _
/* line: 2 */ foo(3)
/* line: 3 */ foo("")
} | ilinum/intellij-scala | testdata/resolve2/bug/ValueFunctionOverloading.scala | Scala | apache-2.0 | 151 |
/*
* 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 ... | Aegeaner/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/orc/OrcScan.scala | Scala | apache-2.0 | 2,181 |
package works.weave.socks.aws.orders.presentation.resource
import java.net.URI
import java.time.LocalDateTime
import javax.ws.rs.GET
import javax.ws.rs.POST
import javax.ws.rs.Path
import javax.ws.rs.Produces
import javax.ws.rs.QueryParam
import javax.ws.rs.core.MediaType
import javax.ws.rs.core.Response
import org.sl... | Compositional/orders-aws | src/main/scala/works.weave.socks.aws.orders/presentation/resource/OrdersResource.scala | Scala | apache-2.0 | 4,513 |
package fpinscala
package applicative
import monads.Functor
import state._
import State._
// must not import this any more, since exercises 6.{12,13} are implemented
// import StateUtil._ // defined at bottom of this file
import monoids._
trait Applicative[F[_]] extends Functor[F] {
def map2[A,B,C](fa: F[A], fb: F... | ShokuninSan/fpinscala | exercises/src/main/scala/fpinscala/applicative/Applicative.scala | Scala | mit | 4,290 |
/*
* 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... | pmularien/spectrum-old | financial/src/main/scala/org/quantintel/ql/time/calendars/Mexico.scala | Scala | apache-2.0 | 2,963 |
/*
* 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... | pmularien/spectrum-old | financial/src/main/scala/org/quantintel/ql/time/Calendar.scala | Scala | apache-2.0 | 11,811 |
package io.scalajs.nodejs
import io.scalajs.collection.Iterator
import scala.scalajs.js
import scala.scalajs.js.|
/**
* url package object
* @author lawrence.daniels@gmail.com
*/
package object url {
type Iterable[A] = js.Array[A] | Iterator[A]
}
| scalajs-io/nodejs | app/current/src/main/scala/io/scalajs/nodejs/url/package.scala | Scala | apache-2.0 | 260 |
package skuber
import java.util.Date
import Volume._
/**
* @author David O'Riordan
*/
case class PersistentVolume(
val kind: String ="PersistentVolume",
override val apiVersion: String = v1,
val metadata: ObjectMeta = ObjectMeta(),
spec: Option[PersistentVolume.Spec] = None,
status: Option[Pers... | doriordan/skuber | client/src/main/scala/skuber/PersistentVolume.scala | Scala | apache-2.0 | 1,776 |
package org.jetbrains.plugins.scala
package lang.refactoring
import mock.EditorMock
import org.jetbrains.plugins.scala.base.SimpleTestCase
import com.intellij.codeInsight.editorActions.moveUpDown.StatementUpDownMover
import junit.framework.Assert._
import java.util.ArrayList
import collection.JavaConversions._
import ... | consulo/consulo-scala | test/org/jetbrains/plugins/scala/lang/refactoring/StatementMoverTestBase.scala | Scala | apache-2.0 | 2,329 |
package dit4c.scheduler.domain
import dit4c.common.KryoSerializable
trait BaseCommand extends KryoSerializable {} | dit4c/dit4c | dit4c-scheduler/src/main/scala/dit4c/scheduler/domain/BaseCommand.scala | Scala | mit | 115 |
/*
* 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 | mllib/src/test/scala/org/apache/spark/mllib/linalg/distributed/CoordinateMatrixSuite.scala | Scala | apache-2.0 | 4,242 |
package dsmoq.persistence
import org.joda.time.DateTime
import PostgresqlHelper.PgSQLSyntaxType
import scalikejdbc.AutoSession
import scalikejdbc.DBSession
import scalikejdbc.ResultName
import scalikejdbc.ResultName
import scalikejdbc.SQLSyntax
import scalikejdbc.SQLSyntaxSupport
import scalikejdbc.SQLSyntaxSupport
i... | nkawa/dsmoq | server/common/src/main/scala/dsmoq/persistence/ZipedFiles.scala | Scala | apache-2.0 | 6,443 |
/*
Copyright (C) 2014-2020 Miquel Sabaté Solà <mikisabate@gmail.com>
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 prog... | mssola/thesis | upc/project/Build.scala | Scala | gpl-3.0 | 3,377 |
package grasshopper.test
import java.io.File
import java.net.InetAddress
import akka.NotUsed
import akka.actor.ActorSystem
import akka.stream.ActorMaterializer
import akka.stream.scaladsl.{ FileIO, Source, Flow, Sink }
import akka.stream.ActorAttributes.supervisionStrategy
import akka.stream.Supervision.resumingDecide... | cfpb/grasshopper | test-harness/src/main/scala/grasshopper/test/ExtractIndex.scala | Scala | cc0-1.0 | 4,449 |
/*
* Copyright 2012-2020 the original author or 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 ap... | planet42/Laika | core/shared/src/main/scala/laika/parse/code/languages/YAMLSyntax.scala | Scala | apache-2.0 | 3,073 |
package qrygraph.shared.parser
import qrygraph.shared.data.{Edge, Node, PigQueryGraph, QueryLoadSource}
import qrygraph.shared.nodes._
/** parses pig scripts into commands */
object PigScriptParser {
/** simple class for parsedLines */
case class ParsedLine(name: String, command: String, parameter: String)
/**... | Starofall/QryGraph | qrygraph/shared/src/main/scala/qrygraph/shared/parser/PigScriptParser.scala | Scala | mit | 4,807 |
/* *\\
** _____ __ _____ __ ____ **
** / ___/ / / /____/ / / / \\ FieldKit **
** / ___/ /_/ /____/ / /__ / / / (c) 2009, field.io ... | field/FieldKit.scala | src.particle/field/kit/particle/StatefulEmitter.scala | Scala | lgpl-3.0 | 1,603 |
package lib
import scala.util.{Failure, Success, Try}
sealed abstract class Datatype(val name: String)
object Datatype {
sealed abstract class Primitive(override val name: String)
extends Datatype(name)
object Primitive {
def apply(name: String): Try[Primitive] = Try(name match {
case "boolean" =>... | mbryzek/apidoc-generator | lib/src/main/scala/Datatype.scala | Scala | mit | 4,358 |
package models
import java.sql.Connection
case class ChangeItemCategory(
categoryId: Long
) (
implicit itemRepo: ItemRepo
) {
def update(itemId: Long)(implicit conn: Connection) {
itemRepo.changeCategory(ItemId(itemId), categoryId)
}
}
| ruimo/store2 | app/models/ChangeItemCategory.scala | Scala | apache-2.0 | 250 |
package com.devangmundhra
import io.prediction.controller.PPreparator
import org.apache.spark.SparkContext
import org.apache.spark.SparkContext._
import org.apache.spark.rdd.RDD
class Preparator
extends PPreparator[TrainingData, PreparedData] {
def prepare(sc: SparkContext, trainingData: TrainingData): Prepared... | devangmundhra/pio-eventsimilar | src/main/scala/Preparator.scala | Scala | mit | 613 |
/***********************************************************************
* 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... | jahhulbert-ccri/geomesa | geomesa-index-api/src/test/scala/org/locationtech/geomesa/index/TestGeoMesaDataStore.scala | Scala | apache-2.0 | 11,656 |
package mesosphere.mesos
import java.time.Clock
import mesosphere.UnitTest
import mesosphere.marathon.RichClock
import mesosphere.marathon.state.Timestamp
import mesosphere.marathon.test.MarathonTestHelper
import org.apache.mesos.Protos.Offer
import scala.concurrent.duration._
class AvailabilityTest extends UnitTes... | guenter/marathon | src/test/scala/mesosphere/mesos/AvailabilityTest.scala | Scala | apache-2.0 | 1,938 |
package colossus.streaming
import colossus.controller.{ControllerDownstream, ControllerUpstream, Encoding}
import colossus.core.{DisconnectCause, DownstreamEventHandler, UpstreamEventHandler}
/**
* A Transcoder is used to convert streams of one encoding to streams of
* another. The two streams are intended to be... | tumblr/colossus | colossus/src/main/scala/colossus/streaming/StreamTranscoder.scala | Scala | apache-2.0 | 2,760 |
package im.actor.server.api.rpc.service
import java.net.URLEncoder
import java.time.{ LocalDateTime, ZoneOffset }
import im.actor.server.api.rpc.service.contacts.ContactsServiceImpl
import scala.concurrent.{ ExecutionContext, Future }
import scala.util.Random
import scalaz.\\/
import akka.contrib.pattern.Distribute... | sfshine/actor-platform | actor-server/actor-tests/src/test/scala/im/actor/server/api/rpc/service/AuthServiceSpec.scala | Scala | mit | 35,971 |
/*
* Beangle, Agile Development Scaffold and Toolkits.
*
* Copyright © 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... | beangle/beangle | style/src/main/scala/org/beangle/style/maven/LocMojo.scala | Scala | lgpl-3.0 | 3,552 |
package ${package};
/**
* Hello world
*/
object App {
def main(args: Array[String]): Unit = println("Hello World!")
} | holymonk/archetypes | archetype-scala/src/main/resources/archetype-resources/src/main/scala/App.scala | Scala | mit | 122 |
/*
* Copyright 2016 Heiko Seeberger
*
* 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... | hseeberger/gabbler | gabbler-user/src/test/scala/de/heikoseeberger/gabbler/user/UserRepositorySpec.scala | Scala | apache-2.0 | 2,856 |
package text.analyzer.dep.chapas
/**
* @author Nakayama
* Created on 2015/12/20
*/
case class PAS(predicate: Token,
arguments: Map[ArgLabel.Value, Token]) | ktr-skmt/FelisCatusZero | src/main/scala/text/analyzer/dep/chapas/PAS.scala | Scala | apache-2.0 | 184 |
/*
* 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... | travisbrown/scalatest | src/test/scala/org/scalatest/EventHelpers.scala | Scala | apache-2.0 | 2,878 |
package rere.ql.data
import rere.ql.types.{ReqlLine, ReqlPoint}
import rere.ql.values.ReqlLineQuery
case class GeoLineString(point1: GeoPoint, point2: GeoPoint, otherPoints: GeoPoint*)
object GeoLineString {
implicit def toReqlLine(implicit line: GeoLineString): ReqlLine = {
new ReqlLineQuery(line.point1, line... | pbaun/rere | modules/ql/src/main/scala/rere/ql/data/GeoLineString.scala | Scala | apache-2.0 | 380 |
package com.catinthedark.lib.animation
/**
* Created by over on 15.03.15.
*/
trait TriggeredAnimation extends Animation {
var started = false
override def step(delta: Float): Unit = {
if (started)
super.step(delta)
}
def start(): Unit = started = true
}
| cat-in-the-dark/old48_32_game | src/main/scala/com/catinthedark/lib/animation/TriggeredAnimation.scala | Scala | apache-2.0 | 276 |
package fpinscala.monoids
import org.specs2.mutable.Specification
import org.specs2.matcher.{Matcher,Matchers,TerminationMatchers}
import org.specs2.matcher.Expectable
import org.specs2.matcher.MatchResult
import fpinscala.parallelism.Nonblocking._
import fpinscala.parallelism.ThreadPoolContext
import fpinscala.state... | jonas/fpinscala | exercises/src/test/scala/fpinscala/monoids/MonoidSpec.scala | Scala | mit | 11,621 |
package org.glotaran.kernel.types.messages.worker
import org.glotaran.core.analysis.GlotaranAnalysis
/**
* Send to worker to start the analysis job.
*/
case class DoAnalysis(analysis: GlotaranAnalysis)
| glotaran/glotaran-kernel | glotaran-kernel-types/src/main/scala/org/glotaran/kernel/types/messages/worker/DoAnalysis.scala | Scala | gpl-3.0 | 206 |
/***********************************************************************
* Copyright (c) 2013-2017 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... | ronq/geomesa | geomesa-process/geomesa-process-vector/src/main/scala/org/locationtech/geomesa/process/transform/BinConversionProcess.scala | Scala | apache-2.0 | 6,105 |
/**
* Copyright (C) 2012 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 prog... | brunobuzzi/orbeon-forms | portlet-support/src/test/scala/org/orbeon/oxf/portlet/WSRP2UtilsTest.scala | Scala | lgpl-2.1 | 3,438 |
/*
* 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 | app/models/responsiblepeople/ResponsiblePerson.scala | Scala | apache-2.0 | 18,013 |
object App {
def this(i0: Int = 100) = {
val i1: i0 = 1; case _ => i2(i1) }
} | som-snytt/dotty | tests/fuzzy/37e5de7d6a0fa8cc9123fd570d9fd82d1fc5767f.scala | Scala | apache-2.0 | 77 |
package org.wildfly.swarm.examples.scala
import java.util.Date
import javax.ws.rs.{GET, Path}
// @author Helio Frota
// @author Yoshimasa Tanabe
@Path("/")
class ScalaResource {
@GET
def get() = {
"Hail at " + new Date()
}
}
| mstahv/wildfly-swarm-examples | jaxrs/scala/src/main/scala/org/wildfly/swarm/examples/scala/ScalaResource.scala | Scala | apache-2.0 | 238 |
package redstone
import Direction._
import redstone.piece._
class Board(val boardPieces: List[BoardPiece], val maxX: Int = 3, val maxY: Int = 4, val bigSquareTargetX: Int = 1, val bigSquareTargetY: Int = 3,
val movesSoFar: List[(Int, Direction)] = List()) {
def findPiece(id: Int): BoardPiece = boardP... | skumargithub/redstone-solver | src/main/scala/redstone/Board.scala | Scala | gpl-2.0 | 4,729 |
package chandu0101.scalajs.rn.apis
import scala.scalajs.js
import scala.scalajs.js.UndefOr
trait PushNotificationIOS extends js.Object {
def setApplicationIconBadgeNumber(number: Int): Unit = js.native
def getApplicationIconBadgeNumber(callback: js.Function): Unit = js.native
def addEventListener(tpe: Strin... | beni55/scalajs-react-native | core/src/main/scala/chandu0101/scalajs/rn/apis/PushNotificationIOS.scala | Scala | apache-2.0 | 810 |
package antsy
trait Wheel[T] {
def turn: Wheel[T]
def get: T
}
object Wheels {
def colorWheel(colors: Seq[Int]): Wheel[Int] =
new Wheel[Int] {
def turn = colors match {
case head :: tail =>
colorWheel(tail ::: head :: Nil)
case head =>
colorWheel(head)
}
... | softprops/antsy | src/main/scala/wheels.scala | Scala | mit | 484 |
/*
* Copyright 2017 TWO SIGMA OPEN SOURCE, 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 appl... | jpallas/beakerx | kernel/scala/src/main/scala/com/twosigma/beakerx/scala/chart/xychart/plotitem/Crosshair.scala | Scala | apache-2.0 | 1,429 |
/*
* Shapes.scala
* (FScape)
*
* Copyright (c) 2001-2022 Hanns Holger Rutz. All rights reserved.
*
* This software is published under the GNU Affero General Public License v3+
*
*
* For further information, please contact Hanns Holger Rutz at
* contact@sciss.de
*/
package de.sciss.lucre.swing
import ... | Sciss/FScape-next | views/src/main/scala/de/sciss/lucre/swing/Shapes.scala | Scala | agpl-3.0 | 7,191 |
/*
* Copyright 2013 the original author or 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 applica... | Hocdoc/sandoc | src/main/scala/laika/parse/MarkupParsers.scala | Scala | apache-2.0 | 12,846 |
/*
* StillmanSubsumptionAlgorithmTest.scala
*
*/
package at.logic.gapt.expr
import at.logic.gapt.proofs.HOLSequent
import org.specs2.mutable._
class StillmanSubsumptionAlgorithmFOLTest extends Specification {
"StillmanSubsumptionAlgorithmFOL" should {
val P = "P"
val Q = "Q"
val R = "R"
val f = ... | loewenheim/gapt | src/test/scala/at/logic/gapt/expr/StillmanSubsumptionAlgorithmTest.scala | Scala | gpl-3.0 | 6,988 |
package scalaprops
package scalazlaws
import scalaprops.Property.forAll
import scalaz._
import scalaz.std.anyVal._
object cobind {
def cobindAssociative[F[_], A, B, C, D](implicit
F: Cobind[F],
D: Equal[D],
fa: Gen[F[A]],
f: Gen[F[A] => B],
g: Gen[F[B] => C],
h: Gen[F[C] => D]
): Property ... | scalaprops/scalaprops | scalaz/src/main/scala/scalaprops/scalazlaws/cobind.scala | Scala | mit | 885 |
package jigg.nlp.ccg
/*
Copyright 2013-2015 Hiroshi Noji
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 ... | mynlp/jigg | src/main/scala/jigg/nlp/ccg/CCGBank.scala | Scala | apache-2.0 | 3,220 |
/*
* Copyright (C) 2016-2019 Lightbend Inc. <https://www.lightbend.com>
*/
package com.lightbend.lagom.internal.persistence
import java.util.concurrent.TimeUnit
import com.typesafe.config.Config
import scala.concurrent.duration._
case class ReadSideConfig(
offsetTimeout: FiniteDuration = 5.seconds,
minBa... | ignasi35/lagom | persistence/core/src/main/scala/com/lightbend/lagom/internal/persistence/ReadSideConfig.scala | Scala | apache-2.0 | 1,131 |
/*
*
* o o o o o
* | o | |\\ /| | /
* | o-o o--o o-o oo | | O | oo o-o OO o-o o o
* | | | | | | | | | | | | | | | | \\ | | \\ /
* O---oo-o o--O | o-o o-o-o o o o-o-o o o o-o o
* |
... | anskarl/LoMRF | src/test/scala/lomrf/logic/TermSpecTest.scala | Scala | apache-2.0 | 5,785 |
package akka.persistence.journal.leveldb
import com.typesafe.config.ConfigFactory
import akka.persistence.journal.LegacyJournalSpec
import akka.persistence.PluginCleanup
class LeveldbJournalJavaSpec extends LegacyJournalSpec with PluginCleanup {
lazy val config = ConfigFactory.parseString(
"""
|akka.pers... | krasserm/akka-persistence-testkit | src/test/scala/akka/persistence/journal/leveldb/LeveldbJournalJavaSpec.scala | Scala | apache-2.0 | 600 |
/* Copyright (C) 2008-2016 University of Massachusetts Amherst.
This file is part of "FACTORIE" (Factor graphs, Imperative, Extensible)
http://factorie.cs.umass.edu, http://github.com/factorie
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with... | strubell/factorie | src/main/scala/cc/factorie/tutorial/TopicsOverTime.scala | Scala | apache-2.0 | 5,708 |
/*
* Copyright 2014–2017 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... | drostron/quasar | connector/src/main/scala/quasar/qscript/SimplifyProjection.scala | Scala | apache-2.0 | 2,934 |
/*
* 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/webmvc | support/src/main/scala/org/beangle/webmvc/support/pdf/ReportContext.scala | Scala | lgpl-3.0 | 970 |
package com.heluna.smtp
import org.subethamail.smtp.{MessageHandler, MessageContext, MessageHandlerFactory}
/**
* Created with IntelliJ IDEA.
* User: markbe
* Date: 5/1/13
* Time: 1:47 PM
*/
class MailDropMessageHandlerFactory extends Object with MessageHandlerFactory {
def create(ctx: MessageContext): Messag... | ministryofjustice/maildrop | smtp/src/main/scala/com/heluna/smtp/MailDropMessageHandlerFactory.scala | Scala | mit | 366 |
package com.github.dnvriend.json
import com.github.dnvriend.ops.AllOps
import org.scalatest.{ FlatSpec, Matchers }
import play.api.libs.json.Json
class SerializeJsonTest extends FlatSpec with Matchers with AllOps {
it should "escape the json string" in {
Json.obj("name" -> "dennis", "age" -> 42).escapedJson.byt... | dnvriend/serverless-test | aws-lambda-handler/src/test/scala/com/github/dnvriend/json/SerializeJsonTest.scala | Scala | apache-2.0 | 639 |
/*
Copyright 2014 Janek Bogucki
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 agree... | janekdb/scalacraft-domain | src/test/scala/com/scalacraft/domain/v2/net/unconstrained/IP4AddressSpec.scala | Scala | apache-2.0 | 2,867 |
/*
* 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 ... | yew1eb/flink | flink-libraries/flink-table/src/main/scala/org/apache/flink/table/runtime/aggregate/RowTimeBoundedRowsOver.scala | Scala | apache-2.0 | 9,665 |
package com.thangiee.lolhangouts.data.usecases.entities
case class SummSearchHist(name: String, regionId: String, isFriend: Boolean)
| Thangiee/LoL-Hangouts | src/com/thangiee/lolhangouts/data/usecases/entities/SummSearchHist.scala | Scala | apache-2.0 | 134 |
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.