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 |
|---|---|---|---|---|---|
package supertagged.utils
import supertagged.{@@, unsafeCastNull}
/**
*
* Add new tag `TagNew` to `Raw` type (already tagged or not) at arbitrary nested position in container `C`
*/
trait Add[C, Raw, TagNew] {
type Out
}
object Add extends AddLow {
implicit def base[Raw, Tag, TagNew]:Aux[Raw @@ (Tag with T... | Rudogma/scala-supertagged | src/main/scala/supertagged/utils/Add.scala | Scala | mit | 716 |
package org.scalajs.sbtplugin.test
import scala.scalajs.js
import scala.scalajs.js.annotation._
@js.native
@JSImport("foo.js")
object JustImport extends js.Object
@js.native
@JSImport("foo.js", "Another")
object AnotherInFoo extends js.Object
@js.native
@JSImport("bar.js", JSImport.Default, globalFallback = "Global... | scala-js/scala-js | sbt-plugin/src/sbt-test/linker/custom-linker/main/Main.scala | Scala | apache-2.0 | 650 |
package com.plasmaconduit.json.validators
import com.plasmaconduit.json.{JsObject, JsValue, JsWriter, JsReader}
import com.plasmaconduit.validation.{Failure, Validation}
trait KeyedJsValue4[A <: KeyedJsValue[_], B <: KeyedJsValue[_], C <: KeyedJsValue[_], D <: KeyedJsValue[_]] {
val valueA: A
val valueB: B
v... | plasmaconduit/json | src/main/scala/com/plasmaconduit/json/validators/KeyedJsValue4.scala | Scala | mit | 2,356 |
/*
* Copyright (c) 2012 Dame Ningen.
* All rights reserved.
*
* This file is part of Gausel.
*
* Gausel 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 o... | Uchuu/Gausel | trunk/src/main/scala/parser/SystemParser.scala | Scala | gpl-3.0 | 6,067 |
package com.mohiva.play.htmlcompressor.fixtures
import play.api.http.DefaultHttpErrorHandler
import play.api.libs.iteratee.Enumerator
import play.api.mvc._
import play.twirl.api.Html
import scala.concurrent.Future
import controllers.AssetsBuilder
import scala.concurrent.ExecutionContext.Implicits.global
/**
* Test c... | CapeSepias/play-html-compressor | test/com/mohiva/play/htmlcompressor/fixtures/Application.scala | Scala | bsd-3-clause | 1,249 |
/*
* 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 ... | gyfora/flink | flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/planner/plan/stream/sql/DeduplicateTest.scala | Scala | apache-2.0 | 5,632 |
package com.github.tanacasino.dropsync.command
import com.typesafe.config.Config
trait SubCommand {
def execute(implicit conf: Config): Int
} | tanacasino/dropsync | src/main/scala/com/github/tanacasino/dropsync/command/SubCommand.scala | Scala | mit | 147 |
#!/bin/sh
exec scala -save "$0" "$@"
!#
// Display text in a GUI
def displayText(text: String) = {
import javax.swing.{JFrame, JTextArea, JScrollPane}
val tarea = new JTextArea()
val frame = new JFrame()
frame.add(new JScrollPane(tarea))
frame.setSize(400, 500)
frame.setVisible(true)
frame.setDefaultClo... | caiorss/Functional-Programming | scala/src/scalaNix.scala | Scala | unlicense | 701 |
/**
* Copyright (c) 2007-2011 Eric Torreborre <etorreborre@yahoo.com>
*
* 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... | stuhood/specs | src/test/scala/org/specs/mock/mockerUnit.scala | Scala | mit | 3,933 |
import org.scalatest._
import compiler._
class SubstitutionsSpec extends FlatSpec with Matchers {
"A substitution" should "be extended adding a (symbol, type) pair" in {
(Substitutions.extend("T1")(Type.TyVar("T1"))(Subst(Map[String,Type]()))
should be (Subst(Map("T1" -> Type.TyVar("T1")))))
}
it shoul... | holoed/ScalaCompilerTools | src/test/scala/SubstitutionsSpec.scala | Scala | apache-2.0 | 1,574 |
/*
* 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 ... | windeye/spark | core/src/main/scala/org/apache/spark/storage/BlockManagerSource.scala | Scala | apache-2.0 | 2,604 |
/*
* Copyright 2014-2022 Netflix, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | Netflix/atlas | atlas-core/src/test/scala/com/netflix/atlas/core/stacklang/PickSuite.scala | Scala | apache-2.0 | 1,024 |
package com.thoughtworks.deeplearning
package plugins
import java.util.logging.Logger
import com.thoughtworks.feature.{Factory, ImplicitApply}, ImplicitApply.ops._
import Factory.inject
import scala.annotation.meta.getter
/** A plugin that creates the instance of [[implicits]].
*
* Any fields and methods in [[Im... | izhangzhihao/DeepLearning.scala | plugins-ImplicitsSingleton/src/main/scala/com/thoughtworks/deeplearning/plugins/ImplicitsSingleton.scala | Scala | apache-2.0 | 849 |
package dawn.flow
import breeze.linalg._
trait Sensor[A, M] extends (Time => A) with RequireModel[M] {
override def toString = getClass.getSimpleName
def generate(model: M, t: Time): A
def apply(t: Time) =
generate(model.get, t)
}
trait VectorSensor[M] extends Sensor[DenseVector[Real], M] {
def cov: ... | rubenfiszel/scala-flow | core/src/main/scala/Sensor.scala | Scala | mit | 498 |
package quizleague.web.util
package object rx {
import scala.language.implicitConversions
import scalajs.js
import rxscalajs.Observable
import rxscalajs.Observable._
import scalajs.js.JSConverters._
import quizleague.web.util.Logging._
implicit def refObsToObs[T](refObs: RefObservable[T]) = refObs.obs
... | gumdrop/quizleague-maintain | js/src/main/scala/quizleague/web/util/rx/package.scala | Scala | mit | 4,006 |
/*
* Copyright (C) Lightbend Inc. <https://www.lightbend.com>
*/
package test
import play.api.test._
import models.UserId
import scala.collection.JavaConverters._
object RouterSpec extends PlaySpecification {
"reverse routes containing boolean parameters" in {
"in the query string" in {
controllers.ro... | benmccann/playframework | dev-mode/sbt-plugin/src/sbt-test/play-sbt-plugin/routes-compiler-injected-routes-compilation-with-request-passed/tests/RouterSpec.scala | Scala | apache-2.0 | 9,435 |
package models
// import scala.slick.driver.Postgres.simple._
// class Application(var name: String, var description: String) extends DomainEntity {
// var roles: List[String] = List[String]()
// def ensureRoles(roleNames: List[String]) = {
// for (role <- roleNames) {
// if (!roles.contains(role))
// ... | hsihealth/aim_prototype | src/main/scala/models/application.scala | Scala | apache-2.0 | 519 |
/*
* Copyright 2016 Dennis Vriend
*
* 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... | dnvriend/akka-camel-test | src/test/scala/com/github/dnvriend/camel/rx/DirectReactiveConsumerTest.scala | Scala | apache-2.0 | 2,039 |
/*
* 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 | interface/src/test/scala/quasar/main/prettify.scala | Scala | apache-2.0 | 12,974 |
package com.alexknvl.shipcraft.i18n
final case class I18n(value: String) | steamcraft/Movecraft-3 | movecraft-api/src/main/scala/com/alexknvl/shipcraft/i18n/I18n.scala | Scala | gpl-3.0 | 73 |
/*
* 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 ... | spark-test/spark | mllib/src/main/scala/org/apache/spark/mllib/util/MLUtils.scala | Scala | apache-2.0 | 21,905 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | lxsmnv/spark | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/CatalystTypeConverters.scala | Scala | apache-2.0 | 18,079 |
/*
* Copyright 2011 University of Wisconsin, Milwaukee
*
* 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 appli... | djspiewak/scala-bison | src/edu/uwm/cs/scalabison/Precedence.scala | Scala | apache-2.0 | 697 |
package ecommerce.shipping.app
import java.net.InetAddress
import akka.actor._
import com.typesafe.config.Config
import ecommerce.shipping.Shipment
import org.slf4j.Logger
import pl.newicom.dddd.actor.{CreationSupport, PassivationConfig}
import pl.newicom.dddd.aggregate.AggregateRootActorFactory
import pl.newicom.ddd... | dominhtung/ddd-leaven-akka-v2 | shipping/write-back/src/main/scala/ecommerce/shipping/app/ShippingBackendConfiguration.scala | Scala | mit | 2,383 |
/*
* Copyright 2014-2021 Netflix, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | brharrington/atlas | atlas-chart/src/main/scala/com/netflix/atlas/chart/TabSepGraphEngine.scala | Scala | apache-2.0 | 904 |
package b
package c
import a.*
object Unambiguous {
println(Settings.Y)
}
| dotty-staging/dotty | tests/run/t4537/c.scala | Scala | apache-2.0 | 78 |
/*
* 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 | graphx/src/test/scala/org/apache/spark/graphx/lib/ShortestPathsSuite.scala | Scala | apache-2.0 | 1,766 |
package persitence.handlers
import persistence.entities.{Account, OAuthAccessToken}
import utils.{Configuration, PersistenceModule}
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future
import scalaoauth2.provider.{ClientCredentialsRequest, InvalidClient, PasswordRequest, _}
class ... | cdiniz/slick-akka-http-oauth2 | src/main/scala/persistence/handlers/OAuth2DataHandler.scala | Scala | apache-2.0 | 5,175 |
package models.daos
import play.api.db.slick.DatabaseConfigProvider
import slick.driver.JdbcProfile
import play.api.db.slick.HasDatabaseConfig
/**
* Trait that imports models.daos.DBTableDefinitions to provide access to
* slick db handling code to be mixed in with DAOs.
*
* LN: Not fond of this design as it doesn... | leannenorthrop/play-mantra-accumulations | app/models/daos/DAOSlick.scala | Scala | apache-2.0 | 562 |
package demo
/*
* Copyright (C) 19/08/16 // mathieu.leclaire@openmole.org
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) ... | openmole/scaladget | bootstrapDemo/src/main/scala/demo/ModalDialogDemo.scala | Scala | agpl-3.0 | 1,700 |
/*
* 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 ... | chuckchen/spark | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/DeduplicateRelations.scala | Scala | apache-2.0 | 13,175 |
package org.openmole.gui.client.core.files
import org.openmole.gui.client.core._
import autowire._
import boopickle.Default._
import org.openmole.gui.client.core.alert.AbsolutePositioning._
import org.openmole.gui.client.core.alert.AlertPanel
import scala.concurrent.ExecutionContext.Implicits.global
import org.openmo... | openmole/openmole | openmole/gui/client/org.openmole.gui.client.core/src/main/scala/org/openmole/gui/client/core/files/FileToolBox.scala | Scala | agpl-3.0 | 9,888 |
//
// The contents of this file are subject to the Mozilla Public
// License Version 1.1 (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.mozilla.org/MPL/
//
// Software distributed under the License is distributed on an "AS
// IS... | kaoru2010/android-startup-project | tools/smc/smc_6_5_0/examples/Scala/EX1/checkstring.scala | Scala | apache-2.0 | 1,992 |
/*
* 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 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be us... | momogentoo/ehour | eHour-persistence/src/main/scala/net/rrm/ehour/persistence/report/dao/ReportAggregatedDaoHibernateImpl.scala | Scala | gpl-2.0 | 5,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... | archieco/kafka | core/src/test/scala/unit/kafka/admin/AddPartitionsTest.scala | Scala | apache-2.0 | 12,127 |
package controllers
import play.api._
import play.api.libs.json._
import play.api.mvc._
import akka.actor.ActorSystem
import akka.actor.Props
import play.api.data._
import play.api.data.Forms._
import java.io.File
/**
* Main controller (about / welcome page)
*/
object Application extends Controller {
/* Just t... | TweetAggregator/CrossTalk | app/controllers/Application.scala | Scala | gpl-2.0 | 546 |
/*
* This file is part of EasyForger which is released under GPLv3 License.
* See file LICENSE.txt or go to http://www.gnu.org/licenses/gpl-3.0.en.html for full license details.
*/
package com.easyforger.creatures
import net.minecraft.entity.monster.EntityCreeper
import net.minecraft.world.World
case class Creeper... | easyforger/easyforger | src/main/scala/com/easyforger/creatures/EFCustomCreeper.scala | Scala | gpl-3.0 | 1,154 |
package com.twitter.zipkin.storage
import com.twitter.util.Await.{ready, result}
import com.twitter.util.{Duration, Time}
import com.twitter.zipkin.common.{Dependencies, DependencyLink}
import org.junit.{Before, Test}
import org.scalatest.Matchers
import org.scalatest.junit.JUnitSuite
import java.util.concurrent.TimeU... | betable/zipkin | zipkin-common/src/test/scala/com/twitter/zipkin/storage/DependencyStoreSpec.scala | Scala | apache-2.0 | 2,192 |
package org.openapitools.server.model
/**
* @param `class` for example: ''null''
* @param expectedBuildNumber for example: ''null''
* @param id for example: ''null''
* @param pipeline for example: ''null''
* @param queuedTime for example: ''null''
*/
final case class QueueItemImpl (
`class`: Option[String... | cliffano/swaggy-jenkins | clients/scala-akka-http-server/generated/src/main/scala/org/openapitools/server/model/QueueItemImpl.scala | Scala | mit | 438 |
package com.dscleaver.sbt.quickfix
import java.io.File
import sbt._
import std._
object VimPlugin {
def install(baseDirectory: File, s: TaskStreams[ScopedKey[_]]): Unit = {
val plugin = baseDirectory / "vim-sbt"
if(plugin.exists) {
s.log.info("Removing previous installation at " + plugin)
IO.del... | dscleaver/sbt-quickfix | src/main/scala/com/dscleaver/sbt/quickfix/VimPlugin.scala | Scala | bsd-3-clause | 526 |
/*
* Copyright 2016 Dennis Vriend
*
* 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... | dnvriend/sbt-scaffold-play | src/main/scala/com/github/dnvriend/scaffold/play/enabler/scalariform/ScalariformEnabler.scala | Scala | apache-2.0 | 2,743 |
package schemasafe
import scala.reflect.macros.blackbox.Context
import schemasafe.utils.XResult
import singleton.ops._
class LiteralQueryWrapper[LQ <: XString] {
def :+[LQ2 <: XString](q2: LQ2)(implicit concat: LQ + LQ2): LiteralQueryWrapper[concat.OutString] =
new LiteralQueryWrapper[concat.OutString]
def +... | schemasafe/toy-troy | troy/src/main/scala/schemasafe/api.scala | Scala | apache-2.0 | 2,793 |
package com.github.errantlinguist.snom.gui
import java.net.URLClassLoader
class ApplicationInfoMessageFactory(private val resourceBundleName: String) {
import java.util.Properties
import scala.io.Source
import scala.io.BufferedSource
private object Property extends Enumeration {
val Name = Value("name")
v... | errantlinguist/phonecontroller | src/main/scala/com/github/errantlinguist/snom/gui/ApplicationInfoMessageFactory.scala | Scala | apache-2.0 | 1,395 |
/*
* Copyright (C) 2005, The OpenURP 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... | openurp/api | std/src/main/scala/org/openurp/std/fee/model/Bill.scala | Scala | lgpl-3.0 | 1,693 |
package org.globalnames
import java.util.concurrent.TimeUnit
import org.openjdk.jmh.annotations._
import org.globalnames.parser.ScientificNameParser.{Result, instance => snp}
import scala.io.Source
import scala.util.Random
@Warmup(iterations = 3, time = 1, timeUnit = TimeUnit.SECONDS)
@Measurement(iterations = 3, t... | GlobalNamesArchitecture/gnparser | benchmark/src/main/scala/org/globalnames/ScientificNameParserBenchmark.scala | Scala | mit | 1,439 |
package dotty.tools.languageserver
import org.junit.Test
import dotty.tools.languageserver.util.Code._
class ReferencesTest {
@Test def valNoReferences0: Unit =
code"class X { val ${m1}x$m2 = 9 }".withSource.references(m1 to m2, Nil)
@Test def valReferences0: Unit = {
code"class X { val ${m1}x$m2 = 9; ... | dotty-staging/dotty | language-server/test/dotty/tools/languageserver/ReferencesTest.scala | Scala | apache-2.0 | 16,142 |
/**
* Copyright (c) 2016, Gluon
* 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 ... | erwin1/gluon-samples | gluon-SQLite-scala/src/main/scala/com.gluonhq.sqlite/package.scala | Scala | bsd-3-clause | 8,714 |
/*
* Copyright 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 applicable l... | wsaccaco/lift | framework/lift-persistence/lift-mongodb/src/main/scala/net/liftweb/mongodb/Meta.scala | Scala | apache-2.0 | 4,751 |
package nb.bar.management.model
import scala.scalajs.js
import scala.scalajs.js.annotation.ScalaJSDefined
/**
* Created by Nadie on 29/05/16.
*/
@ScalaJSDefined
trait Table extends js.Object {
val tableName: String;
val tableId: Int; // It can't be long, because will throw an "1 is not an instance ... | nanybooooom/SamoApp | src/main/scala/nb/bar/management/model/Table.scala | Scala | gpl-2.0 | 410 |
/*
* Copyright 2012 Eike Kettner
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to... | eikek/publet | publet/src/test/scala/org/eknet/publet/vfs/RootContainerSuite.scala | Scala | apache-2.0 | 1,347 |
package me.jeffmay.neo4j.client.cypher
import me.jeffmay.neo4j.client.Show
object DefaultCypherShows {
final val defaultMaxLineWidth: Int = 120
}
trait DefaultCypherShows {
protected val maxLineWidth: Int = DefaultCypherShows.defaultMaxLineWidth
private def separateWithNewLines(strs: Iterable[String]): Boole... | AudaxHealthInc/neo4j-scala-client | core/src/main/scala/me/jeffmay/neo4j/client/cypher/DefaultCypherShows.scala | Scala | apache-2.0 | 3,817 |
package scalajssupport
import scala.scalajs.js
/**
* This wraps RhinoFile, NodeFile, or PhantomFile depending on which javascript
* environment is being used, and emulates a subset of the java.io.File API.
*/
class File(path: String) {
import File._
val _file = jsFile(path)
def this(path: String, child: St... | gslowikowski/scalac-scoverage-plugin | scalac-scoverage-runtime/js/src/main/scala/scalajssupport/File.scala | Scala | apache-2.0 | 1,448 |
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Await
import scala.concurrent.duration._
object PkExample extends App {
import slick.driver.H2Driver.api._
final case class Review(title: String, rating: Int, id: Long = 0L)
final class ReviewTable(tag: Tag) extends Table[Review... | d6y/slick-upsert | src/main/scala/single-pk.scala | Scala | apache-2.0 | 2,158 |
/*
* Copyright (c) 2014-2022 Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
* You may obtain a copy of the Apache License Version 2.0 at http://www.apach... | snowplow/schema-ddl | modules/core/src/main/scala/com.snowplowanalytics/iglu.schemaddl/redshift/ColumnConstraint.scala | Scala | apache-2.0 | 1,531 |
/* *********************************************************************
* This file is part of the MELIA theorem prover
*
* Copyright (c) NICTA/Peter Baumgartner <Peter.Baumgartner@nicta.com.au>
*
* MELIA is free software: you can redistribute it
* and/or modify it under the terms of the GNU General Public Licen... | newca12/MELIA | src/Flags.scala | Scala | gpl-3.0 | 5,617 |
package models.daos
import models.Patient
import scala.concurrent.Future
/**
* Created by Jo on 21/08/2015.
*/
trait PatientDAO {
/**
* Finds a patient by their user ID.
*
* @param hospitalNumber The hospital number of the patient to find.
* @return The found patient or None if no user for the given ... | BBK-SDP-2015-jtomli03/Morphidose2 | app/models/daos/PatientDAO.scala | Scala | apache-2.0 | 616 |
package io.circe.tests
import io.circe.JsonNumber
import org.scalacheck.{ Arbitrary, Gen }
case class JsonNumberString(s: String) {
def toJsonNumber: JsonNumber = JsonNumber.fromString(s).getOrElse(
sys.error(
s"An Arbitrary-provided JsonNumberString should always contain a valid JsonNumber; %s isn't."
... | alexarchambault/circe | tests/shared/src/main/scala/io/circe/tests/JsonNumberString.scala | Scala | apache-2.0 | 1,140 |
/**
* 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... | akosiaris/kafka | core/src/test/scala/unit/kafka/producer/SyncProducerTest.scala | Scala | apache-2.0 | 9,286 |
package stronghold.strings
/**
* problem description: http://rosalind.info/problems/eval/
*/
object ExpectedNumberOfRestrictionSites {
object SampleData {
val sample: List[String] =
List(
"10",
"AG",
"0.25 0.5 0.75"
)
}
import SampleData.sample
import utils.Utilit... | ghostrider77/Bioinformatics | Bioinformatics/src/main/scala-2.11/stronghold/strings/ExpectedNumberOfRestrictionSites.scala | Scala | mit | 1,541 |
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
/** @author John Miller
* @builder scalation.linalgebra.mem_mapped.bld.BldVector
* @version 1.2
* @date Sun Sep 27 18:29:28 EDT 2015
* @see LICENSE (MIT style license file).
*/
package scalation.linalgebra.mem_mapped
im... | mvnural/scalation | src/main/scala/scalation/linalgebra/mem_mapped/VectorL.scala | Scala | mit | 36,057 |
package tastytest
object TestAsyncSuite extends Suite("TestAsyncSuite") {
class MySuite extends testsuite.AsyncSuite
}
| scala/scala | test/tasty/run/src-2/tastytest/TestAsyncSuite.scala | Scala | apache-2.0 | 124 |
/*
* 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... | asorianostratio/incubator-toree | project/Build.scala | Scala | apache-2.0 | 8,968 |
package com.typesafe.akka.http.benchmark.handlers
import akka.http.scaladsl.model.HttpCharsets._
import akka.http.scaladsl.model.MediaTypes._
import akka.http.scaladsl.model.{HttpEntity, HttpResponse, StatusCodes}
import akka.http.scaladsl.server.Directives._
import com.typesafe.akka.http.benchmark.datastore.DataStore... | nathana1/FrameworkBenchmarks | frameworks/Scala/akka-http/src/main/scala/com/typesafe/akka/http/benchmark/handlers/DbHandler.scala | Scala | bsd-3-clause | 1,634 |
/*
* 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 ... | SnappyDataInc/spark | mllib/src/main/scala/org/apache/spark/ml/regression/AFTSurvivalRegression.scala | Scala | apache-2.0 | 23,057 |
import sbt._
import Keys._
import play.Project._
object ApplicationBuild extends Build {
val appName = "web"
val appVersion = "1.0-SNAPSHOT"
val mainDependencies = Seq(
// Add your project dependencies here,
javaCore,
jdbc,
anorm,
cache,
"uk.bl.wa.interject" % "interject-ac... | ukwa/interject | interject-webapp/project/Build.scala | Scala | apache-2.0 | 934 |
package test
import org.specs2.mutable.Specification
class AvroRecord2ArityHeteroTest extends Specification {
"A case class with an `Int` field coexisting with a non-`Int` field" should {
"serialize and deserialize correctly" in {
val record1 = AvroRecordTest48(1, "bonjour")
val record2 = AvroRecor... | julianpeeters/avro-scala-macro-annotations | tests/src/test/scala/AvroRecordTests/datatypetests/AvroRecord2ArityHeteroTest.scala | Scala | apache-2.0 | 4,575 |
/*
* 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 ... | ksattler/piglet | ceplib/src/test/scala/dbis/cep/test/flink/FlinkBatchCEPTest.scala | Scala | apache-2.0 | 4,914 |
/*
* Copyright 2017 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... | pncampbell/ct-calculations | src/test/scala/uk/gov/hmrc/ct/accounts/frs102/boxes/AC130Spec.scala | Scala | apache-2.0 | 1,002 |
/*
* 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 ... | PangZhi/flink | flink-libraries/flink-table/src/test/scala/org/apache/flink/table/api/stream/table/validation/InsertIntoValidationTest.scala | Scala | apache-2.0 | 2,822 |
package mylib
package misc {
object longestCommSeq {
def length[T](a: Seq[T], b: Seq[T]) = {
val tab = Array.ofDim[Int](a.length + 1, b.length + 1)
for (i <- 0 until a.length; j <- 0 until b.length) {
if (a(i) == b(j)) {
tab(i + 1)(j + 1) = tab(i)(j) + 1
} else {
tab(i + 1)(j + 1) = ta... | tianran/tifmo | src/mylib/misc/longestCommSeq.scala | Scala | bsd-2-clause | 692 |
package uk.co.morleydev.ghosthunt.controller.impl.game
import uk.co.morleydev.ghosthunt.controller.Controller
import uk.co.morleydev.ghosthunt.model.event.{Event, sys, game}
import uk.co.morleydev.ghosthunt.model.GameTime
import uk.co.morleydev.ghosthunt.data.store.EntityComponentStore
import uk.co.morleydev.ghosthunt... | MorleyDev/GhostHunt | src/main/scala/uk/co/morleydev/ghosthunt/controller/impl/game/LocalActorController.scala | Scala | mit | 2,386 |
package org.vindinium.server
package system
case class Pov(gameId: String, token: String)
case class PlayerInput(game: Game, token: String) {
def hero = game heroByToken token
}
case class AiTimeoutException(pov: Pov) extends GameException {
def message = s"$pov timeout"
}
| ornicar/vindinium | app/system/model.scala | Scala | mit | 282 |
/*
* 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/bugs/TestBug3.scala | Scala | apache-2.0 | 5,719 |
package com.github.j5ik2o.dddbase.memory
import com.github.j5ik2o.dddbase.AggregateMultiReader
import monix.eval.Task
trait AggregateMultiReadFeature extends AggregateMultiReader[Task] with AggregateBaseReadFeature {
override def resolveMulti(ids: Seq[IdType]): Task[Seq[AggregateType]] =
for {
results ... | j5ik2o/scala-ddd-base-functional | nosql/memory/src/main/scala/com/github/j5ik2o/dddbase/memory/AggregateMultiReadFeature.scala | Scala | mit | 463 |
class A(val member: Int) {
def getAMember = member
}
class SubA(member: Int) extends A(member) {
def getSubAMember = member
}
class B(member: Int) extends SubA(member) {
def getBMember = member
}
object Test {
def printFields(cls: Class[_]) =
println(cls.getDeclaredFields.map(_.toString).sorted.toList.mk... | som-snytt/dotty | tests/run/paramForwarding_together.scala | Scala | apache-2.0 | 636 |
/***********************************************************************
* Copyright (c) 2013-2015 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 is ... | mcharles/geomesa | geomesa-utils/src/main/scala/org/locationtech/geomesa/utils/geotools/package.scala | Scala | apache-2.0 | 1,252 |
/*
* 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 | resource-managers/yarn/src/test/scala/org/apache/spark/deploy/yarn/YarnAllocatorSuite.scala | Scala | apache-2.0 | 20,393 |
package org.jetbrains.plugins.scala
package lang
package parser
package parsing
package expressions
import org.jetbrains.plugins.scala.lang.lexer.ScalaTokenTypes
import org.jetbrains.plugins.scala.lang.parser.parsing.base.Import
import org.jetbrains.plugins.scala.lang.parser.parsing.builder.ScalaPsiBuilder
import org.... | triggerNZ/intellij-scala | src/org/jetbrains/plugins/scala/lang/parser/parsing/expressions/BlockStat.scala | Scala | apache-2.0 | 2,357 |
/*
* Copyright 2018 Analytics Zoo 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... | intel-analytics/analytics-zoo | zoo/src/main/scala/com/intel/analytics/zoo/examples/streaming/textclassification/StreamingInferenceTextClassification.scala | Scala | apache-2.0 | 4,828 |
package controllers
import play.api.mvc._
class HealthCheckController extends Controller {
def healthCheck = Action {
Ok("Play Framework API: up and running!")
}
}
| whiteprompt/akka-http-vs-play | api-play/app/controllers/HealthCheckController.scala | Scala | apache-2.0 | 174 |
/*
* Copyright 2017-2018 47 Degrees, LLC. <http://www.47deg.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless require... | frees-io/freestyle | modules/logging/jvm/src/test/scala/tagless/LoggingTestsJournal.scala | Scala | apache-2.0 | 2,563 |
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 org.jetbrains.plugins.scala.lang.psi.api.expr.{ScExpression, ScIfStmt, ScParenthesisedExpr}
... | ilinum/intellij-scala | src/org/jetbrains/plugins/scala/lang/surroundWith/surrounders/expression/ScalaWithIfConditionSurrounder.scala | Scala | apache-2.0 | 1,535 |
/*
* 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 ... | davidzchen/samza | samza-yarn/src/main/scala/org/apache/samza/job/yarn/SamzaAppMasterMetrics.scala | Scala | apache-2.0 | 3,689 |
object Test extends App {
import util.matching._
import Regex._
val r = "(\\d+)".r
val q = """(\d)""".r
val ns = List("1,2","x","3,4")
val u = r.unanchored
val is = ns collect { case u(x) => x } map { case r(x) => x }
println(is)
// Match from same pattern
val js = (ns map { u findFirstMatchIn _ ... | som-snytt/dotty | tests/run/t6406-regextract.scala | Scala | apache-2.0 | 789 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | BryanCutler/spark | core/src/main/scala/org/apache/spark/deploy/SparkHadoopUtil.scala | Scala | apache-2.0 | 20,543 |
package 练习25
trait b被乘数 {
type 被乘[T <: c乘数] <: z自然数
}
class b被乘数Positive[Tail <: b被乘数] extends b被乘数 {
override type 被乘[T <: c乘数] = T#乘[Tail]
}
class b被乘数Zero extends b被乘数 {
override type 被乘[T <: c乘数] = z自然数Zero
}
trait c乘数 {
type 乘[T <: b被乘数] <: z自然数
}
class c乘数Positive[Tail <: c乘数] extends c乘数 {
override t... | djx314/ubw | a28-练习/src/main/scala/练习25/乘法.scala | Scala | bsd-3-clause | 738 |
/*
* 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/src/main/scala/org/neo4j/cypher/internal/spi/v2_2/TransactionBoundGraphStatistics.scala | Scala | apache-2.0 | 2,745 |
/*
* Copyright 2012-2015 Comcast Cable Communications Management, 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 re... | ipapa/money | money-spring3/src/test/scala/com/comcast/money/spring3/TracedMethodAdvisorSpec.scala | Scala | apache-2.0 | 1,241 |
package templemore.onx.version6
import actors.Actor
import templemore.onx.version5.{Grid, Token, Position}
/**
* @author Chris Turner
*/
class GridActor extends Actor {
private var game: GameActor = _
private var grid: Grid = _
def act(): Unit = {
loop {
react {
case Initialise(g) => {
... | skipoleschris/OandX | src/main/scala/templemore/onx/version6/GridActor.scala | Scala | apache-2.0 | 1,139 |
/*
* The MIT License
*
* Copyright 2015 misakura.
*
* 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 use, copy, modify... | t-kgd/library-water | water-scala-core/src/main/scala/jp/gr/java_conf/kgd/library/water/scala/core/value/SimplePoint2.scala | Scala | mit | 1,940 |
package com.softwaremill.react.kafka2
import org.apache.kafka.clients.producer.{KafkaProducer, ProducerConfig}
import org.apache.kafka.common.serialization.Serializer
object ProducerProvider {
def apply[K, V](host: String, keySe: Serializer[K], valueSe: Serializer[V]) = {
new ProducerProvider(
Map(Produce... | hepin1989/reactive-kafka | core/src/main/scala/com/softwaremill/react/kafka2/ProducerProvider.scala | Scala | apache-2.0 | 898 |
/***********************************************************************
* Copyright (c) 2013-2022 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... | locationtech/geomesa | geomesa-z3/src/test/scala/org/locationtech/geomesa/curve/Z2Test.scala | Scala | apache-2.0 | 4,853 |
/**
* © 2019 Refinitiv. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable l... | e-orz/CM-Well | server/cmwell-data-tools/src/main/scala/cmwell/tools/data/downloader/streams/japi/DownloaderUtils.scala | Scala | apache-2.0 | 3,992 |
/*
* 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 ... | tzulitai/flink | flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/runtime/stream/table/OverWindowITCase.scala | Scala | apache-2.0 | 14,646 |
package org.jetbrains.plugins.scala.lang.resolve2
import _root_.org.jetbrains.plugins.scala.lang.resolve.ScalaResolveTestCase
import com.intellij.psi.impl.source.resolve.reference.impl.PsiMultiReference
import com.intellij.psi.{PsiElement, PsiReference}
import junit.framework._
import org.jetbrains.plugins.scala.exten... | katejim/intellij-scala | test/org/jetbrains/plugins/scala/lang/resolve2/ResolveTestBase.scala | Scala | apache-2.0 | 6,872 |
package org.bitcoins.rpc.channels
import org.bitcoins.core.channels._
import org.bitcoins.core.crypto.{DoubleSha256Digest, ECPrivateKey, WitnessTxSigComponent}
import org.bitcoins.core.currency.{CurrencyUnit, Satoshis}
import org.bitcoins.core.number.Int64
import org.bitcoins.core.policy.Policy
import org.bitcoins.cor... | bitcoin-s/bitcoin-s-rpc-client | src/main/scala/org/bitcoins/rpc/channels/ChannelServer.scala | Scala | mit | 6,856 |
package com.avsystem.commons
package mongo.typed
import org.bson.{BsonDocument, BsonValue}
/**
* Represents a MongoDB order used to sort values. In most situations what you want is [[MongoDocumentOrder]].
* The base `MongoOrder` type is used only in rare situations where `T` is not guaranteed to be a document, e.... | AVSystem/scala-commons | commons-mongo/jvm/src/main/scala/com/avsystem/commons/mongo/typed/MongoOrder.scala | Scala | mit | 3,083 |
#!/bin/sh
L=`pwd`
cp=`echo $L/lib/*`
exec scala -cp "$cp" "$0" "$@"
!#
/**
* Copyright (c) 2014 MongoDB, Inc.
*
* 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... | antonnik/code-classifier | naive_bayes/resources/scala/mongoimport.scala | Scala | apache-2.0 | 9,831 |
/**
* 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... | wangcy6/storm_app | frame/kafka-0.11.0/kafka-0.11.0.1-src/core/src/main/scala/kafka/security/CredentialProvider.scala | Scala | apache-2.0 | 2,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 ... | sh-cho/cshSpark | package.scala | Scala | apache-2.0 | 4,024 |
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.