instruction stringclasses 1
value | output stringlengths 5 1M |
|---|---|
Explain and rewrite the following Scala code: | package tenhou
object Translator {
private val translateDictionary = Map(
// Yaku
"็ซ็ด" -> "๋ฆฌ์น",
"ไธๅฏพๅญ" -> "์น๋์ด์ธ ",
"ๆตใๆบ่ฒซ" -> "์ ๊ตญ๋ง๊ด",
"้ๅๆธ
่ชๆธๅ" -> "์ฏ๋ชจ",
"ไธ็บ" -> "์ผ๋ฐ",
"ๆตทๅบๆๆ" -> "ํด์ ๋ก์",
"ๆฒณๅบๆ้ญ" -> "ํ์ ๋ก์ด",
"ๅถบไธ้่ฑ" -> "์์๊ฐํ",
"ๆถๆง" -> "์ฑต๊นก",
"ๆงๆง" -> "์ฑต๊นก",
"ใใใซ" -> "๋๋ธ",
"ใใใซใช... |
Explain and rewrite the following Scala code: | package aio
package concurrent
import java.util.concurrent.{ ScheduledExecutorService, ScheduledFuture, TimeUnit }
import scala.annotation.tailrec
import scala.concurrent.{ ExecutionContext, Future, Promise }
import scala.concurrent.duration.{ Duration, DurationInt }
import scala.util.Try
import scala.util.control.No... |
Explain and rewrite the following Scala code: | package io.getquill.context.jasync
import java.math.{ BigDecimal => JavaBigDecimal }
import java.time._
import java.util.Date
import io.getquill.util.Messages.fail
import org.joda.time.{ DateTime => JodaDateTime, LocalDate => JodaLocalDate, LocalTime => JodaLocalTime, LocalDateTime => JodaLocalDateTime }
import scal... |
Explain and rewrite the following Scala code: | package be.wegenenverkeer.atomium.client
import java.util.concurrent.TimeUnit
import javax.xml.bind.annotation._
import be.wegenenverkeer.atomium.japi
import be.wegenenverkeer.atomium.japi.client.FeedEntry
import com.github.tomakehurst.wiremock.WireMockServer
import com.github.tomakehurst.wiremock.client.WireMock._
i... |
Explain and rewrite the following Scala code: | package Server.Messages
import Objects.SecureRequest
import spray.routing.RequestContext
case class LikeMsg(
rc: RequestContext,
secureRequest: SecureRequest
) |
Explain and rewrite the following Scala code: | /* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package scaps.nucleus.querying
import scaps.nucleus.QuerySettings
import scaps.nucleus.indexing.FingerprintTerm
... |
Explain and rewrite the following Scala code: | /* Copyright 2009-2021 EPFL, Lausanne */
import stainless.lang._
object Numeric2 {
def looping1(x: Int): Int = looping2(x - 1)
def looping2(x: Int): Int = looping3(x - 1)
def looping3(x: Int): Int = looping4(x - 1)
def looping4(x: Int): Int = looping1(x + 3)
}
// vim: set ts=4 sw=4 et:
|
Explain and rewrite the following Scala code: | package mlib.api
import akka.actor.Actor
/**
* Market trait for all modules
*/
trait Module extends Actor
|
Explain and rewrite the following Scala code: | package lib
import java.util.UUID
import play.api.libs.json.Reads._
import play.api.libs.json._
import services.user.User
/**
* A metadata object that is included in every domain entity (by mixing in MetaEntity trait).
* The fields are the ones that are generated by server, not coming from user json payload.
*... |
Explain and rewrite the following Scala code: | /**
* Copyright 2012 Jeffrey Cameron
*
* 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... |
Explain and rewrite the following Scala code: | package sorm.mappings
import embrace._
import sorm._
import sorm.driver.DriverConnection
import sorm.jdbc.ResultSetView
trait Querying {
import abstractSql.AbstractSql._
def parseResultSet ( rs : ResultSetView, connection : DriverConnection ) : Any
def containerTableMapping : Option[TableMapping]
def tableN... |
Explain and rewrite the following Scala code: | package scalan.compilation.lms.source2bin
import java.io.File
import java.io.File.separator
import org.apache.commons.io.FileUtils
import scalan.ScalanDslExp
import scalan.compilation.lms.scalac.LmsCompilerScalaConfig
import scalan.util.FileUtil._
import scalan.util.{ExtensionFilter, FileUtil, ProcessUtil, StringUti... |
Explain and rewrite the following Scala code: | package cz.cvut.fit.palicand.sat
import com.typesafe.scalalogging.LazyLogging
/**
* Created by palickaa on 10/01/16.
*/
case class SATSolution(instance: SATInstance, assignment: IndexedSeq[Boolean]) extends LazyLogging {
lazy val satisfied: Boolean = {
clausules.foldLeft(true) { (resultSoFar, clausule) =>
... |
Explain and rewrite the following Scala code: | package scodec.protocols.mpeg
package transport
package psi
/**
* Indicates the implementor can be treated as a message delivered in an MPEG transport stream.
*
* This library differentiates tables from sections. Sections are the actual messages delivered
* in the transport stream whereas tables are the result of ... |
Explain and rewrite the following Scala code: | package rml.args.arg.input
import rml.args.exceptions.IllegalArgException
import rml.args.arg.InputCmdMapper
/**
* Argument lists must have exactly one element
*/
trait SingleArg[T] extends InputCmdMapper[T] {
override type R = T
override def getUnused(argList: List[String]) = argList.drop(1)
override def g... |
Explain and rewrite the following Scala code: | /*
* 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 ... |
Explain and rewrite the following Scala code: | /*
* 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 ... |
Explain and rewrite the following Scala code: | package nn
import java.io._
import java.nio.charset.StandardCharsets
import java.nio.file.Files.{createDirectory, exists}
import java.nio.file.Paths.get
import java.util.Calendar
import com.typesafe.scalalogging.Logger
import nn.conv.Conv
import org.junit.Assert.assertEquals
import scala.sys.process._
import scala.u... |
Explain and rewrite the following Scala code: | /**
* Copyright (C) 2015 Stratio (http://stratio.com)
*
* 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 ap... |
Explain and rewrite the following Scala code: | package mesosphere.marathon
package core.instance.update
import mesosphere.marathon.core.condition.Condition
import mesosphere.marathon.core.instance.Instance
import mesosphere.marathon.core.task.{ TaskCondition, Task }
import mesosphere.marathon.state.Timestamp
import org.apache.mesos
import scala.collection.immutab... |
Explain and rewrite the following Scala code: | package utils
import shared._
import argonaut._, argonaut.Argonaut._, argonaut.ArgonautShapeless._
import shapeless._
import eveapi.utils.Decoders._
import eveapi.data.crest._
import org.http4s.Uri
import scalaz._, Scalaz._
object codecs {
// javascript numbers are max. 53 bit, Longs are longer.
implicit val long... |
Explain and rewrite the following Scala code: | /*
* (c) Copyright 2016 Hewlett Packard Enterprise Development LP
*
* 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 b... |
Explain and rewrite the following Scala code: | package play.json.extra
import org.scalatest.FunSuite
import play.api.libs.json._
case class RecursiveClass(o: Option[RecursiveClass], s:String)
object RecursiveClass{
import implicits.optionWithNull
implicit def jsonFormat: Format[RecursiveClass] = Jsonx.formatCaseClass[RecursiveClass]
}
sealed trait Recursi... |
Explain and rewrite the following Scala code: | /*
* 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 ... |
Explain and rewrite the following Scala code: | package services.forms
import java.util.UUID
import models._
import org.mockito.Mockito
import play.api.libs.json.JsString
import play.api.test.{ PlaySpecification, WithApplication }
class ClaimServiceSpec extends PlaySpecification {
"The ClaimServiceImpl" should {
"evaluate hide expressions correctly" in new... |
Explain and rewrite the following Scala code: | /**
* ยฉ 2019 Refinitiv. 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 License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable l... |
Explain and rewrite the following Scala code: | /*
*
* /\\\\\\\\\\
* /\\\\\\///\\\\\\
* /\\\\\\/ \\///\\\\\\ /\\\\\\\\\\\\\\\\\\ /\\\\\\ /\\\\\\
* /\\\\\\ \\//\\\\\\ /\\\\\\/////\\\\\\ /\\\\\\\\\\\\\\\\\\\\\\ \\/// /\\\\\\\\\\ /\\\\\\\\\\ /\\\\\\ /\\\\\\ /\\\\\\\\\\\\\\\\\\\\
* \\/\\\\\\ \\/\\\\\\ \\/\\\\\\\\\\\\\\\\\\\... |
Explain and rewrite the following Scala code: |
package at.junction.api.bus
import org.bukkit.event.{HandlerList, Event}
/**
* User: HansiHE
* Date: 3/3/14
* Time: 1:26 AM
*/
trait BusEvent extends Event {
var source: String = null
def eventIdentifier: String
}
trait BusEventObject {
val handlers: HandlerList = new HandlerList()
def getHandlerLi... |
Explain and rewrite the following Scala code: | /*
* Copyright 2016 Dennis Vriend
*
* 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 t... |
Explain and rewrite the following Scala code: | /*
* Copyright 2019 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 ... |
Explain and rewrite the following Scala code: | package org.jetbrains.plugins.scala.highlighter
import com.intellij.openapi.project.Project
import org.jetbrains.plugins.scala.settings.{ScalaProjectSettings, ScalaProjectSettingsUtil}
/**
* @author Roman.Shein
* Date: 11.01.2016
*/
object ScalaTestHighlighterUtil {
private val scalaTestKeywords =
... |
Explain and rewrite the following Scala code: | package dk.gp.util
import com.typesafe.scalalogging.slf4j.LazyLogging
import breeze.linalg.DenseVector
import breeze.stats._
/**
* Based on https://github.com/apache/spark/blob/master/mllib/src/main/scala/org/apache/spark/mllib/evaluation/RankingMetrics.scala
* (there is a bug in a code there, score variable is not... |
Explain and rewrite the following Scala code: | /*
* 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... |
Explain and rewrite the following Scala code: | package systems.opalia.commons.control.geodesy
import systems.opalia.commons.control.units._
trait DirectResult {
val target: GeoLocation
val finalBearing: Radian
}
|
Explain and rewrite the following Scala code: | package com.haskforce.cabal.highlighting
import com.haskforce.cabal.lang.psi.CabalTypes._
import com.haskforce.cabal.lang.psi._
import com.intellij.lang.annotation.{AnnotationHolder, Annotator, HighlightSeverity}
import com.intellij.openapi.editor.colors.{EditorColorsManager, TextAttributesKey}
import com.intellij.psi... |
Explain and rewrite the following Scala code: | package mock
import model.Token
import com.github.kompot.play2sec.authentication.user.AuthUser
import play.api.libs.json.JsObject
import scala.concurrent.{ExecutionContext, Future}
import org.joda.time.DateTime
import ExecutionContext.Implicits.global
class TokenStore(userStore: UserStore) extends KvStore {
type A ... |
Explain and rewrite the following Scala code: | /* __ *\\
** ________ ___ / / ___ Scala API **
** / __/ __// _ | / / / _ | (c) 2002-2010, LAMP/EPFL **
** __\\ \\/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\\___/_/... |
Explain and rewrite the following Scala code: | class Test1 {
for (1 <- 0 to 10) println (i)
} |
Explain and rewrite the following Scala code: | package com.wixpress.common.petri
import com.github.tomakehurst.wiremock.client.VerificationException
import com.wixpress.petri.laboratory.BiPetriEvent
import com.wixpress.petri.test.SampleAppRunner
class GoogleAnalyticsTestappIT extends BaseTestapp {
val sampleAppViewDriver = new SampleAppViewDriver(webappPort, "... |
Explain and rewrite the following Scala code: | import org.junit.Test
import selfassembly.SimpleRegistry
import selfassembly.examples._
sealed trait Person6
case class Employee(name: String, age: Int) extends Person6
class SubtypingSpec {
@Test def testSealedTraitCaseClass() {
implicit val reg = new SimpleRegistry[Show]
val e = Employee("joe", 40)
... |
Explain and rewrite the following Scala code: | /***********************************************************************
* Copyright (c) 2013-2022 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... |
Explain and rewrite the following Scala code: | /*
* 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 ... |
Explain and rewrite the following Scala code: | /*
* 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 ... |
Explain and rewrite the following Scala code: | /*
* 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 ... |
Explain and rewrite the following Scala code: | /*
* 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... |
Explain and rewrite the following Scala code: | import scala.quoted.*
def impl1[A](using t: Type[A])(using q: Quotes) =
'{ Type.of[A] ; ??? } // error
def impl2[A](using t: Type[A])(using q: Quotes) =
'{ Type.of[A](using q) ; ??? } // error
|
Explain and rewrite the following Scala code: | object A {
given inline x: Int = 0 // error
} // error |
Explain and rewrite the following Scala code: | object Foo {
def bar = {
val data = Map.empty[String, String]
val list = List.empty[Map[String, String]]
list.map(_ ++ data)
}
}
|
Explain and rewrite the following Scala code: |
package object stalepkg {
class Foo
}
package stalepkg {
object Test {
def main(args: Array[String]): Unit = {
}
}
}
|
Explain and rewrite the following Scala code: | package smallcheck
/**
* Examples from the original SmallCheck
*/
object ListProperties extends Properties("List properties") {
import Property._
property("rev-rev") =
forAll { (xs: Stream[Int]) =>
xs == xs.reverse.reverse
}
def isPrefix(xs: List[Int], ys: List[Int]): Boolean = (xs, ys) mat... |
Explain and rewrite the following Scala code: | /*
* Copyright (c) 2014-2020 by The Monix Project Developers.
* See the project homepage at: https://monix.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... |
Explain and rewrite the following Scala code: | /*
* Copyright 2014-2022 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... |
Explain and rewrite the following Scala code: | /*
* 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... |
Explain and rewrite the following Scala code: | /*
* Copyright (c) 2015. Paweล Cesar Sanjuan Szklarz.
*
* 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... |
Explain and rewrite the following Scala code: | package com.github.jmcs.domain.conditionexpression
import com.github.jmcs.domain.Expression
import com.github.jmcs.utils.ExpressionParseException
class ComplexConditionExpression(val expressions: Array[Expression]) extends Expression {
expressions.foreach(exp => exp.parent = this)
def evaluate(): Any =... |
Explain and rewrite the following Scala code: | /* - Coeus web framework -------------------------
*
* Licensed under the Apache License, Version 2.0.
*
* Ported from Apache Jakarta Commons Validator,
* http://commons.apache.org/validator/
*
* It was originally based in on php script by Debbie
* Dyer, validation.php v1.2b, Date: 03/07/02,
* http://javascr... |
Explain and rewrite the following Scala code: | /*
* 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 ... |
Explain and rewrite the following Scala code: | /***********************************************************************
* Copyright (c) 2013-2020 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... |
Explain and rewrite the following Scala code: | package org.crudible.lift.binding.control
import org.crudible.lift.binding.model.LiftControl
import org.crudible.core.binding.BindingSupport
import org.crudible.core.binding.model.PhoneComponent
import org.crudible.lift.binding.markup.LiftPhoneMarkup
import org.crudible.lift.util.SUtils
import org.crudible.core.util.p... |
Explain and rewrite the following Scala code: | /*******************************************************************************
* Copyright 2017 Capital One Services, LLC and Bitwise, 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... |
Explain and rewrite the following Scala code: | /*
* Copyright 2007-2010 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... |
Explain and rewrite the following Scala code: | /*
* Copyright 2017 PayPal
*
* 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 writin... |
Explain and rewrite the following Scala code: | package ch.epfl.scala.index
package server
import model.misc._
import data.github._
import akka.http.scaladsl._
import akka.http.scaladsl.model._
import HttpMethods.POST
import headers._
import Uri._
import unmarshalling.{Unmarshal, Unmarshaller}
import akka.actor.ActorSystem
import akka.stream.ActorMaterializer
imp... |
Explain and rewrite the following Scala code: | package com.github.etacassiopeia.s99.list
/**
* <h1>P03</h1>
* Find the Kth element of a list
*
* @author Mohsen Zainalpour
* @version 1.0
* @since 28/04/16
*/
object P03 {
def main(args: Array[String]): Unit = {
val result = nth(2, List(1, 1, 2, 3, 4, 8))
//val result = nth(7, List(1, 1, 2, ... |
Explain and rewrite the following Scala code: | // Copyright 2014 Foursquare Labs Inc. All Rights Reserved.
package io.fsq.twofishes.indexer.scalding
import com.twitter.scalding._
import com.twitter.scalding.typed.TypedSink
import io.fsq.twofishes.gen._
import io.fsq.twofishes.indexer.util.SpindleSequenceFileSource
import io.fsq.twofishes.util._
import org.apache.h... |
Explain and rewrite the following Scala code: | /*
* -โฅโโโโ -โโโโ-
* โกโขโโโโโ\\โโโฯ โโโโโโโโโโโโชโ
* โฃโฌโโ` `โโโโขโ ฯโโฃโฌโโ โโโขโฃQ
* โโฃโฌโโ ` โคโโโร
` โโขโฌโฃ
* โโฃโฌโโ โโโโโ`ยซโ โขโขโฃโ
* โซโฌโโโ .โ โโจโจ โฃโฃโฌโฯ โฯโโขโขร
* โโขโโโโโ"โโโโ โร
โโโโโโโโโโ`
* ``หยฌ โ หหโยด
*
* ... |
Explain and rewrite the following Scala code: | package mesosphere.marathon
package api.akkahttp.v2
import akka.http.scaladsl.model.{ StatusCodes, Uri }
import akka.http.scaladsl.testkit.ScalatestRouteTest
import mesosphere.UnitTest
import mesosphere.chaos.http.HttpConf
import mesosphere.marathon.api.{ JsonTestHelper, TestAuthFixture }
import mesosphere.marathon.co... |
Explain and rewrite the following Scala code: | package org.nisshiee.crawler
import scalaz._, Scalaz._
trait VldInstances {
type Vld[+T] = ({ type M[+T] = ValidationNel[CrawlError, T] })#M[T]
implicit object vldInstance extends Monad[Vld] {
override def bind[A, B](fa: Vld[A])(f: (A) => Vld[B]): Vld[B] = fa flatMap f
override def point[A](a: => A): ... |
Explain and rewrite the following Scala code: | /*
* Copyright 2006-2010 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... |
Explain and rewrite the following Scala code: | package com.github.aalbul.irc.client
/**
* Created by nuru on 04.01.14.
*/
case class ClientConfig(name: String,
realName: String,
host: String,
port: Int = 6667,
channels: Seq[ChannelConf])
case class ChannelConf(name: S... |
Explain and rewrite the following Scala code: | package com.awesomesauce.minecraft.forge.openautomation.common.lasers.te
import com.awesomesauce.minecraft.forge.core.lib.item.BasicDismantleableTile
import com.awesomesauce.minecraft.forge.core.lib.util.PlayerUtil
import com.awesomesauce.minecraft.forge.openautomation.api.lasers.LaserHelper
import com.awesomesauce.mi... |
Explain and rewrite the following Scala code: | import sbt._
import Keys._
object FPInScalaBuild extends Build {
val opts = Project.defaultSettings ++ Seq(
scalaVersion := "2.11.7",
resolvers += "Typesafe Repository" at "http://repo.typesafe.com/typesafe/releases/",
libraryDependencies += "org.scalatest" % "scalatest_2.11" % "2.2.1" % "test",
... |
Explain and rewrite the following Scala code: | package ucesoft.cbm.peripheral.vic.coprocessor
import ucesoft.cbm.CBMComponent
trait VICCoprocessor extends CBMComponent {
val readOffset : Int
val controlRegisterMask : Int
val interruptMaskRegisterMask : Int
def isActive : Boolean
def cycle(rasterLine:Int,rasterCycle:Int) : Unit
def readReg(reg:Int) : ... |
Explain and rewrite the following Scala code: | /*
* Copyright 2007-2008 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 applicab... |
Explain and rewrite the following Scala code: | /*
* Copyright 2014, by Vladimir Kostyukov and Contributors.
*
* This file is a part of a Finch library that may be found at
*
* https://github.com/finagle/finch
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
* You may... |
Explain and rewrite the following Scala code: | package com.twitter.finatra.kafka.serde.internal
import java.util
import com.twitter.scrooge.{
CompactThriftSerializer,
ThriftStruct,
ThriftStructCodec,
ThriftStructSerializer
}
import org.apache.kafka.common.serialization.{Deserializer, Serde, Serializer}
import org.apache.thrift.protocol.TBinaryProtocol
im... |
Explain and rewrite the following Scala code: | package com.nummulus.amqp.driver.fixture
import scala.concurrent.duration.Duration
import org.mockito.Mockito._
import org.scalatest.mock.MockitoSugar
import com.nummulus.amqp.driver.Channel
import com.nummulus.amqp.driver.DefaultConsumer
import com.nummulus.amqp.driver.IdGenerators
import com.nummulus.amqp.driver.Q... |
Explain and rewrite the following Scala code: | package com.sksamuel.elastic4s.http.search.queries
import com.sksamuel.elastic4s.searches.sort.{FieldSortDefinition, SortDefinition}
import org.elasticsearch.common.bytes.BytesArray
import org.elasticsearch.common.xcontent.{XContentBuilder, XContentFactory}
object SortContentBuilder {
def apply(sort: SortDefinition... |
Explain and rewrite the following Scala code: | /*
* 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 ... |
Explain and rewrite the following Scala code: | package at.ait.dme.forcelayout
import scala.util.Random
/**
* A basic 2D vector, plus some convenience methods.
* @author Rainer Simon <rainer.simon@ait.ac.at>
*/
case class Vector2D(val x: Double, val y: Double ) {
def add(v: Vector2D) = Vector2D(x + v.x, y + v.y)
def +(v: Vector2D) = Vector2D.this.add(... |
Explain and rewrite the following Scala code: | /*
* 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://... |
Explain and rewrite the following Scala code: | /*
* 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 ... |
Explain and rewrite the following Scala code: | /*
* Copyright 2011-2019 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 ... |
Explain and rewrite the following Scala code: | package backend.engine
/**
* An exception class for exceptions during text compilation
*
* @author Stefan Bleibinhaus
*
*/
class TextCompileException(message: String = null, cause: Throwable = null) extends RuntimeException(message, cause) |
Explain and rewrite the following Scala code: | /**
* ยฉ 2019 Refinitiv. 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 License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable l... |
Explain and rewrite the following Scala code: | package xsbtUtil.util
object parse {
def octal(s:String):Int = Integer parseInt (s, 8)
}
|
Explain and rewrite the following Scala code: | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.stephengream.lathanbot.controllers
import com.stephengream.lathanbot.models.StatusObject
import org.springframework.web.bi... |
Explain and rewrite the following Scala code: | package shapeless
import scala.language.experimental.macros
import scala.reflect.macros.whitebox
/**
* Evidence that no implicit instance of the same type as the one being currently searched is
* available elsewhere.
*
* Added to an implicit def like
* {{{
* implicit def genericThing[F, G]
* (implicit
* e... |
Explain and rewrite the following Scala code: | /*
* #%L
* vaadinutil
* %%
* Copyright (C) 2014 KangWoo, Lee
* %%
* 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 re... |
Explain and rewrite the following Scala code: | /*
* Copyright 2014โ2017 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... |
Explain and rewrite the following Scala code: | package gitbucket.core.service
import gitbucket.core.api.ApiMilestone
import gitbucket.core.model.Milestone
import gitbucket.core.model.Profile._
import gitbucket.core.model.Profile.profile.blockingApi._
import gitbucket.core.model.Profile.dateColumnType
import gitbucket.core.service.RepositoryService.RepositoryInfo
... |
Explain and rewrite the following Scala code: | package ws.vinta.albedo.utils
import java.util.Properties
import org.apache.spark.sql.functions._
import org.apache.spark.sql.{AnalysisException, DataFrame, Dataset, SparkSession}
import ws.vinta.albedo.schemas._
import ws.vinta.albedo.settings
object DatasetUtils {
private val dbUrl = "jdbc:mysql://127.0.0.1:3306... |
Explain and rewrite the following Scala code: | package satisfaction
package engine
package actors
import satisfaction.notifier.Notifier
import akka.actor.Actor
import akka.actor.ActorLogging
import satisfaction.Track
import satisfaction.notifier.Notified
import GoalStatus._
/**
* First pass at notification
*/
class NotificationAgent( val notified : Notified... |
Explain and rewrite the following Scala code: | package com.github.mdr.mash.screen
import scala.collection.JavaConverters._
import java.nio.charset.StandardCharsets
import com.github.mdr.mash.utils.Utils
import org.apache.commons.io.IOUtils
sealed trait Colour
sealed trait BasicColour extends Colour {
def bright = BrightColour(this)
}
case object DefaultColo... |
Explain and rewrite the following Scala code: | package org.scalajs.openui5.sap.ui.table
import org.scalajs.openui5.sap.ui.core._
import org.scalajs.openui5.sap.ui.unified.Menu
import org.scalajs.openui5.util.{SettingsMap, Settings, noSettings}
import scala.scalajs.js
import scala.scalajs.js.annotation.{JSName, ScalaJSDefined}
import scala.scalajs.js.|
@ScalaJSD... |
Explain and rewrite the following Scala code: | package com.duffmanstudios.memory
import org.scalatest.{Matchers, FlatSpec}
/**
* Contains unit tests for testing the functionality in Board.
*
* @author Iain Duff
*/
class BoardTest extends ProjectTest {
"duplicateCards" must "create a list containing 2 of each given card" in {
val f = defaultGameFixture
... |
Explain and rewrite the following Scala code: | package com.twitter.finatra.benchmarks
import com.twitter.inject.Test
class RoutingServiceBenchmarkTest extends Test {
"test" in {
val benchmark = new RoutingServiceBenchmark()
benchmark.timeOldLastConstant()
benchmark.timeOldLastNonConstant()
}
}
|
Explain and rewrite the following Scala code: | package edu.gemini.model.p1.dtree
import edu.gemini.model.p1.{ immutable => I }
import scalaz._
import Scalaz._
import scala.language.existentials
object Test extends App {
val node = new Root(I.Semester(2012, I.SemesterOption.B))
val (choices, result) = TextUI.run(node.toUIPage.toInitialState)
println("Choi... |
Explain and rewrite the following Scala code: | package model
trait Profile {
val profile: slick.driver.JdbcProfile
import profile.simple._
// java.util.Date Mapped Column Types
implicit val dateColumnType = MappedColumnType.base[java.util.Date, java.sql.Timestamp](
d => new java.sql.Timestamp(d.getTime),
t => new java.util.Date(t.getTime)
)
... |
Explain and rewrite the following Scala code: | package artie
trait Request {
type Params = Map[String, String]
val Params = Map.empty[String, String]
type Headers = Map[String, String]
val Headers = Map.empty[String, String]
implicit class ParamsAndHeadersOps(elements: Map[String, String]) {
def <&>[A](key: String, value: A): Map[String, String... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.