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
if (process.argv.length < 4) { | |
console.log('usage: node caesarCipher [cipherText] [key(number)]'); | |
return; | |
} | |
const cipherText = process.argv[2]; | |
const key = parseInt(process.argv[3]); | |
const charCodeA = 'a'.charCodeAt(0); | |
const plainText = cipherText |
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
static class Tuple<F, S> { | |
private F first; | |
private S second; | |
public static <F, S> Tuple<F, S> pair(F f, S s) { | |
return new Tuple<F, S>(f, s); | |
} | |
private Tuple(F first, S second) { | |
this.first = first; |
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
@Test | |
public void mapOfItemsToSuppliersByGSCollections() | |
{ | |
final MutableMultimap<String, Supplier> itemsToSuppliers = | |
ArrayAdapter.adapt(this.company.getSuppliers()) | |
.groupByEach(s -> ArrayAdapter.adapt(s.getItemNames())); | |
Verify.assertIterableSize( | |
"should be 2 suppliers for sofa", | |
2, |
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
@Test | |
public void mapOfItemsToSuppliers() | |
{ | |
final MutableMap<String, List<Supplier>> itemsToSuppliers | |
= UnifiedMap.newMap(); | |
for (Supplier supplier : this.company.getSuppliers()) | |
{ | |
for (String itemName : supplier.getItemNames()) | |
{ |
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 syobochim.kotlin | |
import java.math.BigDecimal | |
import kotlin.math.* | |
inline val String.bd : BigDecimal get() = BigDecimal(this) | |
data class 可能性<T> (val 選択肢 : T, val 確率 : BigDecimal) | |
enum class しょぼちむ { |
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 syobochim; | |
import java.util.Map; | |
import java.util.stream.Collectors; | |
public class Main { | |
public static void main(String[] args) { | |
Map m = しょぼちむ.とは() | |
.flatMap(支払い::どうする) |
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 syobochim; | |
import java.math.BigDecimal; | |
import java.util.stream.Stream; | |
public enum おこづかい { | |
金欠("金欠だ~ヽ(;▽;)ノ"), | |
金ならあるんだ("金ならあるんだ!!(((o(*゚▽゚*)o)))") | |
; |
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 syobochim; | |
import java.math.BigDecimal; | |
import java.util.stream.Stream; | |
public enum 支払い { | |
おごるよ, ごちになります, 割り勘; | |
public static Stream<可能性<支払い>> どうする( |
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 syobochim; | |
import java.math.BigDecimal; | |
import java.util.stream.Stream; | |
public enum しょぼちむ { | |
バイトの女の子, ようおっさん, 二年目女子SE, おまえ誰だ, まじレッドキング; | |
public static Stream<可能性<しょぼちむ>> とは() { |
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 syobochim; | |
import java.math.BigDecimal; | |
public final class 可能性<T> { | |
public final T 選択肢; | |
public final BigDecimal 確率; | |
private 可能性(final T 選択肢, final BigDecimal 確率) { |
NewerOlder