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 |
|---|---|---|---|---|---|
/* ___ _ ___ _ _ *\\
** / __| |/ (_) | | Your SKilL Scala Binding **
** \\__ \\ ' <| | | |__ <<debug>> **
** |___/_|\\_\\_|_|____| by: <<some developer>> ... | lordd/ScalaTFGenericBinding | src/de/ust/skill/scala/generic/FileParser.scala | Scala | bsd-3-clause | 14,647 |
package spark
import java.io._
import scala.collection.mutable.Map
class Accumulator[T] (
@transient initialValue: T,
param: AccumulatorParam[T])
extends Serializable {
val id = Accumulators.newId
@transient
var value_ = initialValue // Current value on master
val zero = param.zero(initialValue)... | javelinjs/spark | core/src/main/scala/spark/Accumulators.scala | Scala | bsd-3-clause | 2,431 |
/*
* 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 ... | zhangminglei/flink | flink-libraries/flink-table/src/test/scala/org/apache/flink/table/factories/utils/TestTableFormat.scala | Scala | apache-2.0 | 1,428 |
// Generated by the Scala Plugin for the Protocol Buffer Compiler.
// Do not edit!
//
// Protofile syntax: PROTO3
package com.google.protobuf.timestamp
object TimestampProto extends _root_.scalapb.GeneratedFileObject {
lazy val dependencies: Seq[_root_.scalapb.GeneratedFileObject] = Seq(
)
lazy val messagesComp... | dotty-staging/ScalaPB | scalapb-runtime/non-jvm/src/main/scala/com/google/protobuf/timestamp/TimestampProto.scala | Scala | apache-2.0 | 1,812 |
package org.openurp.edu.eams.teach.program.common.copydao.coursegroup
import org.openurp.edu.teach.plan.CourseGroup
import org.openurp.edu.eams.teach.program.CoursePlan
//remove if not needed
trait IPlanCourseGroupCopyDao {
def copyCourseGroup(sourceCourseGroup: CourseGroup, parentAttachTo: CourseGroup, planAttac... | openurp/edu-eams-webapp | plan/src/main/scala/org/openurp/edu/eams/teach/program/common/copydao/coursegroup/IPlanCourseGroupCopyDao.scala | Scala | gpl-3.0 | 352 |
case class Nat private (value: Int)
object Nat {
def apply(value: Int, disable: Boolean): Option[Nat] =
if (value < 0 || disable) None else Some(new Nat(value))
}
object Test {
val n1o = Nat(2) // error
val n2o = Nat(2, false) // ok
for (n <- n2o) yield n.copy() // error
} | lampepfl/dotty | tests/neg/private-case-class-constr.scala | Scala | apache-2.0 | 285 |
/*
* 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-cassandra/cassandra3/src/it/scala/com/spotify/scio/cassandra/CassandraIT.scala | Scala | apache-2.0 | 6,342 |
package filodb.stress
import com.opencsv.CSVReader
import org.apache.spark.rdd.RDD
import org.apache.spark.sql.{DataFrame, SaveMode, SQLContext}
import org.apache.spark.streaming.{Milliseconds, StreamingContext}
import org.apache.spark.{SparkContext, SparkConf}
import org.joda.time.DateTime
import scala.concurrent.dur... | markhamstra/FiloDB | stress/src/main/scala/filodb.stress/StreamingStress.scala | Scala | apache-2.0 | 4,943 |
package io.argos.agent.notifiers
import java.util
import akka.actor.{Actor, ActorLogging, Props}
import com.typesafe.config.ConfigFactory
import io.argos.agent.Constants
import io.argos.agent.bean.Notification
import Constants._
import scala.collection.JavaConverters._
/**
* Base class for each Notifier actor.
*
... | leleueri/argos | argos-agent/src/main/scala/io/argos/agent/notifiers/Notifier.scala | Scala | apache-2.0 | 3,017 |
package pages
import java.io.InputStream
import java.net.URLEncoder
import java.text._
import java.util.Date
import java.util.zip.ZipInputStream
import controllers.RootController.XSPageHandle
import net.liftweb.common.Full
import net.liftweb.http.SHtml
import net.liftweb.http.js.JsCmd
import net.liftweb.http.js.JsCmd... | slynx-fw/slynx-demo | app/pages/FlotChartsPage.scala | Scala | apache-2.0 | 12,653 |
package templemore.onx.version3
import org.scalatest.matchers.MustMatchers
import org.scalatest. {FeatureSpec, GivenWhenThen}
/**
* @author Chris Turner
*/
class WinScannerSpec extends FeatureSpec with GivenWhenThen with MustMatchers {
feature("The win scanner") {
scenario("can find a horizontal win on the ... | skipoleschris/OandX | src/test/scala/templemore/onx/version3/WinScannerSpec.scala | Scala | apache-2.0 | 3,261 |
package suiryc.scala.akka
import akka.actor.Terminated
import scala.concurrent.Future
object CoreSystem {
// Standard akka resources for non-blocking asynchronous code.
// Must not be used by blocking code.
object NonBlocking extends AkkaResources("non-blocking")
// Akka resources for blocking code.
//
... | suiryc/suiryc-scala | core/src/main/scala/suiryc/scala/akka/CoreSystem.scala | Scala | gpl-3.0 | 1,332 |
package org.jetbrains.plugins.scala.codeInsight.implicits
import java.awt._
import com.intellij.ide.ui.AntialiasingType
import com.intellij.openapi.editor.Editor
import com.intellij.openapi.editor.colors.EditorFontType
import com.intellij.openapi.editor.impl.EditorImpl
import com.intellij.openapi.editor.markup.{Effec... | JetBrains/intellij-scala | scala/codeInsight/src/org/jetbrains/plugins/scala/codeInsight/implicits/TextPartsHintRenderer.scala | Scala | apache-2.0 | 7,459 |
package com.gdax.client
import com.gdax.models.OrderParams.{CancelAfter, OrderType, Side, TimeInForce}
import org.scalatest.FunSuite
class OrderParamsSuite extends FunSuite {
test("TimeInForce.class.toString returns correct values in uppercase"){
assert(TimeInForce.GTC.toString == "GTC")
assert(TimeInForce.... | kramer425/gdax4s | src/test/scala/com/gdax/client/OrderParamsSuite.scala | Scala | mit | 1,033 |
package xyz.hyperreal.bvm
import java.util.NoSuchElementException
import scala.collection.mutable.ArrayBuffer
object VMListClass extends VMClass with VMBuilder {
val parent: VMClass = VMObjectClass
val name: String = "List"
val extending: List[VMType] = List(parent)
val members: Map[Symbol, VMMember] = Map()
... | edadma/funl | bvm/src/main/scala/xyz/hyperreal/bvm/VMListClass.scala | Scala | mit | 2,640 |
/*
* 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 ... | tophua/spark1.52 | external/kafka/src/main/scala/org/apache/spark/streaming/kafka/ReliableKafkaReceiver.scala | Scala | apache-2.0 | 13,442 |
package info.armado.ausleihe.client.graphics.screen
import info.armado.ausleihe.client.connection.RestServerConnection
import info.armado.ausleihe.client.graphics.components.controller.GameTableView
import info.armado.ausleihe.client.graphics.screen.FatalityState.{NonFatal, NonFatalInputReset, Reset}
import info.armad... | Spielekreis-Darmstadt/lending | lending-client-application/src/main/scala/info/armado/ausleihe/client/graphics/screen/ReturnGameScreen.scala | Scala | apache-2.0 | 6,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 not use this f... | transcendent-ai-labs/DynaML | dynaml-core/src/main/scala/io/github/mandar2812/dynaml/kernels/GaussianSpectralKernel.scala | Scala | apache-2.0 | 4,101 |
package org.ucombinator.jaam.util
import org.ucombinator.jaam.patterns.stmt._
import org.ucombinator.jaam.patterns.{LoopPatterns, State}
import soot.{Local, SootMethod, Value}
import soot.jimple.{Stmt => SootStmt, _}
import soot.jimple.toolkits.annotation.logic.{Loop => SootLoop}
import soot.toolkits.graph.LoopNestTre... | Ucombinator/jaam | src/main/scala/org/ucombinator/jaam/util/Loop.scala | Scala | bsd-2-clause | 10,989 |
/*
* 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 | infinity/common/src/main/scala/es/tid/cosmos/infinity/common/permissions/PermissionsMask.scala | Scala | apache-2.0 | 2,176 |
package lila.app
package templating
import controllers.routes
import lila.api.Context
import lila.tournament.Env.{ current => tournamentEnv }
import lila.tournament.{ Tournament, System, Schedule }
import lila.user.{ User, UserContext }
import play.api.libs.json.Json
import play.twirl.api.Html
trait TournamentHelper... | JimmyMow/lila | app/templating/TournamentHelper.scala | Scala | mit | 2,777 |
package lightmark.transformers
import scala.xml._
import lightmark._
object HTMLTransformer {
def convert(rst: reStructuredText): NodeSeq = {
rst match {
case Section(title, level) => Elem(null, "h" + level, Null, TopScope, Text(title))
case FormattedParagraph(inlines, literal) =>
<p>{inline... | vdichev/lightmark | src/main/scala/lightmark/transformers/HTMLTransformer.scala | Scala | apache-2.0 | 1,406 |
//
// Taranos Cloud Sonification Framework: Service Core
// Copyright (C) 2018 David Hinson, Netrogen Blue LLC (dhinson@netrogenblue.com)
//
// 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 F... | taranos/taranoscsf-core | src/main/scala/org/taranos/mc/trunk/intraprocess/TrunkModel.scala | Scala | agpl-3.0 | 66,410 |
package org.scalaide.core
package testsetup
import org.eclipse.jdt.core.IJavaProject
import org.eclipse.jdt.core.JavaCore
import org.eclipse.core.runtime.FileLocator
import org.eclipse.core.runtime.Platform
import java.io.ByteArrayInputStream
import java.io.File
import java.io.IOException
import java.io.InputStream
im... | Kwestor/scala-ide | org.scala-ide.sdt.core.tests/src/org/scalaide/core/testsetup/SDTTestUtils.scala | Scala | bsd-3-clause | 14,981 |
/*
* 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/core/src/main/scala/org/apache/spark/sql/Dataset.scala | Scala | apache-2.0 | 101,651 |
/*
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
distr... | zirpins/scalding | scalding-commons/src/test/scala/com/twitter/scalding/commons/source/storehaus/cassandra/VersionedCassandraStoreInitializerSpec.scala | Scala | apache-2.0 | 6,435 |
/*
* 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... | wangyixiaohuihui/spark2-annotation | core/src/test/scala/org/apache/spark/ThreadingSuite.scala | Scala | apache-2.0 | 8,083 |
package provingground
import provingground.HoTT._
import provingground.Contexts._
//import provingground.Context.Context.empty
import scala.reflect.runtime.universe.{
Try => UnivTry,
Function => FunctionUniv,
_
}
import annotation._
/**
* Recursion and induction for inductive type families.
* A lot of the... | siddhartha-gadgil/ProvingGround | digressions/src/main/scala/provingground/RecursionIndexed.scala | Scala | mit | 9,742 |
package jsonslim
import org.json4s._
import org.json4s.native.JsonMethods._ // for parseOpt
/** Interface for parsing json from arbitrary sources */
trait Src[T] {
def apply(a: T): Option[JValue]
def unapply(jv: JValue): T
}
object Src {
implicit object Str extends Src[String] {
def apply(in: String) = par... | meetup/json-slim | src/main/scala/src.scala | Scala | mit | 579 |
/*
* 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... | yiheng/BigDL | spark/dl/src/test/scala/com/intel/analytics/bigdl/keras/MeanSquaredLogarithmicCriterionSpec.scala | Scala | apache-2.0 | 1,783 |
/*
* -╥⌐⌐⌐⌐ -⌐⌐⌐⌐-
* ≡╢░░░░⌐\\░░░φ ╓╝░░░░⌐░░░░╪╕
* ╣╬░░` `░░░╢┘ φ▒╣╬╝╜ ░░╢╣Q
* ║╣╬░⌐ ` ╤▒▒▒Å` ║╢╬╣
* ╚╣╬░⌐ ╔▒▒▒▒`«╕ ╢╢╣▒
* ╫╬░░╖ .░ ╙╨╨ ╣╣╬░φ ╓φ░╢╢Å
* ╙╢░░░░⌐"░░░╜ ╙Å░░░░⌐░░░░╝`
* ``˚¬ ⌐ ˚˚⌐´
*
* ... | Flipkart/connekt | commons/src/test/scala/com/flipkart/connekt/commons/tests/utils/ConfigUtilsTest.scala | Scala | mit | 968 |
package org.jetbrains.plugins.scala
package lang
package actions
package editor
package autobraces
class AutoBracesTypingTest extends AutoBraceTestBase {
// def testBlubBlub(): Unit = checkGeneratedTextAfterTyping(
// s"""
// |for (e <- expr)
// | $CARET
// | expr
// |""".stripMargin,
// ... | JetBrains/intellij-scala | scala/scala-impl/test/org/jetbrains/plugins/scala/lang/actions/editor/autobraces/AutoBracesTypingTest.scala | Scala | apache-2.0 | 8,997 |
package com.calclavia.graph.node
import java.util.function.Supplier
import java.util.{Optional, Set => JSet}
import nova.core.block.Block
import nova.core.util.Direction
import nova.core.util.transform.vector.Vector3i
import nova.core.world.World
import scala.collection.convert.wrapAll._
/**
* A node that connects... | halvors/Graph-Plugin | src/main/scala/com/calclavia/graph/node/BlockConnectable.scala | Scala | lgpl-3.0 | 1,941 |
/*
* 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 | mllib/src/test/scala/org/apache/spark/ml/classification/RandomForestClassifierSuite.scala | Scala | apache-2.0 | 11,641 |
package com.wordtrellis.projecteuler
/**
* Problem 21
* Let d(n) be defined as the sum of proper divisors of n
* (numbers less than n which divide evenly into n).
* If d(a) = b and d(b) = a, where a != b, then a and b are an amicable pair
* and each of a and b are called amicable numbers.
*
* For example... | todd-cook/Effective-Scala-with-Project-Euler | src/main/scala/com/wordtrellis/projecteuler/problem_21.scala | Scala | mit | 1,316 |
package es.upm.fi.oeg.siq.sparql
import com.hp.hpl.jena.sparql.engine.binding.BindingMap
import com.hp.hpl.jena.rdf.model.ModelFactory
import com.hp.hpl.jena.sparql.core.Var
import com.hp.hpl.jena.sparql.engine.ResultSetStream
import com.hp.hpl.jena.sparql.resultset.JSONOutput
import collection.JavaConversions._
import... | jpcik/morph | morph-core/src/main/scala/es/upm/fi/oeg/siq/sparql/SparqlResults.scala | Scala | apache-2.0 | 1,618 |
package com.tribbloids.spookystuff.utils
import java.util.concurrent.Executors
import org.apache.spark.{FutureAction, Partition}
import org.apache.spark.rdd.RDD
import org.apache.spark.sql.utils.SparkHelper
import scala.concurrent.{ExecutionContext, ExecutionContextExecutor}
import scala.reflect.ClassTag
case class... | tribbloid/spookystuff | core/src/main/scala/com/tribbloids/spookystuff/utils/PartitionExecution.scala | Scala | apache-2.0 | 1,521 |
package scala.meta.internal.javacp.asm
class FieldSignatureVisitor extends JavaTypeSignatureVisitor(false)
| MasseGuillaume/scalameta | semanticdb/metacp/src/main/scala/scala/meta/internal/javacp/asm/FieldSignatureVisitor.scala | Scala | bsd-3-clause | 108 |
/*
* Copyright 2017 PayPal
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writin... | akara/squbs | squbs-unicomplex/src/main/scala/org/squbs/unicomplex/Headers.scala | Scala | apache-2.0 | 1,899 |
// Databricks notebook source
// MAGIC %md
// MAGIC
// MAGIC # [SDS-2.2, Scalable Data Science](https://lamastex.github.io/scalable-data-science/sds/2/2/)
// COMMAND ----------
// MAGIC %md
// MAGIC This is an elaboration of the [http://spark.apache.org/docs/latest/sql-programming-guide.html](http://spark.apache.org... | raazesh-sainudiin/scalable-data-science | db/2/2/007d_SparkSQLProgGuide_HW.scala | Scala | unlicense | 30,592 |
package io.tripod.pipeline.osm.pbf.model
import crosby.binary.fileformat.Blob
sealed trait BlockType
object BlockType {
case object OSMHeader extends BlockType
case object OSMData extends BlockType
}
case class FileBlock(blockType: BlockType, blob: Blob)
| tripod-oss/osm-pbf-pipeline | src/main/scala/io/tripod/pipeline/osm/pbf/model/FileBlock.scala | Scala | mit | 264 |
object Test extends App {
def getClause[T](clauses: List[T]): Option[T] = {
for (c <- clauses) {
return Some(c)
}
return None
}
println(getClause(List(1, 2, 3)))
}
| lampepfl/dotty | tests/run/t0042.scala | Scala | apache-2.0 | 188 |
package controllers.tabs
import play.api.mvc.Controller
import play.api.mvc.Action
import de.fuberlin.wiwiss.silk.workspace.User
import de.fuberlin.wiwiss.silk.util.DPair
import de.fuberlin.wiwiss.silk.evaluation.LinkageRuleEvaluator
object Editor extends Controller {
def editor(projectName: String, taskName: Stri... | fusepoolP3/p3-silk | silk-workbench/app/controllers/tabs/Editor.scala | Scala | apache-2.0 | 2,700 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | ddna1021/spark | sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/StringExpressionsSuite.scala | Scala | apache-2.0 | 38,106 |
/**
* This file is part of the TA Buddy project.
* Copyright (c) 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 of t... | digimead/digi-TABuddy-desktop | part-core-keyring/src/main/scala/org/digimead/tabuddy/desktop/core/keyring/random/api/XSecureRandom.scala | Scala | agpl-3.0 | 3,014 |
package com.bot4s.telegram.methods
import com.bot4s.telegram.models.File
/**
* Use this method to get basic info about a file and prepare it for downloading.
* For the moment, bots can download files of up to 20MB in size. On success, a File object is returned.
* The file can then be downloaded via the link https:... | mukel/telegrambot4s | core/src/com/bot4s/telegram/methods/GetFile.scala | Scala | apache-2.0 | 695 |
package sandbox.actors
import akka.actor.ActorSystem
import akka.routing.FromConfig
import akka.testkit.{ImplicitSender, DefaultTimeout, TestKit}
import org.junit.runner.RunWith
import org.scalatest.{BeforeAndAfterAll, Matchers, WordSpecLike}
import org.scalatest.junit.JUnitRunner
import sandbox.ActorActivator.{start,... | jkonermann/Hello-World | src/test/scala/sandbox/actors/PingTest.scala | Scala | apache-2.0 | 1,306 |
// timber -- Copyright 2012-2021 -- Justin Patterson
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable l... | scalawag/timber | timber-backend/src/main/scala/org/scalawag/timber/backend/receiver/formatter/timestamp/TimestampFormatter.scala | Scala | apache-2.0 | 3,574 |
package step2
object Runner1 {
class Tag[T]
def i[T](tag1: Tag[T], tag2: Tag[T]): List[Tag[T]] = List(tag1, tag2)
class Item1
class Item2
class Item3
class Di1
class Di2
class 底数2 extends 底Positive[底数1, Item1]
class 底数1 extends 底1[底数2]
i(new Tag[log#run[底数2, 指数1]], new Tag[隐数Positive[隐数1, Item... | djx314/ubw | a33-对数/src/main/scala/step2/Runner1.scala | Scala | bsd-3-clause | 1,406 |
package chana.jpql
import chana.avro.Projection
import chana.jpql.nodes._
import chana.schema.SchemaBoard
import org.apache.avro.Schema
import scala.collection.immutable
final case class Metadata(projectionSchema: Schema, withGroupby: Boolean)
final class JPQLMetadataEvaluator(jpqlKey: String, schemaBoard: SchemaBoa... | matthewtt/chana | src/main/scala/chana/jpql/JPQLMetadataEvaluator.scala | Scala | apache-2.0 | 6,610 |
package com.nulabinc.backlog.migration.common.service
import com.nulabinc.backlog.migration.common.client.params.ImportUpdateIssueParams
import com.nulabinc.backlog.migration.common.domain.BacklogComment
/**
* @author
* uchida
*/
trait CommentService {
def allCommentsOfIssue(issueId: Long): Seq[BacklogComment... | nulab/backlog-migration-common | core/src/main/scala/com/nulabinc/backlog/migration/common/service/CommentService.scala | Scala | mit | 712 |
/*
* Copyright 2017-2018 Iaroslav Zeigerman
*
* 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 ... | akkeeper-project/akkeeper | akkeeper/src/main/scala/akkeeper/storage/RecordAlreadyExistsException.scala | Scala | apache-2.0 | 862 |
package artisanal.pickle.maker
import models._
import parser._
import org.specs2._
import mutable._
import specification._
import scala.reflect.internal.pickling.ByteCodecs
import scala.tools.scalap.scalax.rules.scalasig._
import com.novus.salat.annotations.util._
import scala.reflect.ScalaSignature
class IntIntS... | julianpeeters/artisanal-pickle-maker | src/test/scala/doubleValueMember/IntIntSpec.scala | Scala | apache-2.0 | 906 |
/**
* Copyright (C) 2010-2012 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... | 0x6e6562/diffa | kernel/src/main/scala/net/lshift/diffa/kernel/config/CachedServiceLimitsStore.scala | Scala | apache-2.0 | 5,235 |
package knot.msgpack.codec
import knot.msgpack.{Format, MsgPackInput, MsgPackOutput}
trait DoubleCodec extends Codec[Double] {
override def encode(out: MsgPackOutput, v: Double): Unit = {
out.putByteAndDouble(Format.FLOAT64, v)
}
override def decode(in: MsgPackInput): Double = {
val fb = in.getByte()
... | defvar/knot | knot-msgpack/src/main/scala/knot/msgpack/codec/DoubleCodec.scala | Scala | mit | 473 |
package controllers
import javax.inject.Inject
import models.User
import play.api.i18n.MessagesApi
import play.api.libs.json._
import scala.concurrent.ExecutionContext.Implicits.global
class Users @Inject() (val messagesApi: MessagesApi) extends api.ApiController {
def usernames = ApiAction { implicit request =>... | davidgraig/foosball | server/app/controllers/Users.scala | Scala | mit | 557 |
package org.http4s.servlet
import javax.servlet.{AsyncEvent, AsyncListener}
protected[servlet] abstract class AbstractAsyncListener extends AsyncListener {
override def onComplete(event: AsyncEvent): Unit = {}
override def onError(event: AsyncEvent): Unit = {}
override def onStartAsync(event: AsyncEvent): Unit ... | aeons/http4s | servlet/src/main/scala/org/http4s/servlet/AbstractAsyncListener.scala | Scala | apache-2.0 | 382 |
package com.twitter.finagle.postgresql.types
import java.nio.ByteBuffer
import java.nio.ByteOrder
import java.nio.charset.MalformedInputException
import java.nio.charset.StandardCharsets
import java.time.temporal.ChronoUnit
import com.twitter.finagle.postgresql.PgSqlClientError
import com.twitter.finagle.postgresql.Pg... | twitter/finagle | finagle-postgresql/src/test/scala/com/twitter/finagle/postgresql/types/ValueReadsSpec.scala | Scala | apache-2.0 | 15,127 |
package tpass
import tir._
trait TTypeEnvUnitPass extends TTypeEnvPass[Unit] {
override def default = ()
override def combine(x: Unit, y: Unit) = x
override def combineList(ls: List[Unit]) = ()
}
| j-c-w/mlc | src/main/scala/tpass/TTypeEnvUnitPass.scala | Scala | gpl-3.0 | 204 |
/*
* 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 ... | rjbhewei/zipkin | zipkin-query/src/test/scala/com/twitter/zipkin/query/adjusters/TimeSkewAdjusterSpec.scala | Scala | apache-2.0 | 15,795 |
package com.conekta
import java.net.URLEncoder
import scala.collection.JavaConversions.asJavaCollection
import scala.collection.JavaConversions.seqAsJavaList
import scala.util.Properties
import org.apache.http.client.ClientProtocolException
import org.apache.http.client.entity.UrlEncodedFormEntity
import org.apache.ht... | Wirwing/conekta-scala | src/main/scala/com/conekta/Requestor.scala | Scala | apache-2.0 | 5,287 |
/**
* Sequence transcription and complement. Delegated by the Sequence object.
* Note we take a functional approach (no reference to self).
*/
import org.biojava.bio.symbol._
import org.biojava.bio.seq._
import bio._
package bio {
package DNA {
object SequenceTranscription {
/**
* Convert DNA ... | shamim8888/bioscala | src/main/scala/bio/sequence/actions/transcribe.scala | Scala | bsd-2-clause | 3,156 |
package models
import java.util.UUID
import play.api.libs.concurrent.Execution.Implicits.defaultContext
import play.api.libs.json.Json
import play.modules.reactivemongo.ReactiveMongoApi
import reactivemongo.api.indexes.{Index, IndexType}
/** Stores the queried attributes for templating a link.
*
*/
case class Ta... | BonarBeavis/veritask | app/models/Task.scala | Scala | apache-2.0 | 626 |
package at.logic.gapt.proofs.resolution.algorithms
import at.logic.gapt.language.fol.FOLSubstitution
import at.logic.gapt.expr._
import at.logic.gapt.proofs.lk.algorithms.subsumption.StillmanSubsumptionAlgorithmFOL
import at.logic.gapt.proofs.lk.base.FSequent
import at.logic.gapt.proofs.resolution.FClause
import at.lo... | gisellemnr/gapt | src/main/scala/at/logic/gapt/proofs/resolution/algorithms/fixDerivation.scala | Scala | gpl-3.0 | 12,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 ... | apache/flink | flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/planner/plan/optimize/program/FlinkChangelogModeInferenceProgram.scala | Scala | apache-2.0 | 42,155 |
object O {
def blerg = "O.blerg"
}
abstract class B {
def blerg = "B#Blerg"
}
object C extends B {
import O._
/* line: 6 */blerg
}
()
| LPTK/intellij-scala | testdata/resolve2/bug2/SCL2384A.scala | Scala | apache-2.0 | 145 |
package gapt.examples.church_numerals
import gapt.expr._
import scala.annotation.tailrec
/**
* A straightforward implementation of Church numerals. Numbers up to 50000 should work fine,
* above various functions (beta-reduction, substitution, printing, ...) run out of stack.
*/
object num {
@tailrec
def alph... | gapt/gapt | examples/ChurchNumerals.scala | Scala | gpl-3.0 | 1,932 |
package com.naokia.groonga4s.util.column
import com.fasterxml.jackson.databind.PropertyNamingStrategy.PropertyNamingStrategyBase
/**
* This strategy don't omit leading underscore.
*/
object SimpleLowerCaseWithUnderscoresStrategy extends PropertyNamingStrategyBase{
override def translate(propertyName: String): Str... | naokia/groonga4s | src/main/scala/com/naokia/groonga4s/util/column/SimpleLowerCaseWithUnderscoresStrategy.scala | Scala | apache-2.0 | 447 |
/*
* 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 ... | sgururajshetty/carbondata | datamap/mv/core/src/test/scala/org/apache/carbondata/mv/rewrite/MVCreateTestCase.scala | Scala | apache-2.0 | 55,971 |
abstract class Pupa{
def name:String
val pronounce = s"My name is $name"
def act:String
}
class Chef extends Pupa{
def name = "Chef"
override def act = s"Finaly, $name is doing something useful!"
}
println((new Chef).act)
println((new Chef).pronounce)
abstract class X(value:Boolean)
clas... | mkoltsov/AtomicScala | Advanced/AbstractClasses.scala | Scala | mit | 403 |
/*
* Copyright (C) 2012 The Regents of The University California.
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICEN... | sameeragarwal/blinkdb_dev | src/main/scala/shark/execution/ScriptOperatorHelper.scala | Scala | apache-2.0 | 1,482 |
/*
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 not use this f... | mandar2812/DynaML | dynaml-core/src/main/scala/io/github/tailhq/dynaml/models/gp/GPNarXModel.scala | Scala | apache-2.0 | 1,584 |
import sbt._
object Dependencies {
val scalaGitVersion = "4.3"
val jgitVersionOverride = Option(System.getProperty("jgit.version"))
val jgitVersion = jgitVersionOverride.getOrElse("4.4.1.201607150455-r")
val jgit = "org.eclipse.jgit" % "org.eclipse.jgit" % jgitVersion
// the 1.7.2 here matches slf4j-api... | rtyley/bfg-repo-cleaner | project/dependencies.scala | Scala | gpl-3.0 | 1,288 |
import org.joda.time._
import org.scalacheck._
import Arbitrary._
import Gen._
object ScheduleScalaCheck {
import scala.collection.JavaConversions._
import Schedule._
val MAX_REGION_SIZE = 3
val TIME_ZONE_IDS = DateTimeZone.getAvailableIDs.toIndexedSeq
val TIME_ZONE_ID_SIZE = TIME_ZONE_IDS.size
lazy v... | davidhoyt/simple-deployment-scheduler | src/test/scala/ScheduleScalaCheck.scala | Scala | apache-2.0 | 1,585 |
package com.kgrodzicki.chessproblem
sealed trait Piece {
def x: Int
def y: Int
def isAttacking(p: Piece): Boolean
}
case class Rook(x: Int, y: Int) extends Piece {
override def isAttacking(p: Piece) = p.x == x || p.y == y
override def toString = "R"
}
case class King(x: Int, y: Int) extends Piece {
ov... | kgrodzicki/ChessProblem | src/main/scala/com/kgrodzicki/chessproblem/Model.scala | Scala | mit | 1,538 |
package dhg.ccg.prob
import org.junit.Test
import dhg.util.StringUtil._
import org.junit.Assert._
class ProbabilityDistributionTests {
}
| dhgarrette/2014-ccg-supertagging | src/test/scala/dhg/ccg/prob/ProbabilityDistributionTests.scala | Scala | apache-2.0 | 140 |
package chapter1
import org.scalatest.{FreeSpec, Matchers}
class Question3Spec extends FreeSpec with Matchers {
import Question3._
"Should be true" in {
isPermutation("abc", "cba") shouldBe true
isPermutation("abcdfe", "cbaedf") shouldBe true
}
"Should be false" in {
isPermutation("abc", "cb") sho... | alexandrnikitin/algorithm-sandbox | scala/src/test/scala/chapter1/Question3Spec.scala | Scala | mit | 438 |
/*
* 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 ... | tophua/spark1.52 | sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/ConditionalExpressionSuite.scala | Scala | apache-2.0 | 10,245 |
package main.scala.ProfileUpdater
import scala.xml._
import scala.xml.transform._
class ClearPermissions(transformer : Transformer) extends RewriteRule {
override def transform(n : Node) = n match {
case Elem(prefix, "fieldPermissions", _attrs, _scope, children @ _*)
if (transformer.isGoingToTransform((ch... | wojdyga/sfdc-profile-updater | src/main/scala/ProfileUpdater/ClearPermissions.scala | Scala | gpl-3.0 | 400 |
/*
* Copyright 2021 LINE Corporation
*
* LINE Corporation licenses this file to you 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
*
* Unless r... | line/armeria | sangria/sangria_2.13/src/test/scala/com/linecorp/armeria/server/sangria/GraphqlTestUtil.scala | Scala | apache-2.0 | 1,835 |
/*
* CopiesSpec.scala
*
* Copyright 2017 wayfarerx <x@wayfarerx.net> (@thewayfarerx)
*
* 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.... | wayfarerx/dreamsleeve | shared/data/src/test/scala/net/wayfarerx/dreamsleeve/data/patch_data/CopiesSpec.scala | Scala | apache-2.0 | 1,281 |
package sangria.macros
import sangria.ast.AstLocation
import sangria.ast._
import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AnyWordSpec
import sangria.schema.AstNodeTransformer
class LiteralMacroSpec extends AnyWordSpec with Matchers {
"literal graphql macro" should {
"fail compilatio... | sangria-graphql/sangria | modules/core/src/test/scala/sangria/macros/LiteralMacroSpec.scala | Scala | apache-2.0 | 41,814 |
package io.github.junheng.akka.hbase.protocol
import java.io.{ByteArrayInputStream, ByteArrayOutputStream, DataInputStream, DataOutputStream}
import akka.serialization.SerializerWithStringManifest
import io.github.junheng.akka.hbase.protocol.HTableProtocol.{HPut, HPuts, HResult, HResults}
import io.github.junheng.akk... | junheng/akka-hbase | protocol/src/main/scala/io/github/junheng/akka/hbase/protocol/ProtocolSerializer.scala | Scala | mit | 6,195 |
package dotty.tools.scaladoc
package snippets
import dotty.tools.dotc.printing.RefinedPrinter
import dotty.tools.dotc.core._
import dotty.tools.dotc.printing.Texts._
import dotty.tools.dotc.core.Types._
import dotty.tools.dotc.core.Flags._
import dotty.tools.dotc.core.Names._
import dotty.tools.dotc.core.Symbols._
imp... | dotty-staging/dotty | scaladoc/src/dotty/tools/scaladoc/snippets/SelfTypePrinter.scala | Scala | apache-2.0 | 2,214 |
/*
* 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/CosineDistanceCriterion.scala | Scala | apache-2.0 | 4,227 |
/**
* 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... | ijuma/kafka | core/src/test/scala/unit/kafka/integration/UncleanLeaderElectionTest.scala | Scala | apache-2.0 | 11,727 |
package io.transwarp.midas.adaptor.tools
trait IRandomGenerator {
}
| transwarpio/rapidminer | api-driver/src/main/scala/io/transwarp/midas/adaptor/tools/IRandomGenerator.scala | Scala | gpl-3.0 | 70 |
package org.coursera.courier.data
import javax.annotation.Generated
import com.linkedin.data.ByteString
import com.linkedin.data.DataMap
import com.linkedin.data.DataList
import com.linkedin.data.schema.MapDataSchema
import com.linkedin.data.schema.DataSchema
import com.linkedin.data.template.DataTemplate
import co... | coursera/courier | scala/runtime/src/main/scala/org/coursera/courier/data/IntToIntMap.scala | Scala | apache-2.0 | 4,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 ... | akopich/spark | streaming/src/main/scala/org/apache/spark/streaming/dstream/PluggableInputDStream.scala | Scala | apache-2.0 | 1,190 |
/*
* Shadowsocks - A shadowsocks client for Android
* Copyright (C) 2014 <max.c.lv@gmail.com>
*
* 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 y... | a642500/shadowsocks-android | src/main/scala/com/github/shadowsocks/utils/Utils.scala | Scala | gpl-3.0 | 14,017 |
package akka.persistence.pg.journal
import akka.persistence.pg.util.PluginTestConfig
class TestPgAsyncWriteJournal extends PgAsyncWriteJournal {
override lazy val pluginConfig = new PluginTestConfig(context.system)
} | kwark/akka-persistence-postgresql | modules/akka-persistence-pg/src/main/scala/akka/persistence/pg/journal/TestPgAsyncWriteJournal.scala | Scala | mit | 222 |
package com.avast.syringe.config.init
import java.lang.reflect.Method
import java.util.Properties
import org.slf4j.LoggerFactory
/**
* User: vacata
* Date: 12/4/13
* Time: 11:18 PM
*
* Initialize values of given configuration trait from `.property` file.
*/
trait PropertyFileInitialization extends ExternalIniti... | avast/syringe | src/main/scala/com/avast/syringe/config/init/PropertyFileInitialization.scala | Scala | bsd-3-clause | 1,301 |
package scalation.analytics
/** The par package contains classes, traits and objects for
* analytics including classification, clustering and prediction
* with parallel implemtations.
*/
package object par { }
| mvnural/scalation | src/main/scala/scalation/analytics/par/package.scala | Scala | mit | 219 |
package spatutorial.client.modules
import diode.react.ReactPot._
import diode.react._
import diode.data.Pot
import japgolly.scalajs.react._
import japgolly.scalajs.react.vdom.prefix_<^._
import spatutorial.client.components.Bootstrap._
import spatutorial.client.components._
import spatutorial.client.logger._
import sp... | vmunier/scalajs-spa-tutorial | client/src/main/scala/spatutorial/client/modules/TODO.scala | Scala | apache-2.0 | 5,425 |
/*
* Copyright (c) 2018. Fengguo Wei and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License v2.0
* which accompanies this distribution, and is available at
* https://www.apache.org/licenses/LICENSE-2.0
*
* Detailed contributors ar... | arguslab/Argus-SAF | jawa/src/test/scala/org/argus/jawa/flow/summary/grammar/SafsuTest.scala | Scala | apache-2.0 | 5,563 |
/*
* Copyright 2012 The SIRIS Project
*
* 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... | simulator-x/vrpn-io | src/simx/components/vrpn/devices/WiiMote.scala | Scala | apache-2.0 | 2,401 |
/*
* Copyright 2020 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 | it/connectors/RequestEmailVerificationPasscodeConnectorISpec.scala | Scala | apache-2.0 | 2,787 |
/*
* 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 ... | duynguyen/incubator-openwhisk | tests/src/test/scala/system/basic/WskCliUnicodeNodeTests.scala | Scala | apache-2.0 | 1,227 |
//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
/** @author John Miller
* @version 1.3
* @date Wed Feb 20 17:39:57 EST 2013
* @see LICENSE (MIT style license file).
*/
package scalation.analytics.par
import scalation.linalgebra.VectoD
import scalation.linalgebra.par.{Ma... | NBKlepp/fda | scalation_1.3/scalation_modeling/src/main/scala/scalation/analytics/par/PolyRegression.scala | Scala | mit | 5,780 |
/*
* Copyright 2012 Eike Kettner
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to... | eikek/publet | ext/src/main/scala/org/eknet/publet/ext/counter/IpBlacklist.scala | Scala | apache-2.0 | 3,112 |
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.