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 sklearn.base import BaseEstimator, ClassifierMixin, RegressorMixin | |
from dataclasses import dataclass | |
from typing import Generator, Callable, Any | |
import numpy as np | |
@dataclass | |
class SimpleEstimator(BaseEstimator): |
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
which echo > /dev/null 2>&1 && echo hoge |
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
find -L / -type l |
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 java.io.StringReader | |
import scala.xml.parsing.NoBindingFactoryAdapter | |
import org.xml.sax.InputSource | |
import nu.validator.htmlparser.sax.HtmlParser | |
import nu.validator.htmlparser.common.XmlViolationPolicy | |
def parse(html: String) = { | |
val parser = new HtmlParser | |
parser.setNamePolicy(XmlViolationPolicy.ALLOW) |
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
du -h | sort -h |
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
val currentDir = new File(".").getAbsoluteFile().getParent() |
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 com.typesafe.scalalogging.slf4j.Logging | |
class Test extends Logging { | |
logger.warn("hello") | |
} |
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
java -Dswing.defaultlaf=com.sun.java.swing.plaf.windows.WindowsLookAndFeel |
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
val resource = getClass.getResource("/resource.txt").getFile |
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
def product[A](list: Seq[A], length: Int): Iterator[Seq[A]] = { | |
@tailrec | |
def _product(list: Stream[A], length: Int, | |
accum: Stream[Seq[A]]): Stream[Seq[A]] = { | |
length match { | |
case 0 => accum | |
case _ => | |
_product(list, length - 1, | |
list map { |