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 mesosphere.marathon.tasks
import java.io._
import javax.inject.Inject
import mesosphere.marathon.Protos._
import mesosphere.marathon.state.{ PathId, StateMetrics, Timestamp }
import mesosphere.marathon.{ Main, MarathonConf }
import com.codahale.metrics.MetricRegistry
import org.apache.log4j.Logger
import org.... | 14Zen/marathon | src/main/scala/mesosphere/marathon/tasks/TaskTracker.scala | Scala | apache-2.0 | 9,521 |
package com.sutol.scalgen.proj2
// Created by sutol on 14/04/2016. Part of scalgen.
object proj2 {
def main(args: Array[String]) {
val pop = new Pop2()
var num1: Int = 0
var num2: Int = 0
while (pop.step()) {
num1 = pop.getBest.genes & 1111
num2 = pop.getBes... | sutolll/scalgen | proj2/proj2.scala | Scala | mit | 450 |
package parser.json.detail
import parser.json.GenericJsonParser
import play.api.libs.json.JsValue
import models.Skimbo
import parser.json.providers.FacebookWallParser
object FacebookPostDetails extends GenericJsonParser {
override def asSkimbo(json: JsValue): Option[Skimbo] = FacebookWallParser.asSkimbo(json)
... | Froggies/Skimbo | app/parser/json/detail/FacebookPostDetails.scala | Scala | agpl-3.0 | 370 |
package contege.seqgen
import scala.collection.JavaConversions._
import scala.collection.mutable.Set
import scala.collection.mutable.Map
import java.util.ArrayList
import contege.ClassReader
import contege.Random
import contege.Atom
import contege.ConstructorAtom
import contege.MethodAtom
import contege.Stats
import c... | michaelpradel/ConTeGe | src/contege/seqgen/GetParamTask.scala | Scala | gpl-2.0 | 4,110 |
/*
* Copyright 2007-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 applica... | wsaccaco/lift | examples/example/src/main/scala/net/liftweb/example/lib/WebServices.scala | Scala | apache-2.0 | 3,312 |
package lore.compiler.feedback
import lore.compiler.core.Position
import lore.compiler.semantics.NamePath
import lore.compiler.types.{TupleType, Type}
object CoreFeedback {
object Trait {
case class NotFound(name: NamePath) extends Feedback.Error(Position.unknown) {
override def message: String = s"The co... | marcopennekamp/lore | compiler/src/lore/compiler/feedback/CoreFeedback.scala | Scala | mit | 1,525 |
package com.greencatsoft.d3.selection
import scala.scalajs.js
import scala.scalajs.js.UndefOr
import org.scalajs.dom.Node
trait DataDriven[A <: Node, B <: Selection[A, B]] extends js.Object {
import DataDriven._
def data[T](): js.Array[T] = js.native
def data[T](values: js.Array[T]): BoundSelection[A, B] = ... | sid-kap/scalajs-d3 | src/main/scala/com/greencatsoft/d3/selection/DataDriven.scala | Scala | apache-2.0 | 1,301 |
package com.twitter.inject.thrift.integration.http_server
import com.google.inject.{Provides, Singleton}
import com.twitter.finagle.thrift.ClientId
import com.twitter.inject.thrift.ThriftClientModule
import com.twitter.test.thriftscala.EchoService
import com.twitter.util.Future
import com.twitter.conversions.time._
o... | tom-chan/finatra | inject/inject-thrift-client/src/test/scala/com/twitter/inject/thrift/integration/http_server/EchoThriftClientModule.scala | Scala | apache-2.0 | 658 |
package org.woodyalen202
/**
* Created by lichuansun on 14-6-24.
*/
trait TestTrait {
}
| woodyalen202/based-scala | src/main/java/org/woodyalen202/TestTrait.scala | Scala | mit | 92 |
/* Copyright 2009-2021 EPFL, Lausanne */
package stainless
package extraction
package object inlining {
object trees extends Trees with inox.ast.SimpleSymbols {
case class Symbols(
functions: Map[Identifier, FunDef],
sorts: Map[Identifier, ADTSort]
) extends SimpleSymbols with StainlessAbstract... | epfl-lara/stainless | core/src/main/scala/stainless/extraction/inlining/package.scala | Scala | apache-2.0 | 1,567 |
package de.htwg.zeta.server.model.modelValidator.validator.rules.metaModelIndependent
import de.htwg.zeta.common.models.project.instance.elements.NodeInstance
import de.htwg.zeta.server.model.modelValidator.validator.rules.SingleNodeRule
/**
* This file was created by Tobias Droth as part of his master thesis at HTW... | Zeta-Project/zeta | api/server/app/de/htwg/zeta/server/model/modelValidator/validator/rules/metaModelIndependent/NodesAttributesNamesNotEmpty.scala | Scala | bsd-2-clause | 748 |
/*
* 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... | monix/monix | monix-execution/shared/src/test/scala/monix/execution/AsyncQueueSuite.scala | Scala | apache-2.0 | 10,251 |
import leon.instrumentation._
import leon.collection._
import leon.lang._
import ListSpecs._
import leon.annotation._
import conctrees.ConcTrees._
object Conqueue {
def max(x: BigInt, y: BigInt): BigInt = if (x >= y) x else y
def abs(x: BigInt): BigInt = if (x < 0) -x else x
sealed abstract class ConQ[T] {
... | epfl-lara/leon | testcases/lazy-datastructures/ManualnOutdated/Conqueue-Manual.scala | Scala | gpl-3.0 | 9,047 |
/*
* This file is part of Kiama.
*
* Copyright (C) 2014-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 ... | solomono/kiama | library/src/org/kiama/relation/RelationLike.scala | Scala | gpl-3.0 | 6,257 |
package chrome.utils
import chrome.app.runtime.Runtime
import chrome.app.runtime.bindings.{LaunchData, Request}
trait ChromeApp {
def main(args: Array[String]): Unit = {
Runtime.onLaunched.listen(onLaunched)
Runtime.onRestarted.listen((_) => onRestart)
Runtime.onEmbedRequested.listen(onEmbedRequested)
... | lucidd/scala-js-chrome | bindings/src/main/scala/chrome/utils/ChromeApp.scala | Scala | mit | 463 |
/* scala-stm - (c) 2009-2011, Stanford University, PPL */
package scala.concurrent.stm
package skel
import scala.collection.mutable
private[stm] object HashTrieTMap {
def empty[A, B]: TMap[A, B] = new HashTrieTMap(Ref(TxnHashTrie.emptyMapNode[A, B]).single)
def newBuilder[A, B]: mutable.Builder[(A, B), TMap[... | nbronson/scala-stm | src/main/scala/scala/concurrent/stm/skel/HashTrieTMap.scala | Scala | bsd-3-clause | 2,913 |
package im.mange.shoreditch
import im.mange.shoreditch.api._
import im.mange.shoreditch.handler.HttpMethodPartialFunctions._
import im.mange.shoreditch.handler.{Request, Route, ShoreditchHandler}
case class Shoreditch(base: String = "shoreditch",
version: String,
longName: ... | alltonp/shoreditch | src/main/scala/im/mange/shoreditch/Shoreditch.scala | Scala | apache-2.0 | 1,688 |
package assets.mustache.overseas
import uk.gov.gds.ier.transaction.overseas.lastUkAddress.LastUkAddressLookupMustache
import uk.gov.gds.ier.test._
class LastUkAddressLookupTemplateTest
extends TemplateTestSuite
with LastUkAddressLookupMustache {
it should "properly render" in {
running(FakeApplication()) {... | michaeldfallen/ier-frontend | test/assets/mustache/overseas/LastUkAddressLookupTemplateTest.scala | Scala | mit | 1,230 |
/**
* Copyright 2010-2013 Artima, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | jedesah/scalatest-website | app/examples/FunSpecExamples.scala | Scala | apache-2.0 | 14,454 |
package io.buoyant.namerd.iface
import com.twitter.conversions.DurationOps._
import com.twitter.finagle._
import com.twitter.finagle.naming.NameInterpreter
import com.twitter.logging.Level
import com.twitter.util._
import io.buoyant.namer.{ConfiguredDtabNamer, DelegateTree, Metadata, RichActivity}
import io.buoyant.na... | linkerd/linkerd | namerd/iface/control-http/src/test/scala/io/buoyant/namerd/iface/HttpNamerEndToEndTest.scala | Scala | apache-2.0 | 7,095 |
/*
* The MIT License
*
* Copyright (c) 2016 Fulcrum Genomics
*
* 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, c... | fulcrumgenomics/fgbio | src/test/scala/com/fulcrumgenomics/vcf/HapCutToVcfTest.scala | Scala | mit | 16,626 |
package com.adamsresearch.mbs.fanniemae.monthlyfiles
import java.text.SimpleDateFormat
import java.util.Date
/**
* Created by wma on 2/2/15.
*
* TODO: parse these COBOL PICTURE elements...
*/
class FixedRateQuartile
case class FixedQuartilesHeader(quartileRecordType: String,
pool... | waynemadams/mbs-parser | src/main/scala/com/adamsresearch/mbs/fanniemae/monthlyfiles/FixedRateQuartile.scala | Scala | apache-2.0 | 1,973 |
package org.adridadou.ethereum.propeller.values
import org.adridadou.ethereum.propeller.keystore.AccountProvider
import org.ethereum.crypto.ECKey
import org.scalacheck.Arbitrary._
import org.scalacheck.Prop._
import org.scalatest.check.Checkers
import org.scalatest.{Matchers, _}
import scala.util.{Failure, Success, T... | adridadou/eth-propeller-core | src/test/scala/org/adridadou/ethereum/propeller/values/EthAccountTest.scala | Scala | apache-2.0 | 1,735 |
package is.hail.methods
import is.hail.HailContext
import is.hail.annotations._
import is.hail.expr.ir._
import is.hail.expr.ir.functions.MatrixToTableFunction
import is.hail.types.physical.{PCanonicalString, PCanonicalStruct, PFloat64, PInt64, PString, PStruct}
import is.hail.types.virtual.{TFloat64, TStruct}
import ... | danking/hail | hail/src/main/scala/is/hail/methods/IBD.scala | Scala | mit | 12,135 |
/*
* 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... | intel-analytics/BigDL | scala/dllib/src/main/scala/com/intel/analytics/bigdl/dllib/nn/Pack.scala | Scala | apache-2.0 | 4,126 |
package play.api.libs.ws
import org.specs2.mutable._
import org.specs2.mock.Mockito
import com.ning.http.client.{
Response => AHCResponse,
Cookie => AHCCookie
}
import java.util
object WSSpec extends Specification with Mockito {
"WS" should {
"support several query string values for a parameter" in {
... | michaelahlers/team-awesome-wedding | vendor/play-2.2.1/framework/src/play/src/test/scala/play/api/libs/ws/WSSpec.scala | Scala | mit | 2,223 |
/*
* 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 ... | brad-kaiser/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/FlatMapGroupsWithStateExec.scala | Scala | apache-2.0 | 13,642 |
package philosophy.finallytagless
import language.higherKinds
import scala.scalajs.js.JSApp
import org.scalajs.dom._
import cats.{~>, Id, Monad}
import cats.syntax.flatMap._
import cats.syntax.functor._
import philosophy.{Graph, wikiapi, RFuture}
import philosophy.RFuture._
import philosophy.IO._
import philosophy.cr... | vtoro/getting-to-philosophy | src/main/scala/philosophy/finallytagless/finallytagless.scala | Scala | mit | 5,194 |
package com.avsystem.scex
package compiler
import com.avsystem.scex.parsing.PositionMapping
/**
* Created: 14-11-2013
* Author: ghik
*/
case class ExpressionDef(
profile: ExpressionProfile,
template: Boolean,
setter: Boolean,
expression: String,
header: String,
contextType: String,
resultType: Str... | AVSystem/scex | scex-core/src/main/scala/com/avsystem/scex/compiler/ExpressionDef.scala | Scala | mit | 476 |
package justin.db.replica.read
import java.util.UUID
import justin.db.Data
import justin.db.actors.protocol.{StorageNodeFailedRead, StorageNodeFoundRead, StorageNodeNotFoundRead}
import justin.db.consistenthashing.NodeId
import justin.db.storage.GetStorageProtocol
import justin.db.storage.PluggableStorageProtocol.{Da... | speedcom/JustinDB | justin-core/src/test/scala/justin/db/replica/read/ReplicaLocalReaderTest.scala | Scala | apache-2.0 | 2,273 |
/*
* Copyright 2014-2020 Rik van der Kleij
*
* 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... | rikvdkleij/intellij-haskell | src/main/scala/intellij/haskell/psi/stubs/index/HaskellAllNameIndex.scala | Scala | apache-2.0 | 1,186 |
package com.xah.chat.ui.activities
import android.app.Activity
import android.os.Bundle
import android.support.v7.app.ActionBarActivity
import android.view.{View, Window}
import com.xah.chat.comms.{XService, XServiceConnection}
import android.content.{Context, Intent}
import com.xah.chat.framework.TraitActivityContext... | lemonxah/xaHChat | src/main/scala/com/xah/chat/ui/activities/BaseActivity.scala | Scala | mit | 1,172 |
/*
* 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 ... | ahnqirage/spark | sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/csv/CSVInferSchemaSuite.scala | Scala | apache-2.0 | 7,719 |
/*
* 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 ... | vadopolski/ignite | modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/cache/VisorCacheScanCommand.scala | Scala | apache-2.0 | 6,231 |
/**
* 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... | lindong28/kafka | core/src/main/scala/kafka/log/LogCleanerManager.scala | Scala | apache-2.0 | 27,975 |
/*
* Copyright (c) 2014-2020 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... | alexandru/monifu | monix-reactive/shared/src/test/scala/monix/reactive/internal/operators/DelayBySelectorSuite.scala | Scala | apache-2.0 | 2,375 |
/**
* 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... | chirino/activemq-apollo | apollo-stomp/src/test/scala/org/apache/activemq/apollo/stomp/test/WebDriverTrait.scala | Scala | apache-2.0 | 1,070 |
package marge.map
/**
* User: mikio
* Date: 4/7/11
* Time: 3:26 PM
*/
class OneAgainstRest[A](positive: A) extends OutputMap[A, Int] {
def apply(a: A): Int = if (a == positive) 1 else -1
def unapply(b: Int): Option[A] = if (b == 1) Some(positive) else None
}
| mikiobraun/marge | src/main/scala/marge/map/OneAgainstRest.scala | Scala | mit | 269 |
/*
* Copyright (C) Lightbend Inc. <https://www.lightbend.com>
*/
package com.lightbend.lagom.scaladsl.api.deser
import akka.Done
import akka.NotUsed
import akka.stream.scaladsl.Source
import akka.util.ByteString
import com.lightbend.lagom.scaladsl.api.transport._
import play.api.libs.json._
import scala.collection... | lagom/lagom | service/scaladsl/api/src/main/scala/com/lightbend/lagom/scaladsl/api/deser/MessageSerializer.scala | Scala | apache-2.0 | 13,993 |
/*
* 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-execution/shared/src/test/scala/monix/execution/schedulers/ExecutionModelSuite.scala | Scala | apache-2.0 | 2,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 ... | ueshin/apache-spark | sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/sources/TextSocketStreamSuite.scala | Scala | apache-2.0 | 14,444 |
object Test extends App {
Macros.foo1
Macros.foo2
} | som-snytt/dotty | tests/disabled/macro/run/macroPlugins-typedMacroBody/Test_3.scala | Scala | apache-2.0 | 55 |
/*
* Copyright (C) 2015 Stratio (http://stratio.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 by app... | Stratio/Sparta | serving-api/src/main/scala/com/stratio/sparta/serving/api/service/http/DriverHttpService.scala | Scala | apache-2.0 | 5,554 |
/*
* Copyright (C) 2014 - 2017 Contributors as noted in the AUTHORS.md file
*
* 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)... | Tensei-Data/tensei-agent | src/test/scala/com/wegtam/tensei/agent/ProcessorTest.scala | Scala | agpl-3.0 | 10,252 |
package org.dama.datasynth.common.generators.property.dummy
import org.dama.datasynth.common.generators.property.PropertyGenerator
/**
* Created by aprat on 11/04/17.
*
* Dummy property generator that produces a Long
*/
class DummyLongPropertyGenerator( num : Long )
extends PropertyGenerator[Long] {
over... | joangui/DataSynth | src/main/scala/org/dama/datasynth/common/generators/property/dummy/DummyLongPropertyGenerator.scala | Scala | gpl-3.0 | 392 |
package fpinscala.laziness
import Stream._
trait Stream[+A] {
def foldRight[B](z: => B)(f: (A, => B) => B): B = // The arrow `=>` in front of the argument type `B` means that the function `f` takes its second argument by name and may choose not to evaluate it.
this match {
case Cons(h,t) => f(h(), t().fol... | fpinscala-muc/fpinscala-mhofsche | exercises/src/main/scala/fpinscala/laziness/Stream.scala | Scala | mit | 3,204 |
import java.io._
import java.net._
import java.security._
import java.util._
/**
* Scala client for BaseX.
* Works with BaseX 7.x (but not with BaseX 8.0 and later)
* Does not support all bindings yet; your extensions are welcome.
*
* Documentation: http://docs.basex.org/wiki/Clients
*
* (C) Bas... | drmacro/basex | basex-api/src/main/scala/basexclient.scala | Scala | bsd-3-clause | 7,149 |
package com.twitter.finagle.util
import java.net.InetSocketAddress
object InetSocketAddressUtil {
/**
* Parses a comma or space-delimited string of hostname and port pairs. For example,
*
* InetSocketAddressUtil.parseHosts("127.0.0.1:11211") => Seq(new InetSocketAddress("127.0.0.1", 11211))
*
* @... | enachb/finagle_2.9_durgh | finagle-core/src/main/scala/com/twitter/finagle/util/InetSocketAddressUtil.scala | Scala | apache-2.0 | 785 |
/*
* Copyright (c) 2013-2014 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.... | ClaraVista-IT/snowplow | 2-collectors/scala-stream-collector/src/main/scala/com.snowplowanalytics.snowplow.collectors/scalastream/ScalaCollectorApp.scala | Scala | apache-2.0 | 7,091 |
/*
* Copyright 2009-2010 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 appl... | akisaarinen/ccf | ccf/src/main/scala/ccf/tree/indexing/TreeIndex.scala | Scala | apache-2.0 | 3,215 |
/*
* Accio is a platform to launch computer science experiments.
* Copyright (C) 2016-2018 Vincent Primault <v.primault@ucl.ac.uk>
*
* Accio 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... | privamov/accio | accio/java/fr/cnrs/liris/infra/thriftserver/AuthFilter.scala | Scala | gpl-3.0 | 1,866 |
/*
* (c) Copyright 2016 Hewlett Packard Enterprise Development LP
*
* 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... | hpe-cct/cct-nn | src/test/scala/toolkit/neuralnetwork/function/AddConstantSpec.scala | Scala | apache-2.0 | 2,082 |
/*
* 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 ... | xieguobin/Spark_2.0.0_cn1 | ml/classification/DecisionTreeClassifier.scala | Scala | apache-2.0 | 11,324 |
/*
* This file is part of the "silex" library of helpers for Apache Spark.
*
* Copyright (c) 2016 Red Hat, 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.ap... | willb/silex | src/test/scala/com/redhat/et/silex/rdd/lineage.scala | Scala | apache-2.0 | 1,545 |
package models.plan
import scalaz._
import Scalaz._
import models._
case class KnittingState(
bedNeedles: Map[Bed, Map[Needle, NeedleState]],
carriageState: CarriageStates,
output: Knitted,
output3D: Knitted3D,
yarnAttachments: Map[YarnPiece, YarnAttachment]) {
def nextDirection(carriage: Carriage) = car... | knittery/knittery-ui | app/models/plan/KnittingState.scala | Scala | gpl-2.0 | 4,146 |
package pl.gosub.akka.online
import akka.NotUsed
import akka.actor.{Actor, ActorRef, ActorSystem, PoisonPill, Props}
import akka.event.Logging
import akka.http.scaladsl.Http
import akka.http.scaladsl.model.{HttpMethods, HttpRequest, HttpResponse, Uri}
import akka.stream.QueueOfferResult.Enqueued
import akka.stream.sca... | gosubpl/akka-online | src/main/scala/pl/gosub/akka/online/Main.scala | Scala | apache-2.0 | 4,301 |
package org.example
import scalax.chart.api._
import org.specs2._
class ToolTipGeneratorSpec extends Specification { def is = s2"""
Tool Tip Generator Specification
Category Tool Tip Generator
Creation
from ordinary function $cat1
usi... | wookietreiber/scala-chart | src/test/scala/scalax/chart/ToolTipGeneratorSpec.scala | Scala | lgpl-3.0 | 5,826 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | trueyao/spark-lever | mllib/src/test/scala/org/apache/spark/ml/PipelineSuite.scala | Scala | apache-2.0 | 3,155 |
package com.twitter.finagle.postgres.connection
import com.twitter.finagle.postgres.messages.{PgResponse, DataRow, Field}
import scala.collection.mutable.ListBuffer
/*
* Connection states.
*/
sealed trait State
case object SimpleQuery extends State
case object RequestingSsl extends State
case object AwaitingS... | jeremyrsmith/finagle-postgres | src/main/scala/com/twitter/finagle/postgres/connection/States.scala | Scala | apache-2.0 | 1,420 |
/**
* This file is part of the TA Buddy project.
* Copyright (c) 2013-2014 Alexey Aksenov ezh@ezh.msk.ru
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Affero General Global License version 3
* as published by the Free Software Foundation with the addition... | digimead/digi-TABuddy-desktop | part-logic/src/main/scala/org/digimead/tabuddy/desktop/logic/Activator.scala | Scala | agpl-3.0 | 7,406 |
import java.util.Objects
import org.infinispan.distribution.group.{Group, Grouper}
import org.infinispan.manager.DefaultCacheManager
object InfinispanGroupApi {
def main(args: Array[String]): Unit = {
val manager = new DefaultCacheManager("infinispan.xml")
val cacheAsCustomizedKeyClass = manager.getCache[Ke... | kazuhira-r/infinispan-examples | infinispan-group-api/src/main/scala/InfinispanGroupApi.scala | Scala | mit | 5,708 |
/*
* 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 ... | dbtsai/spark | sql/catalyst/src/main/scala/org/apache/spark/sql/connector/catalog/CatalogV2Implicits.scala | Scala | apache-2.0 | 5,470 |
package structures
package laws
trait SemigroupLaws[A] {
implicit val typeClass: Semigroup[A]
import Semigroup.ops._
def combineAssociativity(x: A, y: A, z: A): IsEqual[A] =
((x |+| y) |+| z) =?= (x |+| (y |+| z))
}
object SemigroupLaws {
def apply[A: Semigroup]: SemigroupLaws[A] = new SemigroupLaws[A]... | mpilquist/Structures | laws/src/main/scala/structures/laws/SemigroupLaws.scala | Scala | bsd-3-clause | 362 |
/** ____ __ ____ ____ ____,,___ ____ __ __ ____
* ( _ \\ /__\\ (_ )(_ _)( ___)/ __) ( _ \\( )( )( _ \\ Read
* ) / /(__)\\ / /_ _)(_ )__) \\__ \\ )___/ )(__)( ) _ < README.txt
* (_)\\_)(__)(__)(____)(____)(____)(___/ (__) (______)(____/ LICENSE.txt
*/
imp... | razie/diesel-hydra | samples/sample1/app/Global.scala | Scala | apache-2.0 | 2,549 |
/**
* Copyright (C) 2010-2011 LShift Ltd.
*
* 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... | lshift/diffa | kernel/src/test/scala/net/lshift/diffa/kernel/differencing/LuceneVersionCorrelationStoreTest.scala | Scala | apache-2.0 | 38,380 |
/*
* 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-engine-core/src/main/scala/com/bwsw/sj/engine/core/testutils/benchmark/loader/kafka/KafkaBenchmarkDataSender.scala | Scala | apache-2.0 | 4,178 |
package com.outr.arango
import com.outr.arango.model.ArangoCode
case class ArangoError(error: Boolean, code: Int, errorNum: Option[Int], errorMessage: String) {
lazy val errorCode: ArangoCode = ArangoCode(errorNum.getOrElse(ArangoCode.Failed.code))
def is(code: ArangoCode): Boolean = code == errorCode
overrid... | outr/arangodb-scala | driver/src/main/scala/com/outr/arango/ArangoError.scala | Scala | mit | 405 |
/**
* Copyright (C) 2011 Orbeon, Inc.
*
* This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU Lesser General Public License as published by the Free Software Foundation; either version
* 2.1 of the License, or (at your option) any later version.
*
* This program i... | joansmith/orbeon-forms | src/main/scala/org/orbeon/oxf/fb/GridOps.scala | Scala | lgpl-2.1 | 20,810 |
object Test extends App {
trait A {
def f[T[_]](x : T[Int]) : T[Any]
}
class B extends A {
def f[T[+_]](x : T[Int]) : T[Any] = x
}
class P[Y](var y : Y)
val p = new P(1)
val palias = (new B():A).f[P](p)
palias.y = "hello"
val z: Int = p.y
}
| AlexSikia/dotty | tests/untried/neg/t2066b.scala | Scala | bsd-3-clause | 258 |
package houseprices.csv
import houseprices.postcodes.ClasspathSource
import houseprices.postcodes.Postcode
import houseprices.postcodes.PostcodeRepo
import houseprices.PricePaid
import houseprices.Address
import houseprices.postcodes.FileSource
import org.slf4j.LoggerFactory
class PricePaidCsvProcessor(val csvInputFi... | ayubmalik/houseprices | houseprices-core/src/main/scala/houseprices/csv/PricePaidCsvProcessor.scala | Scala | mit | 1,519 |
object Test extends dotty.runtime.LegacyApp {
val f = () => 5
def test(g: => Int): Unit = {
val gFunc = g _
val isSameClosureClass = gFunc.getClass == f.getClass
val isSame = gFunc eq f
println("Is same closure class: "+isSameClosureClass+" is same closure: "+isSame)
}
test(f())
}
| folone/dotty | tests/pending/run/t1247.scala | Scala | bsd-3-clause | 307 |
/*
* Copyright 2017 FOLIO Co., Ltd.
*
* 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... | folio-sec/reladomo-scala | reladomo-scala-common/src/main/scala/com/folio_sec/reladomo/scala_api/TransactionProvider.scala | Scala | apache-2.0 | 1,407 |
package mesosphere.marathon.tasks
import com.codahale.metrics.MetricRegistry
import mesosphere.marathon.MarathonSpec
import mesosphere.marathon.Protos.Constraint
import mesosphere.marathon.state.AppDefinition
import mesosphere.marathon.state.PathId.StringPathId
import mesosphere.marathon.tasks.TaskQueue.QueuedTask
im... | sttts/marathon | src/test/scala/mesosphere/marathon/tasks/TaskQueueTest.scala | Scala | apache-2.0 | 2,463 |
package scadla.utils.thread
import scala.language.postfixOps
import squants.space.LengthConversions._
/* Radius of ISO metric sizes. _x_y stands of x.y mm. */
object ISO {
val M1 = (1 mm) / 2.0
val M1_2 = (1.2 mm) / 2.0
val M1_6 = (1.6 mm) / 2.0
val M2 = (2 mm) / 2.0
val M2_5 = (2.5 mm) / 2.0
val ... | dzufferey/scadla | src/main/scala/scadla/utils/thread/ISO.scala | Scala | apache-2.0 | 764 |
package scalax.collection.constrained
/**
* Predefined constraints that may be passed to constrained `Graph`s.
*
* @author Peter Empen
*/
package object constraints {
}
| opyate/scala-graph | constrained/src/main/scala/scalax/collection/constrained/constraints/package.scala | Scala | bsd-3-clause | 174 |
package com.temportalist.morphadditions.common
import com.temportalist.origin.api.common.proxy.IProxy
import net.minecraft.entity.player.EntityPlayer
import net.minecraft.tileentity.TileEntity
import net.minecraft.world.World
/**
*
*
* @author TheTemportalist
*/
class ProxyCommon extends IProxy {
override def r... | TheTemportalist/MorphAdditions | src/main/scala/com/temportalist/morphadditions/common/ProxyCommon.scala | Scala | apache-2.0 | 753 |
/**
* Copyright (C) 2016 Nicola Justus <nicola.justus@mni.thm.de>
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
package de.thm.move.util
import javafx.bea... | THM-MoTE/MoVE | src/main/scala/de/thm/move/util/JFxUtils.scala | Scala | mpl-2.0 | 3,141 |
package com.landoop.streamreactor.connect.hive.source.config
import java.util.Collections
import cats.data.NonEmptyList
import com.landoop.streamreactor.connect.hive.{DatabaseName, HadoopConfiguration, TableName, Topic}
import com.landoop.streamreactor.connect.hive.kerberos.Kerberos
import scala.collection.JavaConve... | datamountaineer/stream-reactor | kafka-connect-hive-1.1/src/main/scala/com/landoop/streamreactor/connect/hive/source/config/HiveSourceConfig.scala | Scala | apache-2.0 | 2,119 |
/*
* Copyright (c) 2015, Michael Lewis
* All rights reserved.
*
* 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 conditio... | rrramiro/cucumber | cucumber-runner/src/test/scala/com/waioeka/sbt/MultiplicationSteps.scala | Scala | bsd-2-clause | 2,007 |
/*
* Copyright (C) 2014 - 2017 Contributors as noted in the AUTHORS.md file
*
* 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)... | Tensei-Data/tensei-agent | src/main/scala/com/wegtam/tensei/agent/helpers/ArgonautJavaTime.scala | Scala | agpl-3.0 | 2,365 |
package jumpmicro.jmsangriagraphql.impl.startup
import akka.actor.{Props}
import jumpmicro.jmsangriagraphql.impl.actor.StartWebServerActor
import jumpmicro.shared.util.boilerplate.StartupAkkaActorsBoilerplate
import org.log4s.getLogger
//: ------------------------------------------------------------------------------... | PhilAndrew/JumpMicro | JMSangriaGraphql/src/main/scala/jumpmicro/jmsangriagraphql/impl/startup/StartupAkkaActors.scala | Scala | mit | 861 |
/**
* Licensed to Big Data Genomics (BDG) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The BDG licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use ... | tdanford/adam | adam-core/src/main/scala/org/bdgenomics/adam/util/ParquetFileTraversable.scala | Scala | apache-2.0 | 2,301 |
package be.cmpg.cancer
import scopt.OptionParser
import java.io.File
import scala.collection.mutable.HashMap
object MutualExclusivityPrepareInput extends App {
case class InputConfig(
maf: Option[File] = None,
expression: Map[String, File] = Map(),
seedGenesMutations: Int = 1,
acceptedCorrelationQV... | spulido99/SSA | src/main/scala/be/cmpg/cancer/MutualExclusivityPrepareInput.scala | Scala | gpl-2.0 | 3,560 |
/* Copyright 2009-2016 EPFL, Lausanne */
package leon
package genc
package ir
import PrimitiveTypes._
/*
* Collection of operators for IR with their precedence from the Scala language perspective.
*/
private[genc] object Operators {
// NOTE It is possible to have more than one "From" or several "To", but this i... | epfl-lara/leon | src/main/scala/leon/genc/ir/Operators.scala | Scala | gpl-3.0 | 3,141 |
package com.datasift.dropwizard.scala.jdbi.tweak
import org.scalatest.FlatSpec
/**
* Tests [[com.datasift.dropwizard.scala.jdbi.tweak.OptionContainerFactory]]
*/
class OptionContainerFactorySpec extends FlatSpec {
val factory = new OptionContainerFactory
"OptionContainerFactory for Ints" should "Accepts Optio... | datasift/dropwizard-scala | jdbi/src/test/scala/com/datasift/dropwizard/scala/jdbi/tweak/OptionContainerFactorySpec.scala | Scala | apache-2.0 | 1,622 |
package core
import akka.actor.{ActorSystem, PoisonPill, Props}
import akka.cluster.Cluster
import akka.contrib.pattern.{ClusterSingletonManager, ClusterSingletonProxy}
import akka.pattern.ask
import com.typesafe.config.ConfigFactory
import core.stress.SimpleClusterListener.IsRemoved
import core.stress._
import org.sl... | kciesielski/akka-journal-stress | src/main/scala/core/core.scala | Scala | apache-2.0 | 2,937 |
/*
* Copyright (C) 2017. RandomCoder <randomcoder@randomcoding.co.uk>
*
* 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) any la... | randomcoder/gherkin-converter | src/main/scala/uk/co/randomcoding/cucumber/generator/writer/package.scala | Scala | agpl-3.0 | 1,101 |
package cilib
import scalaz._
import scalaz.Ordering._
import scalaz.std.anyVal._
import scalaz.syntax.equal._
sealed trait Fit {
def fold[Z](penalty: Adjusted => Z, valid: Feasible => Z, infeasible: Infeasible => Z): Z =
this match {
case p @ Adjusted(_,_) => penalty(p)
case v @ Feasible(_) =... | robgarden/cilib | core/src/main/scala/cilib/Fitness.scala | Scala | gpl-3.0 | 5,244 |
/*
* Copyright 2011-2017 Chris de Vreeze
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agree... | dvreeze/yaidom | shared/src/main/scala/eu/cdevreeze/yaidom/convert/ScalaXmlToYaidomConversions.scala | Scala | apache-2.0 | 8,005 |
object SCL5737 {
object Test extends Enumeration {
type Test = Value
val Bar, Baz, Qux = Value
}
class Test2 {
val map: Map[Test.Value, Int] = /*start*/Map(Test.Bar -> 1, Test.Baz -> 2, Test.Qux -> 3)/*end*/
}
}
//Map[SCL5737.Test.Value, Int] | ilinum/intellij-scala | testdata/typeInference/bugs5/SCL5737.scala | Scala | apache-2.0 | 249 |
package models
import helpers.UnitSpec
import org.joda.time.DateTime
import org.joda.time.format.DateTimeFormat
import scala.language.postfixOps
import scala.util.Try
import uk.gov.dvla.vehicles.presentation.common.views.models.DayMonthYear
class DayMonthYearSpec extends UnitSpec {
val validFourDigitYear = 1984
... | dvla/vehicles-online | test/models/DayMonthYearSpec.scala | Scala | mit | 10,652 |
package fpgatidbits.streams
import Chisel._
// combinational fork for one stream -> two streams
// fork functions can be customized
class StreamFork[Ti <: Data, ToA <: Data, ToB <: Data]
(genIn: Ti, genA: ToA, genB: ToB, forkA: Ti => ToA, forkB: Ti => ToB)
extends Module {
val io = new Bundle {
val in = De... | maltanar/fpga-tidbits | src/main/scala/fpgatidbits/streams/StreamFork.scala | Scala | bsd-2-clause | 1,275 |
package io.vamp.workflow_driver
import akka.actor.ActorSystem
import akka.pattern.ask
import com.typesafe.scalalogging.LazyLogging
import io.vamp.common.Config
import io.vamp.common.akka.CommonSupportForActors
import io.vamp.common.akka.IoC._
import io.vamp.common.notification.Notification
import io.vamp.common.vitals... | magneticio/vamp | workflow_driver/src/main/scala/io/vamp/workflow_driver/WorkflowDriver.scala | Scala | apache-2.0 | 5,891 |
package mbilski.spray.hmac
class AuthenticationSpec extends BaseSpec {
property("returns account when account exists and hashes match") {
forAll {(uuid: String, secret: String, uri: String) =>
whenever(notEmpty(uuid, secret, uri)) {
val hash = Signer.generate(secret, uri, Signer.timestamp)
... | mbilski/spray-hmac | src/test/scala/mbilski/spray/hmac/AuthenticationSpec.scala | Scala | apache-2.0 | 1,023 |
package org.zalando.jsonapi.json
import org.scalactic.TypeCheckedTripleEquals
import org.scalatest.{ EitherValues, WordSpec }
import org.zalando.jsonapi.JsonapiRootObjectWriter
import org.zalando.jsonapi.json.sprayhttpx.SprayJsonapiSupport
import org.zalando.jsonapi.model.{ JsonApiObject, JsonApiProperty, RootObject }... | texvex/scala-jsonapi | src/test/scala/org/zalando/jsonapi/json/JsonapiSupportSpec.scala | Scala | mit | 2,365 |
package io.eels.component.jdbc.dialect
import java.sql.{ResultSetMetaData, Types}
import com.sksamuel.exts.Logging
import io.eels.Row
import io.eels.schema._
class GenericJdbcDialect extends JdbcDialect with Logging {
// generic jdbc will just return the values as is
override def sanitize(value: Any): Any = val... | eel-lib/eel | eel-core/src/main/scala/io/eels/component/jdbc/dialect/GenericJdbcDialect.scala | Scala | mit | 4,161 |
/*
* 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 ... | ArvinDevel/onlineAggregationOnSparkV2 | sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/util/StringUtilsSuite.scala | Scala | apache-2.0 | 1,475 |
/*
* 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 ... | jinglining/flink | flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/planner/runtime/batch/sql/join/LookupJoinITCase.scala | Scala | apache-2.0 | 9,164 |
/*
* Copyright (c) 2021, salesforce.com, inc.
* All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
package com.krux.hyperion.common
import java.util.UUID
import scala.language.implicitConv... | realstraw/hyperion | core/src/main/scala/com/krux/hyperion/common/PipelineObjectId.scala | Scala | bsd-3-clause | 2,560 |
package com.arcusys.valamis.web.configuration.ioc
import com.arcusys.learn.liferay.LiferayClasses._
import com.arcusys.learn.liferay.util.LanguageHelper
import com.arcusys.valamis.certificate.storage.CertificateRepository
import com.arcusys.valamis.course._
import com.arcusys.valamis.course.service._
import com.arcusy... | arcusys/Valamis | valamis-portlets/src/main/scala/com/arcusys/valamis/web/configuration/ioc/CommonConfiguration.scala | Scala | gpl-3.0 | 4,648 |
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.