$ export HOMEBREW_NO_AUTO_UPDATE=1
$ brew tap homebrew/science --full
$ cd /usr/local/Homebrew/Library/Taps/homebrew/homebrew-science
$ git checkout 60f6064467f36b80dbcc91164d21acd4ca227ae4
$ brew install ipopt --with-openblas
Warning: Calling 'depends_on :fortran' is deprecated!
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
# .circleci/config.yml | |
commands: | |
check-diff-files-to-halt: | |
description: "halt CircleCI step if there is any files matched with a pattern" | |
parameters: | |
pattern: | |
description: "regular expression to filter changed files" | |
type: string | |
steps: | |
- run: | |
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
#!/bin/bash | |
set -e | |
# Arguments | |
pattern="${1:?"the first argument for pattern is not set"}" | |
# Constants | |
CURRENT_BRANCH="$(git rev-parse --abbrev-ref HEAD)" | |
# Determine the target |
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 _int64_feature(value): | |
# value must be a numpy array. | |
return tf.train.Feature(int64_list=tf.train.Int64List(value=value.flatten())) | |
# Write an array to TFrecord. | |
# a is an array which contains lists of variant length. | |
a = np.array([[0, 54, 91, 153, 177], | |
[0, 50, 89, 147, 196], | |
[0, 38, 79, 157], | |
[0, 49, 89, 147, 177], |
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
# -*- makefile -*- | |
# Tested on macOS Sierra (10.12.2) with llvm installed using Homebrew (https://brew.sh) | |
# brew install llvm | |
CC=/usr/local/opt/llvm/bin/clang++ | |
CFLAGS=-fPIC -m64 -Wall -g -O3 -msse4 -mpopcnt -fopenmp -Wno-sign-compare -I/usr/local/opt/llvm/include -I/usr/include/malloc -std=c++11 | |
LDFLAGS=-g -fPIC -fopenmp -L/usr/local/opt/llvm/lib | |
# common mac flags |
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 os | |
import imghdr | |
import concurrent.futures | |
from urllib.parse import urlparse | |
from urllib.request import urlretrieve | |
def is_jpeg(path): | |
if imghdr.what(path) == 'jpeg': | |
return True |
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
usage: image-downloader.py [-h] --url-list URL_LIST_PATH --outputs OUTPUT_PATH | |
Options for image-downloader.py | |
optional arguments: | |
-h, --help show this help message and exit | |
--url-list URL_LIST_PATH | |
path to a list of image URLs | |
--outputs OUTPUT_PATH |
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
#!/bin/bash | |
airflow run add_gcp_connection add_gcp_connection_python 2001-01-01 |
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
com.google.cloud.hadoop.services.agent.AgentException: Node was restarted while executing a job. This could be user-initiated or caused by Compute Engine maintenance event. (TASK_FAILED) | |
at com.google.cloud.hadoop.services.agent.AgentException$Builder.build(AgentException.java:83) | |
at com.google.cloud.hadoop.services.agent.job.AbstractJobHandler.lambda$kill$0(AbstractJobHandler.java:211) | |
at com.google.cloud.hadoop.services.repackaged.com.google.common.util.concurrent.AbstractTransformFuture$AsyncTransformFuture.doTransform(AbstractTransformFuture.java:211) | |
at com.google.cloud.hadoop.services.repackaged.com.google.common.util.concurrent.AbstractTransformFuture$AsyncTransformFuture.doTransform(AbstractTransformFuture.java:200) | |
at com.google.cloud.hadoop.services.repackaged.com.google.common.util.concurrent.AbstractTransformFuture.run(AbstractTransformFuture.java:130) | |
at com.google.cloud.hadoop.services.repackaged.com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:435) |
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
{"timestamp":1500233640,"user_id":1234,"event_id":"view",...} | |
{"timestamp":1500233641,"user_id":4321,"event_id":"post",...} |
NewerOlder