code stringlengths 5 1M | repo_name stringlengths 5 109 | path stringlengths 6 208 | language stringclasses 1
value | license stringclasses 15
values | size int64 5 1M |
|---|---|---|---|---|---|
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | dbtsai/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/ShuffledRowRDD.scala | Scala | apache-2.0 | 8,769 |
package de.choffmeister.secpwd.utils
import java.io.{File, PrintWriter, FileInputStream, FileOutputStream}
import scala.io.Source
import scala.io.Codec
import scala.language.implicitConversions
class RichFile(val file: File) {
def text: String = Source.fromFile( file )(Codec.UTF8).mkString
def text_=(s: String) ... | choffmeister/secpwd | src/main/scala/de/choffmeister/secpwd/utils/RichFile.scala | Scala | apache-2.0 | 922 |
package nl.malienkolders.htm.admin.worker
import nl.malienkolders.htm.lib.util.Helpers
import java.net.MulticastSocket
import java.net.DatagramPacket
import java.net.InetAddress
import java.nio.ByteBuffer
import nl.malienkolders.htm.lib.model.Viewer
import net.liftweb.mapper.By
import net.liftweb.common.Loggable
obje... | hema-tournament-manager/htm | htm-admin/src/main/scala/nl/malienkolders/htm/admin/worker/BroadcastListener.scala | Scala | apache-2.0 | 1,226 |
package org.zalando.jsonapi.json
import org.zalando.jsonapi.JsonapiRootObjectWriter
import org.zalando.jsonapi.model.JsonApiObject.StringValue
import org.zalando.jsonapi.model.{ Attribute, RootObject }
import org.zalando.jsonapi.model.RootObject.ResourceObject
/**
* Class Person is used during testing
* @param id
... | texvex/scala-jsonapi | src/test/scala/org/zalando/jsonapi/json/Person.scala | Scala | mit | 797 |
package defw.http
import org.scalatest._
class HttpTest extends FlatSpec {
"Http.get" should "request to http://rss.dailynews.yahoo.co.jp/fc/rss.xml in HTTP/GET" in {
val uri = "http://rss.dailynews.yahoo.co.jp/fc/rss.xml"
val result = Http.get(uri)
assert(result.get._1 === 200)
}
"Http.post" shou... | takahish0306/scala-defw | util/src/test/scala/defw/http/HttpTest.scala | Scala | apache-2.0 | 584 |
/*
* 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 ... | zuotingbing/spark | resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn/ApplicationMaster.scala | Scala | apache-2.0 | 37,140 |
package HandlerSocket.Protocol
import java.io.ByteArrayOutputStream
import akka.util.ByteString
import java.util
import org.slf4j.LoggerFactory
class TokenEnumerator(input:ByteString) {
private var v:ByteString = input
def filter(bytes:ByteString):String = {
val out = new ByteArrayOutputStream
var convert... | Mevolutrix/MevoFramework | Utils/src/main/scala/HandlerSocket/Protocol/ResultDecoder.scala | Scala | apache-2.0 | 1,493 |
package com.atomist.param
import com.fasterxml.jackson.core.JsonParser
import com.fasterxml.jackson.databind.{DeserializationContext, JsonDeserializer, JsonNode}
trait ParameterValue {
def getName: String
def getValue: AnyRef
}
object ParameterValueDeserializer extends JsonDeserializer[ParameterValue] {
ove... | atomist/rug | src/main/scala/com/atomist/param/ParameterValue.scala | Scala | gpl-3.0 | 853 |
package net.xylophones.planetoid.game.logic
import net.xylophones.planetoid.game.maths.Vector2D
import net.xylophones.planetoid.game.model.GameEvent.GameEvent
import net.xylophones.planetoid.game.model._
import org.junit.runner.RunWith
import org.scalatest.mock.MockitoSugar
import org.scalatest.{Matchers, FunSuite}
im... | wjsrobertson/planetoid | game/src/test/scala/net/xylophones/planetoid/game/logic/ExplosionHandlingGameUpdaterTest.scala | Scala | apache-2.0 | 2,076 |
package mesosphere.marathon
package raml
trait ConstraintConversion {
implicit val constraintRamlReader: Reads[Constraint, Protos.Constraint] = Reads { raml =>
val operator = raml.operator match {
case ConstraintOperator.Unique => Protos.Constraint.Operator.UNIQUE
case ConstraintOperator.Cluster => ... | guenter/marathon | src/main/scala/mesosphere/marathon/raml/ConstraintConversion.scala | Scala | apache-2.0 | 3,078 |
package common.api
import scala.collection.SortedMap
object PermissionLevel extends Enumeration {
type PermissionLevel = Value
val EVERYONE: PermissionLevel = Value(0)
val SUBSCRIBERS: PermissionLevel = Value(1)
val REGULARS: PermissionLevel = Value(2)
val MODERATORS: PermissionLevel = Value(3)
... | Cobbleopolis/MonsterTruckBot | modules/common/app/common/api/PermissionLevel.scala | Scala | mit | 525 |
import sbt._
import Keys._
import com.typesafe.sbt._
import pgp.PgpKeys._
object PublishSettings {
type Sett = Def.Setting[_]
lazy val all = Seq[Sett](
pom
, publish
, publishMavenStyle := true
, publishArtifact in Test := false
, pomIncludeRepository := { _ => false }
, licenses := Seq("BSD-3-Claus... | NICTA/rng | project/PublishSettings.scala | Scala | bsd-3-clause | 1,382 |
package mesosphere.marathon.test
import java.time._
import scala.concurrent.duration.FiniteDuration
class SettableClock(private[this] var clock: Clock = Clock.fixed(Instant.now, ZoneOffset.UTC)) extends Clock {
override def getZone: ZoneId = clock.getZone
override def instant(): Instant = clock.instant()
ov... | timcharper/marathon | src/test/scala/mesosphere/marathon/test/SettableClock.scala | Scala | apache-2.0 | 751 |
package com.lonelyplanet.openplanet.client.apis
import com.lonelyplanet.openplanet.client.{FilterParameter, IncludeParameter, OpenPlanetClient, Shop}
import spray.json.JsValue
import scala.collection.immutable.Seq
trait OpShop extends Shop {
val client: OpenPlanetClient
override def product(id: String, include:... | lonelyplanet/open-planet-scala-client | src/main/scala/com/lonelyplanet/openplanet/client/apis/OpShop.scala | Scala | mit | 623 |
// Copyright (C) 2011-2012 the original author or authors.
// See the LICENCE.txt file distributed with this work for additional
// information regarding copyright ownership.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You ... | kahosato/scalastyle | src/test/scala/org/scalastyle/scalariform/CommentFilterTest.scala | Scala | apache-2.0 | 2,276 |
package org.bizzle.plugin.ghosthost
import
java.{ io, net },
io.IOException,
net.URLClassLoader
import
scala.io.Source
import
sbt.{ File, IO, Logger, richFile, stringToProcess, TestsFailedException, UpdateReport }
object TestRunner {
def apply(config: GhostHostConfig, debug: DebugSettings, specs: S... | TheBizzle/Ghost-Host | src/main/scala/org/bizzle/plugin/ghosthost/TestRunner.scala | Scala | bsd-3-clause | 3,385 |
package com.github.tweets.common
import com.fasterxml.jackson.annotation.{JsonProperty, JsonIgnoreProperties}
@JsonIgnoreProperties(ignoreUnknown = true)
private[tweets] case class TweetInfo(text: String,
@JsonProperty("created_at") createdDate: String,
... | andrei-l/tweets-for-github-projects-gatherer | src/main/scala/com/github/tweets/common/TweetInfo.scala | Scala | mit | 490 |
/**
* 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... | lindong28/kafka | core/src/main/scala/kafka/server/KafkaApis.scala | Scala | apache-2.0 | 178,949 |
package foo.bar.baz // the package nesting level material to this bug
class DivergenceTest {
trait ColumnBase[T]
trait ShapeLevel
trait Flat extends ShapeLevel
trait Lower extends Flat
class Shape2[Level <: ShapeLevel, -M, U]
implicit final def columnBaseShape[Level >: Flat <: ShapeLevel, T, C <: ... | loskutov/intellij-scala | testdata/scalacTests/pos/t7983.scala | Scala | apache-2.0 | 1,123 |
package com.sksamuel.elastic4s.requests.searches.aggs.pipeline
import com.sksamuel.elastic4s.handlers.script
import com.sksamuel.elastic4s.handlers.script.ScriptBuilderFn
import com.sksamuel.elastic4s.json.{XContentBuilder, XContentFactory}
object BucketSelectorPipelineBuilder {
def apply(agg: BucketSelectorPipelin... | sksamuel/elastic4s | elastic4s-core/src/main/scala/com/sksamuel/elastic4s/requests/searches/aggs/pipeline/BucketSelectorPipelineBuilder.scala | Scala | apache-2.0 | 662 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | ArvinDevel/onlineAggregationOnSparkV2 | core/src/test/scala/org/apache/spark/scheduler/TaskSchedulerImplSuite.scala | Scala | apache-2.0 | 10,958 |
/* 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... | strubell/factorie | src/main/scala/cc/factorie/directed/Gamma.scala | Scala | apache-2.0 | 2,056 |
/*
* Copyright 2016 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/telepooz | src/main/scala/com/github/nikdon/telepooz/model/methods/SendLocation.scala | Scala | apache-2.0 | 1,883 |
/*
* Open Korean Text - Scala library to process Korean text
*
* Copyright 2014 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LIC... | open-korean-text/open-korean-text | src/test/scala/org/openkoreantext/processor/util/KoreanSubstantiveTest.scala | Scala | apache-2.0 | 5,928 |
/*
* Copyright 2012 Eike Kettner
*
* 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... | eikek/publet | web/src/main/scala/org/eknet/publet/web/asset/impl/AssetContainer.scala | Scala | apache-2.0 | 2,637 |
package com.socrata.curator
import java.util.concurrent.{Executor, Executors}
import com.rojoma.simplearm.v2.{Managed, Resource, managed}
import com.socrata.http.client.{HttpClient, HttpClientHttpClient}
object DiscoveryBrokerFromConfig {
private def defaultExecutor = {
// Never timeout shutting down an execu... | socrata-platform/socrata-curator-utils | core/src/main/scala/com.socrata.curator/DiscoveryBrokerFromConfig.scala | Scala | apache-2.0 | 1,846 |
/*
* Copyright 2012 Comcast Cable Communications Management, 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 require... | Comcast/money | money-akka/src/test/scala/com/comcast/money/akka/CollectingSpanHandler.scala | Scala | apache-2.0 | 1,060 |
/*
* This is free and unencumbered software released into the public domain.
*
* Anyone is free to copy, modify, publish, use, compile, sell, or
* distribute this software, either in source code form or as a compiled
* binary, for any purpose, commercial or non-commercial, and by any
* means.
*
* In jurisdictio... | adamcin/snagjar-maven-plugin | src/main/scala/net/adamcin/snagjar/AccessToRepositories.scala | Scala | unlicense | 7,204 |
object B {
inline def getInline: Int =
sys.error("This is an expected failure when running C")
}
| dotty-staging/dotty | sbt-test/source-dependencies/inline/changes/B3.scala | Scala | apache-2.0 | 103 |
package org.nkvoll.javabin.json
import spray.json._
import org.nkvoll.javabin.service.internal.ElasticsearchService.TemplatesUpdated
trait ElasticsearchProtocol extends DefaultJsonProtocol {
implicit val templatesUpdatedProtocol: RootJsonFormat[TemplatesUpdated] = jsonFormat1(TemplatesUpdated)
}
| nkvoll/javabin-rest-on-akka | src/main/scala/org/nkvoll/javabin/json/ElasticsearchProtocol.scala | Scala | mit | 301 |
package dotty.tools
package dotc
package ast
import core._
import util.Positions._, Types._, Contexts._, Constants._, Names._, NameOps._, Flags._
import SymDenotations._, Symbols._, StdNames._, Annotations._, Trees._
import Decorators._
import language.higherKinds
import collection.mutable.ListBuffer
import config.Pri... | yusuke2255/dotty | src/dotty/tools/dotc/ast/Desugar.scala | Scala | bsd-3-clause | 39,350 |
package com.rasterfoundry.datamodel
final case class PageRequest(
offset: Long,
limit: Long,
sort: Map[String, Order]
)
| raster-foundry/raster-foundry | app-backend/datamodel/src/main/scala/com/rasterfoundry/datamodel/PageRequest.scala | Scala | apache-2.0 | 133 |
package provingground.interface
import provingground._
import induction._
import monix.execution.Scheduler.Implicits.global
import monix.eval._
import scala.collection.mutable.ArrayBuffer
import HoTT.{Name => _, _}
import monix.execution.CancelableFuture
import math.max
import trepplein._
import LeanInterface._
imp... | siddhartha-gadgil/ProvingGround | mantle/src/main/scala/provingground/interface/LeanParser.scala | Scala | mit | 26,002 |
/**
* (c) Copyright 2012 WibiData, Inc.
*
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of... | alexandre-normand/kiji-schema-shell | src/main/scala/org/kiji/schema/shell/input/InputSource.scala | Scala | apache-2.0 | 1,074 |
package com.norbitltd.spoiwo.natures.csv
import com.norbitltd.spoiwo.utils.FileUtils
import com.norbitltd.spoiwo.model._
import org.joda.time.LocalDate
object Model2CsvConversions {
implicit class CsvWorkbook(wb : Workbook) {
/**
* Converts the defined workbook into the sheet name -> csv content map for ... | intracer/spoiwo | src/main/scala/com/norbitltd/spoiwo/natures/csv/Model2CsvConversions.scala | Scala | mit | 2,880 |
package net.scalytica.symbiotic.components
import japgolly.scalajs.react._
import japgolly.scalajs.react.vdom.TagMod
import japgolly.scalajs.react.vdom.prefix_<^._
object Modal {
case class Props(
id: String,
header: Option[String] = None,
ariaLabel: String = "",
body: TagMod,
footer:... | kpmeen/symbiotic | examples/symbiotic-client/src/main/scala/net/scalytica/symbiotic/components/Modal.scala | Scala | apache-2.0 | 1,859 |
package org.kanyec.ast
import org.objectweb.asm.MethodVisitor
import org.objectweb.asm.Opcodes._
import org.kanyec.SymbolTable
case class DivisionExpressionNode(expression: AstNode ,operand: AstNode ) extends AstNode{
def generate(mv: MethodVisitor, symbolTable: SymbolTable) {
expression.generate(mv, symbolTabl... | nicksam112/kanyec | src/main/scala/org/kanyec/ast/DivisionExpressionNode.scala | Scala | apache-2.0 | 390 |
package io.pivotal.gemfire.spark.connector.internal
import io.pivotal.gemfire.spark.connector.GemFireConnectionConf
import org.mockito.Mockito._
import org.scalatest.mock.MockitoSugar
import org.scalatest.{FunSuite, Matchers}
class DefaultGemFireConnectionManagerTest extends FunSuite with Matchers with MockitoSugar ... | ysung-pivotal/incubator-geode | gemfire-spark-connector/gemfire-spark-connector/src/test/scala/io/pivotal/gemfire/spark/connector/internal/DefaultGemFireConnectionManagerTest.scala | Scala | apache-2.0 | 3,818 |
package com.codacy.client.stash.client.auth
import scalaj.http.HttpRequest
class TokenAuthenticator(token: String) extends Authenticator {
override def withAuthentication(request: HttpRequest): HttpRequest =
request.header("Authorization", s"Bearer $token")
}
| codacy/stash-scala-client | src/main/scala/com/codacy/client/stash/client/auth/TokenAuthenticator.scala | Scala | apache-2.0 | 268 |
package com.github.mdr.graphospasm.grapheditor.figure
import org.eclipse.draw2d.MarginBorder
import org.eclipse.draw2d.FreeformLayout
import org.eclipse.draw2d.FreeformLayer
class GraphDiagramFigure extends FreeformLayer {
setLayoutManager(new FreeformLayout)
setBorder(new MarginBorder(5))
} | mdr/graphospasm | com.github.mdr.graphospasm.grapheditor/src/main/scala/com/github/mdr/graphospasm/grapheditor/figure/GraphDiagramFigure.scala | Scala | mit | 300 |
package com.github.yoskhdia.sqscala
import com.amazonaws.services.sqs.model.QueueDoesNotExistException
import org.specs2.concurrent.ExecutionEnv
import org.specs2.mutable.Specification
import org.specs2.specification.BeforeAfterAll
import org.specs2.specification.core.Env
import scala.util.Try
import scala.concurrent... | yoskhdia/sqscala | src/test/scala/com/github/yoskhdia/sqscala/SqsClientOperations.scala | Scala | mit | 1,475 |
package cc.factorie.app.nlp
import org.scalatest._
import cc.factorie.app.nlp.pos.{PennPosTag, PennPosDomain}
import cc.factorie.app.nlp.parse._
/** Test serialization of Document to BSON.
@author John Sullivan, Andrew McCallum
*/
class TestDocumentStore extends FlatSpec with Matchers {
def fix = new {
va... | hlin117/factorie | src/test/scala/cc/factorie/app/nlp/TestDocumentStore.scala | Scala | apache-2.0 | 1,676 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | tophua/spark1.52 | core/src/main/scala/org/apache/spark/util/MutableURLClassLoader.scala | Scala | apache-2.0 | 3,722 |
package de.dominicscheurer.fsautils {
import Types._
import Conversions._
import RegularExpressions._
abstract class FSM {
def isDFA = this.isInstanceOf[DFA]
def isNFA = this.isInstanceOf[NFA]
def asDFA: Option[DFA] =
if (isDFA)
Some(this.asInstanceO... | rindPHI/FSAUtils | src/de/dominicscheurer/fsautils/FSM.scala | Scala | mit | 3,617 |
package nl.htm.importer
package swordfish
import nl.htm.importer._
import org.apache.poi.ss.usermodel.WorkbookFactory
import java.io.InputStream
import org.apache.poi.ss.usermodel.Cell
import org.apache.poi.ss.usermodel.Row
import org.apache.poi.ss.usermodel.Sheet
case class SwordfishExcelSettings(in: InputStream, co... | hema-tournament-manager/htm | htm-importer/src/main/scala/nl/htm/importer/swordfish/Swordfish2013ExcelImporter.scala | Scala | apache-2.0 | 5,370 |
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); yo... | sslavic/kafka | core/src/test/scala/unit/kafka/server/BaseRequestTest.scala | Scala | apache-2.0 | 6,241 |
/***********************************************************************
* 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/main/scala/org/locationtech/geomesa/accumulo/index/IndexSchema.scala | Scala | apache-2.0 | 17,058 |
package com.github.marklister.base64
import com.github.marklister.base64.Base64._
import utest._
object Base64TestSuite extends TestSuite {
val tests = TestSuite {
'encode1 {
assert("ABCDEFG".getBytes.toBase64 == ("QUJDREVGRw=="))
}
'encode2 {
assert("homuho".getBytes.toBase64 == ("aG9td... | marklister/base64 | shared/src/test/scala/Base64Spec.scala | Scala | bsd-2-clause | 2,484 |
def f(f: => Int) = {}
println(/* applicable: false */f {})
println(/* */f {1}) | ilinum/intellij-scala | testdata/resolve2/function/block/BlockToFunctionInt.scala | Scala | apache-2.0 | 79 |
package fr.renoux.gaston.model
import fr.renoux.gaston.util.Context
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers
class ScheduleSpec extends AnyFlatSpec with Matchers {
import fr.renoux.gaston.SimpleTestModel.Persons._
import fr.renoux.gaston.SimpleTestModel.Problems._
... | gaelrenoux/gaston | src/test/scala/fr/renoux/gaston/model/ScheduleSpec.scala | Scala | apache-2.0 | 7,406 |
/*
* Copyright 2018 Vladimir Konstantinov
*
* 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 ... | yet-another-cafebabe/korro | src/main/scala/com/github/illfaku/korro/internal/server/HttpChannelInitializer.scala | Scala | lgpl-3.0 | 1,506 |
package promisering
import unfiltered.netty.cycle.Planify
import unfiltered.netty.Http
import java.net.URL
object Server {
def main(args: Array[String]) {
Http(8080)
.resources(new URL(getClass().getResource("/www/robots.txt"), "."))
.handler(Planify(Github.oauth orElse Rings.pages)).run
}
}
| softprops/promise-ring | src/main/scala/server.scala | Scala | mit | 315 |
package compiler
import java.io.File
import java.lang.{Boolean => JBoolean}
import java.util.Optional
import java.util.function.{Supplier, Function => JFunction}
import ch.qos.logback.classic.Logger
import core.cache.FsbtCache
import core.config.FsbtModule
import core.config.FsbtModule.{FsbtProjectName, FsbtProjectRe... | Humblehound/fsbt | server/src/main/scala/compiler/ZincCompiler.scala | Scala | mit | 3,840 |
package messages.parser
abstract class AST
abstract class Data extends AST
abstract class Subjects extends AST
abstract class Operation extends AST
case class Entity(value: String) extends AST
case class Content(entity: Entity, op: String) extends Data
case class To(recipients: Seq[Entity]) extends Subjects
cas... | lymr/fun-chat | fun-chat-server/src/main/scala/messages/parser/AST.scala | Scala | mit | 382 |
// See LICENSE.txt for license details.
package examples
import chisel3._
class LogShifter extends Module {
val io = IO(new Bundle {
val in = Input(UInt(16.W))
val shamt = Input(UInt(4.W))
val out = Output(UInt(16.W))
})
val s0 = RegInit(0.U(16.W))
when (io.shamt(3) === 1.U) {
s0 := io.in... | timtian090/Playground | chiselTutorial/src/main/scala/examples/LogShifter.scala | Scala | mit | 690 |
package me.eax.examples.thrift
import java.io.ByteArrayOutputStream
import java.nio.ByteBuffer
import java.nio.charset.StandardCharsets
import me.eax.examples.thrift.game._
import org.apache.thrift.protocol.TSimpleJSONProtocol
import org.apache.thrift.transport.TIOStreamTransport
object Main extends App {
def hero... | afiskon/scala-thrift-example | src/main/scala/me/eax/examples/thrift/Main.scala | Scala | mit | 1,060 |
/*
Author: uberset
Date: 2015-12-26
Licence: GPL v2
*/
package uberset.l1_compiler
import java.io.PrintWriter
class GeneratorRpn(
val out: PrintWriter
) extends Generator {
override def begin(): Unit = out.print("Program(")
override def end(): Unit = out.print(")")
override def library(): Unit... | uberset/L1-compiler | src/main/scala/uberset/l1_compiler/GeneratorRpn.scala | Scala | gpl-2.0 | 1,206 |
package com.twitter.finagle.protobuf.rpc.channel
class ProtoBufCodec(val service: Service) extends CodecFactory[(String, Message), (String, Message)] {
val maxFrameSize = 1.megabytes.inBytes.intValue
val repo = SimpleMethodLookup(service)
def server = Function.const {
new Codec[(String, Message), (String... | firebase/finagle | finagle-protobuf/src/main/scala/com/twitter/finagle/protobuf/rpc/channel/ProtoBufCodec.scala | Scala | apache-2.0 | 1,085 |
package org.psliwa.idea.composerJson.intellij
import com.intellij.codeInsight.completion.{CompletionParameters, InsertHandler, InsertionContext}
import com.intellij.codeInsight.lookup.LookupElement
import com.intellij.patterns.PsiElementPattern
import com.intellij.psi.PsiElement
import com.intellij.util.ProcessingCont... | psliwa/idea-composer-plugin | src/main/scala/org/psliwa/idea/composerJson/intellij/codeAssist/package.scala | Scala | mit | 1,708 |
package sri.mobile.apis.ios
import scala.scalajs.js
@js.native
trait LinkingIOS extends js.Object {
def addEventListener(tpe: String, handler: js.Function): Unit = js.native
def removeEventListener(tpe: String, handler: js.Function): Unit = js.native
def openURL(url: String): Unit = js.native
def popIniti... | chandu0101/sri | mobile/src/main/scala/sri/mobile/apis/ios/LinkingIOS.scala | Scala | apache-2.0 | 421 |
/*
* Copyright 2014–2020 SlamData Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | slamdata/quasar | connector/src/main/scala/quasar/connector/datasource/PhysicalDatasource.scala | Scala | apache-2.0 | 788 |
package lila.swiss
import com.softwaremill.macwire._
import play.api.Configuration
import scala.concurrent.duration._
import lila.common.config._
import lila.common.{ AtMost, Every, ResilientScheduler }
import lila.socket.Socket.{ GetVersion, SocketVersion }
@Module
final class Env(
appConfig: Configuration,
... | luanlv/lila | modules/swiss/src/main/Env.scala | Scala | mit | 3,268 |
package org.dele.misc
import java.io.{BufferedInputStream, BufferedOutputStream, FileInputStream, FileOutputStream}
import org.apache.commons.compress.archivers.tar.TarArchiveInputStream
import org.apache.commons.compress.compressors.gzip.GzipCompressorInputStream
import org.apache.commons.io.IOUtils
/**
* Created... | new2scala/text-util | misc/src/test/scala/org/dele/misc/TgzDecompressTest.scala | Scala | apache-2.0 | 1,278 |
/*
* Copyright (C) 2010 Romain Reuillon
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This progra... | ISCPIF/PSEExperiments | openmole-src/openmole/core/org.openmole.core.workflow/src/main/scala/org/openmole/core/workflow/task/Task.scala | Scala | agpl-3.0 | 2,275 |
package julienrf.course.gameoflife
import javax.swing.JFrame
import doodle.core.{Circle, Image}
import doodle.jvm.DoodlePanel
object Ui {
def show(events: Events[Image]): Unit = {
val panel = DoodlePanel(Circle(0) lineWidth 0)
events.foreach(image => panel.image = image)
val frame = new JFrame("Game o... | julienrf/scala-lessons | course/code/src/main/scala/julienrf/course/gameoflife/Ui.scala | Scala | mit | 416 |
package com.bnctech.etcd
import com.bnctech.etcd.protocol.{EtcdListResponse, EtcdResponse}
import com.bnctech.etcd.utils.Converter._
import io.vertx.core.http.{HttpClient, HttpClientOptions, HttpClientResponse, HttpMethod}
import io.vertx.core.json.Json
import io.vertx.core.{AsyncResult, Future, Handler, Vertx}
impor... | BnC-Technologies/vertx-etcd | vertx-etcd/src/main/scala/com/bnctech/etcd/EtcdClient.scala | Scala | mit | 9,168 |
package ru.wordmetrix.webcrawler
import java.net.URI
import akka.actor.{Actor, ActorRef, Props, actorRef2Scala}
import ru.wordmetrix.smartfile.SmartFile.fromFile
import ru.wordmetrix.utils.impl.URIEx
import ru.wordmetrix.utils.{CFG, CFGAware}
object WebGet {
abstract sealed trait WebGetMessage
case class WebGe... | electricmind/webcrawler | src/main/scala/ru/wordmetrix/webcrawler/WebGet.scala | Scala | apache-2.0 | 1,849 |
package zio.modelchecker.example
import org.scalatest.matchers.Matcher
import org.scalatest.Assertion
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers
import zio.UIO._
import zio.{Semaphore, UIO}
import zio.modelchecker.Interpreter._
/**
* The dining philosophers:
* https://... | Jentsch/modelchecker | zio/src/test/scala/zio/modelchecker/example/Philosophers.scala | Scala | mit | 1,638 |
package monocle.internal.focus.features.selectfield
import monocle.internal.focus.FocusBase
import monocle.internal.focus.features.SelectParserBase
private[focus] trait SelectFieldParser {
this: FocusBase with SelectParserBase =>
import this.macroContext.reflect._
object SelectField extends FocusParser {
... | julien-truffaut/Monocle | core/shared/src/main/scala-3.x/monocle/internal/focus/features/selectfield/SelectFieldParser.scala | Scala | mit | 1,155 |
/**
* Copyright 2015 Otto (GmbH & Co KG)
*
* 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... | utzwestermann/schedoscope | schedoscope-core/src/main/scala/org/schedoscope/test/ViewSerDe.scala | Scala | apache-2.0 | 4,673 |
/*
* 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 | core/src/main/scala/org/apache/spark/rdd/RDD.scala | Scala | apache-2.0 | 78,062 |
package cbb.cloudphylo
import scala.collection.mutable
import scala.collection.mutable.ListBuffer
object Utils {
def split(content: String): mutable.HashMap[String, String] = {
val results = new mutable.HashMap[String, String]
content.split(">").foreach((p) => {
val lines = p.split(("\\\\r?\\\\n"))
... | xingjianxu/cloudphylo | src/main/scala/cbb/cloudphylo/Utils.scala | Scala | apache-2.0 | 1,252 |
package dokutoku.golden_thumb.crop
import cpw.mods.fml.relauncher.Side
import cpw.mods.fml.relauncher.SideOnly
import dokutoku.golden_thumb.lib.WorldType.Nether
import dokutoku.golden_thumb.lib.Rarity.Rare
import dokutoku.golden_thumb.FX.Effects.metalFXEffect
import net.minecraft.world.World
import java.util.Random
c... | AtomFusion/GoldenThumb | dokutoku/golden_thumb/crop/SoulsandCrop.scala | Scala | mit | 693 |
import sbt._
import Keys._
import xerial.sbt.Sonatype.SonatypeKeys
import com.github.retronym.SbtOneJar
object SimpleAuthBuild extends Build {
lazy val buildSettings = Seq(
organization := "fi.pyppe",
version := "1.1-SNAPSHOT",
scalaVersion := "2.11.1",
crossScalaVersions := Seq("2.11.1", "2.10... | Pyppe/play-simple-auth | project/SimpleAuthBuild.scala | Scala | mit | 2,407 |
import Macros.*
object Test {
def main(args: Array[String]): Unit = {
matches[Int, Int]
matches[1, Int]
matches[Int, 2]
matches[List[Int], List[Int]]
matches[List[Int], List[Double]]
}
}
| lampepfl/dotty | tests/run-macros/quote-type-matcher/quoted_2.scala | Scala | apache-2.0 | 218 |
package org.soabridge.scala.breeze.resources
import akka.actor.SupervisorStrategy.Resume
import akka.actor._
/**
* Missing documentation.
*
* @author <a href="[email protected]">Steffen Krause</a>
* @since 1.0
*/
private[breeze] class ResourceActor extends Actor {
/* Importing all messages declared... | SOABridge/breeze-scala | src/main/scala/org/soabridge/scala/breeze/resources/ResourceActor.scala | Scala | gpl-3.0 | 1,484 |
package nl.rabobank.oss.rules.facts
import nl.rabobank.oss.rules.engine.{ErrorEvaluation, Evaluation, ListFactEvaluation, SingularFactEvaluation}
import scala.language.existentials
trait Fact[+A] {
def name: String
def description: String
def toEval: Evaluation[A]
def valueType: String
override def toSt... | scala-rules/scala-rules | engine-core/src/main/scala/nl/rabobank/oss/rules/facts/facts.scala | Scala | mit | 1,365 |
package util
import scala.concurrent.{ExecutionContext, Future, Promise}
import scala.util.Try
/** Helper class to enhance the default future from scala to allow to convert a list of futures to a list of options */
object FutureEnhancements {
// add global execution context
import scala.concurrent.ExecutionConte... | Starofall/QryGraph | qrygraph/jvm/app/util/FutureEnhancements.scala | Scala | mit | 1,504 |
package pl.edu.agh.iet.akka_tracing.couchdb
import java.nio.charset.StandardCharsets
import java.util.Base64
import java.util.concurrent.CompletableFuture
import org.asynchttpclient.{ Request, RequestBuilder, Response }
import org.json4s._
import org.json4s.ext.JavaTypesSerializers
import org.json4s.native.JsonMethod... | akka-tracing-tool/akka-tracing-couchdb-collector | src/main/scala/pl/edu/agh/iet/akka_tracing/couchdb/CouchDbUtils.scala | Scala | gpl-3.0 | 2,633 |
package com.chrisomeara.pillar
import com.datastax.driver.core.Session
import org.scalatest._
import org.scalatest.matchers.ShouldMatchers
import java.io.{ByteArrayOutputStream, PrintStream}
import java.util.Date
import org.scalatest.mock.MockitoSugar
class PrintStreamReporterSpec extends FunSpec with MockitoSugar w... | weirded/pillar | src/test/scala/com/chrisomeara/pillar/PrintStreamReporterSpec.scala | Scala | mit | 1,682 |
package org.apache.predictionio.examples.friendrecommendation
import org.apache.predictionio.controller._
// For random algorithm
import scala.util.Random
class RandomAlgorithm (val ap: FriendRecommendationAlgoParams)
extends LAlgorithm[FriendRecommendationTrainingData,
RandomModel, FriendRecommendationQuery, ... | alex9311/PredictionIO | examples/experimental/scala-local-friend-recommendation/src/main/scala/RandomAlgorithm.scala | Scala | apache-2.0 | 767 |
/*
* 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 ... | zzcclp/carbondata | index/secondary-index/src/test/scala/org/apache/carbondata/spark/testsuite/secondaryindex/TestRegisterIndexCarbonTable.scala | Scala | apache-2.0 | 4,319 |
/*
* Copyright 2012-2013 Eligotech BV.
*
* 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 ... | CoderPaulK/eventsourced | es-core/src/main/scala/org/eligosource/eventsourced/core/ReplayParams.scala | Scala | apache-2.0 | 7,095 |
package scalan
import java.io.File
import scalan.compilation.{GraphVizExport, GraphVizConfig}
/**
* Base trait for testing specific rewrite rules
*/
trait RewriteRuleSuite[A] extends BaseShouldTests {
lazy val folder = new File(prefix, suiteName)
def getCtx: TestCtx
trait TestCtx extends ScalanDslExp {
... | scalan/scalan | core/src/test/scala/scalan/RewriteRuleSuite.scala | Scala | apache-2.0 | 2,271 |
package com.twitter.finagle.memcached.protocol.text
import com.twitter.finagle.memcached.protocol.{
Error => MemcacheError, ClientError, NonexistentCommand, ServerError}
import com.twitter.io.Charsets
import org.junit.runner.RunWith
import org.scalatest.FunSuite
import org.scalatest.junit.JUnitRunner
@RunWith(class... | kristofa/finagle | finagle-memcached/src/test/scala/com/twitter/finagle/memcached/unit/protocol/text/ShowTest.scala | Scala | apache-2.0 | 1,519 |
/**
* 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... | Ishiihara/kafka | core/src/main/scala/kafka/tools/ReplicaVerificationTool.scala | Scala | apache-2.0 | 22,077 |
/*
Stratagem is a model checker for transition systems described using rewriting
rules and strategies.
Copyright (C) 2013 - SMV@Geneva University.
Program written by Edmundo Lopez Bobeda <edmundo [at] lopezbobeda.net>.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU G... | didierbuchs/oldstratagem | src/main/scala/ch/unige/cui/smv/stratagem/petrinets/Arc.scala | Scala | gpl-2.0 | 1,330 |
/*
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 to in writing, software
distr... | twitter/bijection | bijection-core/src/main/scala/com/twitter/bijection/NumericInjections.scala | Scala | apache-2.0 | 6,238 |
package com.phasmid.laScala.fp
import scala.language.{higherKinds, postfixOps}
import scala.util._
/**
* This is an 2.10-specific appendix to FP
*
* @author scalaprof
*/
object FP_Cross {
/**
* This method is only required when compiling with Scala 2.10.
*
* @param ox the given Option
* @pa... | rchillyard/LaScala | src/main/scala-2.10/com/phasmid/laScala/fp/FP_Cross.scala | Scala | lgpl-2.1 | 2,505 |
package com.arcusys.learn.liferay.update
import com.arcusys.learn.liferay.LiferayClasses.LUpgradeProcess
import com.arcusys.learn.liferay.update.version240.storyTree.StoryTreeTableComponent
import com.arcusys.valamis.persistence.common.SlickDBInfo
import com.arcusys.valamis.web.configuration.ioc.Configuration
import c... | arcusys/Valamis | learn-portlet/src/main/scala/com/arcusys/learn/liferay/update/DBUpdater2320.scala | Scala | gpl-3.0 | 818 |
package circlepuzzles.geometry
/**
* Objects that specify computations for a particular two-dimensional plane-like geometric setting. Subclasses of this
* trait are generally singleton objects.
*
* The types `Point`, `Circle`, `Disk`, and `Arc` must correctly implement `equals` and `hashCode` methods according... | wkretschmer/CirclePuzzles | src/main/scala/circlepuzzles/geometry/Geometry.scala | Scala | mit | 7,519 |
package com.twitter.finatra.json.tests.internal.caseclass.validation
import com.twitter.finatra.validation.NotEmpty
case class CaseClassWithTwoConstructors(id: Long, @NotEmpty name: String) {
def this(id: Long) = this(id, "New User")
}
| syamantm/finatra | jackson/src/test/scala/com/twitter/finatra/json/tests/internal/caseclass/validation/CaseClassWithTwoConstructors.scala | Scala | apache-2.0 | 240 |
/*
* 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 ... | trueyao/spark-lever | mllib/src/main/scala/org/apache/spark/mllib/tree/model/Predict.scala | Scala | apache-2.0 | 1,382 |
/*
* The MIT License (MIT)
*
* Copyright (c) 2015-2019 Helge Holzmann (Internet Archive) <[email protected]>
*
* 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, incl... | helgeho/ArchiveSpark | src/main/scala/org/archive/archivespark/specific/warc/implicits/WarcRDD.scala | Scala | mit | 6,337 |
/*
* 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 ... | shaoxuan-wang/flink | flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/plan/stream/sql/join/JoinReorderTest.scala | Scala | apache-2.0 | 1,101 |
package com.michaelhamrah.flickrgpx
import scala.xml._
import com.github.nscala_time.time.Imports._
import scala.language.implicitConversions
object GpxFile {
implicit def NodeSeqToDouble(value: NodeSeq):Double = {
value.text match {
case "" => 0.0
case s:String => s.toDouble
}
}
def GetWay... | mhamrah/FlickrGpx | src/main/scala/GpxFile.scala | Scala | mit | 967 |
package com.twitter.finagle.http
import com.twitter.conversions.DurationOps._
import com.twitter.util.Stopwatch
import java.net.URLEncoder
import java.nio.charset.StandardCharsets
import org.scalacheck.Gen
import org.scalatest.FunSuite
import org.scalatest.concurrent.{Eventually, IntegrationPatience}
import org.scalat... | luciferous/finagle | finagle-base-http/src/test/scala/com/twitter/finagle/http/QueryParamCodecTest.scala | Scala | apache-2.0 | 4,163 |
import play.api.mvc.{SimpleResult, RequestHeader, Filter}
import play.api.Logger
import scala.concurrent.Future
import play.api.libs.concurrent.Execution.Implicits.defaultContext
object LoggingFilter extends Filter {
def apply(nextFilter: (RequestHeader) => Future[SimpleResult]
)(requestHeader: R... | kcis/kcis-prot | app/controllers/LoggingFilter.scala | Scala | apache-2.0 | 932 |
package org.jetbrains.plugins.scala.testingSupport.scalatest.scala2_11.scalatest3_0_1
import org.jetbrains.plugins.scala.SlowTests
import org.jetbrains.plugins.scala.testingSupport.scalatest.SpecialCharactersTest
import org.junit.experimental.categories.Category
/**
* @author Roman.Shein
* @since 10.03.2017
*/
@Ca... | jastice/intellij-scala | scala/scala-impl/test/org/jetbrains/plugins/scala/testingSupport/scalatest/scala2_11/scalatest3_0_1/Scalatest2_11_3_0_1_SpecialCharactersTest.scala | Scala | apache-2.0 | 462 |
/***********************************************************************
* 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-filter/src/test/scala/org/locationtech/geomesa/filter/FilterHelperTest.scala | Scala | apache-2.0 | 10,573 |
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.