Skip to content

Instantly share code, notes, and snippets.

@EugeneLoy
EugeneLoy / features.m
Created August 4, 2016 20:11
"ops" feature generation
clear ; close all; clc
% helpers used later ---
function [result] = measureError(X, y, theta)
result = linearRegCostFunction(X, y, theta, 0);
endfunction
@EugeneLoy
EugeneLoy / gist:f4efbef43a6764a7f9469a2b670cc128
Created April 17, 2016 18:34
adding scalaz dependency to jupyter-scala
classpath.add(("org.scalaz" , "scalaz-core_2.11" ,"7.2.2"))
@EugeneLoy
EugeneLoy / IO.hs
Last active August 29, 2015 14:24
todo
module IO where
import System.IO
import Control.Exception
import Control.DeepSeq
import Control.Monad.Trans.Either
import Control.Monad.Trans.Class
import Data.Either.Combinators
import System.Environment
@EugeneLoy
EugeneLoy / gist:76727e5cec6943f5dd73
Created March 24, 2015 16:50
Save GET to file with datetime as a name
curl -i https://api.github.com/repos/EugenyLoy/awesome-github > `date -u '+%F'_%H_%M`.txt
@EugeneLoy
EugeneLoy / Call private methods on Scala and Java objects
Last active August 29, 2015 14:07
Helper that allows to call private methods on Scala/Java objects
package object utils {
/**
* Helper that allows to call private methods on Scala/Java objects.
*
* Usage: `someObject.exposeMethod('methodName)(arg1, arg2, arg3)`
*
* See: https://gist.github.com/EugenyLoy/5873642543f869c7e25f
*/
implicit class ExposePrivateMethods(obj: AnyRef) {
@EugeneLoy
EugeneLoy / Log test names (JUnit, SLF4J)
Last active August 29, 2015 14:02
Add this field to your test class to log names of the tests when they start. Works with JUnit 4.9+ and SLF4J.
@Rule
public TestRule loggingRule = new TestWatcher() {
protected void starting(Description description) {
Logger logger = LoggerFactory.getLogger(description.getClassName());
logger.info("Starting: {}", description.getMethodName());
}
};