Skip to content

Instantly share code, notes, and snippets.

View Nick-Harvey's full-sized avatar

Nick Harvey Nick-Harvey

View GitHub Profile
#minikube start --vm-driver=none --feature-gates=Accelerators=true --feature-gates=DevicePlugins=true
Starting local Kubernetes v1.10.0 cluster...
Starting VM...
Getting VM IP address...
Moving files into cluster...
Downloading kubeadm v1.10.0
Downloading kubelet v1.10.0
Finished Downloading kubelet v1.10.0
Finished Downloading kubeadm v1.10.0
Setting up certs...
import pandas as pd
import numpy as np
from fbprophet import Prophet
import matplotlib.pyplot as plt
df = pd.read_csv(‘~/tmp/SP500.csv’)
df[‘y’] = np.log(df[‘y’])
m = Prophet(growth=’linear’)
m.fit(df)
Date Index
2017-03-07 2368.39
2017-03-08 2362.98
2017-03-09 2364.87
2017-03-10 2372.60
2017-03-13 2373.47
Date Index
2017-03-07 2368.39
2017-03-08 2362.98
2017-03-09 2364.87
2017-03-10 2372.60
2017-03-13 2373.47
from __future__ import print_function
import tensorflow as tf
import numpy
import matplotlib.pyplot as plt
import pandas as pd
import os
os.chdir('/Users/Nick/Git/Machinelearning')
# Define our dataset
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1021, in _do_call
return fn(*args)
File "/usr/local/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1003, in _run_fn
status, run_metadata)
File "/usr/local/Cellar/python3/3.6.0/Frameworks/Python.framework/Versions/3.6/lib/python3.6/contextlib.py", line 89, in __exit__
next(self.gen)
File "/usr/local/lib/python3.6/site-packages/tensorflow/python/framework/errors_impl.py", line 469, in raise_exception_on_not_ok_status
pywrap_tensorflow.TF_GetCode(status))
tensorflow.python.framework.errors_impl.InvalidArgumentError: Incompatible shapes: [1176,20] vs. [1176]
@Nick-Harvey
Nick-Harvey / gist:8220591
Created January 2, 2014 15:09
First Java App
import java.util.Scanner;
public class MyFirstClass {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
double PI=3.14;
double radius, area, circumference;
System.out.print("Enter the radius: ");
radius = sc.nextDouble();
@Nick-Harvey
Nick-Harvey / gist:5847094
Created June 24, 2013 00:43
My Openshift plugin
### This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later version.
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
from sos.plugins import Plugin, RedHatPlugin
class Openshift(Plugin, RedHatPlugin):
'''Openshift related information'''
plugin_name = "Openshift"
option_list = [("broker", "Gathers broker specific files", "slow", False),
("node", "Gathers node specific files", "slow", False)]
@Nick-Harvey
Nick-Harvey / Sosreport Example Plugin
Created June 11, 2013 19:49
Sosreport Example Plugin
### This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later version.
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.