Skip to content

Instantly share code, notes, and snippets.

import pandas as pd
import numpy as np
import math
import torch
import torch.nn as nn
from sklearn.preprocessing import MinMaxScaler
import yfinance as yf
from datetime import date
# if we have a GPU then use it
@joestein
joestein / gist:6eeceb4eb8b2f80c83c684a96ee31cd5
Created November 19, 2023 20:03
error with spark and iceberg with nessie
charmalloc@Joes-MacBook-Pro getting-started-apachespark-apachekafka-apacheiceberg % ./create-table.sh anothertester2 yoyoma3
:: loading settings :: url = jar:file:/Users/charmalloc/spark-3.5.0-bin-hadoop3/jars/ivy-2.5.1.jar!/org/apache/ivy/core/settings/ivysettings.xml
Ivy Default Cache set to: /Users/charmalloc/.ivy2/cache
The jars for the packages stored in: /Users/charmalloc/.ivy2/jars
org.apache.hadoop#hadoop-aws added as a dependency
org.apache.spark#spark-sql-kafka-0-10_2.12 added as a dependency
org.apache.spark#spark-avro_2.12 added as a dependency
org.apache.iceberg#iceberg-spark-runtime-3.3_2.12 added as a dependency
software.amazon.awssdk#bundle added as a dependency
software.amazon.awssdk#url-connection-client added as a dependency
@joestein
joestein / tl.py
Created October 16, 2023 20:14
pytorch lstm
import pandas as pd
import numpy as np
import math
#import matplotlib.pyplot as plt # Visualization
#import matplotlib.dates as mdates # Formatting dates
from sklearn.preprocessing import MinMaxScaler
import torch # Library for implementing Deep Neural Network
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
# LSTM for international airline passengers problem with regression framing
import numpy as np
import matplotlib.pyplot as plt
from pandas import read_csv
import math
import tensorflow as tf
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense
from tensorflow.keras.layers import LSTM
@joestein
joestein / bom.xml
Created August 17, 2023 19:53
CycloneDX Part 2
<?xml version="1.0"?><bom serialNumber="b306a76c-4f96-4849-ae45-53e19e65d09c" xmlns="http://cyclonedx.org/schema/bom/1.2"><metadata><timestamp>2023-08-16T20:54:12.425645Z</timestamp><tools><tool><name>SBoM Mix task for Elixir</name></tool></tools><component><bom-ref>685d54d5e8f71d2f</bom-ref><type>container</type><name>docker.io/library/alpine:latest</name><version>sha256:cbaa390ec61abd889dfa5146a411c11717c19ef9e5e18458dbdc06439076ffe7</version></component></metadata><components><component type="library"><name>decimal</name><version>2.1.1</version><description>Arbitrary precision decimal arithmetic.</description><licenses><license><id>Apache-2.0</id></license></licenses><purl>pkg:hex/decimal@2.1.1</purl><hashes><hash alg="SHA-256">5611dca5d4b2c3dd497dec8f68751f1f1a54755e8ed2a966c2633cf885973ad6</hash></hashes></component><component type="library"><name>combine</name><version>0.10.0</version><description>A parser combinator library for Elixir projects.</description><licenses><license><id>MIT</id></license></li
@joestein
joestein / bom.xml
Created August 16, 2023 21:09
sbomexample
<?xml version="1.0"?><bom serialNumber="b306a76c-4f96-4849-ae45-53e19e65d09c" xmlns="http://cyclonedx.org/schema/bom/1.2"><metadata><timestamp>2023-08-16T20:54:12.425645Z</timestamp><tools><tool><name>SBoM Mix task for Elixir</name></tool></tools></metadata><components><component type="library"><name>decimal</name><version>2.1.1</version><description>Arbitrary precision decimal arithmetic.</description><licenses><license><id>Apache-2.0</id></license></licenses><purl>pkg:hex/decimal@2.1.1</purl><hashes><hash alg="SHA-256">5611dca5d4b2c3dd497dec8f68751f1f1a54755e8ed2a966c2633cf885973ad6</hash></hashes></component><component type="library"><name>combine</name><version>0.10.0</version><description>A parser combinator library for Elixir projects.</description><licenses><license><id>MIT</id></license></licenses><purl>pkg:hex/combine@0.10.0</purl><hashes><hash alg="SHA-256">eff8224eeb56498a2af13011d142c5e7997a80c8f5b97c499f84c841032e429f</hash></hashes></component><component type="library"><name>mime</name><version>
(dcos-spark) root@0854347972a9:~/dcos-spark# dcos-spark spark run --submit-args='-Dspark.mesos.coarse=true --driver-cores 1 --driver-memory 1024M --class org.apache.spark.examples.SparkPi https://downloads.mesosphere.com/spark/assets/spark-examples_2.10-1.4.0-SNAPSHOT.jar 30'
ERROR:dcos.http:HTTP Connection Error
Traceback (most recent call last):
File "/root/dcos-spark/env/local/lib/python2.7/site-packages/dcos/http.py", line 97, in _request
**kwargs)
File "/root/dcos-spark/env/local/lib/python2.7/site-packages/requests/api.py", line 57, in request
return session.request(method=method, url=url, **kwargs)
File "/root/dcos-spark/env/local/lib/python2.7/site-packages/requests/sessions.py", line 475, in request
resp = self.send(prep, **send_kwargs)
File "/root/dcos-spark/env/local/lib/python2.7/site-packages/requests/sessions.py", line 585, in send
root@0854347972a9:/dcos/dcos# dcos spark webui
Traceback (most recent call last):
File "/root/.dcos/subcommands/spark/env/bin/dcos-spark", line 11, in <module>
sys.exit(main())
File "/root/.dcos/subcommands/spark/env/local/lib/python2.7/site-packages/dcos_spark/cli.py", line 108, in main
return print_webui(args)
File "/root/.dcos/subcommands/spark/env/local/lib/python2.7/site-packages/dcos_spark/cli.py", line 79, in print_webui
print(discovery.get_spark_webui())
File "/root/.dcos/subcommands/spark/env/local/lib/python2.7/site-packages/dcos_spark/discovery.py", line 11, in get_spark_webui
base_url = util.get_config().get('core.dcos_url')
name: storm-topology-full-dcos
applications:
exhibitor-mesos-storm:
type: "exhibitor-mesos-0.1.x"
id: exhibitor-mesos-storm
version: 0.1
cpu: 0.5
mem: 1024
ports:
- 31991
@joestein
joestein / gist:e01e707366c0b8cedc76
Created June 24, 2015 05:38
failure from master
2015/06/24 01:37:27 [INFO] Terraform version: 0.6.0 dev 74386655a5b4bcc1123a00715637b302b119f824
2015/06/24 01:37:27 [DEBUG] Discovered plugin: atlas = /opt/cisco/edge-test/reference/infrastructure/aws/terraform-provider-atlas
2015/06/24 01:37:27 [DEBUG] Discovered plugin: aws = /opt/cisco/edge-test/reference/infrastructure/aws/terraform-provider-aws
2015/06/24 01:37:27 [DEBUG] Discovered plugin: azure = /opt/cisco/edge-test/reference/infrastructure/aws/terraform-provider-azure
2015/06/24 01:37:27 [DEBUG] Discovered plugin: cloudflare = /opt/cisco/edge-test/reference/infrastructure/aws/terraform-provider-cloudflare
2015/06/24 01:37:27 [DEBUG] Discovered plugin: cloudstack = /opt/cisco/edge-test/reference/infrastructure/aws/terraform-provider-cloudstack
2015/06/24 01:37:27 [DEBUG] Discovered plugin: consul = /opt/cisco/edge-test/reference/infrastructure/aws/terraform-provider-consul
2015/06/24 01:37:27 [DEBUG] Discovered plugin: digitalocean = /opt/cisco/edge-test/reference/infrastructure/aws/terraform-provide