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 ... | kiszk/spark | sql/core/src/test/scala/org/apache/spark/sql/sources/v2/DataSourceV2SQLSuite.scala | Scala | apache-2.0 | 68,704 |
package com.ebay.hackathon.endpoints
import java.util.Date
import javax.servlet.http.HttpServletRequest
import com.ebay.hackathon.Logging
import org.json4s.Formats
import org.scalatra._
import org.scalatra.json._
abstract class BaseServlet extends ScalatraServlet with Logging {
protected def param(key: String)(imp... | sreejithp/i.us.we | iuswe/src/main/scala/com/ebay/hackathon/endpoints/stack.scala | Scala | apache-2.0 | 5,399 |
object Main {
def main(args: Array[String]) {
var x = 1 / 0
}
}
| tobast/compil-petitscala | tests/exec-fail/division_by_zero.scala | Scala | gpl-3.0 | 72 |
package scala.pub.ayada.scala.utils
object ArrayUtils {
/**
* Returns new byte array by copying the data from input
*/
def handleArraySize(src: Array[Byte], length: Int): Array[Byte] = {
val dest: Array[Byte] = Array.ofDim[Byte](length)
if (length <= src.length)
System.... | k-ayada/ScalaUtils | pub/ayada/scala/utils/ArrayUtils.scala | Scala | apache-2.0 | 2,883 |
package com.socrata.util.scalacollectionsfromjava
import scala.jdk.CollectionConverters._
import scala.{collection => sc}
object ScalaCollectionsFromJava {
def scalaSeqAsJavaList[A](a: sc.Seq[A]):java.util.List[A] = a.asJava
}
| socrata-platform/socrata-utils | src/main/scala/com/socrata/util/scalacollectionsfromjava/ScalaCollectionsFromJava.scala | Scala | apache-2.0 | 231 |
/*
* Copyright 2015 Imply Data, 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 agree... | implydata/wikiticker | src/main/scala/io/imply/wikiticker/Message.scala | Scala | apache-2.0 | 2,549 |
package shredzzz.kirkwood.scalatest.tests.matrix.booleans
import shredzzz.kirkwood.cumath.tensor.CuMatrix
import breeze.linalg.{DenseVector, DenseMatrix}
import shredzzz.kirkwood.cumath.Sentinel
import shredzzz.kirkwood.scalatest.tests.matrix.BooleanCuMatrixTester
import shredzzz.kirkwood.scalatest._
class CuMatrixTe... | shredzzz/kirkwood | src/test/scala/shredzzz/kirkwood/scalatest/tests/matrix/booleans/CuMatrixTest.scala | Scala | apache-2.0 | 4,330 |
package tholowka.diz.marshalling.terms
private [terms] object NumericParser {}
private [terms] case class NumericParser {
def consume(input: AnyVal): String = {
input.toString
}
}
| tholowka/diz | src/main/scala/tholowka/diz/marshalling/terms/NumericParser.scala | Scala | mit | 198 |
package org.specs2.scalaz
import scalaz.\\/
import org.specs2.Specification
class DisjunctionMatchersSpec extends Specification with DisjunctionMatchers { def is = s2"""
beRightDisjunction should
match \\/- $rightMatches
beLeftDisjunction should
match -\\/ $leftMa... | typelevel/scalaz-specs2 | src/test/scala/DisjunctionMatchersSpec.scala | Scala | mit | 1,876 |
package scaladownunder
class FirstTest extends TestSpec {
describe("a first test") {
it("should fail") {
fail("oh no!")
}
}
}
| scala-downunder/myfirstapp | src/test/scala/scaladownunder/FirstTest.scala | Scala | apache-2.0 | 148 |
package controllers
import java.util.UUID
import javax.inject.{Inject, Singleton}
import play.api.mvc.{Action, Controller}
import services.OAuthSubredditSuggesterEngineProvider
import scala.concurrent.{ExecutionContext, Future}
/**
* Created by vikram on 1/15/17.
*/
@Singleton
class OAuth2Controller @Inject()(e... | vikram-r/subreddit-suggester | app/controllers/OAuth2Controller.scala | Scala | mit | 1,382 |
/**
* Copyright 2016, deepsense.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 applicable law or agreed ... | deepsense-io/seahorse-workflow-executor | deeplang/src/it/scala/io/deepsense/deeplang/LocalExecutionContext.scala | Scala | apache-2.0 | 3,483 |
package com.judopay.connect.statsd.sink
import com.judopay.connect.statsd.config.ExtractorConfig
import com.judopay.connect.statsd.{StatType, StatsdClient}
import org.apache.kafka.connect.data.Struct
import org.apache.kafka.connect.sink.SinkRecord
import java.lang.{Integer => jInt, Short => jShort, Long => jLong}
cl... | mtranter/kafka-connect-statsd | kafka-connect-statsd/src/main/scala/com/judopay/connect/statsd/sink/StatsdRecordDispatcher.scala | Scala | mit | 1,563 |
package pro.boto.recommender.learning.persistence
import org.apache.kudu.spark.kudu.{KuduContext, KuduDataFrameReader}
import org.apache.spark.sql.{DataFrame, SparkSession}
import pro.boto.recommender.configuration.RecommenderConfig
import pro.boto.recommender.data.tables.product.{ProductColumn, ProductRow}
object P... | eskabetxe/product-recommender | recommender-learning/src/main/java/pro/boto/recommender/learning/persistence/ProductTable.scala | Scala | apache-2.0 | 1,828 |
package com.fourgee.app
import org.scalatra.test.specs2._
// For more on Specs2, see http://etorreborre.github.com/specs2/guide/org.specs2.guide.QuickStart.html
class ReactScalatraServletSpec extends ScalatraSpec { def is =
"GET / on ReactScalatraServlet" ^
"should return status 200" ... | waynebli/react-scalatra | src/test/scala/com/fourgee/app/ReactScalatraServletSpec.scala | Scala | unlicense | 501 |
/**
* 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... | wangcy6/storm_app | frame/kafka-0.11.0/kafka-0.11.0.1-src/core/src/main/scala/kafka/server/KafkaApis.scala | Scala | apache-2.0 | 102,721 |
package travelling
import processing.core._
import PConstants._
import java.awt.event.{KeyEvent, MouseEvent}
import scala.collection.mutable.Map
/**
* Type your own text and see the letters move.
*/
class TypeTool(override val p: ToolContainer) extends Tool(p) {
val initials = Letters.supportedCharacters
val pl... | fdb/travelling_letters | src/main/scala/travelling/TypeTool.scala | Scala | lgpl-3.0 | 2,412 |
//
// TestEnvironmentDescription.scala -- Scala class TestEnvironmentDescription
// Project OrcTests
//
// Created by jthywiss on Sep 4, 2017.
//
// Copyright (c) 2019 The University of Texas at Austin. All rights reserved.
//
// Use and redistribution of this file is governed by the license terms in
// the LICENSE fil... | orc-lang/orc | OrcTests/src/orc/test/util/TestEnvironmentDescription.scala | Scala | bsd-3-clause | 8,989 |
package pdi.jwt
import pdi.jwt.exceptions.{
JwtNonNumberException,
JwtNonStringException,
JwtNonStringSetOrStringException,
JwtNonSupportedAlgorithm
}
import play.api.libs.json._
trait JwtJsonImplicits {
private def extractString(json: JsObject, fieldName: String): Option[String] =
(json \\ fieldName).t... | pauldijou/jwt-scala | json/play-json/src/main/scala/JwtJsonImplicits.scala | Scala | apache-2.0 | 3,976 |
package org.flowpaint.util
import java.awt.event.{MouseAdapter, MouseEvent}
/**
*
*
* @author Hans Haggstrom
*/
class DragHandler[T <: AnyRef]( dragButton : MouseButton, listener : DragListener[T] ) extends MouseAdapter {
sealed class DragState
object NoDrag extends DragState
object DragButtonPressed extend... | zzorn/flowpaint | src/main/scala/org/flowpaint/util/DragHandler.scala | Scala | gpl-2.0 | 2,371 |
/*
* 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/nn/keras/KullbackLeiblerDivergenceCriterionSpec.scala | Scala | apache-2.0 | 2,308 |
/*
* 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-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/util/FlinkRelMdUtil.scala | Scala | apache-2.0 | 3,195 |
package org.openurp.edu.eams.core.model
import collection.mutable
import collection.mutable.HashSet
import org.beangle.commons.collection.Collections
import org.beangle.data.model.Component
import org.beangle.data.model.annotation.code
import org.openurp.base.Department
import org.openurp.code.edu.Education
import or... | openurp/edu-eams-webapp | core/src/main/scala/org/openurp/edu/eams/core/model/StudentScope.scala | Scala | gpl-3.0 | 1,134 |
/*
* Copyright 2014 Commonwealth Computer Research, 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 applicabl... | jnh5y/geomesa | geomesa-jobs/src/main/scala/org/locationtech/geomesa/jobs/JobUtils.scala | Scala | apache-2.0 | 4,242 |
/* Copyright 2013 Nest Labs
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... | mighdoll/sparkle | util/src/main/scala/nest/sparkle/util/PeekableIterator.scala | Scala | apache-2.0 | 1,754 |
/*
* Copyright (C) 2013 Alcatel-Lucent.
*
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
* Licensed to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a cop... | molecule-labs/molecule | molecule-parsers/src/main/scala/molecule/parsers/ascii/StringBuilder.scala | Scala | apache-2.0 | 1,944 |
package basics
object AnonymousFunction {
val anonymous = (x: Int) => x + 2;
def add() = { (x: Int) => x + 1 }
def add1(x: Int) = { add().apply(x) }
def execFun(f: Int => Int, a: Int) = f(a)
def execFun(f: (Int, Int) => Int, a: Int, b: Int) = f(a, b)
} | szaqal/KitchenSink | Scala/01/src/main/scala/basics/AnonymousFunction.scala | Scala | gpl-3.0 | 269 |
/*
* Copyright (c) 2014-2020 by The Monix Project Developers.
* See the project homepage at: https://monix.io
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache... | alexandru/monifu | benchmarks/shared/src/main/scala/monix/benchmarks/ObservableMapTaskBenchmark.scala | Scala | apache-2.0 | 2,341 |
package com.outr.arango.api.model
import io.circe.Json
case class DeleteAPIAqlfunctionRc404(error: Boolean,
code: Option[Long] = None,
errorMessage: Option[String] = None,
errorNum: Option[Long] = None) | outr/arangodb-scala | api/src/main/scala/com/outr/arango/api/model/DeleteAPIAqlfunctionRc404.scala | Scala | mit | 316 |
package org.jetbrains.plugins.scala
package lang
package psi
package api
package toplevel
import com.intellij.openapi.util.text.StringUtil
import com.intellij.psi.{PsiClass, PsiMethod}
import org.jetbrains.plugins.scala.extensions._
import org.jetbrains.plugins.scala.lang.psi.api.statements._
import org.jetbrains.plug... | loskutov/intellij-scala | src/org/jetbrains/plugins/scala/lang/psi/api/toplevel/ScTypedDefinition.scala | Scala | apache-2.0 | 4,751 |
// The MIT License (MIT)
// Copyright (c) 2016 Josiah Witt, Christopher Poenaru
package com.trifectalabs.myriad
package aco
import akka.actor.{ActorRef, ActorSystem}
case class ACOSystem(
system: ActorSystem,
nodes: List[ActorRef],
config: ACOConfiguration)
object ACOUtil {
val r = new scala.util.Random(Sys... | trifectalabs/myriad | src/main/scala/aco/ACOSystem.scala | Scala | mit | 346 |
package org.mitre.mandolin.mlp.spark
import org.apache.spark.SparkContext
import org.apache.spark.rdd.RDD
import org.apache.spark.ml.linalg.SQLDataTypes.VectorType
import org.mitre.mandolin.mlp._
import org.mitre.mandolin.optimize.spark.{DistributedOnlineOptimizer, DistributedOptimizerEstimator}
import org.mitre.mand... | project-mandolin/mandolin | mandolin-spark/src/main/scala/org/mitre/mandolin/mlp/spark/MMLPDataFrames.scala | Scala | apache-2.0 | 7,852 |
/*
* Copyright 2001-2013 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... | travisbrown/scalatest | src/test/scala/org/scalatest/testng/TestNGSuiteGroupsSuite.scala | Scala | apache-2.0 | 4,508 |
/*
* Copyright 2015 Netflix, 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 t... | jasimmk/atlas | atlas-core/src/main/scala/com/netflix/atlas/core/stacklang/Extractors.scala | Scala | apache-2.0 | 1,138 |
/*
* 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 | core/src/main/scala/org/apache/spark/status/api/v1/ApiRootResource.scala | Scala | apache-2.0 | 10,594 |
package com.overviewdocs.background.reindex
import akka.stream.Materializer
import akka.stream.scaladsl.{Sink,Source}
import java.time.Instant
import java.util.concurrent.TimeUnit
import org.reactivestreams.Publisher
import scala.collection.immutable
import scala.concurrent.{ExecutionContext,Future}
import scala.concu... | overview/overview-server | worker/src/main/scala/com/overviewdocs/background/reindex/Reindexer.scala | Scala | agpl-3.0 | 4,078 |
package no.digipost.labs.users
import org.scalatest.FunSuite
import org.scalatra.test.scalatest._
import org.json4s._
import no.digipost.labs.security.Headers
import Headers._
import org.json4s.jackson.JsonMethods._
import SessionHelper._
class SessionsResourceTest extends ScalatraFunSuite {
addServlet(sessionServl... | digipost/labs | backend/src/test/scala/no/digipost/labs/users/SessionsResourceTest.scala | Scala | apache-2.0 | 1,161 |
package com.adendamedia.salad.api
import com.adendamedia.salad.serde.Serde
import scala.concurrent.{ExecutionContext, Future}
/**
* Interface with Redis key-value data structures.
* @tparam EK The key storage encoding.
* @tparam EV The value storage encoding.
* @tparam API The lettuce API to wrap.
*/
trait... | adenda/salad | src/main/scala/com/adendamedia/salad/api/SaladStringCommands.scala | Scala | lgpl-3.0 | 2,557 |
/*
,i::,
:;;;;;;;
;:,,::;.
1ft1;::;1tL
t1;::;1,
:;::; _____ __ ___ __
fCLff ;:: tfLLC / ___/ / |/ /____ _ _____ / /_
CLft11 :,, i1tffLi \__ \ ____ / /|_/ //... | S-Mach/s_mach.validate | src/main/scala/s_mach/validate/package.scala | Scala | mit | 2,521 |
// Copyright (C) 2021 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable ... | GerritCodeReview/gerrit | e2e-tests/src/test/scala/com/google/gerrit/scenarios/AbandonChange.scala | Scala | apache-2.0 | 2,384 |
package org.bone.ircballoon
import org.bone.ircballoon.model.IRCInfo
import org.eclipse.swt.widgets.{List => SWTList, _}
import org.eclipse.swt.layout._
import org.eclipse.swt.events._
import org.eclipse.swt.graphics._
import org.eclipse.swt.custom.StyledText
import org.eclipse.swt.custom.StackLayout
import org.ecli... | brianhsu/IRCBalloon | src/main/scala/ui/IRCSetting.scala | Scala | gpl-3.0 | 2,456 |
package pl.project13.scala.akka.raft
import akka.actor.Actor
import akka.persistence.fsm.PersistentFSM
import pl.project13.scala.akka.raft.compaction.LogCompactionExtension
import pl.project13.scala.akka.raft.config.RaftConfiguration
import pl.project13.scala.akka.raft.model._
import pl.project13.scala.akka.raft.proto... | ktoso/akka-raft | src/main/scala/pl/project13/scala/akka/raft/RaftActor.scala | Scala | apache-2.0 | 6,202 |
package hr.element.doit.csv
import java.io.Reader
import scala.annotation.tailrec
import scala.collection.immutable.VectorBuilder
import LineReader._
object LineReader {
type SmrMode = Smr => ModeCase
type Columns = Map[String, Int]
}
class LineReaderWithHeader(config: CSVConfig, reader: Reader, header: Columns)... | rinmalavi/doit-csv | src/main/scala/hr/element/doit/csv/LineReader.scala | Scala | bsd-3-clause | 4,801 |
package lila.perfStat
import lila.game.Pov
import lila.rating.PerfType
import org.joda.time.DateTime
case class PerfStat(
_id: String, // userId/perfId
userId: UserId,
perfType: PerfType,
highest: Option[RatingAt],
lowest: Option[RatingAt],
bestWins: Results,
worstLosses: Results,
cou... | JimmyMow/lila | modules/perfStat/src/main/PerfStat.scala | Scala | mit | 5,076 |
package scala.meta.internal.javacp.asm
import scala.meta.internal.javacp._
import scala.tools.asm.signature.SignatureVisitor
trait TypeParametersVisitor { this: SignatureVisitor =>
private var typeParameters = List.newBuilder[TypeParameterVisitor]
private var lastTypeParameterVisitor: TypeParameterVisitor = _
... | olafurpg/scalameta | semanticdb/metacp/src/main/scala/scala/meta/internal/javacp/asm/TypeParametersVisitor.scala | Scala | bsd-3-clause | 929 |
package spire.math
import scala.annotation.tailrec
import scala.math.{ScalaNumber, ScalaNumericConversions}
import scala.{specialized => spec}
import spire.algebra.{IsIntegral, Order, Rig, Signed}
import Natural._
// NOTE: this class works, but is only optimal for a relatively narrow
// set of problems. for really ... | lrytz/spire | core/src/main/scala/spire/math/Natural.scala | Scala | mit | 21,043 |
package org.shubinmountain.king
import android.os.Bundle
import com.badlogic.gdx.backends.android._
class Main extends AndroidApplication {
override def onCreate(savedInstanceState: Bundle) {
super.onCreate(savedInstanceState)
val config = new AndroidApplicationConfiguration
config.useAccelerometer = fa... | signal2564/king-of-nothing | android/src/main/scala/Main.scala | Scala | gpl-2.0 | 464 |
package org.hibernate.cache.rediscala.regions
import java.util.Properties
import org.hibernate.cache.rediscala.client.HibernateRedisCache
import org.hibernate.cache.rediscala.strategy.RedisAccessStrategyFactory
import org.hibernate.cache.spi.access.{CollectionRegionAccessStrategy, AccessType}
import org.hibernate.cach... | debop/hibernate-rediscala | src/main/scala/org/hibernate/cache/rediscala/regions/RedisCollectionRegion.scala | Scala | apache-2.0 | 1,364 |
/*
* 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 ... | ptkool/spark | external/kafka-0-10-sql/src/test/scala/org/apache/spark/sql/kafka010/KafkaSinkSuite.scala | Scala | apache-2.0 | 21,309 |
/*
* Copyright (c) 2013 Habla Computing
*
* 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 ag... | hablapps/app-dofollow | src/test/scala/org/hablapps/dofollow/test/portal/project/task/CloseTaskTest.scala | Scala | apache-2.0 | 24,457 |
package mesosphere.marathon
package core.instance
import com.typesafe.scalalogging.StrictLogging
import mesosphere.marathon.core.condition.Condition
import mesosphere.marathon.core.pod.MesosContainer
import mesosphere.marathon.core.task.bus.MesosTaskStatusTestHelper
import mesosphere.marathon.core.task.state.{NetworkI... | gsantovena/marathon | src/test/scala/mesosphere/marathon/core/instance/TestTaskBuilder.scala | Scala | apache-2.0 | 19,160 |
/*
* Copyright 2014-2022 Netflix, 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... | Netflix/atlas | atlas-lwcapi/src/main/scala/com/netflix/atlas/lwcapi/SubscriptionManager.scala | Scala | apache-2.0 | 10,161 |
package common.api.bitTracking
import common.api.bitTracking.BitTrackingMode.BitTrackingMode
import common.components.DaoComponents
import common.models.BitTrackingSettings
import common.models.bitTrackingFormData.BitTrackingFormData
import common.ref.MtrConfigRef
import javax.inject.Inject
import play.api.Logger
impo... | Cobbleopolis/MonsterTruckBot | modules/common/app/common/api/bitTracking/BitTrackingState.scala | Scala | mit | 6,055 |
package com.bradbrok.filmomatic
import com.pi4j.io.gpio.{RaspiPin, PinState}
import org.scalatest.{FlatSpec, Matchers}
import com.bradbrok.filmomatic.hardware.GpioPins._
class SmokeSpec extends FlatSpec with Matchers {
"Reading pin state" should "not fail" in {
val pin = pin1
pin.setState(PinState.LOW)
... | bradbrok/Film-O-Matic | integration/src/test/scala/com/bradbrok/filmomatic/SmokeSpec.scala | Scala | mit | 356 |
package com.votors.ml
import java.util.concurrent.atomic.AtomicInteger
import com.votors.common.{Conf, Utils}
import com.votors.common.Utils._
import com.votors.umls.UmlsTagger2
import opennlp.tools.parser.Parse
import org.apache.spark.broadcast.Broadcast
import scala.StringBuilder
import scala.collection.mutable.Ar... | zwChan/Clinical-Text-Mining | src/main/scala/com/votors/ml/Ngram.scala | Scala | apache-2.0 | 22,758 |
/*
* 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/akka-simple | src/main/scala/akka/actor/simple/package.scala | Scala | apache-2.0 | 785 |
/*
* 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 ... | spark0001/spark2.1.1 | mllib/src/main/scala/org/apache/spark/mllib/clustering/LDAModel.scala | Scala | apache-2.0 | 39,450 |
/*
* 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 n... | rhauch/kafka | core/src/test/scala/unit/kafka/coordinator/transaction/TransactionLogTest.scala | Scala | apache-2.0 | 3,690 |
package com.gh.helper.domain
import java.util.Date
/**
* Customers search parameters.
*
* @param title name
* @param store name of store
* @param details details
*/
case class GroceryListSearchParameters(title: Option[String] = None,
store: Option[String] = None,
... | saetar/grocery-backend | src/main/scala/com/gh/helper/domain/GroceryListSearchParameters.scala | Scala | unlicense | 387 |
package japgolly.scalajs.react.vdom
import japgolly.scalajs.react.feature.ReactFragment
import japgolly.scalajs.react.util._
import japgolly.scalajs.react.{PropsChildren, facade}
import scala.scalajs.js
// ================================================================================================================... | japgolly/scalajs-react | coreGeneric/src/main/scala/japgolly/scalajs/react/vdom/Implicits.scala | Scala | apache-2.0 | 6,174 |
package com.pygmalios.rawKafkaCassandra
import java.text.SimpleDateFormat
import java.util.Date
import akka.actor.ActorSystem
import akka.testkit.{ImplicitSender, TestKit}
import com.pygmalios.rawKafkaCassandra.actors.KafkaToCassandra
import com.pygmalios.rawKafkaCassandra.cassandra.CassandraSessionFactoryImpl
import... | pygmalios/raw-kafka-cassandra | src/itest/scala/com/pygmalios/rawKafkaCassandra/EmbeddedKafkaToLocalCassandraISpec.scala | Scala | apache-2.0 | 2,693 |
import daos._
package object App {
object Daos {
// Postgre
implicit val userDAO = UserPostgreDAO
implicit val adminDAO: AdminDAO = AdminPostgreDAO
// Mongo
// implicit val userDAO: UserDAO = UserMongoDAO
// implicit val adminDAO: AdminDAO = AdminMongoDAO
}
}
| ybr/PlayBootstrap | app/App.scala | Scala | mit | 294 |
/*
* Copyright 2014–2018 SlamData Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | slamdata/slamengine | qsu/src/main/scala/quasar/qsu/MinimizeAutoJoins.scala | Scala | apache-2.0 | 11,496 |
package autosteamgifts.background
import autosteamgifts.{CachedStorageDictionary, FutureQueue}
import autosteamgifts.TimeAmount._
import org.scalajs.dom.ext.Ajax
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future
import scala.scalajs.js
object GameRating extends MessageReceiver {... | erdavila/auto-steamgifts | src/main/scala/autosteamgifts/background/GameRating.scala | Scala | mit | 3,766 |
package com.twitter.finagle.ssl.server
import com.twitter.finagle.ssl.{
ApplicationProtocols,
CipherSuites,
ClientAuth,
KeyCredentials,
Protocols,
TrustCredentials
}
import java.io.File
import org.scalatest.funsuite.AnyFunSuite
class SslServerConfigurationTest extends AnyFunSuite {
test("server configu... | twitter/finagle | finagle-core/src/test/scala/com/twitter/finagle/ssl/server/SslServerConfigurationTest.scala | Scala | apache-2.0 | 2,559 |
/*
* Copyright (C) 2014 Stratio (http://stratio.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 app... | Stratio/cassandra-lucene-index | plugin/src/test/scala/com/stratio/cassandra/lucene/index/FSIndexTest.scala | Scala | apache-2.0 | 3,923 |
/*
* Copyright (C) 2020 MapRoulette contributors (see CONTRIBUTORS.md).
* Licensed under the Apache License, Version 2.0 (see LICENSE).
*/
package org.maproulette.framework.mixins
import anorm.NamedParameter
import org.maproulette.session.{SearchParameters, SearchLocation}
import org.maproulette.framework.psql.SQLU... | mgcuthbert/maproulette2 | app/org/maproulette/framework/mixins/SearchParametersMixin.scala | Scala | apache-2.0 | 33,689 |
/*
* fsc-analytics
*/
package de.pc2.dedup
import scala.collection.mutable.ListBuffer
import scala.collection.mutable.Map
import de.pc2.dedup.chunker.Chunk
import de.pc2.dedup.chunker.File
import de.pc2.dedup.chunker.FilePart
import de.pc2.dedup.fschunk.handler.FileDataHandler
/**
* Default class for all other fi... | dmeister/fs-c-analytics | src/main/scala/de/pc2/dedup/DefaultFileDataHandler.scala | Scala | bsd-3-clause | 1,357 |
package org.openapitools.client.model
case class Queue (
_class: Option[String],
_items: Option[List[QueueBlockedItem]]
)
object Queue {
def toStringBody(var_class: Object, var_items: Object) =
s"""
| {
| "class":$var_class,"items":$var_items
| }
""".stripMargin
}
| cliffano/swaggy-jenkins | clients/scala-gatling/generated/src/gatling/scala/org/openapitools/client/model/Queue.scala | Scala | mit | 320 |
// Copyright (c) 2018. Distributed under the MIT License (see included LICENSE file).
package cocoa.foundation
import scalanative.native._
import objc._
@ObjC
trait NSSecureCoding extends NSCoding {
}
object NSSecureCoding {
@inline def supportsSecureCoding(): BOOL = extern
}
| jokade/scalanative-cocoa | foundation/src/main/scala/cocoa/foundation/NSSecureCoding.scala | Scala | mit | 283 |
package poly.collection.node
import poly.collection._
/**
* @author Tongfei Chen
*/
trait GraphNode[K, +E] extends ForwardNodeLike[K, GraphNode[K, E]] {
def key: K
/** Returns the data on this node. */
final def data: K = key
def outgoingKeySet: Set[K]
def outgoingMap: Map[K, E]
def succ: Iterable[... | ctongfei/poly-collection | core/src/main/scala/poly/collection/node/GraphNode.scala | Scala | mit | 363 |
package edu.chop.cbmi.dataExpress.test.util
import org.scalatest.Tag
object OracleTest extends Tag("edu.chop.cbmi.dataExpress.test.util.tags.OracleTest")
object SqlServerTest extends Tag("edu.chop.cbmi.dataExpress.test.util.tags.SqlServerTest") | chop-dbhi/dataexpress | src/test/scala/edu/chop/cbmi/dataExpress/test/util/Tags.scala | Scala | bsd-2-clause | 246 |
object GClassNameCompletion {
"absd"
}
| Alefas/ScalaCourse2015 | src/main/scala/lecture3/GClassNameCompletion.scala | Scala | apache-2.0 | 41 |
package t6278
import language.implicitConversions
object test {
def ok() {
class Foo(val i: Int) {
def foo[A](body: =>A): A = body
}
implicit def toFoo(i: Int): Foo = new Foo(i)
val k = 1
k foo println("k?")
val j = 2
}
def nope() {
implicit class Foo(val i: Int) {
def ... | loskutov/intellij-scala | testdata/scalacTests/pos/t6278-synth-def.scala | Scala | apache-2.0 | 479 |
import sbt._
import Keys._
object Tools {
type Sett = Project.Setting[_]
def onVersion[A](all: Seq[A], on292: => Seq[A] = Seq(), on210: => Seq[A] = Seq()) =
scalaVersion(v => all ++ (if (v.contains("2.10")) on210 else on292))
def onVersionTask[A](all: Seq[A], on292: => Seq[A] = Seq(), on210: => Seq[A] = Se... | NICTA/trackfunction | project/Tools.scala | Scala | bsd-3-clause | 407 |
/*
* Copyright (c) 2013 Scott Abernethy.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is d... | scott-abernethy/opener-of-the-way | app/controllers/Babbling.scala | Scala | gpl-3.0 | 1,909 |
package com.allaboutscala.learn.spark.utils
import org.apache.spark.SparkConf
import org.apache.spark.sql.SparkSession
/**
* Created by Nadim Bahadoor on 28/06/2016.
*
* Tutorial: Learn How To Use Apache Spark
*
* [[http://allaboutscala.com/big-data/spark/]]
*
* Copyright 2016 Nadim Bahadoor (http://al... | nadimbahadoor/learn-spark | source-code/learn-spark/src/main/scala/com/allaboutscala/learn/spark/utils/Context.scala | Scala | apache-2.0 | 1,157 |
package gapt.proofs.lk.transformations
import gapt.expr.formula.Formula
import gapt.logic.Polarity
import gapt.proofs.SequentConnector
import gapt.proofs.lk.LKProof
import gapt.proofs.lk.LKVisitor
import gapt.proofs.lk.rules.AndLeftRule
import gapt.proofs.lk.rules.AndRightRule
import gapt.proofs.lk.rules.ContractionLe... | gapt/gapt | core/src/main/scala/gapt/proofs/lk/transformations/PushWeakeningsToLeaves.scala | Scala | gpl-3.0 | 10,135 |
/*
* 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 ... | houshengbo/openwhisk | core/standalone/src/main/scala/org/apache/openwhisk/standalone/PreFlightChecks.scala | Scala | apache-2.0 | 5,378 |
package io.youi
class Key private[youi](val value: String, val description: String, val `type`: KeyType) {
Key.register(this)
val pressed: Val[Boolean] = Var(false)
override def toString: String = s"Key(value: $value, description: $description, type: ${`type`})"
}
class CharacterKey private[youi](val char: Ch... | outr/youi | ui/shared/src/main/scala/io/youi/Key.scala | Scala | mit | 51,427 |
package com.dantezhao.helloworld.better
import akka.actor.{Actor, ActorSystem, PoisonPill, Props, Terminated}
/**
* Created by Dante on 2017/6/18.
*/
object BetterHelloWorld extends App{
val system = ActorSystem("HelloActors")
system.actorOf(Props[BetterMaster], "master")
}
//这里用三个case class来声明三种消息类型
// case... | dantezhao/concurrency_and_parallelism | actor/actor_scala/src/main/scala/com/dantezhao/helloworld/better/BetterHelloWorld.scala | Scala | apache-2.0 | 1,311 |
/*
* 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 ... | Intel-bigdata/OAP | oap-native-sql/core/src/test/scala/org/apache/spark/sql/connector/SupportsCatalogOptionsSuite.scala | Scala | apache-2.0 | 13,013 |
/**
* Copyright (C) 2015 Stratio (http://stratio.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 ap... | luismcl/crossdata | driver/src/test/scala/com/stratio/crossdata/driver/JavaDriverIT.scala | Scala | apache-2.0 | 2,356 |
package streams
import javax.inject.Inject
import akka.NotUsed
import akka.stream.FlowShape
import akka.stream.scaladsl.{Flow, GraphDSL, ZipWith, ZipWith2}
import models.twitter.{TwitterAPI, TwitterUser}
import play.api.Logger
import play.api.libs.json.JsValue
import play.api.libs.ws.WSRequest
import scala.concurren... | Queendimimi/twitter_extractor | app/streams/BatchUserFlow.scala | Scala | apache-2.0 | 4,239 |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... | apache/flink | flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/planner/plan/rules/logical/SplitPythonConditionFromCorrelateRule.scala | Scala | apache-2.0 | 6,017 |
package org.scalajs.testinterface.internal
import scala.scalajs.js
import js.Dynamic.{literal => lit}
import js.JSConverters._
import sbt.testing._
private[testinterface] object TaskDefSerializer {
def serialize(td: TaskDef): js.Dynamic = {
lit(fullyQualifiedName = td.fullyQualifiedName,
fingerprint =... | spaced/scala-js | test-interface/src/main/scala/org/scalajs/testinterface/internal/TaskDefSerializer.scala | Scala | bsd-3-clause | 891 |
package dsentric.contracts
import dsentric.codecs.std.DCodecs
import dsentric.codecs._
import dsentric.failure._
import dsentric._
import shapeless.HList
/**
* Verifies the structure of the document and removes any Empty objects or Null values.
* Bad types can be dropped or return failures
*/
private[dsentric] tra... | HigherState/dsentric | maps/src/main/scala/dsentric/contracts/VerifyOps.scala | Scala | apache-2.0 | 9,599 |
package dsl_examples.delay
import scalaz._
/** Implement the scalaz monad type class. */
object Delay4 {
sealed trait Delayed[+T] {
def force: T
}
object Delayed {
def delay[T](delayed: => T) = new Delayed[T] {
private[this] lazy val cached: T = delayed
def force: T = cached
}
impl... | phipsgabler/dsl-examples | src/main/scala/dsl_examples/delay/Delay4.scala | Scala | mit | 1,083 |
package basinet.nio
import basinet.{Result}
import java.nio.channels.{Pipe => JPipe, Channel => JChannel, _}
import java.net._
import scala.Option
import scala.annotation.tailrec
class Channel(channel: JChannel) extends basinet.Channel {
private def _asSelectable: Option[SelectableChannel] = if(channel.isInstanceOf... | sopindm/basinet | scala/nio/Channels.scala | Scala | epl-1.0 | 7,002 |
package fhj.swengb.project.courseware.controllers.homework
import java.net.URL
import java.util.ResourceBundle
import javafx.fxml.FXML
import javafx.scene.control.{Label, Button, TextField, DatePicker}
import fhj.swengb.project.courseware.components.BaseController
import fhj.swengb.project.courseware.models.Homework
... | McKorleone/fhj.swengb.project.courseware | src/main/scala/fhj/swengb/project/courseware/controllers/homework/HomeworkCreateController.scala | Scala | apache-2.0 | 2,733 |
//
// Copyright 2016 Commonwealth Bank of Australia
//
// 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 ... | CommBank/coppersmith | scalding/src/main/scala/commbank/coppersmith/scalding/ScaldingDataSource.scala | Scala | apache-2.0 | 4,833 |
package db
import javax.inject.{Inject, Singleton}
import data.{DASUser, DASUserOps, UserId}
import play.api.db.slick.DatabaseConfigProvider
import scala.concurrent.{ExecutionContext, Future}
trait DASUserModule extends SlickModule {
import driver.api._
implicit val userIdMapper: BaseColumnType[UserId] = Mapp... | UKGovernmentBEIS/das-alpha-client-mock | src/main/scala/db/DASUserModule.scala | Scala | mit | 1,319 |
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may... | KevinLiLu/kafka | core/src/test/scala/unit/kafka/admin/LeaderElectionCommandTest.scala | Scala | apache-2.0 | 11,642 |
/*
* Copyright (C) 2012 The Regents of The University California.
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICEN... | vax11780/shark | src/main/scala/shark/execution/UnionOperator.scala | Scala | apache-2.0 | 5,548 |
/*
* Copyright 2011-2019 Asakusa Framework Team.
*
* 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 ... | ashigeru/asakusafw-spark | runtime/src/main/scala/com/asakusafw/spark/runtime/graph/Source.scala | Scala | apache-2.0 | 1,788 |
package edu.gemini.smartgcal.odbinit.osgi
import org.osgi.framework.BundleContext
import java.util.logging.{Level, Logger}
// TODO: this is sort of an abomination, sorry.
// Figure out how to use Validation and do this correctly.
object BundleProp {
private val Log = Logger.getLogger(getClass.getName)
val toPos... | arturog8m/ocs | bundle/edu.gemini.smartgcal.odbinit/src/main/scala/edu/gemini/smartgcal/odbinit/osgi/BundleProp.scala | Scala | bsd-3-clause | 1,639 |
package org.veripacks.reader.dependencies
import org.veripacks.Logging
import collection.mutable.ListBuffer
import org.objectweb.asm._
import org.veripacks._
import org.veripacks.ClassUsage
@Export
class ClassDependenciesReader(additionalPkgFilter: PkgFilter) extends Logging {
def read(dependenciesOf: ClassName, cl... | adamw/veripacks | verifier/src/main/scala/org/veripacks/reader/dependencies/ClassDependenciesReader.scala | Scala | apache-2.0 | 1,314 |
package com.phasmid.hedge_fund.model
import spray.http.Uri._
import spray.http.Uri
import com.phasmid.hedge_fund.http.UriGet
/**
* @author robinhillyard
*/
case class GoogleQuery(exchange: String) extends Query {
val uriGet = new UriGet()
def createQuery(symbols: List[String]): Uri = {
//https://www.googl... | rchillyard/Scalaprof | hedge-fund/src/main/scala/com/phasmid/hedge_fund/model/GoogleQuery.scala | Scala | gpl-2.0 | 988 |
//
// Fundus - a cross platform application/game framework for Scala
// Copyright (c) 2013, Michael Bayne - All rights reserved.
// http://github.com/samskivert/fundus/blob/master/LICENSE
package fundus.core
import java.nio.Buffer
import fundus.gl.GLES2
/** Contains data for a bitmap image. A bitmap can be rendered... | samskivert/fundus | core/src/main/scala/fundus/core/Bitmap.scala | Scala | bsd-3-clause | 1,365 |
/*
* Copyright 2017 helloscala.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 law or agreed ... | helloscala/helloscala | hs-akka-http-cache/src/main/scala/helloscala/http/cache/CacheMemoryDirectives.scala | Scala | apache-2.0 | 733 |
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.