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.madsen.xcs.core
import java.util.concurrent.atomic.AtomicBoolean
trait Sumo {
private val running: AtomicBoolean = new AtomicBoolean(true)
def run(): Unit = {
while (running.get()) {
/*
(1) Sensor values are read.
(2) All active chromosomes are in a pool. Predicates react to... | beatmadsen/xcs-main | src/main/scala/com/madsen/xcs/core/Sumo.scala | Scala | mit | 693 |
package com.eevolution.context.dictionary.domain.api.repository
import com.eevolution.context.dictionary._
/**
* Copyright (C) 2003-2017, e-Evolution Consultants S.A. , http://www.e-evolution.com
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Publi... | adempiere/ADReactiveSystem | dictionary-api/src/main/scala/com/eevolution/context/dictionary/domain/api/repository/ReplicationLogRepository.scala | Scala | gpl-3.0 | 1,145 |
package com.github.jlprat.gameserver.become.actor
import akka.actor.{Props, ActorSystem}
import akka.testkit._
import com.github.jlprat.gameserver.become.actors.Player
import com.github.jlprat.gameserver.become.model.{Card, Hand}
import com.github.jlprat.gameserver.become.protocol.ClientProtocol._
import com.github.jl... | jlprat/akka-gameserver | src/test/scala/com/github/jlprat/gameserver/become/actor/PlayerActorSpec.scala | Scala | apache-2.0 | 14,486 |
package cromwell.jobstore
import akka.actor.{LoggingFSM, Props}
import cromwell.core.Dispatcher.EngineDispatcher
import cromwell.core.actor.BatchingDbWriter._
import cromwell.core.actor.{BatchingDbWriter, BatchingDbWriterActor}
import cromwell.jobstore.JobStore.{JobCompletion, WorkflowCompletion}
import cromwell.jobst... | ohsu-comp-bio/cromwell | engine/src/main/scala/cromwell/jobstore/JobStoreWriterActor.scala | Scala | bsd-3-clause | 3,191 |
/*
* 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/amls-frontend | test/controllers/amp/AmpControllerSpec.scala | Scala | apache-2.0 | 4,363 |
package chapter07
object IfExpressions {
def main(args: Array[String]): Unit = {
println("Enter your Marks :")
val marks = readInt()
val grade =
if (marks >= 90) "S"
else if (marks >= 80) "A"
else if (marks >= 70) "B"
else if (marks >= 60) "C"
else if (marks >= 50) "D"
... | aakashmathai/ScalaTutorial | src/main/scala/chapter07/IfExpressions.scala | Scala | apache-2.0 | 404 |
/*
* Copyright 2010 Michael Fortin <mike@brzy.org>
*
* 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... | m410/brzy | src/test/scala/org/brzy/mock/MockModProvider.scala | Scala | apache-2.0 | 803 |
/*
* Copyright 2016 Actian Corporation
*
* 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... | ActianCorp/spark-vector | src/main/scala/com/actian/spark_vector/datastream/VectorEndpoint.scala | Scala | apache-2.0 | 3,531 |
package at.vizu.s2n.parser
import scala.reflect.runtime.universe._
/**
* Phil on 25.09.15.
*/
case class AST(fileName: String, internalTree: Tree) | viZu/nasca | src/main/scala/at/vizu/s2n/parser/AST.scala | Scala | apache-2.0 | 150 |
/*
* Copyright 2001-2008 Artima, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... | yyuu/scalatest | src/test/scala/org/scalatest/tools/ScalaTestRunnerSuite.scala | Scala | apache-2.0 | 7,734 |
/*
* 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 ... | VladimirErshov/ignite | modules/visor-console/src/main/scala/org/apache/ignite/visor/visor.scala | Scala | apache-2.0 | 79,582 |
package net.scalaleafs
import java.io.InputStream
import java.nio.charset.Charset
import scala.xml._
import scala.io.Source
import scala.xml.Source._
import scala.xml.parsing.NoBindingFactoryAdapter
import scala.xml.NamespaceBinding
object XHTML5Parser {
private val voidElements = Set("area", "base", "br", "col", ... | scalastuff/scalaleafs | src/main/scala/net/scalaleafs/XHTML5Parser.scala | Scala | apache-2.0 | 6,643 |
package example
import org.scalatest.FunSuite
import org.junit.runner.RunWith
import org.scalatest.junit.JUnitRunner
import scala.util.Random
/**
* This class implements a ScalaTest test suite for the methods in object
* `Lists` that need to be implemented as part of this assignment. A test
* suite is simply a co... | edvorg/scala-progfun | example/src/test/scala/example/ListsSuite.scala | Scala | gpl-3.0 | 5,330 |
/*
* 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 ... | spark-test/spark | sql/core/src/main/scala/org/apache/spark/sql/DataFrameWriter.scala | Scala | apache-2.0 | 39,746 |
/**
* 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... | Esquive/kafka | core/src/main/scala/kafka/controller/ReplicaStateMachine.scala | Scala | apache-2.0 | 23,547 |
/*
* Copyright 2014 http4s.org
*
* 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 i... | http4s/http4s | blaze-server/src/test/scala/org/http4s/blaze/server/BlazeServerMtlsSpec.scala | Scala | apache-2.0 | 5,587 |
/**
* 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... | jhspaybar/kafka | core/src/test/scala/unit/kafka/server/KafkaConfigTest.scala | Scala | apache-2.0 | 13,721 |
package test_data
import scala.xml.Elem
object ClaimBuilder {
def goodClaim: Elem = {
<DWPBody xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns="http://www.govtalk.gov.uk/dwp/carers-allowance"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.gov... | Department-for-Work-and-Pensions/RenderingService | test/test_data/ClaimBuilder.scala | Scala | mit | 40,510 |
package com.mz.training.actions
import akka.actor.SupervisorStrategy.Stop
import akka.actor.{Actor, ActorLogging, ActorRef}
import akka.util.Timeout
import com.mz.training.common.jdbc.JDBCConnectionActor
import com.mz.training.common.jdbc.JDBCConnectionActor.{Commit, Committed, Rollback}
import com.mz.training.domains... | michalzeman/angular2-training | akka-http-server/src/main/scala/com/mz/training/actions/UserActionActor.scala | Scala | mit | 1,745 |
package com.karasiq.shadowcloud.test.actors
import java.nio.file.Files
import akka.actor.PoisonPill
import akka.pattern.ask
import akka.stream.scaladsl.{Keep, Source}
import akka.stream.testkit.scaladsl.{TestSink, TestSource}
import akka.util.ByteString
import com.karasiq.common.encoding.{Base64, HexString}
import co... | Karasiq/shadowcloud | core/assembly/src/test/scala/com/karasiq/shadowcloud/test/actors/RegionDispatcherTest.scala | Scala | apache-2.0 | 12,133 |
package tuner.gui
import scala.swing.Frame
import tuner.Config
import tuner.Tuner
import tuner.project.Project
abstract class Window(val project:Project) extends Frame {
// register this window with Tuner
Tuner.listenTo(this)
def toFront = {
visible = true
peer.toFront
}
}
| gabysbrain/tuner | src/main/scala/tuner/gui/Window.scala | Scala | mit | 296 |
package controllers
import com.google.inject.Inject
import models.BusinessDetailsModel
import models.CacheKeyPrefix
import models.ConfirmFormModel
import models.EligibilityModel
import models.PaymentModel
import models.RetainModel
import models.VehicleAndKeeperLookupFormModel
import org.apache.commons.codec.binary.Bas... | dvla/vrm-retention-online | app/controllers/Payment.scala | Scala | mit | 14,143 |
package org.finra.datagenerator.scaffolding.config
/**
* Created by dkopel on 12/13/16.
*/
case class ConfigBundle(name: ConfigBundleName, defs: Map[ConfigName, ConfigDefinition[_]]) {
def apply[T](key: ConfigName): ConfigDefinition[_] = defs(key)
} | FINRAOS/DataGenerator | rubber-scaffolding/rubber-commons/src/main/scala/org/finra/datagenerator/scaffolding/config/ConfigBundle.scala | Scala | apache-2.0 | 258 |
package com.jensraaby.sxt
import org.scalatest.prop.Checkers
import org.scalatest.{FlatSpec, Matchers}
trait SXTSuite extends FlatSpec with Matchers with Checkers
| jensraaby/SXT | src/test/scala/com/jensraaby/sxt/SXTSuite.scala | Scala | apache-2.0 | 165 |
package info.andreaswolf.roadhopper.simulation
import akka.actor.{ActorLogging, ActorRef, Actor}
import akka.pattern.ask
import com.graphhopper.util.shapes.GHPoint3D
import info.andreaswolf.roadhopper.road.{RoadSegment, Route}
import scala.collection.mutable.ListBuffer
import scala.concurrent.{Future, ExecutionContex... | andreaswolf/roadhopper | src/main/scala/info/andreaswolf/roadhopper/simulation/JourneyActor.scala | Scala | mit | 6,220 |
/***********************************************************************
* 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-accumulo/geomesa-accumulo-datastore/src/test/scala/org/locationtech/geomesa/accumulo/data/AccumuloFeatureWriterTest.scala | Scala | apache-2.0 | 22,902 |
package models
import play.api._
import play.api.db._
import play.api.Play.current
import anorm._
import anorm.SqlParser._
import java.util.Date
import java.io.{ IOException, FileOutputStream, FileInputStream, File }
import java.util.zip.{ ZipEntry, ZipInputStream }
import play.api.templates.Html
case class Site(... | musethno/MGS | app/models/Utils.scala | Scala | mit | 10,014 |
/**
* Licensed to Big Data Genomics (BDG) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The BDG licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use ... | bigdatagenomics/bdg-services | bdgs-service-manager/src/main/scala/org/bdgenomics/services/manager/ServiceManager.scala | Scala | apache-2.0 | 3,417 |
package thistle.examples.webevent
import org.scalatest.FunSpec
import thistle.core.{MatchSequence, MatchTree}
import thistle.predicates.General._
import thistle.core.{Query, Node}
import thistle.examples.webevent.Predicates._
class QueriesTestSpec extends FunSpec {
def generateEvent(ref: String, url: String): Sea... | smarden1/thistle | src/test/scala/thistle/examples/QueriesSpec.scala | Scala | mit | 3,731 |
/*
* Copyright 2017 io.metabookmarks
*
* 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... | metabookmarks/kafka-slick-offsetstorage | src/main/scala/io/metabookmarks/kafka/offsetstorage/OffsetStore.scala | Scala | apache-2.0 | 2,651 |
package com.karasiq.shadowcloud.webapp.controllers
import com.karasiq.shadowcloud.model.{Folder, Path}
import com.karasiq.shadowcloud.webapp.context.FolderContext
import com.karasiq.shadowcloud.webapp.utils.HasKeyUpdate
trait FolderController extends HasKeyUpdate[Path] {
def addFolder(folder: Folder): Unit
def de... | Karasiq/shadowcloud | server/webapp/src/main/scala/com/karasiq/shadowcloud/webapp/controllers/FolderController.scala | Scala | apache-2.0 | 1,473 |
package com.socrata.soda.server.export
import com.rojoma.json.v3.ast.{JArray, JNull, JString}
import com.rojoma.json.v3.io.CompactJsonWriter
import com.rojoma.simplearm.v2._
import com.socrata.http.common.util.AliasedCharset
import com.socrata.http.server.HttpResponse
import com.socrata.soda.server.SodaUtils
import co... | socrata-platform/soda-fountain | soda-fountain-lib/src/main/scala/com/socrata/soda/server/export/JsonExporter.scala | Scala | apache-2.0 | 3,395 |
/*
* Copyright 2011-2021 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 ... | asakusafw/asakusafw-spark | runtime/src/test/scala/com/asakusafw/spark/runtime/rdd/ConfluentSpec.scala | Scala | apache-2.0 | 4,025 |
//package io.youi.util
//
//import io.youi.component.{AbstractContainer, Component, Transform}
//import io.youi.drawable.Context
//import io.youi.{dom, ui}
//import org.scalajs.dom.{Event, document, html}
//
//import scala.concurrent.ExecutionContext.Implicits.global
//
//object DebugWindow {
// private lazy val root ... | outr/youi | app/js/src/main/scala/io/youi/util/DebugWindow.scala | Scala | mit | 3,095 |
package playground
import scala.quoted._, scala.quoted.matching._
import scala.quoted.{given _}
import scala.tasty._
object macros {
inline def mcr(x: => Any) = ${mcrImpl('x)}
def mcrImpl(body: Expr[Any])(using ctx: QuoteContext) : Expr[Any] = {
import ctx.tasty.{_, given _}
body.unseal match { case Bloc... | som-snytt/dotty | tests/neg-macros/i6976/Macro_1.scala | Scala | apache-2.0 | 344 |
/*
* 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 ... | sachintyagi22/spark | core/src/main/scala/org/apache/spark/serializer/Serializer.scala | Scala | apache-2.0 | 6,695 |
package edu.cmu.lti.nlp.amr.FastFeatureVector
import edu.cmu.lti.nlp.amr._
import edu.cmu.lti.nlp.amr.Train._
import java.lang.Math.abs
import java.lang.Math.log
import java.lang.Math.exp
import java.lang.Math.random
import java.lang.Math.floor
import java.lang.Math.min
import java.lang.Math.max
import scal... | hopshackle/wordAlignment | src/edu/cmu/lti/nlp/amr/FastFeatureVector/Adagrad.scala | Scala | bsd-2-clause | 3,897 |
package org.jetbrains.plugins.scala
package lang
package psi
package api
package base
package types
/**
* @author Alexander Podkhalyuzin
* Date: 13.03.2008
*/
trait ScTypeProjection extends ScTypeElement with ScReferenceElement {
override protected val typeName = "TypeProjection"
def typeElement: ScTypeElement ... | loskutov/intellij-scala | src/org/jetbrains/plugins/scala/lang/psi/api/base/types/ScTypeProjection.scala | Scala | apache-2.0 | 369 |
package io.ruben.minecraft.avatars
import java.util.logging.Level._
import io.ruben.minecraft.avatars.listeners.{AvatarListeners, PlayerListeners}
import org.bukkit.plugin.java.JavaPlugin
import DataAccess._
import driver.api._
import slick.jdbc.meta.MTable
import scala.concurrent.ExecutionContext.Implicits.global
i... | Istar-Eldritch/bukkit-avatars | src/main/scala/io/ruben/minecraft/avatars/AvatarsPlugin.scala | Scala | gpl-3.0 | 1,402 |
/* Taking three different letters from the 26 letters of the alphabet, character strings of length three can be formed.
Examples are 'abc', 'hat' and 'zyx'.
When we study these three examples we see that for 'abc' two characters come lexicographically after its neighbour to the left.
For 'hat' there is exactly one char... | bgwines/project-euler | src/in progress/problem158.scala | Scala | bsd-3-clause | 7,105 |
/**
* Licensed to Big Data Genomics (BDG) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The BDG licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use ... | heuermh/bdg-avocado | avocado-core/src/test/scala/org/bdgenomics/avocado/util/RewriteHetsSuite.scala | Scala | apache-2.0 | 7,195 |
package com.socrata.spandex.secondary
import com.rojoma.simplearm._
import com.socrata.datacoordinator.secondary._
import com.socrata.datacoordinator.util.collection.ColumnIdMap
import com.socrata.soql.types.{SoQLText, SoQLType, SoQLValue}
import com.socrata.spandex.common.client._
class ResyncHandler(
client: Sp... | socrata-platform/spandex | spandex-secondary/src/main/scala/com.socrata.spandex.secondary/ResyncHandler.scala | Scala | apache-2.0 | 2,261 |
package com.themillhousegroup.edn.test
object CaseClassFixtures {
// Basic case classes:
case class AllStrings(bish: String, bash: String, bosh: String)
case class OptionalStrings(bish: String, bash: Option[String], bosh: String)
case class AllLongs(bash: Option[Long], bosh: Long)
case class IntsNotLongs(ba... | themillhousegroup/edn-scala | src/test/scala/com/themillhousegroup/edn/test/CaseClassFixtures.scala | Scala | gpl-2.0 | 1,124 |
package propertynder.ml
import java.io.File
import breeze.linalg._
import propertynder.ml.Transform._
object CSVLoader {
case class TrainingSet(examples: DenseMatrix[Double], labels: DenseVector[Double])
private def mkTrainingSet(f: File, skip: Option[Int])(exampleTransformation: DenseMatrix[Double] => DenseMat... | ostapneko/propertynder | src/main/scala/propertynder/ml/CSVLoader.scala | Scala | mit | 1,877 |
/*
* Copyright 2010-2011 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 applica... | lzpfmh/framework-2 | web/testkit/src/test/scala/net/liftweb/http/testing/TestObjects.scala | Scala | apache-2.0 | 1,537 |
package com.alanjz.microstrike.gear
class Incendiary {
}
| spacenut/microstrike | src/com/alanjz/microstrike/gear/Incendiary.scala | Scala | gpl-2.0 | 59 |
package com.twitter.finagle.netty4.proxy
import com.twitter.finagle.ProxyConnectException
import io.netty.buffer.{ByteBuf, Unpooled}
import io.netty.channel.ChannelHandlerContext
import io.netty.channel.embedded.EmbeddedChannel
import io.netty.handler.proxy.{ProxyHandler, ProxyConnectException => NettyProxyConnectExce... | luciferous/finagle | finagle-netty4/src/test/scala/com/twitter/finagle/netty4/proxy/Netty4ProxyConnectHandlerTest.scala | Scala | apache-2.0 | 3,384 |
package com.outr.arango
import com.outr.arango.api.model.GetAPIDatabaseNew
import com.outr.arango.api.{APIDatabase, APIDatabaseDatabaseName}
import com.outr.arango.model.ArangoResponse
import io.youi.net.Path
import profig.JsonUtil
import scala.concurrent.{ExecutionContext, Future}
class SystemDatabase(db: ArangoDB)... | outr/arangodb-scala | driver/src/main/scala/com/outr/arango/SystemDatabase.scala | Scala | mit | 917 |
package mr.merc.ui.world
import mr.merc.local.Localization
import mr.merc.map.hex.TerrainHexField
import mr.merc.ui.common.CanvasLayers
import mr.merc.ui.minimap.Minimap
import scalafx.scene.layout.Pane
import scalafx.application.Platform
class WorldInterfacePane(frame: WorldFrame, val worldCanvas: CanvasLayers, ter... | RenualdMarch/merc | src/main/scala/mr/merc/ui/world/WorldInterfacePane.scala | Scala | gpl-3.0 | 3,461 |
/*
* 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 ... | adobe-research/spark-cluster-deployment | initial-deployment-puppet/modules/spark/files/spark/examples/src/main/scala/org/apache/spark/examples/mllib/DenseKMeans.scala | Scala | apache-2.0 | 3,440 |
import org.apache.spark.sql.types._
import org.apache.spark.ml.{Pipeline, PipelineModel}
import org.apache.spark.sql.streaming.Trigger
import scala.concurrent.duration._
// load the trained model we saved in the previous step
val datadir = "/user/pliu/CMAPSS/"
val model = PipelineModel.load(datadir + "gbtmodel")
val ... | liupeirong/Azure | IoTKafkaSpark/6.Predict/streamingPredict.scala | Scala | mit | 1,473 |
import scala.tools.partest._
import scala.tools.nsc._
object Test extends DirectTest {
override def extraSettings: String = "-usejavacp -nowarn -Ystop-after:typer"
override def code = "" // not used
def code1 = """
package object p1 {
trait A
object A
}
"""
def code2 = """
package object p2 {
class... | yusuke2255/dotty | tests/pending/run/t8029.scala | Scala | bsd-3-clause | 996 |
import scala.quoted._
object E {
inline def eval[T](inline x: E[T]): T = ${ impl('x) }
def impl[T: Type](expr: Expr[E[T]]) (using QuoteContext): Expr[T] =
expr.unliftOrError.lift
implicit def ev1[T: Type]: Unliftable[E[T]] = new Unliftable { // TODO use type class derivation
def apply(x: Expr[E[T]])... | som-snytt/dotty | tests/run-macros/inline-macro-staged-interpreter/Macro_1.scala | Scala | apache-2.0 | 2,379 |
package pl.pholda.malpompaaligxilo.dsl
object LogixExprParserJVMTest extends LogicExprParserTest {
override def testForm: TestForm = TestFormJVM
}
| pholda/MalpompaAligxilo | dsl/jvm/src/test/scala/pl/pholda/malpompaaligxilo/dsl/LogixExprParserJVMTest.scala | Scala | gpl-3.0 | 150 |
package com.scalaAsm.x86
package Instructions
package General
// Description: Call to Interrupt Procedure
// Category: general/breakstack
trait INT1 extends InstructionDefinition {
val mnemonic = "INT1"
}
object INT1 extends ZeroOperands[INT1] with INT1Impl
trait INT1Impl extends INT1 {
implicit object _0 exten... | bdwashbu/scala-x86-inst | src/main/scala/com/scalaAsm/x86/Instructions/General/INT1.scala | Scala | apache-2.0 | 415 |
/*
* Copyright (C) 2009-2014 Typesafe Inc. <http://www.typesafe.com>
*/
package scalaguide.advanced.extending
import play.api.test._
object ScalaPlugins extends PlaySpecification {
"scala plugins" should {
"allow accessing plugins" in {
val app = FakeApplication(additionalPlugins = Seq(classOf[MyPlugin]... | jyotikamboj/container | pf-documentation/manual/working/scalaGuide/advanced/extending/code/ScalaPlugins.scala | Scala | mit | 2,163 |
package odfi.server.manager.ui
class WelcomeView extends ODFIBaseUI {
this.pageContent {
h1("Welcome") {
}
}
} | richnou/odfi-manager | server/src/main/scala/odfi/server/manager/ui/WelcomeView.scala | Scala | lgpl-3.0 | 136 |
package vggames.regex
import vggames.shared.task.JudgedTask
import vggames.shared.task.Task
class Match(matchingTargets : MatcherTargets) extends Task {
def judge(challenge : String) : JudgedTask = new Regex(challenge).matchAll(matchingTargets).judgment();
def challenge : String = "Qual RegEx reconhece " + matc... | vidageek/games | games/regex/src/main/scala/vggames/regex/Match.scala | Scala | gpl-3.0 | 370 |
package mesosphere.marathon
package raml
import org.apache.mesos.{Protos => Mesos}
import scala.collection.immutable.Map
trait EnvVarConversion {
implicit val envVarRamlWrites: Writes[Map[String, state.EnvVarValue], Map[String, EnvVarValueOrSecret]] =
Writes {
_.mapValues {
case (state.EnvVarStri... | gsantovena/marathon | src/main/scala/mesosphere/marathon/raml/EnvVarConversion.scala | Scala | apache-2.0 | 1,311 |
package eu.monniot.redis.plugin
import java.io.{BufferedReader, InputStreamReader}
import redis.embedded.{Redis, RedisExecProvider, RedisServer}
import redis.embedded.cluster.RedisCluster
import sbt.{File, Logger, TestEvent, TestResult, TestsListener}
class RedisTestsListener(logger: Logger,
... | fmonniot/sbt-redis-plugin | src/main/scala/eu/monniot/redis/plugin/RedisTestsListener.scala | Scala | apache-2.0 | 4,108 |
package de.christofreichardt.scala.diagnosis
import de.christofreichardt.diagnosis.TracerFactory
import de.christofreichardt.diagnosis.AbstractTracer
trait Tracing {
def withTracer[T](resultTypeAsString: String, callee: AnyRef, methodSignature: String)(block: => T): T = {
val tracer = getCurrentTracer()
... | chr78rm/secret-sharing | shamirs-scheme/src/main/scala/de/christofreichardt/scala/diagnosis/Tracing.scala | Scala | gpl-3.0 | 555 |
package com.sksamuel.scapegoat.inspections.string
import com.sksamuel.scapegoat.InspectionTest
/** @author Stephen Samuel */
class StripMarginOnRegexTest extends InspectionTest {
override val inspections = Seq(new StripMarginOnRegex)
"StripMarginOnRegex" - {
"should report warning" - {
"for regex cont... | sksamuel/scapegoat | src/test/scala/com/sksamuel/scapegoat/inspections/string/StripMarginOnRegexTest.scala | Scala | apache-2.0 | 1,225 |
import java.net.Socket
import java.io.PrintWriter
import java.io.BufferedReader
import java.io.InputStreamReader
/**
* Scala IRC Bot, based upon apbot[0]
* [0] http://sourceforge.net/p/apbot/home/apbot/
*/
object Sib {
val host = "127.0.0.1"
val port = 6667
val nick = "sib"
val channel = "#test"
val symb... | axelknauf/sib | sib.scala | Scala | mit | 6,273 |
/*
* Copyright 2017 Nikolay Donets
*
* 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 ... | nikdon/scala-cloud-datastore | src/main/scala/com/github/nikdon/google/datastore/DerivedDatastoreFormat.scala | Scala | apache-2.0 | 6,973 |
package gdg.blaze.ext.io
import gdg.blaze._
import org.apache.spark.streaming.dstream.DStream
class StdIn (pc: StdInConfig, source:SourceInput) extends Input {
override def apply(): DStream[Message] = {
source(scala.io.Source.stdin).flatMap(pc.codec.decode)
}
}
case class StdInConfig(codec:Codec)
object StdIn... | micahrupersburg/blaze-of-glory | src/main/scala/gdg/blaze/ext/io/StdIn.scala | Scala | apache-2.0 | 485 |
object Foo {
inline def track[T](inline f: T): T = {
printStack("track")
printStack("track")
f
}
def printStack(tag: String): Unit = {
println(tag + ": "+ new Exception().getStackTrace().apply(1))
}
}
object Test {
import Foo.*
def main(args: Array[String]): Unit = {
track {
pri... | dotty-staging/dotty | tests/run/i4947c.scala | Scala | apache-2.0 | 376 |
/*
* 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/amls-frontend | test/models/renewal/ConversionsSpec.scala | Scala | apache-2.0 | 9,148 |
/* *\\
** Squants **
** **
** Scala Quantities and Units of Measure Library and DSL **
** (c) 2013-2015, G... | garyKeorkunian/squants | shared/src/test/scala/squants/space/AreaSpec.scala | Scala | apache-2.0 | 6,079 |
/**
* 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... | fintler/kafka | core/src/main/scala/kafka/consumer/ConsumerFetcherManager.scala | Scala | apache-2.0 | 6,872 |
package net.categoricaldata
package object dsl {
def ??? = throw new NoSuchMethodException //???
} | JasonGross/categoricaldata | src/main/scala/net/categoricaldata/dsl/package.scala | Scala | mit | 100 |
/*
* 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 ... | sryza/spark | core/src/main/scala/org/apache/spark/executor/CoarseGrainedExecutorBackend.scala | Scala | apache-2.0 | 4,492 |
package org.jetbrains.plugins.scala
package lang
package psi
package impl
package base
package patterns
import com.intellij.lang.ASTNode
import org.jetbrains.plugins.scala.extensions._
import org.jetbrains.plugins.scala.lang.psi.api.base.patterns._
import org.jetbrains.plugins.scala.lang.psi.api.expr.ScBlockExpr
impo... | JetBrains/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/lang/psi/impl/base/patterns/ScPatternArgumentListImpl.scala | Scala | apache-2.0 | 837 |
package deburnat.transade.gui.center
import collection.mutable.Map
import swing.{Orientation, BorderPanel, CheckBox, ComboBox, BoxPanel, Swing, event}
import event.{FocusGained, FocusLost, MouseClicked}
import Orientation._
import BorderPanel.Position._
import scala.xml.Node
import deburnat.transade.gui.admins.GuiAdm... | deburnatshazem/deburnat | gui/src/main/scala/deburnat/transade/gui/center/LoadPanel.scala | Scala | apache-2.0 | 3,931 |
object Firsts:
type First[X] = X match
case Map[_, v] => First[Option[v]]
def first[X](x: X): First[X] = x match
case x: Map[_, _] => first(x.values.headOption) // error
@main
def runFirsts2(): Unit =
assert(first(Map.empty[Int, Int]) == None) // error
| dotty-staging/dotty | tests/neg/10349.scala | Scala | apache-2.0 | 276 |
package org.gbougeard.model.projects
/**
* Created with IntelliJ IDEA.
* User: gbougeard
* Date: 13/07/13
* Time: 19:07
* To change this template use File | Settings | File Templates.
*/
case class DashboardSectionInfo(name: String,
query: String)
object DashboardSectionInfo {
... | gbougeard/gas | src/main/scala/org/gbougeard/model/projects/DashboardSectionInfo.scala | Scala | apache-2.0 | 456 |
// $ scalac LogisticRegression.scala
// $ scala LogisticRegression
import scala.math
class LogisticRegression(val N: Int, val n_in: Int, val n_out: Int) {
val W: Array[Array[Double]] = Array.ofDim[Double](n_out, n_in)
val b: Array[Double] = new Array[Double](n_out)
def train(x: Array[Int], y: Array[Int], lr: ... | oma-deeplearning/deeplearning | scala/LogisticRegression.scala | Scala | gpl-2.0 | 2,813 |
package com.example.actors
import akka.actor.{Actor, Props}
import akka.event.Logging
import com.example.models.{Location, PlaceListResult}
import com.example.services.HttpService
class PlaceFinder {
var httpService = HttpService()
def getPlacesForLocation(location: Location): PlaceListResult = {
val radius... | divanvisagie/lazy-places | src/main/scala/com/example/actors/SystemActor.scala | Scala | apache-2.0 | 1,042 |
/*
* Copyright (C) 2016-2019 Lightbend Inc. <https://www.lightbend.com>
*/
package docs.scaladsl.advanced.akka
package workerservice {
import com.lightbend.lagom.scaladsl.api.Service
import com.lightbend.lagom.scaladsl.api.ServiceCall
import docs.scaladsl.advanced.akka.dataobjects.Job
import docs.scaladsl.a... | ignasi35/lagom | docs/manual/scala/guide/advanced/code/Akka.scala | Scala | apache-2.0 | 3,146 |
package com.twitter.finagle.mux.lease.exp
import com.twitter.app.GlobalFlag
import com.twitter.conversions.storage.intToStorageUnitableWholeNumber
import com.twitter.conversions.time._
import com.twitter.finagle.stats.{StatsReceiver, NullStatsReceiver, DefaultStatsReceiver}
import com.twitter.util.{Duration, Stopwatch... | sveinnfannar/finagle | finagle-mux/src/main/scala/com/twitter/finagle/mux/lease/exp/ClockedDrainer.scala | Scala | apache-2.0 | 9,070 |
package org.helgoboss.domino.configuration_watching
import org.osgi.service.cm.{ConfigurationAdmin, ManagedService}
import org.helgoboss.capsule.{CapsuleContext, CapsuleScope}
import org.osgi.service.metatype.{MetaTypeProvider => JMetaTypeProvider}
import org.helgoboss.scala_osgi_metatype.interfaces.MetaTypeProvider
i... | lefou/domino | src/main/scala/org/helgoboss/domino/configuration_watching/ConfigurationWatcherCapsule.scala | Scala | mit | 4,899 |
package com.github.mgoeminne.iban
import org.scalatest.{Inspectors, Matchers, FlatSpec}
/**
* Tests dedicated to the Portuguese BBAN
*/
class BBANPortugalTest extends FlatSpec with Matchers with Inspectors
{
val validBBANs = Seq("0002 0123 12345678901 54",
"0035 0683 00000007843 11"
)
... | mgoeminne/scala-iban | src/test/scala/com/github/mgoeminne/iban/BBANPortugalTest.scala | Scala | mit | 829 |
package elea.term
import elea._
import elea.rewrite.Env
import scalaz.Ordering.{EQ, GT, LT}
import scalaz.{Name => _, _}
import Scalaz._
case class Fix(body: Term,
index: Fix.Index,
name: Option[String] = None)
extends Term with FirstOrder[Term] {
override def reduce(... | wsonnex/elea | src/main/scala/elea/term/Fix.scala | Scala | mit | 11,173 |
package org.jetbrains.plugins.scala
package lang
package parser
package parsing
package expressions
import org.jetbrains.plugins.scala.lang.lexer.ScalaTokenTypes
import org.jetbrains.plugins.scala.lang.parser.parsing.builder.ScalaPsiBuilder
/**
* @author Alexander Podkhalyuzin
* Date: 13.02.2008
*/
/*
* SelfInv... | loskutov/intellij-scala | src/org/jetbrains/plugins/scala/lang/parser/parsing/expressions/SelfInvocation.scala | Scala | apache-2.0 | 1,161 |
package io.reactivecqrs.core.aggregaterepository
import java.time.Instant
import io.reactivecqrs.core.eventstore.EventStoreState
import io.reactivecqrs.core.util.ActorLogging
import io.reactivecqrs.api._
import akka.actor.{Actor, ActorRef, PoisonPill}
import io.reactivecqrs.api.id.{AggregateId, CommandId, UserId}
imp... | marpiec/ReactiveCQRS | core/src/main/scala/io/reactivecqrs/core/aggregaterepository/AggregateRepositoryActor.scala | Scala | apache-2.0 | 17,903 |
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distribute... | wvlet/airframe | airframe-log/src/main/scala/wvlet/airframe/log/package.scala | Scala | apache-2.0 | 1,005 |
package hasheq
package immutable
import scala.annotation.tailrec
/**
* Note that each element insertion takes O(n) time, which means that creating a list map with
* n elements will take O(n^2^) time. This makes the builder suitable only for a small number of
* elements.
*
*/
private[hasheq] object ListMap {... | TomasMikula/hasheq | src/main/scala/hasheq/immutable/ListMap.scala | Scala | bsd-3-clause | 5,749 |
/**
* Copyright (C) 2007 Orbeon, Inc.
*
* This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU Lesser General Public License as published by the Free Software Foundation; either version
* 2.1 of the License, or (at your option) any later version.
*
* This prog... | evlist/orbeon-forms | src/main/scala/org/orbeon/oxf/xforms/submission/TextReplacer.scala | Scala | lgpl-2.1 | 5,686 |
object P17 {
def split[A](n:Int, ls:List[A]):(List[A], List[A]) = {
def helper(i:Int, front:List[A], end:List[A]):(List[A], List[A]) = (i, end) match {
case (_, Nil) => (front.reverse, Nil)
case (0, _) => (front.reverse, end)
case (_, h::tail) => helper(i-1, h::front, tail)
}
... | liefswanson/S-99 | src/main/scala/17.scala | Scala | gpl-2.0 | 345 |
package com.danielasfregola.twitter4s.http.clients.rest.statuses.parameters
import com.danielasfregola.twitter4s.http.marshalling.Parameters
private[twitter4s] final case class RetweetersIdsParameters(id: Long, count: Int, cursor: Long, stringify_ids: Boolean)
extends Parameters
| DanielaSfregola/twitter4s | src/main/scala/com/danielasfregola/twitter4s/http/clients/rest/statuses/parameters/RetweetersIdsParameters.scala | Scala | apache-2.0 | 286 |
import language.higherKinds
trait Foldable[F[_]] {
def foldMap[A,B:Monoid](foldable: F[A])(f: A => B): B
}
object Foldable {
def foldMap[A,B:Monoid,F[A]:Foldable](fa: F[A])(g: A => B) =
implicitly[Foldable[F]].foldMap(fa)(g)
def fold[A:Monoid,F[A]:Foldable](f: F[A]): A = ???
def toList[A,F[A]:Foldable](f: F... | grzegorzbalcerek/scala-exercises | Foldable/Foldable.scala | Scala | bsd-2-clause | 390 |
package repositories.storage.dao.events
import no.uio.musit.models.{EventId, MuseumId}
import no.uio.musit.test.MusitSpecWithAppPerSuite
import no.uio.musit.test.matchers.MusitResultValues
import utils.testhelpers.{BaseDummyData, EventGenerators}
class EnvReqDaoSpec
extends MusitSpecWithAppPerSuite
with BaseD... | kpmeen/musit | service_storagefacility/test/repositories/storage/dao/events/EnvReqDaoSpec.scala | Scala | gpl-2.0 | 1,481 |
// basic while loop
def whileLoop {
var i = 1
while(i <= 3) {
println("while: " + i)
i += 1
}
println();
}
whileLoop
// basic for loop
def forLoop {
for(i <- 0 until 3) {
println("for: " + i)
}
println();
}
forLoop
// ruby ruby ruby ruby
def rubyStyleForLoop {
val array = Array(1, 2, 3)... | Mastermindzh/Seven-Languages-in-Seven-Weeks | Scala/Day 1/loops.scala | Scala | mit | 408 |
/*
* Copyright 2011-2022 GatlingCorp (https://gatling.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by appli... | gatling/gatling | gatling-charts/src/main/scala/io/gatling/charts/template/RequestDetailsPageTemplate.scala | Scala | apache-2.0 | 972 |
package com.trainologic.samples.petclinic.service
import com.trainologic.samples.petclinic._
import repository.MapBasedReadOnlyOwnerRepository
import cats.Id
import cats.data.Xor
import cats.data.Reader
import model.Owner
import org.atnos.eff.all._
import org.atnos.eff.syntax.all._
import repository.OwnerRepository
imp... | Trainologic/petclinic_eff | src/test/scala/com/trainologic/samples/petclinic/service/OwnerTestPure.scala | Scala | apache-2.0 | 1,620 |
package nars.language
import java.util._
import nars.io.Symbols
import nars.storage.Memory
import SetExt._
//remove if not needed
import scala.collection.JavaConversions._
import CompoundTerm._
object SetExt {
/**
* Try to make a new set from one component. Called by the inference rules.
* @param t The compo... | automenta/opennars | nars_scala/src/main/scala/nars/language/SetExt.scala | Scala | gpl-2.0 | 2,785 |
package com.streamsend.migration
import java.io.File
import org.gradle.api.tasks.{Input, InputDirectory, InputFile}
import org.gradle.api.internal.ConventionTask
abstract class CassandraTask extends ConventionTask {
var configurationFile: File = _
var migrationDirectory: File = _
var migrationName: Strin... | iamsteveholmes/cassandra-migration-gradle-plugin | src/main/scala/com/streamsend/migration/CassandraTask.scala | Scala | mit | 983 |
/*
* 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 ... | rahul003/mxnet | scala-package/examples/src/test/scala/org/apache/mxnetexamples/cnntextclassification/CNNClassifierExampleSuite.scala | Scala | apache-2.0 | 2,923 |
/******************************************************************************
* Copyright (c) 2014, Equal Experts Ltd
* 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 ... | EqualExperts/Midas | src/test/scala/com/ee/midas/dsl/expressions/FieldSpecs.scala | Scala | bsd-2-clause | 3,754 |
/*
* Copyright 2016 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... | ahudspith-equalexperts/ct-calculations | src/main/scala/uk/gov/hmrc/ct/ct600a/v3/LPQ04.scala | Scala | apache-2.0 | 1,072 |
package com.xuanyuansen.algo.layers
import com.xuanyuansen.algo.params.LayerParam
/**
* Created by wangshuai on 16/7/28.
* base class of layer, each layer has its param
* if recurrent, each layer has many nodes
*/
class Layer {
}
class LossLayer extends Layer {
}
class LSTMLayer extends Layer {
}
class GRU... | xuanyuansen/scalaLSTM | src/main/scala/com/xuanyuansen/algo/layers/Layer.scala | Scala | apache-2.0 | 345 |
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.