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 |
|---|---|---|---|---|---|
object Main {
def main(args: Array[String]) {
val t = readLine().toInt
var memo = Array.fill[BigInt](101)(0)
memo(1) = 1
def allFactorials(t: Int, memo: Array[BigInt]) {
def factorial(n: Int):BigInt = {
if( memo(n) == 0 && n != 1) {
memo(n) = n * factorial (n - 1)... | DavidOrchard/codechef | smallfactorial/Main.scala | Scala | mit | 482 |
/**
* Copyright 2014 Frank Austin Nothaft
*
* 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 ... | fnothaft/snark | snark-core/src/test/scala/net/fnothaft/snark/DenseArrayStructureSuite.scala | Scala | apache-2.0 | 1,040 |
package org.jetbrains.plugins.scala.lang.completion
import com.intellij.codeInsight.completion.{CompletionResultSet, InsertHandler}
import com.intellij.codeInsight.lookup.{AutoCompletionPolicy, LookupElement, LookupElementPresentation, LookupElementRenderer}
import com.intellij.openapi.application.ApplicationManager
i... | advancedxy/intellij-scala | src/org/jetbrains/plugins/scala/lang/completion/ScalaAfterNewCompletionUtil.scala | Scala | apache-2.0 | 10,948 |
package me.jamesphiliprobinson.utilities.time
import org.scalatest.{FunSuite, Matchers}
/**
* Created by James Robinson on 03/04/2016.
*/
class DefaultSleepTimerSpecImpl extends FunSuite with Matchers {
test("Can sleep for the time required following creation") {
val timer = new DefaultSleepTimerImpl(100, ... | etothepii/utilities | src/test/scala/me/jamesphiliprobinson/utilities/time/DefaultSleepTimerSpecImpl.scala | Scala | apache-2.0 | 3,096 |
/**
* Copyright (C) 2017 DANS - Data Archiving and Networked Services (info@dans.knaw.nl)
*
* 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/LIC... | rvanheest/easy-greeter | src/main/scala/nl/knaw/dans/easy/greeter/GreeterService.scala | Scala | apache-2.0 | 2,107 |
package games.audio
import java.io.InputStream
import com.jcraft.jogg.Packet
import com.jcraft.jogg.Page
import com.jcraft.jogg.StreamState
import com.jcraft.jogg.SyncState
import com.jcraft.jorbis.DspState
import com.jcraft.jorbis.Block
import com.jcraft.jorbis.Info
import com.jcraft.jorbis.Comment
import java.io.EOF... | joelross/scalajs-games | demo/jvm/src/main/scala/games/audio/VorbisDecoder.scala | Scala | bsd-3-clause | 5,261 |
package contege
import scala.collection.mutable.Set
import java.lang.reflect._
/**
* Reads methods, constructors, and fields of a class,
* ignoring all members that can't be called in a generated test
* (i.e., only public, non-abstract etc. members are considered).
*/
class ClassReader(val cls: Class[_]) {
def... | michaelpradel/ConTeGe | src/contege/ClassReader.scala | Scala | gpl-2.0 | 1,554 |
package controllers.api
import controllers.Application
import db._
import models.frontend.AccountReceivedFromFrontend
import play.api.libs.json._
import play.api.mvc.{Action, Controller}
import services.EmailService
object AccountApi extends Controller {
val httpStatusCodeEmailAlreadyRegistered = 230
val httpStat... | PanzerKunst/workdimension | website/app/controllers/api/AccountApi.scala | Scala | gpl-3.0 | 2,685 |
/*
* Copyright (C) 2016-2019 Lightbend Inc. <https://www.lightbend.com>
*/
package com.lightbend.lagom.scaladsl.server
import java.util.concurrent.atomic.AtomicBoolean
import akka.NotUsed
import akka.actor.ActorSystem
import akka.stream.scaladsl.{ Flow, Sink, Source }
import akka.stream.{ ActorMaterializer, Materi... | rstento/lagom | service/scaladsl/server/src/test/scala/com/lightbend/lagom/scaladsl/server/ScaladslStreamedServiceRouterSpec.scala | Scala | apache-2.0 | 4,417 |
package skuber
import skuber.json.format.serviceFmt
import org.scalatest.Matchers
import org.scalatest.concurrent.Eventually
import scala.concurrent.Await
import scala.concurrent.duration._
import scala.util.{Failure, Random, Success}
class ServiceSpec extends K8SFixture with Eventually with Matchers {
val nginxSe... | doriordan/skuber | client/src/it/scala/skuber/ServiceSpec.scala | Scala | apache-2.0 | 1,626 |
package is.hail.expr.ir
import java.io.OutputStreamWriter
import is.hail.types._
import is.hail.types.physical.PStruct
import is.hail.types.virtual._
import is.hail.io.fs.FS
import is.hail.rvd._
import is.hail.utils._
import is.hail.variant.ReferenceGenome
import org.json4s._
import org.json4s.jackson.JsonMethods.par... | cseed/hail | hail/src/main/scala/is/hail/expr/ir/AbstractMatrixTableSpec.scala | Scala | mit | 7,030 |
/*
* This file is part of Kiama.
*
* Copyright (C) 2011-2015 Anthony M Sloane, Macquarie University.
*
* Kiama is free software: you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the
* Free Software Foundation, either version 3 of the License, or ... | adeze/kiama | library/src/org/kiama/example/oberon0/L1/TypeAnalyser.scala | Scala | gpl-3.0 | 1,303 |
package uk.ac.surrey.xw
import java.io.File
import java.lang.reflect.Modifier.isAbstract
import java.lang.reflect.Modifier.isPublic
import java.net.JarURLConnection
import java.net.URL
import java.net.URLClassLoader
import java.util.jar.Attributes
import java.util.jar.JarFile
import scala.collection.JavaConverters.en... | CRESS-Surrey/eXtraWidgets | core/src/main/scala/uk/ac/surrey/xw/WidgetsLoader.scala | Scala | mit | 3,416 |
/***********************************************************************
* Copyright (c) 2013-2019 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... | elahrvivaz/geomesa | geomesa-convert/geomesa-convert-common/src/main/scala/org/locationtech/geomesa/convert2/validators/SimpleFeatureValidator.scala | Scala | apache-2.0 | 4,395 |
package com.sandinh.couchbase.transcoder
import com.couchbase.client.core.lang.{Tuple, Tuple2}
import com.couchbase.client.core.message.ResponseStatus
import com.couchbase.client.core.message.kv.MutationToken
import com.couchbase.client.deps.io.netty.buffer.ByteBuf
import com.couchbase.client.deps.io.netty.util.Charse... | giabao/couchbase-scala | core/src/main/scala/com/sandinh/couchbase/transcoder/CompatStringTranscoder.scala | Scala | apache-2.0 | 3,344 |
package com.sksamuel.elastic4s.bulk
import com.sksamuel.elastic4s.TcpClient
import com.sksamuel.exts.OptionImplicits._
import org.elasticsearch.action.bulk.BulkProcessor.Listener
import org.elasticsearch.action.bulk.{BackoffPolicy, BulkRequest, BulkResponse}
import org.elasticsearch.common.unit.{ByteSizeUnit, ByteSize... | FabienPennequin/elastic4s | elastic4s-tcp/src/main/scala/com/sksamuel/elastic4s/bulk/BulkProcessorBuilder.scala | Scala | apache-2.0 | 2,472 |
/**
* Created on March 6, 2011
* Copyright (c) 2011, Wei-ju Wu
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* no... | weiju/adf-tools | infoviewer/src/main/scala/org/dmpp/infoviewer/InfoViewer.scala | Scala | bsd-3-clause | 3,380 |
package exerciseThree
import akka.actor._
import akka.stream.actor._
import video.Frame
// ------------
// EXERCISE 3.1
// ------------
// Fill in the code necessary to produce random circles based on the requested demand.
// The properties of the circles should be retrieved from the the CircleGenerator actor
// whic... | ktoso/streams-workshop | src/exercises/exerciseThree/CirclePublisher.scala | Scala | cc0-1.0 | 1,478 |
/*
* Copyright (c) 2013 original 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 a... | eigengo/monitor | agent-akka/src/test/scala/org/eigengo/monitor/agent/akka/UnfilteredActorCellMonitoringAspectSpec.scala | Scala | apache-2.0 | 7,431 |
package colang.ast.raw.expression
import colang.MappedStrategy
import colang.ast.raw.ParserImpl.SingleTokenStrategy
import colang.tokens.ThisKeyword
/**
* Represents a 'this' expression referencing the current contextual object.
* @param thisKeyword 'this' keyword
*/
case class ThisReference(thisKeyword: ThisKe... | psenchanka/colang | src/main/scala/colang/ast/raw/expression/ThisReference.scala | Scala | mit | 506 |
/*
* Copyright 2018 Analytics Zoo 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... | intel-analytics/analytics-zoo | zoo/src/main/scala/com/intel/analytics/zoo/examples/nnframes/finetune/ImageFinetune.scala | Scala | apache-2.0 | 4,836 |
/*
* InterpreterViewImpl.scala
* (SysSon)
*
* Copyright (c) 2013-2017 Institute of Electronic Music and Acoustics, Graz.
* Copyright (c) 2014-2019 Hanns Holger Rutz. All rights reserved.
*
* This software is published under the GNU General Public License v3+
*
*
* For further information, please contact H... | iem-projects/sysson | src/main/scala/at/iem/sysson/gui/impl/InterpreterViewImpl.scala | Scala | gpl-3.0 | 2,391 |
/*
* 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... | levinson/phantom | phantom-dsl/src/test/scala/com/websudos/phantom/builder/serializers/QuerySerializationTest.scala | Scala | bsd-2-clause | 6,038 |
package dzufferey.utils
import java.io._
object IO {
def storeInFile(file: File, data: Array[Byte]): Unit = {
val fileOut = new DataOutputStream( new FileOutputStream(file))
fileOut.write(data, 0, data.length)
fileOut.close
}
def storeInFile(file: String, data: Array[Byte]): Unit = storeInFile(new... | dzufferey/misc-scala-utils | src/main/scala/dzufferey/utils/IO.scala | Scala | apache-2.0 | 2,572 |
/*
* 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/logical/operators.scala | Scala | apache-2.0 | 26,917 |
import scala.io.Source._
object FacebookSettings {
/**
To do later because it is slightly different from twitter's config... Maybe we'll erase that shit out
*/
}
| t3g7/spark-streaming-facebook | src/main/scala/FacebookSettings.scala | Scala | apache-2.0 | 167 |
package peregin.gpv.gui.gauge
import java.awt.{Font, Graphics2D}
trait DigitalGauge extends GaugePainter with DigitalFont {
def valueText(): String
def unitText(): String
override def paint(g: Graphics2D, w: Int, h: Int) = {
super.paint(g, w, h)
val cy = h / 2
val box = math.min(w, h)
val fs... | peregin/gps-overlay-on-video | src/main/scala/peregin/gpv/gui/gauge/DigitalGauge.scala | Scala | mit | 861 |
package models.daos
import com.mohiva.play.silhouette.api.LoginInfo
import com.mohiva.play.silhouette.impl.daos.DelegableAuthInfoDAO
import com.mohiva.play.silhouette.impl.providers.OAuth2Info
import models.daos.OAuth2InfoDAO._
import play.api.libs.concurrent.Execution.Implicits._
import scala.collection.mutable
impo... | glidester/play-silhouette-seed | app/models/daos/OAuth2InfoDAO.scala | Scala | apache-2.0 | 2,797 |
package net.mauhiz.poustache
import scala.util.Try
case class MustacheContext(initialContext: Any, strict: Boolean = true) {
import net.mauhiz.poustache.MustacheContext._
var contextStack: Seq[Any] = Vector(initialContext)
def context(contextName: String, innerContent: => String): String = {
contextName.... | mauhiz/poustache | src/main/scala/net/mauhiz/poustache/MustacheContext.scala | Scala | gpl-2.0 | 3,991 |
package purespark.examples
import purespark.GraphX._
import purespark.Prelude._
import scala.util.Random
object Types {
type Color = Int
type Palette = (Color, List[Double], Boolean, Random)
}
/**
* A pregel implemention of the Communication-Free Learning algorithm for graph coloring.
*
* See ... | ericpony/scala-examples | PureSpark/examples/CFLVertexColoring.scala | Scala | mit | 4,003 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | ArvinDevel/onlineAggregationOnSparkV2 | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/HiveTypeCoercion.scala | Scala | apache-2.0 | 35,414 |
trait Foo[T <: Bar[T]#Elem] // error: illegal cyclic reference
trait Bar[T] {
type Elem = T
}
trait Foo2[T <: Bar2[T]#Elem] // error: illegal cyclic reference
trait Bar2[T] {
type Elem = T
}
| densh/dotty | tests/neg/i974.scala | Scala | bsd-3-clause | 195 |
/*
* 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 ... | saturday-shi/spark | streaming/src/main/scala/org/apache/spark/streaming/scheduler/rate/RateEstimator.scala | Scala | apache-2.0 | 2,962 |
/*
* Copyright 2001-2008 Artima, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agre... | yyuu/scalatest | src/test/scala/org/scalatest/path/FreeSpecSpec.scala | Scala | apache-2.0 | 38,190 |
package kvstore
import akka.testkit.TestKit
import akka.testkit.ImplicitSender
import org.scalatest.BeforeAndAfterAll
import org.scalatest.matchers.ShouldMatchers
import org.scalatest.FunSuite
import akka.actor.ActorSystem
import scala.concurrent.duration._
import akka.testkit.TestProbe
import Arbiter._
import Persist... | gempesaw/reactive-coursera | kvstore/src/test/scala/kvstore/Step5_PrimaryPersistenceSpec.scala | Scala | mit | 4,101 |
package org.http4s
import java.net.URLEncoder
import org.http4s.Uri.{apply => _, unapply => _, Fragment => _, Path => _, _}
import org.http4s.UriTemplate._
import org.http4s.util.StringWriter
import scala.collection.mutable
import scala.collection.mutable.ArrayBuffer
import scala.util.{Failure, Success, Try}
/**
* ... | reactormonk/http4s | core/src/main/scala/org/http4s/UriTemplate.scala | Scala | apache-2.0 | 21,600 |
args.foreach(arg => println(arg))
args.foreach((arg : String) => println(arg))
args.foreach(println)
| DinoZhang/hello-scala | pa.scala | Scala | mit | 101 |
package coursier.util
abstract class PlatformSyncCompanion
| alexarchambault/coursier | modules/cache/js/src/main/scala/coursier/util/PlatformSyncCompanion.scala | Scala | apache-2.0 | 60 |
/*
* 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 ... | StephanEwen/incubator-flink | flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/planner/plan/schema/LegacyCatalogSourceTable.scala | Scala | apache-2.0 | 9,707 |
/*
* ____ ____ _____ ____ ___ ____
* | _ \\ | _ \\ | ____| / ___| / _/ / ___| Precog (R)
* | |_) | | |_) | | _| | | | | /| | | _ Advanced Analytics Engine for NoSQL Data
* | __/ | _ < | |___ | |___ |/ _| | | |_| | Copyright (C) 2010 - 2013 SlamData, In... | precog/platform | mimir/src/main/scala/com/precog/mimir/ReductionLib.scala | Scala | agpl-3.0 | 23,997 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | ahnqirage/spark | sql/core/src/test/scala/org/apache/spark/sql/streaming/EventTimeWatermarkSuite.scala | Scala | apache-2.0 | 29,617 |
package aima.core.environment.map2d
/**
* Provides a general interface for two dimensional maps.
*
* @author Shawn Garner
*/
trait Map2D {
/**
*
* @return a list of all locations in the map.
*/
def locations: List[String]
/**
* Answers to the question: Where can I get, following one of ... | aimacode/aima-scala | core/src/main/scala/aima/core/environment/map2d/Map2D.scala | Scala | mit | 4,267 |
object GenericTypedPlaceholder {
def foo[T](x: T => Int, y: T) = x(y)
foo[String](/*start*/_.length/*end*/, "")
}
//(String) => Int | ilinum/intellij-scala | testdata/typeInference/expected/placeholder/GenericTypedPlaceholder.scala | Scala | apache-2.0 | 136 |
package dazzle.waffle
import dazzle.waffle.adapter.Adapter
import java.nio.file.Path
import java.io.{File, ByteArrayInputStream, InputStream}
import scala.util.Try
/**
* Filesystem
*
* @param adapter an adapter
*/
class FileSystem(adapter: Adapter) {
/**
* Reads the content of the file
*
* @param key f... | dazzle-lab/waffle | src/main/scala/dazzle/waffle/FileSystem.scala | Scala | mit | 2,259 |
package scala.dao
import model.dao.ProductDAO
import org.scalatest.BeforeAndAfterEach
import org.scalatestplus.play.{OneAppPerTest, PlaySpec}
import play.api.db.DBApi
import play.api.db.evolutions.Evolutions
import play.api.inject.guice.GuiceApplicationBuilder
import scala.reflect.ClassTag
/**
* Created by lukasz ... | lszku/ProductDatabase | test/scala/dao/ProductDaoTest.scala | Scala | bsd-3-clause | 1,178 |
package com.sksamuel.elastic4s.searches.queries.geo
import com.sksamuel.elastic4s.searches.GeoPoint
import com.sksamuel.elastic4s.searches.queries.Query
import com.sksamuel.exts.OptionImplicits._
case class GeoPolygonQuery(field: String,
points: Seq[GeoPoint],
ign... | Tecsisa/elastic4s | elastic4s-core/src/main/scala/com/sksamuel/elastic4s/searches/queries/geo/GeoPolygonQuery.scala | Scala | apache-2.0 | 1,083 |
package liang.don.dzviewer.tile
/**
* Stores information regarding the original image size.
*
* @constructor Create a new image size setting with a width and height value.
* @param width The image's width value.
* @param height The image's height value.
*
* @author Don Liang
* @Version 0.1, 14/09/2011
*/
clas... | dl2k84/DeepZoomViewer | src/liang/don/dzviewer/tile/ImageSize.scala | Scala | mit | 369 |
/*
* 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 ... | hequn8128/flink | flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/api/TableSourceTest.scala | Scala | apache-2.0 | 17,733 |
package org.jetbrains.plugins.scala
package codeInsight.unwrap
import java.util
import com.intellij.codeInsight.CodeInsightBundle
import com.intellij.psi.PsiElement
import org.jetbrains.plugins.scala.extensions.childOf
import org.jetbrains.plugins.scala.lang.psi.api.expr.ScIfStmt
/**
* Nikolay.Tropin
* 2014-06-27
... | ilinum/intellij-scala | src/org/jetbrains/plugins/scala/codeInsight/unwrap/ScalaIfUnwrapper.scala | Scala | apache-2.0 | 1,175 |
package controllers
import com.gu.googleauth.UserIdentity
import play.api.mvc.Security.AuthenticatedRequest
object Auth {
type AuthRequest[A] = AuthenticatedRequest[A, UserIdentity]
}
| ovotech/comms-audit-log | app/controllers/Auth.scala | Scala | mit | 190 |
package controllers
import play.api._
import play.api.mvc._
import play.api.libs.json._
import play.api.libs.iteratee._
import models._
import akka.actor._
import scala.concurrent.duration._
class Application extends Controller {
/**
* Just display the home page.
*/
def index = Action { implicit reque... | play2-maven-plugin/play2-maven-test-projects | play24/scala/websocket-chat/app/controllers/Application.scala | Scala | apache-2.0 | 981 |
package org.talkingpuffin.ui
import _root_.scala.swing.{ListView, Button, GridBagPanel, ScrollPane}
import org.talkingpuffin.filter.FilterSet
import javax.swing.event.{TableModelEvent, TableModelListener}
import javax.swing.BorderFactory
import java.awt.Dimension
import _root_.scala.swing.event.ButtonClicked
import _r... | dcbriccetti/talking-puffin | desktop/src/main/scala/org/talkingpuffin/ui/UnmutePane.scala | Scala | mit | 1,286 |
package ro.redeul.katas.algos
import org.scalatest.{GivenWhenThen, Matchers, FeatureSpec}
class IslandProfileTest extends FeatureSpec with GivenWhenThen with Matchers {
scenario("Complicated") {
Given("simple tree")
val profile = Seq((0, 0), (1, 7), (2, 5), (3, 10), (4, 2), (5, 3), (6, 1), (7, 6), (8, 4), (... | mtoader/katas | algos/src/test/scala/ro/redeul/katas/algos/IslandProfileTest.scala | Scala | mit | 1,943 |
package scala.slick
/** JDBC-related code, including all facilities for <em>Plain SQL</em> queries
* and JDBC-specific driver components. */
package object jdbc
| dvinokurov/slick | src/main/scala/scala/slick/jdbc/package.scala | Scala | bsd-2-clause | 163 |
class DefaultCredentialsProvider extends CredentialsProvider {
private val provider = new com.amazonaws.auth.DefaultAWSCredentialsProviderChain
override def getCredentials: Credentials = {
provider.getCredentials match {
case sc: com.amazonaws.auth.AWSSessionCredentials => Credentials(sc.getAWSAccessKeyId... | hirokikonishi/awscala | aws/core/src/main/scala/DefaultCredentialsProvider.scala | Scala | apache-2.0 | 608 |
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); yo... | wangcy6/storm_app | frame/kafka-0.11.0/kafka-0.11.0.1-src/core/src/test/scala/integration/kafka/tools/MirrorMakerIntegrationTest.scala | Scala | apache-2.0 | 3,292 |
/*
* Copyright (c) 2016, Innoave.com
* All rights reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN... | haraldmaida/AbacusSFX | src/main/scala/com/innoave/abacus/domain/model/Parameter.scala | Scala | apache-2.0 | 1,409 |
package com.github.kmizu.scomb
import org.scalatest.{DiagrammedAssertions, FunSpec}
class JsonSpec extends FunSpec with DiagrammedAssertions {
sealed abstract class JValue
case class JObject(properties: (String, JValue)*) extends JValue
case class JArray(elements: JValue*) extends JValue
case class JString(va... | kmizu/scomb | src/test/scala/com/github/kmizu/scomb/JsonSpec.scala | Scala | bsd-3-clause | 5,430 |
// An object is a class with a single instance
object Upper {
def upper(strings:String*) = strings.map(_.toUpperCase())
}
println(Upper.upper("A","First","Scala","Program").mkString(" "))
| M42/linguaggi | scala/hello.scala | Scala | gpl-2.0 | 191 |
import a.*
object B {
val foo = new A.Buf[Seq[Double]]
val bar = Seq.empty[Double]
foo.append(bar)
}
| dotty-staging/dotty | sbt-test/tasty-compat/add-overload/b/B.scala | Scala | apache-2.0 | 108 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | ArvinDevel/onlineAggregationOnSparkV2 | core/src/test/scala/org/apache/spark/scheduler/NotSerializableFakeTask.scala | Scala | apache-2.0 | 1,562 |
import sbt._
import Keys._
object SoqlStdlib {
lazy val settings: Seq[Setting[_]] = BuildSettings.projectSettings() ++ Seq(
name := "soql-stdlib",
libraryDependencies ++= {
if(scalaVersion.value.startsWith("2.13")) Nil
else Seq(compilerPlugin("org.scalamacros" % "paradise" % "2.1.1" cross CrossVe... | socrata-platform/soql-reference | project/SoqlStdlib.scala | Scala | apache-2.0 | 466 |
package io.youi.component.feature
import io.youi.Color
import io.youi.component.types.{Prop, TextDecorationLine, TextDecorationStyle}
class TextDecorationFeature(override val parent: FeatureParent) extends Feature {
lazy val line: Prop[Set[TextDecorationLine]] = new Prop(
getter = Set.empty,
setter = set =>... | outr/youi | gui/src/main/scala/io/youi/component/feature/TextDecorationFeature.scala | Scala | mit | 816 |
/*
* 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... | monixio/monix | monix-reactive/shared/src/test/scala/monix/reactive/internal/operators/DebounceFlattenSuite.scala | Scala | apache-2.0 | 1,616 |
package org.jetbrains.plugins.scala.codeInsight.template.macros
import com.intellij.codeInsight.lookup.LookupElement
import com.intellij.codeInsight.template.{Expression, ExpressionContext, Macro, Result}
import org.jetbrains.plugins.scala.project.ProjectExt
/**
* @author adkozlov
*/
trait ScalaMacro extends Macr... | ilinum/intellij-scala | src/org/jetbrains/plugins/scala/codeInsight/template/macros/ScalaMacro.scala | Scala | apache-2.0 | 1,005 |
/*
* Open Korean Text - Scala library to process Korean text
*
* 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/LIC... | open-korean-text/open-korean-text | src/main/scala/org/openkoreantext/processor/util/KoreanPos.scala | Scala | apache-2.0 | 4,461 |
import java.sql.SQLException
import com.mysql.jdbc.exceptions.MySQLDataException
import slick.driver.MySQLDriver.api._
import scala.concurrent.Await
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.duration._
case class User(id: Long, name: String, password: String, email: Option[Stri... | queirozfcom/slick_sandbox | src/main/scala/CaseClass.scala | Scala | apache-2.0 | 4,629 |
/*
* 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... | adarro/ddo-calc | subprojects/common/ddo-modeling/src/main/scala/io/truthencode/ddo/modeling/Library.scala | Scala | apache-2.0 | 840 |
/**
* Copyright (C) 2010-2011 LShift Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law... | lshift/diffa | kernel/src/main/scala/net/lshift/diffa/kernel/util/NonCancellingFeedbackHandle.scala | Scala | apache-2.0 | 951 |
package nz.wicker.autoencoder.math.optimization
case class LimitNumberOfLineSearches(maxLineSearches: Int)
extends TerminationCriterion[Any, (Int, Int)] {
def apply(x: Any, lineSearchesEvals: (Int, Int)): Boolean = {
lineSearchesEvals._1 > maxLineSearches
}
} | joergwicker/autoencoder | src/main/scala/nz/wicker/autoencoder/math/optimization/LimitNumberOfLineSearches.scala | Scala | gpl-3.0 | 274 |
/*
* 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 ... | michalsenkyr/spark | mllib/src/main/scala/org/apache/spark/ml/classification/NaiveBayes.scala | Scala | apache-2.0 | 15,016 |
/* Copyright (C) 2008-2014 University of Massachusetts Amherst.
This file is part of "FACTORIE" (Factor graphs, Imperative, Extensible)
http://factorie.cs.umass.edu, http://github.com/factorie
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with... | iesl/fuse_ttl | src/factorie-factorie_2.11-1.1/src/main/scala/cc/factorie/app/classify/Classifier.scala | Scala | apache-2.0 | 12,013 |
package my.game.pkg.screens
// import my.game.pkg.screens.BaseScreen
import my.game.pkg.utils.Utils._
import my.game.pkg.Asteroidsexample
import my.game.pkg.Settings.font_gen
import com.badlogic.gdx.Game
import com.badlogic.gdx.scenes.scene2d.{Stage, Actor}
import com.badlogic.gdx.Gdx
import com.badlogic.gdx.utils.v... | raymank26/asteroids-scala | common/src/main/scala/screens/main_menu.scala | Scala | gpl-3.0 | 2,753 |
/*
* Created on 2010/04/22
* Copyright (c) 2010-2011, Wei-ju Wu.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, ... | logicmoo/zmpp2 | zmpp-glk/src/test/scala/GlkFileSystemTest.scala | Scala | bsd-3-clause | 2,251 |
package geostat
/**
* UndirectedLink class
*
* @param nodeA first node
* @param nodeB second node
*/
@SerialVersionUID(123L)
class UndirectedLink(nodeA: MapPoint, nodeB: MapPoint) extends Link(nodeA, nodeB) {
override def hashCode: Int = {
val prime = 31L;
var result = 1L;
var a = 0L;
var b = ... | alessandroadamo/geostat | src/main/scala/geostat/UndirectedLink.scala | Scala | lgpl-3.0 | 815 |
package redeyes.api.http
import redeyes.api._
import redeyes.parser._
import scalaz.std.list._
import scalaz.std.string._
/**
* This module describes segments of paths that appear in a request.
*/
trait Paths extends ApiModule {
import charParser._
/**
* Describes a prefix of a path -- that is, a path p... | redeyes/redeyes | src/main/scala/redeyes/api/http/paths.scala | Scala | mit | 1,096 |
package com.overviewdocs.models.tables
import com.overviewdocs.database.Slick.api._
import com.overviewdocs.models.File
class FilesImpl(tag: Tag) extends Table[File](tag, "file") {
def id = column[Long]("id", O.PrimaryKey)
def referenceCount = column[Int]("reference_count")
def name = column[String]("name")
d... | overview/overview-server | common/src/main/scala/com/overviewdocs/models/tables/Files.scala | Scala | agpl-3.0 | 813 |
package pl.touk.nussknacker.engine.avro.schemaregistry.confluent.serialization.jsonpayload
import io.confluent.kafka.schemaregistry.avro.AvroSchema
import org.apache.avro.Schema
import org.apache.avro.io.{Encoder, NoWrappingJsonEncoder}
import org.apache.kafka.common.serialization.Serializer
import pl.touk.nussknacker... | TouK/nussknacker | utils/avro-components-utils/src/main/scala/pl/touk/nussknacker/engine/avro/schemaregistry/confluent/serialization/jsonpayload/ConfluentJsonPayloadSerializerFactory.scala | Scala | apache-2.0 | 2,293 |
/*
* Copyright (C) 2016-2017 Lightbend Inc. <https://www.lightbend.com>
*/
package com.lightbend.lagom.scaladsl.persistence
import akka.persistence.query.Offset
import akka.stream.scaladsl
import akka.{ Done, NotUsed }
import scala.concurrent.Future
import scala.concurrent.duration._
import scala.reflect.ClassTag
... | edouardKaiser/lagom | persistence/scaladsl/src/main/scala/com/lightbend/lagom/scaladsl/persistence/PersistentEntityRegistry.scala | Scala | apache-2.0 | 2,934 |
import java.io._
trait NotSerializableInterface { def apply(a: Any): Any }
abstract class NotSerializableClass { def apply(a: Any): Any }
// SAM type that supports lambdas-as-invoke-dynamic
trait IsSerializableInterface extends java.io.Serializable { def apply(a: Any): Any }
// SAM type that still requires lambdas-as-... | scala/scala | test/files/run/sammy_seriazable.scala | Scala | apache-2.0 | 1,547 |
/*
* Licensed to Intel Corporation under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* Intel Corporation licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use t... | SeaOfOcean/BigDL | dl/src/test/scala/com/intel/analytics/bigdl/torch/DistKLDivCriterionSpec.scala | Scala | apache-2.0 | 2,449 |
package gie.ggdrive
import gie.utils.prop.Configuration
import java.io.{FileNotFoundException, RandomAccessFile, File}
import gie.file_utils.ImplicitFileOps._
import gie.utils.{loan}
import gie.file_utils.file
import scala.collection.mutable
import scala.concurrent.{Promise, Future, ExecutionContext}
import com.typesa... | gienanesobaka/ggdrive | src/main/scala/gdrive_queue.scala | Scala | gpl-2.0 | 4,649 |
package pureconfig.generic
import scala.language.experimental.macros
import pureconfig._
/** An object that, when imported, provides implicit `ConfigReader` and `ConfigWriter` instances for value classes,
* tuples, case classes and sealed traits.
*/
object auto {
implicit def exportReader[A]: Exported[ConfigRe... | melrief/pureconfig | modules/generic/src/main/scala/pureconfig/generic/auto.scala | Scala | mpl-2.0 | 477 |
/*
* 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 ... | ueshin/apache-flink | flink-runtime/src/test/scala/org/apache/flink/runtime/testingUtils/TestingUtils.scala | Scala | apache-2.0 | 12,448 |
/*
* 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 ... | takezoe/incubator-predictionio | examples/scala-parallel-similarproduct/rid-user-set-event/src/main/scala/ALSAlgorithm.scala | Scala | apache-2.0 | 8,234 |
package tech.sourced.berserker.normalizer.model
import org.apache.spark.sql.types.{BinaryType, StringType, StructField, StructType}
object Schema {
val files = StructType(
StructField("repoId", StringType, nullable = false) ::
StructField("repoUrl", StringType, nullable = false) ::
StructField("hash... | bzz/berserker | normalizer/src/main/scala/tech/sourced/berserker/normalizer/model/Schema.scala | Scala | gpl-3.0 | 547 |
package guide
import scala.tools.nsc.Global
import scala.tools.nsc.transform.TypingTransformers
object _21_ParamAlias extends App {
def run(g: Global)(unit: g.CompilationUnit): Unit = {
object transformFields extends TypingTransformers {
override val global: g.type = g
import global._
object t... | retronym/scalac-survival-guide | src/main/scala/guide/_21_ParamAlias.scala | Scala | bsd-3-clause | 2,551 |
package org.coroutines
import org.coroutines.common._
import scala.annotation.tailrec
import scala.collection._
import scala.language.experimental.macros
import scala.reflect.macros.whitebox.Context
/** Synthesizes all coroutine-related functionality.
*/
private[coroutines] class Synthesizer[C <: Context](val c:... | storm-enroute/coroutines | src/main/scala/org/coroutines/Synthesizer.scala | Scala | bsd-3-clause | 14,974 |
package example
import example.Hello.User
import org.scalatest._
class HelloSpec extends FlatSpec with Matchers {
it should "sort with Null First" in {
val arr: Seq[User] = List(User(Some(1), 3), User(None, 1), User(Some(2), 2))
assert(Hello.sortWithNullFirst(arr) === arr.sortBy(_.order))
}
}
| rysh/my-scala-playground | sort-example/src/test/scala/example/HelloSpec.scala | Scala | mit | 312 |
/*
* 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 ... | bOOm-X/spark | mllib/src/main/scala/org/apache/spark/ml/r/AFTSurvivalRegressionWrapper.scala | Scala | apache-2.0 | 5,430 |
package ui.shader.builder
import ui.shader.builder.types.GlType
import ui.shader.builder.value.GlValue
import scala.collection.mutable.ListBuffer
class GlModule[T <: GlType](val result: GlValue[T],
val commands: ListBuffer[GlCommand],
val functions: Li... | gvatn/play-scalajs-webgl-spark | client/src/main/scala/ui/shader/builder/GlModule.scala | Scala | mit | 358 |
package bibcanon
import bibtex.{ Name, TexChars }
import java.nio.charset.{Charset, CharsetEncoder}
import java.util.regex.Pattern
object BibtexFormatter {
val ws = Pattern.compile("\\\\s")
def author2Bibtex(n: Name) = {
// There are three possible formats for a name in BibTeX, but we only
// use two, si... | jneem/bibcleaner | src/bibcanon/BibtexFormatter.scala | Scala | gpl-3.0 | 2,158 |
/*
* 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 ... | pronix/spark | examples/src/main/scala/org/apache/spark/examples/ml/MovieLensALS.scala | Scala | apache-2.0 | 6,388 |
package org.bowlerframework.model
class RequestMapperException(cause: String) extends Exception(cause) | rkpandey/Bowler | core/src/main/scala/org/bowlerframework/model/RequestMapperException.scala | Scala | bsd-3-clause | 104 |
// Copyright (C) 2016 IBM Corp. All Rights Reserved.
// See the LICENCE.txt file distributed with this work for additional
// information regarding copyright ownership.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may ob... | kane77/watson-scala-wrapper | src/main/scala/com/ibm/watson/developer_cloud/concept_insights/v2/model/Corpora.scala | Scala | apache-2.0 | 1,383 |
package scalaxy.streams
package test
import org.junit._
import org.junit.Assert._
class ArrayOpsTest extends StreamComponentsTestBase with StreamTransforms {
import global._
@Test
def testExtraction {
val SomeArrayOpsOp(_, ArrayOpsOp) = typecheck(q"genericArrayOps(Array[Any]())")
val SomeArrayOpsOp(_, ... | nativelibs4java/scalaxy-streams | src/test/scala/ops/ArrayOpsTest.scala | Scala | bsd-3-clause | 1,222 |
/*
* Copyright 2014–2017 SlamData Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | jedesah/Quasar | sparkcore/src/main/scala/quasar/physical/sparkcore/fs/elastic/SparkElastic.scala | Scala | apache-2.0 | 14,437 |
/**
*
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* OpenAPI spec version:
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
... | CucumisSativus/rpgRollerBackend | functionalTest/src/main/scala/io/swagger/client/model/AddActorsToCombatParameters.scala | Scala | mit | 423 |
/*
* Copyright (C) 2016-2019 Lightbend Inc. <https://www.lightbend.com>
*/
package docs.home.scaladsl.persistence
import com.lightbend.lagom.scaladsl.persistence.AggregateEventShards
import com.lightbend.lagom.scaladsl.persistence.AggregateEvent
import com.lightbend.lagom.scaladsl.persistence.AggregateEventTag
cla... | rcavalcanti/lagom | docs/manual/scala/guide/cluster/code/docs/home/scaladsl/persistence/ShardedBlogEventTag.scala | Scala | apache-2.0 | 645 |
/**
* Copyright (C) 2019 Inera AB (http://www.inera.se)
*
* This file is part of statistik (https://github.com/sklintyg/statistik).
*
* statistik 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 v... | sklintyg/statistik | gatling/src/test/scala/se/inera/statistics/gatling/NationellSjukskrivningPerKonPerLan.scala | Scala | lgpl-3.0 | 1,017 |
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.