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 monocle
/**
* Show how could we use Optics to manipulate some Json AST
*/
class JsonExample extends MonocleSuite {
sealed trait Json
case class JsString(s: String) extends Json
case class JsNumber(n: Int) extends Json
case class JsArray(l: List[Json]) extends Json
case class JsObject(m: Map[Strin... | NightRa/Monocle | example/src/test/scala/monocle/JsonExample.scala | Scala | mit | 4,762 |
/*
* Scala (https://www.scala-lang.org)
*
* Copyright EPFL and Lightbend, Inc.
*
* Licensed under Apache License 2.0
* (http://www.apache.org/licenses/LICENSE-2.0).
*
* See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*/
package scala.annotation.meta
... | scala/scala | src/library/scala/annotation/meta/beanGetter.scala | Scala | apache-2.0 | 461 |
package org.unisonweb
import org.unisonweb.Builtins._
import org.unisonweb.Pattern._
import org.unisonweb.Term.Syntax._
import org.unisonweb.Term._
import org.unisonweb.compilation._
import org.unisonweb.util.PrettyPrint
import Terms.Int64Ops._
import org.unisonweb.Value.Lambda.ClosureForming
object CompilationTests ... | paulp/unison | runtime-jvm/main/src/test/scala/CompilationTests.scala | Scala | mit | 35,959 |
/* Copyright (C) 2008-2016 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... | Craigacp/factorie | src/main/scala/cc/factorie/optimize/Trainer.scala | Scala | apache-2.0 | 22,542 |
package com.nthportal.shell
package impl
object WriteCommand extends Command {
override val name: String = "write"
override def execute(args: ImmutableSeq[String])(implicit sink: OutputSink): Unit = {
sink.writeln(s"${this.getClass.getName} has been executed")
}
}
| NthPortal/app-shell | src/test/scala/com/nthportal/shell/impl/WriteCommand.scala | Scala | apache-2.0 | 277 |
package org.knora.webapi
package object app {
val APPLICATION_MANAGER_ACTOR_NAME = "applicationManager"
val APPLICATION_MANAGER_ACTOR_PATH = "/user/" + APPLICATION_MANAGER_ACTOR_NAME
}
| musicEnfanthen/Knora | webapi/src/main/scala/org/knora/webapi/app/package.scala | Scala | agpl-3.0 | 196 |
/*
* 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 ... | WindCanDie/spark | sql/core/src/test/scala/org/apache/spark/sql/streaming/StreamSuite.scala | Scala | apache-2.0 | 45,720 |
import org.specs2.mutable._
class B extends Specification
{
"this" should {
"not work" in { 1 must_== 2 }
}
}
object A extends Specification
{
"this" should {
"not work" in { 1 must_== 2 }
}
} | twitter-forks/sbt | sbt/src/sbt-test/tests/it/changes/ClassFailModuleFail.scala | Scala | bsd-3-clause | 203 |
package wallet
import java.util.Date
import com.fasterxml.jackson.annotation.JsonProperty
import org.hibernate.validator.constraints.NotEmpty
import org.springframework.context.annotation.Bean
import scala.beans.BeanProperty
/**
* Created by vaibhavb on 9/19/14.
*/
class IDCard (@JsonProperty("card_id") card_id:... | vaibhavabhor/CMPE273Assignment2 | src/main/scala/wallet/IDCard.scala | Scala | mit | 936 |
package chapter3
object Exercise3_28 {
/**
*
*/
def map[A, B](tree: Tree[A])(f: A => B): Tree[B] = tree match {
case Empty() => Empty()
case Leaf(a) => Leaf(f(a))
case Branch(left, right) => Branch(map(left)(f), map(right)(f))
}
def main(args: Array[String]): Unit = {
assert(map(Le... | amolnayak311/functional-programming-in-scala | src/chapter3/Exercise3_28.scala | Scala | unlicense | 488 |
/*
* 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 ... | JerryLead/spark | sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLCLIDriver.scala | Scala | apache-2.0 | 14,214 |
/** Copyright 2015 TappingStone, 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 ... | nvoron23/PredictionIO | data/src/main/scala/io/prediction/data/storage/hbase/HBLEvents.scala | Scala | apache-2.0 | 9,503 |
package com.typesafe.sbt
package packager
package archetypes
import Keys._
import sbt._
import sbt.Project.Initialize
import sbt.Keys.{ mappings, target, name, mainClass, normalizedName }
import linux.LinuxPackageMapping
import SbtNativePackager._
/**
* This class contains the default settings for creating and deplo... | yanns/sbt-native-packager | src/main/scala/com/typesafe/sbt/packager/archetypes/JavaApp.scala | Scala | bsd-2-clause | 8,055 |
package haru.action
import scala.reflect.runtime.universe
import org.apache.http.client.methods.HttpPost
import org.apache.http.entity.StringEntity
import org.apache.http.impl.client.HttpClientBuilder
import org.joda.time.DateTimeZone
import akka.actor.Actor
import akka.actor.ActorLogging
import akka.actor.ActorSystem... | haruio/haru-admin | src/main/scala/haru/action/PushController.scala | Scala | mit | 3,191 |
/*
* 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 not u... | chenc10/Spark-PAF | sql/core/src/main/scala/org/apache/spark/sql/DataFrameHolder.scala | Scala | apache-2.0 | 1,351 |
package org.dbpedia.spotlight.db.io.util
/**
* A token occurrence parser reads the tokens file that is the result of processing
* Wikipedia dumps on Pig and converts it for further processing.
*
* @author Joachim Daiber
*/
trait TokenOccurrenceParser {
def parse(tokens: String, minimumCount: Int): Pair[Array[... | Skunnyk/dbpedia-spotlight-model | index/src/main/scala/org/dbpedia/spotlight/db/io/util/TokenOccurrenceParser.scala | Scala | apache-2.0 | 456 |
package domain.util
import java.net.URL
import scala.xml.XML
import org.xml.sax.InputSource
import scala.xml.parsing.NoBindingFactoryAdapter
import org.ccil.cowan.tagsoup.jaxp.SAXFactoryImpl
import java.net.HttpURLConnection
import scala.xml.Node
object Html {
lazy val adapter = new NoBindingFactoryAdapter
lazy v... | rori-dev/lunchbox | backend-play-akka-scala/app/domain/util/Html.scala | Scala | mit | 848 |
/*
* 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 ... | esi-mineset/spark | external/kinesis-asl/src/main/scala/org/apache/spark/streaming/kinesis/KinesisUtils.scala | Scala | apache-2.0 | 34,818 |
/*
* Copyright 2012 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 t... | lookout/zipkin | zipkin-cassandra/src/main/scala/com/twitter/zipkin/cassandra/Keyspace.scala | Scala | apache-2.0 | 2,342 |
package org.scaladebugger.docs.layouts.partials.common.vendor
import scalatags.Text.all._
/**
* Represents a <script ... > containing highlight.js init code.
*/
object HighlightJSInit {
def apply(): Modifier = {
script("hljs.initHighlightingOnLoad();")
}
}
| ensime/scala-debugger | scala-debugger-docs/src/main/scala/org/scaladebugger/docs/layouts/partials/common/vendor/HighlightJSInit.scala | Scala | apache-2.0 | 269 |
/*
* MIT License
*
* Copyright (c) 2016 Ramjet Anvil
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, mod... | RamjetAnvil/padrone | server/src/main/scala/com/ramjetanvil/padrone/http/client/oculus/package.scala | Scala | mit | 2,526 |
// False negative test, requires overloading in Cell.
trait Cell { def setCellValue(i: Int) = () ; def setCellValue(d: Double) = () }
trait Nope {
def f = {
trait CellSetter[A] {
def setCell(cell: Cell, data: A): Unit
}
implicit val bigDecimalCellSetter = new CellSetter[math.BigDecimal]() {
... | felixmulder/scala | test/files/neg/t9041.scala | Scala | bsd-3-clause | 559 |
/*
* 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 ... | bharathkk/samza | samza-kafka/src/main/scala/org/apache/samza/system/kafka_deprecated/KafkaSystemAdmin.scala | Scala | apache-2.0 | 21,492 |
package org.jetbrains.plugins.scala.lang.psi.types.api
import com.intellij.openapi.project.Project
import com.intellij.psi._
import com.intellij.psi.search.GlobalSearchScope
import org.jetbrains.plugins.scala.extensions.PsiTypeExt
import org.jetbrains.plugins.scala.lang.psi.api.toplevel.typedef.ScClass
import org.jetb... | loskutov/intellij-scala | src/org/jetbrains/plugins/scala/lang/psi/types/api/ScTypePsiTypeBridge.scala | Scala | apache-2.0 | 4,325 |
package shardakka
import com.google.protobuf.ByteString
abstract class Codec[A] extends Encoder[A] with Decoder[A]
trait Encoder[A] {
def toString(bytes: ByteString): String
def toBytes(value: A): ByteString
}
trait Decoder[A] {
def fromBytes(bytes: ByteString): A
}
final object StringCodec extends Codec[St... | VikingDen/actor-platform | actor-server/actor-core/src/main/scala/shardakka/Codec.scala | Scala | mit | 560 |
/*
* Code Pulse: A real-time code coverage testing tool. For more information
* see http://code-pulse.com
*
* Copyright (C) 2014 Applied Visions - http://securedecisions.avi.com
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
... | secdec/codepulse | codepulse/src/main/scala/com/secdec/codepulse/tracer/TreemapDataStreamer.scala | Scala | apache-2.0 | 2,376 |
package com.shorrockin.cascal
import org.junit.Test
import jmx.CascalStatistics
class TestCascalStatistics {
@Test def testMultipleMBeanRegistration() {
// if recalling this doesn't throw an exception - we treat that as success
CascalStatistics.reinstallMBean
CascalStatistics.reinstallMBean
... | shorrockin/cascal | src/test/scala/com/shorrockin/cascal/TestCascalStatistics.scala | Scala | apache-2.0 | 328 |
package ontology_debugging_tool
import java.awt.Dimension
import scala.swing.Action
import scala.swing.BorderPanel
import scala.swing.Button
import scala.swing.CheckBox
import scala.swing.FlowPanel
import scala.swing.GridPanel
import scala.swing.ListView
import scala.swing.MainFrame
import scala.swing.ScrollP... | t-morita/JWO_Refinement_Tools | src/main/scala/ontology_debugging_tool/PropertyRefinementPanel.scala | Scala | apache-2.0 | 14,272 |
package isuda
import skinny.micro.{ApiFormats, SkinnyMicroFilter, NotFound, Ok}
import scala.util.control.Exception.allCatch
trait Static extends ApiFormats {
self: SkinnyMicroFilter =>
addMimeMapping("image/x-icon", "ico")
get("/(?:(?:css|js|img)/.*|favicon[.]ico)".r) {
val ext = requestPath.split("[.]")... | dekokun/isucon6-qualify | webapp/scala/isuda/src/main/scala/isuda/Static.scala | Scala | mit | 530 |
/*
* 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 ... | shivangi1015/incubator-carbondata | integration/spark-common-test/src/test/scala/org/apache/carbondata/spark/testsuite/directdictionary/TimestampDataTypeDirectDictionaryWithNoDictTestCase.scala | Scala | apache-2.0 | 3,703 |
/** This does NOT crash unless it's in the interactive package.
*/
package scala.tools.nsc
package interactive
trait MyContextTrees {
val self: Global
val NoContext = self.analyzer.NoContext
}
//
// error: java.lang.AssertionError: assertion failed: trait Contexts.NoContext$ linkedModule: <none>List()
// at sca... | folone/dotty | tests/pending/pos/trait-force-info.scala | Scala | bsd-3-clause | 867 |
/*
* This file is part of Kiama.
*
* Copyright (C) 2013-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/grammar/GrammarTree.scala | Scala | gpl-3.0 | 3,771 |
package debop4s.core.retry
import java.util.concurrent.atomic.{AtomicBoolean, AtomicInteger}
import debop4s.core.utils.JavaTimer
import debop4s.core._
import debop4s.core.concurrent._
import org.scalatest.BeforeAndAfterAll
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future
impor... | debop/debop4s | debop4s-core/src/test/scala/debop4s/core/retry/PolicyFunSuite.scala | Scala | apache-2.0 | 4,643 |
package ch.bsisa.hyperbird.documents
import java.io.InputStream
import java.util.Date
import org.apache.poi.ss.usermodel._
import org.apache.poi.ss.util.CellReference
import org.jsoup.Jsoup
import play.api.Logger
import securesocial.core.Identity
import scala.collection.JavaConversions._
/**
* Encapsulate logic a... | bsisa/hb-api | app/ch/bsisa/hyperbird/documents/SpreadSheetBuilder.scala | Scala | gpl-2.0 | 20,679 |
import scala.collection._
trait IterableViewLike[+A,
+Coll,
+This <: IterableView[A, Coll] with IterableViewLike[A, Coll, This]] {
def viewToString: String = ""
protected[this] def viewIdentifier: String = ""
trait Transformed[+B]
}
trait IterableView[+A, +Coll] extends IterableViewLike[A, Coll, IterableView[A, ... | scala/scala | test/files/pos/specializes-sym-crash.scala | Scala | apache-2.0 | 1,362 |
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\\
* @ @ *
* # # # # (c) 2017 CAB *
* # # # # # # ... | AlexCAB/MathAct | mathact_core/src/main/scala/mathact/core/app/infrastructure/MainControllerActor.scala | Scala | mit | 7,094 |
package system.cell.processor.route.actors
import akka.actor.{ActorRef, Props}
import com.actors.TemplateActor
import system.names.NamingSystem
import system.ontologies.messages.Location._
import system.ontologies.messages.MessageType.Route
import system.ontologies.messages.MessageType.Route.Subtype.{Info, Response}
i... | albertogiunta/arianna | src/main/scala/system/cell/processor/route/actors/RouteManager.scala | Scala | gpl-3.0 | 2,414 |
package com.solidfire.jsvcgen.client
import java.io.StringReader
import java.util
import com.solidfire.gson.internal.LinkedTreeMap
import com.solidfire.gson.stream.JsonReader
import com.solidfire.gson.{Gson, JsonObject, JsonParser}
import com.solidfire.jsvcgen.JavaClasses._
import com.solidfire.jsvcgen.javautil.Optio... | solidfire/jsvcgen | jsvcgen-client-java/src/test/scala/com/solidfire/jsvcgen/client/ServiceBaseSuite.scala | Scala | apache-2.0 | 11,927 |
package io.github.daviddenton.finagle.aws
import io.github.daviddenton.finagle.aws.AwsHmacSha256.hash
class AwsStringToSign(canonicalRequest: AwsCanonicalRequest, requestScope: AwsCredentialScope, requestDate: AwsRequestDate) {
private val stringToSign =
s"""${AwsStringToSign.ALGORITHM}
|${requestDate.fu... | daviddenton/finagle-aws | src/main/scala/io/github/daviddenton/finagle/aws/AwsStringToSign.scala | Scala | apache-2.0 | 552 |
package ca.uwaterloo.gsd.rangeFix
import collection.mutable
import collection._
import ConditionalCompilation._
object SMTFixGenerator {
var testNewAlgorithm:Boolean = false
val guardPrefix = "__gd__"
type Diagnosis = Set[String]
type SemanticDiagnosis = (Diagnosis, Diagnosis)
type SemanticDiagnose... | matachi/rangeFix | src/main/scala/fixGeneration/SMTFixGenerator.scala | Scala | mit | 43,227 |
package im.actor.server.messaging
import akka.actor.ActorSystem
import im.actor.api.rpc.messaging._
import im.actor.server.group.GroupExtension
import im.actor.server.model.{ Peer, PeerType }
import scala.concurrent.Future
trait PushText {
implicit val system: ActorSystem
import system.dispatcher
type PushTe... | ljshj/actor-platform | actor-server/actor-core/src/main/scala/im/actor/server/messaging/PushText.scala | Scala | mit | 1,623 |
package com.github.kimutansk.akka.exercise.persistence
import akka.actor.ActorLogging
import akka.persistence.{SnapshotOffer, PersistentActor}
/**
* Akka-Persistenceの確認を行うサンプルActor
*/
class SamplePersistentActor(name: String) extends PersistentActor with ActorLogging {
override def persistenceId: String = "Sampl... | togusafish/kimutansk-_-scala-exercise | akka-exercise/src/main/scala/com/github/kimutansk/akka/exercise/persistence/SamplePersistentActor.scala | Scala | mit | 940 |
package avrohugger
package input
package reflectivecompilation
import schemagen._
import scala.collection.JavaConverters._
object PackageSplitter {
def getCompilationUnits(code: String): List[String] = {
def getCompilationUnits(
lines : List[String],
pkgResult: List[String]= List(),
compUn... | ppearcy/avrohugger | avrohugger-core/src/main/scala/input/reflectivecompilation/PackageSplitter.scala | Scala | apache-2.0 | 2,005 |
package infrastructure.actor
import akka.actor._
import scala.language.implicitConversions
trait CreationSupport {
def getChild(name: String): Option[ActorRef]
def createChild(props: Props, name: String): ActorRef
def getOrCreateChild(props: Props, name: String): ActorRef = getChild(name).getOrElse(createChild... | pawelkaczor/ddd-leaven-akka | src/main/scala/infrastructure/actor/CreationSupport.scala | Scala | mit | 688 |
/*
*************************************************************************************
* Copyright 2011 Normation SAS
*************************************************************************************
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero Ge... | Kegeruneku/rudder | rudder-web/src/main/scala/com/normation/rudder/web/snippet/administration/TechniqueLibraryManagement.scala | Scala | agpl-3.0 | 32,132 |
package spinoco.fs2.cassandra.internal
import shapeless.HList
import shapeless.ops.hlist.ToTraversable
import shapeless.ops.record.Keys
import spinoco.fs2.cassandra.internal
/**
* Created by adamchlupacek on 03/08/16.
*/
trait ColumnsKeys[C <: HList]{
def keys: Seq[String]
}
object ColumnsKeys {
implicit de... | Spinoco/fs2-cassandra | core/src/main/scala/spinoco/fs2/cassandra/internal/ColumnsKeys.scala | Scala | mit | 559 |
package tetravex.view
import scala.swing._
import scala.swing.event._
import tetravex.core.{Grid, Tile}
object View extends BorderPanel{
private var board: Board = null
private var menu: Menu = new Menu()
layout(menu) = BorderPanel.Position.North
def init(g: Grid) {
board = new Board(g)
layout(boa... | antoineB/tetravex | src/main/scala/view/View.scala | Scala | bsd-3-clause | 834 |
/**
* 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... | piavlo/operations-debs-kafka | core/src/main/scala/kafka/tools/ReplayLogProducer.scala | Scala | apache-2.0 | 8,574 |
/***********************************************************************
* Copyright (c) 2013-2018 Commonwealth Computer Research, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and... | ddseapy/geomesa | geomesa-features/geomesa-feature-common/src/main/scala/org/locationtech/geomesa/features/TransformSimpleFeature.scala | Scala | apache-2.0 | 6,011 |
/**
* Copyright (C) 2009-2015 Typesafe Inc. <http://www.typesafe.com>
*/
package akka.actor
import akka.actor.Deploy.{ NoDispatcherGiven, NoMailboxGiven }
import akka.dispatch._
import akka.routing._
import scala.annotation.varargs
import scala.collection.immutable
import scala.language.existentials
import scala.r... | jmnarloch/akka.js | akka-js-actor/shared/src/main/scala/akka/actor/Props.scala | Scala | bsd-3-clause | 7,053 |
/*
* 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 ... | chbatey/killrweather | killrweather-app/src/it/scala/com/datastax/killrweather/WeatherStationActorSpec.scala | Scala | apache-2.0 | 2,039 |
package org.jetbrains.plugins.scala.codeInspection.typeChecking
import com.intellij.codeInspection.LocalInspectionTool
import org.jetbrains.plugins.scala.codeInspection.{ScalaInspectionBundle, ScalaInspectionTestBase}
import org.jetbrains.plugins.scala.util.runners.{MultipleScalaVersionsRunner, RunWithScalaVersions, T... | JetBrains/intellij-scala | scala/scala-impl/test/org/jetbrains/plugins/scala/codeInspection/typeChecking/IsInstanceOfInspectionTest.scala | Scala | apache-2.0 | 1,857 |
/***********************************************************************
* Copyright (c) 2013-2018 Commonwealth Computer Research, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and... | jahhulbert-ccri/geomesa | geomesa-utils/src/main/scala/org/locationtech/geomesa/utils/geotools/SftBuilder.scala | Scala | apache-2.0 | 9,195 |
package breeze.math
/*
Copyright 2012 David Hall
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... | wstcpyt/breeze | math/src/test/scala/breeze/math/TensorSpaceTestBase.scala | Scala | apache-2.0 | 3,477 |
package com.github.vladminzatu.surfer
import scala.math._
class Score(val value: Double) extends Serializable {
def +(time: Long): Score = {
val u = max(value, Score.rate * time)
val v = min(value, Score.rate * time)
Score(u + log1p(exp(v - u)))
}
override def toString(): String = value.toString;... | VladMinzatu/surfer | src/main/scala/com/github/vladminzatu/surfer/Score.scala | Scala | mit | 549 |
package lila.setup
import chess.format.Forsyth
import chess.{ Game => ChessGame, Board, Situation, Clock, Speed }
import lila.game.Game
import lila.lobby.Color
import lila.tournament.{ System => TournamentSystem }
private[setup] trait Config {
// Whether or not to use a clock
val timeMode: TimeMode
// Clock ... | samuel-soubeyran/lila | modules/setup/src/main/Config.scala | Scala | mit | 3,745 |
package lila.perfStat
import akka.actor._
import com.typesafe.config.Config
import scala.concurrent.duration._
import akka.actor._
import lila.common.PimpedConfig._
final class Env(
config: Config,
system: ActorSystem,
lightUser: String => Option[lila.common.LightUser],
db: lila.db.Env) {
private ... | clarkerubber/lila | modules/perfStat/src/main/Env.scala | Scala | agpl-3.0 | 1,549 |
///////////////////////////////////////////////////////////////////////////////
// argparser.scala
//
// Copyright (C) 2011-2014 Ben Wing, The University of Texas at Austin
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// Y... | utcompling/textgrounder | src/main/scala/opennlp/textgrounder/util/argparser.scala | Scala | apache-2.0 | 74,251 |
/***********************************************************************
* 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-utils/src/test/scala/org/locationtech/geomesa/utils/stats/DescriptiveStatsTest.scala | Scala | apache-2.0 | 12,366 |
package com.tribbloids.spookystuff.parsing
import com.tribbloids.spookystuff.testutils.FunSpecx
import com.tribbloids.spookystuff.utils.{InterleavedIterator, Interpolation}
import fastparse.internal.Logger
import org.apache.spark.BenchmarkHelper
import org.scalatest.Ignore
import org.slf4j.LoggerFactory
import scala.... | tribbloid/spookystuff | benchmark/src/test/scala/com/tribbloids/spookystuff/parsing/ParsersBenchmark.scala | Scala | apache-2.0 | 12,023 |
/*
* Copyright 2011-2018 GatlingCorp (http://gatling.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applic... | wiacekm/gatling | gatling-core/src/test/scala/io/gatling/core/action/RendezVousSpec.scala | Scala | apache-2.0 | 1,302 |
/*
* Copyright 2013 Maurício Linhares
*
* Maurício Linhares licenses this file 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 copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless ... | dripower/postgresql-async | postgresql-async/src/main/scala/com/github/mauricio/async/db/postgresql/column/PostgreSQLTimestampEncoderDecoder.scala | Scala | apache-2.0 | 3,644 |
/* *\\
** _____ __ _____ __ ____ **
** / ___/ / / /____/ / / / \\ FieldKit **
** / ___/ /_/ /____/ / /__ / / / (c) 2010, FIELD ... | field/FieldKit.scala | src/field/kit/math/Package.scala | Scala | lgpl-3.0 | 3,126 |
package org.jetbrains.plugins.scala
package codeInsight.intention
import com.intellij.codeInsight.intention.PsiElementBaseIntentionAction
import com.intellij.openapi.editor.Editor
import com.intellij.openapi.project.Project
import com.intellij.psi.PsiElement
import com.intellij.psi.impl.source.codeStyle.CodeEditUtil
i... | triplequote/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/codeInsight/intention/AddBracesIntention.scala | Scala | apache-2.0 | 3,280 |
/*
* 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 ... | himanshudhami/PredictionIO | tools/src/main/scala/org/apache/predictionio/tools/commands/Management.scala | Scala | apache-2.0 | 7,151 |
/**
* 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 | workflowexecutormqprotocol/src/main/scala/io/deepsense/workflowexecutor/communication/mq/json/DefaultJsonMessageDeserializer.scala | Scala | apache-2.0 | 1,074 |
package org.jetbrains.plugins.scala.testingSupport.scalatest.scala2_13.scalatest3_1_1
import org.jetbrains.plugins.scala.testingSupport.scalatest.ScalaTestWholeSuiteTest
class Scalatest2_13_3_1_1_WholeSuiteTest extends Scalatest2_13_3_1_1_Base
with ScalaTestWholeSuiteTest
| JetBrains/intellij-scala | scala/scala-impl/test/org/jetbrains/plugins/scala/testingSupport/scalatest/scala2_13/scalatest3_1_1/Scalatest2_13_3_1_1_WholeSuiteTest.scala | Scala | apache-2.0 | 277 |
/*
* Copyright (c) 2013 David Soergel <dev@davidsoergel.com>
* Licensed under the Apache License, Version 2.0
* http://www.apache.org/licenses/LICENSE-2.0
*/
package worldmake.storage.casbah
import collection.mutable
import com.mongodb.casbah.commons.Imports
import com.mongodb.casbah.Imports._
import com.mon... | davidsoergel/worldmake | src/main/scala/worldmake/storage/casbah/CasbahHelpers.scala | Scala | apache-2.0 | 4,278 |
/*
* Copyright 2014 Frugal Mechanic (http://frugalmechanic.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... | AlwaysEncrypted/fm-sbt-s3-resolver | src/main/scala/fm/sbt/S3RawRepository.scala | Scala | apache-2.0 | 1,307 |
/*
* 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 ... | ddna1021/spark | sql/core/src/test/scala/org/apache/spark/sql/DataFrameWindowFunctionsSuite.scala | Scala | apache-2.0 | 24,169 |
package exercise
import org.scalatest.{BeforeAndAfterAll, Matchers, WordSpecLike}
import akka.actor.{ActorSystem, Props}
import akka.testkit.{ImplicitSender, TestKit}
/**
* Created by guisil on 18/01/2017.
*/
class ExpressionManagerSpec extends TestKit(ActorSystem("ExpressionManagerIntegrationSpec")) with Implici... | guisil/scala-akka-http-calculator | src/test/scala/exercise/ExpressionManagerSpec.scala | Scala | mit | 2,180 |
package com.github.gigurra.glasciia
import com.badlogic.gdx.Gdx
import com.badlogic.gdx.graphics.{Pixmap, Texture}
import com.badlogic.gdx.graphics.g2d.TextureRegion
import com.badlogic.gdx.graphics.glutils.FrameBuffer
import com.github.gigurra.glasciia.Glasciia._
/**
* Created by johan on 2017-01-14.
*/
case cla... | GiGurra/glasciia | glasciia-core/src/main/scala/com/github/gigurra/glasciia/TextureRegionFrameBuffer.scala | Scala | mit | 1,168 |
package net.fehmicansaglam.tepkin.examples
import akka.stream.ActorMaterializer
import akka.util.Timeout
import net.fehmicansaglam.bson.BsonDocument
import net.fehmicansaglam.tepkin.MongoClient
import scala.concurrent.duration._
object TailableCursorExample extends App {
val client = MongoClient("mongodb://localh... | cancobanoglu/tepkin | examples/src/main/scala/net/fehmicansaglam/tepkin/examples/TailableCursorExample.scala | Scala | apache-2.0 | 678 |
package chandu0101.scalajs.react.components
import japgolly.scalajs.react.vdom.html_<^._
import japgolly.scalajs.react.Callback
import japgolly.scalajs.react.BackendScope
import japgolly.scalajs.react.ScalaComponent
import scala.collection.immutable
import scalacss.ProdDefaults._
import scalacss.ScalaCssReact.scalac... | chandu0101/scalajs-react-components | core/src/main/scala/chandu0101/scalajs/react/components/ReactTable.scala | Scala | apache-2.0 | 10,282 |
package org.scaladebugger.api.profiles.swappable
import org.scaladebugger.api.profiles.ProfileManager
import org.scaladebugger.api.profiles.traits.DebugProfile
/**
* Represents the management functionality of swapping debug profiles.
*/
trait SwappableDebugProfileManagement { this: DebugProfile =>
protected val p... | chipsenkbeil/scala-debugger | scala-debugger-api/src/main/scala/org/scaladebugger/api/profiles/swappable/SwappableDebugProfileManagement.scala | Scala | apache-2.0 | 1,230 |
package com.twitter.algebird
import java.util.PriorityQueue
import scala.collection.generic.CanBuildFrom
/**
* Aggregators compose well.
*
* To create a parallel aggregator that operates on a single
* input in parallel, use:
* GeneratedTupleAggregator.from2((agg1, agg2))
*/
object Aggregator extends java.io.Ser... | avibryant/algebird | algebird-core/src/main/scala/com/twitter/algebird/Aggregator.scala | Scala | apache-2.0 | 12,410 |
package walfie.gbf.raidfinder
import java.util.Date
import monix.execution.schedulers.TestScheduler
import monix.reactive.Observer
import monix.reactive.subjects._
import org.mockito.Mockito._
import org.scalatest._
import org.scalatest.concurrent.{Eventually, ScalaFutures}
import org.scalatest.Matchers._
import org.s... | gnawnoraa/GBF-Raider-Copy | stream/src/test/scala/walfie/gbf/raidfinder/KnownBossesObserverSpec.scala | Scala | mit | 3,131 |
package mesosphere.marathon.upgrade
import mesosphere.marathon.state.AppDefinition.VersionInfo
import mesosphere.marathon.state.AppDefinition.VersionInfo.FullVersionInfo
import mesosphere.marathon.state.PathId._
import mesosphere.marathon.state._
import mesosphere.marathon._
import mesosphere.marathon.test.Mockito
imp... | vivekjuneja/marathon | src/test/scala/mesosphere/marathon/upgrade/DeploymentPlanTest.scala | Scala | apache-2.0 | 17,139 |
/*
* Copyright (c) 2002-2018 "Neo Technology,"
* Network Engine for Objects in Lund AB [http://neotechnology.com]
*
* This file is part of Neo4j.
*
* Neo4j 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 Foundatio... | HuangLS/neo4j | community/cypher/cypher-compiler-2.3/src/main/scala/org/neo4j/cypher/internal/compiler/v2_3/ast/rewriters/Namespacer.scala | Scala | apache-2.0 | 3,476 |
package taczombie.client.view.gui
import scala.swing._
import taczombie.client.util.RegexHelper
import scala.swing.event.KeyPressed
import scala.swing.event.Key
import taczombie.client.util.Address
import taczombie.client.util.RegexHelper
class ConnectDialog extends Dialog {
var address: Option[Address] = None
va... | mahieke/TacZombie | gui/src/main/scala/taczombie/client/view/gui/ConnectDialog.scala | Scala | gpl-2.0 | 1,504 |
package monocle.internal.focus.features.each
import monocle.function.Each
import monocle.internal.focus.FocusBase
private[focus] trait EachGenerator {
this: FocusBase =>
import macroContext.reflect._
def generateEach(action: FocusAction.KeywordEach): Term = {
import action.{fromType, toType, eachInstance}... | julien-truffaut/Monocle | core/shared/src/main/scala-3.x/monocle/internal/focus/features/each/EachGenerator.scala | Scala | mit | 465 |
package org.gtri.util.scala.xsdbuilder.elements
import org.gtri.util.scala.statemachine._
import org.gtri.util.xsddatatypes._
import org.gtri.util.xsddatatypes.XsdConstants._
import org.gtri.util.scala.xsdbuilder.XmlParser._
import org.gtri.util.scala.xmlbuilder.{XmlNamespaceContext, XmlElement}
final case class XsdD... | gtri-iead/org.gtri.util.scala | xsdbuilder/src/main/scala/org/gtri/util/scala/xsdbuilder/elements/XsdDocumentation.scala | Scala | gpl-3.0 | 1,850 |
import scala.slick.driver.H2Driver.simple._
// The main application
object HelloSlick extends App {
// The query interface for the Suppliers table
val suppliers: TableQuery[Suppliers] = TableQuery[Suppliers]
// the query interface for the Coffees table
val coffees: TableQuery[Coffees] = TableQuery[Coffees]
... | sabau/valeriarossini | wp-content/plugins/activator-1.2.10/templates/42d77b2f-0e24-4a17-a285-2905405419e9/src/main/scala/HelloSlick.scala | Scala | apache-2.0 | 5,575 |
package im.actor.server.api.rpc.service.auth
import java.time.{ LocalDateTime, ZoneOffset }
import im.actor.api.rpc.misc.ApiExtension
import im.actor.server.acl.ACLUtils
import scala.concurrent.Future
import scala.concurrent.forkjoin.ThreadLocalRandom
import scalaz.{ -\\/, \\/, \\/- }
import akka.actor.ActorSystem
... | lzpfmh/actor-platform | actor-server/actor-rpc-api/src/main/scala/im/actor/server/api/rpc/service/auth/AuthHelpers.scala | Scala | mit | 9,108 |
/*
* Copyright (C) 2016-2019 Lightbend Inc. <https://www.lightbend.com>
*/
package docs.home.scaladsl.serialization.v2a
import com.lightbend.lagom.scaladsl.playjson.JsonMigration
import com.lightbend.lagom.scaladsl.playjson.JsonMigrations
import com.lightbend.lagom.scaladsl.playjson.JsonSerializerRegistry
import co... | ignasi35/lagom | docs/manual/scala/guide/cluster/code/docs/home/scaladsl/serialization/v2a/OrderPlaced.scala | Scala | apache-2.0 | 835 |
package org.openurp.edu.eams.teach.program.major.service.impl
import org.beangle.commons.dao.Operation
import org.beangle.commons.dao.impl.BaseServiceImpl
import org.beangle.data.jpa.dao.OqlBuilder
import com.ekingstar.eams.core.CommonAuditState
import org.openurp.edu.eams.teach.program.Program
import org.openurp.edu... | openurp/edu-eams-webapp | plan/src/main/scala/org/openurp/edu/eams/teach/program/major/service/impl/MajorPlanAuditServiceImpl.scala | Scala | gpl-3.0 | 3,548 |
/*
This file is part of Intake24.
Copyright 2015, 2016 Newcastle University.
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 appl... | digitalinteraction/intake24 | FoodDataServices/src/main/scala/uk/ac/ncl/openlab/intake24/services/foodindex/russian/RussianSpecialFoodNames.scala | Scala | apache-2.0 | 980 |
/**
* 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... | reiseburo/kafka | core/src/main/scala/kafka/server/ReplicaFetcherThread.scala | Scala | apache-2.0 | 12,914 |
package com.eclipsesource.schema.internal.refs
import java.net.{URL, URLDecoder, URLStreamHandler}
import com.eclipsesource.schema._
import com.eclipsesource.schema.internal._
import com.eclipsesource.schema.internal.constraints.Constraints.Constraint
import com.eclipsesource.schema.internal.url.UrlStreamResolverFact... | edgarmueller/play-json-schema-validator | src/main/scala/com/eclipsesource/schema/internal/refs/SchemaRefResolver.scala | Scala | apache-2.0 | 14,131 |
/*
* Copyright 2011-2018 GatlingCorp (http://gatling.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applic... | wiacekm/gatling | gatling-recorder/src/main/scala/io/gatling/recorder/ui/swing/component/DialogFileSelector.scala | Scala | apache-2.0 | 2,214 |
package ee.cone.c4gate
import com.typesafe.scalalogging.LazyLogging
import ee.cone.c4actor.Types.SrcId
import ee.cone.c4actor._
import ee.cone.c4assemble.Types.{Each, Values}
import ee.cone.c4assemble.{Assemble, assemble, c4assemble}
import ee.cone.c4di.c4multi
import ee.cone.c4gate.HttpProtocol.S_HttpRequest
@c4asse... | conecenter/c4proto | base_examples/src/main/scala/ee/cone/c4gate/TestTxTransform.scala | Scala | apache-2.0 | 974 |
package ar.com.pablitar
import ar.com.pablitar.point._
trait Positioned[P<:Point[P]] {
def space: Space[P]
var position: P = space.origin
}
trait Speedy[P <: Point[P]] <: Positioned[P]{
def bounds = space.infiniteBounds
def speed: P
def applySpeed(delta:Double) = position = bounds.bound(po... | pablitar/fun-spaces | fun-spaces-alt2/test/ar/com/pablitar/TestTraits.scala | Scala | mit | 493 |
package scroll.examples
import scroll.internal.compartment.impl.Compartment
import scroll.internal.dispatch.DispatchQuery
import scroll.internal.dispatch.DispatchQuery.Bypassing
import scroll.internal.util.Many.*
object BankExample {
@main def runBankExample(): Unit = {
val stan = Person("Stan")
val brian... | max-leuthaeuser/SCROLL | examples/src/main/scala/scroll/examples/BankExample.scala | Scala | lgpl-3.0 | 4,232 |
object test {
def apply[a,b](f: a => b): a => b = { x: a => f(x) }
def twice[a](f: a => a): a => a = { x: a => f(f(x)) }
def main = apply[Int,Int](twice[Int]{x: Int => x})(1);
}
| folone/dotty | tests/untried/pos/lambda.scala | Scala | bsd-3-clause | 192 |
package org.jetbrains.plugins.scala
package lang
package references
import java.util
import java.util.Collections
import com.intellij.openapi.diagnostic.Logger
import com.intellij.openapi.module.{Module, ModuleUtilCore}
import com.intellij.openapi.roots.ModuleRootManager
import com.intellij.openapi.util.{Condition, T... | triggerNZ/intellij-scala | src/org/jetbrains/plugins/scala/lang/references/ScalaReferenceContributor.scala | Scala | apache-2.0 | 8,500 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | caneGuy/spark | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/AstBuilder.scala | Scala | apache-2.0 | 115,421 |
/**
* ConnectedComponents.scala
* Generic connected components finding algorithm.
*
* Overview, created November 2012
*
* @author Jonathan Stray
*
*/
package com.overviewdocs.clustering
import scala.collection.mutable.{Stack, Set}
object ConnectedComponents {
// Takes a node, and a set of unvisited nodes,... | overview/overview-server | worker/src/main/scala/com/overviewdocs/clustering/ConnectedComponents.scala | Scala | agpl-3.0 | 2,057 |
/*
* 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 | monix-reactive/shared/src/main/scala/monix/reactive/internal/builders/EvalAlwaysObservable.scala | Scala | apache-2.0 | 1,499 |
// Databricks notebook source exported at Fri, 24 Jun 2016 23:55:05 UTC
// MAGIC %md
// MAGIC
// MAGIC # [Scalable Data Science](http://www.math.canterbury.ac.nz/~r.sainudiin/courses/ScalableDataScience/)
// MAGIC
// MAGIC
// MAGIC ### prepared by [Raazesh Sainudiin](https://nz.linkedin.com/in/raazesh-sainudiin-4595... | raazesh-sainudiin/scalable-data-science | db/week6/12_SparkStreaming/021_SparkStreamingIntro.scala | Scala | unlicense | 18,293 |
package org.template.recommendation
import org.apache.predictionio.controller.LServing
class Serving
extends LServing[Query, PredictedResult] {
override
def serve(query: Query,
predictedResults: Seq[PredictedResult]): PredictedResult = {
predictedResults.head
}
} | alex9311/PredictionIO | examples/scala-parallel-recommendation/filter-by-category/src/main/scala/Serving.scala | Scala | apache-2.0 | 282 |
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.