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 |
|---|---|---|---|---|---|
/*
* Scala.js (https://www.scala-js.org/)
*
* Copyright EPFL.
*
* Licensed under Apache License 2.0
* (https://www.apache.org/licenses/LICENSE-2.0).
*
* See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*/
package org.scalajs.linker
/** ECMAScript fea... | nicolasstucki/scala-js | linker/shared/src/main/scala/org/scalajs/linker/ESFeatures.scala | Scala | apache-2.0 | 2,887 |
// 6. Write a for loop for computing the product of the Unicode codes of all letters in a string. For example, the product of the characters in "Hello" is 9415087488L .
var prod = 1
var prodL = 1L
for (c <- "Hello") {
prod *= c
prodL *= c
println(c, prod, prodL)
} | P7h/ScalaPlayground | Scala for the Impatient/exercises/org/p7h/scala/impatient/chapter02/06.scala | Scala | apache-2.0 | 280 |
/*
* Copyright 2015 - 2017 Pablo Alcaraz
* Mysql to Postgres converter
*
* 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... | pabloa/mysql2postgresql | src/main/scala/com/github/mysql2postgresql/converter/conversion/data/BooleanDataConverter.scala | Scala | apache-2.0 | 1,364 |
import scala.reflect.TypeTest
trait R {
type Nat
type Succ <: Nat
type Idx
given TypeTest[Nat, Succ] = typeTestOfSucc
protected def typeTestOfSucc: TypeTest[Nat, Succ]
def n: Nat
def one: Succ
}
object RI extends R {
type Nat = Int
type Succ = Int
type Idx = Int
protected def typeTestOfSucc: Typ... | lampepfl/dotty | tests/neg-custom-args/fatal-warnings/type-test-paths-2.scala | Scala | apache-2.0 | 1,017 |
package blackjackcardcount;
import scala.collection.mutable.{Queue, ArrayBuffer, HashSet}
import scala.util.Random
class BlackJackCardShoe(ndecks : Int) {
protected val cardqueue : Queue[BlackJackPlayingCard] = Queue();
private val rgenerator : Random = new Random();
protected val cards_per_deck : Int = 52;
... | mjquinlan/blackjackcardcount | src/main/scala/BlackJackCardShoe.scala | Scala | mit | 1,299 |
package com.blinkbox.books.elasticsearch.client.api
import org.elasticsearch.action.delete.DeleteRequest
import org.elasticsearch.action.index.IndexRequest
import org.elasticsearch.action.update.UpdateRequest
case class IndexMeta(
_index: String,
_type: String,
_id: String,
ttl: Option[Long],
version_type: ... | blinkboxbooks/elastic-http | src/main/scala/com/blinkbox/books/elasticsearch/client/api/metas.scala | Scala | mit | 3,587 |
package mimir.ctables
import java.io._
import org.specs2.mutable._
import mimir.test._
import optimus.optimization._
import optimus.algebra._
import optimus.algebra.AlgebraOps._
import optimus.optimization.enums._
import optimus.optimization.model._
object CTPrioritizerSpec extends Specification {
//val test = CT... | UBOdin/mimir | src/test/scala/mimir/ctables/CTPrioritizerSpec.scala | Scala | apache-2.0 | 4,168 |
package com.example.android_servicetest
import android.os.IBinder
import android.app.Service
import android.content.Intent
import android.os.Binder
class MyService extends Service {
val myBinder = new MyBinder
var loop: Boolean = true
def onBind(intent: Intent): IBinder = {
println("MyService is onBind inv... | firefoxmmx2/Android_ServiceTest | src/com/example/android_servicetest/MyService.scala | Scala | apache-2.0 | 1,217 |
package aoc.day21
object Part2 extends App {
println("See part 1.")
} | GuillaumeDD/AdventOfCode2015 | src/main/scala/aoc/day21/Part2.scala | Scala | gpl-3.0 | 72 |
package examples.demo
import examples.demo.GModularClockCircle.Clock
import examples.demo.ui.{Circle, Point, Shape, ShapesPanel}
import rescala.default._
/** We now convert our BouncingBall into an external Module, similar
* to Clock earlier. We begin by wrapping the movement code into
* a class. We leave the bal... | guidosalva/REScala | Code/Examples/examples/src/main/scala/examples/demo/KSemiModularBall.scala | Scala | apache-2.0 | 2,363 |
package sbt
import java.io.File
import java.net.URI
import Project._
import Def.{ ScopedKey, Setting }
import Scope.{ GlobalScope, ThisScope }
import Types.{ const, idFun, Id }
import complete._
import DefaultParsers._
/**
* The resulting `session` and verbose and quiet summaries of the result of a set operation.
*... | jasonchaffee/sbt | main/src/main/scala/sbt/SettingCompletions.scala | Scala | bsd-3-clause | 18,141 |
package goggles.macros.lex
import goggles.macros.At
import org.specs2._
class LexerSpec extends Specification with ScalaCheck { def is =
s2"""
Lexer should:
Make each opening bracket a token $openBrackets
Make each closed bracket a token $closeBrackets
Make each dot a token $dots
Make ... | kenbot/goggles | macros/src/test/scala/goggles/macros/lex/LexerSpec.scala | Scala | mit | 2,164 |
/*
* Copyright (c) 2014 Dufresne Management Consulting LLC.
*/
package com.nickelsoftware.bettercare4me.hedis.hedis2014;
import org.scalatestplus.play.OneAppPerSuite
import org.scalatestplus.play.PlaySpec
import com.nickelsoftware.bettercare4me.hedis.HEDISRulesTestSpec
import com.nickelsoftware.bettercare4me.hedis.S... | reactivecore01/bettercare4.me | play/test/com/nickelsoftware/bettercare4me/hedis/hedis2014/CDC_LDL_C_RuleTestSpec.scala | Scala | apache-2.0 | 1,325 |
/*
* 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 | kernel-api/src/main/scala/org/apache/toree/magic/dependencies/IncludeMagicLoader.scala | Scala | apache-2.0 | 1,169 |
package chat.tox.antox.utils
object Constants {
val START_TOX = "chat.tox.antox.START_TOX"
val STOP_TOX = "chat.tox.antox.STOP_TOX"
val BROADCAST_ACTION = "chat.tox.antox.BROADCAST"
val SWITCH_TO_FRIEND = "chat.tox.antox.SWITCH_TO_FRIEND"
val UPDATE = "chat.tox.antox.UPDATE"
val DOWNLOAD_DIRECTORY = ... | gale320/Antox | app/src/main/scala/chat/tox/antox/utils/Constants.scala | Scala | gpl-3.0 | 735 |
/*
* Licensed to Cloudera, Inc. under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. Cloudera, Inc. licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use thi... | Peddle/hue | apps/spark/java/livy-spark/src/main/scala/com/cloudera/hue/livy/spark/interactive/InteractiveSessionProcessFactory.scala | Scala | apache-2.0 | 1,453 |
package hsu.algorithm.evolutionary
case class EAParam(
numOfIterations: Int,
numOfIndividuals: Int,
numOfProblemLength: Int,
selectionPressure: Int,
crossoverRate: Double,
mutationRate: Double
... | ChuyuHsu/scala-genetic-algorithm | src/main/scala/hsu/algorithm/evolutionary/EAParam.scala | Scala | gpl-2.0 | 336 |
/*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distri... | flaminem/flamy | src/test/scala/com/flaminem/flamy/utils/prettyprint/Tabulator$Test.scala | Scala | apache-2.0 | 1,935 |
package models
import java.util.UUID
import scala.collection.convert.WrapAsScala
import scala.concurrent.ExecutionContext
import scala.concurrent.Future
import play.api.libs.json._
import play.api.libs.functional.syntax._
import play.api.data.validation.ValidationError
import com.datastax.driver.core.utils.UUIDs
impor... | magro/play2-scala-cassandra-sample | app/models/models.scala | Scala | apache-2.0 | 2,977 |
package org.scalajs.jsenv.selenium
import scalajs.js
import scalajs.js.Dynamic._
import scalajs.js.annotation.JSExport
object SeleniumApp extends js.JSApp {
private val canvasId = "testCanvas"
def main(): Unit = {
ElementCreator.create("<h1>SeleniumJSEnv Test</h1>")
CanvasCreator.create(canvasId)
Can... | nicolasstucki/scala-js-env-selenium | seleniumJSEnvTest/src/main/scala/org/scalajs/jsenv/selenium/SeleniumApp.scala | Scala | bsd-3-clause | 1,116 |
/**
* 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"); yo... | geeag/kafka | core/src/test/scala/unit/kafka/server/FetchRequestTest.scala | Scala | apache-2.0 | 11,852 |
package cfn
import org.json4s._
import org.json4s.native._
object TemplateBuilder {
def buildAsJValue(template: Template): JValue = template.asJValue
def buildAsString(template: Template): String = prettyJson(renderJValue(buildAsJValue(template)))
}
| j5ik2o/cloudformation-scala | src/main/scala/cfn/TemplateBuilder.scala | Scala | mit | 259 |
package breeze.stats
import scala.reflect.ClassTag
import util.Sorting
import breeze.util.{quickSelectImpl, quickSelect}
/*
Copyright 2009 David Hall, Daniel Ramage
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 co... | claydonkey/breeze | math/src/main/scala/breeze/stats/DescriptiveStats.scala | Scala | apache-2.0 | 17,806 |
/*
* 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 ... | caneGuy/spark | core/src/main/scala/org/apache/spark/scheduler/cluster/CoarseGrainedSchedulerBackend.scala | Scala | apache-2.0 | 34,371 |
package shred.man.cuda.cumath.tensor.matrix
import breeze.linalg.DenseMatrix
import jcuda.driver.CUdeviceptr
import jcuda.jcublas.JCublas2
import jcuda.runtime.JCuda
import jcuda.{Sizeof, Pointer}
import shred.man.cuda.cumath._
import shred.man.cuda.cumath.operators.Assigner
import shred.man.cuda.cumath.tensor.matrix.... | shredzzz/shredman | cuda/src/main/scala/shred/man/cuda/cumath/tensor/matrix/CuMatrix.scala | Scala | apache-2.0 | 4,183 |
package edu.gemini.pit.ui.view.obs
import edu.gemini.gsa.client.impl.GsaUrl
import edu.gemini.model.p1.immutable._
import edu.gemini.pit.model._
import edu.gemini.pit.ui.editor._
import edu.gemini.pit.ui.util.SharedIcons._
import edu.gemini.pit.ui.util._
import java.awt.datatransfer._
import javax.swing.TransferHandle... | arturog8m/ocs | bundle/edu.gemini.pit/src/main/scala/edu/gemini/pit/ui/view/obs/ObsListView.scala | Scala | bsd-3-clause | 24,019 |
package com.yuvimasory.flashcards
import org.scalatest.FunSuite
import FlashcardParser._
import FlashcardParser.ComponentParsers._
import StringUtils._
class FlashcardParserTest extends FunSuite {
test("`flashcard` simple case") {
val str =
"""
* front
back
""" substring(1)
parseAll(flashcard, str) matc... | ymasory/Flashup | src/test/scala/FlashcardParserTest.scala | Scala | agpl-3.0 | 629 |
package controllers
import javax.inject._
import play.api._
import play.api.mvc._
@Singleton
class Application @Inject() extends Controller {
def index(path: String) = Action {
Ok(views.html.index())
}
def api(path: String) = Action {
Ok("Swagger")
}
}
| pass-stack/generator-pass | generators/app/templates/app/controllers/Application.scala | Scala | mit | 273 |
/*
* 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 ... | shaneknapp/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/FileSourceStrategy.scala | Scala | apache-2.0 | 11,216 |
import scala.quoted.*
object Macros {
inline def foreach1(start: Int, end: Int, f: Int => Unit): String = ${impl('start, 'end, 'f)}
inline def foreach2(start: Int, end: Int, f: => Int => Unit): String = ${impl('start, 'end, 'f)}
inline def foreach3(start: Int, end: Int, inline f: Int => Unit): String = ${impl('... | dotty-staging/dotty | tests/run-macros/quote-inline-function/quoted_1.scala | Scala | apache-2.0 | 731 |
/*
* Copyright 2017 PayPal
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in ... | anilgursel/squbs | squbs-pattern/src/main/scala/org/squbs/pattern/stream/PersistentQueue.scala | Scala | apache-2.0 | 8,470 |
package fpinscala.laziness
import Stream._
trait Stream[+A] {
def uncons: Option[(A, Stream[A])]
def isEmpty: Boolean = uncons.isEmpty
/*
The natural recursive solution will stack overflow for large streams. We'll write it with an explicit loop instead.
*/
def toList: List[A] = {
val buf = new colle... | galarragas/FpInScala | answers/src/main/scala/fpinscala/laziness/Stream.scala | Scala | mit | 7,537 |
package com.olegych.scastie.storage
import com.olegych.scastie.api._
import java.nio.file._
import org.scalatest.FunSuite
class SnippetsContainerTest extends FunSuite {
private def testContainer =
new SnippetsContainer(
Files.createTempDirectory("test"),
Files.createTempDirectory("old-test")
... | OlegYch/scastie | storage/src/test/scala/com.olegych.scastie.storage/SnippetsContainerTest.scala | Scala | apache-2.0 | 4,329 |
/* Copyright 2017-18, Emmanouil Antonios Platanios. 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 ... | eaplatanios/tensorflow | tensorflow/scala/api/src/main/scala/org/platanios/tensorflow/api/learn/layers/rnn/cell/RNNCell.scala | Scala | apache-2.0 | 2,238 |
package com.monsanto.arch.cloudformation.model.resource
import com.monsanto.arch.cloudformation.model.Token.TokenSeq
import com.monsanto.arch.cloudformation.model._
import spray.json._
import scala.annotation.implicitNotFound
import scala.language.implicitConversions
case class `AWS::ECS::Cluster`(name: String,
... | MonsantoCo/cloudformation-template-generator | src/main/scala/com/monsanto/arch/cloudformation/model/resource/ECS.scala | Scala | bsd-3-clause | 16,343 |
package specs
import org.scalatest.prop.PropertyChecks
import org.scalatest.{Matchers, WordSpec}
trait Spec extends WordSpec with PropertyChecks with Matchers
| mdedetrich/scalajson | shared/src/test/scala/specs/Spec.scala | Scala | bsd-3-clause | 161 |
package scala.meta.tests
package parsers
import scala.meta.{Name => _, _}, Importee._, Term.{This, Name => TermName, Select, Super}
import scala.meta.Name.{Anonymous, Indeterminate}
import scala.meta.dialects.Scala211
import scala.meta.parsers.ParseException
class ImportSuite extends ParseSuite {
test("import foo.b... | scalameta/scalameta | tests/shared/src/test/scala/scala/meta/tests/parsers/ImportSuite.scala | Scala | bsd-3-clause | 4,251 |
package user
import slick.driver.PostgresDriver.api._
import scala.concurrent.{ExecutionContext, Future}
class UserRepository(implicit db: Database, ec: ExecutionContext) {
val usersTQ = TableQuery[Users]
def findByUserId(id: Long): Future[Option[User]] = {
db.run(byUserIdQueryCompiled(id).result.headOptio... | piobab/akka-http-rest-api | src/main/scala/user/UserRepository.scala | Scala | mit | 1,572 |
package com.eevolution.context.dictionary.domain.api.service
import com.eevolution.context.dictionary._
import com.eevolution.context.dictionary.domain.model.AccessLog
/**
* Copyright (C) 2003-2017, e-Evolution Consultants S.A. , http://www.e-evolution.com
* This program is free software: you can redistribute it ... | adempiere/ADReactiveSystem | dictionary-api/src/main/scala/com/eevolution/context/dictionary/domain/api/service/AccessLogService.scala | Scala | gpl-3.0 | 1,215 |
package no.uio.musit.security.oauth2
import no.uio.musit.security.BearerToken
import play.api.libs.json.{Reads, __}
import play.api.libs.functional.syntax._
case class OAuth2Info(
accessToken: BearerToken,
tokenType: Option[String] = None,
expiresIn: Option[Long] = None,
refreshToken: Option[String] =... | MUSIT-Norway/musit | musit-service/src/main/scala/no/uio/musit/security/oauth2/OAuth2Info.scala | Scala | gpl-2.0 | 787 |
package library.persistance.repository
import library.model.User
trait IUserRepository
{
def verifyUser(user: User): Boolean
def getUserByUsername(username: String): User
}
| leyyin/university | systems-for-design-and-implementation/labs/lab3/LibraryPersistance/src/library/persistance/repository/IUserRepository.scala | Scala | mit | 184 |
package stoner.ai
import stoner.board.{Board, Move, Side}
trait StonerBrain {
def bestMove(board: Board) : Option[(Move, Side)]
}//end trait StonerBrain
//31337 | RJRyV/stoner | src/main/scala/stoner/ai/StonerBrain.scala | Scala | gpl-3.0 | 169 |
package effectful.examples.effects
import effectful.{EffectIterator, LiftService}
import effectful.augments._
import cats._
import effectful.examples.effects.sql.SqlDriver._
package object sql {
implicit class SqlCursorPML[E[_]](val self: SqlDriver[E]) extends AnyVal {
def iteratePreparedQuery(
preparedSt... | lancegatlin/effectful-demo | src/test/scala/effectful/examples/effects/sql/package.scala | Scala | mit | 3,466 |
/*
* 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 ... | jeremiaswerner/openwhisk | core/standalone/src/main/scala/org/apache/openwhisk/standalone/StandaloneDockerSupport.scala | Scala | apache-2.0 | 9,110 |
package nz.wicker.autoencoder.demo
import nz.wicker.autoencoder._
import nz.wicker.autoencoder.math.matrix._
import scala.math.pow
import nz.wicker.autoencoder.math.matrix.Mat
import nz.wicker.autoencoder.math.optimization.ConjugateGradientDescent_HagerZhangConfiguration
import nz.wicker.autoencoder.neuralnet.rbm.Defa... | joergwicker/autoencoder | src/main/scala/nz/wicker/autoencoder/demo/ConfigurableArffCompressionMain_Stream.scala | Scala | gpl-3.0 | 7,598 |
package inoio
package spray2json
import org.specs2.mutable._
import shapeless._
import spray.json._
import fommil.sjs._
import play.api.libs.json.Json
import allconversions._
class JsonSpec extends Specification {
import traits._
import Implicits._
val st : SimpleTrait = Foo("hello")
val r : SimpleTrait =... | justjoheinz/play-spray2json | src/test/scala/inoio/spray2json/specs.scala | Scala | apache-2.0 | 1,696 |
package models.oauth2
case class Usuario (chave: String, at: String, nome: String, pic: String, email: String) | w2srobinho/ine5646 | origem_destino/app/models/oauth2/Usuario.scala | Scala | mit | 113 |
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
/** @author John Miller, Yung Long Li
* @builder scalation.linalgebra.bld.BldSparseMatrix
* @version 1.2
* @date Sat Nov 10 19:05:18 EST 2012
* @see LICENSE (MIT style license file).
*/
package scalation.linalgebra
imp... | mvnural/scalation | src/main/scala/scalation/linalgebra/SparseMatrixI.scala | Scala | mit | 60,914 |
package actorbase.driver
import java.io.PrintStream
import java.net.{InetAddress, Socket}
import java.nio.{ByteBuffer, ByteOrder}
/**
* This class defines a concrete connection with a server.
*
* @constructor
* @param host The host name as String
* @param port The host port as Integer
* @param username Th... | SweeneyThreads/ActorbaseDriver | src/main/scala/actorbase/driver/ConcreteConnection.scala | Scala | mit | 2,477 |
/*
* 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 | mllib/src/main/scala/org/apache/spark/ml/tuning/ParamGridBuilder.scala | Scala | apache-2.0 | 3,251 |
package me.breidenbach.rabbitex
import me.breidenbach.rabbitex.connection.RabbitFactory
/**
* Date: 10/19/14
* Time: 10:01 PM
* Copyright 2014 Kevin E. Breidenbach
* @author Kevin E. Breidenbach
*/
case class ExampleScalaPublisher(host: String, port: Int, exchange: String, subject: String) {
val rabbitEx = Rab... | RabbitExpress/RabbitEx-Java | src/examples/scala/me/breidenbach/rabbitex/ExampleScalaPublisher.scala | Scala | mit | 800 |
/**
* (c) Copyright 2012 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... | alexandre-normand/kiji-schema-shell | src/main/scala/org/kiji/schema/shell/ddl/AlterTableSetColumnSchemaCommand.scala | Scala | apache-2.0 | 1,467 |
/*
* 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 ... | wangmiao1981/spark | resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/KubernetesDriverSpec.scala | Scala | apache-2.0 | 1,049 |
package scodec
package examples
import scalaz.\\/
import shapeless._
import scodec.bits._
import codecs._
class ProductsExample extends CodecSuite {
case class Woozle(count: Int, strength: Int)
case class Wocket(size: Int, inverted: Boolean)
"product codec examples" should {
"demonstrate case class gener... | danielwegener/scodec | src/test/scala/scodec/examples/ProductsExample.scala | Scala | bsd-3-clause | 1,502 |
package sorm.driver
import sorm.jdbc.{JdbcConnection, Statement}
import sorm.core.SormException
trait StdDropAllTables { self: StdConnection with StdListTables with StdQuote =>
def dropAllTables() {
def tryToDrop
( table : String )
{
try {
connection.executeUpdate( Statement("DROP ... | csachs/sorm | src/main/scala/sorm/driver/StdDropAllTables.scala | Scala | mit | 712 |
/**
* 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/test/scala/unit/kafka/admin/DeleteTopicTest.scala | Scala | apache-2.0 | 14,310 |
/*
* This file is part of Kiama.
*
* Copyright (C) 2011-2015 Anthony M Sloane, Macquarie University.
*
* Kiama 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 ... | joaoraf/kiama | library/src/org/kiama/example/oberon0/L4/SymbolTable.scala | Scala | gpl-3.0 | 2,601 |
package com.twitter.finagle.service
import com.twitter.conversions.time._
import com.twitter.finagle.MockTimer
import com.twitter.finagle.stats.{Counter, StatsReceiver, NullStatsReceiver}
import com.twitter.finagle.Service
import com.twitter.util.{Future, Time, Promise, Return, Duration, Timer}
import org.junit.runner... | JustinTulloss/finagle | finagle-core/src/test/scala/com/twitter/finagle/service/ExpiringServiceTest.scala | Scala | apache-2.0 | 6,811 |
import sbt._
import sbt.Keys._
import com.typesafe.sbt.SbtScalariform._
import com.typesafe.sbteclipse.core.EclipsePlugin._
import scalariform.formatter.preferences._
import scoverage.ScoverageSbtPlugin
import sbtbuildinfo.Plugin._
object ChcalcBuild extends Build {
object Dependencies {
val scalazVersion = "7.... | chwthewke/ch-calc | project/ChcalcBuild.scala | Scala | mit | 2,302 |
import sbt._
import Keys._
import sbtrelease.ReleasePlugin._
import sbtbuildinfo.Plugin._
import scala.xml.Group
object build extends Build {
val manifestSetting = packageOptions <+= (name, version, organization) map {
(title, version, vendor) =>
Package.ManifestAttributes(
"Created-By" -> "Simple... | swagger-api/swagger-async-httpclient | project/build.scala | Scala | apache-2.0 | 5,419 |
package cucumber
package runtime
import _root_.gherkin.formatter.model.Step
import _root_.gherkin.I18n
import _root_.scala.collection.JavaConversions._
import _root_.java.util.regex.Pattern
class ScalaStepDefinition(frame:StackTraceElement, name:String, pattern:String, parameterTypes:List[Class[_]], f:List[Any] => ... | PhilipMay/cucumber-jvm | scala/src/main/scala/cucumber/runtime/ScalaStepDefinition.scala | Scala | mit | 986 |
package cn.gridx.scala.lang.collections.treemap
import scala.collection.immutable.TreeMap
/**
* Created by tao on 7/19/16.
*/
object Test extends App {
var m = TreeMap[Int, Int]()
m += (1 -> 10)
m += (2 -> 20)
m += (3 -> 30)
m += (0 -> 0)
m += (2 -> 21)
m += (2 -> 19)
println(m)
}
| TaoXiao/Scala | lang/src/main/scala/cn/gridx/scala/lang/collections/treemap/Test.scala | Scala | apache-2.0 | 308 |
/**
* 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... | evlist/orbeon-forms | src/main/scala/org/orbeon/oxf/xforms/state/DynamicState.scala | Scala | lgpl-2.1 | 13,004 |
package com.wavylabs.kata.romannumerals
import org.scalatest.FunSuite
/**
* Created by vega on 3/19/15.
*/
class RomanNumeralsConverterTest extends FunSuite {
test("arabic to roman one") {
assert("I" == RomanNumeralsConverter.arabicToRoman(1))
assert("II" == RomanNumeralsConverter.arabicToRoman(2))
a... | vega113/RomanNumeralsKataScala | src/test/scala/com/wavylabs/kata/romannumerals/RomanNumeralsConverterTest.scala | Scala | apache-2.0 | 1,377 |
package de.sciss.lucre.matrix
import de.sciss.file._
import de.sciss.lucre.artifact.{Artifact, ArtifactLocation}
import de.sciss.lucre.expr.IntObj
import de.sciss.lucre.stm.Durable
import de.sciss.lucre.stm.store.BerkeleyDB
object NetCDFSerialTest extends App {
type S = Durable
implicit val system = Durable(Berke... | iem-projects/LucreMatrix | core/src/test/scala/de/sciss/lucre/matrix/NetCDFSerialTest.scala | Scala | lgpl-2.1 | 1,705 |
package redmine4s.api.resource
import org.scalatest.{DiagrammedAssertions, FlatSpec}
class IssueCategoryResourceSpec extends FlatSpec with DiagrammedAssertions {
}
| tomingtoming/redmine4s | src/test/scala/redmine4s/api/resource/IssueCategoryResourceSpec.scala | Scala | apache-2.0 | 166 |
package com.twitter.scrooge.android_generator
import com.twitter.scrooge.ast.{Identifier, Enum}
import com.twitter.scrooge.java_generator.TypeController
class EnumConstant(val name: String, val value: Int, val last: Boolean)
class EnumController(e: Enum, generator: AndroidGenerator, ns: Option[Identifier])
exten... | twitter/scrooge | scrooge-generator/src/main/scala/com/twitter/scrooge/android_generator/EnumController.scala | Scala | apache-2.0 | 516 |
// Equites, a Scala chess playground
// Copyright © 2011, 2013-2014 Frank S. Thomas <frank@timepit.eu>
//
// 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
/... | equites-chess/equites-core | src/main/scala/eu/timepit/equites/Piece.scala | Scala | gpl-3.0 | 3,191 |
/**
* 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... | noslowerdna/kafka | core/src/main/scala/kafka/utils/CoreUtils.scala | Scala | apache-2.0 | 11,944 |
/*
* Copyright 2015 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-native-packager-demo | simple-javaapp-packaging/project/Settings.scala | Scala | apache-2.0 | 1,593 |
/*
* 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/ct-calculations | src/main/scala/uk/gov/hmrc/ct/ct600/v3/B45.scala | Scala | apache-2.0 | 1,542 |
package com.joescii.fpr
package snippet
import net.liftweb.http.{LiftRules, S}
import net.liftweb.util.Helpers._
import net.liftweb.common.Full
import scala.util.Try
import scala.xml.NodeSeq
object Code {
private val newline = System.getProperty("line.separator")
private def src = (for {
name <- S.attr("src... | joescii/fp-renaissance | src/main/scala/com/joescii/fpr/snippet/Code.scala | Scala | apache-2.0 | 1,689 |
package lila.user
import scala.concurrent.duration._
import lila.common.LightUser
import chess.Speed
import lila.rating.PerfType
import org.joda.time.DateTime
case class User(
id: String,
username: String,
perfs: Perfs,
count: Count,
troll: Boolean = false,
ipBan: Boolean = false,
enable... | clarkerubber/lila | modules/user/src/main/User.scala | Scala | agpl-3.0 | 6,927 |
package org.denigma.nlp.messages.Annotations
case class Rule(
name: String,
labels: Seq[String],
ruleType: String,
unit: String,
priority: String,
keep: Boolean,
action: String,
pattern: String
) | antonkulaga/bio-nlp | annotator/shared/src/main/scala/org/denigma/nlp/messages/Annotations/rules.scala | Scala | mpl-2.0 | 303 |
package com.twitter.finagle.postgresql
import com.twitter.finagle.postgresql.Types.FieldDescription
import com.twitter.finagle.postgresql.Types.Format
import com.twitter.finagle.postgresql.Types.Oid
import com.twitter.finagle.postgresql.Types.WireValue
import com.twitter.finagle.postgresql.transport.MessageDecoder
imp... | twitter/finagle | finagle-postgresql/src/main/scala/com/twitter/finagle/postgresql/BackendMessage.scala | Scala | apache-2.0 | 4,970 |
package org.mrgeo.job
import java.awt.image.WritableRaster
import java.net.URLClassLoader
import com.esotericsoftware.kryo.io.{Output, Input}
import com.esotericsoftware.kryo.{Serializer, KryoSerializable, Kryo}
import com.esotericsoftware.kryo.serializers.JavaSerializer
import org.apache.spark.graphx.{GraphKryoRegis... | tjkrell/MrGEO | mrgeo-core/src/main/scala/org/mrgeo/job/KryoRegistrar.scala | Scala | apache-2.0 | 2,328 |
package org.cvogt
import sbt._
import sbt.Keys._
import fastparse.core.Result
import scalaparse.Scala
private object Scalaparse {
def apply(
sourceDirectories: Seq[File],
includeFilter: FileFilter,
excludeFilter: FileFilter,
configuration: Configuration,
streams: TaskStrea... | cvogt/sbt-scalaparse | src/main/scala/Scalaparse.scala | Scala | bsd-2-clause | 1,454 |
package play.sockjs.api
import scala.concurrent.Future
import scala.util.control.NonFatal
import akka.actor.{ActorRef, Props}
import akka.stream.scaladsl._
import play.api.http.websocket.CloseCodes
import play.api.libs.streams._
import play.api.libs.json._
import play.api.mvc._
import play.sockjs.api.Frame._
/**
... | fdimuccio/play2-sockjs | src/main/scala/play/sockjs/api/SockJS.scala | Scala | apache-2.0 | 5,354 |
package skinny.oauth2.client.backlog
import skinny.logging.LoggerProvider
import skinny.oauth2.client.{ BearerRequest, OAuth2Client, OAuth2Token }
import skinny.json.JSONStringOps
import scala.util.control.NonFatal
case class BacklogAPI(spaceID: String) extends LoggerProvider {
def myself(token: OAuth2Token): Opt... | holycattle/skinny-framework | oauth2/src/main/scala/skinny/oauth2/client/backlog/BacklogAPI.scala | Scala | mit | 810 |
package mesosphere.marathon
package core.launchqueue.impl
import akka.actor.{ Actor, ActorLogging, ActorRef, Cancellable, Props }
import akka.event.LoggingReceive
import mesosphere.marathon.core.launchqueue.impl.RateLimiterActor.{
AddDelay,
ResetViableTasksDelays,
DecreaseDelay,
DelayUpdate,
GetDelay,
Rese... | natemurthy/marathon | src/main/scala/mesosphere/marathon/core/launchqueue/impl/RateLimiterActor.scala | Scala | apache-2.0 | 2,478 |
package controllers.gsn.api
case class OutputFormat(code:String) {
val formats=Seq("csv","json")
if (!formats.exists(_==code))
throw new IllegalArgumentException("Invalid format: "+code)
}
object Csv extends OutputFormat("csv")
object Json extends OutputFormat("json") | nkryvych/gsn | gsn-tools/gsn-services/app/controllers/gsn/api/Formats.scala | Scala | gpl-3.0 | 282 |
package com.lot.order.service
import scala.concurrent.duration.DurationInt
import com.lot.order.model.OrderJsonProtocol
import akka.actor.Actor
import akka.util.Timeout
import spray.routing.HttpService
import com.lot.utils.Configuration
import com.lot.utils.CORSSupport
import com.typesafe.config.ConfigFactory
import c... | thimmaiah/life_of_a_trade_scala | src/main/scala/com/lot/order/service/OrderRoutesActor.scala | Scala | apache-2.0 | 756 |
/*
* Copyright 2022 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | hmrc/nisp-frontend | app/uk/gov/hmrc/nisp/controllers/GARedirectController.scala | Scala | apache-2.0 | 1,013 |
/**
* 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 | perf/src/main/scala/kafka/perf/ProducerPerformance.scala | Scala | apache-2.0 | 12,216 |
package org.jetbrains.plugins.scala.codeInspection.packageNameInspection
import com.intellij.codeInspection.{LocalQuickFix, ProblemDescriptor}
import com.intellij.openapi.project.Project
import org.jetbrains.plugins.scala.settings._
/**
* @author Alexander Podkhalyuzin
*/
class EnablePerformanceProblemsQuickFix(pr... | triggerNZ/intellij-scala | src/org/jetbrains/plugins/scala/codeInspection/packageNameInspection/EnablePerformanceProblemsQuickFix.scala | Scala | apache-2.0 | 984 |
package org.elasticmq.metrics
import akka.actor.ActorRef
import akka.util.Timeout
import org.elasticmq.QueueStatistics
import org.elasticmq.actor.reply.ReplyActorRef
import org.elasticmq.msg.{GetQueueStatistics, ListQueues, LookupQueue}
import org.elasticmq.util.NowProvider
import scala.concurrent.{ExecutionContext, ... | adamw/elasticmq | core/src/main/scala/org/elasticmq/metrics/QueueMetricsOps.scala | Scala | apache-2.0 | 1,764 |
/*
* Copyright 2015 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 applicab... | arkadius/reliable-http-client | sample/test/src/test/scala/rhttpc/test/DeliveryResponseAfterRestartWithDockerSpec.scala | Scala | apache-2.0 | 6,297 |
package io.scalajs
import io.scalajs.nodejs.timers._
import scala.concurrent.duration.FiniteDuration
import scala.language.implicitConversions
import scala.scalajs.js
import scala.scalajs.js.annotation.JSGlobal
import scala.scalajs.js.|
/**
* nodejs package object
* @author lawrence.daniels@gmail.com
*/
packag... | scalajs-io/nodejs | app/common/src/main/scala/io/scalajs/nodejs/package.scala | Scala | apache-2.0 | 7,220 |
package scodec.protocols.pcap
import scala.concurrent.duration._
import scodec.bits.ByteOrdering
import scodec.Codec
import scodec.codecs._
import org.joda.time.DateTime
case class RecordHeader(
timestampSeconds: Long,
timestampMicros: Long,
includedLength: Long,
originalLength: Long) {
def timestamp: Date... | jrudnick/scodec-protocols | src/main/scala/scodec/protocols/pcap/RecordHeader.scala | Scala | bsd-3-clause | 1,030 |
package com.trafigura.chess
class ChessLayouts(trace: Boolean, m: Int, n: Int, pieces: Piece*) {
/**
* Determines whether the specified piece is not under theratening.
* @param p piece to be placed
* @param coord coordinate to be placed on
* @param pp specifies previously placed piece with its coordinate... | dobrynya/chepila | src/main/scala/com/trafigura/chess/ChessLayouts.scala | Scala | apache-2.0 | 1,745 |
/*
* Copyright (C) 2015 Original Work Marios Iliofotou
*
* This file is part of ReSurfAlt.
*
* ReSurfAlt 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... | finleyb/ReSurfAlt | src/test/scala/com/resurf/graph/RequestRepositoryTest.scala | Scala | gpl-2.0 | 887 |
package org.jetbrains.plugins.scala
package lang
package parser
package parsing
package xml.pattern
import com.intellij.lang.PsiBuilder
import org.jetbrains.plugins.scala.lang.parser.ScalaElementTypes
import com.intellij.psi.xml.XmlTokenType
import builder.ScalaPsiBuilder
/**
* @author Alexander Podkhalyuzin
* Date: ... | consulo/consulo-scala | src/org/jetbrains/plugins/scala/lang/parser/parsing/xml/pattern/EmptyElemTagP.scala | Scala | apache-2.0 | 1,270 |
trait X[+A]
trait Y[-B]
trait Z[C]
@main def Test = {
test[X]
test[Y]
test[Z]
}
| lampepfl/dotty | tests/run-macros/i8520/Test_2.scala | Scala | apache-2.0 | 87 |
/***********************************************************************
* Copyright (c) 2013-2020 Commonwealth Computer Research, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and... | aheyne/geomesa | geomesa-utils/src/main/scala/org/locationtech/geomesa/utils/classpath/ServiceLoader.scala | Scala | apache-2.0 | 2,947 |
package io.flow.event.v2
import com.amazonaws.auth.AWSCredentialsProviderChain
import com.amazonaws.services.dynamodbv2.streamsadapter.StreamsWorkerFactory
import com.amazonaws.services.dynamodbv2.streamsadapter.model.RecordAdapter
import com.amazonaws.services.kinesis.clientlibrary.exceptions.{InvalidStateException, ... | flowcommerce/lib-event | app/io/flow/event/v2/DynamoStreamConsumer.scala | Scala | mit | 6,085 |
/*
* Copyright 2015 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... | pacenick/http-verbs | src/test/scala/uk/gov/hmrc/play/audit/http/connector/AuditConnectorSpec.scala | Scala | apache-2.0 | 10,656 |
package com.karasiq.scalajsbundler.compilers
import com.github.sommeri.less4j.core.DefaultLessCompiler
import com.karasiq.scalajsbundler.ScalaJSBundler.PageTypedContent
import scala.language.postfixOps
class Less4jCompiler extends AssetCompiler {
override def compile(contents: Seq[PageTypedContent]): String = {
... | Karasiq/sbt-scalajs-bundler | src/main/scala/com/karasiq/scalajsbundler/compilers/Less4jCompiler.scala | Scala | mit | 429 |
/**
* This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]].
*/
// DO NOT EDIT MANUALLY
package sbt.internal.langserver.codec
import _root_.sjsonnew.{ Unbuilder, Builder, JsonFormat, deserializationError }
trait SaveOptionsFormats { self: sjsonnew.BasicJsonProtocol =>
implicit lazy va... | sbt/sbt | protocol/src/main/contraband-scala/sbt/internal/langserver/codec/SaveOptionsFormats.scala | Scala | apache-2.0 | 1,092 |
package lila
import lila.db.JsTube
package object mod extends PackageObject with WithPlay {
object tube {
private[mod] implicit lazy val modlogTube =
Modlog.tube inColl Env.current.logColl
}
}
| JimmyMow/lila | modules/mod/src/main/package.scala | Scala | mit | 211 |
package com.danielasfregola.twitter4s.providers
import com.danielasfregola.twitter4s.entities.{AccessToken, ConsumerToken}
trait TokenProvider {
val consumerToken: ConsumerToken
val accessToken: AccessToken
}
| DanielaSfregola/twitter4s | src/main/scala/com/danielasfregola/twitter4s/providers/TokenProvider.scala | Scala | apache-2.0 | 215 |
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.