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 gitbucket.core.model
protected[model] trait TemplateComponent { self: Profile =>
import profile.api._
trait BasicTemplate { self: Table[_] =>
val userName = column[String]("USER_NAME")
val repositoryName = column[String]("REPOSITORY_NAME")
def byAccount(userName: String) = (this.userName === ... | rabitarochan/gitbucket | src/main/scala/gitbucket/core/model/BasicTemplate.scala | Scala | apache-2.0 | 3,688 |
/***********************************************************************
* Copyright (c) 2013-2016 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 ... | nagavallia/geomesa | geomesa-utils/src/main/scala/org/locationtech/geomesa/utils/conf/GeoMesaSystemProperties.scala | Scala | apache-2.0 | 1,334 |
package com.bwsw.commitlog.filesystem
import java.io.ByteArrayInputStream
import java.security.MessageDigest
import javax.xml.bind.DatatypeConverter
class CommitLogBinary(id: Long, content: Array[Byte], md5: Option[Array[Byte]]) extends CommitLogStorage{
require(if (md5.isDefined) md5.get.length == 32 else true)
... | bwsw/tstreams-transaction-server | src/main/scala/com/bwsw/commitlog/filesystem/CommitLogBinary.scala | Scala | apache-2.0 | 1,405 |
package io
import java.nio.{ByteBuffer, ByteOrder}
/**
* A wrapper for a byte buffer that is guaranteed to be in little endian byte order
* @param buffer the wrapped ByteBuffer
*/
class BlobBuilder private(private val buffer: ByteBuffer) extends AnyVal {
def put[T](value: T)(implicit s: BlobSerializer[T]) = s.w... | rklaehn/akka_http_test | src/main/scala/io/BlobBuilder.scala | Scala | apache-2.0 | 2,198 |
package com.shorrockin.cascal.model
import java.nio.ByteBuffer
import org.apache.cassandra.thrift.ColumnParent
import org.apache.cassandra.thrift.ColumnPath
import org.apache.cassandra.thrift.ColumnOrSuperColumn
import scala.collection.JavaConversions._
import com.shorrockin.cascal.utils.Conversions
class CounterSuper... | Shimi/cascal | src/main/scala/com/shorrockin/cascal/model/CounterSuperColumn.scala | Scala | apache-2.0 | 1,882 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | caneGuy/spark | sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/LiteralGenerator.scala | Scala | apache-2.0 | 7,081 |
package rpgboss.model.battle
import rpgboss._
import rpgboss.model._
import rpgboss.model.battle._
object BattleTest {
class BattleFixture(aiOpt: Option[BattleAI] = None) {
val pData = ProjectData("fake-uuid", "fake-title")
val characterFast =
Character(progressions = StatProgressions(spd = Curve(10,... | rpgboss/rpgboss | core/src/test/scala/rpgboss/model/battle/BattleSpec.scala | Scala | agpl-3.0 | 5,545 |
package ru.wordmetrix.ratnest
import scala.actors.Actor
class Metagor extends Actor {
/*
* Meta Server make from goods more detalized version.
*/
def act() = {
val log = new Log("Metagor", "started")
loop {
react {
case goods: GoodsMeta => None //new ja... | electricmind/ratnest | src/main/scala/ru/wordmetrix/ratnest/MetaGor.scala | Scala | apache-2.0 | 2,096 |
/*
* 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 ... | jlopezmalla/spark | streaming/src/main/scala/org/apache/spark/streaming/Time.scala | Scala | apache-2.0 | 3,018 |
/*
* Copyright 2009-2010 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by appl... | akisaarinen/ccf | ccf/src/main/scala/ccf/session/Result.scala | Scala | apache-2.0 | 744 |
package org.sackfix.tester.tests
import org.sackfix.tester.simplefix.message.{FixTags, MsgTypes, SessMessages}
/**
* Created by Jonathan during 2017.
*/
class T6_a_NothingReceivedForHeartbeatPlus20Spec() extends SackFixTestSpec {
behavior of "Send test request"
it should "No data received during heartbeat in... | PendaRed/sackfixtests | sf-fix-tester/src/test/scala/org/sackfix/tester/tests/T6_a_NothingReceivedForHeartbeatPlus20Spec.scala | Scala | mit | 1,352 |
/**
* Copyright 2015 Thomson Reuters
*
* 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 ag... | TRnonodename/CM-Well | server/cmwell-data-tools/src/main/scala/cmwell/tools/data/utils/akka/stats/DownloaderStats.scala | Scala | apache-2.0 | 8,050 |
package org.reactivecouchbase.rs.scaladsl
import java.util.concurrent.{ConcurrentHashMap, Executors}
import com.typesafe.config.{Config, ConfigFactory}
import org.reactivecouchbase.rs.scaladsl.TypeUtils.{ClusterCustomizer, EnvCustomizer}
import scala.concurrent.duration.Duration
import scala.concurrent.{ExecutionCon... | ReactiveCouchbase/reactivecouchbase-rs-core | src/main/scala/org/reactivecouchbase/rs/scaladsl/ReactiveCouchbase.scala | Scala | apache-2.0 | 1,673 |
package scala.models
import io.apibuilder.generator.v0.models.Attribute
import scala.generator.ScalaService
import org.scalatest.funspec.AnyFunSpec
import org.scalatest.matchers.should.Matchers
class Play2BindablesSpec extends AnyFunSpec with Matchers {
lazy val service = models.TestHelper.referenceApiService
l... | mbryzek/apidoc-generator | scala-generator/src/test/scala/models/Play2BindablesSpec.scala | Scala | mit | 1,975 |
package spire.std
import spire.algebra.{MetricSpace, Monoid, Order}
@SerialVersionUID(0L)
class StringMonoid extends Monoid[String] with Serializable {
def id = ""
def op(x: String, y: String): String = x + y
}
@SerialVersionUID(0L)
class StringOrder extends Order[String] with Serializable {
override def eqv(x... | lrytz/spire | core/src/main/scala/spire/std/string.scala | Scala | mit | 1,536 |
package io.scalajs.nodejs.net
import io.scalajs.nodejs.events.IEventEmitter
import scala.scalajs.js
import scala.scalajs.js.annotation.JSImport
/**
* net - The net module provides you with an asynchronous network wrapper. It contains functions for creating both
* servers and clients (called streams).
* @see ht... | scalajs-io/nodejs | app/common/src/main/scala/io/scalajs/nodejs/net/Net.scala | Scala | apache-2.0 | 6,393 |
/**
* Copyright 2012-2013 greencheek.org (www.greencheek.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 ... | tootedom/yankeedo | yankeedo-core/src/main/scala/org/greencheek/jms/yankeedo/structure/scenario/ScenarioExecution.scala | Scala | apache-2.0 | 823 |
package io.jfc.test
import algebra.Eq
import cats.data.{ NonEmptyList, Validated, Xor }
import io.jfc.{ Cursor, GenericCursor, Json }
import io.jfc.syntax._
abstract class CursorSuite[C <: GenericCursor[C]](implicit eq: Eq[C]) extends JfcSuite {
def fromJson(j: Json): C
def top(c: C): Option[Json]
def focus(c: ... | non/circe | core/src/test/scala/io/jfc/test/CursorSuite.scala | Scala | apache-2.0 | 2,999 |
/*
* 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 ... | kevinyu98/spark | sql/core/src/main/scala/org/apache/spark/sql/DataFrameStatFunctions.scala | Scala | apache-2.0 | 23,756 |
package io.finch.eval
import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.module.scala.DefaultScalaModule
import com.twitter.finagle.Http
import com.twitter.util.{Await, Eval}
import io.finch._
import io.finch.jackson._
/**
* A simple Finch application evaluating the given Scala expressio... | yanana/finch | examples/src/main/scala/io/finch/eval/Main.scala | Scala | apache-2.0 | 1,296 |
/*
* Copyright 2001-2013 Artima, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agre... | dotty-staging/scalatest | scalatest/src/main/scala/org/scalatest/tools/StandardErrReporter.scala | Scala | apache-2.0 | 1,656 |
package fi.onesto.sbt.mobilizer
sealed trait RequestPty
case object WithPty extends RequestPty
case object NoPty extends RequestPty | onesto/sbt-mobilizer | src/main/scala/fi/onesto/sbt/mobilizer/RequestPty.scala | Scala | mit | 135 |
/*
* Copyright 2016 Jesper de Jong
*
* 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 ... | jesperdj/spring-cloud-demo | whiteboard-service/src/main/scala/com/jesperdj/example/service/whiteboard/domain/NoteRepository.scala | Scala | apache-2.0 | 812 |
package com.readclosely.util
/*
Copyright 2009-2010 Karl Pichotta
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... | kpich/readclosely | src/main/scala/com/readclosely/util/UserUtil.scala | Scala | apache-2.0 | 2,048 |
package com.agoda.kafka.connector.jdbc
import java.sql.Timestamp
import java.util.TimeZone
import com.agoda.kafka.connector.jdbc.JdbcSourceConnectorConstants._
import com.agoda.kafka.connector.jdbc.models.Mode
import com.agoda.kafka.connector.jdbc.models.Mode.{IncrementingMode, TimestampIncrementingMode, TimestampMod... | arpanchaudhury/kafka-jdbc-connector | src/main/scala/com/agoda/kafka/connector/jdbc/JdbcSourceConnectorConfig.scala | Scala | apache-2.0 | 5,038 |
package ui.math
import scala.scalajs.js.typedarray.Float32Array
import Mat3._
class Mat3[T](var x1: T,
var x2: T,
var x3: T,
var x4: T,
var x5: T,
var x6: T,
var x7: T,
var x8: T,
var x9: T) {
... | gvatn/play-scalajs-webgl-spark | client/src/main/scala/ui/math/Mat3.scala | Scala | mit | 5,474 |
/*
* 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 n... | TiVo/kafka | core/src/test/scala/unit/kafka/server/LogDirFailureTest.scala | Scala | apache-2.0 | 9,174 |
/*
* Copyright 2001-2011 Artima, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agre... | svn2github/scalatest | project/GenTable.scala | Scala | apache-2.0 | 45,139 |
package com.naughtyzombie.sparkle.recipesearch
import org.apache.spark.mllib.feature.HashingTF
import org.apache.spark.mllib.linalg.Vector
/**
* Created by pram on 11/11/2015.
*/
object Utils {
val numFeatures = 1000
val tf = new HashingTF(numFeatures)
def featurize(s: String): Vector = {
tf.transform... | pram/sparkle | src/main/scala/com/naughtyzombie/sparkle/recipesearch/Utils.scala | Scala | mit | 348 |
package org.hotsextra.matchmaking
package webinterface
package codec
import argonaut._
import argonaut.Json._
import entries.HeroLeagueEntry
import rating.Rating
object Encoders {
implicit def encodeRating: EncodeJson[Rating] = new EncodeJson[Rating] {
def encode(r: Rating) = Json.obj(
("value", jNumber(... | martijnhoekstra/hotsextra-matchmaker | src/main/scala/org/hotsextra/matchmaking/webinterface/codec/Encoders.scala | Scala | agpl-3.0 | 690 |
package scala.test.junit
import org.junit.Test
import org.hamcrest.CoreMatchers._
import org.hamcrest.MatcherAssert._
import scala.test.junit.support.JUnitCompileTimeDep
import java.lang.management.ManagementFactory
import java.lang.management.RuntimeMXBean
class JunitWithDepsTest {
@Test
def hasCompileTimeDepen... | sdtwigg/rules_scala | test/src/main/scala/scala/test/junit/JunitTests.scala | Scala | apache-2.0 | 729 |
object cury{
def curry[A,B,C](f:(A,B)=>C): A=>(B=>C) = {
(a: A) => b:B=>f(a,b)
}
def main(args: Array[String]) = {
println(curry(1,"asda"=>2.5))
}
}
| jmlb23/scala | curry.scala | Scala | gpl-3.0 | 159 |
package com.fulldeep.indexation;
import com.fulldeep.indexation._
import java.io.File
class Query( val id:Int, val text:String , val relation:Seq[Int]) extends Serializable {
def getId():Int={
id
}
}
| ToqueWillot/M2DAC | RI/RI_searchEngine/RI_Project/indexation/src/main/scala/com/fulldeep/indexation/Query.scala | Scala | gpl-2.0 | 233 |
/*
* Copyright 2017 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... | liquidarmour/ct-calculations | src/main/scala/uk/gov/hmrc/ct/CATO22.scala | Scala | apache-2.0 | 1,246 |
/*
* Copyright 2006-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... | lift/framework | core/util/src/main/scala/net/liftweb/util/JsonCmd.scala | Scala | apache-2.0 | 1,938 |
package com.weez.mercury
object HttpServer {
import scala.concurrent._
import scala.util._
import shapeless._
import akka.actor._
import akka.io._
import spray.can.Http
import spray.routing._
import spray.http._
import spray.json._
import spray.util.LoggingContext
import com.typesafe.config._
... | weeztech/weez-mercury | main/src/main/scala/com/weez/mercury/HttpServer.scala | Scala | apache-2.0 | 9,289 |
val str = String.format("This is a %s", "Test")
println(str)
val str2 = String.format("This is a %s".format("Test@"))
println(str2)
| chrisheckler/Scala_scripts | stringFormat.scala | Scala | mit | 134 |
package de.htwg.zeta.common.models.entity
import java.util.UUID
case class Log(
id: UUID,
task: String,
log: String,
status: Int,
date: String
) extends Entity
| Zeta-Project/zeta | api/common/src/main/scala/de/htwg/zeta/common/models/entity/Log.scala | Scala | bsd-2-clause | 183 |
package lobos
package object breeze {
import _root_.breeze.linalg.{DenseMatrix, DenseVector}
implicit def indexedSeq2Vector(seq:IndexedSeq[Double]):DenseVector[Double] = DenseVector(seq:_*)
implicit def indexedSeqIterator2Matrix(iterator:Iterator[IndexedSeq[Double]]):DenseMatrix[Double] = DenseMatrix(iterator.... | Wsiegenthaler/lobos | jvm/src/main/scala/lobos/breeze.scala | Scala | bsd-3-clause | 332 |
/*
* Copyright (c) 2015 Stojan Dimitrovski
*
* 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, ... | hf/siddhartha | src/main/scala/me/stojan/siddhartha/message/Assignments.scala | Scala | mit | 1,706 |
package org.thp.cortex.models
import scala.util.Try
import play.api.libs.json.{ JsObject, JsString, Json }
import javax.inject.{ Inject, Singleton }
import org.thp.cortex.models.JsonFormat.workerTypeFormat
import org.elastic4play.models.JsonFormat.enumFormat
import org.elastic4play.models.{ AttributeDef, EntityDef,... | CERT-BDF/Cortex | app/org/thp/cortex/models/Job.scala | Scala | agpl-3.0 | 3,315 |
/**
* News Feed
* news feed api
*
* OpenAPI spec version: 1.0.0
* Contact: media@glennengstrand.info
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
*/
package info.glennengstrand.news.model
case class Participant(
id: Optio... | gengstrand/clojure-news-feed | server/feed6/src/main/scala/info/glennengstrand/news/model/Participant.scala | Scala | epl-1.0 | 377 |
/*
* Copyright (c) 2017. Yuriy Stul
*/
package com.stulsoft.ysps.pforcomprehansion
/**
* You can mix options and list types in map/flatMap (Option can be seen as a simple collection)
*
* We want to remove empty values and increment other values
*
* See [[https://gist.github.com/loicdescotte/4044169 Scala ... | ysden123/ysps | src/main/scala/com/stulsoft/ysps/pforcomprehansion/Example4.scala | Scala | mit | 718 |
/*******************************************************************************
* Copyright (c) 2019. Carl Minden
*
* This program 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 ... | carlminden/anathema-roguelike | src/com/anathema_roguelike/stats/characterstats/secondarystats/Endurance.scala | Scala | gpl-3.0 | 1,222 |
package com.example.api.models.exceptions
case object ModelNotFoundException extends RuntimeException
| Ticketfly/play-api | app/com/example/api/models/exceptions/ModelNotFoundException.scala | Scala | mit | 103 |
package liang.don.dzviewer
import swing.SimpleSwingApplication
/**
* Java runtime version of the DeepZoomViewer main class.
*
* @author Don Liang
* @Version 0.1, 14/09/2011
*/
object DeepZoomViewerMain extends SimpleSwingApplication {
val PREFERRED_WINDOW_WIDTH = 800 //1920
val PREFERRED_WINDOW_HEIGHT = 600... | dl2k84/DeepZoomViewer | src/liang/don/dzviewer/DeepZoomViewerMain.scala | Scala | mit | 491 |
/*
* This file is part of EasyForger which is released under GPLv3 License.
* See file LICENSE.txt or go to http://www.gnu.org/licenses/gpl-3.0.en.html for full license details.
*/
package com.easyforger.samples.items
import com.easyforger.items.EFItemSpade
import net.minecraft.block.state.IBlockState
import net.mi... | easyforger/easyforger-samples | src/main/scala/com/easyforger/samples/items/ItemQuickSpade.scala | Scala | gpl-3.0 | 596 |
package latis.ops.resample
import latis.dm._
class NearestNeighborResampling(domainSet: Iterable[Variable])
extends Resampling(domainSet) with NearestNeighborInterpolation {
override def interpolator(xs: Array[Double], ys: Array[Double]): Double => Option[Double] =
super[NearestNeighborInterpolation].interp... | dlindhol/LaTiS | src/main/scala/latis/ops/resample/NearestNeighborResampling.scala | Scala | epl-1.0 | 338 |
package com.cloudray.scalapress.plugin.asset.pngshrink
import org.scalatest.{OneInstancePerTest, FunSuite}
import org.scalatest.mock.MockitoSugar
import org.apache.commons.io.IOUtils
import com.sksamuel.scrimage.{Format, Image}
import java.io.ByteArrayInputStream
/** @author Stephen Samuel */
class PngShrinkAssetList... | vidyacraghav/scalapress | src/test/scala/com/cloudray/scalapress/plugin/asset/pngshrink/PngShrinkAssetListenerTest.scala | Scala | apache-2.0 | 1,410 |
/*
* Copyright (c) 2015-6 Alexandre Archambault
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable l... | rorygraves/perf_tester | corpus/shapeless/src/test/scala/shapeless/annotation.scala | Scala | apache-2.0 | 3,775 |
/**
* 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... | chirino/activemq-apollo | apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Connection.scala | Scala | apache-2.0 | 7,025 |
/*
* Copyright 2016 The BigDL Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | intel-analytics/BigDL | scala/dllib/src/test/scala/com/intel/analytics/bigdl/dllib/utils/tf/loaders/CeilSpec.scala | Scala | apache-2.0 | 1,525 |
package com.krux.hyperion.examples
import scala.language.postfixOps
import com.krux.hyperion.Implicits._
import com.krux.hyperion.action.SnsAlarm
import com.krux.hyperion.activity._
import com.krux.hyperion.common.S3Uri
import com.krux.hyperion.expression.{Format, Parameter, RuntimeNode}
import com.krux.hyperion.resou... | hoangelos/hyperion | examples/src/main/scala/com/krux/hyperion/examples/ExampleMapReduce.scala | Scala | apache-2.0 | 2,595 |
package org.ybiquitous.messages.scala
import java.util.Locale
import org.ybiquitous.messages.MessageKeyNotFoundException
trait MessageBuilder {
@throws(classOf[MessageKeyNotFoundException])
def build(locale: Locale, key: String, args: Seq[Any]): String
def buildOrElse(locale: Locale, key: String, args: Seq[An... | ybiquitous/messages | messages-scala/src/main/scala/org/ybiquitous/messages/scala/MessageBuilder.scala | Scala | apache-2.0 | 483 |
import scala.reflect.macros.blackbox.Context
object Impls {
def foo(unconventionalName: Context)(x: unconventionalName.Expr[Int]) = {
import unconventionalName.universe._
unconventionalName.Expr[Unit](q"""println("invoking foo...")""")
}
}
object Macros {
def foo(x: Int): Unit = macro Impls.foo
}
| martijnhoekstra/scala | test/files/run/macro-impl-rename-context/Impls_Macros_1.scala | Scala | apache-2.0 | 314 |
package scala.macros.intellij.engine
trait Universe {
}
| triplequote/intellij-scala | scala/scala-impl/src/scala/macros/intellij/engine/Universe.scala | Scala | apache-2.0 | 58 |
package gg.uhc.hosts.endpoints.ubl
import akka.http.scaladsl.server.Directives._
import akka.http.scaladsl.server.Route
import gg.uhc.hosts.CustomJsonCodec
import gg.uhc.hosts.database.Database
import gg.uhc.hosts.endpoints.{BasicCache, CustomDirectives, DatabaseErrorRejection, EndpointRejectionHandler}
import scala.... | Eluinhost/hosts.uhc.gg | src/main/scala/gg/uhc/hosts/endpoints/ubl/GetCurrentUbl.scala | Scala | mit | 692 |
package com.cterm2.miniflags
// Render Objects for Triangular(Default) Flags
package render
{
package object nameTag
{
// TileRenderer
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer
import net.minecraft.client.renderer._
import org.lwjgl.opengl.GL11._
object TERenderer extends ... | Pctg-x8/miniflags | src/render/nameTagRender.scala | Scala | lgpl-2.1 | 2,085 |
/*
* Copyright (c) 2013 David Soergel <dev@davidsoergel.com>
* Licensed under the Apache License, Version 2.0
* http://www.apache.org/licenses/LICENSE-2.0
*/
package worldmake.executionstrategy
import worldmake._
import scalax.file.Path
import scala.collection.GenMap
import scala.concurrent.{ExecutionContext, F... | davidsoergel/worldmake | src/main/scala/worldmake/executionstrategy/QsubExecutionStrategy.scala | Scala | apache-2.0 | 11,858 |
/*
* Copyright 2018 Analytics Zoo Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or... | intel-analytics/analytics-zoo | zoo/src/main/scala/com/intel/analytics/zoo/pipeline/inference/PythonInferenceModel.scala | Scala | apache-2.0 | 3,764 |
package org.plummtw.jinrou
import _root_.java.io.File
import _root_.junit.framework._
import Assert._
import _root_.scala.xml.XML
import _root_.net.liftweb.util._
object AppTest {
def suite: Test = {
val suite = new TestSuite(classOf[AppTest])
suite
}
def main(args : Array[String]) {
_root_.junit.t... | Plummtw/jinrou_Lift | src/test/scala/org/plummtw/jinrou/AppTest.scala | Scala | apache-2.0 | 1,968 |
package io.hnfmr.chapter6
import scala.language.higherKinds
import cats.Monad
import cats.instances.option._
import cats.syntax.flatMap._
import cats.syntax.functor._
import cats.syntax.option._
object CartesianEx extends App {
def product[M[_]: Monad, A, B] ( fa: M[A] ,fb: M[B] ): M[(A, B)] =
for {
a <-... | hnfmr/advanced-scala | src/main/scala/io/hnfmr/chapter6/CartesianEx.scala | Scala | mit | 428 |
/*
* 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 ... | Sephiroth-Lin/incubator-carbondata | integration/spark2/src/main/scala/org/apache/spark/sql/execution/BatchedDataSourceScanExec.scala | Scala | apache-2.0 | 6,041 |
/***********************************************************************
* 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-hbase/geomesa-hbase-tools/src/main/scala/org/locationtech/geomesa/hbase/tools/data/HBaseCreateSchemaCommand.scala | Scala | apache-2.0 | 2,450 |
/* Copyright (C) 2008-2014 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... | patverga/factorie | src/main/scala/cc/factorie/tutorial/ForwardBackwardPOS.scala | Scala | apache-2.0 | 7,430 |
import play.api._
import play.api.mvc.Results._
import play.api.mvc._
import scala.concurrent.Future
object Global extends GlobalSettings {
override def onBadRequest(request: RequestHeader, error: String) = {
Future.successful(BadRequest("Bad Request: " + error))
}
override def onError(request: RequestHeader, ... | kristiankime/web-education-games | app/Global.scala | Scala | mit | 558 |
package json.schema.scope
import java.net.URI
import argonaut.Argonaut._
import argonaut.{ACursor, HCursor, Json}
import scalaz.{-\\/, \\/, \\/-}
/**
* Expands relative references and Ids in a JSON document.
* See http://json-schema.org/latest/json-schema-core.html
*/
trait ExpandReferences extends JsonTraver... | VoxSupplyChain/json-schema-parser | src/main/scala/json/schema/scope/ExpandReferences.scala | Scala | apache-2.0 | 2,622 |
/*
* 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 | core/src/main/scala/org/apache/spark/scheduler/TaskInfo.scala | Scala | apache-2.0 | 3,121 |
package com.cerner.beadledom.resteasy
import com.cerner.beadledom.resteasy.fauxservice.health.ImportantThingHealthDependency
import com.cerner.beadledom.testing.JsonErrorMatchers.beBadRequestError
import com.cerner.beadledom.testing.JsonMatchers.equalJson
import com.google.common.base.Charsets
import java.io.File
impo... | bbaugher/beadledom | resteasy/src/test/scala/com/cerner/beadledom/resteasy/ResteasyServiceSpec.scala | Scala | apache-2.0 | 23,097 |
package com.yetu.play.authenticator.models.services
import com.mohiva.play.silhouette.api.services.IdentityService
import com.mohiva.play.silhouette.impl.providers.CommonSocialProfile
import com.yetu.play.authenticator.models.{YetuSocialProfile, User}
import scala.concurrent.Future
/**
* Handles actions to users.
... | yetu/yetu-play-authenticator | app/com/yetu/play/authenticator/models/services/UserService.scala | Scala | apache-2.0 | 846 |
import fpinscala.datastructures._
import org.scalatest._
import org.scalatest.prop._
import org.scalacheck._
class ListSpec extends FlatSpec with Matchers with PropertyChecks {
"A List's tail" should "have produce Nil when invoked with Nil" in {
assert(List.tail(Nil) === Nil)
}
it should "have produce List... | enpassant/fpinscala | exercises/src/test/scala/fpinscala/datastructures/ListSpec.scala | Scala | mit | 4,027 |
trait B; trait C; trait D
val b: (B => C) with D = null
/*start*/b/*end*/
//(B => C) with D | triplequote/intellij-scala | scala/scala-impl/testdata/typeInference/bugs5/SCL7604.scala | Scala | apache-2.0 | 93 |
package skinny.controller.feature
import skinny.micro.SkinnyMicroBase
import skinny.micro.contrib.CSRFTokenSupport
import skinny.logging.LoggerProvider
object CSRFProtectionFeature {
// follows Rails default
val DEFAULT_KEY: String = "csrf-token"
}
/**
* Provides Cross-Site Request Forgery (CSRF) protection.
... | Kuchitama/skinny-framework | framework/src/main/scala/skinny/controller/feature/CSRFProtectionFeature.scala | Scala | mit | 3,145 |
/*
* 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 ... | Intel-bigdata/CRF-Spark | src/main/scala/com/intel/ssg/bdt/nlp/Data.scala | Scala | apache-2.0 | 4,709 |
/*
* 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 ... | spark0001/spark2.1.1 | yarn/src/test/scala/org/apache/spark/deploy/yarn/YarnSparkHadoopUtilSuite.scala | Scala | apache-2.0 | 7,711 |
/*
* Copyright (C) 2009-2018 Lightbend Inc. <https://www.lightbend.com>
*/
package play.api.routing.sird
import org.specs2.mutable.Specification
import play.core.test.FakeRequest
class DslSpec extends Specification {
"Play routing DSL" should {
"support extracting GET requests" in {
"match" in {
... | Shenker93/playframework | framework/src/play/src/test/scala/play/api/routing/sird/DslSpec.scala | Scala | apache-2.0 | 4,252 |
/*
* 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 ... | yelshater/hadoop-2.3.0 | spark-core_2.10-1.0.0-cdh5.1.0/src/main/scala/org/apache/spark/executor/ExecutorUncaughtExceptionHandler.scala | Scala | apache-2.0 | 2,081 |
package at.logic.gapt.proofs.lk
import at.logic.gapt.expr.{ Formula, Polarity }
import at.logic.gapt.proofs.SequentConnector
object weakeningOnlySubTree {
/**
* Checks if the a proof consists only of an initial sequent and weakening inferences.
*
* @param proof An LK-proof.
* @return true if the proof c... | gebner/gapt | core/src/main/scala/at/logic/gapt/proofs/lk/PushWeakeningsToLeaves.scala | Scala | gpl-3.0 | 8,902 |
package im.actor.server.push.apple
import com.github.kxbmap.configs.syntax._
import com.typesafe.config.Config
import scala.collection.JavaConversions._
final case class ApplePushConfig(certs: List[ApnsCert])
object ApplePushConfig {
def load(config: Config): ApplePushConfig =
ApplePushConfig(
certs = c... | EaglesoftZJ/actor-platform | actor-server/actor-core/src/main/scala/im/actor/server/push/apple/ApplePushConfig.scala | Scala | agpl-3.0 | 950 |
package mesosphere.marathon.core.task.update.impl.steps
import mesosphere.marathon.core.task.Task
import mesosphere.marathon.core.task.tracker.TaskUpdater
import mesosphere.marathon.state.{ PathId, Timestamp }
import mesosphere.marathon.test.Mockito
import mesosphere.marathon.{ MarathonSchedulerDriverHolder, MarathonT... | pgkelley4/marathon | src/test/scala/mesosphere/marathon/core/task/update/impl/steps/UpdateTaskTrackerStepImplTest.scala | Scala | apache-2.0 | 3,702 |
package filodb.cassandra
import java.util.concurrent.ThreadLocalRandom
import scala.concurrent.{ExecutionContext, Future}
import scala.concurrent.duration._
import scala.util.Try
import com.datastax.driver.core._
import com.datastax.driver.core.exceptions.{ConnectionException, NoHostAvailableException, QueryExecutio... | tuplejump/FiloDB | cassandra/src/main/scala/filodb.cassandra/FiloCassandraConnector.scala | Scala | apache-2.0 | 3,184 |
package loco
import molt.syntax.cfg.parsable._
import molt.syntax.cfg._
import CFGParserHelpers._
object ExtensibleLambdaParsing {
import ExtensibleLambda._
object VarCategory extends RegexLexicalCategory("[a-z][a-zA-Z0-9]*")
object IntCategory extends RegexLexicalCategory("[0-9]+")
def makeExpParser(g: Glo... | julianmichael/loco | src/main/scala/loco/ExtensibleLambdaParsing.scala | Scala | mit | 11,122 |
package com.rossabaker
package benchmarks
import org.openjdk.jmh.annotations._
@State(Scope.Thread)
@Fork(2)
@Measurement(iterations = 10)
@Warmup(iterations = 10)
@Threads(1)
class Sum extends BenchmarkUtils {
@Param(Array("10000"))
var size: Int = _
@Benchmark
def fs2Iterate: Long = {
import _root_.fs2... | rossabaker/benchmarks | src/main/scala/Sum.scala | Scala | apache-2.0 | 4,158 |
/*
* 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 ... | brad-kaiser/spark | resource-managers/kubernetes/core/src/test/scala/org/apache/spark/deploy/k8s/submit/steps/DriverServiceBootstrapStepSuite.scala | Scala | apache-2.0 | 7,939 |
package spire
package math
import spire.algebra.Order
/**
* Interface for a sorting strategy object.
*/
trait Sort extends Any {
def sort[@sp A: Order: ClassTag](data:Array[A]): Unit
}
/**
* Simple implementation of insertion sort.
*
* Works for small arrays but due to O(n^2) complexity is not generally goo... | tixxit/spire | core/shared/src/main/scala/spire/math/Sorting.scala | Scala | mit | 4,868 |
/***********************************************************************
* Copyright (c) 2013-2019 Commonwealth Computer Research, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and... | elahrvivaz/geomesa | geomesa-utils/src/main/scala/org/locationtech/geomesa/utils/geohash/RadialGeoHashIterator.scala | Scala | apache-2.0 | 2,512 |
package com.github.mdr.graphospasm.grapheditor.model.commands
import com.github.mdr.graphospasm.grapheditor.utils.Utils._
import com.github.mdr.graphospasm.grapheditor.model._
import com.github.mdr.graphospasm.core.graph._
import org.eclipse.gef.commands.Command
import org.eclipse.draw2d.geometry.Rectangle
import org.... | mdr/graphospasm | com.github.mdr.graphospasm.grapheditor/src/main/scala/com/github/mdr/graphospasm/grapheditor/model/commands/SetAttributeValueCommand.scala | Scala | mit | 999 |
package tryp
import reflect.macros.whitebox.Context
import annotation.StaticAnnotation
class ModelTreeAnnotation(val c: Context)
extends Annotation
{
import c.universe._
implicit object TreeLiftable
extends Liftable[RoseTree[ModelTreeNode]]
{
def apply(tree: RoseTree[ModelTreeNode]) = {
val cls = t... | tek/pulsar | unit/macros/src/annotation.scala | Scala | mit | 1,024 |
/*
* Copyright 2016 OSBI Ltd
*
* 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 writ... | OSBI/meteorite-core | api/src/main/scala/bi/meteorite/core/api/security/exceptions/MeteoriteSecurityException.scala | Scala | apache-2.0 | 805 |
package monocle.bench
import java.util.concurrent.TimeUnit
import monocle.bench.BenchModel._
import monocle.bench.input.Nested0Input
import org.openjdk.jmh.annotations._
// format: off
@BenchmarkMode(Array(Mode.AverageTime))
@OutputTimeUnit(TimeUnit.MICROSECONDS)
@State(Scope.Benchmark)
class StdLensBench extends Le... | julien-truffaut/Monocle | bench/src/main/scala/monocle/bench/StdLensBench.scala | Scala | mit | 2,167 |
package com.twitter.scrooge.java_generator
import com.github.mustachejava.{DefaultMustacheFactory, Mustache}
import com.twitter.mustache.ScalaObjectHandler
import com.twitter.scrooge.ast.{EnumType, ListType, MapType, ReferenceType, SetType, StructType, _}
import com.twitter.scrooge.backend.{GeneratorFactory, ServiceOp... | travisbrown/scrooge | scrooge-generator/src/main/scala/com/twitter/scrooge/java_generator/ApacheJavaGenerator.scala | Scala | apache-2.0 | 8,637 |
/*
* Copyright 2001-2011 Artima, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agre... | yyuu/scalatest | src/test/scala/org/scalatest/prop/PropertyCheckFailedExceptionSuite.scala | Scala | apache-2.0 | 1,477 |
package gitbucket.core.model
abstract sealed case class WebHookContentType(code: String, ctype: String)
object WebHookContentType {
object JSON extends WebHookContentType("json", "application/json")
object FORM extends WebHookContentType("form", "application/x-www-form-urlencoded")
val values: Vector[WebHookCo... | McFoggy/gitbucket | src/main/scala/gitbucket/core/model/WebHook.scala | Scala | apache-2.0 | 2,330 |
/*
* Monkeyman static web site generator
* Copyright (C) 2013 Wilfred Springer
*
* This program 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 2
* of the License, or (at your option) an... | wspringer/monkeyman | src/main/scala/nl/flotsam/monkeyman/decorator/ResourceDecoration.scala | Scala | gpl-2.0 | 1,398 |
package a
{
package b
{
object A
{
private[a] def x = 3
}
}
} | jaceklaskowski/sbt | sbt/src/sbt-test/source-dependencies/qualified-access/A.scala | Scala | bsd-3-clause | 73 |
package com.ezoky.ezmodel.interaction.dsl
import com.ezoky.ezmodel.core.Models._
/**
* @author gweinbach on 24/02/2021
* @since 0.2.0
*/
trait NaturalIdDSL {
implicit val ModelDSLNaturalId: NaturalId[Model] =
NaturalId.define(_.name)
implicit val DomainDSLNaturalId: NaturalId[Domain] =
NaturalId.d... | ezoky/ezmodel | ezmodel-interaction/src/main/scala/com/ezoky/ezmodel/interaction/dsl/NaturalIdDSL.scala | Scala | gpl-2.0 | 3,977 |
package dsentric
object RawObject {
val empty: Map[String, Raw] = Map.empty
}
object RawArray {
val empty: Vector[Raw] = Vector.empty
}
| HigherState/dsentric | core/src/main/scala/dsentric/RawObject.scala | Scala | apache-2.0 | 142 |
package pl.touk.nussknacker.engine.avro.encode
import cats.data.NonEmptyList._
import cats.data.Validated.{Invalid, Valid, condNel}
import cats.data.{Validated, ValidatedNel}
import cats.implicits._
import org.apache.avro.SchemaCompatibility.SchemaCompatibilityType
import org.apache.avro.{Schema, SchemaCompatibility}
... | TouK/nussknacker | utils/avro-components-utils/src/main/scala/pl/touk/nussknacker/engine/avro/encode/OutputValidator.scala | Scala | apache-2.0 | 4,634 |
package scala.pickling
package pickler
import java.math.BigInteger
/** This contains implicits which can serialize java.math.BigInteger values. */
trait JavaBigIntegerPicklers extends PrimitivePicklers {
// TODO(jsuereth) - Register runtime picklers
implicit val javaBigIntegerPickler:
Pickler[BigInteger] wit... | beni55/pickling | core/src/main/scala/scala/pickling/pickler/JavaBigInteger.scala | Scala | bsd-3-clause | 1,237 |
package akka
package object io {
def printToFile(f: java.io.File)(op: java.io.PrintWriter => Unit) {
val p = new java.io.PrintWriter(f)
try { op(p) } finally { p.close() }
}
}
| drexin/akka-io-file | src/test/scala/akka/io/package.scala | Scala | apache-2.0 | 189 |
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.