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.onion.mongo
import com.onion.model.{User, Meeting}
import reactivemongo.bson.BSONDocument
import spray.json.{RootJsonReader, RootJsonFormat}
import sprest.models.{UniqueSelector, Model}
import sprest.reactivemongo.ReactiveMongoPersistence
import sprest.reactivemongo.typemappers.{NormalizedIdTransformer, Sp... | jasoncao/onion-ring | src/main/scala/com/onion/mongo/DB.scala | Scala | apache-2.0 | 2,747 |
/*
* 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 ... | manishgupta88/carbondata | integration/spark-common-cluster-test/src/test/scala/org/apache/carbondata/cluster/sdv/generated/SetParameterTestCase.scala | Scala | apache-2.0 | 13,547 |
/*
* 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 ... | wwjiang007/flink | flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/planner/plan/utils/PartitionPrunerTest.scala | Scala | apache-2.0 | 6,804 |
package epic.features
import epic.framework.Feature
@SerialVersionUID(1L)
class SpanShapeFeaturizer extends SurfaceFeaturizer[String] with Serializable {
def anchor(words: IndexedSeq[String]): SurfaceFeatureAnchoring[String] = {
new SurfaceFeatureAnchoring[String] {
def featuresForSpan(begin: Int, end: In... | maxim-rabinovich/epic | src/main/scala/epic/features/SpanShapeGenerator.scala | Scala | apache-2.0 | 7,581 |
/*
* 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 ... | JerryLead/spark | resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala | Scala | apache-2.0 | 60,460 |
package com.github.dzhg.tedis.protocol
import java.io.InputStream
import com.github.dzhg.tedis.protocol.RESP._
import scala.collection.mutable
class RESPReader(in: InputStream) {
def readValue(): RESPValue = {
val c = in.read().toByte
c match {
case SIMPLE_STRING => readSimpleString()
case IN... | dzhg/tedis | src/main/scala/com/github/dzhg/tedis/protocol/RESPReader.scala | Scala | mit | 1,971 |
object Sample {
def main(args : Array[String]) {
val s = Array.ofDim[String](2, 2)
s(1)(1) = "test"
"stop here"
}
} | consulo/consulo-scala | testdata/debugger/ScalaMethodEvaluation/arrayApplyFunction/src/Sample.scala | Scala | apache-2.0 | 131 |
/*
* 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/sources/memoryV2.scala | Scala | apache-2.0 | 6,060 |
package com.twitter.finagle.exp
import com.twitter.concurrent.ForkingScheduler
import com.twitter.finagle.Failure
import com.twitter.finagle.Service
import com.twitter.finagle.ServiceFactory
import com.twitter.finagle.SimpleFilter
import com.twitter.finagle.Stack
import com.twitter.finagle.Stackable
import com.twitter... | twitter/finagle | finagle-core/src/main/scala/com/twitter/finagle/exp/ForkingSchedulerFilter.scala | Scala | apache-2.0 | 2,528 |
/*
* Copyright (c) 2017 Magomed Abdurakhmanov, Hypertino
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
*/
package com.hypertino.hyperbus.serialization
import... | hypertino/hyperbus | hyperbus/src/main/scala/com/hypertino/hyperbus/serialization/MessageReader.scala | Scala | mpl-2.0 | 2,038 |
/*
Copyright 2014 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... | tdyas/scalding | scalding-thrift-macros/src/main/scala/com/twitter/scalding/thrift/macros/impl/ScroogeInternalOrderedSerializationImpl.scala | Scala | apache-2.0 | 4,101 |
package models
class SlackConfiguration(val botName: String,
val iconEmoji: String,
val fallbackChannel: String,
val incommingUrl: String) {
}
| uqtimes/SlackBotScala | app/models/SlackConfiguration.scala | Scala | mit | 219 |
/*
Copyright (c) 2012 Joshua Garnett
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distri... | joshgarnett/Astar-Scala | test/com/adverserealms/astar/basic2d/MockLargeSquareGridMap.scala | Scala | mit | 4,670 |
/*
* Created on 2010/06/07
* Copyright (c) 2010-2011, Wei-ju Wu.
* 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, ... | logicmoo/zmpp2 | zmpp-glk/src/main/scala/org/zmpp/glk/GlkDispatch.scala | Scala | bsd-3-clause | 23,621 |
// See LICENSE.txt for license details.
package examples
import chisel3._
import chisel3.util._
//A 4-bit adder with carry in and carry out
class Adder4 extends Module {
val io = IO(new Bundle {
val A = Input(UInt(4.W))
val B = Input(UInt(4.W))
val Cin = Input(UInt(1.W))
val Sum = Output(UIn... | timtian090/Playground | chiselTutorial/src/main/scala/examples/Adder4.scala | Scala | mit | 1,095 |
package net.aicomp.terraforming
import java.applet.Applet
import scala.util.control.Exception.allCatch
class AppletReplayMain extends Applet {
override def start() {
val fps = allCatch opt getParameter("fps").toDouble getOrElse (15.0)
val replay = getParameter("replay")
Main.main(Array("-" + Main.LIGHT... | AI-comp/Terraforming | src/main/scala/net/aicomp/terraforming/AppletReplayMain.scala | Scala | apache-2.0 | 400 |
import sbt.Keys._
import sbt._
object PublishConfig {
// General settings for subprojects to be published
lazy val doPublish = Seq(
publishMavenStyle := true,
publishArtifact in Test := false,
(for {
username <- Option(System.getenv().get("SONATYPE_USERNAME"))
password <- Option(S... | lefou/blended | project/PublishConfig.scala | Scala | apache-2.0 | 1,000 |
package fr.ramiro.sfuzzy.dsl
import fr.ramiro.sfuzzy.FunctionsUtils.{ max, min }
import fr.ramiro.sfuzzy._
import org.scalatest.FunSuite
import MembershipFunctions.{ piecewiseLinear => l }
/**
* Created by Ramiro on 11/05/2017.
*/
class QualifyTest extends FunSuite {
test("AND -> MIN") {
case object scoring e... | rrramiro/sFuzzyLogic | src/test/scala/fr/ramiro/sfuzzy/dsl/QualifyTest.scala | Scala | apache-2.0 | 3,600 |
/*
* 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/play-ui | src/main/scala/uk/gov/hmrc/play/config/AssetsConfig.scala | Scala | apache-2.0 | 960 |
package com.github.mdr.mash.functions
import com.github.mdr.mash.compiler.{ CompilationUnit, Compiler }
import com.github.mdr.mash.evaluator.StandardEnvironment
import com.github.mdr.mash.inference.TypedArguments
import com.github.mdr.mash.parser.AbstractSyntax.InvocationExpr
import org.scalatest.{ FlatSpec, Matchers ... | mdr/mash | src/test/scala/com/github/mdr/mash/functions/BindTypesTest.scala | Scala | mit | 4,654 |
package sp.areus
import akka.actor._
import akka.pattern.ask
import akka.util.Timeout
import sp.domain._
import sp.system.messages._
import scala.concurrent.duration._
import scala.xml._
/**
* Created by Kristofer on 2014-06-27.
*/
class VCImportService(modelHandler: ActorRef) extends Actor {
implicit val timeo... | kristoferB/SP | sp1/src/main/scala/sp/areus/VCImportService.scala | Scala | mit | 3,293 |
package im.tox.antox.callbacks
import android.content.Context
import im.tox.antox.tox.ToxSingleton
import im.tox.antox.utils.{AntoxFriend, Constants}
import im.tox.tox4j.core.callbacks.FriendActionCallback
object AntoxOnActionCallback {
private val TAG = "im.tox.antox.TAG"
}
class AntoxOnActionCallback(private va... | 0xPoly/Antox | app/src/main/scala/im/tox/antox/callbacks/AntoxOnActionCallback.scala | Scala | gpl-3.0 | 658 |
/*
Implicit Flows: a prototype taint tracking system for implicit flows
Copyright (C) 2013 Petey Aldous <petey.aldous@utah.edu>
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; e... | peteyblueeyes/implicit-flows | src/org/ucombinator/experimental/AbstractState.scala | Scala | gpl-2.0 | 3,045 |
/*
* UGenGraph.scala
* (FScape)
*
* Copyright (c) 2001-2022 Hanns Holger Rutz. All rights reserved.
*
* This software is published under the GNU Affero General Public License v3+
*
*
* For further information, please contact Hanns Holger Rutz at
* contact@sciss.de
*/
package de.sciss.fscape
import ak... | Sciss/FScape-next | core/shared/src/main/scala/de/sciss/fscape/UGenGraph.scala | Scala | agpl-3.0 | 10,518 |
/*
* 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 ... | holdenk/spark | sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLCLIDriver.scala | Scala | apache-2.0 | 23,882 |
/**
* Copyright 2015 Yahoo Inc. Licensed under the Apache License, Version 2.0
* See accompanying LICENSE file.
*/
package models.navigation
/**
* @author hiral
*/
object Menus {
import models.navigation.QuickRoutes._
def clusterMenus(cluster: String) : IndexedSeq[Menu] = IndexedSeq(
Menu("Cluster",Index... | NerdWallet/kafka-manager | app/models/navigation/Menus.scala | Scala | apache-2.0 | 905 |
package spire
package math
import spire.algebra.{Eq, EuclideanRing, Field, PartialOrder, Order, Ring, Signed}
private[spire] trait ScalaEquivWrapper[A] extends scala.math.Equiv[A] {
def eq: Eq[A]
def equiv(x:A, y:A): Boolean = eq.eqv(x, y)
}
private[spire] trait ScalaPartialOrderingWrapper[A] extends scala.math... | non/spire | core/src/main/scala/spire/math/ScalaWrappers.scala | Scala | mit | 2,597 |
/*
* Copyright 2020 Precog Data
*
* 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 ... | djspiewak/quasar | foundation/src/main/scala/quasar/contrib/matryoshka/OrderR.scala | Scala | apache-2.0 | 1,033 |
package kr.ne.outsider
import org.springframework.scala.context.function.FunctionalConfigApplicationContext
/**
* Copyright (c) 2013 JeongHoon Byun aka "Outsider", <http://blog.outsider.ne.kr/>
* Licensed under the MIT license.
* <http://outsider.mit-license.org/>
*
* Author: Outsider
* Date: 13. 9. 29.
* Time... | outsideris/spring-scala-examples | beans-with-spring-scala-using-functionalconfiguration/src/main/scala/kr/ne/outsider/HelloApp.scala | Scala | mit | 710 |
/*
* 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/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JDBCRelation.scala | Scala | apache-2.0 | 4,066 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | ueshin/apache-spark | core/src/test/scala/org/apache/spark/scheduler/TaskContextSuite.scala | Scala | apache-2.0 | 18,943 |
package scalajs.antdesign
import japgolly.scalajs.react.{CallbackTo, React, ReactComponentU_, ReactNode}
import moment.Date
import scala.scalajs.js
import scala.scalajs.js.annotation.JSImport
import scala.scalajs.js.{Dynamic, Object}
/**
* @see https://ant.design/components/calendar/#API
* @param value set date
... | mdedetrich/scalajs-antdesign | src/main/scala/scalajs/antdesign/Calendar.scala | Scala | bsd-3-clause | 9,289 |
package actors
import language.postfixOps
import scala.concurrent.duration._
import akka.actor.Actor
import akka.actor.ActorRef
import akka.actor.ActorSystem
import akka.actor.ActorLogging
import akka.actor.Props
import akka.actor.RootActorPath
import akka.cluster.Cluster
import akka.cluster.ClusterEvent.CurrentCluste... | luzhuomi/playakkahbase | scala/playAkka/app/actors/TransformationBackend.scala | Scala | gpl-2.0 | 1,842 |
/*
* Copyright (C) 2010 Romain Reuillon
*
* 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 later version.
*
* This progra... | ISCPIF/PSEExperiments | openmole-src/openmole/core/org.openmole.core.tools/src/main/scala/org/openmole/core/tools/collection/WeakHashSet.scala | Scala | agpl-3.0 | 1,320 |
/*
* 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/test/scala/org/apache/spark/scheduler/TaskResultGetterSuite.scala | Scala | apache-2.0 | 13,225 |
/*
* Copyright (c) 2010-2015 SAP SE.
* 2016-2018 The University of Sheffield.
*
* All rights reserved. This program and the accompanying materials
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://ww... | DASPA/DASCA | com.logicalhacking.dasca.crosslanguage/src/main/scala/com/logicalhacking/dasca/crosslanguage/builder/algorithms/ExecuteActionBasedChecker.scala | Scala | epl-1.0 | 4,191 |
package models.translations
import java.util._;
import javax.persistence._;
import javax.validation.constraints._;
import com.avaje.ebean.Model;
import play.data.format._;
import play.data.validation._;
import models.user.UserSession
import play.api.libs.json.Json
import play.api.libs.json._
import models.PaymentMeth... | marcin-lawrowski/felicia | app/models/translations/TranslationValue.scala | Scala | gpl-3.0 | 1,196 |
package shield.actors.config.upstream
import akka.actor.{Actor, ActorSystem, Props}
import akka.testkit.{TestActorRef, TestKit, TestProbe}
import org.scalatest.{MustMatchers, WordSpecLike}
import shield.actors.config.{ServiceDetails, UpstreamAggregatorMsgs}
import shield.config.{HttpServiceLocation, ServiceLocation, S... | RetailMeNot/shield | src/test/scala/shield/actors/config/upstream/S3UpstreamUpdaterSpec.scala | Scala | mit | 5,468 |
package tastytest
object TestMatchTypes {
def test1: MatchTypes.Elem[List[String]] = "hello"
def test2: String = new MatchTypes.Foo[List[String], "hello"].foo("hello")
}
| scala/scala | test/tasty/neg/src-2/TestMatchTypes_fail.scala | Scala | apache-2.0 | 177 |
package com.emotioncity.soriento.testmodels
import javax.persistence.Id
import com.emotioncity.soriento.ODocumentReader
import com.emotioncity.soriento.RichODocumentImpl._
import com.orientechnologies.orient.core.id.ORID
import com.orientechnologies.orient.core.record.impl.ODocument
/**
* Created by stream on 08.09... | dimparf/Soriento | src/test/scala/com/emotioncity/soriento/testmodels/LinkedMessage.scala | Scala | apache-2.0 | 397 |
package lila.socket
package actorApi
import play.api.libs.json.JsObject
import akka.actor.ActorRef
case class Connected[M <: SocketMember](
enumerator: JsEnumerator,
member: M)
case class Sync(uid: String, friends: List[String])
case class Ping(uid: String)
case class PingVersion(uid: String, version: Int)
case o... | Happy0/lila | modules/socket/src/main/actorApi.scala | Scala | mit | 789 |
package utils
import animatedPotato.protocol.protocol._
import play.api.libs.json.Json
case class ID(id: IdType)
object ID {
implicit val IDFormat = Json.format[ID]
}
| fikrimuhal/animated-potato | backend/AnimatedPotatoBackend/app/utils/ID.scala | Scala | gpl-3.0 | 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"); yo... | eribeiro/kafka | core/src/test/scala/unit/kafka/server/SaslApiVersionsRequestTest.scala | Scala | apache-2.0 | 3,974 |
import java.util.concurrent.{ThreadFactory, Executors}
import com.typesafe.config.Config
import org.http4s.{Request, Response}
import org.joda.time.{ReadablePeriod, Interval, ReadableInstant}
import techex.web.WebSocket
import scala.concurrent.{ExecutionContext, Future}
import scala.util.{Failure, Success}
import sca... | kantega/tech-ex-2015 | backend/src/main/scala/techex/package.scala | Scala | mit | 2,152 |
package com.theseventhsense.utils.collections
trait Counter {
def inc(): Unit
}
class ObservableIterator[T](iterator: Iterator[T], counter: Counter) extends Iterator[T] {
override def hasNext: Boolean = iterator.hasNext
override def next(): T = {
counter.inc()
iterator.next()
}
}
| 7thsense/utils-collections | core/src/main/scala/com/theseventhsense/utils/collections/ObservableIterator.scala | Scala | mit | 300 |
package autowire
import io.circe.Json
import io.circe.Decoder
import io.circe.Encoder
import io.circe.generic.auto._
import io.circe.parser._
import io.circe.syntax._
trait JsonSerializers extends autowire.Serializers[Json, Decoder, Encoder] {
//TODO error handling improvements (left cases)
override def write[AnyClas... | aholland/autowire-circe | server/app/autowire/AutoWireServer.scala | Scala | unlicense | 693 |
/*
* 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/amls-frontend | test/models/hvd/SalesChannelSpec.scala | Scala | apache-2.0 | 1,638 |
package amailp.intellij.robot.extensions
import com.intellij.lang.PsiStructureViewFactory
import com.intellij.psi.PsiFile
import com.intellij.ide.structureView._
import com.intellij.openapi.fileEditor.FileEditor
import com.intellij.openapi.project.Project
import amailp.intellij.robot.psi.RobotPsiFile
import amailp.int... | puhnastik/robot-plugin | src/main/scala/amailp/intellij/robot/extensions/RobotPsiStructureViewFactory.scala | Scala | gpl-3.0 | 769 |
package fpinscala.testing
import fpinscala.laziness.{Stream, Cons, Empty}
import fpinscala.state._
import fpinscala.parallelism._
import fpinscala.parallelism.Par.Par
import scala.util.Try
import Gen._
import Prop._
import java.util.concurrent.{Executors,ExecutorService}
/*
The library developed in this chapter goes ... | benkio/fpinscala | exercises/src/main/scala/fpinscala/testing/Gen.scala | Scala | mit | 6,406 |
System.out.println("here I am!")
| raymondpoling/bandit-script | resources/scala/script1.scala | Scala | epl-1.0 | 33 |
package controllers
import javax.inject.{Inject, Named}
import akka.actor.ActorRef
import models.actors.analyses.AnalysesActor
import models.db._
import models.form.AnalysesForm
import play.api.data.Form
import play.api.data.Forms._
import play.api.i18n.{I18nSupport, MessagesApi}
import play.api.mvc.Contro... | LeonardoZ/SAEB | app/controllers/AnalysesController.scala | Scala | mit | 1,722 |
package views.vrm_assign
object Timeout {
final val ExitId = "exit"
}
| dvla/vrm-assign-online | app/views/vrm_assign/Timeout.scala | Scala | mit | 74 |
import leon.lang._
object DaysToYears {
val base : Int = 1980
def isLeapYear(y : Int): Boolean = y % 4 == 0
def daysToYears(days : Int): Int = {
require(days > 0)
daysToYears1(base, days)._1
}
def daysToYears1(year : Int, days : Int): (Int, Int) = {
require(year >= base && days > 0)
if... | ericpony/scala-examples | testcases/repair/DaysToYears/DaysToYears2.scala | Scala | mit | 998 |
package proofpeer.proofscript.frontend
import proofpeer.general.StringUtils
import proofpeer.indent.{ParseTree => IndentParseTree, _}
import proofpeer.indent.regex._
import proofpeer.indent.{Constraint => CS}
import ParseTree._
import proofpeer.proofscript.logic.{Preterm, Syntax, Namespace}
class ProofScriptGrammar(... | proofpeer/proofpeer-proofscript | shared/src/main/scala/proofpeer/proofscript/frontend/ProofScriptGrammar.scala | Scala | mit | 34,657 |
/*
* 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-eval/jvm/src/test/scala/monix/eval/TaskBlockingSuite.scala | Scala | apache-2.0 | 2,067 |
/*
* 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 ... | maropu/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/dynamicpruning/CleanupDynamicPruningFilters.scala | Scala | apache-2.0 | 2,495 |
package net.sansa_stack.inference.utils
/**
* @author Lorenz Buehmann
*/
object EntailmentRegimes {
sealed abstract class EntailmentRegime() {}
case object RDFS extends EntailmentRegime()
case object OWL extends EntailmentRegime()
}
| SANSA-Stack/SANSA-RDF | sansa-inference/sansa-inference-common/src/main/scala/net/sansa_stack/inference/utils/EntailmentRegimes.scala | Scala | apache-2.0 | 247 |
package org.openeyes.api.services.workflow
import org.bson.types.ObjectId
import org.openeyes.api.utils.Date._
import org.openeyes.api.forms.workflow.TicketForm
import org.openeyes.api.models.Patient
import org.openeyes.api.models.workflow.Ticket
/**
* Created by stu on 23/09/2014.
*/
object TicketService {
def ... | openeyes/poc-backend | src/main/scala/org/openeyes/api/services/workflow/TicketService.scala | Scala | gpl-3.0 | 1,629 |
package colossus.examples
import colossus.core._
import colossus.protocols.websocket._
import colossus.streaming.PushResult
import subprotocols.rawstring._
import akka.actor._
import scala.concurrent.duration._
class PrimeGenerator extends Actor {
var lastPrime = 1
def receive = {
case Next => sender() ! ... | tumblr/colossus | colossus-examples/src/main/scala/colossus.examples/WebsocketExample.scala | Scala | apache-2.0 | 2,964 |
package models.database
import models.ReportsModel
import ReportsModel._
import org.joda.time.LocalDate
import play.api.db.slick.Config.driver.simple._
object ReportsDatabase {
val reports = TableQuery[Reports]
}
case class ReportEntity(world: String, date: LocalDate, detected: Int, banned: Int, deleted: Int)
cla... | pvoznenko/play-slick-angular-test-example | app/models/database/ReportsDatabase.scala | Scala | mit | 948 |
package com.magmanics.licensing.client
import javax.ws.rs._
import javax.ws.rs.core.MediaType
import com.magmanics.auditing.model.{AuditCode, Audit}
import com.magmanics.auditing.service.AuditSearchDto
import org.jboss.resteasy.client.jaxrs.{BasicAuthentication, ResteasyClientBuilder}
/**
* REST Client for Licensin... | manicmonkey/licensing | Licensing-Client/src/main/scala/com/magmanics/licensing/client/AuditClient.scala | Scala | gpl-3.0 | 1,140 |
abstract class List {
def ::(a: Any) = new ::(a, this)
}
case object Nil extends List
case class ::(head: Any, tail: List) extends List
object Main extends App {
def show(lst: List) {
lst match {
case ::(h, t) => { println(h); show(t) }
case Nil =>
}
}
val friends = "Fred" :: "Wilma" :... | yeahnoob/scala-impatient-2e-code | src/ch14/sec13/List.scala | Scala | gpl-3.0 | 493 |
/*
* Copyright 2014–2018 SlamData Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | slamdata/slamengine | ejson/src/test/scala/quasar/ejson/DecodeEjsonSpec.scala | Scala | apache-2.0 | 1,285 |
package org.jetbrains.plugins.scala
package lang
package psi
package api
package expr
import com.intellij.psi.PsiElement
/**
* @author Alexander Podkhalyuzin
* Date: 06.03.2008
*/
trait ScIf extends ScExpression {
def condition: Option[ScExpression]
def thenExpression: Option[ScExpression]
def e... | JetBrains/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/lang/psi/api/expr/ScIf.scala | Scala | apache-2.0 | 769 |
package org.apache.hadoop.mapred
import org.apache.hadoop.fs.FileSystem
import org.apache.hadoop.fs.Path
import org.apache.hadoop.util.ReflectionUtils
import org.apache.hadoop.io.NullWritable
import org.apache.hadoop.io.Text
import java.text.SimpleDateFormat
import java.text.NumberFormat
import java.io.IOException
im... | koeninger/spark | core/src/main/scala/spark/HadoopWriter.scala | Scala | bsd-3-clause | 5,482 |
package app
import org.scalatra._
import scalate.ScalateSupport
import org.json4s.{DefaultFormats, Formats}
import org.scalatra.json._
import controllers.MenuData
class pageApiServletJson extends ResumeAppStack with JacksonJsonSupport {
protected implicit val jsonFormats: Formats = DefaultFormats
before() {
... | gregoryboucher/resume-app | src/main/scala/app/pageApiServlet.scala | Scala | mit | 496 |
package intellij.haskell.runconfig.console
import java.util.concurrent.ConcurrentHashMap
import com.intellij.openapi.editor.Editor
import com.intellij.openapi.project.Project
import com.intellij.psi.PsiFile
import scala.collection.concurrent
import scala.jdk.CollectionConverters._
object HaskellConsoleViewMap {
p... | rikvdkleij/intellij-haskell | src/main/scala/intellij/haskell/runconfig/console/HaskellConsoleViewMap.scala | Scala | apache-2.0 | 1,073 |
/**
* Copyright (C) 2009-2015 Typesafe Inc. <http://www.typesafe.com>
*/
package akka.io
import java.net.DatagramSocket
import java.net.InetSocketAddress
import com.typesafe.config.Config
import scala.collection.immutable
import akka.io.Inet.{ SoJavaFactories, SocketOption }
import akka.util.Helpers.Requiring
import... | jmnarloch/akka.js | akka-js-actor/jvm/src/main/scala/akka/io/Udp.scala | Scala | bsd-3-clause | 13,086 |
import javax.inject.Inject
import play.api.OptionalDevContext
import play.api.http._
import play.api.mvc._
import play.api.mvc.request.RequestTarget
import play.api.routing.Router
import play.core.WebCommands
/**
* Handles all requests.
*
* https://www.playframework.com/documentation/latest/ScalaHttpRequestHandl... | gengstrand/clojure-news-feed | server/feed12/app/RequestHandler.scala | Scala | epl-1.0 | 2,067 |
/*
* Copyright © 2014 TU Berlin (emma@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 by app... | aalexandrov/emma | emma-language/src/main/scala/org/emmalanguage/compiler/lang/backend/Backend.scala | Scala | apache-2.0 | 1,178 |
package org.bitcoins.commons.jsonmodels.cli
import org.bitcoins.commons.serializers.Picklers
import org.bitcoins.core.protocol.dlc.models.DLCPayoutCurve
import org.bitcoins.core.protocol.tlv.{
ContractDescriptorTLV,
ContractDescriptorV0TLV,
ContractDescriptorV1TLV,
DLCSerializationVersion,
DigitDecomposition... | bitcoin-s/bitcoin-s | app-commons/src/main/scala/org/bitcoins/commons/jsonmodels/cli/ContractDescriptorParser.scala | Scala | mit | 1,805 |
package p04Euler
import p05Func.Prime
object SumOfPrime {
def main(args: Array[String]): Unit = {
val lp = Prime.listPrime
println(lp.takeWhile(_ < 2000000).toList.sum)
println(lp.takeWhile(_ < 10).toList.sum)
}
}
| vkubicki/ScalaTest | src/main/scala/p04Euler/010 - SumOfPrime.scala | Scala | mit | 243 |
package vtpassim
import org.apache.spark.sql.SparkSession
case class ONBRecord(id: String, issue: String, series: String, seq: Int,
date: String, text: String, page_access: String, book_access: String)
object ONB {
def main(args: Array[String]) {
val spark = SparkSession.builder().appName("ONB import").getOr... | ViralTexts/vt-passim | src/main/scala/ONB.scala | Scala | apache-2.0 | 1,589 |
package xyz.hyperreal.btree
import collection.SortedMap
import collection.mutable.{Map, MapLike, AbstractMap}
object MutableSortedMap {
private val DEFAULT_ORDER = 10
}
class MutableSortedMap[K <% Ordered[K], V]( btree: BPlusTree[K, V] ) extends SortedMap[K, V] {
def this() = this( new MemoryBPlusTree[K, V](Mutab... | edadma/b-tree | src/main/scala/MutableSortedMap.scala | Scala | isc | 1,963 |
/*
* 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 ... | szhem/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/statefulOperators.scala | Scala | apache-2.0 | 18,423 |
/*
* 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/UDFRegistration.scala | Scala | apache-2.0 | 70,319 |
/**
* 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... | sabre1041/camel | components/camel-scala/src/test/scala/org/apache/camel/scala/CamelTestSupportTest.scala | Scala | apache-2.0 | 1,449 |
package one.lockstep.lock.client
trait LockParams
case class BasicLockParams(lockoutThreshold: Int) extends LockParams
| lockstep-one/vault | vault-client/src/main/scala/one/lockstep/lock/client/LockParams.scala | Scala | agpl-3.0 | 121 |
package org.kokho.scheduling
/**
* Created with IntelliJ IDEA on 5/28/15.
* @author: Mikhail Kokho
*
* Task is an immutable object that produces an infinite sequence of jobs.
*
* A task is specified by four parameters:
* offset - the release time of the first job
* execution... | mkokho/dynoslack | src/main/scala/org/kokho/scheduling/Task.scala | Scala | apache-2.0 | 1,663 |
/* __ *\\
** ________ ___ / / ___ __ ____ Scala.js tools **
** / __/ __// _ | / / / _ | __ / // __/ (c) 2013-2014, LAMP/EPFL **
** __\\ \\/ /__/ __ |/ /__/ __ |/_// /_\\ \\ http://scala-js.org/ **
** /____/\\___/... | colinrgodsey/scala-js | tools/shared/src/main/scala/org/scalajs/core/tools/optimizer/IRChecker.scala | Scala | bsd-3-clause | 32,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... | lindong28/kafka | core/src/main/scala/kafka/log/LogConfig.scala | Scala | apache-2.0 | 29,484 |
package org.jetbrains.plugins.scala
package lang
package transformation
package calls
/**
* @author Pavel Fatin
*/
class ExpandApplyCallTest extends TransformerTest(new ExpandApplyCall()) {
override protected val header: String =
"""
object O {
def apply(p: A) {}
def apply(p1: A, p2: A) {... | JetBrains/intellij-scala | scala/scala-impl/test/org/jetbrains/plugins/scala/lang/transformation/calls/ExpandApplyCallTest.scala | Scala | apache-2.0 | 1,238 |
package com.typesafe.slick.testkit.tests
import com.typesafe.slick.testkit.util.{RelationalTestDB, AsyncTest}
class RelationalScalarFunctionTest extends AsyncTest[RelationalTestDB] {
import tdb.profile.api._
def test = {
def check[T](q: Rep[T], exp: T) = q.result.map(_ shouldBe exp)
def checkLit[T : Colu... | nuodb/slick | slick-testkit/src/main/scala/com/typesafe/slick/testkit/tests/RelationalScalarFunctionTest.scala | Scala | bsd-2-clause | 2,695 |
package org.test
import org.nlogo.api
import api.Syntax._
import api.ScalaConversions._
import org.nlogo.api._
class ComputeMean extends api.DefaultReporter {
override def getSyntax = reporterSyntax(Array(Syntax.ListType), NumberType)
def average(numbers: Vector[Double]): Double = numbers.sum / numbers.length
... | Spatial-ABM-with-Netlogo/Chapitre-A | scala-plugin-netlogo-sbt/src/ComputeMean.scala | Scala | agpl-3.0 | 701 |
package edison.model.domain
import edison.model._
object ParamDefs {
def apply(params: ParamDef*): ParamDefs = {
new ParamDefs(params.toVector, Map[ParamName, ParamDef](params.map({ p => (p.name, p) }): _*))
}
}
/**
* An ordered set of ParamDefs that allows for accessing parameter definitions by name and by... | pawel-wiejacha/edison | core/src/main/scala/edison/model/domain/ParamDefs.scala | Scala | mit | 554 |
/*
* Copyright (c) 2014 Robert Conrad - All Rights Reserved.
* Unauthorized copying of this file, via any medium is strictly prohibited.
* This file is proprietary and confidential.
* Last modified by rconrad, 12/24/14 4:37 PM
*/
package base.rest.route
import akka.actor.ActorRefFactory
/**
* Builds the main e... | robconrad/base-api | project-rest/src/main/scala/base/rest/route/RestVersionsRouteFactory.scala | Scala | mit | 533 |
/*
* Demo of using by name implicits to resolve (hidden) divergence issues when
* traversing recursive generic structures.
*
* See http://stackoverflow.com/questions/25923974
*/
sealed trait HList
object HList {
implicit class Syntax[L <: HList](l: L) {
def ::[U](u: U): U :: L = new ::(u, l)
}
}
sealed tr... | som-snytt/dotty | tests/neg/byname-implicits-18.scala | Scala | apache-2.0 | 1,532 |
package org.ensime.fixture
import java.io.File
import java.nio.charset.Charset
import akka.actor.ActorSystem
import akka.testkit.TestProbe
import org.ensime.api._
import org.ensime.core.javac.JavaCompiler
import org.ensime.indexer._
import org.ensime.util._
import org.ensime.util.file._
import org.slf4j.LoggerFactory... | jacobono/ensime-server | core/src/it/scala/org/ensime/fixture/JavaCompilerFixture.scala | Scala | gpl-3.0 | 2,731 |
/*
* 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 ... | kimihe/Swallow | swallow-benchmark/HiBench-master/sparkbench/micro/src/main/scala/com/intel/sparkbench/micro/ScalaSort.scala | Scala | apache-2.0 | 2,233 |
package chat.tox.antox.utils
import java.io.{BufferedReader, File, InputStreamReader, Reader}
import java.net.URL
import java.nio.charset.Charset
import org.json.JSONObject
import scala.io.Source
object JsonReader {
private def readAll(rd: Reader): String = {
val sb = new StringBuilder()
var cp: Int = rd... | wiiam/Antox | app/src/main/scala/chat/tox/antox/utils/JsonReader.scala | Scala | gpl-3.0 | 1,190 |
package trivial.rest.caching
import scala.collection.mutable
/**
* Usage:
*
* class MemoDemo extends Memo {
* // Functions:
* private val func = (input: String) => { /* Do something expensive here */ }
* def memoisedFunction(input: String) = memo { func } (input)
*
* // Methods:
* private def ... | agmenc/trivial-rest | src/main/scala/trivial/rest/caching/Memo.scala | Scala | mit | 2,184 |
/*
* Copyright 2014 Dominic Scheurer
*
* This file is part of FSAUtilsGUI.
*
* FSAUtilsGUI 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 l... | rindPHI/FSAUtilsGUI | src/de/dominicscheurer/fsautils/gui/XMLEditor.scala | Scala | gpl-3.0 | 1,922 |
package com.bwsw.tstreamstransactionserver.netty.server.transactionMetadataService.stateHandler
case class KeyStreamPartition(stream: Int, partition: Int) {
def toByteArray: Array[Byte] = {
val buffer = java.nio.ByteBuffer.allocate(
java.lang.Integer.BYTES + java.lang.Integer.BYTES
)
buffer
... | bwsw/tstreams-transaction-server | src/main/scala/com/bwsw/tstreamstransactionserver/netty/server/transactionMetadataService/stateHandler/KeyStreamPartition.scala | Scala | apache-2.0 | 638 |
package ru.biocad.ig.common.structures.tree
import scala.collection.mutable
/**
* Created with IntelliJ IDEA.
* User: pavel
* Date: 03.06.14
* Time: 10:08
*/
class MultiTree[T](v : Option[T], w : Double) extends AbstractTree[T](v, w) {
private val _children = mutable.HashSet.empty[MultiTree[T]]
def this(v :... | zmactep/igcat | lib/ig-common/src/main/scala/ru/biocad/ig/common/structures/tree/MultiTree.scala | Scala | bsd-2-clause | 471 |
package de.leanovate.swaggercheck.shrinkable
import com.fasterxml.jackson.core.JsonGenerator
case object CheckJsNull extends CheckJsValue {
override def isNull: Boolean = true
override def generate(json: JsonGenerator): Unit = json.writeNull()
override def shrink: Stream[CheckJsValue] = Stream.empty
} | leanovate/swagger-check | json-schema-gen/src/main/scala/de/leanovate/swaggercheck/shrinkable/CheckJsNull.scala | Scala | mit | 312 |
package com.criteo.vizatra.vizsql
sealed trait Case { def format(str: String): String }
case object UpperCase extends Case { def format(str: String) = str.toUpperCase }
case object LowerCase extends Case { def format(str: String) = str.toLowerCase }
case object CamelCase extends Case {
def format(str: String) = str.... | criteo/vizsql | shared/src/main/scala/com/criteo/vizatra/vizsql/Show.scala | Scala | apache-2.0 | 5,520 |
package sgl.util
import org.scalatest.funsuite.AnyFunSuite
trait RandomProviderAbstractSuite extends AnyFunSuite with RandomProvider {
test("Two instances from same seed produces same stream of random data") {
val r1 = Random.fromSeed(77)
val r2 = Random.fromSeed(77)
assert(r1.nextInt() === r2.nextInt(... | regb/scala-game-library | core/src/test/scala/sgl/util/RandomProviderSuite.scala | Scala | mit | 830 |
class C1 {
def a {}
case class A
}
class C2 extends C1 {
def b {}
case class B
}
object O extends C2 {
def c {}
case class C
println(/* line: 2 */a)
println(/* line: 7 */b)
println(/* line: 12 */c)
println(super./* line: 2 */a)
println(super./* line: 7 */b)
println(super./* resolved: false *... | ilinum/intellij-scala | testdata/resolve2/inheritance/super/multiple/Object.scala | Scala | apache-2.0 | 764 |
/*
* 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/vat-registration-frontend | app/forms/DispatchFromWarehouseForm.scala | Scala | apache-2.0 | 915 |
import java.util.concurrent.TimeUnit
import actors.Messages._
import actors._
import akka.actor.{ActorSystem, ActorRef, Inbox, Props}
import scala.concurrent.duration.{FiniteDuration, Duration}
object Main {
lazy val system = ActorSystem("Test-Simulator")
val injectorIds = Array(10, 494, 222)
lazy val reaper... | barkhorn/actortester | src/main/scala/Main.scala | Scala | apache-2.0 | 1,613 |
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.