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; | |
import static java.lang.String.valueOf; | |
import static java.util.Objects.isNull; | |
import static java.util.Objects.nonNull; | |
import java.util.ArrayList; | |
import java.util.LinkedList; | |
import java.util.List; | |
import java.util.stream.Collectors; |
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
public class Application { | |
static String solve(String word) { | |
Objects.requireNonNull(word); | |
Map<String, Integer> chars = new LinkedHashMap<String, Integer>(); | |
for (int i = 0; i < word.length(); i++) { | |
var w = word.charAt(i); | |
chars.compute(String.valueOf(w), (k, v) -> { | |
if (v != null) { |
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
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE FlexibleContexts #-} | |
{-# LANGUAGE NoImplicitPrelude #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
{-# LANGUAGE TemplateHaskell #-} | |
{-# LANGUAGE TypeApplications #-} | |
{-# LANGUAGE TypeFamilies #-} | |
{-# LANGUAGE TypeOperators #-} |
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 { | |
XPTOService | |
} from '../services' | |
import { loginFailed } from './index.js' | |
const initial = { | |
filtering: { | |
data: [] | |
}, | |
listing: {} |
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 React, { useEffect } from "react"; | |
import { connect, styled } from "frontity"; | |
import Link from "./link"; | |
import List from "./list"; | |
import Item from "./list/list-item"; | |
import FeaturedMedia from "./featured-media"; | |
const Post = ({ state, actions, libraries }) => { | |
// Get information about the current URL. |
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
const promiseWithTimeout = (timeoutMs, promise, failureMessage) => { | |
var timeoutHandle; | |
const timeoutPromise = new Promise((resolve, reject) => { | |
timeoutHandle = setTimeout(() => reject(new Error(failureMessage)), timeoutMs); | |
}); | |
return Promise.race([ | |
promise, | |
timeoutPromise, | |
]).then((result) => { |
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
#lang racket | |
(require net/http-client) | |
(require net/url) | |
(require json) | |
(require net/uri-codec) | |
(require racket/cmdline) | |
(define lg (make-logger 'currency-logger)) | |
(current-logger lg) |
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 example.controller | |
import arrow.fx.reactor.FluxK | |
import arrow.fx.reactor.extensions.fluxk.async.effect | |
import arrow.fx.reactor.value | |
import example.ParserService | |
import org.springframework.web.bind.annotation.GetMapping | |
import org.springframework.web.bind.annotation.RequestParam | |
import org.springframework.web.bind.annotation.RestController | |
import reactor.core.publisher.Flux |
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
use std::cmp::Ordering; | |
use std::io; | |
use rand::Rng; | |
fn main() { | |
println!("Guess the number!"); | |
let secret_number = rand::thread_rng().gen_range(1, 101); | |
let mut attempts : Vec<u32> = Vec::new(); |
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 io.github.pauljamescleary.petstore.domain.destination | |
import scala.language.higherKinds | |
trait DestinationRepositoryAlgebra[F[_]] { | |
def destinations(departureId: Long): F[List[Long]] | |
} |
NewerOlder