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 x7c1.wheat.macros.database
import android.content.ContentValues
import android.database.Cursor
import scala.language.dynamics
import scala.language.experimental.macros
import scala.reflect.macros.blackbox
object TypedCursor {
def apply[A <: TypedFields]
(cursor: Cursor): A with TypedCursor[A] = macro T... | x7c1/Linen | wheat-macros/src/main/scala/x7c1/wheat/macros/database/TypedCursor.scala | Scala | mit | 4,117 |
package im.actor.server.api.rpc.service.groups
import java.time.Instant
import akka.actor.ActorSystem
import akka.http.scaladsl.util.FastFuture
import cats.data.Xor
import com.github.ghik.silencer.silent
import im.actor.api.rpc.PeerHelpers._
import im.actor.api.rpc._
import im.actor.api.rpc.files.ApiFileLocation
impo... | EaglesoftZJ/actor-platform | actor-server/actor-rpc-api/src/main/scala/im/actor/server/api/rpc/service/groups/GroupsServiceImpl.scala | Scala | agpl-3.0 | 26,627 |
/*
* 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/batch-updater | src/main/scala/uk/gov/hmrc/batchupdater/BatchUpdateResult.scala | Scala | apache-2.0 | 2,260 |
package com.kodekutters
import scala.util.control.Breaks._
import play.api.libs.functional.syntax._
import play.api.libs.json.Reads._
import play.api.libs.json.Writes._
import play.api.libs.json.{JsValue, _}
import play.api.libs.json._
import scala.language.implicitConversions
import scala.language.postfixOps
// tod... | workingDog/weblvcScala | src/main/scala/com/kodekutters/FilterSupport.scala | Scala | apache-2.0 | 16,238 |
package app.components.semanticui
import japgolly.scalajs.react
import japgolly.scalajs.react.vdom.VdomNode
import japgolly.scalajs.react.{Callback, Children}
import scala.scalajs.js
import japgolly.scalajs.react.vdom.html_<^._
object Confirm {
val component = react.JsComponent[js.Object, Children.Varargs, Null](S... | Igorocky/lesn | client/src/main/scala/app/components/semanticui/Confirm.scala | Scala | mit | 1,167 |
package com.github.j5ik2o.reactive.redis.command.strings
final case class StartAndEnd(start: Int, end: Int)
| j5ik2o/reactive-redis | core/src/main/scala/com/github/j5ik2o/reactive/redis/command/strings/StartAndEnd.scala | Scala | mit | 109 |
package org.bowlerframework.view.scalate
import org.bowlerframework.controller.Controller
/**
* Created by IntelliJ IDEA.
* User: wfaler
* Date: 20/04/2011
* Time: 23:46
* To change this template use File | Settings | File Templates.
*/
trait LayoutScope{ this: Controller => {
}
//activeLayout(activeLayout... | rkpandey/Bowler | core/src/main/scala/org/bowlerframework/view/scalate/LayoutScope.scala | Scala | bsd-3-clause | 324 |
package scala.meta
package internal
package prettyprinters
import scala.meta.prettyprinters._
import Show.{ sequence => s }
import scala.meta.tokens._
object TokenStructure {
def apply[T <: Token]: Structure[T] = {
Structure(x => {
implicit val dialect = x.dialect
val prefix = (x: Token) match {
... | MasseGuillaume/scalameta | scalameta/tokens/shared/src/main/scala/scala/meta/internal/prettyprinters/TokenStructure.scala | Scala | bsd-3-clause | 678 |
/*
* 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... | chipsenkbeil/incubator-toree | communication/src/main/scala/org/apache/toree/communication/security/Hmac.scala | Scala | apache-2.0 | 2,158 |
/*
* Copyright 2018 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/worldpay-downloader | test/unit/controllers/EmisReportServiceSpec.scala | Scala | apache-2.0 | 3,573 |
/*
* Copyright (C) 2017 Radicalbit
*
* This file is part of flink-JPMML
*
* flink-JPMML 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) an... | maocorte/flink-jpmml | flink-jpmml-scala/src/main/scala/io/radicalbit/flink/pmml/scala/api/exceptions/package.scala | Scala | agpl-3.0 | 1,962 |
/*
* 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 ... | mike0sv/spark | mllib/src/main/scala/org/apache/spark/ml/evaluation/BinaryClassificationEvaluator.scala | Scala | apache-2.0 | 4,191 |
//
// Hamming.scala -- Scala benchmark Hamming sequence
// Project OrcTests
//
// Copyright (c) 2018 The University of Texas at Austin. All rights reserved.
//
// Use and redistribution of this file is governed by the license terms in
// the LICENSE file found in the project's top-level directory and also found at
// U... | orc-lang/orc | OrcTests/src/orc/test/item/scalabenchmarks/Hamming.scala | Scala | bsd-3-clause | 3,082 |
package org.jetbrains.plugins.scala.lang.refactoring.introduceVariable
import com.intellij.openapi.editor.Editor
import com.intellij.openapi.module.Module
import com.intellij.openapi.project.Project
import com.intellij.openapi.util.text.StringUtil
import com.intellij.psi._
import com.intellij.psi.search.{GlobalSearchS... | whorbowicz/intellij-scala | src/org/jetbrains/plugins/scala/lang/refactoring/introduceVariable/ScopeSuggester.scala | Scala | apache-2.0 | 15,140 |
/*
* Copyright 2021 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | hmrc/gmp-frontend | test/config/ApplicationConfigSpec.scala | Scala | apache-2.0 | 1,026 |
package com.stackmob.customcode.dev
package test
package server
package sdk
package data
package dataservice
import org.specs2.Specification
import org.specs2.mock.Mockito
import scala.util.Try
import com.stackmob.customcode.dev.server.sdk.data.smValue
import com.stackmob.core.DatastoreException
private[dataservice] ... | matthewfarwell/stackmob-customcode-dev | src/test/scala/com/stackmob/customcode/dev/test/server/sdk/data/dataservice/DeleteObject.scala | Scala | apache-2.0 | 996 |
package gsn.config
import org.scalatest._
class VsConfigTest extends FunSpec with Matchers {
describe("gps vs config"){
val vs=VsConf.load("src/test/resources/conf/vs/gps.xml")
it("should read params"){
vs.name shouldBe "GPSVS"
vs.description should startWith ("Virtual sensor producing rand... | EliasFarhan/gsn | gsn-tools/src/test/scala/gsn/config/VsConfigTest.scala | Scala | gpl-3.0 | 1,409 |
package com.singlestore.spark
import java.sql.SQLTransientConnectionException
import com.github.mrpowers.spark.daria.sql.SparkSessionExt._
import org.apache.spark.sql.SaveMode
import org.apache.spark.sql.types.{DecimalType, IntegerType, StringType}
import org.scalatest.{BeforeAndAfterAll, BeforeAndAfterEach}
import ... | memsql/memsql-spark-connector | src/test/scala/com/singlestore/spark/MaxErrorsTest.scala | Scala | apache-2.0 | 2,478 |
/* - Coeus web framework -------------------------
*
* Licensed under the Apache License, Version 2.0.
*
* Author: Spiros Tzavellas
*/
package com.tzavellas.coeus.validation.vspec.constraint
import com.tzavellas.coeus.bind.Error
import java.util.Calendar
trait CalendarConstraints {
def isBefore(cal: Calenda... | sptz45/coeus | src/main/scala/com/tzavellas/coeus/validation/vspec/constraint/CalendarConstraints.scala | Scala | apache-2.0 | 1,513 |
package com.twitter.finatra.http.integration.tweetexample.main.controllers
import com.twitter.concurrent.exp.AsyncStream
import com.twitter.finagle.http.{Request, Response}
import com.twitter.finatra.http.Controller
import com.twitter.finatra.http.integration.tweetexample.main.domain.Tweet
import com.twitter.finatra.h... | nkhuyu/finatra | http/src/test/scala/com/twitter/finatra/http/integration/tweetexample/main/controllers/TweetsController.scala | Scala | apache-2.0 | 1,712 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | WindCanDie/spark | external/kinesis-asl/src/main/scala/org/apache/spark/streaming/kinesis/KinesisReceiver.scala | Scala | apache-2.0 | 15,987 |
/*
* Skylark
* http://skylark.io
*
* Copyright 2012-2017 Quantarray, 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
*
* Unl... | quantarray/skylark | skylark-measure/src/test/scala/com/quantarray/skylark/measure/AnyMeasureParsersSpec.scala | Scala | apache-2.0 | 1,604 |
package uk.gov.gds.ier.model
case class PostcodeAnywhereResponse(Items:List[Map[String,String]])
| michaeldfallen/ier-frontend | app/uk/gov/gds/ier/model/PostcodeAnywhereResponse.scala | Scala | mit | 98 |
package org.thinkmeta.smp.core
import language.experimental.macros
import reflect.macros.Context
/**
* @author Hossam Karim
*/
object HostedLisp {
trait Target
case object TermTreesTarget extends Target
case object TypeTreesTarget extends Target
case object CasesTarget extends Target
case object PatternT... | hkarim/macros-playground | core/src/main/scala/org/thinkmeta/smp/core/HostedLisp.scala | Scala | apache-2.0 | 11,812 |
/*
* Copyright 2012-2019 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
*
* Unl... | Comcast/sirius | src/test/scala/com/comcast/xfinity/sirius/uberstore/data/BufferedFileReadHandleTest.scala | Scala | apache-2.0 | 5,312 |
package org.revenj.patterns
import scala.io.Source
import scala.reflect.ClassTag
import scala.xml.Elem
import scala.xml.parsing.ConstructingParser
import org.joda.time.DateTime
import org.joda.time.LocalDate
import org.joda.time.format.DateTimeFormat
import com.fasterxml.jackson.core.JsonGenerator
import com.fasterx... | tferega/revenj | scala/Core/src/main/scala/org/revenj/patterns/JsonSerialization.scala | Scala | bsd-3-clause | 4,679 |
/*
* This file is a part of the "sur la plaque" toolkit for cycling
* data analytics and visualization.
*
* Copyright (c) 2013--2014 William C. Benton and Red Hat, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You m... | willb/sur-la-plaque | analysis/src/main/scala/com/freevariable/surlaplaque/app/power_bests.scala | Scala | apache-2.0 | 9,499 |
package com.twitter.finagle.netty3
import com.twitter.finagle.benchmark.StdBenchAnnotations
import com.twitter.io.Buf
import java.nio
import org.jboss.netty.buffer.ChannelBuffers
import org.openjdk.jmh.annotations._
import org.openjdk.jmh.infra.Blackhole
@State(Scope.Benchmark)
class ChannelBufferBufBenchmark extends... | sveinnfannar/finagle | finagle-benchmark/src/main/scala/com/twitter/finagle/netty3/ChannelBufferBufBenchmark.scala | Scala | apache-2.0 | 1,756 |
/*
* Copyright 2014-2021 Netflix, 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... | brharrington/atlas | atlas-core/src/test/scala/com/netflix/atlas/core/model/InWordSuite.scala | Scala | apache-2.0 | 1,304 |
/*
* Copyright (c) 2014-2015 by its authors. Some rights reserved.
* See the project homepage at: http://www.monifu.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://... | virtualirfan/monifu | monifu/shared/src/main/scala/monifu/reactive/internals/operators/misc.scala | Scala | apache-2.0 | 3,751 |
package cl.asa.init
/**
* ASAใงไฝฟ็จใใ่พๆธใๆๅฎใใใฏใฉใน
* ไปใฏใใใซ็ดๆธใใ ใ๏ผใใๆนๆณใใใใฐๅคๆดใใใ
*/
class YamlFile {
//val frame: String = "yaml/new_frames2.yaml"
//val dicframe: String = "yaml/new_frames2.dic"
val frame: String = "yaml/new_argframes.yaml"
val dicframe: String = "yaml/new_argframes.dic"
val cchart: String = "ya... | Takeuchi-Lab-LM/scala_asa3 | ASA/src/main/scala/cl/asa/init/YamlFile.scala | Scala | mit | 1,175 |
package scala.pickling.binary
import scala.pickling._
import scala.pickling.internal._
import scala.language.implicitConversions
import scala.reflect.runtime.universe.Mirror
import java.io.InputStream
import java.nio.ByteBuffer
abstract class BinaryPickle extends Pickle {
type PickleFormatType = BinaryPickleFormat... | phaller/pickling | core/src/main/scala/scala/pickling/binary/BinaryPickle.scala | Scala | bsd-3-clause | 8,250 |
package com.lambtors.poker_api.module.poker.application.table.find
import cats.implicits._
import com.lambtors.poker_api.module.poker.domain.PokerGameRepository
import com.lambtors.poker_api.module.poker.domain.error.PokerGameNotFound
import com.lambtors.poker_api.module.poker.domain.model.{GameId, TableCardsResponse}... | lambtors/poker-api | src/main/scala/com/lambtors/poker_api/module/poker/application/table/find/TableCardsFinder.scala | Scala | mit | 778 |
package im.actor.api.rpc
import im.actor.api.rpc.peers.{ ApiGroupOutPeer, ApiOutPeer, ApiPeer, ApiPeerType }
import im.actor.server.model.{ Peer, PeerType }
trait PeersImplicits {
implicit class ExtPeer(peer: ApiPeer) {
lazy val asModel: Peer =
Peer(PeerType.fromValue(peer.`type`.id), peer.id)
}
imp... | EaglesoftZJ/actor-platform | actor-server/actor-core/src/main/scala/im/actor/api/rpc/PeersImplicits.scala | Scala | agpl-3.0 | 1,261 |
// see http://www.ittc.ku.edu/~andygill/papers/reifyGraph.pdf
// and https://hackage.haskell.org/package/data-reify
package leibniz
import cats.Applicative
import cats.syntax.all._
| alexknvl/leibniz | src/test/scala/MuRef.scala | Scala | mit | 184 |
/*
* Copyright (C) 2016-2019 Lightbend Inc. <https://www.lightbend.com>
*/
package com.lightbend.lagom.dev
import scala.collection.immutable
object PortAssigner {
private[lagom] case class ProjectName(name: String) {
def withTls = ProjectName(name + "-tls")
}
private[lagom] object ProjectName {
impl... | rcavalcanti/lagom | dev/build-tool-support/src/main/scala/com/lightbend/lagom/dev/PortAssigner.scala | Scala | apache-2.0 | 3,788 |
package org.scaladebugger.api.pipelines
import org.scaladebugger.test.helpers.ParallelMockFunSpec
class FilterOperationSpec extends ParallelMockFunSpec {
describe("FilterOperation") {
describe("#process") {
it("should filter data to include only predicates resolving to true") {
val expected = Seq(... | ensime/scala-debugger | scala-debugger-api/src/test/scala/org/scaladebugger/api/pipelines/FilterOperationSpec.scala | Scala | apache-2.0 | 528 |
/*
* Copyright 2017 Datamountaineer.
*
* 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... | datamountaineer/stream-reactor | kafka-connect-elastic6/src/main/scala/com/datamountaineer/streamreactor/connect/elastic6/ElasticWriter.scala | Scala | apache-2.0 | 1,973 |
// Copyright: 2010 - 2017 https://github.com/ensime/ensime-server/graphs
// License: http://www.apache.org/licenses/LICENSE-2.0
package org.ensime.api
import java.io.File
trait EnsimeTestData {
// duplicating utils to minimise dependencies
private def canon(s: String): RawFile = {
val file = new File(s)
v... | pascr/ensime-server | api/src/test/scala/org/ensime/api/EnsimeTestData.scala | Scala | gpl-3.0 | 5,432 |
package fpinscala.exercises
import fpinscala.exercises.Exercise4.uncurry
/**
* See [[fpinscala.gettingstarted.MyModule]]
*/
object Exercise4 {
// Exercise 4: Implement `uncurry`
def uncurry[A, B, C](f: A => B => C): (A, B) => C = {
(a, b) => f(a)(b)
}
/*
NB: There is a method on the `Function` obj... | tobyweston/fpinscala | exercises/src/main/scala/fpinscala/exercises/Exercise4.scala | Scala | mit | 907 |
package scala.macros.internal
package trees
import scala.macros.internal.prettyprinters.EOL
object Errors {
final val QuasiquotesRequireCompilerSupport =
"new-style quasiquotes require " +
"""addCompilerPlugin("org.scalamacros" %% "scalac-plugin" % "..." cross CrossVersion.full);""" +
" consult http... | xeno-by/scalamacros | core/src/main/scala/scala/macros/internal/trees/Errors.scala | Scala | bsd-3-clause | 1,305 |
/*
* Copyright (c) 2012-2016 Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
* You may obtain a copy of the Apache License Version 2.0 at http://www.apach... | sspinc/snowplow | 3-enrich/scala-common-enrich/src/main/scala/com.snowplowanalytics.snowplow.enrich/common/utils/HttpClient.scala | Scala | apache-2.0 | 1,981 |
package org.jetbrains.plugins.scala.codeInspection.monads
import com.intellij.codeInspection.ProblemsHolder
import com.intellij.psi.PsiElement
import org.jetbrains.plugins.scala.codeInspection.AbstractInspection
import org.jetbrains.plugins.scala.codeInspection.monads.NestedStatefulMonadsInspection._
import org.jetbra... | ilinum/intellij-scala | src/org/jetbrains/plugins/scala/codeInspection/monads/NestedStatefulMonadsInspection.scala | Scala | apache-2.0 | 1,214 |
package kiambogo.scrava.models
/**
* Created by christopher on 14-10-23.
*/
case class Photo(
id: Int,
activity_id: Int,
resource_state: Int,
ref: String,
uid: String,
caption: String,
`type`: String,
uploaded_at: String,
created_at: String,
location: Option[List[Float]]) | kiambogo/scrava | src/main/scala/kiambogo/scrava/models/Photo.scala | Scala | mit | 275 |
package mesosphere.marathon.io.storage
import java.io._
import mesosphere.marathon.io.IO
/**
* The local file system implementation.
*
* @param file the underlying file
* @param path the relative path, this item is identified with.
*/
case class FileStorageItem(file: File, basePath: File, path: String, bas... | EasonYi/marathon | src/main/scala/mesosphere/marathon/io/storage/FileStorageProvider.scala | Scala | apache-2.0 | 1,834 |
package de.htwg.zeta.persistence.fixtures
import java.util.UUID
import de.htwg.zeta.common.models.entity.EventDrivenTask
object EventDrivenTaskFixtures {
val entity1 = EventDrivenTask(
id = UUID.randomUUID,
name = "eventDrivenTask1",
generatorId = UUID.randomUUID,
filterId = UUID.randomUUID,
... | Zeta-Project/zeta | api/persistence/src/test/scala/de/htwg/zeta/persistence/fixtures/EventDrivenTaskFixtures.scala | Scala | bsd-2-clause | 792 |
package blended.testsupport
import java.util.concurrent.atomic.AtomicInteger
import akka.actor.ActorSystem
import akka.testkit.TestKit
import scala.concurrent.duration._
import scala.concurrent.Await
object TestActorSys {
val uniqueId = new AtomicInteger(0)
def apply(f : TestKit => Unit) = new TestActorSys("Te... | lefou/blended | blended.testsupport/src/main/scala/blended/testsupport/TestActorSys.scala | Scala | apache-2.0 | 680 |
/*
* BaseMacros.scala
*
* Copyright (c) 2013 Lonnie Pryor III
*
* 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... | lpryor/fulcrum-spike | code/src/test/scala/fulcrum/code/BaseMacros.scala | Scala | apache-2.0 | 8,997 |
/* ___ _ ___ _ _ *\\
** / __| |/ (_) | | The SKilL Generator **
** \\__ \\ ' <| | | |__ (c) 2013 University of Stuttgart **
** |___/_|\\_\\_|_|____| see LICENSE ... | XyzNobody/skill | src/main/scala/de/ust/skill/generator/scala/internal/FieldDeclarationMaker.scala | Scala | bsd-3-clause | 2,774 |
/*
* 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/deploy/master/PersistenceEngineSuite.scala | Scala | apache-2.0 | 4,969 |
/*
* 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/ExternalShuffleServiceSuite.scala | Scala | apache-2.0 | 3,778 |
/*
* Copyright 2016 by Simba Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agree... | InitialDLab/Simba | src/main/scala/org/apache/spark/sql/simba/execution/join/RKJSpark.scala | Scala | apache-2.0 | 5,952 |
package types
/**
* Generic types example
*
*/
class LinkedList[A] {
private class Node[A](elem: A) {
var next: Node[A] = _
override def toString = elem.toString
}
private var head: Node[A] = _
def add(elem: A) {
val n = new Node(elem)
n.next = head
head = n
}
private def pr... | rafaelkyrdan/cookbook | src/main/scala/types/LinkedList.scala | Scala | mit | 708 |
/*
* Copyright 2017-2018 Iaroslav Zeigerman
*
* 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 ... | akkeeper-project/akkeeper | akkeeper/src/main/scala/akkeeper/storage/zookeeper/async/AsyncZookeeperClient.scala | Scala | apache-2.0 | 4,419 |
package uk.co.odinconsultants.bitcoin.hbase
import org.apache.hadoop.hbase.client.{Put, Table}
import org.apache.hadoop.hbase.util.Bytes.toBytes
import uk.co.odinconsultants.bitcoin.core.Logging
import uk.co.odinconsultants.bitcoin.hbase.HBaseSetup.qualifier
import uk.co.odinconsultants.bitcoin.parsing.MetaStore.Batch... | PhillHenry/Cryptorigin | bitcoin/src/main/scala/uk/co/odinconsultants/bitcoin/hbase/HBaseMetaStore.scala | Scala | gpl-2.0 | 969 |
package orc.android
import android.app.Activity
import android.os.Bundle
import android.widget.Button
import android.view.View
import android.widget.Toast
import android.util.Log
import android.widget.TextView
import android.os.AsyncTask
import android.os.Handler
import android.app.AlertDialog
import android.widget.Ed... | orc-lang/orc | OrcAndroid/src/orc/android/RunActivity.scala | Scala | bsd-3-clause | 11,489 |
/*
* The MIT License (MIT)
*
* Copyright (c) 2016 Ian McIntosh
*
* 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,... | cranst0n/f3 | modules/web/src/main/scala/f3/web/action.scala | Scala | mit | 1,493 |
/*
Copyright (c) 2016, Elliot Stirling
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and th... | Trugath/Evolve | src/main/scala/evolve/example/FourBitFullAdderNAND.scala | Scala | bsd-3-clause | 7,686 |
/*
* 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 ... | aokolnychyi/spark | graphx/src/main/scala/org/apache/spark/graphx/util/GraphGenerators.scala | Scala | apache-2.0 | 10,153 |
/**
* 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... | akosiaris/kafka | core/src/main/scala/kafka/server/KafkaRequestHandler.scala | Scala | apache-2.0 | 3,559 |
package sbt
package std
import reflect.macros._
import Def.Initialize
import sbt.internal.util.complete.Parser
import sbt.internal.util.appmacro.{ Convert, Converted }
object InputInitConvert extends Convert {
def apply[T: c.WeakTypeTag](c: blackbox.Context)(nme: String, in: c.Tree): Converted[c.type] =
nme ma... | Duhemm/sbt | main-settings/src/main/scala/sbt/std/InputConvert.scala | Scala | bsd-3-clause | 3,478 |
type Empty[X] = EmptyTuple
type Twice[X] = (X, X)
def test =
val a1: EmptyTuple = ??? : Tuple.Fold[EmptyTuple, Nothing, Tuple2]
val a2: (Int, (String, Nothing)) = ??? : Tuple.Fold[(Int, String), Nothing, Tuple2]
val a3: Int | String | Char = ??? : Tuple.Fold[(Int, String, Char), Nothing, [X, Y] =>> X | Y]
| dotty-staging/dotty | tests/pos/tuple-fold.scala | Scala | apache-2.0 | 315 |
package org.singingwizard.auto2up
import org.rogach.scallop._
import org.apache.pdfbox.pdmodel._
import java.io.File
import resource._
import org.apache.pdfbox.pdmodel.common.PDRectangle
import org.apache.pdfbox.multipdf.LayerUtility
import org.apache.pdfbox.util.Matrix
import org.apache.pdfbox.pdmodel.graphics.image.... | arthurp/auto2up | src/main/scala/org/singingwizard/auto2up/Main.scala | Scala | gpl-3.0 | 12,026 |
package ru.biocad.ig.alicont.conts.affine
import ru.biocad.ig.alicont.algorithms.affine.GlobalAlignment
import ru.biocad.ig.alicont.conts.AffineAlicont
/**
* Created with IntelliJ IDEA.
* User: pavel
* Date: 27.11.13
* Time: 23:32
*/
class AlicontGlobal(maxheight : Int, query : String, gap_open : Double, gap_ext... | zmactep/igcat | lib/ig-alicont/src/main/scala/ru/biocad/ig/alicont/conts/affine/AlicontGlobal.scala | Scala | bsd-2-clause | 1,255 |
/*
* Copyright 2020 Spotify AB
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | spotify/scio | scio-redis/src/main/scala/com/spotify/scio/redis/instances/CoderInstances.scala | Scala | apache-2.0 | 4,025 |
package org.finra.datagenerator.scaffolding.messaging.config
import org.finra.datagenerator.scaffolding.messaging.response.Response
import org.finra.datagenerator.scaffolding.messaging.{MessageContext, Replies}
/**
* Created by dkopel on 8/22/16.
*/
/**
* Used to define the configuration of each intention.
* ... | FINRAOS/DataGenerator | rubber-scaffolding/rubber-commons/src/main/scala/org/finra/datagenerator/scaffolding/messaging/config/ResponseConfiguration.scala | Scala | apache-2.0 | 848 |
/*
* Scala (https://www.scala-lang.org)
*
* Copyright EPFL and Lightbend, Inc.
*
* Licensed under Apache License 2.0
* (http://www.apache.org/licenses/LICENSE-2.0).
*
* See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*/
// GENERATED CODE: DO NOT EDIT... | scala/scala | src/library/scala/Product2.scala | Scala | apache-2.0 | 1,573 |
package scrabble
import scala.util.{ Try, Success, Failure }
import scala.util.Failure
import scalaz.NonEmptyList
import org.specs2.matcher.MatchResult
class MoveTest extends ScrabbleTest {
def withGameAndPositions(game: Option[Game], placed: Option[NonEmptyList[(Pos, Tile)]])(
behaviour: ValidInputPlaceLetter... | Happy0/scalascrabble | src/test/scala/MoveTest.scala | Scala | gpl-2.0 | 12,399 |
/***********************************************************************
* 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 ... | tkunicki/geomesa | geomesa-utils/src/main/scala/org/locationtech/geomesa/utils/geohash/GeoHashIterator.scala | Scala | apache-2.0 | 9,856 |
package scommons.client.ui.select
import org.scalajs.dom.window
import scommons.react._
import scala.concurrent.Future
import scala.concurrent.duration._
import scala.scalajs.concurrent.JSExecutionContext.Implicits.queue
import scala.scalajs.js
import scala.util.{Failure, Success}
case class SearchSelectProps(select... | viktor-podzigun/scommons | ui/src/main/scala/scommons/client/ui/select/SearchSelect.scala | Scala | apache-2.0 | 2,601 |
package org.http4s
import cats.effect.IO
import fs2.Stream
import fs2.text.utf8Encode
import org.http4s.headers._
class ServerSentEventSpec extends Http4sSpec {
import ServerSentEvent._
def toStream(s: String): Stream[IO, Byte] =
Stream.emit(s).through(utf8Encode)
"decode" should {
"decode multi-line ... | ChristopherDavenport/http4s | tests/src/test/scala/org/http4s/ServerSentEventSpec.scala | Scala | apache-2.0 | 3,507 |
/*
* MIT License
*
* Copyright (c) 2016 Ramjet Anvil
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, mod... | RamjetAnvil/padrone | server/src/main/scala/com/ramjetanvil/cqrs/experimental/PartialHandlers.scala | Scala | mit | 2,953 |
/*
* Copyright (C) 2015 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... | openmole/openmole | openmole/plugins/org.openmole.plugin.environment.batch/src/main/scala/org/openmole/plugin/environment/batch/storage/StorageInterface.scala | Scala | agpl-3.0 | 3,374 |
package walfie.gbf.raidfinder
import twitter4j._
import walfie.gbf.raidfinder.domain._
import scala.util.Try
object StatusParser {
/** Regexes to match raid request tweets */
val RaidRegexJapanese = "((?s).*)ๅๅ ่
ๅ้๏ผๅๆฆID๏ผ([0-9A-F]+)\\n(.+)\\n?(.*)".r
val RaidRegexEnglish = "((?s).*)I need backup!Battle ID: ([0-9A... | gnawnoraa/GBF-Raider-Copy | stream/src/main/scala/walfie/gbf/raidfinder/StatusParser.scala | Scala | mit | 2,534 |
package ch.ninecode.model
import com.esotericsoftware.kryo.Kryo
import com.esotericsoftware.kryo.Serializer
import com.esotericsoftware.kryo.io.Input
import com.esotericsoftware.kryo.io.Output
import org.apache.spark.sql.Row
import ch.ninecode.cim.CIMClassInfo
import ch.ninecode.cim.CIMContext
import ch.ninecode.cim.... | derrickoswald/CIMScala | CIMReader/src/main/scala/ch/ninecode/model/Topology.scala | Scala | mit | 24,008 |
import org.apache.spark.ml.feature._
import org.apache.spark.sql.DataFrame
object FeatureBuilder {
def createVectors(
dataDFCompleted: DataFrame,
predictDFCompleted: DataFrame
): (StringIndexerModel, VectorAssembler, IndexToString, Seq[StringIndexerMod... | multivacplatform/multivac-kaggle-titanic | src/main/scala/FeatureBuilder.scala | Scala | mit | 1,925 |
package net.tomaserman.specus.node.plugin
import net.tomasherman.specus.common.api.plugin.definitions.PluginDefinitionLoader
import net.tomasherman.specus.common.api.plugin.{PluginEventManager, SimplePluginManager}
import net.tomasherman.specus.common.api.plugin.config.PluginConfig
import akka.actor.ActorRef
import ak... | tomasherman/specus | node/src/main/scala/plugin/NodePluginManager.scala | Scala | gpl-3.0 | 1,801 |
package uk.ac.ncl.openlab.intake24.services.fooddb.images
sealed trait ImageServiceError {
val e: Throwable
}
case class IOError(e: Throwable) extends ImageServiceError
case class FileTypeNotAllowed(e: Throwable) extends ImageServiceError
case class ImageStorageError(e: Throwable) extends ImageServiceError
case ... | digitalinteraction/intake24 | FoodDataServices/src/main/scala/uk/ac/ncl/openlab/intake24/services/fooddb/images/Errors.scala | Scala | apache-2.0 | 386 |
/*
Copyright 2013 Crossing-Tech
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... | Crossing-Tech/akka-osgi-sample | core/src/main/scala/akka/osgi/sample/activation/Activator.scala | Scala | apache-2.0 | 2,233 |
/*
* 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... | wzhongyuan/BigDL | spark/dl/src/main/scala/com/intel/analytics/bigdl/nn/Reshape.scala | Scala | apache-2.0 | 7,038 |
/*
* Copyright 2013 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... | tresata/storehaus | storehaus-algebra/src/test/scala/com/twitter/storehaus/algebra/BufferingStoreProperties.scala | Scala | apache-2.0 | 1,878 |
/*
* Copyright (C) 2009-2019 Lightbend Inc. <https://www.lightbend.com>
*/
// this is copy/pasted from https://github.com/akka/akka/blob/5576c233d063b3ee4cfc05d8e73c614a3dea478d/project/CrossJava.scalas
package akka
import java.io.File
import scala.annotation.tailrec
import scala.collection.immutable.ListMap
impo... | rcavalcanti/lagom | docs/project/CrossJava.scala | Scala | apache-2.0 | 7,356 |
package scala.collection.mutable;
import org.openjdk.jmh.annotations._
import org.openjdk.jmh.infra._
import org.openjdk.jmh.runner.IterationType
import org.openjdk.jol.info.GraphLayout
import benchmark._
import java.util.concurrent.TimeUnit
/** Utilities for the [[OpenHashMapBenchmark]].
*
* The method calls a... | felixmulder/scala | test/benchmarks/src/main/scala/scala/collection/mutable/OpenHashMapBenchmark.scala | Scala | bsd-3-clause | 9,862 |
import stainless.lang._
import stainless.annotation._
import scala.annotation.meta.field
import scala.collection.concurrent.TrieMap
object IgnoredField {
case class TrieMapWrapper[K, V](
@(ignore @field)
@(pure @field)
@extern
theMap: TrieMap[K, V]
) {
@extern
def contains(k: K): Boolea... | epfl-lara/stainless | frontends/benchmarks/verification/valid/MicroTests/IgnoredField.scala | Scala | apache-2.0 | 947 |
package net.stoerr.gappenginescalatemplate
import java.util.logging.Logger
import javax.servlet.http.{HttpServletResponse, HttpServletRequest, HttpServlet}
/**
* @author <a href="http://www.stoerr.net/">Hans-Peter Stoerr</a>
* @since 20.02.2015
*/
class HelloWorldServlet extends HttpServlet {
val logger = Logge... | stoerr/GoogleAppengineScalaTemplate | src/main/scala/net/stoerr/gappenginescalatemplate/HelloWorldServlet.scala | Scala | apache-2.0 | 848 |
package demo
package components
package materialui.svgicons
import chandu0101.scalajs.react.components.materialui.MuiSvgIcon
import japgolly.scalajs.react._
import japgolly.scalajs.react.vdom.prefix_<^._
object CommunicationCall {
val component = ReactComponentB[Unit]("CommunicationCall")
.render(P => {
... | tpdi/scalajs-react-components | demo/src/main/scala/demo/components/materialui/svgicons/CommunicationCall.scala | Scala | apache-2.0 | 677 |
package com.github.mlangc.experiments.refactoring
import org.scalameter.picklers.noPickler._
import org.scalameter.api._
import scala.tools.refactoring.util.SourceWithMarker.Movement
import scala.tools.refactoring.util.SourceWithMarker.Movements
import scala.tools.refactoring.util.SourceWithMarker
object SourceWithMa... | mlangc/scala-refactoring-experiments | src/test/scala/com/github/mlangc/experiments/refactoring/SourceWithMarkerBenchmark.scala | Scala | bsd-3-clause | 1,176 |
/*
`take` first checks if n==0. In that case we need not look at the stream at all.
*/
def take(n: Int): Stream[A] =
if (n > 0) this match {
case Cons(h, t) if n == 1 => cons(h(), Stream.empty) // we can say Stream.empty
case Cons(h, t) => cons(h(), t().take(n-1))
case _ => Stream.empty
}
else Stream... | fpinscala-muc/fpinscala-kdziubli | answerkey/laziness/02.answer.scala | Scala | mit | 729 |
package play.boilerplate.generators
import java.io.File.{separator, separatorChar}
import play.boilerplate.parser.model.Parameter
trait StringUtils {
def decapitalize(s: String): String = {
if (s == null) null
else if (s.length == 0) ""
else {
val chars = s.toCharArray
chars(0) = chars(0).... | Romastyi/sbt-play-boilerplate | sbt-plugin/lib/src/main/scala/play/boilerplate/generators/StringUtils.scala | Scala | apache-2.0 | 2,123 |
package controllers
import play.api._
import play.api.mvc._
import views._
case class Box (x:Int, y: Int)
class Application extends Controller {
def index = Action { implicit request =>
Ok(views.html.report4())
}
} | fikrimuhal/animated-potato | backend/GraphicPlay8/app/controllers/Application.scala | Scala | gpl-3.0 | 225 |
package com.github.morikuni.locest.util
/** ใใผใฟใฎๆฐธ็ถๅใ่กใใ
*
* @tparam A ็ฎก็ใใๅ
*/
trait Repository[A]
| morikuni/locest | util/src/main/scala/com/github/morikuni/locest/util/Repository.scala | Scala | mit | 138 |
package org.jetbrains.plugins.scala
package codeInspection
package valInTraitInspection
import com.intellij.codeInspection.{ProblemHighlightType, ProblemsHolder}
import com.intellij.psi.PsiElement
import org.jetbrains.plugins.scala.lang.psi.api.statements.{ScValueDeclaration, ScVariableDeclaration}
import org.jetbrain... | loskutov/intellij-scala | src/org/jetbrains/plugins/scala/codeInspection/valInTraitInspection/AbstractValueInTraitInspection.scala | Scala | apache-2.0 | 1,357 |
/*
* Copyright 2019 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/play-filters | src/test/scala/uk/gov/hmrc/play/filters/NoCacheByDefaultFilterSpec.scala | Scala | apache-2.0 | 2,652 |
package eu.brosbit.opos.lib
import _root_.net.liftweb.http.ResourceServer
import _root_.scala.xml.NodeSeq
import _root_.net.liftweb.http.{LiftRules}
import _root_.net.liftweb.http.js._
import JsCmds._
import JE._
import jquery.JqJE._
//import org.specs2.internal.scalaz.effect.Resource
// Allows the user to type stu... | mikolajs/osp | src/main/scala/eu/brosbit/opos/lib/DataTable.scala | Scala | agpl-3.0 | 4,660 |
package beam.agentsim.agents.memberships
import org.matsim.api.core.v01.Id
import org.matsim.api.core.v01.population.Person
import org.matsim.households.{Household, Households}
import org.matsim.vehicles.Vehicle
import scala.collection.concurrent.TrieMap
import scala.collection.{mutable, JavaConverters}
case class H... | colinsheppard/beam | src/main/scala/beam/agentsim/agents/memberships/HouseholdMembershipAllocator.scala | Scala | gpl-3.0 | 1,965 |
package com.sksamuel.elastic4s.requests.searches.aggs
import com.sksamuel.elastic4s.requests.common.RefreshPolicy
import com.sksamuel.elastic4s.requests.searches.DateHistogramInterval
import com.sksamuel.elastic4s.requests.searches.aggs.responses.Aggregations
import com.sksamuel.elastic4s.requests.searches.aggs.respon... | stringbean/elastic4s | elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/requests/searches/aggs/BucketSortPipelineAggHttpTest.scala | Scala | apache-2.0 | 3,070 |
/*
* 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/main/scala/org/apache/spark/annotation/Since.scala | Scala | apache-2.0 | 1,407 |
package wandou.util.pinyin
import wandou.util.pinyin.format.HanyuPinyinOutputFormat
import wandou.util.pinyin.format.exception.BadHanyuPinyinOutputFormatCombination
/**
* A class provides several utility functions to convert Chinese characters
* (both Simplified and Tranditional) into various Chinese Romaniz... | wandoulabs/wandou-math | wandou-util/src/main/scala/wandou/util/pinyin/PinyinHelper.scala | Scala | apache-2.0 | 8,058 |
/*
* 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 ... | deroneriksson/incubator-systemml | src/main/scala/org/apache/sysml/api/ml/LinearRegression.scala | Scala | apache-2.0 | 4,901 |
// Copyright: 2010 - 2018 https://github.com/ensime/ensime-server/graphs
// License: http://www.gnu.org/licenses/gpl-3.0.en.html
package org.ensime.indexer
import akka.actor._
import akka.event.slf4j.SLF4JLogging
import org.apache.commons.vfs2._
import org.ensime.api._
import org.ensime.config.richconfig._
import org... | yyadavalli/ensime-server | core/src/main/scala/org/ensime/indexer/SourceResolver.scala | Scala | gpl-3.0 | 4,097 |
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.