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 com.soteradefense.datawake.trails.topology.search.data
import backtype.storm.tuple.Values
import com.soteradefense.datawake.trails.data.StormData
/**
* Helper Class for parsing a new Datawake term
* @param org The org it belongs to
* @param domain The domain it belongs to
* @param trail The trail it belon... | Sotera/datawake-prefetch | trail-specific-search/src/main/scala/com/soteradefense/datawake/trails/topology/search/data/DatawakeTerm.scala | Scala | apache-2.0 | 652 |
/*
Copyright (c) 2016, Rice University
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2.... | agrippa/spark-swat | swat/src/main/scala/org/apache/spark/rdd/cl/CodeGenUtil.scala | Scala | bsd-3-clause | 6,772 |
package io.skyfii.mandrill.model
// See https://mandrillapp.com/api/docs/users.JSON.html#method=ping
case class Error(status: String,
code: Int,
name: String,
message: String)
| skyfii/skyfii-mandrill | src/main/scala/io/skyfii/mandrill/model/Error.scala | Scala | apache-2.0 | 228 |
package com.github.morikuni.locest.util
/** 識別可能なオブジェクト。
*
* @tparam Id 識別子の型
* @tparam Prop 扱う属性の型
*/
trait Entity[Id <: Identifier[_], Prop <: Property] {
val id: Id
val property: Prop
override def hashCode: Int = id.hashCode
override def equals(other: Any): Boolean = other match {
case that: E... | morikuni/locest | util/src/main/scala/com/github/morikuni/locest/util/Entity.scala | Scala | mit | 426 |
/*
* Copyright (c) 2014-2021 by The Monix Project Developers.
* See the project homepage at: https://monix.io
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache... | monifu/monifu | monix-tail/shared/src/main/scala/monix/tail/internal/IterantFoldLeftL.scala | Scala | apache-2.0 | 3,628 |
/*
* Copyright (C) 2011 <mathieu.Mathieu Leclaire at openmole.org>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later versio... | mathieuleclaire/prynt | src/main/scala/prynt/test/PatientResuts.scala | Scala | lgpl-3.0 | 993 |
// Generated by the Scala Plugin for the Protocol Buffer Compiler.
// Do not edit!
//
// Protofile syntax: PROTO3
package com.komanov.serialization.domain.protos.events
@SerialVersionUID(0L)
final case class PageMetaTagAddedPb(
path: String = "",
name: String = "",
value: String = ""
) extends com.t... | dkomanov/scala-serialization | scala-serialization/src/main/scala/com/komanov/serialization/domain/protos/events/PageMetaTagAddedPb.scala | Scala | mit | 5,197 |
package funpep.server
import scala.concurrent.ExecutionContext.Implicits._
import scalaz._
import scalaz.concurrent._
import scalaz.stream._
import scalaz.syntax.functor._
import org.http4s._
import org.http4s.server.middleware._
import org.http4s.server.blaze._
import net.bmjames.opts.{ execParser, info }
import ... | agjacome/funpep | server/src/main/scala/funpep/server/FunpepServer.scala | Scala | mit | 2,142 |
package org.scalatest.examples.suite.oneargtest
import org.scalatest.fixture
import java.io._
class ExampleSuite extends fixture.Suite {
case class FixtureParam(file: File, writer: FileWriter)
def withFixture(test: OneArgTest) = {
// create the fixture
val file = File.createTempFile("hello", "world")
... | svn2github/scalatest | examples/src/main/scala/org/scalatest/examples/suite/oneargtest/ExampleSuite.scala | Scala | apache-2.0 | 905 |
package sledtr.section
import org.scalatest.FunSuite
import java.text.SimpleDateFormat
class Ch2SectionTest extends FunSuite {
test("レスをバラバラにする") {
var m = Ch2Res("", 0, "俺より強い名無しに会いにいく<><>2010/09/25(土) 20:25:03 ID:G3NorCXq0<> おいw<>")
var f = new SimpleDateFormat("yyyy/MM/dd kk:mm:ss")
(m: @unchecked) ma... | K2Da/sledtr | src/test/scala/sledtr/section/Ch2SectionTest.scala | Scala | gpl-3.0 | 1,073 |
/*
* 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
* distrib... | fusepoolP3/p3-silk | silk-workbench-outdated/src/main/scala/de/fuberlin/wiwiss/silk/workbench/lift/snippet/GenerateLinksDialog.scala | Scala | apache-2.0 | 2,187 |
package com.github.sparkfy.recovery
import com.github.sparkfy.serializer.Serializer
/**
* Implementation of this class can be plugged in as recovery mode alternative.
*/
abstract class RecoveryFactory(conf: Map[String, String], serializer: Serializer) {
/**
* PersistenceEngine defines how the persistent data(... | sparkfy/sparkfy | sparkfy-common/src/main/scala/com/github/sparkfy/recovery/RecoveryFactory.scala | Scala | apache-2.0 | 626 |
package org.elastic.rest.scala.driver
import org.elastic.rest.scala.driver.RestBase._
import org.elastic.rest.scala.driver.RestBaseRuntimeTyped._
import org.elastic.rest.scala.driver.utils.NoJsonHelpers._
import org.elastic.rest.scala.driver.test_utils.SampleResources._
import org.elastic.rest.scala.driver.test_... | Alex-At-Home/rest_client_library | rest_scala_core/jvm/src/test/scala/org/elastic/rest/scala/driver/RestBaseAsyncTests.scala | Scala | apache-2.0 | 9,567 |
package nz.ubermouse.hummingbirdsyncer.printers
import nz.ubermouse.hummingbirdsyncer.api.Trakt.TraktActivity
import com.typesafe.scalalogging.slf4j.Logging
/**
* Created by Taylor on 18/07/14.
*/
object TraktActivityPrinter extends Logging {
def apply(activities:List[TraktActivity]) {
for(activity <- activi... | UberMouse/TraktToHummingbird | src/main/scala/nz/ubermouse/hummingbirdsyncer/printers/TraktActivityPrinter.scala | Scala | mit | 730 |
/*
* The MIT License
*
* Copyright (c) 2016 Fulcrum Genomics LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to us... | fulcrumgenomics/fgbio | src/main/scala/com/fulcrumgenomics/vcf/ByIntervalListVariantContextIterator.scala | Scala | mit | 6,710 |
package main.scala.proofdisplay
import org.scalajs.dom
import org.scalajs.dom.html
import dom.document
import scala.scalajs.js.annotation.JSExportTopLevel
import proofdisplay.ProverStub
object TestObject {
def main(args: Array[String]): Unit = {
// appendPar(document.body, "$$\\\\mathcal{test}$$")
}
de... | bgroenks96/PropLogic | webx/src/main/scala/proofdisplay/TestObject.scala | Scala | mit | 1,263 |
/*
* 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-2.0
*
... | adarro/ddo-calc | incubating/toad-api/src/main/scala/io/truthencode/toad/config/Bootstrap.scala | Scala | apache-2.0 | 4,202 |
package rpgboss.editor.dialog.db
import rpgboss.editor._
import rpgboss.editor.uibase._
import rpgboss.editor.dialog.db.components._
import rpgboss.editor.uibase.SwingUtils._
import scala.swing._
import scala.swing.event._
import rpgboss.editor.dialog._
import rpgboss.model._
import rpgboss.model.Constants._
import ne... | DrDub/rpgboss | desktop/src/main/scala/rpgboss/editor/dialog/db/SkillsPanel.scala | Scala | agpl-3.0 | 2,842 |
package at.forsyte.apalache.tla.typecheck.passes
import at.forsyte.apalache.infra.ExceptionAdapter
import at.forsyte.apalache.infra.passes.{Pass, PassOptions, TerminalPassWithTlaModule, WriteablePassOptions}
import at.forsyte.apalache.tla.imp.passes.{SanyParserPass, SanyParserPassImpl}
import com.google.inject.Abstrac... | konnov/apalache | tla-types/src/main/scala/at/forsyte/apalache/tla/typecheck/passes/TypeCheckerModule.scala | Scala | apache-2.0 | 1,455 |
/*
* The MIT License (MIT)
*
* Copyright (c) 2016 Algolia
* http://www.algolia.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... | algolia/algoliasearch-client-scala | src/main/scala/algolia/objects/InsidePolygon.scala | Scala | mit | 1,756 |
/*
* 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 ... | saltstar/spark | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala | Scala | apache-2.0 | 40,249 |
package cucumber.runtime
import org.junit.{Test, Assert}
import Assert._
import collection.JavaConverters._
import _root_.gherkin.I18n
import gherkin.formatter.model.Tag
class ScalaDslTest {
@Test
def emptyBefore {
var called = false
object Befores extends ScalaDsl with EN {
Before {
call... | mbellani/cucumber-jvm | scala/src/test/scala/cucumber/runtime/ScalaDslTest.scala | Scala | mit | 3,770 |
import scalaz.\\/
/**
* Created by denis on 9/4/16.
*/
class GenerationException(number: Long, message: String)
extends Exception(message)
object ScalazDisjunction {
def queryNextNumberE: Exception \\/ Long = {
val source = Math.round(Math.random * 100)
if (source <= 60) \\/.right(source)
else \\... | denisftw/advanced-scala-code | scalaz/src/main/scala/ScalazDisjunction.scala | Scala | apache-2.0 | 1,080 |
package argonaut.internal
import argonaut._
import scala.collection.immutable.{ SortedMap, MapLike }
object Macros extends MacrosCompat {
def materializeCodecImpl[T: c.WeakTypeTag](c: Context): c.Expr[CodecJson[T]] = {
import c.universe._
val tpe = weakTypeOf[T]
val encode = materializeEncodeImpl[T](c)
... | etorreborre/argonaut | src/main/scala/argonaut/internal/Macros.scala | Scala | bsd-3-clause | 3,364 |
package breeze.linalg
/*
Copyright 2012 David Hall
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... | claydonkey/breeze | math/src/main/scala/breeze/linalg/Vector.scala | Scala | apache-2.0 | 32,964 |
package models.jbehave
import java.io.File
import org.clapper.classutil.ClassFinder
import play.api.libs.json.{Json, JsValue}
import org.jbehave.core.steps.{StepCandidate, Steps}
import org.jbehave.core.configuration.MostUsefulConfiguration
import scala.collection.JavaConversions._
import com.technologyconversations.b... | TechnologyConversations/TechnologyConversationsBdd | app/models/jbehave/JBehaveSteps.scala | Scala | apache-2.0 | 4,327 |
/*
* The MIT License
*
* Copyright 2014 Kamnev Georgiy (nt.gocha@gmail.com).
*
* Данная лицензия разрешает, безвозмездно, лицам, получившим копию данного программного
* обеспечения и сопутствующей документации (в дальнейшем именуемыми "Программное Обеспечение"),
* использовать Программное Обеспечение без огра... | gochaorg/odt-export | src/main/scala/xyz/cofe/odtexport/odt/xtest/StyleProperty.scala | Scala | mit | 5,979 |
/*
* Copyright 2017 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 agreed to i... | spinnaker/kayenta | kayenta-judge/src/test/scala/com/netflix/kayenta/judge/UtilsSuite.scala | Scala | apache-2.0 | 4,118 |
package foo.bar
import org.junit._
import org.junit.Assert._
class Basic
{
val foo = new Foo
@Test
def checkBind(): Unit =
{
try { assertTrue( foo.eval("3") == 3) }
catch { case e => e.printStackTrace; throw e}
}
}
| jamesward/xsbt | sbt/src/sbt-test/compiler-project/run-test/src/test/scala/Basic.scala | Scala | bsd-3-clause | 226 |
package com.twitter.finagle.http
import com.twitter.conversions.time._
import org.jboss.netty.handler.codec.http.DefaultCookie
import org.junit.runner.RunWith
import org.scalatest.FunSuite
import org.scalatest.junit.JUnitRunner
import scala.collection.JavaConverters._
@RunWith(classOf[JUnitRunner])
class CookieTest e... | mkhq/finagle | finagle-base-http/src/test/scala/com/twitter/finagle/http/CookieTest.scala | Scala | apache-2.0 | 8,196 |
package org.jetbrains.plugins.scala
package lang.lexer
import com.intellij.openapi.editor.ex.util.{LexerEditorHighlighter, SegmentArrayWithData}
import com.intellij.openapi.editor.impl.EditorImpl
import com.intellij.testFramework.fixtures.CodeInsightTestFixture
import org.jetbrains.plugins.scala.base.EditorActionTestB... | loskutov/intellij-scala | test/org/jetbrains/plugins/scala/lang/lexer/IncrementalLexerHighlightingTest.scala | Scala | apache-2.0 | 7,016 |
package it.nerdammer.spark.hbase
import java.util
import it.nerdammer.spark.hbase.conversion.{SingleColumnFieldWriter, FieldWriter}
import scala.reflect.ClassTag
import scala.util.Random
trait SaltingProvider[T] extends Serializable{
def salting: Array[T]
def salt(rowKey: Array[Byte]): T
protected def veri... | nerdammer/spark-hbase-connector | src/main/scala/it/nerdammer/spark/hbase/SaltingProvider.scala | Scala | apache-2.0 | 2,408 |
package scorex.app.api.http
import java.nio.charset.StandardCharsets
import play.api.libs.json.Json
import scorex.account.{Account, PublicKeyAccount}
import scorex.app.Controller
import scorex.crypto.{Base58, SigningFunctionsImpl}
import spray.routing.HttpService
import scala.util.{Failure, Success, Try}
trait Addr... | pozharko/Scorex-Lagonaki | src/main/scala/scorex/app/api/http/AddressHttpService.scala | Scala | cc0-1.0 | 7,177 |
/*
* 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/datasources/v2/CreateNamespaceExec.scala | Scala | apache-2.0 | 2,229 |
import sbt._
import Keys._
import Scope.{ GlobalScope, ThisScope }
object LaunchProguard {
lazy val Proguard = config("proguard") hide;
lazy val configurationFile = settingKey[File]("Location of the generated proguard configuration file.")
lazy val proguard = taskKey[File]("Produces the final compacted jar that... | xeno-by/old-scalameta-sbt | project/Proguard.scala | Scala | bsd-3-clause | 6,816 |
package katas.scala.doors
import org.junit.Test
import org.scalatest.Matchers
class Doors8 extends Matchers {
@Test def `end state of doors`() {
walkDoors(amount = 1) should equal(Seq(true))
walkDoors(amount = 2) should equal(Seq(true, false))
walkDoors(amount = 3) should equal(Seq(true, false, false))
walk... | dkandalov/katas | scala/src/katas/scala/doors/Doors8.scala | Scala | unlicense | 968 |
/*
* Copyright 2015 the original author or authors.
* @https://github.com/scouter-project/scouter
*
* 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... | yuyupapa/OpenSource | scouter.server/src/scouter/server/db/TextRD.scala | Scala | apache-2.0 | 1,421 |
/**
*
* Copyright 2014 Lukas Karas, Avast a.s. <karas@avast.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 required b... | avast/BigMap | src/main/scala/com/avast/bigmap/TsvMap.scala | Scala | apache-2.0 | 2,132 |
package views.disposal_of_vehicle.priv
import composition.TestHarness
import helpers.disposal_of_vehicle.CookieFactoryForUISpecs
import org.openqa.selenium.WebDriver
import org.scalatest.selenium.WebBrowser
import WebBrowser.go
import WebBrowser.pageSource
import WebBrowser.pageTitle
import pages.disposal_of_vehicle.B... | dvla/vehicles-online | test/views/disposal_of_vehicle/priv/DisposeSuccessIntegrationSpec.scala | Scala | mit | 1,382 |
/*
* Copyright 2017-2020 Aleksey Fomkin
*
* 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 ag... | fomkin/korolev | modules/korolev/src/main/scala/korolev/internal/ComponentInstance.scala | Scala | apache-2.0 | 13,331 |
/*
* 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 ... | bwsw/sj-platform | core/sj-common/src/main/scala/com/bwsw/sj/common/si/model/stream/SjStream.scala | Scala | apache-2.0 | 7,273 |
package sri.mobile.examples.router.components
import sri.core.ElementFactory._
import sri.core.ReactElement
import sri.mobile.examples.router.RouterExampleApp.{Fourth, Second}
import sri.mobile.examples.router.routes.ThirdModule
import sri.universal.components._
import sri.universal.router
import sri.universal.router.... | hamazy/sri | mobile-examples/src/main/scala/sri/mobile/examples/router/components/HomeScreen.scala | Scala | apache-2.0 | 2,567 |
/**
* Copyright (C) 2014 TU Berlin (peel@dima.tu-berlin.de)
*
* 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... | akunft/peel | peel-core/src/main/scala/org/peelframework/core/results/model/Experiment.scala | Scala | apache-2.0 | 3,646 |
package modules
import com.google.inject.name.Named
import com.google.inject.{ AbstractModule, Provides }
import com.mohiva.play.silhouette.api.actions.{ SecuredErrorHandler, UnsecuredErrorHandler }
import com.mohiva.play.silhouette.api.crypto._
import com.mohiva.play.silhouette.api.repositories.AuthInfoRepository
imp... | hnrklssn/game-check-match | app/modules/SilhouetteModule.scala | Scala | apache-2.0 | 17,664 |
package pl.combosolutions.backup
trait Executable[T <: Executable[T]] extends Serializable {
def run: Async[Result[T]]
def digest[U](implicit interpreter: Result[T]#Interpreter[U]): Async[U]
}
| MateuszKubuszok/BackupDSL | modules/common/src/main/scala/pl/combosolutions/backup/Executable.scala | Scala | mit | 200 |
package de.qualitune.ast
/**
* @author Max Leuthaeuser
* @since 27.02.12
*/
case class ASTElement() | max-leuthaeuser/CPSTextInterpreter | src/main/scala/de/qualitune/ast/ASTElement.scala | Scala | gpl-3.0 | 109 |
/*
* 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 ... | dotunolafunmiloye/spark | streaming/src/main/scala/org/apache/spark/streaming/StreamingContext.scala | Scala | apache-2.0 | 19,947 |
package io.buoyant.linkerd
package protocol
import com.fasterxml.jackson.annotation.{JsonIgnore, JsonSubTypes, JsonTypeInfo}
import com.fasterxml.jackson.core.{JsonParser, TreeNode}
import com.fasterxml.jackson.databind.annotation.JsonDeserialize
import com.fasterxml.jackson.databind.{DeserializationContext, JsonDeser... | denverwilliams/linkerd | linkerd/protocol/http/src/main/scala/io/buoyant/linkerd/protocol/HttpConfig.scala | Scala | apache-2.0 | 9,629 |
/**
* 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
* distributed ... | Tony-Zhang03/kafka | core/src/test/scala/integration/kafka/api/QuotasTest.scala | Scala | apache-2.0 | 9,321 |
/*
* 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/CommentBlock.scala | Scala | apache-2.0 | 1,469 |
package deploymentzone.actor.unit
import deploymentzone.actor._
import org.scalatest.{WordSpecLike, Matchers}
import akka.testkit.{ImplicitSender, TestActorRef}
import com.typesafe.config.ConfigFactory
import akka.actor.ActorInitializationException
class StatsActorSpec
extends TestKit("stats-actor-unit-spec")
wit... | jamesmulcahy/akka-actor-statsd | src/test/scala/deploymentzone/actor/unit/StatsActorSpec.scala | Scala | mit | 2,585 |
// Copyright (C) 2015, codejitsu.
package net.codejitsu.tasks
import net.codejitsu.tasks.dsl.Tasks._
import net.codejitsu.tasks.dsl._
/**
* Upload file to remote host(s).
*
* @param source source file to upload
* @param target destination hosts
* @param destinationPath path on destination hosts
* @param usingS... | codejitsu/tasks | tasks-dsl/src/main/scala/net/codejitsu/tasks/Upload.scala | Scala | apache-2.0 | 1,951 |
package com.v_standard.utils
import java.util.concurrent.atomic.AtomicInteger
/**
* カウンタークラス。
*/
class Counter(initVal:Int = 0) {
/** カウント値 */
private val count = new AtomicInteger(initVal)
/**
* インクリメントして値を取得。
*
* @return 値
*/
def get(): Int = count.incrementAndGet()
}
| VanishStandard/scalikejdbc-orm | src/main/scala/com/v_standard/utils/Counter.scala | Scala | bsd-3-clause | 348 |
package fpinscala.answers.datastructures
sealed trait Tree[+A]
case class Leaf[A](value: A) extends Tree[A]
case class Branch[A](left: Tree[A], right: Tree[A]) extends Tree[A]
object Tree {
def size[A](t: Tree[A]): Int = t match {
case Leaf(_) => 1
case Branch(l,r) => 1 + size(l) + size(r)
}
/*
W... | peterbecich/fpinscala | answers/src/main/scala/fpinscala/datastructures/Tree.scala | Scala | mit | 2,944 |
/*
* Licensed to Intel Corporation under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* Intel Corporation licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use t... | SeaOfOcean/BigDL | dl/src/test/scala/com/intel/analytics/bigdl/models/utils/ModelBroadcastSpec.scala | Scala | apache-2.0 | 1,467 |
//
// Logger.scala -- Scala object Logger
// Project OrcScala
//
// Created by jthywiss on Oct 15, 2018.
//
// Copyright (c) 2019 The University of Texas at Austin. All rights reserved.
//
// Use and redistribution of this file is governed by the license terms in
// the LICENSE file found in the project's top-level dir... | orc-lang/orc | OrcScala/src/orc/values/sites/Logger.scala | Scala | bsd-3-clause | 559 |
/***********************************************************************
* Copyright (c) 2013-2019 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... | elahrvivaz/geomesa | geomesa-fs/geomesa-fs-storage/geomesa-fs-storage-common/src/main/scala/org/locationtech/geomesa/fs/storage/common/jobs/StorageConfiguration.scala | Scala | apache-2.0 | 6,338 |
package controllers
import java.util.concurrent.CountDownLatch
import play.api.mvc._
import play.libs.Akka
import rros.{SocketListener, Response, RROSProtocol}
import rros.play.{PublisherSocketAdapter, ChannelManagementTableImpl, ReceiverSocketAdapter}
import scala.util.Random
/**
* Created by namnguyen on 3/12/15.... | namhnguyen/RROS | examples/play_socket_server/app/controllers/Sockets.scala | Scala | apache-2.0 | 2,198 |
package com.orendainx.trucking.storm.bolts
import java.util
import com.orendainx.trucking.commons.models.{EnrichedTruckAndTrafficData, TruckEventTypes, WindowedDriverStats}
import com.typesafe.scalalogging.Logger
import org.apache.storm.task.{OutputCollector, TopologyContext}
import org.apache.storm.topology.OutputFi... | orendain/trucking-iot | storm-topology/src/main/scala/com/orendainx/trucking/storm/bolts/DataWindowingBolt.scala | Scala | apache-2.0 | 2,526 |
/*
* 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 ... | lincoln-lil/flink | flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/planner/plan/batch/sql/agg/GroupWindowTest.scala | Scala | apache-2.0 | 14,021 |
/*
* 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 | sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/StringExpressionsSuite.scala | Scala | apache-2.0 | 39,491 |
/*
Copyright 2012 Twitter, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distr... | twitter/scalding | scalding-core/src/main/scala/com/twitter/scalding/typed/ValuePipe.scala | Scala | apache-2.0 | 4,402 |
package org.automanlang.core.info
import java.util.{Date, UUID}
import org.automanlang.core.info.QuestionType.QuestionType
import org.automanlang.core.scheduler.Task
import scala.slick.driver.SQLiteDriver.simple.MappedColumnType
case class QuestionInfo(computation_id: UUID,
name: String,
... | dbarowy/AutoMan | libautoman/src/main/scala/org/automanlang/core/info/QuestionInfo.scala | Scala | gpl-2.0 | 1,505 |
package varys.framework.master
import akka.actor._
import akka.remote.{DisassociatedEvent, RemotingLifecycleEvent}
import akka.routing._
import java.text.SimpleDateFormat
import java.util.Date
import java.util.concurrent.atomic._
import java.util.concurrent.ConcurrentHashMap
import scala.collection.mutable.{ArrayBuf... | mosharaf/varys | core/src/main/scala/varys/framework/master/Master.scala | Scala | apache-2.0 | 20,123 |
/*
* 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 ... | akopich/spark | examples/src/main/scala/org/apache/spark/examples/SparkALS.scala | Scala | apache-2.0 | 4,848 |
package lexer
sealed trait Tree
case class Leaf(value: String) extends Tree
case class Branch(operation:Char, left: Tree, right: Tree) extends Tree
object Auxiliary {
def removeWhite(string: String):String =
string filter ((x:Char) => x != ' ')
def separateByTokens(string: String, tokens: List[Char]): Li... | Bolt64/my_code | scala/lexer.scala | Scala | mit | 2,760 |
package com.sungevity.cmaes
import breeze.linalg._
import breeze.linalg.eigSym.EigSym
import breeze.numerics._
import com.sungevity.cmaes
/**
* A minimalistic implementation of Covariance Matrix Adaptation Evolution Strategy. For algorithm description please
* visit [[https://en.wikipedia.org/wiki/CMA-ES]]. This ... | VolodymyrOrlov/cma-es-scala | src/main/scala/com/sungevity/cmaes/CMAEvolutionStrategy.scala | Scala | apache-2.0 | 4,965 |
/*
* Copyright 2016 The BigDL Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | jenniew/BigDL | spark/dl/src/main/scala/com/intel/analytics/bigdl/utils/tf/loaders/SqrtGrad.scala | Scala | apache-2.0 | 1,566 |
package scala.slick.jdbc.meta
import scala.slick.jdbc.{ResultSetInvoker, JdbcType}
/**
* A wrapper for a row in the ResultSet returned by DatabaseMetaData.getUDTs().
*/
case class MUDT(
typeName: MQName, className: String, sqlType: Int, remarks: String, baseType: Option[Short]) {
def sqlTypeName = JdbcType.typ... | boldradius/slick | src/main/scala/scala/slick/jdbc/meta/MUDT.scala | Scala | bsd-2-clause | 800 |
package org.aguo.civsim.controller
import org.aguo.civsim.model.World
import org.aguo.civsim.model.domain._
import org.aguo.civsim.view._
object ExamineController {
def handleInput(input: String, world: World): World = {
val domain = world.domain
val population = domain.population
val territory = domain... | aguo777/civ-sim | src/main/scala/org/aguo/civsim/controller/ExamineController.scala | Scala | mit | 685 |
package redis.api.sortedsets
import akka.util.ByteString
import redis._
import redis.api.{Aggregate, Limit, SUM, ZaddOption}
import redis.protocol.RedisReply
case class Zadd[K, V](key: K, options: Seq[ZaddOption], scoreMembers: Seq[(Double, V)])
(implicit keySeria: ByteStringSerializer[K], conver... | etaty/rediscala | src/main/scala/redis/api/SortedSets.scala | Scala | apache-2.0 | 13,348 |
package sublimeSpam.ui
import scala.swing._
import Swing._
import java.awt.Color
import sublimeSpam._
import ui.MainMenu._
class ResultPanel(trackPath: String, trackDesc: String, game: Game, previousBestOption: Option[(String, (Int, String, String))]) extends BorderPanel {
minimumSize = new Dimension(wi... | Berthur/SublimeSpam | src/sublimeSpam/ui/ResultPanel.scala | Scala | gpl-3.0 | 4,148 |
package rewriting
import benchmarks.MolecularDynamics
import ir._
import ir.ast._
import lift.arithmetic.SizeVar
import opencl.executor.{Execute, Executor}
import opencl.ir._
import opencl.ir.pattern.ReduceSeq
import org.junit.Assert._
import org.junit.{AfterClass, BeforeClass, Test}
import rewriting.macrorules.MacroR... | lift-project/lift | src/test/rewriting/TestRewriteMD.scala | Scala | mit | 3,852 |
/*
* 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 ... | poffuomo/spark | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/StarSchemaDetection.scala | Scala | apache-2.0 | 15,013 |
package tutorial.webapp
import scala.scalajs.js.JSApp
object TutorialApp extends JSApp {
case class Interval(length: Int, max: Int) {
def add(value: Int) = Interval(length + 1, math.max(max, value))
}
private val emptyInterval = Interval(0, Int.MinValue)
private def calcNextState(intervals: List[Interval... | enpassant/scalajs | src/main/scala/tutorial/webapp/TutorialApp.scala | Scala | apache-2.0 | 1,153 |
/*
* Copyright 2019 Spotify AB.
*
* 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 ... | regadas/scio | scio-google-cloud-platform/src/main/scala/com/spotify/scio/bigtable/TableAdmin.scala | Scala | apache-2.0 | 10,506 |
/* __ *\\
** ________ ___ / / ___ __ ____ Scala.js Test Suite **
** / __/ __// _ | / / / _ | __ / // __/ (c) 2013, LAMP/EPFL **
** __\\ \\/ /__/ __ |/ /__/ __ |/_// /_\\ \\ http://scala-js.org/ **
** /____/\\___/... | andreaTP/scala-js | test-suite/src/test/scala/org/scalajs/testsuite/javalib/lang/StringBufferTest.scala | Scala | bsd-3-clause | 11,358 |
/*
* Copyright (c) 2014, Brook 'redattack34' Heisler
* 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, t... | Redattack34/ModularRayguns | src/main/scala/com/castlebravostudios/rayguns/api/items/RaygunChamber.scala | Scala | bsd-3-clause | 1,812 |
package edu.gemini.ui.workspace.scala
import edu.gemini.ui.workspace.IShell
import java.util.logging.{Level, Logger}
import javax.swing.SwingUtilities
import java.io.File
object RichShell {
private val log = Logger.getLogger(classOf[RichShell[_]].getName)
}
// N.B. this isn't threadsafe. It expects to be on the UI... | arturog8m/ocs | bundle/edu.gemini.ui.workspace/src/main/scala/edu/gemini/ui/workspace/scala/RichShell.scala | Scala | bsd-3-clause | 4,455 |
/*
* Copyright 2017 Guy Van den Broeck <guyvdb@cs.ucla.edu>
*
* 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 ... | UCLA-StarAI/ScalaDD | src/test/scala/edu/ucla/cs/starai/CompilationSpec.scala | Scala | apache-2.0 | 2,526 |
package tests
private object Private {
def bar = ???
}
| triplequote/intellij-scala | scala/scala-impl/testdata/rename3/privateMemberSamePackage/before/tests/Private.scala | Scala | apache-2.0 | 58 |
package no.ntnu.httpmock.servlet
import com.orbekk.logging.Logger
import javax.servlet.http.HttpServlet
import javax.servlet.http.HttpServletRequest
import javax.servlet.http.HttpServletResponse
import no.ntnu.httpmock.Mock
import no.ntnu.httpmock.MockProvider
import no.ntnu.httpmock.DummyMockResponse
class MockServl... | orbekk/HttpMock | src/main/scala/no/ntnu/httpmock/servlet/MockServlet.scala | Scala | apache-2.0 | 1,264 |
package org.labrad.registry
import java.io.{ByteArrayOutputStream, File, FileInputStream, FileOutputStream}
import java.net.{URLDecoder, URLEncoder}
import java.nio.ByteOrder.BIG_ENDIAN
import java.nio.charset.StandardCharsets.UTF_8
import org.labrad.data._
import org.labrad.types._
import scala.annotation.tailrec
/*... | labrad/scalabrad | manager/src/main/scala/org/labrad/registry/FileStore.scala | Scala | mit | 5,307 |
package org.jetbrains.plugins.scala
package lang
package psi
package impl
package base
package patterns
import com.intellij.lang.ASTNode
import com.intellij.psi._
import com.intellij.psi.scope.PsiScopeProcessor
import org.jetbrains.plugins.scala.extensions.PsiTypeExt
import org.jetbrains.plugins.scala.lang.lexer._
imp... | whorbowicz/intellij-scala | src/org/jetbrains/plugins/scala/lang/psi/impl/base/patterns/ScTypedPatternImpl.scala | Scala | apache-2.0 | 5,208 |
/**
* Copyright 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 required... | GitOutATown/ActorServiceRegistry | serviceRegistry/src/main/scala/com/comcast/csv/akka/serviceregistry/ServiceRegistry.scala | Scala | apache-2.0 | 5,913 |
package com.github.mdr.mash.evaluator
import com.github.mdr.mash.parser.AbstractSyntax.{ LookupExpr, ThisExpr }
import com.github.mdr.mash.runtime._
object LookupEvaluator extends EvaluatorHelper {
def evaluateLookupExpr(lookupExpr: LookupExpr)(implicit context: EvaluationContext): MashValue = {
val LookupExpr... | mdr/mash | src/main/scala/com/github/mdr/mash/evaluator/LookupEvaluator.scala | Scala | mit | 1,862 |
/*
* Copyright (c) 2013-2014 Telefónica Investigación y Desarrollo S.A.U.
*
* 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
*
* Unles... | telefonicaid/fiware-cosmos-platform | cosmos-api/app/es/tid/cosmos/api/auth/oauth2/InvalidProfileException.scala | Scala | apache-2.0 | 976 |
/**
* Copyright: Copyright (C) 2016, ATS Advanced Telematic Systems GmbH
* License: MPL-2.0
*/
package org.genivi.sota.data
import java.security.InvalidParameterException
import eu.timepit.refined.api.Refined
import org.scalacheck.{Arbitrary, Gen}
trait PackageIdGenerators {
/**
* For property based testin... | PDXostc/rvi_sota_server | common-test/src/main/scala/org/genivi/sota/data/PackageIdGenerators.scala | Scala | mpl-2.0 | 2,511 |
package web.protocols
import play.api.libs.json._
import play.api.libs.functional.syntax._ // Combinator syntax
sealed trait Error {
def code: Int
def message: JsValue
}
object Error {
case class BadRequest(message: JsValue) extends Error {
val code = 400
}
implicit val writes = new Writes[Error] {
... | OmniaGM/activator-spray-twitter | web/app/web/protocols/Error.scala | Scala | apache-2.0 | 441 |
/***********************************************************************
* Copyright (c) 2013-2016 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 ... | nagavallia/geomesa | geomesa-utils/src/main/scala/org/locationtech/geomesa/utils/geohash/RectangleGeoHashIterator.scala | Scala | apache-2.0 | 4,468 |
package org.jetbrains.plugins.scala
package lang
package parser
package parsing
package top
import com.intellij.lang.PsiBuilder
import org.jetbrains.plugins.scala.lang.lexer.ScalaTokenTypes
import org.jetbrains.plugins.scala.lang.parser.parsing.builder.ScalaPsiBuilder
import scala.annotation.tailrec
/**
* @author Al... | JetBrains/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/lang/parser/parsing/top/QualId.scala | Scala | apache-2.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"); yo... | wangcy6/storm_app | frame/kafka-0.11.0/kafka-0.11.0.1-src/core/src/test/scala/integration/kafka/api/SslProducerSendTest.scala | Scala | apache-2.0 | 1,135 |
package beam.agentsim.agents.choice.logit
import scala.util.Random
import org.scalatest.{Matchers, WordSpecLike}
class MultinomialLogitSpec extends WordSpecLike with Matchers {
"An MNL Model with standard data" must {
val utilityFunctions = Map(
"car" -> Map("intercept" -> UtilityFunctionOperation.Inter... | colinsheppard/beam | src/test/scala/beam/agentsim/agents/choice/logit/MultinomialLogitSpec.scala | Scala | gpl-3.0 | 6,450 |
package cloudcmd.common.adapters
// "s3://<aws id>@<bucket>?tier=2&tags=s3&secret=<aws secret>"
class S3Adapter extends IndexFilterAdapter(new DirectS3Adapter) {} | briangu/cloudcmd | common/src/main/scala/cloudcmd/common/adapters/S3Adapter.scala | Scala | apache-2.0 | 168 |
object Solution {
def sievePrimeGenerator(n: Int): (Array[Int], Array[Boolean]) = {
val nums = Array.fill(n + 1)(true)
nums(0) = false
nums(1) = false
val primes = for (i <- (2 to n).toIterator if nums(i)) yield {
var j = 2
while (i * j <= n) {
nums(i * j) = false
j += 1
... | advancedxy/hackerrank | project-euler/problem-58/SpiralPrimes.scala | Scala | mit | 1,515 |
class Casey1[T](val a: T) {
def isEmpty: Boolean = false
def isEmpty(x: T): Boolean = ???
def get: T = a
def get(x: T): String = ???
}
object Casey1 { def unapply[T](a: Casey1[T]) = a }
object Test {
def main(args: Array[String]): Unit = {
val c @ Casey1(x) = new Casey1(0)
assert(x == c.get)
}
}
| lampepfl/dotty | tests/pos/i1540b.scala | Scala | apache-2.0 | 318 |
package com.twitter.finagle.postgresql.machine
import com.twitter.finagle.postgresql.BackendMessage
import com.twitter.finagle.postgresql.BackendMessage.CommandTag
import com.twitter.finagle.postgresql.BackendMessage.DataRow
import com.twitter.finagle.postgresql.BackendMessage.RowDescription
import com.twitter.finagle... | twitter/finagle | finagle-postgresql/src/test/scala/com/twitter/finagle/postgresql/machine/SimpleQueryMachineSpec.scala | Scala | apache-2.0 | 7,178 |
package com.signalcollect.dcop.evaluation.bestresponse
import com.signalcollect.StateForwarderEdge
import com.signalcollect.interfaces.AggregationOperation
import com.signalcollect.ExecutionConfiguration
import com.signalcollect.Graph
import com.signalcollect.dcop.evaluation.candidates.BestResponseVertexBuilder
import... | gmazlami/dcop-maxsum | src/main/scala/com/signalcollect/dcop/evaluation/bestresponse/BRExecutor.scala | Scala | apache-2.0 | 2,305 |
/*
* The MIT License (MIT)
*
* Copyright (c) 2015 Enterprise Data Management Council
*
* 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... | edmcouncil/rdf-toolkit | src/test/scala/org/edmcouncil/rdf_toolkit/SesameRdfFormatterSpec.scala | Scala | mit | 4,553 |
/*
* 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 ... | kevinyu98/spark | sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/json/JsonSuite.scala | Scala | apache-2.0 | 98,218 |
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.