This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** @format */ | |
describe("AppService", () => { | |
const client = new PrismaClient({ | |
// log: ['query', 'info', 'warn'], | |
}); | |
afterAll(async () => { | |
await client.$disconnect(); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** @format */ | |
import { PrismaClient } from "@prisma/client"; | |
import { Batch, Product } from "./app.model"; | |
import { IProductRepository } from "./app.repository"; | |
import { AppService } from "./app.service"; | |
import { AbstractUnitOfWork, PrismaUnitOfWork } from "./unitOfWork"; | |
class FakeProductRepository implements IProductRepository { | |
constructor(private batches: Batch[]) {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pyspark.sql.functions import max | |
covid060320.select(max("Deaths")).take(1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
covid060320 = spark\ | |
.read\ | |
.option("inferSchema", "true")\ | |
.option("header", "true")\ | |
.csv("03-06-2020.csv") | |
covid060320.take(10) | |
covid060320.sort("Deaths").explain() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Injectable } from "@nestjs/common"; | |
import { DictionaryService } from "dictionary.service"; | |
import { State, HangmanGame } from "hangman"; | |
import { Observable } from "rxjs"; | |
import { first } from "rxjs/operators"; | |
const games = new Map<string, HangmanGame>() | |
var currentGameId = 1 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Controller, Post, Get, Param, Put, Res } from "@nestjs/common"; | |
import { HangmanService } from "hangman.service"; | |
@Controller('hangman') | |
export class HangmanController { | |
constructor(private readonly hangmanService: HangmanService) {} | |
@Post() | |
newGame() { | |
return this.hangmanService.createNewGame() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Subject, Observable, interval, merge } from "rxjs"; | |
import { map, scan, share } from 'rxjs/operators'; | |
export const MAX_LIFE = 7 | |
export const MAX_TIME = 5 | |
export type State = { | |
gameId: string, | |
status: string, | |
knownSecretWord: Array<string>, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Controller, Post, Get, Param, Put, Res } from "@nestjs/common"; | |
import { HangmanService } from "hangman.service"; | |
@Controller('hangman') | |
export class HangmanController { | |
constructor(private readonly hangmanService: HangmanService) {} | |
@Post() | |
newGame() { | |
return this.hangmanService.createNewGame() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example | |
import akka.actor.ActorSystem | |
import akka.stream._ | |
import akka.stream.scaladsl.Source | |
import akka.{Done, NotUsed} | |
import scala.collection.immutable.ListSet | |
import scala.concurrent.{ExecutionContextExecutor, Future} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {from, Observable} from 'rxjs'; | |
import {reduce} from "rxjs/operators"; | |
import reduceReducers from "reduce-reducers"; | |
const MAX_LIFE = 7; | |
const zip = (arr1: Array<string>, arr2: Array<string>) => arr1.map((e, i) => [e, arr2[i]]) | |
type State = { | |
status: string, |
NewerOlder