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 |
|---|---|---|---|---|---|
/**
* Created by YuanZhaokang on 2016/3/27 0027.
*/
import java.io.File
import java.net.URI
import java.util
import javax.imageio.ImageIO
import org.apache.hadoop.conf.Configuration
import org.apache.hadoop.fs.{FileSystem, Path}
import org.apache.spark.{SparkConf, SparkContext}
object Draw {
def main(args: Array... | yuanzhaokang/ParallelizeHeatmap | src/Draw.scala | Scala | gpl-2.0 | 3,271 |
import io.circe.generic.semiauto._
import shapeless._
case class 苹果(苹果名称: String, 苹果大小: Int)
case class 桃(桃名称: String, 桃大小: Int)
case class 鸡(鸡名称: String, 鸡大小: Int, 神坛: Option[神坛])
case class 鹅(鹅名称: String, 鹅大小: Int)
case class 走地鸡(走地鸡名称: String, 走地鸡大小: Int)
case class 蛋糕(蛋糕名称: String, 蛋糕大小: Int)
case class 神坛(苹果: 苹果,... | djx314/ubw | raw03-祭祀日常小百科/src/main/scala/Prepare.scala | Scala | bsd-3-clause | 2,248 |
package is
package solidninja
package scalatest
import cats.effect._
/**
* Functions that help testing purely functional code in ScalaTest
*/
trait Fs2Spec {
def io(t: IO[Unit]) = t.unsafeRunSync()
}
| solidninja/openshift-scala-api | src/test/scala/is/solidninja/scalatest/Fs2Spec.scala | Scala | mit | 210 |
package im.tox.antox.tox
/**
* Trait for Tox interval times
*/
trait Intervals {
/**
* Returns how many milliseconds should be used as an interval between tox iterations
*/
def interval: Int
}
/**
* An enumeration to store the different possible levels the app can be 'working' at.
* Enumeration makes it... | Ansa89/Antox | app/src/main/scala/im/tox/antox/tox/Intervals.scala | Scala | gpl-3.0 | 464 |
package se.ramn.bottfarmen.example.wren
import collection.JavaConverters._
import collection.immutable.Seq
import se.ramn.bottfarmen.api.BotCommander
import se.ramn.bottfarmen.api.GameState
import se.ramn.bottfarmen.api
import se.ramn.bottfarmen.api.Command
import se.ramn.bottfarmen.api.Move
import se.ramn.bottfarmen... | ramn/bottfarmen | common/src/main/scala/example/wren/WrenBot.scala | Scala | gpl-3.0 | 1,658 |
/*
* Copyright 2016 MongoDB, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to... | jCalamari/mongo-scala-driver | driver/src/it/scala/org/mongodb/scala/gridfs/GridFSSpec.scala | Scala | apache-2.0 | 14,029 |
package pfennig
import simulacrum._
import scala.language.{implicitConversions,higherKinds}
@typeclass trait Sampleable[F[_]] {
@op("sample") def sample[A](distribution: F[A])(randomness: Randomness): A
}
| noelwelsh/pfennig | src/main/scala/pfennig/Sampleable.scala | Scala | apache-2.0 | 209 |
package org.hammerlab.guacamole.filters
import org.apache.commons.math3.util.ArithmeticUtils.binomialCoefficientLog
object FishersExactTest {
/** Fisher's exact test, returned as a probability. */
def apply(totalA: Int, totalB: Int, conditionA: Int, conditionB: Int): Double =
math.exp(asLog(totalA, totalB, c... | hammerlab/guacamole | src/main/scala/org/hammerlab/guacamole/filters/FishersExactTest.scala | Scala | apache-2.0 | 944 |
package org.openurp.edu.eams.core.web.action
import java.io.File
import java.io.FileInputStream
import java.io.IOException
import java.io.InputStream
import java.text.SimpleDateFormat
import java.util.Calendar
import java.util.Date
import java.util.TreeMap
import javax.servlet.http.HttpServletResponse
import org... | openurp/edu-eams-webapp | web/src/main/scala/org/openurp/edu/eams/core/web/action/AdminclassAction.scala | Scala | gpl-3.0 | 23,443 |
package synahive.restapi.models.db
import synahive.restapi.models.TokenEntity
import synahive.restapi.utils.DatabaseConfig
trait TokenEntityTable extends UserEntityTable with DatabaseConfig {
import driver.api._
class Tokens(tag: Tag) extends Table[TokenEntity](tag, "tokens") {
def id = column[Option[Long]]... | synahive/synahive-server | src/main/scala/synahive/restapi/models/db/TokenEntityTable.scala | Scala | mit | 717 |
package com.lucidchart.open.nark.controllers
import com.lucidchart.open.nark.request.{AppFlash, AppAction, AuthAction, DashboardAction}
import com.lucidchart.open.nark.views
import com.lucidchart.open.nark.models.{GraphModel, DashboardModel}
import com.lucidchart.open.nark.models.records.GraphType
import com.lucidchar... | lucidsoftware/nark | app/com/lucidchart/open/nark/controllers/GraphsController.scala | Scala | apache-2.0 | 4,358 |
package com.stefansavev.randomprojections.implementation
import com.stefansavev.randomprojections.datarepr.sparse.SparseVector
object OptimizedHadamard {
def multiplyIntoHelper(from: Int, input: Array[Double], output: Array[Double]): Unit = {
var a = input(from)
var b = input(from + 1)
output(from) = a ... | stefansavev/random-projections-at-berlinbuzzwords | src/main/scala/com/stefansavev/randomprojections/implementation/HadamardUtils.scala | Scala | apache-2.0 | 7,115 |
package org.powlab.jeye.decode.graph
import org.powlab.jeye.decode.processor.comparison.ComparisonInformator
import org.powlab.jeye.decode.graph.OpcodeDetails._
import org.powlab.jeye.decode.sids.Sid
import org.powlab.jeye.decode.processor.control.GotoInstructionInformator._
import org.powlab.jeye.decode.processor.con... | powlab/jeye | src/main/scala/org/powlab/jeye/decode/graph/GotoTypes.scala | Scala | apache-2.0 | 5,506 |
package nars.gui
import java.awt._
import java.awt.event._
import nars.entity.Concept
import nars.storage.Memory
//remove if not needed
import scala.collection.JavaConversions._
/**
* Window accept a Term, then display the content of the corresponding Concept
*/
class TermWindow(var memory: Memory) extends NarsFram... | automenta/opennars | nars_scala/src/main/scala/nars/gui/TermWindow.scala | Scala | gpl-2.0 | 1,956 |
package com.github.cuzfrog.tool.bmt
import java.io.File
import java.nio.charset.Charset
import com.typesafe.config.Config
import com.github.cuzfrog.maila.Mail
/**
* This class takes care of reading and parsing file that contains mails infomation.
*
* Created by cuz on 2016-08-09.
*/
private[bmt] class FileMa... | cuzfrog/maila | bmt/src/main/scala/com/github/cuzfrog/tool/bmt/FileMails.scala | Scala | apache-2.0 | 1,466 |
// Copyright (C) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in project root for information.
package com.microsoft.ml.spark
import org.apache.spark.ml.feature.VectorAssembler
import org.apache.spark.ml.linalg.DenseVector
class EnsembleByKeySuite extends TestBase {
t... | rastala/mmlspark | src/ensemble/src/test/scala/EnsembleByKeySuite.scala | Scala | mit | 2,595 |
/*
* 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 ... | bowenli86/flink | flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/planner/runtime/batch/sql/join/LookupJoinITCase.scala | Scala | apache-2.0 | 9,243 |
/**
* Copyright (C) 2013 Orbeon, Inc.
*
* This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU Lesser General Public License as published by the Free Software Foundation; either version
* 2.1 of the License, or (at your option) any later version.
*
* This program i... | wesley1001/orbeon-forms | src/main/scala/org/orbeon/oxf/externalcontext/ExternalContextOps.scala | Scala | lgpl-2.1 | 1,267 |
package clide.nlp.assistant
import java.util.Collections
import clide.assistants.{AssistantControl, AssistantBehavior, Cursor}
import clide.collaboration.{Annotations, Operation}
import clide.models.{OpenedFile, SessionInfo}
/**
* If you override any existing methods do not forget to call their
* super-class method... | t6/clide-nlp | src-scala/clide/nlp/assistant/ReconcilingAssistantBehavior.scala | Scala | lgpl-3.0 | 3,837 |
package org.coursera.courier.data
import javax.annotation.Generated
import com.linkedin.data.ByteString
import com.linkedin.data.DataList
import com.linkedin.data.DataMap
import com.linkedin.data.schema.ArrayDataSchema
import com.linkedin.data.schema.DataSchema
import com.linkedin.data.template.DataTemplateUtil
imp... | coursera/courier | scala/runtime/src/main/scala/org/coursera/courier/data/StringArray.scala | Scala | apache-2.0 | 3,309 |
// scalac: -Ycheck-all-patmat
object Test{
def foo(a: Int) = a match {
case 5 => "Five!"
case 42 => "The answer."
}
def bar(a: (Int, Int)) = a match {
case (5, 5) => "Two fives!"
case (42, 21) => "The answer and a half."
}
def baz(a: (Boolean, Boolean)) = a match {
case (true, false) ... | dotty-staging/dotty | tests/patmat/t4526.scala | Scala | apache-2.0 | 366 |
// Copyright (c) 2016 Marco Marini, [email protected]
//
// Licensed under the MIT License (MIT);
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://opensource.org/licenses/MIT
//
// Permission is hereby granted, free of charge, to any per... | m-marini/actd | src/main/scala/org/mmarini/actd/Agent.scala | Scala | mit | 1,741 |
package io.udash.bootstrap.button
import io.udash._
import io.udash.bootstrap._
import io.udash.bootstrap.utils.BootstrapStyles
import io.udash.testing.UdashCoreFrontendTest
import io.udash.wrappers.jquery._
class UdashButtonGroupTest extends UdashCoreFrontendTest {
"UdashButtonGroup component" should {
"rende... | UdashFramework/udash-core | bootstrap4/.js/src/test/scala/io/udash/bootstrap/button/UdashButtonGroupTest.scala | Scala | apache-2.0 | 5,491 |
//: ----------------------------------------------------------------------------
//: Copyright (C) 2015 Verizon. All Rights Reserved.
//:
//: Licensed under the Apache License, Version 2.0 (the "License");
//: you may not use this file except in compliance with the License.
//: You may obtain a copy of the Licen... | neigor/funnel | nginx/src/main/scala/Stats.scala | Scala | apache-2.0 | 1,009 |
package org.hokiegeek2.storm.extensions.io.client.config
class ClientConfig(host : String,port : Int) {
def getHost : String = {
host
}
def getPort : Int = {
port
}
} | hokiegeek2/storm-extensions | src/main/scala/org/hokiegeek2/storm/extensions/io/client/config/ClientConfig.scala | Scala | apache-2.0 | 190 |
package mesosphere.marathon.state
import com.codahale.metrics.MetricRegistry
import mesosphere.marathon.metrics.Metrics
import mesosphere.marathon.state.PathId._
import mesosphere.marathon.{ MarathonConf, MarathonSpec, StoreCommandFailedException }
import mesosphere.util.ThreadPoolContext
import mesosphere.util.state.... | okuryu/marathon | src/test/scala/mesosphere/marathon/state/MarathonStoreTest.scala | Scala | apache-2.0 | 10,146 |
package com.programmaticallyspeaking.ncd.chrome.domains
import com.programmaticallyspeaking.ncd.host.ObjectId
import com.programmaticallyspeaking.ncd.testing.UnitTest
class ScriptEvaluateSupportTest extends UnitTest {
"wrapInFunction" - {
"doesn't wrap if there are no call arguments" in {
val functionDec... | provegard/ncdbg | src/test/scala/com/programmaticallyspeaking/ncd/chrome/domains/ScriptEvaluateSupportTest.scala | Scala | bsd-3-clause | 2,939 |
package Pacman
import Chisel._
class Net(layers: List[LayerData]) extends Module {
val io = new Bundle {
val ready = Bool().asOutput
val start = Bool().asInput
val xsIn = Vec
.fill(layers(0).parameters.NumberOfCores)(
Bits(width = layers(0).parameters.K))
.asInput
val xsOut =
... | martinhath/bnn | src/main/scala/Net.scala | Scala | mit | 1,701 |
/**
* Copyright 2014 Dropbox, 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... | aijiekj/djinni | src/source/generator.scala | Scala | apache-2.0 | 13,390 |
package com.datastax.spark.connector.demo
import com.datastax.spark.connector.cql.CassandraConnector
object BasicReadWriteDemo extends DemoApp {
CassandraConnector(conf).withSessionDo { session =>
session.execute("CREATE KEYSPACE IF NOT EXISTS test WITH REPLICATION = {'class': 'SimpleStrategy', 'replication_fa... | Stratio/spark-cassandra-connector | spark-cassandra-connector-demos/simple-demos/src/main/scala/com/datastax/spark/connector/demo/BasicReadWriteDemo.scala | Scala | apache-2.0 | 1,392 |
/**
* Copyright (C) 2012 Klout Inc. <http://www.klout.com>
*/
package com.klout.akkamemcached
import akka.util.ByteString
import akka.actor._
import com.google.common.hash.Hashing._
import Protocol._
import ActorTypes._
import akka.actor.IO._
/**
* Object sent to the IoActor indicating that a multiget request is ... | klout/akka-memcached | src/main/scala/Protocol.scala | Scala | apache-2.0 | 8,624 |
package org.allenai.common.indexing
import org.allenai.common.testkit.UnitSpec
class BarronsDocumentReaderSpec extends UnitSpec {
val sentences = (0 to 20).map("sentence " + _)
val sampleLines = Seq(
s"5.1.1.1.1\t${sentences(0)}",
s"5.1.1.1.2\t${sentences(1)}",
s"5.1.1.1.3\t${sentences(2)}",
s"5.... | jkinkead/common | indexing/src/test/scala/org/allenai/common/indexing/BarronsDocumentReaderSpec.scala | Scala | apache-2.0 | 1,789 |
package controllers
import play.api.mvc.Controller
import java.util.UUID
import models.user.SkimboToken
import services.endpoints.Endpoints
import views.html.defaultpages.badRequest
import services.commands.CmdFromUser
import models.command.NewToken
import services.actors.UserInfosActor
import play.api.libs.concurrent... | Froggies/Skimbo | app/controllers/Mobile.scala | Scala | agpl-3.0 | 2,057 |
package scalacookbook.chapter03
import java.io.{IOException, FileNotFoundException}
/**
* Created by liguodong on 2016/6/28.
*/
object MatchOneOrMoreException extends App{
val s = "Foo"
//一个
try {
val i = s.toInt
} catch {
case e: Exception => e.printStackTrace
}
def openAndReadAFile(filename:... | liguodongIOT/java-scala-mix-sbt | src/main/scala/scalacookbook/chapter03/MatchOneOrMoreException.scala | Scala | apache-2.0 | 1,759 |
/*
* Copyright (c) 2017 Andrzej Jozwik
*
* 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, modify, merge, publ... | ajozwik/akka-smtp-server | smtp-util/src/main/scala/pl/jozwik/smtp/util/Constants.scala | Scala | mit | 2,629 |
/*
* TreeModel.scala
* (TreeTable)
*
* Copyright (c) 2013-2020 Hanns Holger Rutz. All rights reserved.
*
* This library 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 t... | Sciss/TreeTable | scala/src/main/scala/de/sciss/treetable/TreeModel.scala | Scala | lgpl-3.0 | 1,590 |
/*
* Copyright 2010-2011 Vilius Normantas <[email protected]>
*
* This file is part of Crossbow library.
*
* Crossbow is free software: you can redistribute it and/or modify it under the terms of the GNU
* General Public License as published by the Free Software Foundation, either version 3 of the
* License, or (at ... | ViliusN/Crossbow | crossbow-core/src/lt/norma/crossbow/indicators/FirstValue.scala | Scala | gpl-3.0 | 1,211 |
trait ConstantOps {
def exprs = (
1 << 2L : Int, // was: error: type mismatch; found : Long(4L)
64 >> 2L : Int, // was: error: type mismatch; found : Long(4L)
64 >>> 2L : Int, // was: error: type mismatch; found : Long(4L)
'a' << 2L : Int,
'a' >> 2L : Int,
'a'>>> 2L : Int
)
}
| loskutov/intellij-scala | testdata/scalacTests/pos/t8462.scala | Scala | apache-2.0 | 318 |
package org.http4s
package bench
import java.util.concurrent.TimeUnit
import org.openjdk.jmh.annotations._
@BenchmarkMode(Array(Mode.AverageTime))
@OutputTimeUnit(TimeUnit.MICROSECONDS)
@State(Scope.Benchmark)
class HttpHeadersBench {
@Benchmark
def apply(in: HeadersInput) =
Headers(in.headerSeq.toList)
@B... | ChristopherDavenport/http4s | bench/src/main/scala/org/http4s/bench/HttpHeadersBench.scala | Scala | apache-2.0 | 1,030 |
/*
* 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 ... | rednaxelafx/apache-spark | sql/core/src/main/scala/org/apache/spark/sql/execution/aggregate/HashAggregateExec.scala | Scala | apache-2.0 | 45,611 |
import java.io.File
import java.util.Scanner
import java.util.TreeMap
import scala.collection.mutable.Map
import scala.collection.JavaConversions.mapAsScalaMap
val in = new Scanner(new File("example.txt"))
val counts: Map[String, Int] = new TreeMap[String, Int]
while (in.hasNext) {
val key = i... | demiazz/scala-impatient | chapter-04/exercise-05/main.scala | Scala | unlicense | 455 |
package org.terkwood.pathfinding.core
package object finders {
val Sqrt2 = math.sqrt(2)
}
| felixt-cake/Pathfinding.scala | src/main/scala/org/terkwood/pathfinding/core/finders/package.scala | Scala | mit | 93 |
package com.bryghts.kissnumber
import java.lang.{Double => JavaDouble}
trait IntegerNumberIsIntegralDef extends Integral[IntegerNumber]
{
def plus (x: IntegerNumber, y: IntegerNumber): IntegerNumber = x + y
def minus (x: IntegerNumber, y: IntegerNumber): IntegerNumber = x - y
def times (x: IntegerNumber... | marcesquerra/KissNumber | src/main/scala/com/bryghts/kissnumber/numerics.scala | Scala | mit | 6,720 |
package timezra.dropbox.core
import java.text.DateFormat
import java.text.SimpleDateFormat
import java.util.Date
import scala.annotation.implicitNotFound
import scala.concurrent.Future
import scala.concurrent.duration.DurationInt
import akka.actor.ActorRef
import akka.actor.ActorSystem
import akka.io.IO
import akka.pa... | timezra/dropbox-sdk-scala | dropbox-sdk-scala/src/main/scala/timezra/dropbox/core/Dropbox.scala | Scala | mit | 24,676 |
package com.datastax.spark.connector.writer
import com.datastax.driver.core._
import com.datastax.spark.connector.types.{ColumnType, Unset}
import com.datastax.spark.connector.util.{CodecRegistryUtil, Logging}
/**
* Class for binding row-like objects into prepared statements. prefixVals
* is used for binding consta... | ponkin/spark-cassandra-connector | spark-cassandra-connector/src/main/scala/com/datastax/spark/connector/writer/BoundStatementBuilder.scala | Scala | apache-2.0 | 4,554 |
/*
* Copyright 2022 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | hmrc/vat-registration-frontend | app/featureswitch/core/config/FeatureSwitchingModule.scala | Scala | apache-2.0 | 4,765 |
package korolev
import korolev.VDom._
import scala.annotation.tailrec
import scala.collection.mutable
import scala.language.implicitConversions
trait Shtml {
import ShtmlMisc._
implicit def toTextNode(text: String): Text = Text(text)
implicit def toOptionNode(opt: Option[VDom]): VDom = opt match {
case ... | PhilAndrew/JumpMicro | JMSangriaGraphql/src/main/scala/korolev/Shtml.scala | Scala | mit | 1,909 |
package tifmo.document
import tifmo.dcstree.{ SemRole, Quantifier, Relation, Selection }
import scala.collection.{ mutable, immutable }
class TokenNode(val token: Token) {
/**
* Set to `false` if the word is negated.
*/
var sign = true
/**
* The calculation order of the semantic roles of the token.
... | tomtung/tifmo | src/main/scala/tifmo/document/TokenNode.scala | Scala | bsd-2-clause | 2,686 |
/**
* The peloba zero-knowledge library
* Copyright (C) 2013 peloba UG & Co. KG
*
* 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 opt... | peloba/zk-library | src/main/scala/de/peloba/util/Helper.scala | Scala | agpl-3.0 | 2,518 |
package adt
import scala.language.higherKinds
package object bson {
@deprecated("Use adt.bson.mongodb.DBCompanion instead.", "1.3.0")
type DBCompanion[-A, T] = mongodb.DBCompanion[A, T]
@deprecated("Use adt.bson.mongodb.DBExtractor instead.", "1.3.0")
type DBExtractor[T] = mongodb.DBExtractor[T]
@depreca... | jeffmay/bson-adt | bson-adt-mongo2/src/main/scala/adt/bson/package.scala | Scala | apache-2.0 | 808 |
/**
* Copyright 2014 Gianluca Amato <[email protected]>
*
* This file is part of JANDOM: JVM-based Analyzer for Numerical DOMains
* JANDOM is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 o... | amato-gianluca/Jandom | core/src/test/scala/it/unich/jandom/domains/objects/PreciseObjectDomain.scala | Scala | lgpl-3.0 | 2,303 |
/* __ *\\
** ________ ___ / / ___ __ ____ Scala.js API **
** / __/ __// _ | / / / _ | __ / // __/ (c) 2013, LAMP/EPFL **
** __\\ \\/ /__/ __ |/ /__/ __ |/_// /_\\ \\ http://scala-lang.org/ **
** /____/\\___/... | lrytz/scala-js | library/src/main/scala/scala/scalajs/js/JSON.scala | Scala | bsd-3-clause | 2,252 |
package spark.rdd
import java.io.{ObjectOutputStream, IOException}
import spark._
private[spark]
class CartesianPartition(
idx: Int,
@transient rdd1: RDD[_],
@transient rdd2: RDD[_],
s1Index: Int,
s2Index: Int
) extends Partition {
var s1 = rdd1.partitions(s1Index)
var s2 = rdd2.partitions(... | koeninger/spark | core/src/main/scala/spark/rdd/CartesianRDD.scala | Scala | bsd-3-clause | 2,119 |
/**
* Copyright 2011-2016 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 appli... | GabrielPlassard/gatling | gatling-charts/src/main/scala/io/gatling/charts/template/ConsoleTemplate.scala | Scala | apache-2.0 | 2,640 |
/*
* Copyright 2016 Tamer AbdulRadi
*
* 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... | schemasafe/troy | troy-macro/src/test/scala/troy/macros/SelectValidationSpec.scala | Scala | apache-2.0 | 5,844 |
/*
* Copyright (C)2014 D. Plaindoux.
*
* 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, or (at your option) any
* later version.
*
* This program is distributed i... | d-plaindoux/rapido | src/main/resources/scala/core/Type.scala | Scala | lgpl-2.1 | 1,251 |
/*
* 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 ... | gioenn/xSpark | core/src/main/scala/org/apache/spark/partial/SumEvaluator.scala | Scala | apache-2.0 | 3,342 |
/*
* 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 ... | wangmiao1981/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/state/FlatMapGroupsWithStateExecHelper.scala | Scala | apache-2.0 | 9,962 |
package codecheck.github
package events
import org.json4s.jackson.JsonMethods
trait PullRequestEventJson {
val pullRequestEventJson = JsonMethods.parse(
"""{
| "action": "opened",
| "number": 1,
| "pull_request": {
| "url": "https://api.github.com/repos/baxterthehacker/public-repo... | code-check/github-api-scala | src/test/scala/events/PullRequestEventJson.scala | Scala | mit | 27,764 |
package troy
package macros
import troy.cql.ast.CqlParser
import troy.schema._
object CqlOps {
import VParseResultImplicits._
def parseQuery(queryString: String) =
CqlParser
.parseDML(queryString)
.toV(f => Messages.QueryParseFailure(f.msg, f.next.pos.line, f.next.pos.column))
}
| schemasafe/troy | troy-macro/src/main/scala/troy/macros/CqlOps.scala | Scala | apache-2.0 | 302 |
package com.datastax.spark.connector.embedded
import java.net.{ConnectException, Socket}
import java.nio.file.{FileAlreadyExistsException, Files, Paths}
import scala.annotation.tailrec
import scala.util.{Failure, Success, Try}
case class DynamicCassandraPorts(basePort: Int) extends CassandraPorts {
import Dynamic... | ponkin/spark-cassandra-connector | spark-cassandra-connector-embedded/src/main/scala/com/datastax/spark/connector/embedded/DynamicCassandraPorts.scala | Scala | apache-2.0 | 2,365 |
/*
* 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 | compiler/src/main/scala/com/asakusafw/spark/compiler/spi/AggregationCompiler.scala | Scala | apache-2.0 | 2,696 |
/*******************************************************************************
* Copyright (c) 2015 Guillaume DUBUISSON DUPLESSIS <[email protected]>.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* ... | GuillaumeDD/scala99problems | src/main/scala/graphs/P89/sol01Graph.scala | Scala | gpl-3.0 | 856 |
package demoproduct
import scala.concurrent.duration._
import io.gatling.core.Predef._
import io.gatling.http.Predef._
import io.gatling.jdbc.Predef._
object RefSEA {
val headers_0 = Map("Upgrade-Insecure-Requests" -> "1")
val refSEA =
//exec(flushCookieJar)
exec(http("get refSEA")
.ge... | evandor/skysail | skysail.product.demo.e2e.gatling/src/gatling/scala/demoproduct/RefSEA.scala | Scala | apache-2.0 | 879 |
/* __ *\\
** ________ ___ / / ___ __ ____ Scala.js API **
** / __/ __// _ | / / / _ | __ / // __/ (c) 2013-2015, LAMP/EPFL **
** __\\ \\/ /__/ __ |/ /__/ __ |/_// /_\\ \\ http://scala-lang.org/ **
** /____/\\___/... | CapeSepias/scala-js | library/src/main/scala/scala/scalajs/js/Union.scala | Scala | bsd-3-clause | 2,919 |
/*
* 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 ... | chenc10/Spark-PAF | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JDBCRelation.scala | Scala | apache-2.0 | 3,988 |
/**
* Copyright (C) 2009-2013 Typesafe Inc. <http://www.typesafe.com>
*/
package achilles.backend.services
import akka.actor.Actor
trait RequireMsg
case class QueryRecom(uid: String, content: String, loc: String) extends RequireMsg
case class checkDB() extends RequireMsg
trait RecResult
case class BasicRecResul... | yinxusen/achilles | src/main/scala/achilles/backend/services/RequireMsg.scala | Scala | apache-2.0 | 377 |
package org.tobster.dpp.datamodel
import scala.collection.mutable.HashMap
import org.joda.time.DateTime
object FlightLookup {
print("FlightLookup: ")
private val FileNames = List(
"cfi_all_spo.csv",
"cfi_all_spo_delta.csv"
)
// Immutable Map: Origin -> List[Flight]
private val allFlights: Ma... | tobeydee/dynamicpackagingserverprototype | src/main/scala/org/tobster/dpp/datamodel/FlightLookup.scala | Scala | mit | 1,661 |
package c3.w2
import org.junit.runner.RunWith
import org.scalameter.{Key, Warmer, config}
import org.scalatest.FunSuite
import org.scalatest.junit.JUnitRunner
import scala.util.Random
@RunWith(classOf[JUnitRunner])
class MergeSortSuite extends FunSuite {
trait mergeSort {
val maxDepth = 7
val xs = new Ar... | lwo/lwo.github.io | src/test/scala/c3/w2/MergeSortSuite.scala | Scala | gpl-3.0 | 1,663 |
package se.ramn.bottfarmen.example.idle
import collection.JavaConverters._
import collection.immutable.Seq
import se.ramn.bottfarmen.api
import se.ramn.bottfarmen.api.Command
import se.ramn.bottfarmen.api.Move
import se.ramn.bottfarmen.api.BotCommander
import se.ramn.bottfarmen.api.GameState
import se.ramn.bottfarmen... | ramn/bottfarmen | common/src/main/scala/example/idle/IdleCommander.scala | Scala | gpl-3.0 | 682 |
package scaladex.data
package maven
private[maven] object PomConvert {
def apply(model: org.apache.maven.model.Model): ArtifactModel = {
import model._
import scala.jdk.CollectionConverters._
import scala.util.Try
def list[T](l: java.util.List[T]): List[T] =
Option(l).map(_.asScala.toList).get... | scalacenter/scaladex | modules/data/src/main/scala/scaladex/data/maven/PomConvert.scala | Scala | bsd-3-clause | 3,369 |
package com.kalmanb.sbt.extra
import scala.xml.Elem
import scala.xml.Node
import scala.xml.transform.RewriteRule
import com.kalmanb.sbt.Jenkins
import sbt.Keys._
import sbt._
object JenkinsGitPlugin {
import com.kalmanb.sbt.JenkinsPlugin._
import Git._
val jenChangeJobBranch = InputKey[Unit]("jenChangeJobBran... | kalmanb/sbt-jenkins-manager | src/main/scala/com/kalmanb/sbt/extra/JenkinsGitPlugin.scala | Scala | apache-2.0 | 2,381 |
package scalajsreact.select.example.components
import japgolly.scalajs.react._
import japgolly.scalajs.react.extra.Reusability
import japgolly.scalajs.react.extra.router.RouterCtl
import japgolly.scalajs.react.vdom.prefix_<^._
import scala.scalajs.js.{Any, UndefOr}
import scalacss.Defaults._
import scalacss.ScalaCssR... | lvitaly/scalajs-react-select-example | src/main/scala/scalajsreact/select/example/components/LeftNav.scala | Scala | apache-2.0 | 1,569 |
//偏函数
import java.util.Date
object LogWithDate{
def main(args: Array[String]){
val date = new Date
val LogWithDateBound = log(date, _:String)
LogWithDateBound("message1")
Thread.sleep(1000) //毫秒
LogWithDateBound("message2")
Thread.sleep(1000)
LogWi... | PengLiangWang/Scala | function/LogWithDate.scala | Scala | gpl-3.0 | 664 |
/*
* Copyright 2013 David Savage
*
* 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... | davemssavage/modula | scratch/src/org/chronologicalthought/modula/scratch/ServiceIdeas.scala | Scala | apache-2.0 | 1,598 |
/*
* Copyright 2022 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | hmrc/vat-registration-frontend | app/services/PartnershipIdService.scala | Scala | apache-2.0 | 1,367 |
package com.basdek.mailchimp_v3.operations.lists
import com.basdek.mailchimp_v3.dto.MailChimpList
import com.basdek.mailchimp_v3.{Config, MailChimpResultFuture, SimpleAuthenticate}
import com.basdek.mailchimp_v3.operations.Operation
import com.ning.http.client.Response
import dispatch._, Defaults._
import org.json4s._... | basdek/mailchimp_v3 | src/main/scala/com/basdek/mailchimp_v3/operations/lists/CreateListOperation.scala | Scala | mit | 1,021 |
/*
* 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 ... | lxsmnv/spark | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/windowExpressions.scala | Scala | apache-2.0 | 30,287 |
package hu.blackbelt.cd.bintray.deploy
import java.nio.file.{Files, StandardCopyOption}
import java.util.{Properties, UUID}
import awscala.s3.S3
import com.amazonaws.regions.Regions
import com.amazonaws.services.s3.model.GetObjectRequest
import hu.blackbelt.cd.bintray.VFS.FS
object Access {
val bintray_organizatio... | tsechov/s3-bintray-deploy | src/main/scala/hu/blackbelt/cd/bintray/deploy/Access.scala | Scala | apache-2.0 | 1,231 |
package filodb.core.memstore
import scala.collection.mutable.ArrayBuffer
import scala.concurrent.duration._
import scala.util.Random
import com.googlecode.javaewah.IntIterator
import org.scalatest.BeforeAndAfter
import filodb.core._
import filodb.core.binaryrecord2.RecordBuilder
import filodb.core.metadata.Dataset
i... | tuplejump/FiloDB | core/src/test/scala/filodb.core/memstore/PartKeyLuceneIndexSpec.scala | Scala | apache-2.0 | 14,112 |
/**
* sbt-application - application builder with ProGuard and JavaFX support
*
* Copyright (c) 2012 Alexey Aksenov [email protected]
*
* 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
*
* ... | sbt-android-mill/sbt-application | src/main/scala/sbt/application/javafx/CSSToBinTask.scala | Scala | apache-2.0 | 1,727 |
package com.outr.arango.api.model
import io.circe.Json
case class GeneralGraphEdgeDefinitionAddHttpExamplesRc202(error: Boolean,
code: Option[Int] = None,
graph: Option[GraphRepresentation] = None) | outr/arangodb-scala | api/src/main/scala/com/outr/arango/api/model/GeneralGraphEdgeDefinitionAddHttpExamplesRc202.scala | Scala | mit | 316 |
/*
* 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 ... | maropu/spark | sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/OptimizerSuite.scala | Scala | apache-2.0 | 3,060 |
package com.webtrends.harness.component.kafka.actor
import akka.actor.ActorRef
import com.webtrends.harness.app.HActor
import com.webtrends.harness.component.kafka.actor.KafkaTopicManager.DownSources
import com.webtrends.harness.component.kafka.util.KafkaSettings
import com.webtrends.harness.component.metrics.MetricsA... | malibuworkcrew/wookiee-kafka | src/main/scala/com/webtrends/harness/component/kafka/actor/SourceMonitor.scala | Scala | apache-2.0 | 4,217 |
package gitbucket.core.api
/**
* path for api url. if set path '/repos/aa/bb' then, expand 'http://server:post/repos/aa/bb' when converted to json.
*/
case class ApiPath(path: String)
| intermezzo-fr/gitbucket | src/main/scala/gitbucket/core/api/ApiPath.scala | Scala | apache-2.0 | 187 |
import cats.free.Free
import scala.collection.mutable
import cats.free.Free.liftF
import cats.{~>, Id}
object InteractionKv {
// DSL Interaction
sealed trait Interaction[A]
case object Ask extends Interaction[String]
case class Tell(input: String) extends Interaction[Unit]
type InteractionAlgebra[A] = Free[... | PaNaVTEC/Katas | key-value-pair/src/main/scala/InteractionKv.scala | Scala | apache-2.0 | 1,607 |
package jigg.pipeline
/*
Copyright 2013-2015 Takafumi Sakakibara and Hiroshi Noji
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 requi... | tomeken-yoshinaga/jigg | src/main/scala/jigg/pipeline/CCGParseAnnotator.scala | Scala | apache-2.0 | 5,848 |
package org.cg.scala.dhc.domelments
import org.cg.scala.dhc.util.FileInfo
/**
* Created by ssmertnig on 4/28/17.
*/
case class TargetExtension(override val file: FileInfo, val extensions: Array[Extension])
extends Extension(file, extensions) {
override def getItems(): List[Item] = {
val systems = (xml \\... | curiosag/datahubchecker | datahubchecker-utility/src/main/scala/org/cg/scala/dhc/domelments/TargetExtension.scala | Scala | unlicense | 4,476 |
package breeze.linalg
/*
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... | calippo/breeze | math/src/main/scala/breeze/linalg/DenseVector.scala | Scala | apache-2.0 | 28,908 |
/*
* 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 ... | aljoscha/flink | flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/planner/plan/batch/sql/RemoveCollationTest.scala | Scala | apache-2.0 | 13,244 |
/**
* Copyright (c) 2002-2012 "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 Foundati... | dksaputra/community | cypher/src/main/scala/org/neo4j/cypher/internal/pipes/matching/Joiner.scala | Scala | gpl-3.0 | 3,095 |
/* __ *\
** ________ ___ / / ___ __ ____ Scala.js Test Suite **
** / __/ __// _ | / / / _ | __ / // __/ (c) 2013, LAMP/EPFL **
** __\ \/ /__/ __ |/ /__/ __ |/_// /_\ \ http://scala-js.org/ **
** /____/\___/_/ |_/... | colinrgodsey/scala-js | test-suite/src/test/scala/org/scalajs/testsuite/compiler/BooleanTest.scala | Scala | bsd-3-clause | 1,477 |
/*
* Copyright 2015 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... | hugocf/reactive-circuit-breaker | src/test/scala/uk/gov/hmrc/circuitbreaker/WithCircuitBreakerSpec.scala | Scala | apache-2.0 | 3,856 |
package org.jetbrains.plugins.scala.lang.refactoring.util
import com.intellij.openapi.util.TextRange
import com.intellij.psi._
import com.intellij.psi.util.PsiTreeUtil
import org.jetbrains.plugins.scala.ScalaBundle
import org.jetbrains.plugins.scala.extensions.ResolvesTo
import org.jetbrains.plugins.scala.lang.psi.Sca... | ilinum/intellij-scala | src/org/jetbrains/plugins/scala/lang/refactoring/util/ScalaVariableValidator.scala | Scala | apache-2.0 | 6,792 |
package model
case class FeeBucket(index: Int, minFee: Int, maxFee: Int, count: Int, memCount: Int)
case class FeePrediction(fee: Long, minDelay: Int, maxDelay: Int, minMinutes: Int, maxMinutes: Int)
case class FeeSummary(
predictions: Array[FeePrediction],
feeByDelay: Map[Int, Long],
feeByMinutes: Map[Int, Lo... | papauschek/cointape | model/src/main/scala/model/Fees.scala | Scala | mit | 3,902 |
package org.scaladebugger.api.profiles.traits.info.events
import com.sun.jdi.event.MonitorContendedEnteredEvent
import org.scaladebugger.api.profiles.traits.info.{ObjectInfo, ThreadInfo}
/**
* Represents the interface that needs to be implemented to provide
* an abstraction over the JDI montior contended entered ev... | chipsenkbeil/scala-debugger | scala-debugger-api/src/main/scala/org/scaladebugger/api/profiles/traits/info/events/MonitorContendedEnteredEventInfo.scala | Scala | apache-2.0 | 893 |
package io.react2.reactiveaws.core
import com.typesafe.config.ConfigFactory
/**
* @author dbalduini
*/
trait HasConfig {
lazy val config = ConfigFactory.load()
}
| dbalduini/ReactiveAws | core/src/main/scala/io/react2/reactiveaws/core/HasConfig.scala | Scala | apache-2.0 | 168 |
/*
* Copyright 2014–2018 SlamData Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | slamdata/matryoshka | tests/shared/src/test/scala/matryoshka/example/intList.scala | Scala | apache-2.0 | 3,005 |
package org.scalaide.ui.internal.actions
import org.eclipse.jface.action.IAction
import org.eclipse.jface.viewers.ISelection
import org.eclipse.ui.IObjectActionDelegate
import org.eclipse.ui.IWorkbenchPart
import org.eclipse.ui.IWorkbenchWindow
import org.scalaide.core.internal.logging.LogManager
import org.eclipse.ui... | Kwestor/scala-ide | org.scala-ide.sdt.core/src/org/scalaide/ui/internal/actions/RunDiagnosticAction.scala | Scala | bsd-3-clause | 1,754 |
/*
* 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 ... | zcan/samza | samza-core/src/test/scala/org/apache/samza/system/chooser/TestBootstrappingChooser.scala | Scala | apache-2.0 | 9,753 |
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.