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 |
|---|---|---|---|---|---|
/*
* 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/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JDBCRDD.scala | Scala | apache-2.0 | 13,645 |
package org.scaladebugger.api.dsl.watchpoints
import org.scaladebugger.api.lowlevel.events.data.JDIEventDataResult
import org.scaladebugger.api.lowlevel.requests.JDIRequestArgument
import org.scaladebugger.api.pipelines.Pipeline
import org.scaladebugger.api.profiles.traits.info.events.ModificationWatchpointEventInfo
i... | ensime/scala-debugger | scala-debugger-api/src/test/scala/org/scaladebugger/api/dsl/watchpoints/ModificationWatchpointDSLWrapperSpec.scala | Scala | apache-2.0 | 4,117 |
package controllers
import java.net.URLEncoder.encode
import net.scalytica.symbiotic.api.types.SymbioticDocument
import play.api.mvc.Result
import scala.concurrent.{ExecutionContext, Future}
import scala.util.control.NonFatal
trait FileStreaming { self: SymbioticController =>
val CT_DISP_ATTACHMENT = "attachment... | kpmeen/symbiotic | examples/symbiotic-server/app/controllers/FileStreaming.scala | Scala | apache-2.0 | 1,614 |
/**
* Copyright (C) 2013 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... | brunobuzzi/orbeon-forms | xforms/jvm/src/main/scala/org/orbeon/oxf/xforms/xbl/BindingDescriptor.scala | Scala | lgpl-2.1 | 13,524 |
package edu.gemini.pot.sp.validator
import edu.gemini.pot.sp.{ISPConflictFolder, SPComponentType, SPComponentBroadType, ISPNode}
import edu.gemini.pot.sp.SPComponentType._
object Types {
def initial = new Types(Set()).addNarrow[ISPConflictFolder](CONFLICT_FOLDER)
}
/** A set of NodeTypes. */
case class Types(node... | arturog8m/ocs | bundle/edu.gemini.pot/src/main/scala/edu/gemini/pot/sp/validator/Types.scala | Scala | bsd-3-clause | 1,046 |
package net.furikuri.cproxy.client
import java.net.InetSocketAddress
import java.util.UUID
import akka.actor.{Actor, ActorLogging, ActorRef, Props}
import akka.io.Tcp._
import akka.util.ByteString
import net.furikuri.cproxy.client.CloudProxyConnector.LocalResponse
object CloudProxyConnector {
final case class Loc... | FuriKuri/cloud-proxy | client/src/main/scala/net/furikuri/cproxy/client/CloudProxyConnector.scala | Scala | mit | 1,788 |
/*
* La Trobe University - Distributed Deep Learning System
* Copyright 2014 Matthias Langer (t3l@threelights.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.apa... | bashimao/ltudl | blaze/src/main/scala/edu/latrobe/blaze/modules/FilterLayerLike.scala | Scala | apache-2.0 | 9,595 |
package com.atomist.source.git
import java.io.File
import com.atomist.source.ArtifactSourceException
import org.scalatest.{FlatSpec, Matchers}
class NaiveFileSystemGitHubSourceReaderTest extends FlatSpec with Matchers {
def fakeReposForTest(): File = {
new File(getClass.getClassLoader.getResource("fake_repos_... | atomist/artifact-source | src/test/scala/com/atomist/source/git/NaiveFileSystemGitHubSourceReaderTest.scala | Scala | gpl-3.0 | 1,475 |
/*
* 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/test/scala/com/intel/analytics/bigdl/dllib/integration/torch/NarrowTableSpec.scala | Scala | apache-2.0 | 4,002 |
/*
* 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 ... | hvanhovell/spark | core/src/main/scala/org/apache/spark/scheduler/DAGScheduler.scala | Scala | apache-2.0 | 117,652 |
package slrn.feature
import org.scalatest.FunSuite
class FeaturesTest extends FunSuite {
test("feature combinations should work") {
val color = DiscreteFeature("color", "green")(2.0)
val size = DiscreteFeature("size", "XXL")(3.0)
val c1 = Feature.cross(color, size)
assert(c1.name == "color|size")
... | lorserker/slrn | src/test/scala/slrn/features.scala | Scala | mit | 551 |
/**
* 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... | wesley1001/orbeon-forms | src/main/scala/org/orbeon/oxf/fb/GridOps.scala | Scala | lgpl-2.1 | 20,813 |
/*
*
* Copyright (c) 2016 Sylvain Julmy
*
* 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 2 of the License, or
* (at your option) any later version.
*
* This program is... | SnipyJulmy/MSE_1617_PA | KlugHDL/src/main/scala/klughdl/core/model/Diagram.scala | Scala | gpl-2.0 | 2,790 |
class C {
def f(a:Int, b:Int) = 1
def f() = 2
}
object Test extends App {
val c = new C()
println(c.f(a = 1,2))
println(c.f(a = 1, b = 2))
println(c.f(b = 2, a = 1))
println(c.f())
}
| lampepfl/dotty | tests/run/t2488.scala | Scala | apache-2.0 | 197 |
import org.scalatest.prop.PropertyChecks
import org.scalatest.{FlatSpec, Matchers}
class YamlTest extends FlatSpec with Matchers with PropertyChecks {
import com.cj.serialization.yaml._
import com.cj.serialization.json.Json
import Fixtures._
behavior of "YamlCodecYaml"
it should "satisfy the first seriali... | cjdev/serialization | src/test/scala/YamlTest.scala | Scala | mit | 5,152 |
package org.broadinstitute.dsde.vault.datamanagement.util
import scala.reflect.runtime._
object Reflection {
def getObject[T](objectName: String): T = {
// via
// http://stackoverflow.com/questions/23466782/scala-object-get-reference-from-string-in-scala-2-10
// https://github.com/anvie/slick-test/b... | broadinstitute/vault-datamanagement | src/main/scala/org/broadinstitute/dsde/vault/datamanagement/util/Reflection.scala | Scala | bsd-3-clause | 637 |
package com.codahale.yoink.benchmarks
import collection.immutable.HashMap
import com.codahale.yoink.PersistentHashMap
import util.Random
import java.io.{PrintWriter, FileWriter}
object HashMapBenchmark {
val MaxItems = 100000
val MaxRandScope = MaxItems * 100
def buildSequentialStdLib() {
var m: Map[Int, I... | codahale/yoink | src/test/scala/com/codahale/yoink/benchmarks/HashMapBenchmark.scala | Scala | mit | 3,323 |
package backend.data.mongodb.dao
import backend.data.dao.PostDaoComponent
import backend.data.mongodb.service.UserDataServiceMongo
import backend.data.service.UserDataService
import com.mongodb.BasicDBList
import com.mongodb.casbah.commons.conversions.scala.RegisterJodaTimeConversionHelpers
import com.mongodb.casbah.c... | ExNexu/scablo | app/backend/data/mongodb/dao/PostDaoComponentMongo.scala | Scala | bsd-2-clause | 2,952 |
/*
* 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 ... | jackylk/incubator-carbondata | integration/spark/src/main/scala/org/apache/spark/sql/secondaryindex/events/SILoadEventListener.scala | Scala | apache-2.0 | 4,165 |
/*
* Copyright 2015 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 agreed t... | ericssmith/intellij-haskell | src/com/powertuple/intellij/haskell/util/OSUtil.scala | Scala | apache-2.0 | 1,010 |
/*
* 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... | twitter/storehaus | storehaus-core/src/main/scala/com/twitter/storehaus/WriteThroughStore.scala | Scala | apache-2.0 | 3,554 |
/*
* 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 ... | starpit/openwhisk | tests/src/test/scala/org/apache/openwhisk/core/loadBalancer/test/ShardingContainerPoolBalancerTests.scala | Scala | apache-2.0 | 21,147 |
package com.mbesida.dribble
import spray.json.DefaultJsonProtocol
package object model {
case class DribbbleUser(id: Long, name: String, username: String, shots_url: String)
case class Shot(id: Long, title: String, likes_url: String)
case class User(id: Long, name: String, username: String, likes: Int)
tr... | mbesida/dribble-stats | src/main/scala/com/mbesida/dribble/model/package.scala | Scala | apache-2.0 | 602 |
/*
* 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 | framework/lift-modules/lift-osgi/src/main/scala/net/liftweb/osgi/internal/Activator.scala | Scala | apache-2.0 | 6,435 |
// This file is machine-generated.
package org.apache.avro.scala.test.generated.scala {
import _root_.scala.collection.JavaConverters._
class RecordDefaultField(
val a : String
) extends org.apache.avro.scala.ImmutableRecordBase {
def copy(a : String = this.a): RecordDefaultField =
new RecordDefaultField(... | julianpeeters/avro | lang/scala/src/test/resources/testdata/org/apache/avro/scala/test/generated/scala/RecordWithDefaults.scala | Scala | apache-2.0 | 13,607 |
package org.jetbrains.plugins.scala
package compiler
import com.intellij.application.options.RegistryManager
import com.intellij.compiler.server.BuildManager
import com.intellij.openapi.diagnostic.Logger
import com.intellij.openapi.project.Project
import org.jetbrains.jps.incremental.scala.Client
import org.jetbrains.... | JetBrains/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/compiler/RemoteServerRunner.scala | Scala | apache-2.0 | 3,856 |
package com.blackboxsociety.json
import scala.util.parsing.combinator._
import scalaz._
object JsonParser extends RegexParsers {
override def skipWhitespace = false
val commaSep = padded(",")
val textChar = "[^\\",\\r\\n]".r
val asciiEsc: Parser[String] = "\\\\" | "\\"" | "/"
val backspaceEsc: Parser[S... | blackboxsociety/blackbox-json | src/main/scala/com/blackboxsociety/json/JsonParser.scala | Scala | mit | 2,051 |
package ohnosequences.mg7.loquats
import ohnosequences.mg7._
import ohnosequences.loquat._, utils.files._
import ohnosequences.statika._
import ohnosequences.{ flash => f }, f.api._
import ohnosequences.cosas._, types._, klists._
import ohnosequences.datasets._
import java.io.File
case class flashDataProcessing(val ... | ohnosequences/mg7 | src/main/scala/mg7/loquats/1.flash.scala | Scala | agpl-3.0 | 1,884 |
package nodes.images
import breeze.linalg.DenseVector
import org.apache.spark.rdd.RDD
import pipelines._
import utils.Image
/**
* Takes an image and converts it to a dense vector.
*/
object ImageVectorizer extends Transformer[Image, DenseVector[Double]] {
def apply(in: Image): DenseVector[Double] = {
DenseVec... | shivaram/keystone | src/main/scala/nodes/images/ImageVectorizer.scala | Scala | apache-2.0 | 341 |
/*
* Copyright (c) 2011 ScalaStuff.org (joint venture of Alexander Dvorkovyy and Ruud Diterwich)
*
* 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.o... | scalastuff/scalabeans | src/test/scala/org/scalastuff/proto/value/BeanValueHandlerTest.scala | Scala | apache-2.0 | 1,628 |
package com.ajjpj.adiagram_.ui.mouse
import com.ajjpj.adiagram_.ui.AScreenPos
/**
* @author arno
*/
private[mouse] trait ResizableMouseTrackerState extends MouseTrackerState {
private val boxHandles = new BoxHandles(ctrl)
private var keepBoxHandles = false
private val lineHandles = new LineHandles(ctrl)
p... | arnohaase/a-diagram | src/main/scala-old/com/ajjpj/adiagram_/ui/mouse/ResizableMouseTrackerState.scala | Scala | apache-2.0 | 1,022 |
package at.logic.gapt.proofs.lk.algorithms
import at.logic.gapt.expr._
import at.logic.gapt.language.schema.SchemaFormula
import at.logic.gapt.proofs.lk._
import at.logic.gapt.proofs.lk.base._
import at.logic.gapt.proofs.shlk._
import scala.util.control.TailCalls._
/**
* Removes the redundant weakenings and contrac... | gisellemnr/gapt | src/main/scala/at/logic/gapt/proofs/lk/algorithms/elimination.scala | Scala | gpl-3.0 | 26,167 |
/*
* Log.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 de.sciss... | Sciss/FScape-next | core/shared/src/main/scala/de/sciss/fscape/Log.scala | Scala | agpl-3.0 | 510 |
/*
Defines and enforces the basic functionality of all scalaSci Matrix types.
It also implements the common patterns of functionality for all matrix types.
The user should use these routines in order to have portable scalaSci code,
that can directly use different lower-level matrix libraries.
*/
package scalaSci
... | scalalab/scalalab | source/src/main/scala/scalaSci/scalaSciMatrix.scala | Scala | mit | 145,704 |
package org.scalaperf
package time
trait Time {
def time() = System.nanoTime
def timeDiff(start: Long, end: Long): Long = {
if (start > end) throw new IllegalStateException("Clock ran backwards: start = " + start + " > end = " + end)
else (end - start)
}
}
| tonymagne/scalaperf | src/main/scala/org/scalaperf/time/Time.scala | Scala | lgpl-3.0 | 275 |
/*
* Copyright (c) 2014-2018 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... | Wogan/monix | monix-reactive/shared/src/main/scala/monix/reactive/internal/builders/EvalAlwaysObservable.scala | Scala | apache-2.0 | 1,492 |
package fi.allacca
import android.app.{AlertDialog, DialogFragment, Dialog, Activity}
import android.os.Bundle
import android.util.TypedValue
import android.widget._
import android.view.ViewGroup.LayoutParams.MATCH_PARENT
import android.view.ViewGroup.LayoutParams.WRAP_CONTENT
import android.text.InputFilter
import an... | reaktor/allacca | src/main/scala/fi/allacca/editEvent.scala | Scala | gpl-3.0 | 21,570 |
class C(c: C) {
println(c.n) // error
val c2 = new C(this)
val n = 10
}
| lampepfl/dotty | tests/init/neg/soundness6.scala | Scala | apache-2.0 | 87 |
package controllers
import javax.inject.{Inject, Named}
import akka.pattern._
import akka.actor.ActorRef
import akka.util.Timeout
import animatedPotato.protocol.protocol.{Question => _, _}
import core.Jwt
import dao.{AnswerDAO, UserDAO}
import play.api.libs.json.Json
import models._
import models.Category
import play.... | fikrimuhal/animated-potato | backend/AnimatedPotatoBackend/app/controllers/InterviewController.scala | Scala | gpl-3.0 | 5,481 |
package org.jetbrains.plugins.scala
package lang.dependency
import com.intellij.openapi.application.ApplicationManager
import com.intellij.openapi.util.{Key, TextRange}
import com.intellij.psi._
import com.intellij.psi.scope.NameHint
import org.jetbrains.plugins.scala.extensions._
import org.jetbrains.plugins.scala.la... | triplequote/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/lang/dependency/Dependency.scala | Scala | apache-2.0 | 6,731 |
/* Copyright 2009-2021 EPFL, Lausanne */
import stainless.lang._
import stainless.annotation._
object RealNonDiscrete {
def nonDiscrete(x: Real): Boolean = {
require(x > Real(1) && x < Real(3))
x == Real(2)
}.holds
}
| epfl-lara/stainless | frontends/benchmarks/verification/invalid/RealNonDiscrete.scala | Scala | apache-2.0 | 233 |
package com.gx.proxy
import org.scalatest.{FlatSpec, Matchers}
/**
* Copyright 2017 josephguan
*
* 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/licens... | josephguan/scala-design-patterns | structural/proxy/src/test/scala/com/gx/proxy/ProxySpec.scala | Scala | apache-2.0 | 1,126 |
/*
* Copyright Β© 2017 Full 360 Inc
*
* 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,... | full360/prometheus_client_scala | client-finatra/src/test/scala/com/full360/prometheus/http/finatra/FinatraBaseSpec.scala | Scala | mit | 1,905 |
/* 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 scaps.scala.featureExtraction
import org.scalatest.Finders
import org.scalatest.FlatSpec
import org.scala... | scala-search/scaps | scala/src/test/scala/scaps/scala/featureExtraction/ScalaSourceExtractorDocCommentsSpecs.scala | Scala | mpl-2.0 | 2,679 |
package cpup.mc.oldenMagic.content.runes
import cpup.mc.oldenMagic.api.oldenLanguage.runes.SingletonRune
import cpup.mc.oldenMagic.api.oldenLanguage.runeParsing.TVerbRune
import cpw.mods.fml.relauncher.{Side, SideOnly}
import net.minecraft.util.IIcon
import cpup.mc.oldenMagic.OldenMagicMod
import cpup.mc.oldenMagic.ap... | CoderPuppy/oldenmagic-mc | src/main/scala/cpup/mc/oldenMagic/content/runes/HideRune.scala | Scala | mit | 1,328 |
package slick.compiler
import scala.collection.mutable.{ArrayBuffer, HashMap}
import slick.ast._
import Util._
import TypeUtil._
/** Expand table-valued expressions in the result type to their star projection. */
class ExpandTables extends Phase {
val name = "expandTables"
def apply(state: CompilerState) = state... | adamkozuch/slick | slick/src/main/scala/slick/compiler/Columnizer.scala | Scala | bsd-2-clause | 9,439 |
/*
* 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/controllers/msb/CETransactionsInNext12MonthsControllerSpec.scala | Scala | apache-2.0 | 8,061 |
/*
* Copyright (C) 2014 Szu-Hsien Lee (misgod.tw@gmail.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 applicable la... | misgod/twculture | src/main/scala/com/a30corner/twculture/DetailPlaceFragment.scala | Scala | apache-2.0 | 6,411 |
/**
* Copyright 2014 Dropbox, 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... | Wattpad/djinni | src/source/JNIGenerator.scala | Scala | apache-2.0 | 16,426 |
package η»δΉ 20
object Runner {
class Item1 {
override def toString: String = "Item1"
}
class Item2 {
override def toString: String = "Item2"
}
class Item3 {
override def toString: String = "Item3"
}
class Item4 {
override def toString: String = "Item4"
}
class Item5 {
override def ... | djx314/ubw | a28-η»δΉ /src/main/scala/η»δΉ 20/Runner.scala | Scala | bsd-3-clause | 2,181 |
package probability_monad
object Examples {
import Distribution._
/**
* If you flip a coin and it comes up heads 10 times, what is the probability you have
* the fair coin?
*/
case class CoinTrial(haveFairCoin: Boolean, flips: List[Coin])
def bayesianCoin(nflips: Int): Distribution[CoinTrial] = {
... | jliszka/probability-monad | src/main/scala/probability-monad/Examples.scala | Scala | apache-2.0 | 24,972 |
/*
* 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 ... | bowenli86/flink | flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/planner/runtime/batch/sql/TableScanITCase.scala | Scala | apache-2.0 | 4,680 |
package com.readclosely.snippet
/*
Copyright 2009-2010 Karl Pichotta
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... | kpich/readclosely | src/main/scala/com/readclosely/snippet/TmpUtil.scala | Scala | apache-2.0 | 1,270 |
package pl.newicom.dddd.messaging.event
case class EventMessageEntry(msg: OfficeEventMessage, position: Long)
| odd/akka-ddd | akka-ddd-messaging/src/main/scala/pl/newicom/dddd/messaging/event/EventMessageEntry.scala | Scala | mit | 111 |
package com.rasterfoundry.datamodel
import cats.syntax.either._
import io.circe._
sealed abstract class ExportType(val repr: String) {
override def toString = repr
}
object ExportType {
case object Dropbox extends ExportType("DROPBOX")
case object S3 extends ExportType("S3")
case object Local extends ExportT... | raster-foundry/raster-foundry | app-backend/datamodel/src/main/scala/ExportType.scala | Scala | apache-2.0 | 776 |
package scaladex.server.route
import scala.concurrent.ExecutionContext
import akka.http.scaladsl.model.Uri._
import akka.http.scaladsl.server.Directives._
import akka.http.scaladsl.server._
import scaladex.core.model.Env
import scaladex.core.model.UserState
import scaladex.core.model.search.Page
import scaladex.core.... | scalacenter/scaladex | modules/server/src/main/scala/scaladex/server/route/SearchPages.scala | Scala | bsd-3-clause | 2,725 |
package es.weso.schema
import es.weso.rdf._
import es.weso.rdf.nodes._
import es.weso.shapemaps.ShapeMap
import es.weso.utils.FileUtils
import cats.effect._
import es.weso.rdf.jena.RDFAsJenaModel
abstract class Schema {
/**
* Name of this schema. Example: ShEx, Shacl_TQ, ...
*/
def name: String... | labra/shaclex | modules/schema/src/main/scala/es/weso/schema/Schema.scala | Scala | mit | 2,122 |
package org.bfn.ninetynineprobs
object P32 {
/**
* Determine the greatest common divisor of two positive integer numbers. Use
* Euclid's algorithm.
**/
def gcd(a : Integer, b : Integer) : Integer = {
if (b == 0)
a
else
gcd(b, a%b)
}
}
| bfontaine/99Scala | src/main/scala/P32.scala | Scala | mit | 273 |
/*
* Copyright 2015 Delft University of Technology
*
* 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 appli... | tudelft-atlarge/graphalytics-platforms-graphx | src/main/scala/science/atlarge/graphalytics/graphx/lcc/LocalClusteringCoefficientJob.scala | Scala | apache-2.0 | 4,973 |
package sample.hello
import akka.actor._
import akka.routing._
import scala.collection.mutable
import scala.io.Source
import collection.JavaConversions._
import collection.mutable.{HashMap,MultiMap,Map,Set}
/**
* Created by root on 3/5/15.
*/
class ReturnedSourcePlagMatches extends Actor {
def manOf[T: Manifest](... | SteliosKats/Plagiarism_Detection_System_Using_Akka | src/main/scala/sample/hello/ReturnedSourcePlagMatches.scala | Scala | cc0-1.0 | 5,351 |
package idv.brianhsu.maidroid.plurk.activity
import android.content.Context
import android.content.DialogInterface
import android.content.Intent
import android.os.Bundle
import android.support.v7.app.ActionBarActivity
import android.view.Menu
import android.view.MenuItem
import idv.brianhsu.maidroid.plurk._
import idv... | brianhsu/MaidroidPlurk | src/main/scala/activity/CurrentUserActivity.scala | Scala | gpl-3.0 | 3,397 |
package notebook.server
import notebook.client.CalcRequest
import play.api.libs.json._
/**
* Author: Ken
*/
trait KernelMessage
case object RestartKernel extends KernelMessage
case object Shutdown extends KernelMessage
trait CalcServiceMessage
case class Unregister(ws:WebSockWrapper) extends CalcServiceMessage
ca... | dragos/spark-notebook | app/notebook/server/KernelMessage.scala | Scala | apache-2.0 | 559 |
import scala.collection.mutable.Map
import scala.collection.Set
import org.apache.spark._
import org.apache.spark.graphx._
// To make some of the examples work we will also need RDD
import org.apache.spark.rdd.RDD
object Question5 {
def parseContent(content: String): Set[String] = {
var m = scala.collection.mu... | luozhaoyu/big-data-system | assignment3/partC/src/main/scala/q5.scala | Scala | mit | 3,815 |
package com.eigengo.lift.exercise
import akka.actor.{ActorLogging, Props}
import akka.contrib.pattern.ShardRegion
import akka.persistence.PersistentView
import com.eigengo.lift.Exercise._
import com.eigengo.lift.common.UserId
import com.eigengo.lift.exercise.UserExercises.{ExerciseSuggestionsSetEvt, SessionEndedEvt, S... | imace/open-muvr | server/exercise/src/main/scala/com/eigengo/lift/exercise/UserExercisesStatistics.scala | Scala | apache-2.0 | 10,873 |
package com.arcusys.valamis.certificate.service.util
import java.io.{ BufferedReader, InputStreamReader }
import java.util
import org.apache.http.NameValuePair
import org.apache.http.client.entity.UrlEncodedFormEntity
import org.apache.http.client.methods.{ HttpGet, HttpPost }
import org.apache.http.impl.client.Defau... | ViLPy/Valamis | valamis-certificate/src/main/scala/com/arcusys/valamis/certificate/service/util/OpenBadgesHelper.scala | Scala | lgpl-3.0 | 3,975 |
/*
* Copyright (c) 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.apache.org/lice... | guardian/snowplow | 3-enrich/scala-common-enrich/src/main/scala/com.snowplowanalytics.snowplow.enrich/common/utils/JsonUtils.scala | Scala | apache-2.0 | 4,432 |
package com.github.gdefacci.briscola.presentation.sitemap
import org.obl.raz.Path
final case class SiteMap(players:Path, playerLogin:Path) | gdefacci/briscola | ddd-briscola-web/src/main/scala/com/github/gdefacci/briscola/presentation/sitemap/siteMap.scala | Scala | bsd-3-clause | 141 |
package latis.ops.math
import latis.dm.Dataset
import latis.ops.Operation
trait MathOperation extends Operation
object MathOperation {
def apply(op: (Double,Double) => Double, ds: Dataset): BinaryMathOperation = new BinaryMathOperation(op, ds)
def apply(op: => (Double) => Double): UnaryMathOperation = n... | dlindhol/LaTiS | src/main/scala/latis/ops/math/MathOperation.scala | Scala | epl-1.0 | 450 |
package eu.shiftforward
import scala.collection.SortedMap
import scala.collection.immutable.Queue
abstract class Simulation {
type Action = () => Unit
type Agenda = SortedMap[Long, Queue[Action]]
type Trigger = (() => Boolean, () => Unit)
protected var curtime = 0l
def currentTime: Long = curtime
privat... | hugoferreira/from-zero-to-computer | src/main/scala/eu/shiftforward/Simulation.scala | Scala | mit | 1,528 |
package com.originate.scalypher
import com.originate.scalypher.action.ActionItem
import com.originate.scalypher.action.ReturnAction
import com.originate.scalypher.action.ReturnAll
import com.originate.scalypher.action.ReturnDistinct
import com.originate.scalypher.action.ReturnReference
import com.originate.scalypher.p... | Originate/scalypher | src/main/scala/query/SetQuery.scala | Scala | mit | 2,351 |
package chapter2
import org.scalatest.funsuite.AnyFunSuite
class PropositionalFormulaTest extends AnyFunSuite {
test("someImportantTautologies") {
val p = Atom("p")
val q = Atom("q")
val r = Atom("r")
assert(Iff(Not(True), False).isTautology)
assert(Iff(Not(False), True).isTautology)
assert(... | inpefess/practical-logic-handbook | src/test/scala/chapter2/PropositionalFormulaTest.scala | Scala | mit | 1,582 |
/*
* (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-core | src/test/scala/cogx/reference/memory/RefFieldMemory.scala | Scala | apache-2.0 | 25,544 |
package org.infinispan.spark.test
import java.util.function.BooleanSupplier
import scala.annotation.tailrec
import scala.concurrent.duration.{Duration, _}
import scala.language.{implicitConversions, postfixOps}
import scala.util.{Failure, Success, Try}
object TestingUtil {
val DefaultDuration = 60 seconds
val... | vjuranek/infinispan-spark | src/test/scala/org/infinispan/spark/test/TestingUtil.scala | Scala | apache-2.0 | 1,384 |
/*
Copyright 2013 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... | rangadi/summingbird | summingbird-batch-hadoop/src/main/scala/com/twitter/summingbird/batch/BatchConfig.scala | Scala | apache-2.0 | 1,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 ... | facaiy/spark | sql/core/src/test/scala/org/apache/spark/sql/execution/metric/SQLMetricsTestUtils.scala | Scala | apache-2.0 | 11,989 |
package es.um.nosql.streaminginference.benchmark
import scala.collection.immutable.HashMap
object Benchmark {
val defaultOptions = HashMap[String, String](
"elements" -> "120",
"entities" -> "6",
"versions" -> "2",
"depth" -> "3",
"fields" -> "2",
"host" -> "localhost",
... | catedrasaes-umu/NoSQLDataEngineering | projects/es.um.nosql.streaminginference.benchmark/src/es/um/nosql/streaminginference/benchmark/Benchmark.scala | Scala | mit | 3,259 |
package me.yingrui.segment.core
import me.yingrui.segment.dict.IWord
import me.yingrui.segment.graph.IGraph
import me.yingrui.segment.graph.Path
import me.yingrui.segment.hmm._
import me.yingrui.segment.util.SerializeHandler
import collection.mutable.ListBuffer
class POSRecognizer extends IPOSRecognizer {
private ... | yingrui/mahjong | lib-segment/src/main/scala/me/yingrui/segment/core/POSRecognizer.scala | Scala | gpl-3.0 | 2,596 |
package org.jetbrains.plugins.scala
package lang
package psi
package impl
package toplevel
package imports
import com.intellij.lang.ASTNode
import com.intellij.psi.PsiElement
import com.intellij.psi.tree.IElementType
import org.jetbrains.plugins.scala.extensions._
import org.jetbrains.plugins.scala.lang.TokenSets.{ID_... | JetBrains/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/lang/psi/impl/toplevel/imports/ScImportSelectorImpl.scala | Scala | apache-2.0 | 3,974 |
/*
* Copyright 2013-2015 Websudos, Limited.
*
* 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,
* this list of c... | analytically/phantom | phantom-dsl/src/test/scala/com/websudos/phantom/tables/SecondaryIndexTable.scala | Scala | bsd-2-clause | 2,452 |
package concrete.runner
import java.net.URL
import java.security.InvalidParameterException
import com.typesafe.scalalogging.LazyLogging
import concrete._
import concrete.generator.FailedGenerationException
import concrete.generator.cspompatterns.FZPatterns
import concrete.heuristic._
import concrete.heuristic.branch.... | concrete-cp/concrete | src/main/scala/concrete/runner/FZConcrete.scala | Scala | lgpl-2.1 | 10,484 |
implicit def contMonad[R] = new Monad[Cont[R, ?]] {
def flatMap[A, B](ka: Cont[R, A])(kab: A => Cont[R, B]): Cont[R, B] =
Cont { hb =>
runCont(ka)(a => runCont(kab(a))(hb))
}
def pure[A](a: A): Cont[R, A] =
Cont(ha => ha(a))
} | hmemcpy/milewski-ctfp-pdf | src/content/3.5/code/scala/snippet29.scala | Scala | gpl-3.0 | 249 |
/*
* Copyright 2013 - 2020 Outworkers 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... | outworkers/phantom | phantom-dsl/src/test/scala/com/outworkers/phantom/builder/query/prepared/PreparedDeleteQueryTest.scala | Scala | apache-2.0 | 4,931 |
package be.wegenenverkeer.atomium.format
import java.lang.{Double => JDouble, Integer => JInteger, Long => JLong}
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter
import javax.xml.bind.annotation.{XmlAttribute, XmlElement, XmlElementRef, XmlValue}
import scala.annotation.meta.field
package object jaxb {
... | joachimvda/atomium | modules/format/src/main/scala/be/wegenenverkeer/atomium/format/jaxb/package.scala | Scala | mit | 527 |
package com.seanshubin.server
import scala.collection.mutable.ArrayBuffer
sealed abstract case class InternetMediaType(name: String) {
InternetMediaType.valuesBuffer += this
def matchesString(s: String) = name.equalsIgnoreCase(s)
}
object InternetMediaType {
private val valuesBuffer = new ArrayBuffer[Internet... | SeanShubin/schulze | server/src/main/scala/com/seanshubin/server/InternetMediaType.scala | Scala | unlicense | 1,101 |
/*
* 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 ... | gioenn/xSpark | mllib/src/main/scala/org/apache/spark/ml/feature/StandardScaler.scala | Scala | apache-2.0 | 7,873 |
/*
* 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 ... | tzulitai/flink | flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/api/validation/TableEnvironmentValidationTest.scala | Scala | apache-2.0 | 8,140 |
/***********************************************************************
* Copyright (c) 2013-2018 Commonwealth Computer Research, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and... | ddseapy/geomesa | geomesa-arrow/geomesa-arrow-datastore/src/main/scala/org/locationtech/geomesa/arrow/data/ArrowDataStoreFactory.scala | Scala | apache-2.0 | 3,137 |
/*
* 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 ... | hwstreaming/flink | flink-libraries/flink-table/src/main/scala/org/apache/flink/table/plan/rules/datastream/DataStreamValuesRule.scala | Scala | apache-2.0 | 1,806 |
package statla
import spire.math._
import scala.language.implicitConversions
package object Implicits {
implicit def Seq2Sample[T : Fractional, V : Numeric](elems: Seq[V]): Sample[T] = elems.length match {
case 0 => Util.emptySample[T]
case _ => Util.compute[T, V](elems)
}
}
| jvican/statla | src/main/scala/statla/Implicits.scala | Scala | mit | 291 |
/*
* Copyright 2017 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... | VlachJosef/bforms | app/uk/gov/hmrc/bforms/binders/ValueClassBinder.scala | Scala | apache-2.0 | 1,600 |
/*
* Copyright 2013 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... | twitter/chill | chill-protobuf/src/test/scala/com/twitter/chill/protobuf/ProtobufTest.scala | Scala | apache-2.0 | 2,603 |
package org.dele.misc
import java.io.InputStream
import org.apache.commons.io.IOUtils
import org.dele.misc.EntityData.EntDetail
/**
* Created by jiaji on 11/26/2016.
*/
object EntityDataFilter extends App {
import tgz.TgzUtil._
val defaultEncoding = "UTF-8"
def extractOne(in:InputStream):Map[String,EntD... | new2scala/text-util | misc/src/test/scala/org/dele/misc/EntityDataFilter.scala | Scala | apache-2.0 | 2,291 |
package cromwell
import wdl._
import wom.JobOutput
import wom.values.WomValue
package object engine {
implicit class EnhancedFullyQualifiedName(val fqn: FullyQualifiedName) extends AnyVal {
def scopeAndVariableName: (String, String) = {
val array = fqn.split("\\\\.(?=[^\\\\.]+$)")
(array(0), array(... | ohsu-comp-bio/cromwell | engine/src/main/scala/cromwell/engine/package.scala | Scala | bsd-3-clause | 530 |
package com.toscaruntime.compiler
import java.nio.file.{Files, Path, Paths}
import com.toscaruntime.compiler.tosca.CompilationResult
import com.toscaruntime.util.{ClassLoaderUtil, FileUtil}
import com.typesafe.scalalogging.LazyLogging
import org.scalatest.{BeforeAndAfter, MustMatchers, WordSpec}
class AbstractSpec e... | vuminhkh/tosca-runtime | compiler/src/test/scala/com/toscaruntime/compiler/AbstractSpec.scala | Scala | mit | 2,836 |
package com.ajjpj.adiagram_.model
import com.ajjpj.adiagram_.model.diagram._
import com.ajjpj.adiagram_.ui.fw.{Digest, Command}
import com.ajjpj.adiagram_.model.style._
import com.ajjpj.adiagram_.model.diagram.LiteralPosSource
import com.ajjpj.adiagram_.ui.ADiagramController
/**
* @author arno
*/
object DiagramMan... | arnohaase/a-diagram | src/main/scala-old/com/ajjpj/adiagram_/model/DiagramManipulation.scala | Scala | apache-2.0 | 2,313 |
package com.sksamuel.avro4s
import java.nio.file.Files
import org.apache.avro.file.DataFileReader
import org.apache.avro.generic.{GenericData, GenericDatumReader, GenericRecord}
import org.apache.avro.util.Utf8
import org.scalatest.concurrent.Timeouts
import org.scalatest.{Matchers, WordSpec}
class AvroSerializerTes... | Antwnis/avro4s | avro4s-core/src/test/scala/com/sksamuel/avro4s/AvroSerializerTest.scala | Scala | mit | 2,073 |
package com.fustigatedcat.heystk.engine.rule
import java.net.InetAddress
import com.fustigatedcat.heystk.common.normalization.Normalization
import com.typesafe.config.Config
import scala.collection.JavaConverters._
object RuleCriterion {
def create(config : Config) : RuleCriterion = config.getString("type").toLo... | fustigatedcat/heystk | engine/src/main/scala/com/fustigatedcat/heystk/engine/rule/RuleCriterion.scala | Scala | gpl-3.0 | 3,316 |
/*
* 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 ... | windeye/spark | streaming/src/main/scala/org/apache/spark/streaming/util/MasterFailureTest.scala | Scala | apache-2.0 | 15,497 |
import play.api._
import org.joda.time.DateTime
import models._
import anorm._
object Global extends GlobalSettings {
override def onStart(app: Application) {
// Create the initial token if no users exist
if(User.all.isEmpty && Token.all.isEmpty) {
Token.create(Token(Token.InitialToken, "", Toke... | PriscH/Foosball | app/Global.scala | Scala | gpl-3.0 | 2,488 |
import _root_.io.gatling.core.scenario.Simulation
import ch.qos.logback.classic.{Level, LoggerContext}
import io.gatling.core.Predef._
import io.gatling.http.Predef._
import org.slf4j.LoggerFactory
import scala.concurrent.duration._
/**
* Performance test for the Chauffage entity.
*/
class ChauffageGatlingTest exte... | CherifAbdoul/TpSirM1MIAGE_Ierlomenko-Kinfack-Haidara | tpJpa/src/test/gatling/simulations/ChauffageGatlingTest.scala | Scala | gpl-2.0 | 3,304 |
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.