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 com.fsist.safepickle
import scala.annotation.StaticAnnotation
/** Place this annotation on a class parameter to make the Autogen pickler use this name in the pickled version
* instead of the parameter's name.
*/
case class Name(value: String) extends StaticAnnotation
/** Place this annotation on a class ... | fsist/safepickle | src/main/scala/com/fsist/safepickle/Annotations.scala | Scala | apache-2.0 | 473 |
// package org.scala_tools.javautils.j2s
//
// import org.specs._
// import org.specs.runner.{ConsoleRunner, JUnit4}
//
// class EnumerationSpecTest extends JUnit4(EnumerationSpec)
// object EnumerationSpecRunner extends ConsoleRunner(EnumerationSpec)
//
// object EnumerationSpec extends Specification {
// "A Java... | jorgeortiz85/scala-javautils | src/test/scala/org/scala_tools/javautils/j2s/EnumerationSpec.scala | Scala | apache-2.0 | 549 |
/*
* 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 applica... | kevinwheeler/geomesa | geomesa-core/src/main/scala/org/locationtech/geomesa/core/index/QueryPlanners.scala | Scala | apache-2.0 | 19,811 |
package com.rumblesan.examples.befunge
import scalaz._, Scalaz._
object Types {
type Grid = Vector[Vector[Instruction]]
type Stack = List[Integer]
type VMState[A] = State[VM, A]
sealed trait Direction
case object North extends Direction
case object South extends Direction
case object East extends ... | rumblesan/scala-experiments | src/main/scala/Examples/Befunge/Types.scala | Scala | bsd-2-clause | 373 |
package ch.epfl.bluebrain.nexus.iam.routes
import java.util.UUID
import akka.NotUsed
import akka.actor.ActorSystem
import akka.http.javadsl.server.Rejections._
import akka.http.scaladsl.marshalling.sse.EventStreamMarshalling._
import akka.http.scaladsl.model.headers.`Last-Event-ID`
import akka.http.scaladsl.model.sse... | hygt/nexus-iam | src/main/scala/ch/epfl/bluebrain/nexus/iam/routes/EventRoutes.scala | Scala | apache-2.0 | 5,297 |
/*
* Copyright © 2014 TU Berlin (emma@dima.tu-berlin.de)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by app... | emmalanguage/emma | emma-language/src/main/scala/org/emmalanguage/api/backend/Runtime.scala | Scala | apache-2.0 | 866 |
package org.kimbasoft.akka.router.broadcast
import akka.actor.Actor
import akka.routing.{BroadcastPool, FromConfig}
import org.kimbasoft.akka.router.ActorWorker
import org.kimbasoft.akka.router.ActorWorker.Exceptions.IllegalRequestException
import org.kimbasoft.akka.router.ActorWorker.Messages.{ConfRouterRequest, Prog... | kimba74/sandbox-scala | src/main/scala/org/kimbasoft/akka/router/broadcast/BroadcastRouterPool.scala | Scala | gpl-3.0 | 1,177 |
/*
* Copyright 2021 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | hmrc/ct-calculations | src/main/scala/uk/gov/hmrc/ct/ct600j/v2/TAQ01.scala | Scala | apache-2.0 | 992 |
/***********************************************************************
* Copyright (c) 2013-2015 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 is ... | drackaer/geomesa | geomesa-features/geomesa-feature-common/src/main/scala/org/locationtech/geomesa/features/SerializationOption.scala | Scala | apache-2.0 | 1,697 |
/*
* Copyright 2015 MongoDB, 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 ... | jCalamari/mongo-scala-driver | driver/src/test/scala/org/mongodb/scala/model/AggregatesSpec.scala | Scala | apache-2.0 | 9,724 |
/*
* 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 ... | Panos-Bletsos/spark-cost-model-optimizer | sql/core/src/test/scala/org/apache/spark/sql/test/SQLTestUtils.scala | Scala | apache-2.0 | 11,427 |
/* Copyright 2017-18, Emmanouil Antonios Platanios. 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/LICENSE-2.0
*
* Unless ... | eaplatanios/tensorflow | tensorflow/scala/api/src/main/scala/org/platanios/tensorflow/api/ops/training/optimizers/schedules/ExponentialDecay.scala | Scala | apache-2.0 | 4,485 |
/**
* Copyright (C) 2011 Orbeon, Inc.
*
* This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU Lesser General Public License as published by the Free Software Foundation; either version
* 2.1 of the License, or (at your option) any later version.
*
* This program i... | martinluther/orbeon-forms | src/main/scala/org/orbeon/oxf/externalcontext/AsyncRequest.scala | Scala | lgpl-2.1 | 4,034 |
package ml.combust.mleap.core.clustering
import ml.combust.mleap.core.Model
import ml.combust.mleap.core.annotation.SparkCode
import ml.combust.mleap.core.linalg.LinalgUtils
import ml.combust.mleap.core.types.{ScalarType, StructType, TensorType}
import org.apache.spark.ml.linalg.mleap.VectorWithNorm
import org.apache.... | combust/mleap | mleap-core/src/main/scala/ml/combust/mleap/core/clustering/KMeansModel.scala | Scala | apache-2.0 | 1,951 |
/*
* Copyright 2014-2021 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... | brharrington/atlas | atlas-chart/src/main/scala/com/netflix/atlas/chart/graphics/TimeSeriesStack.scala | Scala | apache-2.0 | 3,012 |
/*
* 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 ... | joseph-torres/spark | sql/core/src/main/scala/org/apache/spark/sql/DataFrameReader.scala | Scala | apache-2.0 | 32,307 |
import scala.actors.Actor
import scala.actors.scheduler.DaemonScheduler
object DaemonActors {
class MyDaemon extends Actor {
override def scheduler = DaemonScheduler
def act() {
loop {
react { case num: Int => reply(num + 1) }
}
}
}
def main(args: Array[String]) {
val d = (n... | promlow/books-and-tutorials | ActorsInScala/Chapter7/daemon.scala | Scala | mit | 367 |
package evescala.model.requestresponse
import com.twitter.finagle.http.Response
import evescala.converter.TimeConverter
import evescala.exception.HttpResponseNotOKException
import evescala.model.requestresponse.ApiKey.{CorporationApiKey, AccountApiKey, CharacterApiKey}
import org.jboss.netty.handler.codec.http.{HttpRe... | pequalsnp/evescala | src/main/scala/evescala/model/requestresponse/ApiKeyRequestResponse.scala | Scala | apache-2.0 | 4,955 |
/*
* Copyright 2017 PayPal
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in ... | Harikiranvuyyuru/squbs | squbs-unicomplex/src/test/scala/org/squbs/stream/KillSwitchStream.scala | Scala | apache-2.0 | 2,089 |
/*
* 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... | monix/monix | monix-reactive/shared/src/test/scala/monix/reactive/internal/operators/WithLatestFrom2Suite.scala | Scala | apache-2.0 | 3,378 |
package io.getquill.context.jdbc
import com.typesafe.config.ConfigFactory
import io.getquill.{ JdbcContextConfig, Spec }
class JdbcContextConfigSpec extends Spec {
"fail if cannot load dataSource" in {
intercept[IllegalStateException] {
JdbcContextConfig(ConfigFactory.empty()).dataSource
}
}
} | getquill/quill | quill-jdbc/src/test/scala/io/getquill/context/jdbc/JdbcContextConfigSpec.scala | Scala | apache-2.0 | 314 |
package org.jetbrains.plugins.scala.worksheet.ammonite
import com.intellij.codeInsight.navigation.actions.GotoDeclarationHandler
import com.intellij.openapi.actionSystem.DataContext
import com.intellij.openapi.editor.Editor
import com.intellij.psi.{PsiElement, PsiFile, PsiNamedElement}
import org.jetbrains.plugins.sca... | JetBrains/intellij-scala | scala/worksheet/src/org/jetbrains/plugins/scala/worksheet/ammonite/AmmoniteGotoHandler.scala | Scala | apache-2.0 | 2,211 |
/* sbt -- Simple Build Tool
* Copyright 2008, 2009 Mark Harrah
*/
package sbt
import org.apache.ivy.{core,plugins}
import core.module.id.ModuleRevisionId
import plugins.resolver.{ChainResolver, DependencyResolver, IBiblioResolver}
import plugins.resolver.{AbstractPatternsBasedResolver, AbstractSshBasedResolver, File... | matheshar/simple-build-tool | src/main/scala/sbt/impl/ConvertResolver.scala | Scala | bsd-3-clause | 3,288 |
package sp.system
import java.lang.Exception
import akka.actor._
import org.json4s.{JNothing}
import sp.domain._
import sp.system.messages._
import sp.domain.Logic._
import akka.pattern.ask
import akka.util.Timeout
import scala.util._
import scala.concurrent.duration._
class ServiceTalker(service: ActorRef,
... | kristoferB/SP | sp1/src/main/scala/sp/system/ServiceTalker.scala | Scala | mit | 7,482 |
package de.tu_berlin.formic.datastructure.tree.client
import akka.actor.{ActorSystem, Props}
import akka.testkit.{ImplicitSender, TestActorRef, TestKit, TestProbe}
import de.tu_berlin.formic.common.datastructure.client.AbstractClientDataStructureFactory.{NewDataStructureCreated, WrappedCreateRequest}
import de.tu_berl... | rbraeunlich/formic | tree/shared/src/test/scala/de/tu_berlin/formic/datastructure/tree/client/FormicTreeDataStructureFactorySpec.scala | Scala | apache-2.0 | 5,856 |
package com.simple.simplespec.matchers
import org.hamcrest.{Description, BaseMatcher}
import com.simple.simplespec.{Failure, Outcome}
class ThrownExceptionFunctionMatcher(pf: PartialFunction[Throwable, Any])
extends BaseMatcher[Outcome[Any]] {
def describeTo(description: Description) {
description.appendText... | SimpleFinance/simplespec | src/main/scala/com/simple/simplespec/matchers/ThrownExceptionFunctionMatcher.scala | Scala | mit | 526 |
/**
* 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... | usakey/kafka | core/src/main/scala/kafka/controller/ReplicaStateMachine.scala | Scala | apache-2.0 | 22,670 |
/**
* Copyright (C) 2016 Orbeon, Inc.
*
* This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU Lesser General Public License as published by the Free Software Foundation; either version
* 2.1 of the License, or (at your option) any later version.
*
* This program i... | brunobuzzi/orbeon-forms | form-runner/jvm/src/test/scala/org/orbeon/oxf/fr/SendTest.scala | Scala | lgpl-2.1 | 7,841 |
package com.github.tminglei.slickpg
package net
import slick.ast.TypedType
import slick.ast.Library.{SqlFunction, SqlOperator}
import slick.driver.{PostgresDriver, JdbcTypesComponent}
import slick.lifted.{FunctionSymbolExtensionMethods, ExtensionMethods}
import slick.jdbc.JdbcType
import FunctionSymbolExtensionMethods... | timcharper/slick-pg | core/src/main/scala/com/github/tminglei/slickpg/net/PgNetExtensions.scala | Scala | bsd-2-clause | 4,224 |
/*
* Copyright 2022 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | hmrc/help-to-save-frontend | test/uk/gov/hmrc/helptosavefrontend/controllers/ControllerSpecBase.scala | Scala | apache-2.0 | 930 |
package com.geishatokyo.sqlgen.external
import java.io.{ByteArrayOutputStream, InputStreamReader, BufferedReader, InputStream}
/**
*
* User: takeshita
* Create: 11/11/16 13:04
*/
trait ProcessSupport {
def closeProcessStreams(process: Process) = {
process.getOutputStream().close()
process.getInputStre... | geishatokyo/sql-generator | src/main/scala/com/geishatokyo/sqlgen/external/ProcessSupport.scala | Scala | mit | 828 |
package org.akoshterek.backgammon.nn
class InputUnit extends Neuron {
def value_=(v: Float): Unit = {
_value = v
}
} | akoshterek/MultiGammonJava | multi-gammon-core/src/main/java/org/akoshterek/backgammon/nn/InputUnit.scala | Scala | gpl-3.0 | 125 |
package chrome.system.cpu.bindings
import scala.scalajs.js
import scala.scalajs.js.annotation.JSName
@JSName("chrome.system.cpu")
object CPU extends js.Object {
def getInfo(callback: js.Function1[CPUInfo, _]): Unit = js.native
}
| amsayk/scala-js-chrome | bindings/src/main/scala/chrome/system/cpu/bindings/CPU.scala | Scala | mit | 241 |
/*
* Copyright 2008 WorldWide Conferencing, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... | wsaccaco/lift | archetypes/lift-archetype-jpa-basic/src/main/resources/archetype-resources/spa/src/main/scala/model/Enumv.scala | Scala | apache-2.0 | 1,378 |
package controllers.api
import controllers.actions.{WithUser, WithDBSession, Security}
import play.api.db.slick.DBAction
import play.api.libs.json.{JsError, JsSuccess, Json}
import play.api.mvc._
import repositories.UserRepositoryComponent
import models.UserFormatter._
import repositories.UserRepositoryMessages._
imp... | nagirrab/Karaoke | app/controllers/api/UserController.scala | Scala | mit | 1,716 |
package com.mblinn.oo.tinyweb.stepthree
import com.mblinn.oo.tinyweb.ControllerException
import com.mblinn.oo.tinyweb.RenderingException
trait Controller {
def handleRequest(httpRequest: HttpRequest): HttpResponse
}
class FunctionController(view: View, doRequest: (HttpRequest) =>
Map[String, List[String]] ) exte... | pharmpress/codingdojo | dojo-tinyweb/src/main/scala/com/mblinn/oo/tinyweb/stepthree/Controller.scala | Scala | apache-2.0 | 778 |
/*
* Copyright (c) 2011-2012, Alex McGuire, Louis Botterill
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, th... | syl20bnr/maker | maker/src/maker/project/Module.scala | Scala | bsd-2-clause | 10,207 |
package im.actor.server.group
import akka.http.scaladsl.util.FastFuture
import akka.pattern.ask
import akka.util.Timeout
import com.google.protobuf.ByteString
import im.actor.api.rpc.AuthorizedClientData
import im.actor.api.rpc.groups.{ ApiGroup, ApiGroupFull, ApiMember }
import im.actor.server.dialog.UserAcl
import i... | ljshj/actor-platform | actor-server/actor-core/src/main/scala/im/actor/server/group/GroupOperations.scala | Scala | mit | 7,467 |
package models
import java.util.UUID
import com.mohiva.play.silhouette.api.{Identity, LoginInfo}
sealed trait User extends Identity{
val userID: UUID
val loginInfo: LoginInfo
val title: String
val firstName: String
val lastName: String
val email: String
}
/**
* The administrator object.
*
* @param us... | BBK-SDP-2015-jtomli03/Morphidose2 | app/models/User.scala | Scala | apache-2.0 | 1,515 |
package mot.monitoring
import mot.util.LiveTabler
import mot.util.Tabler
import mot.Context
import mot.util.Util.CeilingDivider
import mot.Address
import mot.util.Util.atomicLong2Getter
import mot.util.Differ
class ClientConnector(context: Context) extends MultiCommandHandler {
val subcommands = Seq(Live, Totals)
... | marianobarrios/mot | src/main/scala/mot/monitoring/ClientConnector.scala | Scala | bsd-2-clause | 5,451 |
/** soar
*
* Copyright (c) 2017 Hugo Firth
* Email: <me@hugofirth.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
*
... | NewcastleComputingScience/student-outcome-accelerator | glance-core/shared/src/main/scala/uk/ac/ncl/la/soar/glance/eval/Data.scala | Scala | apache-2.0 | 2,074 |
package keystoneml.nodes.util
import breeze.linalg.DenseVector
import org.apache.spark.rdd.RDD
import keystoneml.pipelines.FunctionNode
/**
* This transformer splits the input vector into a number of blocks.
*/
class VectorSplitter(
blockSize: Int,
numFeaturesOpt: Option[Int] = None)
extends FunctionNode... | amplab/keystone | src/main/scala/keystoneml/nodes/util/VectorSplitter.scala | Scala | apache-2.0 | 1,322 |
package singleton.ops
import org.scalacheck.{Prop, Properties}
import shapeless.test.illTyped
import singleton.TestUtils._
class STESpec extends Properties("<=") {
type OP[L,R] = <=[L,R]
type leftNat = shapeless.Nat._1
type leftChar = W.`'\\u0001'`.T
type leftInt = W.`1`.T
type leftLong = W.`1L`.T
type le... | soronpo/singleton-ops | src/test/scala/singleton/ops/STESpec.scala | Scala | apache-2.0 | 6,279 |
/*
* La Trobe University - Distributed Deep Learning System
* Copyright 2016 Matthias Langer (t3l@threelights.de)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apa... | bashimao/ltudl | demos/src/test/scala/edu/latrobe/blaze/TestTensors.scala | Scala | apache-2.0 | 7,334 |
package euranova
object Main {
val thing = new Thing()
def main(args: Array[String]) {
println("Hello World !")
println(thing.prop)
}
}
| euranova/code_retreat | scaffolds/scala/src/main/scala/euranova/Main.scala | Scala | mit | 152 |
/*
* 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 ... | graphframes/graphframes | src/test/scala/org/graphframes/lib/ConnectedComponentsSuite.scala | Scala | apache-2.0 | 9,021 |
package lila.hub
package actorApi
import chess.format.Uci
import org.joda.time.DateTime
import play.api.libs.json._
import scala.concurrent.Promise
// announce something to all clients
case class Announce(msg: String, date: DateTime, json: JsObject)
package streamer {
case class StreamStart(userId: String)
}
pack... | luanlv/lila | modules/hub/src/main/actorApi.scala | Scala | mit | 10,805 |
package com.holmesprocessing.analytics.relationship
import com.holmesprocessing.analytics.relationship.primaryRelationships.PrimaryRelationshipsGenerator
import com.holmesprocessing.analytics.relationship.knowledgeBase.KnowledgeBaseGenerator
import com.holmesprocessing.analytics.relationship.SparkConfig._
import java... | cli0/gsoc_relationship | primary_relationships/src/main/scala/com/holmesprocessing/analytics/relationship/PrimaryRelationshipsApplication.scala | Scala | apache-2.0 | 934 |
/*
* Copyright (C) 2009-2018 Lightbend Inc. <https://www.lightbend.com>
*/
package play.api.mvc
import java.net.URLEncoder
import org.specs2.specification.core.Fragments
class FlashCookieSpec extends org.specs2.mutable.Specification {
"Flash cookies" should {
"bake in a header and value" in {
val es =... | Shenker93/playframework | framework/src/play/src/test/scala/play/api/mvc/FlashCookieSpec.scala | Scala | apache-2.0 | 3,280 |
package memnets.fx.app
import java.beans.PropertyDescriptor
import memnets.core._
import memnets.fx.utils._
import org.controlsfx.property.BeanPropertyUtils
class ConfigEditorFX extends PropertyEditorFX(categoryOn = false) {
def setConfig(cfg: ModelConfig): Unit = {
setItems(BeanPropertyUtils.getProperties(cfg... | MemoryNetworks/memnets | fx/src/main/scala/memnets/fx/app/ConfigEditorFX.scala | Scala | apache-2.0 | 893 |
/*
* 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/models/recommendation/WideAndDeep.scala | Scala | apache-2.0 | 16,239 |
/*
* Copyright (C) 2009 Lalit Pant <pant.lalit@gmail.com>
*
* The contents of this file are subject to the GNU General Public License
* Version 3 (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.gnu.org/copyleft/gpl.html
*
*... | dotta/kojo | KojoEnv/src/net/kogics/kojo/SpriteCanvas.scala | Scala | gpl-3.0 | 20,770 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you... | wangyixiaohuihui/spark2-annotation | core/src/main/scala/org/apache/spark/executor/CommitDeniedException.scala | Scala | apache-2.0 | 1,277 |
package net.sansa_stack.query.spark.dof.tensor
import net.sansa_stack.query.spark.dof.bindings._
import net.sansa_stack.query.spark.dof.node._
import net.sansa_stack.query.spark.dof.triple.Reader
import net.sansa_stack.query.spark.utils.SetAccumulator
import org.apache.jena.graph.{Node, Triple}
import org.apache.jena.... | SANSA-Stack/SANSA-RDF | sansa-query/sansa-query-spark/src/main/scala/net/sansa_stack/query/spark/dof/tensor/RDDTensor.scala | Scala | apache-2.0 | 7,692 |
package biz.meetmatch.modules
import biz.meetmatch.model.{Sentence, SentenceCountByLanguage}
import org.apache.spark.sql.{Dataset, SparkSession}
import org.rogach.scallop.Scallop
object CountSentencesByLanguage extends Module with ParquetExtensions[SentenceCountByLanguage] {
override val parquetFile = "SentenceCoun... | tolomaus/languagedetector | src/main/scala/biz/meetmatch/modules/CountSentencesByLanguage.scala | Scala | mit | 1,893 |
/*
* Copyright 2019 Spotify AB.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to ... | spotify/scio | scio-google-cloud-platform/src/main/scala/com/spotify/scio/bigquery/package.scala | Scala | apache-2.0 | 2,819 |
package scife
package enumeration
package common.enumdef
import scife.{ enumeration => e }
import scife.util._
import scala.language.postfixOps
object BinarySearchTreeEnum {
import structures.BSTrees._
import dependent._
import memoization._
type EnumType = Depend[(Int, Range), Tree]
val enumDefLis... | kaptoxic/SciFe | src/test/scala/scife/enumeration/common/enumdef/BinarySearchTreeEnum.scala | Scala | gpl-2.0 | 9,415 |
package edu.umass.ciir.kbbridge.features
import scala.collection.JavaConversions._
import edu.umass.ciir.models._
import org.lemurproject.galago.core.parse.Document
import scala.collection.mutable.HashMap
import util.{SetMeasures, LanguageModelFeatures}
import edu.umass.ciir.kbbridge.search.{DocumentBridgeMap}
import ... | daltonj/KbBridge | src/main/scala/edu/umass/ciir/kbbridge/features/LocalDocumentFeatures.scala | Scala | apache-2.0 | 7,136 |
package com.virdis.datachallenge
import com.typesafe.config.{ConfigFactory, Config}
import com.virdis.{UnicodeTweetCounter, TwitterHashTagGraph}
object DataChallenge {
def main(args: Array[String]) {
println("Main Challenge Started......")
if (args.isEmpty) {
start(ConfigFactory.load("application.con... | virdis/data-challenge | src/main/scala/DataChallenge.scala | Scala | apache-2.0 | 653 |
package me.mtrupkin.terminal
import me.mtrupkin.console.screen.{Screen, ConsoleKey}
import me.mtrupkin.geometry.Size
// Created on 11/20/2014.
case class Input(
key: Option[ConsoleKey] = None,
mouseMove: Option[me.mtrupkin.geometry.Point] = None,
mouseClick: Option[me.mtrupkin.geometry.Point] = None,... | mtrupkin/console-lib | src/main/scala/terminal/Terminal.scala | Scala | mit | 532 |
/*
* Copyright 2015 GeekSaga.
*
* 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... | geekflow/light | collector/src/main/java/com/geeksaga/light/collector/Product.scala | Scala | apache-2.0 | 709 |
package com.github.cthulhu314.scalaba.persistance
import com.github.cthulhu314.scalaba.models.{Thread, Post}
import com.mongodb.casbah.Imports._
import com.novus.salat._
import com.novus.salat.global._
import scala.Some
class MongoRepository(url : String, database : String) extends Repository{
val db = MongoClient(... | cthulhu314/scalaba | src/main/scala/com/github/cthulhu314/scalaba/persistance/posts/MongoRepository.scala | Scala | mit | 2,234 |
/**
* 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... | ErikKringen/kafka | core/src/test/scala/unit/kafka/integration/UncleanLeaderElectionTest.scala | Scala | apache-2.0 | 11,520 |
import java.io.File
import java.io.FileWriter
import java.io.BufferedWriter
import scala.io.Source
import scala.io.Codec // for 2.8
object Helper {
implicit val codec = Codec.default // for 2.8
def translateShouldToMust(shouldLine: String): String = {
val temp1 = shouldLine.replaceAll("<code>must</code>", ... | kevinwright/scalatest | src/generators/scala/GenMustMatchers.scala | Scala | apache-2.0 | 4,423 |
package com.twitter.finagle.http.filter
import com.twitter.finagle.Service
import com.twitter.finagle.http.{MediaType, Method, Request, Response, Status}
import com.twitter.util.Future
import org.specs.SpecificationWithJUnit
class JsonpFilterSpec extends SpecificationWithJUnit {
val dummyService = new Service[Requ... | joshbedo/finagle | finagle-http/src/test/scala/com/twitter/finagle/http/filter/JsonpFilterSpec.scala | Scala | apache-2.0 | 1,944 |
package thesis.orderings
import thesis.matrixTypes._
import thesis.utils._
import breeze.linalg._
class NestedOrdering extends MatrixOrdering{
override def toString:String = "Nested"
/**
* @param c vector containing the sum of each column
* @return a vector containing the sum of each row
*/
private def conju... | GLeurquin/Faithful-visualization-of-categorical-datasets | src/main/scala/Orderings/NestedOrdering.scala | Scala | mit | 1,390 |
/*
* 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
* distributed u... | Leeheng86/spark-deployer | core/src/main/scala/sparkdeployer/EC2Machines.scala | Scala | apache-2.0 | 5,833 |
/*
* Licensed to The Apereo Foundation under one or more contributor license
* agreements. See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* The Apereo Foundation licenses this file to you under the Apache License,
* Version 2.0, (the "License"); you ma... | equella/Equella | Source/Plugins/Core/com.equella.serverbase/scalasrc/com/tle/core/db/types/DbUUID.scala | Scala | apache-2.0 | 999 |
package org.example
class SIncrementalityType | JetBrains/intellij-scala | scala/scala-impl/testdata/move/removeImport_MultipleSelectors_MoveAllButOne/before/org/example/SIncrementalityType.scala | Scala | apache-2.0 | 46 |
package cmdreader.std
import cmdreader._
import types._
import util._
import run._
class Idxr extends Command {
def getName = "idxr"
def isValidArg0(n: Int) = n == 3 || n == 4
def apply(args: Array[Type]): Type = {
try {
CollectionOps.ctc(l => {
CollectionOps.replaceFirstOccurrence(args(0), a... | bluebear94/bag | src/main/scala/cmdreader/std/Idxr.scala | Scala | gpl-3.0 | 664 |
import ore.db.ModelService
import ore.discourse.OreDiscourseApi
import zio.{Has, Task, UIO}
package object ore {
type Config = Has[OreJobsConfig]
type Db = Has[ModelService[UIO]]
type Discourse = Has[OreDiscourseApi[Task]]
type OreEnv = zio.ZEnv with Config with Db with Discourse
}
| SpongePowered/Ore | jobs/src/main/scala/ore/package.scala | Scala | mit | 304 |
package enums
import play.api.libs.json.{Writes, Reads}
import scala.slick.driver.MySQLDriver.simple._
/**
* Created by mind on 1/12/15.
*/
object StateEnum extends Enumeration {
type State = Value
val noKey = Value(0, "no salt key")
val offline = Value(1, "can't ping and test ping")
val arrived = Value(2,... | sdgdsffdsfff/bugatti | app/enums/StateEnum.scala | Scala | bsd-2-clause | 610 |
/*
* Copyright 2022 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | hmrc/self-service-time-to-pay-frontend | app/views/Views.scala | Scala | apache-2.0 | 2,940 |
package tiger
trait Temp {
type Label
type Temp
def newTemp(): Temp
def newLabel(): Label
def namedLabel(s:String): Label
def namedTemp(s:String): Temp
}
object Temp extends Temp {
type Label = String
type Temp = String
var i, j = 0
override def newTemp(): Temp = {
i += 1
"T" + i
}
... | joseluisdiaz/tigerc | src/main/scala/tiger/Temp.scala | Scala | apache-2.0 | 484 |
package pl.combosolutions.backup.tasks
import java.nio.file.{ Paths, Path }
import org.specs2.mock.Mockito
import org.specs2.mutable.Specification
import org.specs2.specification.Scope
import pl.combosolutions.backup.{ Async, Cleaner }
import pl.combosolutions.backup.test.Tags.UnitTest
class SelectFilesSpec extends ... | MateuszKubuszok/BackupDSL | modules/tasks/src/test/scala/pl/combosolutions/backup/tasks/SelectFilesSpec.scala | Scala | mit | 2,123 |
package com.blinkbox.books.purchasing.admin
import org.scalatest.FlatSpec
import spray.http.StatusCodes
import spray.routing.HttpService
import spray.testkit.ScalatestRouteTest
class AdminApiTest extends FlatSpec with ScalatestRouteTest with HttpService {
def actorRefFactory = system
val route = (new AdminApi().r... | blinkboxbooks/skeleton-service | admin/src/test/scala/com/blinkbox/purchasing/admin/AdminApiTest.scala | Scala | mit | 549 |
import org.fedoraproject.mobile.util.Hashing
import org.scalacheck.Properties
import org.scalacheck.Prop.forAll
object StringSpecification extends Properties("String") {
property("length") = forAll { (a: String) =>
Hashing.md5(a).length == 32
}
property("hexadecimal") = forAll { (a: String) =>
Hashing.... | fedora-infra/mobile | src/test/scala/Specs.scala | Scala | mpl-2.0 | 384 |
package scaladex.infra.config
import com.typesafe.config.Config
import com.typesafe.config.ConfigFactory
final case class ElasticsearchConfig(port: Int, index: String, reset: Boolean)
object ElasticsearchConfig {
def load(): ElasticsearchConfig =
from(ConfigFactory.load())
def from(config: Config): Elastics... | scalacenter/scaladex | modules/infra/src/main/scala/scaladex/infra/config/ElasticsearchConfig.scala | Scala | bsd-3-clause | 531 |
package com.geeksville.andropilot.gui
import com.ridemission.scandroid.AsyncVoidTask
import com.ridemission.scandroid.AndroidLogger
import com.geeksville.sunspot.SunspotClient
import android.content.Context
import android.app.Activity
import com.ridemission.scandroid.UsesResources
import android.support.v4.app.Fragmen... | geeksville/arduleader | andropilot/src/main/scala/com/geeksville/andropilot/gui/SunspotDetectorTask.scala | Scala | gpl-3.0 | 1,441 |
package org.jetbrains.plugins.scala.lang.psi.stubs.impl
import com.intellij.psi.PsiElement
import com.intellij.psi.stubs.{IStubElementType, StubBase, StubElement}
import com.intellij.util.SofterReference
import com.intellij.util.io.StringRef
import org.jetbrains.plugins.scala.lang.psi.api.base.{ScIdList, ScPatternList... | loskutov/intellij-scala | src/org/jetbrains/plugins/scala/lang/psi/stubs/impl/ScValueOrVariableStubImpl.scala | Scala | apache-2.0 | 2,474 |
package org.loudkicks.console
import org.loudkicks.{User, Post}
sealed trait Response {
def lines: Seq[String]
}
case class Lines(lines: Seq[String]) extends Response
trait Empty extends Response {
val lines = Seq.empty
}
case object Empty extends Empty
case class Posted(post: Post) extends Empty
case class ... | timothygordon32/loudkicks | src/main/scala/org/loudkicks/console/Response.scala | Scala | apache-2.0 | 374 |
package calculator
object TweetLength {
final val MaxTweetLength = 140
def tweetRemainingCharsCount(tweetText: Signal[String]): Signal[Int] = {
Signal {
MaxTweetLength - tweetLength(tweetText())
}
}
def colorForRemainingCharsCount(remainingCharsCount: Signal[Int]): Signal[String] = {
Signal... | kevllino/scala-specialization | 01-ProgFun2/calculator/src/main/scala/calculator/TweetLength.scala | Scala | mit | 1,139 |
import scala.language.experimental.macros
object Macros {
def foo1(x: Any) = macro 2
def foo2(x: Any) = macro Impls.foo(null)(null)
def foo3(x: Any) = macro {2; Impls.foo}
{
def impl(c: scala.reflect.macros.blackbox.Context) = { import c.universe._; c.Expr[Unit](q"()") }
def foo = macro impl
foo
}... | scala/scala | test/files/neg/macro-invalidshape/Macros_Test_2.scala | Scala | apache-2.0 | 403 |
// Generated by the Scala Plugin for the Protocol Buffer Compiler.
// Do not edit!
//
// Protofile syntax: PROTO2
package com.google.protobuf.descriptor
import _root_.scalapb.internal.compat.JavaConverters._
/** @param deprecated
* Is this method deprecated?
* Depending on the target platform, this can emit D... | dotty-staging/ScalaPB | scalapb-runtime/jvm/src/main/scala/com/google/protobuf/descriptor/MethodOptions.scala | Scala | apache-2.0 | 16,336 |
/*
* 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... | cheeseng/scalatest | examples/src/main/scala/org/scalatest/examples/spec/pending/SetSpec.scala | Scala | apache-2.0 | 967 |
/*
* This file is part of Evo2DSim.
*
* Evo2DSim 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
* (at your option) any later version.
*
* Evo2DSim is distrib... | vchuravy/Evo2DSim | core/src/main/scala/org/vastness/evo2dsim/core/gui/RenderManager.scala | Scala | mit | 833 |
package org.scalacheck.ops
import org.scalacheck.{Arbitrary, Gen}
import scala.collection.{BitSet, mutable}
import scala.reflect.{ClassTag, classTag}
object GenOps {
@deprecated("This method will be removed in the next major version.", "2.3.0")
def binary: Gen[Int] = Gen.oneOf(0, 1)
def bits(size: Int): Gen[... | jeffmay/scalacheck-ops | core_1-12/src/main/scala/org/scalacheck/ops/GenOps.scala | Scala | apache-2.0 | 2,616 |
package xitrum.view
import xitrum.Action
trait GetActionClassDefaultsToCurrentAction {
this: Action =>
def getActionClass[T <: Action : Manifest]: Class[Action] = {
val klass = manifest[T].runtimeClass.asInstanceOf[Class[Action]]
if (klass == classOf[Nothing]) getClass.asInstanceOf[Class[Action]] else kl... | xitrum-framework/xitrum | src/main/scala/xitrum/view/GetActionClassDefaultsToCurrentAction.scala | Scala | mit | 330 |
package com.jaroop.anorm.debug
import anorm._
import scala.annotation.{ StaticAnnotation, compileTimeOnly }
import scala.language.experimental.macros
import scala.reflect.macros.whitebox.Context
@compileTimeOnly("Enable macro paradise to expand macro annotations.")
class parser(name: String) extends StaticAnnotation ... | mhzajac/anorm-debugger | src/main/scala/com/jaroop/anorm/debug/parser.scala | Scala | apache-2.0 | 2,241 |
/*
* Copyright (c) 2013-2022 Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
* You may obtain a copy of the Apache License Version 2.0 at http://www.apach... | snowplow/scala-forex | src/main/scala/com.snowplowanalytics/forex/responses.scala | Scala | apache-2.0 | 1,484 |
package com.datastax.spark.connector.util
import org.apache.commons.lang3.StringUtils
import org.apache.spark.SparkConf
import org.apache.spark.sql.cassandra.CassandraSourceRelation
import com.datastax.spark.connector.cql.{AuthConfFactory, CassandraConnectionFactory, CassandraConnectorConf}
import com.datastax.spark.c... | datastax/spark-cassandra-connector | connector/src/main/scala/com/datastax/spark/connector/util/ConfigCheck.scala | Scala | apache-2.0 | 5,080 |
/*
* Copyright 2015 David Edwards
*
* 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... | davidledwards/rpn | src/main/scala/com/loopfor/rpn/AST.scala | Scala | apache-2.0 | 2,228 |
import scala.reflect.runtime.universe._
class ImaginaryCanBuildFrom[-From, -Elem, +To]
class CompletelyIndependentList[+A] {
type Repr <: CompletelyIndependentList[A]
def map[B, That](f: A => B)(implicit cbf: ImaginaryCanBuildFrom[Repr, B, That]): That = ???
def distinct(): CompletelyIndependentList[A] = ???
}
... | scala/scala | test/files/run/fail-non-value-types.scala | Scala | apache-2.0 | 1,377 |
/*
* Copyright 2014-2021 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... | brharrington/atlas | atlas-akka/src/main/scala/com/netflix/atlas/akka/UnboundedMeteredMailbox.scala | Scala | apache-2.0 | 2,988 |
/**
* Copyright (C) 2009-2011 the original author or authors.
* See the notice.md 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.
* Yo... | maslovalex/scalate | scalate-camel/src/test/scala/org/fusesource/scalate/camel/CamelScalateEndpointTest.scala | Scala | apache-2.0 | 3,156 |
/*
* 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... | tresata/storehaus | storehaus-core/src/main/scala/com/twitter/storehaus/ComposedStore.scala | Scala | apache-2.0 | 1,798 |
package com.github.ldaniels528.trifecta.sjs.controllers
import com.github.ldaniels528.trifecta.sjs.models._
import io.scalajs.npm.angularjs.Scope
import scala.scalajs.js
/**
* Reference Data Aware
* @author lawrence.daniels@gmail.com
*/
@js.native
trait ReferenceDataAware extends js.Object {
self: Scope =>
... | ldaniels528/trifecta | app-js/src/main/scala/com/github/ldaniels528/trifecta/sjs/controllers/ReferenceDataAware.scala | Scala | apache-2.0 | 1,893 |
/*
* Copyright 2020 WorldWide Conferencing, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable l... | lift/framework | persistence/mongodb-record/src/test/scala/net/liftweb/mongodb/record/testmodels/DoubleTest.scala | Scala | apache-2.0 | 1,056 |
/*
* 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/ShouldBeWritableLogicalAndSpec.scala | Scala | apache-2.0 | 10,824 |
//package com.sksamuel.avro4s.record.encoder
//
//import com.sksamuel.avro4s.{AvroSchema, Encoder, ImmutableRecord, SchemaFor}
//import org.apache.avro.util.Utf8
//import org.scalatest.matchers.should.Matchers
//import org.scalatest.wordspec.AnyWordSpec
//
//class OptionEncoderTest extends AnyWordSpec with Matchers {
/... | sksamuel/avro4s | avro4s-core/src/test/scala/com/sksamuel/avro4s/record/encoder/OptionEncoderTest.scala | Scala | apache-2.0 | 1,720 |
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.