This file contains hidden or 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
""" | |
A bare bones examples of optimizing a black-box function (f) using | |
Natural Evolution Strategies (NES), where the parameter distribution is a | |
gaussian of fixed standard deviation. | |
""" | |
import numpy as np | |
np.random.seed(0) | |
# the function we want to optimize |
This file contains hidden or 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 pdfutil; | |
import org.apache.pdfbox.cos.COSArray; | |
import org.apache.pdfbox.cos.COSDictionary; | |
import org.apache.pdfbox.cos.COSName; | |
import org.apache.pdfbox.cos.COSStream; | |
import org.apache.pdfbox.pdmodel.PDDocument; | |
import org.apache.pdfbox.pdmodel.PDDocumentCatalog; | |
import org.apache.pdfbox.pdmodel.PDPage; | |
import org.apache.pdfbox.pdmodel.PDResources; |
This file contains hidden or 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
module Test.Hspec.JSON | |
( shouldBeJson | |
) where | |
import Control.Monad (when) | |
import Control.Monad.State (StateT, get, modify, runStateT) | |
import Control.Monad.Writer (Writer, execWriter, tell) | |
import Data.ByteString.Lazy (ByteString) | |
import Data.Function (on) | |
import Data.Monoid ((<>)) |
This file contains hidden or 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 Arrows #-} | |
import Control.Arrow | |
double :: Int -> Int | |
double x = x * 2 | |
triple :: Int -> Int | |
triple x = x * 3 |
This file contains hidden or 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 datetime | |
import httplib2 | |
# to see in detail what's going on, uncomment | |
# httplib2.debuglevel = 4 | |
from apiclient.discovery import build | |
from oauth2client.client import OAuth2Credentials, OAuth2WebServerFlow | |
if __name__ == "__main__": |
This file contains hidden or 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
cuke() { | |
clear | |
cucumber --drb --tags @dev features/ | |
if [ $? -eq 0 ]; then | |
echo "" | |
echo "" | |
echo "@dev test are fine. Running all the tests." | |
echo "" | |
cucumber --drb features/ | |
if [ $? -eq 0 ]; then |
NewerOlder