Skip to content

Instantly share code, notes, and snippets.

View jamesmcm's full-sized avatar

James McMurray jamesmcm

View GitHub Profile
@jamesmcm
jamesmcm / sum_matrices.scala
Created October 8, 2019 19:50
sum_matrices.scala
def sum_vector(x: Array[Int], y: Array[Int]): Array[Int] = {
(x zip y).map((a: (Int, Int)) => a._1 + a._2)
}
def sum_matrix(x: Array[Array[Int]], y: Array[Array[Int]]): Array[Array[Int]] = {
(x zip y).map((a: (Array[Int], Array[Int])) => sum_vector(a._1, a._2))
}
@jamesmcm
jamesmcm / manhole2.log
Created March 19, 2018 07:25
manhole2.log
jenkins@ip-172-31-13-221:/home/james$ netcat -U /tmp/manhole-19489
######### ProcessID=19489, ThreadID=139875607566080 #########
File: "/usr/lib/python3.6/threading.py", line 884, in _bootstrap
self._bootstrap_inner()
File: "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
self.run()
File: "/home/jenkins/datawarehouse/env/lib/python3.6/site-packages/manhole/__init__.py", line 234, in run
self.connection_handler(self.client)
File: "/home/jenkins/datawarehouse/env/lib/python3.6/site-packages/manhole/__init__.py", line 302, in handle_connection_repl
postgres_1 | ERROR: relation "organizations" does not exist at character 293
postgres_1 | STATEMENT: SELECT organizations.updated_at AS organizations_updated_at, organizations.created_at AS organizations_created_at, organizations.id AS organizations_id, organizations.name AS organizations_name, organizations.slug AS organizations_slug, organizations.settings AS organizations_settings
postgres_1 | FROM organizations
postgres_1 | WHERE organizations.slug = 'default'
postgres_1 | LIMIT 1
server_1 | [2017-01-26 21:30:43,708] ERROR in app: Exception on /login [GET]
server_1 | Traceback (most recent call last):
server_1 | File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1988, in wsgi_app
server_1 | response = self.full_dispatch_request()
server_1 | File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1641, in full_dispatch_request
[archie@archie redash]$ sudo docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
be4ee11ece36 mariadb "docker-entrypoint.sh" 15 minutes ago Up 15 minutes 0.0.0.0:3306->3306/tcp redash_mysql_1
47dbdab08ecc redis:2.8 "docker-entrypoint.sh" 15 minutes ago Up 15 minutes 6379/tcp redash_redis_1
e13258baa4ef postgres:9.3 "/docker-entrypoint.s" 15 minutes ago Up 15 minutes 5432/tcp redash_postgres_1
redash:
image: redash/redash:latest
ports:
- "5000:5000"
links:
- redis
- postgres
environment:
REDASH_LOG_LEVEL: "INFO"
REDASH_REDIS_URL: "redis://redis:6379/0"
redash_1 | [2017-01-26 18:33:26,291][PID:27][INFO][metrics] method=GET path=/api/session endpoint=redash.send_static status=500 content_type=? content_length=-1 duration=2.40 query_count=0 query_duration=0.00
redash_1 | [2017-01-26 18:33:26,448][PID:27][INFO][metrics] method=GET path=/login endpoint=redash.login status=302 content_type=text/html; charset=utf-8 content_length=209 duration=3.39 query_count=2 query_duration=1.16
redash_1 | [2017-01-26 18:33:26,448][PID:27][INFO][metrics] method=GET path=/login endpoint=redash.login status=500 content_type=? content_length=-1 duration=4.18 query_count=2 query_duration=1.16
redash_1 | [2017-01-26 18:33:27,249][PID:33][INFO][metrics] method=GET path=/api/session endpoint=redash.send_static status=404 content_type=text/html content_length=233 duration=1.65 query_count=0 query_duration=0.00
redash_1 | [2017-01-26 18:33:27,250][PID:33][INFO][metrics] method=GET path=/api/session endpoint=redash.send_static status=500 content_type=? c
[archie@archie redash]$ sudo npm run start
> [email protected] start /home/archie/repos/redash
> webpack-dev-server --content-base client/app
[HPM] Proxy created: /login -> http://localhost:5000/
[HPM] Proxy created: /images -> http://localhost:5000/
[HPM] Proxy created: /js -> http://localhost:5000/
[HPM] Proxy created: /styles -> http://localhost:5000/
[HPM] Proxy created: /status.json -> http://localhost:5000/
@jamesmcm
jamesmcm / GoogleCodeJamA6.cpp
Created March 17, 2016 10:48
GoogleCodeJamA6.cpp
//https://code.google.com/codejam/contest/635101/dashboard#s=p0
#include <string>
#include <vector>
#include <boost/algorithm/string.hpp>
#include <iostream>
#include <sstream>
class Node {
public:
std::vector<Node*> children;
@jamesmcm
jamesmcm / GoogleCodeJamA5.cpp
Created March 15, 2016 16:12
GoogleCodeJamA5.cpp
//https://code.google.com/codejam/contest/619102/dashboard#s=p0
#include <string>
#include <vector>
#include <boost/algorithm/string.hpp>
#include <iostream>
#include <sstream>
int main(){
std::string line;
int numCases;
@jamesmcm
jamesmcm / GoogleCodeJamA4.cpp
Created March 14, 2016 16:17
GoogleCodeJamA4.cpp
// https://code.google.com/codejam/contest/90101/dashboard#s=p0
#include <string>
#include <vector>
#include <boost/algorithm/string.hpp>
#include <iostream>
#include <sstream>
#include <regex>
int main(){
int L,D,N;