Skip to content

Instantly share code, notes, and snippets.

Avatar

Roberto Gandolfo Hashioka rogaha

View GitHub Profile
@rogaha
rogaha / dnn.py
Created Mar 7, 2017 — forked from syhw/dnn.py
A simple deep neural network with or w/o dropout in one file.
View dnn.py
"""
A deep neural network with or w/o dropout in one file.
License: Do What The Fuck You Want to Public License http://www.wtfpl.net/
"""
import numpy, theano, sys, math
from theano import tensor as T
from theano import shared
from theano.tensor.shared_randomstreams import RandomStreams
@rogaha
rogaha / pg-pong.py
Created Mar 7, 2017 — forked from karpathy/pg-pong.py
Training a Neural Network ATARI Pong agent with Policy Gradients from raw pixels
View pg-pong.py
""" Trains an agent with (stochastic) Policy Gradients on Pong. Uses OpenAI Gym. """
import numpy as np
import cPickle as pickle
import gym
# hyperparameters
H = 200 # number of hidden layer neurons
batch_size = 10 # every how many episodes to do a param update?
learning_rate = 1e-4
gamma = 0.99 # discount factor for reward
View gist:005f972919e7348d9948
- name: add_a_unique_name_736
title: Docker Hub Sign-ups
type: looker_column
base_view: profiles_dockeruser
dimensions: [profiles_dockeruser.account_state, profiles_dockeruser.date_joined_month]
pivots: [profiles_dockeruser.account_state]
measures: [profiles_dockeruser.count]
filters:
profiles_dockeruser.date_joined_month: before this month
sorts: [profiles_dockeruser.date_joined_month]
View gist:46a42add58ac0dacc642
rogaha@Robertos-MacBook-Pro:~/development/rogaha/temp/heroku_postgres_monitor$ heroku pg:ps --app prod-docker-io 17:21:51 ☁ master ☀
psql: FATAL: remaining connection slots are reserved for non-replication superuser connections
! Heroku client internal error.
! Search for help at: https://help.heroku.com
! Or report a bug at: https://github.com/heroku/heroku/issues/new
Error: psql failed. exit status 512, output: "" (RuntimeError)
Backtrace: /Library/Ruby/Gems/2.0.0/gems/heroku-3.10.3/lib/heroku/command/pg.rb:571:in `exec_sql_on_uri'
/Library/Ruby/Gems/2.0.0/gems/heroku-3.10.3/lib/heroku/command/pg.rb:561:in `exec_sql'
/Library/Ruby/Gems/2.0.0/gems/heroku-3.10.3/lib/heroku/command/pg.rb:533:in `version'
View gist:2860c3243a8e6a4de141
GET haystack/modelresult/_search
{"query": {"filtered": {"filter": {"bool": {"must": [{"term": {"status": 1}}, {"term": {"is_private": false}}]}}, "query": {"function_score": {"query": {"bool": {"minimum_should_match": 2, "should": [{"match": {"repo_name_auto.partial": {"operator": "and", "query": "rogaha/test1", "boost": 0.05}}}, {"custom_boost_factor": {"boost_factor": 0.05, "query": {"multi_match": {"operator": "and", "fields": ["name_auto^3", "name_auto.partial^2", "name_auto.partial_back", "name_auto.partial_middle"], "query": "rogaha/test1"}}}}, {"custom_boost_factor": {"boost_factor": 0.04, "query": {"multi_match": {"operator": "and", "fields": ["repo_name_auto^3", "repo_name_auto.partial^2", "repo_name_auto.partial_back", "repo_name_auto.partial_middle"], "query": "rogaha/test1"}}}}, {"custom_boost_factor": {"boost_factor": 0.03, "query": {"multi_match": {"operator": "and", "fields": ["namespace_auto^3", "namespace_auto.partial^2", "namespace_auto.partial_back", "namespace_auto.partial_middle"], "q
View gist:a15036fdcffac4842453
Internal Server Error
Traceback:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/gunicorn/workers/sync.py", line 131, in handle_request
respiter = self.wsgi(environ, resp.start_response)
File "/usr/local/lib/python2.7/dist-packages/newrelic-2.18.1.15/newrelic/api/web_transaction.py", line 853, in __call__
result = application(environ, _start_response)
File "/usr/local/lib/python2.7/dist-packages/newrelic-2.18.1.15/newrelic/api/function_trace.py", line 95, in literal_wrapper
View gist:6954270e15ab7f141e3f
root@42e8d052494e:~# tail -f /var/log/registry_hub.log
return wrapped(*args, **kwargs)
File "/home/docker/docker_index/profiles/middleware.py", line 118, in process_request
if not sso_enabled() or should_skip_sso(request):
File "/home/docker/docker_index/profiles/middleware.py", line 36, in sso_enabled
return waffle.switch_is_active(SSO_SWITCH_NAME)
File "/src/django-waffle/waffle/__init__.py", line 132, in switch_is_active
switch = cache.get(keyfmt(SWITCH_CACHE_KEY, switch_name))
File "/usr/local/lib/python2.7/dist-packages/redis_cache/cache.py", line 31, in _decorator
raise e.parent
View gist:5cc036a608d98fb1dfd1
Step 0 : FROM stackbrew/ubuntu:12.04
---> c17f3f519388
Step 1 : MAINTAINER Docker SaaS Team <SaaS@docker.io>
---> Using cache
---> 9c3019c4fa7f
Step 2 : ADD ./serverconf/scripts/install_apt_packages.sh /build/scripts/
---> Using cache
---> b7d2967ba7cc
Step 3 : RUN /build/scripts/install_apt_packages.sh
---> Running in 7e4b2b0cfc88
View gist:dae8ac950911dd684d38
2014-09-15 16:28:38,289 INFO PoolWorker-33: child process calling self.run()
2014-09-15 16:28:50,480 ERROR PoolWorker-9: metrics.metric_recurly_revenue: returned an error: [Errno 110] Connection timed out Retrying in 1 second...
Traceback (most recent call last):
File "/metrics/run", line 66, in run_module
result = mod.run(*args)
File "/metrics/metrics/metric_recurly_revenue.py", line 9, in run
'name': 'recurly_monthly_recurring_revenue', 'value_i': get_monthly_recurring_revenue()
File "/metrics/metrics/recurly_client.py", line 25, in get_monthly_recurring_revenue
active = sum([s.unit_amount_in_cents/100 for s in recurly.Subscription.all() if s.state in 'active'])
File "/usr/local/lib/python2.7/dist-packages/recurly/resource.py", line 92, in __iter__
View gist:35080f1b34a047adf5b5
### Keybase proof
I hereby claim:
* I am rogaha on github.
* I am rogaha (https://keybase.io/rogaha) on keybase.
* I have a public key whose fingerprint is 926B BD95 8604 9F11 BBC5 0D18 AE0D E675 7148 4F2F
To claim this, I am signing this object:
You can’t perform that action at this time.