Skip to content

Instantly share code, notes, and snippets.

View xxxnell's full-sized avatar

Namuk Park xxxnell

View GitHub Profile
def mean[A](as: List[A])(implicit frac: Fractional[A]): A =
if (as.nonEmpty) frac.div(as.sum, frac.fromInt(as.length)) else frac.zero
@xxxnell
xxxnell / fizzbuzz.scala
Last active August 8, 2018 03:38
A solution of FizzBuzz test using a type class customized for Scala. For more detail, see https://blog.xxxnell.com/ko/posts/formalization (Korean).
trait Msg[+A]
trait EmptyMsg extends Msg[Nothing]
trait MsgOps extends MsgLaws {
def point[A](a: A): Msg[A]
def flatMap[A, B](msg: Msg[A], f: A => Msg[B]): Msg[B]
@xxxnell
xxxnell / extract_ILSVRC.sh
Created July 16, 2023 22:18 — forked from BIGBALLON/extract_ILSVRC.sh
script for ImageNet data extract.
#!/bin/bash
#
# script to extract ImageNet dataset
# ILSVRC2012_img_train.tar (about 138 GB)
# ILSVRC2012_img_val.tar (about 6.3 GB)
# make sure ILSVRC2012_img_train.tar & ILSVRC2012_img_val.tar in your current directory
#
# https://github.com/facebook/fb.resnet.torch/blob/master/INSTALL.md
#
# train/
@xxxnell
xxxnell / split_s20.json
Created July 28, 2023 22:04
split_s20.json
{"train": ["2nteA02", "1yllC02", "3ezuA01", "1oheA01", "1zseA00", "2re1A01", "1on2A01", "1nkgA03", "2yeqA01", "3tovA02", "3k9iA01", "3euhA02", "2w21A00", "2kwyA00", "3oe7G01", "4i9cA02", "4p9fA02", "2lgvA00", "1w91A01", "1qusA01", "3klqA01", "3u5eI02", "2v3mF00", "2g3qA00", "4pn6A00", "3og2A01", "4g92B00", "2qyvA01", "4dkaC00", "2iylD01", "2e3tB03", "4iihB04", "4arfA03", "1f2kA00", "4kpnA00", "1n11A00", "3lcuA02", "2wssW01", "1f7uA02", "3ch3X00", "4d94A05", "3rwnB00", "3ombA02", "3mdpA00", "3s6gA01", "3hmzA00", "1gv4A02", "1xo8A00", "3sahA01", "4dq5B00", "1vjhA00", "3dsmA00", "1pe4A00", "4g23A02", "4bp9A02", "5eqjB01", "3udcA03", "3v42A02", "3o0gD00", "2oj5B01", "1f7uA03", "1serA01", "3f9tA01", "2pnwA01", "4jleA00", "2xzmT00", "3p9dG03", "1lrzA02", "3if4A02", "2i9wA00", "4lcmA00", "3sfzA01", "6g2jS00", "2k5vA00", "3cx5D02", "1z7bA02", "3o6qA01", "1mr9A00", "2pr7A00", "2bicA01", "2vfrA04", "4nehA05", "1v57A03", "2gagC02", "4iilA01", "2v7gA02", "3r7zA01", "3gv3A00", "5bs1A00", "2o5nA01", "1tg7A03", "1ow4A00", "