Use exists?
Ruby:
package cisconacpoller | |
import scala.util.matching.Regex | |
trait Response | |
case class FailResponse(reason: String) extends Response | |
object NoSuchUserFailure extends FailResponse("No logged in user matches the criteria") | |
object InvalidCredentialsFailure extends FailResponse("Username or password is incorrect") |
def union[A](a: Set[A], b: Set[A]) { | |
var c = b | |
for(item <- a) { | |
c += item | |
} | |
c | |
} | |
OR: |
package com.proceranetworks.psm.leasepoller | |
package twpoller | |
import java.net.InetAddress | |
import java.nio.ByteBuffer | |
object ByteBufferImplicits { | |
implicit def byteBuffer2PimpedByteBuffer(buffer: ByteBuffer): PimpedByteBuffer = new PimpedByteBuffer(buffer) | |
} | |
class PimpedByteBuffer(buffer: ByteBuffer) { |
using terms from application "Messages" | |
on message received theMessage from theBuddy for theChat | |
set buddyId to id of theBuddy as text | |
if (makelower(theMessage) begins with "todo:") then | |
set trim1 to trim_line(theMessage, "todo:", 0) | |
set trim2 to trim_line(trim1, " ", 0) | |
tell application "Things 2" | |
set newToDo to make new to do ¬ | |
with properties {name:trim2, notes:"From: " & buddyId} |
/* Actions.scala */ | |
package actions | |
trait Action // Trait ~= abstract class / interface. Can't be directly instantiated. | |
sealed trait Feed extends Actions // Sealing is not required but important as the compiler will know that this class can't be extended by any other code, meaning we can do static typechecking that anything that is supposed to handle all cases of Feed actually does so. More reading: http://underscore.io/blog/posts/2015/06/02/everything-about-sealed.html | |
/* Objects are often used similar to packages in Scala. In this case you can just think of them as a grouping, no other special meaning */ | |
object Feed { | |
class FetchRequest extends Feed |
function generator(baseType) { | |
// Need to handle variable length argument lists | |
const fun = (payload) => ({ | |
type: fun, | |
payload: payload, | |
baseType: baseType | |
}); | |
return fun; | |
} |
// lib/actions.js | |
import identity from 'lodash/identity'; | |
export const ActionType = { | |
REQUEST: 'REQUEST', | |
SUCCESS: 'SUCCESS', | |
FAILURE: 'FAILURE' | |
}; | |
function createActionCreatorFlat(prefix, type, requestPayloadCreator = identity) { |
apiVersion: argoproj.io/v1alpha1 | |
kind: Workflow | |
metadata: | |
generateName: render-123-classroom | |
spec: | |
maxParallelism: 50 # Run maximum 50 tasks in parallel | |
retryStrategy: | |
limit: 2 # Retry each task max twice | |
entrypoint: render | |
templates: |
I hereby claim:
To claim this, I am signing this object: