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 |
|---|---|---|---|---|---|
/**
* The MIT License (MIT)
*
* Copyright (c) 2013 Lorand Szakacs
*
* 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 ... | lorandszakacs/fall2013-610-project-blackfyre | scala-data-aggregator/src/main/scala/behavioral/parse/Compare.scala | Scala | mit | 5,514 |
/*
* 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 ... | capitalone/Hydrograph | hydrograph.engine/hydrograph.engine.spark/src/main/scala/hydrograph/engine/spark/datasource/utils/ShutdownHookManager.scala | Scala | apache-2.0 | 6,907 |
package gitbucket.core.service
import gitbucket.core.model.{Collaborator, Repository, Account}
import gitbucket.core.model.Profile._
import gitbucket.core.util.JGitUtil
import profile.simple._
trait RepositoryService { self: AccountService =>
import RepositoryService._
/**
* Creates a new repository.
*
... | uli-heller/gitbucket | src/main/scala/gitbucket/core/service/RepositoryService.scala | Scala | apache-2.0 | 20,655 |
/*
* 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/main/scala/org/apache/spark/sql/execution/CacheManager.scala | Scala | apache-2.0 | 13,379 |
object Test {
def f1c(x: Int) = {
class T1 {
def f2 = {
trait T2 {
def f3: Int = {
def f4 = 10
def f5 = f4
def f7 = this.f3
f5
}
def f3a = f3
}
class C2 extends T2
class C3 extends T1
new C2... | som-snytt/dotty | tests/init/pos/inner28.scala | Scala | apache-2.0 | 378 |
package com.sksamuel.elastic4s.script
import com.sksamuel.elastic4s.FieldsMapper
import org.elasticsearch.script.Script
import org.elasticsearch.script.ScriptService.ScriptType
import scala.collection.JavaConverters._
import scala.language.implicitConversions
case class ScriptDefinition(script: String,
... | ulric260/elastic4s | elastic4s-core/src/main/scala/com/sksamuel/elastic4s/script/ScriptDefinition.scala | Scala | apache-2.0 | 1,473 |
package de.zalando.model
import de.zalando.apifirst.Application._
import de.zalando.apifirst.Domain._
import de.zalando.apifirst.ParameterPlace
import de.zalando.apifirst.naming._
import de.zalando.apifirst.Hypermedia._
import de.zalando.apifirst.Http._
import de.zalando.apifirst.Security
import java.net.URL
import Sec... | zalando/play-swagger | api-first-core/src/test/scala/model/resources.instagram_api_yaml.scala | Scala | mit | 171,134 |
package org.bitcoins.db
import com.typesafe.config.ConfigFactory
import org.bitcoins.chain.config.ChainAppConfig
import org.bitcoins.core.config.MainNet
import org.bitcoins.node.config.NodeAppConfig
import org.bitcoins.testkit.BitcoinSTestAppConfig
import org.bitcoins.testkit.BitcoinSTestAppConfig.ProjectType
import o... | bitcoin-s/bitcoin-s | db-commons-test/src/test/scala/org/bitcoins/db/DBConfigTest.scala | Scala | mit | 4,365 |
package codegen.types
object StructGenerator {
private val tabWidth = 4
/**
* Generates a string to declare a C struct
* @param definition Definition of the struct to generate
* @return String to declare the C struct
*/
def apply(definition: StructDefinition): String = {
s"""typedef struct... | gatkin/cDTO | src/main/scala/codegen/types/StructGenerator.scala | Scala | mit | 4,277 |
package cakesolutions.kafka
import org.apache.kafka.clients.consumer.ConsumerRecords
import org.apache.kafka.common.KafkaException
import org.apache.kafka.common.requests.IsolationLevel
import org.apache.kafka.common.serialization.{StringDeserializer, StringSerializer}
import org.slf4j.LoggerFactory
import scala.coll... | cakesolutions/scala-kafka-client | client/src/test/scala/cakesolutions/kafka/IdempotentProducerSpec.scala | Scala | mit | 3,253 |
package com.chriswk.bnet.wow.model
case class StatHolder(amount: Long, stat: Long)
| chriswk/sbnetapi | src/main/scala/com/chriswk/bnet/wow/model/Stat.scala | Scala | mit | 84 |
/*
* 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 ... | starpit/openwhisk | common/scala/src/main/scala/org/apache/openwhisk/core/containerpool/ContainerFactory.scala | Scala | apache-2.0 | 3,856 |
package mimir.adaptive
import java.io._
import com.typesafe.scalalogging.LazyLogging
import scala.collection.JavaConverters._
import scala.collection.mutable.ListBuffer
import mimir.Database
import mimir.parser._
import mimir.algebra._
import mimir.lenses._
import mimir.models._
import mimir.views._
import mimir.stat... | UBOdin/mimir | src/main/scala/mimir/adaptive/CheckHeader.scala | Scala | apache-2.0 | 3,691 |
/*
* Copyright 2011 TomTom International BV
*
* 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 o... | ebowman/splitter | src/test/scala/tomtom/splitter/layer7/RequestsTest.scala | Scala | apache-2.0 | 3,168 |
package nl.dekkr.hoppr.rest
import nl.dekkr.hoppr.model.{Feed, Syndication, FetchLogger}
import nl.dekkr.hoppr.rss.{FeedLogOutput, AtomOutput}
import spray.http.MediaTypes._
import spray.http.StatusCodes
import spray.httpx.marshalling._
import StatusCodes._
import spray.routing.HttpService
case class Url(uri: String)... | plamola/hoppR | src/main/scala/nl/dekkr/hoppr/rest/RestService.scala | Scala | mit | 3,285 |
package eu.timepit.refined.types
import eu.timepit.refined.api.{Refined, RefinedTypeOps}
import eu.timepit.refined.boolean.{And, Or}
import eu.timepit.refined.numeric.Interval
import eu.timepit.refined.string.{IPv4, MatchesRegex, StartsWith}
/** Module for refined types that are related to the Internet protocol suite... | fthomas/refined | modules/core/shared/src/main/scala-3.0+/eu/timepit/refined/types/net.scala | Scala | mit | 5,304 |
/*
* Copyright (C) 2014 - 2016 Softwaremill <http://softwaremill.com>
* Copyright (C) 2016 - 2019 Lightbend Inc. <http://www.lightbend.com>
*/
package akka.kafka.javadsl
import java.util
import java.util.concurrent.{CompletionStage, Executor, Executors}
import java.util.concurrent.atomic.AtomicBoolean
import akka... | softwaremill/reactive-kafka | tests/src/test/scala/akka/kafka/javadsl/ControlSpec.scala | Scala | apache-2.0 | 3,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 ... | shenbaise/mltoy | src/main/scala/org/apache/spark/examples/streaming/RecoverableNetworkWordCount.scala | Scala | apache-2.0 | 4,612 |
package learn.danipl.model
/**
* Created by Daniel on 07/09/2017.
*/
case class SimpleRecord(id: Long, body: Array[Byte]) | danipl/LearnScalaProject | src/main/scala/learn/danipl/model/SimpleRecord.scala | Scala | gpl-3.0 | 126 |
/*
* 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 | core/src/test/scala/org/apache/spark/deploy/master/ui/MasterWebUISuite.scala | Scala | apache-2.0 | 4,136 |
package com.redis
import java.io._
import java.net.{Socket, InetSocketAddress}
import serialization.Parse.parseStringSafe
trait IO extends Log {
val host: String
val port: Int
var socket: Socket = _
var out: OutputStream = _
var in: InputStream = _
var db: Int = _
def connected = {
socket != null... | Tjoene/thesis | Case_Programs/scala-redis-2.9-pre-scala-2.10/src/main/scala/com/redis/IO.scala | Scala | gpl-2.0 | 2,572 |
package stefansavev.demo.hyperloglog.hashing
trait Hasher {
def hash(obj: Long): Long
}
| dvgodoy/HashingAndSketching | out/production/hyperloglog/stefansavev/demo/hyperloglog/hashing/Hasher.scala | Scala | apache-2.0 | 91 |
package dsl
import ch.epfl.yinyang._
import ch.epfl.yinyang.typetransformers._
import scala.language.experimental.macros
import scala.reflect.macros.blackbox.Context
package object la {
def la[T](block: => T): T = macro implementations.liftRep[T]
def laDebug[T](block: => T): T = macro implementations.liftRepDebu... | scala-yinyang/scala-yinyang | components/examples/src/la/package.scala | Scala | bsd-3-clause | 1,335 |
package demo.pages
import japgolly.scalajs.react._
import japgolly.scalajs.react.vdom.prefix_<^._
import com.acework.js.components.bootstrap._
import demo.examples._
import org.scalajs.dom.raw.{HTMLDocument, HTMLElement}
import scala.scalajs.js.{UndefOr, undefined}
import org.scalajs.dom.{Event, document, window}
imp... | weiyinteo/scalajs-react-bootstrap | demo/src/main/scala/demo/pages/Components.scala | Scala | mit | 6,463 |
package com.giyeok.jparser.visualize
import org.eclipse.swt.graphics.Font
import org.eclipse.jface.resource.JFaceResources
import org.eclipse.swt.SWT
import org.eclipse.draw2d.MarginBorder
import org.eclipse.draw2d.Figure
import org.eclipse.draw2d.ColorConstants
import org.eclipse.draw2d.LineBorder
trait VisualizeRes... | Joonsoo/moon-parser | visualize/src/main/scala/com/giyeok/jparser/visualize/VisualizeResources.scala | Scala | mit | 4,166 |
package service
import model._
import scala.slick.driver.H2Driver.simple._
import Database.threadLocalSession
import util.JGitUtil
trait RepositoryService { self: AccountService =>
import RepositoryService._
/**
* Creates a new repository.
*
* @param repositoryName the repository name
* @param userNa... | emag/gitbucket | src/main/scala/service/RepositoryService.scala | Scala | apache-2.0 | 15,954 |
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2015-2021 Andre White.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE... | adarro/ddo-calc | subprojects/common/ddo-core/src/main/scala/io/truthencode/ddo/model/feats/ImprovedEvasion.scala | Scala | apache-2.0 | 1,665 |
package battle
import battle.GameBoard.Coordinate
class GameBoard(val width: Int, val height: Int) {
private val grid = Array.ofDim[AnyRef](width, height)
def put(obj: AnyRef, coordinate: Coordinate): Unit = {
grid(coordinate.x)(coordinate.y) = obj
}
def get(coordinate: Coordinate): Option[AnyRef] = {
... | bbalser/gladiator-actors | src/main/scala/battle/GameBoard.scala | Scala | cc0-1.0 | 966 |
import scala.quoted.*
trait IsExpr {
type Underlying
}
val foo: IsExpr = ???
def g()(using Quotes): Unit = {
val a = Type.of[foo.Underlying]
()
}
| dotty-staging/dotty | tests/pos-macros/i7048b.scala | Scala | apache-2.0 | 155 |
package java.net
import java.io.UnsupportedEncodingException
import java.nio.{CharBuffer, ByteBuffer}
import java.nio.charset.{Charset, MalformedInputException}
object URLDecoder {
@Deprecated
def decode(s: String): String = decodeImpl(s, Charset.defaultCharset)
def decode(s: String, enc: String): String = {
... | mdedetrich/scala-js | javalib/src/main/scala/java/net/URLDecoder.scala | Scala | bsd-3-clause | 2,033 |
// Compiles with no options
// Compiles with -Ydebug -Ydisable-unreachable-prevention
// Crashes with -Ydebug
trait Bippy { 3 match { case 3 => } }
| yusuke2255/dotty | tests/untried/pos/t7427.scala | Scala | bsd-3-clause | 148 |
/**
* Copyright (C) 2014 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... | brunobuzzi/orbeon-forms | form-runner/jvm/src/test/scala/org/orbeon/oxf/xml/FormRunnerFilterReceiverTest.scala | Scala | lgpl-2.1 | 4,709 |
package csvdb
import org.scalatest.{Matchers, FlatSpec}
import scala.io.Source
class DBSpec extends FlatSpec with Matchers {
"DB" should "sanitize file names" in {
DB.tableNameFor("../../../exported-data.csv") should be ("exported_data_csv")
DB.tableNameFor("exported-data.csv") should be ("exported_data_c... | mtomko/csvdb | src/test/scala/csvdb/DBSpec.scala | Scala | epl-1.0 | 947 |
package scala.meta.internal.io
import java.io.File
import java.net.URI
import java.nio.file.Path
// Rough implementation of java.nio.Path, should work similarly for the happy
// path but has undefined behavior for error handling.
case class NodeNIOPath(filename: String) extends Path {
private[this] val escapedSepar... | MasseGuillaume/scalameta | scalameta/io/js/src/main/scala/scala/meta/internal/io/NodeNIOPath.scala | Scala | bsd-3-clause | 3,273 |
package docs
object next_steps {
val _ = {
//#logdata
val logData =
"""|2013-06-29 11:16:23 124.67.34.60 keyboard
|2013-06-29 11:32:12 212.141.23.67 mouse
|2013-06-29 11:33:08 212.141.23.67 monitor
|2013-06-29 12:12:34 125.80.32.31 speakers
|2013-06-29 12:51:50 101.40.50.62 keyboard
... | tpolecat/atto | modules/docs/src/main/scala/next-steps.scala | Scala | mit | 5,157 |
/* Copyright (C) 2012-2013 Treode, 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... | Treode/cps | src/test/scala/com/treode/cps/stub/io/FileStubSpec.scala | Scala | apache-2.0 | 1,239 |
package service
import dao.{ PasswordDao, UserDao }
import model.{ User, UserPassword }
import router.dto.UserDto
import utils.DatabaseConfig._
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future
import scalaz.OptionT
import scalaz.OptionT._
import scalaz.std.scalaFuture._
trait... | Gneotux/pfc | src/main/scala/service/UserService.scala | Scala | apache-2.0 | 2,450 |
package scryetek.vecmath
@inline
final class Vec4(var x: Float, var y: Float, var z: Float, var w: Float) {
def this() = this(0, 0, 0, 0)
@inline
def set(x: Float = this.x, y: Float = this.y, z: Float = this.z, w: Float = this.w) = {
this.x = x
this.y = y
this.z = z
this.w = w
this
}
@i... | mseddon/vecmath | shared/src/main/scala/scryetek/vecmath/Vec4.scala | Scala | bsd-3-clause | 3,603 |
/*
* Copyright (C) 2009-2018 Lightbend Inc. <https://www.lightbend.com>
*/
package play.sbt
import sbt.Keys._
import sbt.{ Def, Level, Scope, Settings, State }
import sbt.internal.LogManager
import sbt.internal.util.ManagedLogger
/**
* Fix compatibility issues for PlayImport. This is the version compatible with s... | Shenker93/playframework | framework/src/sbt-plugin/src/main/scala-sbt-1.0/play/sbt/PlayImportCompat.scala | Scala | apache-2.0 | 389 |
package org.dele.misc.bookFastDS
import org.apache.spark.sql.types._
import org.apache.spark.sql.{DataFrame, Dataset, SparkSession}
/**
* Created by dele on 2017-02-27.
*/
object GeoCityDataTest extends App {
case class GeoLocEntry(
locId:Int,
country:String,
... | new2scala/text-util | misc/src/test/scala/org/dele/misc/bookFastDS/GeoCityDataTest.scala | Scala | apache-2.0 | 1,895 |
// Synchronous Shopping
// https://www.hackerrank.com/challenges/synchronous-shopping
package search.syncshopping
import scala.collection._
/**
*
*/
object Solution {
val Debug = false
val PrintPath = Debug && true
val PrintAdding = Debug && PrintPath && false
val PrintLast = Debug && PrintPath && true
... | uliashkevich/hackerrank | src/search/syncshopping/Solution.scala | Scala | artistic-2.0 | 9,195 |
package io.getquill.context.sql.norm
import io.getquill.Spec
import io.getquill.context.sql.testContext.qr1
import io.getquill.context.sql.testContext.qr2
import io.getquill.context.sql.testContext.qr3
import io.getquill.context.sql.testContext.quote
import io.getquill.context.sql.testContext.unquote
class ExpandJoin... | getquill/quill | quill-sql/src/test/scala/io/getquill/context/sql/norm/ExpandJoinSpec.scala | Scala | apache-2.0 | 2,342 |
package dsl.reactive.examples
import dsl.reactive._
import dsl.reactive.auxiliary._
import dsl.reactive.optimizations._
import virtualization.lms.common._
import scala.collection.mutable.ListBuffer
trait SignalCodeGeneration extends ReactiveDSL {
def exec(x: Rep[Unit]) = {
val v = ReactiveVar(5)
val s = IS... | markus1189/OptiReactive | src/main/scala/dsl/reactive/examples/SignalCodeGeneration.scala | Scala | gpl-3.0 | 696 |
// Generated by the Scala Plugin for the Protocol Buffer Compiler.
// Do not edit!
//
// Protofile syntax: PROTO3
package com.komanov.serialization.domain.protos.site
@SerialVersionUID(0L)
final case class PagePb(
name: String = "",
path: String = "",
metaTags: Seq[com.komanov.serialization.domain.proto... | dkomanov/scala-serialization | scala-serialization/src/main/scala/com/komanov/serialization/domain/protos/site/PagePb.scala | Scala | mit | 7,782 |
/***********************************************************************
* 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-utils/src/test/scala/org/locationtech/geomesa/utils/stats/StatTestHelper.scala | Scala | apache-2.0 | 2,251 |
package org.http4s
package client
package jetty
import cats.effect._
import cats.implicits._
import fs2._
import org.eclipse.jetty.client.HttpClient
import org.eclipse.jetty.client.api.{Request => JettyRequest}
import org.eclipse.jetty.http.{HttpVersion => JHttpVersion}
import org.log4s.{Logger, getLogger}
object Jet... | ChristopherDavenport/http4s | jetty-client/src/main/scala/org/http4s/client/jetty/JettyClient.scala | Scala | apache-2.0 | 2,405 |
package lila.mod
import lila.user.{ User, UserRepo }
final class UserSearch(
securityApi: lila.security.Api,
emailAddress: lila.security.EmailAddress) {
// http://stackoverflow.com/questions/106179/regular-expression-to-match-hostname-or-ip-address
private val ipv4Pattern = """^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0... | clarkerubber/lila | modules/mod/src/main/UserSearch.scala | Scala | agpl-3.0 | 1,401 |
/*
* 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 ... | trueyao/spark-lever | streaming/src/main/scala/org/apache/spark/streaming/dstream/QueueInputDStream.scala | Scala | apache-2.0 | 1,836 |
package org.jetbrains.plugins.scala
package lang
package surroundWith
package surrounders
package expression
import com.intellij.lang.ASTNode
import com.intellij.openapi.util.TextRange
import com.intellij.psi.PsiElement
import psi.api.expr.{ScParenthesisedExpr, ScIfStmt, ScExpression}
import psi.types.result.TypingCon... | consulo/consulo-scala | src/org/jetbrains/plugins/scala/lang/surroundWith/surrounders/expression/ScalaWithIfConditionSurrounder.scala | Scala | apache-2.0 | 1,513 |
package com.seanshubin.scala.training.sample.data
trait RandomChooser {
def fromSeq[T](seq: Seq[T]): T
}
| SeanShubin/scala-training | sample-data/src/main/scala/com/seanshubin/scala/training/sample/data/RandomChooser.scala | Scala | unlicense | 108 |
package com.github.gdefacci.di.macrodef
import scala.reflect.macros.blackbox.Context
private[di] trait DagNodeOrRefFactory[C <: Context] { self:DagNodes[C] =>
import context.universe._
def alias(exprNm:TermName, valueExpr: Tree, tpe:Type, scope:DagScope, parent:Option[Dag[DagNodeOrRef]]):Dag[DagNodeOrRef] = {
... | gdefacci/di | macros/src/main/scala/com/github/gdefacci/di/macrodef/DagNodeOrRefFactory.scala | Scala | mit | 2,454 |
/***********************************************************************
* 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-kudu/geomesa-kudu-datastore/src/main/scala/org/locationtech/geomesa/kudu/data/KuduFeature.scala | Scala | apache-2.0 | 1,034 |
package jp.pigumer.sbt.cloud.aws.s3
import jp.pigumer.sbt.cloud.aws.cloudformation.AwscfSettings
import com.amazonaws.services.s3.AmazonS3
import com.amazonaws.services.s3.model.PutObjectRequest
import sbt.Keys._
import sbt._
import sbt.complete.DefaultParsers._
import scala.annotation.tailrec
import scala.util.{Fail... | PigumerGroup/sbt-aws-cloudformation | src/main/scala/jp/pigumer/sbt/cloud/aws/s3/UploadTemplates.scala | Scala | mit | 3,872 |
package com.automatatutor.model
import net.liftweb.mapper._
import net.liftweb.common.{Full,Box}
import net.liftweb.http.SessionVar
import net.liftweb.util.StringHelpers
import net.liftweb.util.Mailer
import net.liftweb.common.Empty
import net.liftweb.util.FieldError
import scala.xml.Text
import net.liftweb.util.Maile... | AutomataTutor/automatatutor-frontend | src/main/scala/com/automatatutor/model/User.scala | Scala | mit | 5,575 |
import org.scalatest._
// abstract general testing class
abstract class UnitTestSpec extends FlatSpec with Matchers with OptionValues with Inside with Inspectors
case class ConditionResolver(val check:Boolean) {
def skip(ignore: () => Unit) = Executor(check, ignore)
}
case class Executor(val flag:Boolean, val ig... | sadikovi/sbt-multi-project-example | bar/src/test/scala/UnitTestSpec.scala | Scala | mit | 819 |
package threesbrain.game.consoleplay
import threesbrain.game.core.Play
object ConsolePlay extends App {
val end = Play.play(ConsolePlayer)
println(end)
println("Score: " + end.score)
} | zommerfelds/threes-brain | src/main/scala/threesbrain/game/consoleplay/ConsolePlay.scala | Scala | mit | 198 |
package org.jetbrains.plugins.scala.lang.typeInference
package generated
import org.jetbrains.plugins.scala.lang.typeInference.testInjectors.{SCL9532Injector, SCL9445Injector, SCL9533Injector, SCL9865Injector}
class TypeInferenceBugs5Test extends TypeInferenceTestBase {
//This class was generated by build script, p... | triplequote/intellij-scala | scala/scala-impl/test/org/jetbrains/plugins/scala/lang/typeInference/generated/TypeInferenceBugs5Test.scala | Scala | apache-2.0 | 22,606 |
/**
* Copyright (C) 2016 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... | orbeon/orbeon-forms | form-runner/jvm/src/main/scala/org/orbeon/oxf/fr/persistence/relational/Statement.scala | Scala | lgpl-2.1 | 1,571 |
/*
* Copyright (c) 2017 Magomed Abdurakhmanov, Hypertino
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
*/
package com.hypertino.hyperbus.util
import com.hype... | hypertino/hyperbus | hyperbus/src/main/scala/com/hypertino/hyperbus/util/ErrorUtils.scala | Scala | mpl-2.0 | 1,479 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | ddna1021/spark | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/ScalaUDF.scala | Scala | apache-2.0 | 52,837 |
package io.buoyant.namerd.iface
import com.fasterxml.jackson.annotation.JsonIgnore
import com.twitter.conversions.time._
import com.twitter.finagle._
import com.twitter.finagle.buoyant.TlsClientConfig
import com.twitter.finagle.naming.NameInterpreter
import com.twitter.finagle.param.{HighResTimer, Label}
import com.tw... | denverwilliams/linkerd | interpreter/namerd/src/main/scala/io/buoyant/namerd/iface/NamerdInterpreterInitializer.scala | Scala | apache-2.0 | 4,528 |
final class Natural extends scala.math.ScalaNumber with scala.math.ScalaNumericConversions {
def intValue: Int = 0
def longValue: Long = 0L
def floatValue: Float = 0.0F
def doubleValue: Double = 0.0D
def isWhole: Boolean = false
def underlying = this
}
| lrytz/scala | test/files/pos/t6600.scala | Scala | apache-2.0 | 265 |
// goseumdochi: experiments with incarnation
// Copyright 2016 John V. Sichi
//
// 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... | lingeringsocket/goseumdochi | android/src/main/scala/org/goseumdochi/android/lib/ActivityBase.scala | Scala | apache-2.0 | 1,669 |
package org.workcraft.services
abstract class Format(val description: String, val extension: String)
object Format {
case object DotG extends Format("Signal Transition Graph", ".g")
case object LolaPetriNet extends Format("Petri Net in LoLA format", ".lola")
case object WorkcraftPetriNet extends Format("Petri N... | tuura/workcraft-2.2 | Core/src/main/scala/org/workcraft/services/Format.scala | Scala | gpl-3.0 | 489 |
package com.aimplicits.gallery
import org.scalatest.{MustMatchers, WordSpec}
/**
* Created by Paul Lysak on 14/08/17.
*/
class SampleSpec extends WordSpec with MustMatchers {
"something" must {
"work" in {
//TODO
}
}
}
| paul-lysak/gallery-proto | gallery_cookies_lambda/src/test/scala/com/aimplicits/gallery/SampleSpec.scala | Scala | apache-2.0 | 244 |
package uk.gov.dvla.vehicles.presentation.common.helpers
import uk.gov.dvla.vehicles.presentation.common.composition.TestComposition
import uk.gov.dvla.vehicles.presentation.common.testhelpers.UnitTestHelper
abstract class UnitSpec extends UnitTestHelper with TestComposition
| dvla/vehicles-presentation-common | common-test/test/uk/gov/dvla/vehicles/presentation/common/helpers/UnitSpec.scala | Scala | mit | 278 |
// Copyright: 2010 - 2016 https://github.com/ensime/ensime-server/graphs
// License: http://www.gnu.org/licenses/gpl-3.0.en.html
package org.ensime.indexer
import akka.event.slf4j.SLF4JLogging
import java.io.File
import org.apache.commons.vfs2._
import org.ensime.api._
import org.ensime.vfs._
import org.ensime.util.... | sugakandrey/ensime-server | core/src/main/scala/org/ensime/indexer/SourceResolver.scala | Scala | gpl-3.0 | 2,881 |
/***********************************************************************
* 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-features/geomesa-feature-avro/src/main/scala/org/locationtech/geomesa/features/avro/serde/ASFDeserializer.scala | Scala | apache-2.0 | 3,991 |
package core
class DispatchContext(val game: Game, channel: Channel) extends Receiver {
private[this] val mailbox = collection.mutable.Queue.empty[(Receiver, Message)]
private[this] var inputRequirer: Option[(Receiver, String)] = None
private[this] val logBuffer = new StringBuilder()
channel.subscribeInput(ha... | whence/powerlife | scala/powercards_actor/core/Dispatch.scala | Scala | mit | 1,594 |
package rea.examples
import rea._
import P._
object Drawing {
val winSize = Vec(640, 360)
val win = Win(size = winSize, clear = false, bkg = Color(102))
object ContinuousLines {
def draw(p: Boolean, a: Vec, b: Vec) {
if (p) {
line(a, b)
}
}
def main = win.setup(stroke(255)).run {
Get.lift... | anton-k/reactive-processing | src/main/scala/examples/Drawing.scala | Scala | bsd-3-clause | 596 |
package simple
import org.scalatest._
class SimpleSpec extends FlatSpec {
"Calling native methods in tests" should "work" in {
assert(Library.say("hello") == 42)
}
}
| jodersky/sbt-jni | plugin/src/sbt-test/sbt-jni/simple/core/src/test/scala/simple/Test.scala | Scala | bsd-3-clause | 178 |
import annotation.*
import elidable.*
trait T {
@elidable(FINEST) def f1(): Unit
@elidable(SEVERE) def f2(): Unit
@elidable(FINEST) def f3() = assert(false, "Should have been elided.")
def f4(): Unit
}
class C extends T {
def f1() = println("Good for me, I was not elided. C.f1")
def f2() = println("Good f... | dotty-staging/dotty | tests/pending/run/elidable.scala | Scala | apache-2.0 | 2,520 |
/*
* 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 ... | hongyuhong/flink | flink-libraries/flink-table/src/main/scala/org/apache/flink/table/plan/rules/logical/PushFilterIntoTableSourceScanRule.scala | Scala | apache-2.0 | 4,954 |
/*
* Copyright 2014 Lars Edenbrandt
*
* 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... | slicebox/slicebox | src/main/scala/se/nimsa/sbx/app/routing/UiRoutes.scala | Scala | apache-2.0 | 4,068 |
/*
* Copyright 2001-2008 Artima, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agre... | svn2github/scalatest | src/main/scala/org/scalatest/fixture/Suite.scala | Scala | apache-2.0 | 15,032 |
package config
import java.io.File
import com.typesafe.config.ConfigFactory
import com.typesafe.scalalogging.LazyLogging
object Config extends LazyLogging {
implicit class RichConfig(val underlying: com.typesafe.config.Config) extends AnyVal {
def getOptional[T](path: String, f: (String ⇒ T)) = if(underlying.hasP... | Calavoow/eve-corp-contracts | src/main/scala/config/Config.scala | Scala | gpl-2.0 | 995 |
/*
* 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 ... | shaoxuan-wang/flink | flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/plan/stream/sql/join/TemporalJoinTest.scala | Scala | apache-2.0 | 4,533 |
package org.scalajs.core.compiler.test
import org.scalajs.core.compiler.test.util._
import org.junit.Test
// scalastyle:off line.size.limit
/** This tests the UndefinedParam tracker in the compiler backend.
*
* In order to properly implement removal of trailing default parameters, the
* compiler backend may gen... | xuwei-k/scala-js | compiler/src/test/scala/org/scalajs/core/compiler/test/JSUndefinedParamTest.scala | Scala | bsd-3-clause | 2,786 |
package controllers.auth
import java.util.UUID
import javax.inject.Inject
import com.mohiva.play.silhouette.api._
import com.mohiva.play.silhouette.api.repositories.AuthInfoRepository
import com.mohiva.play.silhouette.api.services.AvatarService
import com.mohiva.play.silhouette.api.util.PasswordHasherRegistry
import ... | stanikol/walnuts | server/app/controllers/auth/SignUpController.scala | Scala | apache-2.0 | 4,586 |
package katas.scala.newton
import org.junit.Test
import org.scalatest.Matchers
class Newton9 extends Matchers {
@Test def `find square root of number`() {
sqrt(1) should beTolerantEqualTo(1)
sqrt(2) should beTolerantEqualTo(1.414)
sqrt(3) should beTolerantEqualTo(1.732)
sqrt(4) should beTolerantEqualTo(2)
... | dkandalov/katas | scala/src/katas/scala/newton/Newton9.scala | Scala | unlicense | 550 |
/*
* Copyright (c) 2011-2015 EPFL DATA Laboratory
* Copyright (c) 2014-2015 The Squall Collaboration (see NOTICE)
*
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License... | epfldata/squall | squall-functional/src/main/scala/ch/epfl/data/squall/api/scala/Stream.scala | Scala | apache-2.0 | 10,678 |
/*******************************************************************************
Copyright (c) 2013-2014, S-Core, KAIST.
All rights reserved.
Use is subject to license terms.
This distribution may include materials developed by third parties.
*********************************************************... | darkrsw/safe | src/main/scala/kr/ac/kaist/jsaf/analysis/typing/models/Tizen/TIZENnetworkbearerselection.scala | Scala | bsd-3-clause | 8,404 |
/*
* 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 ... | benschaff/spark-druid-olap | src/main/scala/org/sparklinedata/druid/client/DruidMessages.scala | Scala | apache-2.0 | 2,085 |
package Scalisp
import org.scalatest.FlatSpec
import org.scalatest.matchers.ShouldMatchers
class LambdaSpec extends FlatSpec with ShouldMatchers {
val repl = new REPL()
"Lambdas" should "be allowed" in {
repl.executeLine("(define test (lambda (r) (* 3.141592653 (* r r))))")
}
it should "execute correctly" in ... | quantintel/Scalisp | src/test/scala/Lambda.scala | Scala | mit | 439 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | ueshin/apache-spark | core/src/main/scala/org/apache/spark/mapred/SparkHadoopMapRedUtil.scala | Scala | apache-2.0 | 4,159 |
/*
* 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 ... | icexelloss/spark | core/src/main/scala/org/apache/spark/executor/CoarseGrainedExecutorBackend.scala | Scala | apache-2.0 | 14,680 |
package edu.gemini.spModel.inst
import edu.gemini.pot.ModelConverters._
import edu.gemini.spModel.core._
import edu.gemini.spModel.gemini.gmos._
import edu.gemini.spModel.guide.VignettingCalculator
import edu.gemini.spModel.inst.FeatureGeometry._
import edu.gemini.spModel.obs.context.ObsContext
import org.scalacheck.... | arturog8m/ocs | bundle/edu.gemini.pot/src/test/scala/edu/gemini/spModel/inst/VignettingCalcSpec.scala | Scala | bsd-3-clause | 5,684 |
/**
* 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... | martinluther/orbeon-forms | src/main/scala/org/orbeon/oxf/resources/handler/DataURLDecoder.scala | Scala | lgpl-2.1 | 2,483 |
/**
* (c) Copyright 2013 WibiData, Inc.
*
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* 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... | kijiproject/kiji-schema-shell | src/main/scala/org/kiji/schema/shell/ddl/AlterTableSetFamilySchemaCommand.scala | Scala | apache-2.0 | 2,295 |
package org.jetbrains.plugins.scala.annotator
import com.intellij.psi.PsiElement
class ScalaLibVarianceTest extends VarianceTestBase {
override def annotateFun(element: PsiElement, annotator: ScalaAnnotator, mock: AnnotatorHolderMock): Unit = annotator.annotate(element, mock)
protected def code(insertLine: Stri... | jastice/intellij-scala | scala/scala-impl/test/org/jetbrains/plugins/scala/annotator/ScalaLibVarianceTest.scala | Scala | apache-2.0 | 2,395 |
/*
* Copyright (C) 2009-2018 Lightbend Inc. <https://www.lightbend.com>
*/
object Transitive
| Shenker93/playframework | framework/src/sbt-plugin/src/sbt-test/play-sbt-plugin/multiproject/transitive/app/Transitive.scala | Scala | apache-2.0 | 95 |
package de.frosner.broccoli.models
import de.frosner.broccoli.models.JobStatus.JobStatus
import play.api.libs.json._
object JobStatus extends Enumeration {
type JobStatus = Value
val Running = Value("running")
val Pending = Value("pending")
val Stopped = Value("stopped")
val Dead = Value("dead")
val Unk... | FRosner/cluster-broccoli | server/src/main/scala/de/frosner/broccoli/models/JobStatus.scala | Scala | apache-2.0 | 570 |
/*
* Copyright (c) 2016. <[email protected]>
*
* TagTest.scala is part of marc4scala.
*
* marc4scala 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... | jasonzou/marc4scala | src/test/scala/org/marc4scala/TagTest.scala | Scala | gpl-3.0 | 958 |
package com.scalaAsm.x86
package Instructions
package General
// Description: Jump short if not overflow (OF=0)
// Category: general/branch/cond
trait JNO extends InstructionDefinition {
val mnemonic = "JNO"
}
object JNO extends OneOperand[JNO] with JNOImpl
trait JNOImpl extends JNO {
implicit object _0 extends... | bdwashbu/scala-x86-inst | src/main/scala/com/scalaAsm/x86/Instructions/General/JNO.scala | Scala | apache-2.0 | 637 |
import com.nn.math.activations.StepFunction
import com.nn.{PerceptronLearningTrait, NNetwork}
import org.scalatest._
import org.scalatest.junit.AssertionsForJUnit
import org.junit.Assert._
import org.junit.Test
import org.junit.Before
import scala.collection.mutable.ArrayBuffer
import scala.util.Random
/**
* Created... | GeorgeDittmar/Scala-NeuralNet | src/test/scala/TestPerceptron.scala | Scala | apache-2.0 | 2,326 |
trait Exec[T <: Exec[T]]
object Tree {
sealed trait Next[+T, +PL, +P, +H, +A]
sealed trait Child[+T, +PL, +P, +H, +A]
sealed trait Branch[T <: Exec[T], PL, P, H, A] extends Child[T, PL, P, H, A] with NonEmpty[T, PL, P, H]
sealed trait NonEmpty[T <: Exec[T], PL, P, H]
case object Empty extends Next[Nothin... | dotty-staging/dotty | tests/pos/i9841b.scala | Scala | apache-2.0 | 760 |
/*
* Copyright 2014 Joshua R. Rodgers
*
* 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... | Mr-Byte/Random-Redstone | core/src/main/scala/com/theenginerd/core/client/model/builder/shapes/Box.scala | Scala | apache-2.0 | 4,318 |
package ulang.prove
import ulang.expr.Expr
import ulang.expr.Var
import ulang.expr.App
import ulang.expr.Apps
class congruence {
val emptyUse: Set[Expr] = Set()
var rep = Map[Expr, Expr]()
var use = Map[Expr, Set[Expr]]() withDefaultValue emptyUse
var sig = Map[Expr, Expr]()
def find(a: Expr): Expr = {
... | gernst/ulang-proto | src/main/scala/ulang/prove/congruence.scala | Scala | mit | 1,742 |
/**
* 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... | vkroz/kafka | core/src/main/scala/kafka/coordinator/ConsumerMetadata.scala | Scala | apache-2.0 | 2,027 |
package im.actor.server.api.rpc.service
import java.net.URLEncoder
import java.time.{ LocalDateTime, ZoneOffset }
import scala.concurrent.{ ExecutionContext, Future }
import scala.util.Random
import scalaz.\\/
import akka.contrib.pattern.DistributedPubSubExtension
import com.google.protobuf.{ ByteString, CodedInputS... | x303597316/actor-platform | actor-server/actor-tests/src/test/scala/im/actor/server/api/rpc/service/AuthServiceSpec.scala | Scala | mit | 33,929 |
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.