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 my.game.pkg.screens
import my.game.pkg.utils.Utils._
import my.game.pkg.Asteroidsexample
import my.game.pkg.round.{Round, RoundState}
import my.game.pkg.Settings.{font_gen, sounds}
import com.badlogic.gdx.scenes.scene2d.{Stage, Actor}
import com.badlogic.gdx.scenes.scene2d.ui.{Table, Label, Skin, TextButton}
... | raymank26/asteroids-scala | common/src/main/scala/screens/game_screen.scala | Scala | gpl-3.0 | 2,256 |
package java
package object util {
implicit private[util] class CompareNullablesOps(val self: Any) extends AnyVal {
@inline
def ===(that: Any): Boolean =
if (self.asInstanceOf[AnyRef] eq null) that.asInstanceOf[AnyRef] eq null
else self.equals(that)
}
private[util] final case class Box[+K](... | renyaoxiang/scala-js | javalib/src/main/scala/java/util/package.scala | Scala | bsd-3-clause | 783 |
/*
* Copyright (c) 2014-2021 by The Monix Project Developers.
* See the project homepage at: https://monix.io
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache... | monifu/monifu | monix-reactive/shared/src/test/scala/monix/reactive/internal/operators/ExecuteOnObservableSuite.scala | Scala | apache-2.0 | 2,804 |
/*
* 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 ... | bravo-zhang/spark | core/src/main/scala/org/apache/spark/ui/exec/ExecutorsTab.scala | Scala | apache-2.0 | 2,041 |
/*
* 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/core/src/test/scala/org/apache/spark/sql/ColumnExpressionSuite.scala | Scala | apache-2.0 | 23,743 |
/**
* 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... | ramonmaruko/camel | components/camel-swagger/src/main/scala/org/apache/camel/component/swagger/DefaultCamelSwaggerServlet.scala | Scala | apache-2.0 | 2,252 |
/***
* Copyright 2014 Rackspace US, 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 applica... | tylerroyal/api-checker | core/src/main/scala/com/rackspace/com/papi/components/checker/step/results/BadMediaTypeResult.scala | Scala | apache-2.0 | 995 |
package org.jetbrains.sbt
package project
import com.intellij.ide.actions.OpenProjectFileChooserDescriptor
import com.intellij.openapi.vfs.VirtualFile
/**
* @author Pavel Fatin
*/
class SbtOpenProjectDescriptor extends OpenProjectFileChooserDescriptor(true) {
override def isFileVisible(file: VirtualFile, showHidd... | triggerNZ/intellij-scala | src/org/jetbrains/sbt/project/SbtOpenProjectDescriptor.scala | Scala | apache-2.0 | 604 |
package org.scalatra
package oauth2
package model
import scalaz._
import Scalaz._
import com.novus.salat.dao.SalatDAO
import databinding.Command
import com.novus.salat.Context
import OAuth2Imports._
import org.scalatra.validation.{ ValidationError, UnknownError }
trait CommandableDao[ObjectType <: Product] {
def ex... | scalatra/oauth2-server | src/main/scala/org/scalatra/oauth2/model/CommandableDao.scala | Scala | mit | 1,066 |
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
/** @author John Miller
* @version 1.2
* @date Sun Sep 23 21:14:14 EDT 2012
* @see LICENSE (MIT style license file).
*/
package scalation.analytics
import math.round
import scalation.linalgebra.{MatriD, MatrixD, MatrixI, V... | mvnural/scalation | src/main/scala/scalation/analytics/ClassifierInt.scala | Scala | mit | 6,183 |
package ru.imho.ddsmt
import java.text.SimpleDateFormat
import java.util.Date
import org.fusesource.jansi.AnsiConsole
import org.fusesource.jansi.Ansi._
import org.fusesource.jansi.Ansi.Color._
/**
* Created by skotlov on 11/17/14.
*/
object Logger {
private val dateFormat = new SimpleDateFormat("dd.MM.yyyy HH:m... | IMHOVi/ddsmt | ddsmt-engine/src/main/scala/ru/imho/ddsmt/Logger.scala | Scala | apache-2.0 | 705 |
class C {
val x = 1
object `$` {
val y = x + x
class abc$ {
def xy = x + y
}
object abc$ {
def xy = x + y
}
}
}
object Test extends App {
val c = new C()
println(c.`$`.y)
println(c.`$`.abc$.xy)
println(new c.`$`.abc$().xy)
}
| som-snytt/dotty | tests/run/t6888.scala | Scala | apache-2.0 | 272 |
package edu.berkeley
import com.fasterxml.jackson.databind.{JsonNode, ObjectMapper}
import com.fasterxml.jackson.module.scala.DefaultScalaModule
import scala.reflect._
package object veloxms {
type FeatureVector = Array[Double]
type WeightVector = Array[Double]
type UserID = Long
type Version = Long
// ... | amplab/velox-modelserver | veloxms-core/src/main/scala/edu/berkeley/veloxms/package.scala | Scala | apache-2.0 | 588 |
/**
* Copyright (C) 2010 Orbeon, Inc.
*
* This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU Lesser General Public License as published by the Free Software Foundation; either version
* 2.1 of the License, or (at your option) any later version.
*
* This program i... | joansmith/orbeon-forms | src/main/scala/org/orbeon/oxf/xforms/event/XFormsEvent.scala | Scala | lgpl-2.1 | 9,023 |
import sbt._
import Keys._
import sbtassembly.Plugin._
import AssemblyKeys._
object KafkaUtilsBuild extends Build {
def sharedSettings = Defaults.defaultSettings ++ assemblySettings ++ Seq(
version := "0.3.0-SNAPSHOT",
scalaVersion := "2.10.3",
organization := "com.quantifind",
scalacOptions := Seq(... | chandanbansal/KafkaOffsetMonitor | project/Build.scala | Scala | apache-2.0 | 2,180 |
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2015-2021 Andre White.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
... | adarro/ddo-calc | subprojects/common/ddo-core/src/main/scala/io/truthencode/ddo/support/naming/DescriptiveDisplay.scala | Scala | apache-2.0 | 770 |
package pregnaware.database.wrappers
import java.sql.Date
import java.time.LocalDate
import pregnaware.database.ConnectionManager._
import pregnaware.database.schema.Tables._
import pregnaware.user.entities.WrappedFriend
import slick.driver.MySQLDriver.api._
import scala.concurrent.Future
/** Friend-related functio... | jds106/pregnaware | service/src/main/scala/pregnaware/database/wrappers/FriendWrapper.scala | Scala | mit | 4,566 |
package com.alvin.niagara.schemaregistry
import java.util
import io.confluent.kafka.schemaregistry.client.SchemaRegistryClient
import io.confluent.kafka.serializers.{AbstractKafkaAvroSerDeConfig, KafkaAvroDeserializer, KafkaAvroDeserializerConfig, KafkaAvroSerializer}
import org.apache.avro.specific.SpecificRecord
im... | AlvinCJin/Niagara | src/main/scala/com/alvin/niagara/schemaregistry/SpecificAvroSerde.scala | Scala | apache-2.0 | 3,513 |
/*
* Copyright 2015 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... | howyp/domain | src/main/scala/uk/gov/hmrc/domain/AgentUserId.scala | Scala | apache-2.0 | 1,023 |
package com.sk.app.proxmock.application.domain.conditions
import com.sk.app.proxmock.application.configuration.ConfigurationContext
import org.springframework.messaging.Message
/**
* Created by Szymon on 22.05.2016.
*/
case class HeaderMatches(header: String, pattern: String) extends Condition {
override def te... | szymonkudzia/proxmock | sources/src/main/scala/com/sk/app/proxmock/application/domain/conditions/HeaderMatches.scala | Scala | mit | 604 |
package com.twitter.scrooge.backend
import com.twitter.util.{Return, Throw, Try}
import com.twitter.scrooge.testutil.Spec
class NonFinagleSpec extends Spec {
"None Finagle Service " should {
"work in Scala" in {
import vanilla.test._
import vanilla.test1._
import vanilla.test2._
val chic... | thirstycrow/scrooge | scrooge-generator-tests/src/test/scala/com/twitter/scrooge/backend/NonFinagleSpec.scala | Scala | apache-2.0 | 1,567 |
package com.teambytes.inflatable.raft.protocol
/** Message with phantom type, used to differenciate between Internal and Raft messages */
private[inflatable] class Message[T <: MessageType]
private[inflatable] sealed trait MessageType
private[inflatable] class Raft extends MessageType
private[raft] class Interna... | grahamar/inflatable | src/main/scala/com/teambytes/inflatable/raft/protocol/Message.scala | Scala | apache-2.0 | 458 |
class LocalBefore {
val field1 = 45
def fiFoo = ???
val fil1, fil2: Int
def foo2() = {
val fiValue = 67
fi<caret>
}
} | ilinum/intellij-scala | testdata/completion3/order/LocalBefore.scala | Scala | apache-2.0 | 135 |
package slick.lifted
import scala.language.higherKinds
import scala.language.experimental.macros
import scala.annotation.implicitNotFound
import scala.reflect.macros.Context
import slick.ast.{Join => AJoin, _}
import FunctionSymbolExtensionMethods._
import ScalaBaseType._
sealed trait QueryBase[T] extends Rep[T]
/**... | dotta/slick | slick/src/main/scala/slick/lifted/Query.scala | Scala | bsd-2-clause | 15,393 |
package com.reactific.cboris
import akka.util.ByteString
import java.time.Instant
import java.time.Duration
import shapeless._
import shapeless.ops.coproduct.Unifier
import scala.collection.immutable.HashMap
import scala.language.implicitConversions
object Model {
sealed trait CBORVal
case object CBORNull ex... | reactific/cboris | src/main/scala/com/reactific/cboris/Model.scala | Scala | apache-2.0 | 4,916 |
/*
* Part of NDLA image-api.
* Copyright (C) 2016 NDLA
*
* See LICENSE
*
*/
package no.ndla.imageapi.caching
class Memoize[R](f: () => R, maxAgeMs: Long) extends (() => R) {
case class CacheValue(value: R, lastUpdated: Long) {
def isExpired: Boolean = lastUpdated + maxAgeMs <= System.currentTimeMillis()
... | NDLANO/image-api | src/main/scala/no/ndla/imageapi/caching/Memoize.scala | Scala | gpl-3.0 | 711 |
package nibbler
import nibbler.evaluation
import nibbler.evaluation.{FunctionBuilder, FunctionNode}
import org.junit.runner.RunWith
import org.mockito.Mockito.verify
import org.scalatest.FunSuite
import org.scalatest.junit.JUnitRunner
import org.scalatest.matchers.ShouldMatchers
import org.scalatest.mock.MockitoSugar
... | pkoperek/nibbler | src/test/scala/nibbler/FunctionTest.scala | Scala | gpl-3.0 | 11,371 |
//
// Extended.scala -- Scala class and objects for the Orc extended AST
// Project OrcScala
//
// Created by dkitchin on May 19, 2010.
//
// Copyright (c) 2017 The University of Texas at Austin. All rights reserved.
//
// Use and redistribution of this file is governed by the license terms in
// the LICENSE file found... | orc-lang/orc | OrcScala/src/orc/ast/ext/Extended.scala | Scala | bsd-3-clause | 15,064 |
/* Title: Pure/PIDE/text.scala
Author: Fabian Immler, TU Munich
Author: Makarius
Basic operations on plain text.
*/
package isabelle
import scala.collection.mutable
import scala.util.Sorting
object Text
{
/* offset */
type Offset = Int
/* range -- with total quasi-ordering */
obj... | larsrh/libisabelle | modules/pide/2019-RC4/src/main/scala/PIDE/text.scala | Scala | apache-2.0 | 6,051 |
/*
* 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 ... | akrabat/openwhisk | common/scala/src/main/scala/org/apache/openwhisk/core/containerpool/ContainerFactory.scala | Scala | apache-2.0 | 7,159 |
/*
* 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 | sql/core/src/main/scala/org/apache/spark/sql/RelationalGroupedDataset.scala | Scala | apache-2.0 | 24,122 |
package lila
package object i18n extends PackageObject with WithPlay {
object tube {
private[i18n] implicit lazy val translationTube =
Translation.tube inColl Env.current.translationColl
}
}
| danilovsergey/i-bur | modules/i18n/src/main/package.scala | Scala | mit | 209 |
/*
* ******************************************************************************
* * Copyright (C) 2013 Christopher Harris (Itszuvalex)
* * Itszuvalex@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 p... | Itszuvalex/Femtocraft-alpha-1 | src/main/java/com/itszuvalex/femtocraft/industry/gui/GuiMicroReconstructor.scala | Scala | gpl-2.0 | 5,288 |
package com.datastax.spark.connector.cql
import com.datastax.oss.driver.api.core.auth.AuthProvider
import com.datastax.oss.driver.internal.core.auth.ProgrammaticPlainTextAuthProvider
import com.datastax.spark.connector.util.{ConfigParameter, ReflectionUtil}
import org.apache.spark.SparkConf
/** Stores credentials use... | datastax/spark-cassandra-connector | connector/src/main/scala/com/datastax/spark/connector/cql/AuthConf.scala | Scala | apache-2.0 | 3,753 |
package org.jetbrains.plugins.scala
package codeInspection.collections
import org.jetbrains.plugins.scala.codeInspection.InspectionBundle
/**
* Nikolay.Tropin
* 2014-05-08
*/
class GetGetOrElseTest extends OperationsOnCollectionInspectionTest {
val hint = InspectionBundle.message("get.getOrElse.hint")
override... | triggerNZ/intellij-scala | test/org/jetbrains/plugins/scala/codeInspection/collections/GetGetOrElseTest.scala | Scala | apache-2.0 | 874 |
package documentation
import scala.util.Either.MergeableEither
import org.qirx.cms.i18n.Messages
import org.qirx.cms.metadata.dsl.Confidential
import org.qirx.cms.metadata.dsl.GeneratableValue
import org.qirx.cms.metadata.dsl.GeneratedValueProperty
import org.qirx.cms.metadata.dsl.Identifiable
import org.qirx.cms.met... | EECOLOR/play-cms | cms/src/test/scala/documentation/_08_01_Property_DSL.scala | Scala | mit | 9,717 |
package org.phenoscape.kb
import java.util.UUID
import akka.http.scaladsl.marshalling.{Marshaller, ToEntityMarshaller}
import akka.http.scaladsl.model.MediaTypes
import scala.jdk.CollectionConverters._
import scala.concurrent.Future
import scala.language.implicitConversions
import scala.xml.Elem
import org.apache.jen... | phenoscape/phenoscape-kb-services | src/main/scala/org/phenoscape/kb/Study.scala | Scala | mit | 19,833 |
package scommons.client.ui.popup
import scommons.client.ui.SimpleButtonData
import scommons.client.ui.icon.IconCss
import scommons.client.ui.popup.YesNoCancelOption._
import scommons.react.test.TestSpec
import scommons.react.test.raw.ShallowInstance
import scommons.react.test.util.ShallowRendererUtils
class YesNoPopu... | viktor-podzigun/scommons | ui/src/test/scala/scommons/client/ui/popup/YesNoPopupSpec.scala | Scala | apache-2.0 | 4,006 |
package com.sksamuel.elastic4s.analyzers
import org.scalatest.{Matchers, WordSpec}
class StemmerTokenFilterTest extends WordSpec with TokenFilterDsl with Matchers {
"StemmerTokenFilter builder" should {
"set language" in {
stemmerTokenFilter("testy").lang("vulcan").json.string shouldBe """{"type":"stemme... | aroundus-inc/elastic4s | elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/analyzers/StemmerTokenFilterTest.scala | Scala | apache-2.0 | 355 |
package scala.scalanative
package compiler
package pass
import scala.collection.mutable
import nir._, Inst.Let
import analysis.DominatorTree
import analysis.ControlFlow
/** Eliminates redundant box/unbox operations within
* a single method definition. This is quite simplistic approach
* but we need this to remove... | cedricviaccoz/scala-native | tools/src/main/scala/scala/scalanative/compiler/pass/GlobalBoxingElimination.scala | Scala | bsd-3-clause | 5,868 |
package com.larskroll.whloot.data
import java.util.Date
import anorm.SqlParser._
import anorm._
import java.math.BigDecimal
case class Transaction(id: Long, ts: Date, itemId: Long, quantity: Long, price: Double)
object TransactionQueries {
val tableName = "whloot_transactions";
val insert: SqlQuery =
SQL("""INS... | Bathtor/Whloot | src/main/scala/com/larskroll/whloot/data/Transactions.scala | Scala | apache-2.0 | 988 |
object Test {
Cat.compose[List,Option].Functor
}
| som-snytt/dotty | tests/untried/neg/t4079/t4079_2.scala | Scala | apache-2.0 | 51 |
package benchmark.utils
import com.bwsw.tstreamstransactionserver.rpc.{ProducerTransaction, TransactionStates}
import scala.collection.immutable.IndexedSeq
trait TransactionCreator {
private val rand = new scala.util.Random()
def createProducerTransactions(streamID: Int, partition: Int, _type: TransactionStates... | bwsw/tstreams-transaction-server | src/test/scala/benchmark/utils/TransactionCreator.scala | Scala | apache-2.0 | 1,437 |
package nfn.service
import java.nio.charset.StandardCharsets
import akka.actor.ActorRef
import ccn.packet.{CCNName, Content, MetaInfo}
import scala.util.{Failure, Success, Try}
/**
* The map service is a generic service which transforms n [[NFNValue]] into a [[NFNListValue]] where each value was applied by a given... | cn-uofbasel/nfn-scala | src/main/scala/nfn/service/MapReduceService.scala | Scala | isc | 4,441 |
package edu.gemini.spModel.pio.codec
import scalaz._, Scalaz._
import scala.collection.JavaConverters._
import edu.gemini.spModel.pio._
import edu.gemini.spModel.pio.xml.PioXmlFactory
object CodecSyntax {
class ParamSetCodecOps[A](a: A)(implicit ev: ParamSetCodec[A]) {
def encode(key: String): ParamSet = ev.e... | arturog8m/ocs | bundle/edu.gemini.spModel.pio/src/main/scala/edu/gemini/spModel/pio/codec/CodecSyntax.scala | Scala | bsd-3-clause | 461 |
package jsky.app.ot.viewer.open
import edu.gemini.pot.client.SPDB
import edu.gemini.pot.sp.{ISPProgram, SPNodeKey}
import edu.gemini.pot.spdb.IDBDatabaseService
import edu.gemini.shared.gui.SizePreference
import edu.gemini.shared.util.VersionComparison.{Newer, Conflicting}
import edu.gemini.shared.util.immutable.Apply... | arturog8m/ocs | bundle/jsky.app.ot/src/main/scala/jsky/app/ot/viewer/open/OpenDialog.scala | Scala | bsd-3-clause | 17,835 |
import org.specs2.mutable._
import org.specs2.runner._
import org.junit.runner._
import play.api.test._
import play.api.test.Helpers._
/**
* add your integration spec here.
* An integration test will fire up a whole play application in a real (or headless) browser
*/
@RunWith(classOf[JUnitRunner])
class Integratio... | takatama/play-scala-todolist | test/IntegrationSpec.scala | Scala | mit | 532 |
package com.github.libsml.test
import com.github.libsml.aggregation.optimization.{Optimization, OptimizationConf}
import com.github.libsml.math.linalg.Vector
import com.github.libsml.math.util.VectorUtils
import com.github.libsml.model.data.DataUtils
/**
* Created by huangyu on 15/9/8.
*/
object OptimizationTest {
... | libsml/libsml | aggregation/src/test/scala/com/github/libsml/test/OptimizationTest.scala | Scala | apache-2.0 | 1,642 |
package io.scalac.hzip
import shapeless.{HNil, ::, HList}
import shapeless.ops.function.FnToProduct
import shapeless.ops.hlist.Prepend
/**
* Created by tomasz on 08/10/15.
*/
object quasispray extends App{
case class Response(body: String)
case class Request(url : String)
type Route = Request => Response
d... | haghard/shapeless-learning | src/main/scala/io/scalac/hzip/quasispray.scala | Scala | apache-2.0 | 1,632 |
package demo
package components
package materialui
import japgolly.scalajs.react._
import japgolly.scalajs.react.vdom.prefix_<^._
import scala.scalajs.js
import scalacss.Defaults._
import scalacss.ScalaCssReact._
import scalacss.mutable.StyleSheet.Inline
object MobileTearSheet {
object Style extends Inline {
... | tpdi/scalajs-react-components | demo/src/main/scala/demo/components/materialui/MobileTearSheet.scala | Scala | apache-2.0 | 1,012 |
package skinny.assets
import org.mozilla.javascript._
import skinny.util.LoanPattern._
import java.io.{ ByteArrayInputStream, IOException, InputStreamReader }
import org.mozilla.javascript.tools.shell.Global
import skinny.ClassPathResourceLoader
import skinny.exception.AssetsPrecompileFailureException
import org.slf4j... | BlackPrincess/skinny-framework | assets/src/main/scala/skinny/assets/LessCompiler.scala | Scala | mit | 3,167 |
/*
* Copyright (c) 2009 Sony Pictures Imageworks Inc.
*
* 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, thi... | azinman/scala-migrations | src/test/scala/com/imageworks/migration/tests/MigrationTests.scala | Scala | bsd-3-clause | 19,442 |
/*
* Copyright (c) 2013. Regents of the University of California
*
* 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 require... | fnothaft/adam | adam-core/src/main/scala/edu/berkeley/cs/amplab/adam/util/ParquetFileTraversable.scala | Scala | apache-2.0 | 2,071 |
/*
* 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
* distribute... | wvlet/airframe | airframe-codec/src/main/scala/wvlet/airframe/codec/JSONCodec.scala | Scala | apache-2.0 | 4,020 |
/*
* Copyright (C) Lightbend Inc. <https://www.lightbend.com>
*/
package play.api.mvc
import play.api.libs.typedmap.TypedMap
import play.api.mvc.request.RemoteConnection
import play.api.mvc.request.RequestTarget
/**
* Wrap an existing request. Useful to extend a request.
*
* If you need to add extra values to a... | benmccann/playframework | core/play/src/main/scala/play/api/mvc/WrappedRequest.scala | Scala | apache-2.0 | 1,974 |
/*
* 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 ... | Dax1n/spark-core | core/src/main/scala/org/apache/spark/scheduler/SparkListener.scala | Scala | apache-2.0 | 12,460 |
package scalakurs.patternmatching
import org.scalatest.FunSpec
import org.scalatest.matchers.ShouldMatchers
import PatternMatching._
class PatternMatchingTest extends FunSpec with ShouldMatchers {
describe("Exercise 1: Match 5") {
it("should match 5") { assert(match5(5))}
it("""should match "5"""") { asse... | elacin/scala-kurs | oppgaver/src/test/scala/scalakurs/patternmatching/PatternMatchingTest.scala | Scala | apache-2.0 | 2,543 |
/*
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... | twitter/algebird | algebird-core/src/main/scala/com/twitter/algebird/monad/EitherMonad.scala | Scala | apache-2.0 | 1,244 |
/*
* Copyright 2015 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicab... | arkadius/reliable-http-client | rhttpc-amqp/src/main/scala/rhttpc/transport/amqp/AmqpConnectionFactory.scala | Scala | apache-2.0 | 2,920 |
package scala.tools.scalap
package scalax
package rules
package scalasig
trait Flags {
def hasFlag(flag : Long) : Boolean
def isImplicit: Boolean = hasFlag(0x00000001)
def isFinal: Boolean = hasFlag(0x00000002)
def isPrivate: Boolean = hasFlag(0x00000004)
def isProtected: Boolean = hasFlag(0x00000008)
... | ilinum/intellij-scala | scalap/src/scala/tools/scalap/scalax/rules/scalasig/Flags.scala | Scala | apache-2.0 | 2,792 |
package org.scalatra
package validation
import org.apache.commons.validator.routines.EmailValidator
import scala.util.matching.Regex
import java.util.Locale._
import scala.util.control.Exception._
import java.net.URI
import org.apache.commons.validator.routines.UrlValidator
import scalaz._
import Scalaz._
import mojol... | etorreborre/scalatra | commands/src/main/scala/org/scalatra/validation/Validators.scala | Scala | bsd-2-clause | 6,150 |
package adtoyou.spark.analysis
import java.sql.{Connection, PreparedStatement, SQLException}
import java.text.SimpleDateFormat
import java.util.{Calendar, Date}
import aiouniya.spark.MyRDDFunctions._
import aiouniya.spark.common.Constants._
import aiouniya.spark.util.JdbcUtil2
import org.apache.commons.dbuti... | 7u/spark-learning | spark.learning/spark_test/src/main/scala/adtoyou/spark/analysis/NewMacCounter.scala | Scala | apache-2.0 | 5,425 |
package com.rasterfoundry.backsplash.server
import com.rasterfoundry.backsplash.error.NoDataInRegionException
import com.rasterfoundry.backsplash.error.NoDataInRegionException
import com.rasterfoundry.database.Implicits._
import com.rasterfoundry.database.{ProjectLayerDao, SceneDao}
import com.rasterfoundry.datamodel.... | raster-foundry/raster-foundry | app-backend/backsplash-server/src/main/scala/com/rasterfoundry/backsplash/Cacheable.scala | Scala | apache-2.0 | 2,370 |
/**
* 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 ... | guozhangwang/kafka | core/src/main/scala/kafka/controller/ControllerState.scala | Scala | apache-2.0 | 3,741 |
package com.rasterfoundry.notification.email
import com.rasterfoundry.notification.email.Model._
import cats.effect.Sync
import cats.implicits._
import io.chrisdavenport.log4cats.Logger
import io.chrisdavenport.log4cats.slf4j.Slf4jLogger
import org.apache.commons.mail.HtmlEmail
import org.apache.commons.mail._
trait... | raster-foundry/raster-foundry | app-backend/notification/src/main/scala/com/rasterfoundry/notification/email/EmailNotifier.scala | Scala | apache-2.0 | 2,727 |
package io.bazel.rulesscala.dependencyanalyzer
import java.nio.file.Files
import java.nio.file.Path
import io.bazel.rulesscala.io_utils.DeleteRecursively
import org.scalatest.funsuite._
import scala.tools.nsc.reporters.StoreReporter
import io.bazel.rulesscala.utils.JavaCompileUtil
import io.bazel.rulesscala.utils.Test... | bazelbuild/rules_scala | third_party/dependency_analyzer/src/test/io/bazel/rulesscala/dependencyanalyzer/AstUsedJarFinderTest.scala | Scala | apache-2.0 | 16,732 |
package org.pinky.core
import javax.servlet.http.{HttpServlet, HttpServletRequest, HttpServletResponse}
import java.io.InputStream
import java.awt.image.BufferedImage
import javax.imageio.ImageIO
/**
* Created by IntelliJ IDEA.
* User: phausel
* Date: 12/13/10
* Time: 5:43 PM
* To change this template use File |... | d5nguyenvan/pinky | src/main/scala/org/pinky/core/PinkySimpleServlet.scala | Scala | bsd-3-clause | 2,483 |
/*
* The MIT License (MIT)
*
* Copyright (C) 2012 47 Degrees, LLC http://47deg.com hello@47deg.com
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including with... | 47deg/mvessel | core/src/main/scala/com/fortysevendeg/mvessel/util/ResultSetProcessorOps.scala | Scala | mit | 1,477 |
/*
* Copyright (c) 2021, salesforce.com, inc.
* All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
package com.krux.hyperion.datanode
import com.krux.hyperion.adt.HString
import com.krux.hy... | realstraw/hyperion | core/src/main/scala/com/krux/hyperion/datanode/RedshiftDataNode.scala | Scala | bsd-3-clause | 2,164 |
/*
* 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... | psyyz10/BigDL | spark/dl/src/main/scala/com/intel/analytics/bigdl/nn/Tanh.scala | Scala | apache-2.0 | 1,877 |
package com.github.dunmatt.robokomodo
class StateMachine[S](startState: S, allowedTransition: (S, S)=>Boolean, actions: (S, S)=>Unit) {
protected var _state = startState
def state = _state
def state_=(s: S) = {
if (s != state && allowedTransition(state, s)) {
actions(state, s)
_state = s
}
... | dunmatt/robokomodo | src/main/scala/com/github/dunmatt/robokomodo/StateMachine.scala | Scala | mit | 326 |
package scalariform
import scala.util.Properties
import scalariform.utils.Utils._
import scala.math.Ordering
object ScalaVersion {
private val VersionPattern = """(\\d+)\\.(\\d+)\\.(.*)""".r
def parseOrDefault(s: String): ScalaVersion = parse(s).getOrElse(ScalaVersions.DEFAULT)
def parse(s: String): Option[S... | tkawachi/scalariform | scalariform/src/main/scala/scalariform/ScalaVersions.scala | Scala | mit | 1,266 |
package coursier.cli.bootstrap
import java.nio.file.{Files, Path, Paths}
import cats.data.{Validated, ValidatedNel}
import cats.implicits._
import coursier.cache.{ArchiveCache, Cache}
import coursier.jvm.{JvmCache, JvmIndex}
import coursier.launcher.MergeRule
import coursier.launcher.internal.Windows
import coursier.... | coursier/coursier | modules/cli/src/main/scala/coursier/cli/bootstrap/BootstrapSpecificParams.scala | Scala | apache-2.0 | 5,419 |
/* NSC -- new Scala compiler
* Copyright 2005-2013 LAMP/EPFL
* @author Paul Phillips
*/
package scala
package reflect
package internal
package pickling
import PickleFormat._
import util.shortClassOfInstance
trait Translations {
self: SymbolTable =>
def isTreeSymbolPickled(code: Int): Boolean = (code: @annot... | felixmulder/scala | src/reflect/scala/reflect/internal/pickling/Translations.scala | Scala | bsd-3-clause | 6,178 |
/*
* Copyright 2015 Nicolas Rinaudo
*
* 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... | nrinaudo/tabulate | enumeratum/jvm/src/test/scala/kantan/csv/enumeratum/values/SerializationTests.scala | Scala | mit | 3,282 |
package org.apache.spark.hax
/**
* Created by ngoehausen on 3/30/16.
*/
import java.io.{ByteArrayInputStream, ByteArrayOutputStream}
import org.apache.spark.util._
import scala.collection.mutable.{Map, Set}
//import org.apache.xbean.asm5.{ClassReader, ClassVisitor, MethodVisitor, Type}
//import org.apache.xbea... | nimbusgo/spark-flow | src/main/scala/org/apache/spark/hax/MyClosureCleaner.scala | Scala | apache-2.0 | 20,225 |
/*
* 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 ... | pgandhi999/spark | sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/HigherOrderFunctionsSuite.scala | Scala | apache-2.0 | 32,343 |
/**
* Swaggy Jenkins
* Jenkins API clients generated from Swagger / Open API specification
*
* The version of the OpenAPI document: 1.1.2-pre.0
* Contact: blah@cliffano.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not ed... | cliffano/swaggy-jenkins | clients/scala-httpclient-deprecated/generated/src/main/scala/org/openapitools/client/model/ListView.scala | Scala | mit | 592 |
package filters
import javax.inject.Inject
import play.api.http.HttpFilters
import play.filters.headers.SecurityHeadersFilter
/**
* Samsara Aquarius
* Main HTTP Filter
*/
class Filters @Inject() (security: SecurityHeadersFilter) extends HttpFilters {
override def filters = Seq(security)
}
| sczyh30/samsara-aquarius | app/filters/Filters.scala | Scala | mit | 303 |
/*
* 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 l... | MansurAshraf/storehaus | storehaus-kafka-08/src/test/scala/com/twitter/storehaus/kafka/KafkaContext.scala | Scala | apache-2.0 | 1,966 |
/**
* Copyright 2011-2017 GatlingCorp (http://gatling.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.org/licenses/LICENSE-2.0
*
* Unless required by appli... | MykolaB/gatling | gatling-charts/src/main/scala/io/gatling/charts/report/AllSessionsReportGenerator.scala | Scala | apache-2.0 | 1,489 |
package app.comet
import app.model.Probe
case class Init(allProbes: List[Probe])
| alltonp/reprobate | src/main/scala/app/comet/ActorMessages.scala | Scala | apache-2.0 | 83 |
package gapt.proofs.lk.rules
import gapt.expr.Const
import gapt.expr.Expr
import gapt.expr.Var
import gapt.expr.ty.FunctionType
import gapt.proofs.SequentIndex
import gapt.proofs.lk.LKProof
/**
* Proof that a given data type constructor c preserves a formula F:
*
* <pre>
* (π)
* ... | gapt/gapt | core/src/main/scala/gapt/proofs/lk/rules/InductionCase.scala | Scala | gpl-3.0 | 1,752 |
object HelloScala {
def main(args: Array[String]): Unit = {
println("Hello world Scala !")
}
} | GELOG/variantminer | src/main/scala/HelloScala.scala | Scala | apache-2.0 | 102 |
package org.deeplearning4j.spark.ml.utils
/**
* Created by derek.miller on 3/17/17.
*/
import org.apache.spark.sql.DataFrame
class DatasetFacade(val dataset: DataFrame) {
def get : DataFrame = dataset
}
object DatasetFacade {
def dataRows(dataset: DataFrame) : DatasetFacade = new DatasetFacade(dataset)
}... | shuodata/deeplearning4j | deeplearning4j-scaleout/spark/dl4j-spark-ml/src/main/spark-1/scala/org/deeplearning4j/spark/ml/utils/DatasetFacade.scala | Scala | apache-2.0 | 321 |
package demo
package components
package reactinfinite
import japgolly.scalajs.react._
import japgolly.scalajs.react.vdom.prefix_<^._
import scalacss.Defaults._
object ReactInfiniteInfo {
object Style extends StyleSheet.Inline {
import dsl._
val content = style(textAlign.center,
fontSize(30.px),
... | tpdi/scalajs-react-components | demo/src/main/scala/demo/components/reactinfinite/ReactInfiniteInfo.scala | Scala | apache-2.0 | 1,026 |
package smtlib
package theories
package experimental
import trees.Terms._
import Operations._
/* Experimental support for the theory of sets in CVC4
* Based on the operations in http://cvc4.cs.nyu.edu/wiki/Sets
*/
object Sets {
private val SetUnion: String = "union"
private val SetIntersection: String = "inter... | regb/scala-smtlib | src/main/scala/smtlib/theories/experimental/Sets.scala | Scala | mit | 1,767 |
/***********************************************************************
* Copyright (c) 2013-2020 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... | aheyne/geomesa | geomesa-arrow/geomesa-arrow-datastore/src/main/scala/org/locationtech/geomesa/arrow/data/ArrowFeatureStore.scala | Scala | apache-2.0 | 4,691 |
import scala.reflect.runtime.universe._
object Bish {
def m: Unit = {
object Bash {
typeOf[Option[_]]
}
}
}
| yusuke2255/dotty | tests/pending/pos/t6204-a.scala | Scala | bsd-3-clause | 127 |
package org.jetbrains.plugins.cbt.process
import com.intellij.openapi.application.ApplicationManager
import com.intellij.openapi.externalSystem.service.notification.{ExternalSystemNotificationManager, NotificationCategory, NotificationData, NotificationSource}
import com.intellij.openapi.project.Project
import org.jet... | triplequote/intellij-scala | cbt/src/org/jetbrains/plugins/cbt/process/CbtOutputListener.scala | Scala | apache-2.0 | 3,681 |
import net.liftweb.json._
class Dummy extends Serializable {
val json = parse("{\\"x\\": 42}").asInstanceOf[JValue]
} | nightuser/scala-json-fail | src/main/scala/Dummy.scala | Scala | mit | 118 |
package ohnosequences.metapasta
import ohnosequences.nisperon.{JsonSerializer, Serializer, MapMonoid, Monoid}
import scala.collection.mutable
//todo rank, name ...
case class TaxInfo(count: Long, acc: Long) {
override def toString = count + ":" + acc
}
object taxInfoMonoid extends Monoid[TaxInfo] {
val _unit = ... | INTERCROSSING/metapasta | src/main/scala/ohnosequences/metapasta/AssignTable.scala | Scala | agpl-3.0 | 2,178 |
package org.igye.jfxutils.concurrency
import javafx.application.Platform
import org.apache.logging.log4j.Logger
import scala.concurrent.{Future, Promise}
object JfxFuture {
def apply[T](proc: => T)(implicit log: Logger): Future[T] = {
apply(proc, false)
}
def apply[T](proc: => T, forcibly: Bool... | Igorocky/jfxutils | src/main/scala/org/igye/jfxutils/concurrency/JfxFuture.scala | Scala | mit | 1,011 |
package keystoneml.nodes.stats
import breeze.linalg._
import breeze.numerics._
import breeze.stats.distributions.Rand
import org.apache.spark.rdd.RDD
import keystoneml.pipelines._
import keystoneml.utils.MatrixUtils
import keystoneml.workflow.Transformer
/**
* Transformer that extracts random cosine features from a ... | amplab/keystone | src/main/scala/keystoneml/nodes/stats/CosineRandomFeatures.scala | Scala | apache-2.0 | 2,188 |
package sandbox
import scala.annotation.tailrec
import scala.collection.mutable
sealed trait Trie {
val value: Option[Char] = None
val children: mutable.Map[Char, Trie] = mutable.Map.empty
def put(s: String): Unit = {
@tailrec def put0(s: String, index: Int, node: Trie): Unit = {
val c = s.charAt(ind... | alexandrnikitin/algorithm-sandbox | scala/src/main/scala/sandbox/Trie.scala | Scala | mit | 1,082 |
package controllers
import connectors.{SequencerConnector, K8055Connector}
import model._
import play.api.libs.json.Json
import play.api.routing.JavaScriptReverseRouter
import play.api.mvc._
import scala.concurrent.ExecutionContext.Implicits.global
import play.api.Logger
import play.mvc.Http.MimeTypes
object Status... | bullimog/k8055-frontend | app/controllers/StatusController.scala | Scala | gpl-2.0 | 3,230 |
package li.ues.codeego.game
import akka.actor._
import akka.pattern.ask
import akka.util.Timeout
import scala.concurrent.duration._
import scala.collection.mutable._
import scala.concurrent.ExecutionContext.Implicits._
import scala.concurrent.{Await, Future}
import scala.util._
class UserActor(user: User) extends A... | Codeego/codeego | src/main/scala/li/ues/codeego/game/UserActor.scala | Scala | lgpl-3.0 | 517 |
/**
* Copyright (C) 2007 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 p... | brunobuzzi/orbeon-forms | xforms/jvm/src/main/scala/org/orbeon/oxf/xforms/function/xxforms/XXFormsFormURLEncode.scala | Scala | lgpl-2.1 | 1,384 |
/* sbt -- Simple Build Tool
* Copyright 2011 Mark Harrah
*/
package sbt
import java.io.File
import java.net.URI
import BuildLoader._
import Alternatives._
import Types.{ const, idFun }
final class MultiHandler[S, T](builtIn: S => Option[T], root: Option[S => Option[T]], nonRoots: List[(URI, S => Option[T])], getURI... | jaceklaskowski/sbt | main/src/main/scala/sbt/BuildLoader.scala | Scala | bsd-3-clause | 6,540 |
package com.auginte.scarango.request.raw.replace
/**
* Replace content of the document
*
* PUT /_api/document/{collection-name}/{document-key}
*/
case class Document(rawData: String, collectionName: String, key: String)
| aurelijusb/scarango | src/main/scala/com/auginte/scarango/request/raw/replace/Document.scala | Scala | apache-2.0 | 229 |
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.