Skip to content

Instantly share code, notes, and snippets.

@danellis
danellis / workshop1.rs
Created December 11, 2018 22:53
Rust workshop part 1
use std::env;
struct Stats {
max: f64,
mean: f64,
min: f64,
size: u64,
sum: f64,
}
@danellis
danellis / 4_part1.py
Created December 5, 2018 20:56
AoC 2018 4 part 1
import re
# [1518-02-19 00:58] wakes up
# [1518-04-08 00:00] Guard #2423 begins shift
# [1518-06-10 00:05] falls asleep
regex = re.compile(r'\[(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2})\] (.+)')
class Time:
def __init__(self, year, month, day, hour, minute):
@danellis
danellis / debootstrap.log
Created December 5, 2018 18:58
debootstrap failure
dpkg: warning: parsing file '/var/lib/dpkg/status' near line 5 package 'dpkg':
missing description
dpkg: warning: parsing file '/var/lib/dpkg/status' near line 5 package 'dpkg':
missing architecture
Selecting previously unselected package base-passwd.
(Reading database ... 0 files and directories currently installed.)
Preparing to unpack .../base-passwd_3.5.44_amd64.deb ...
Unpacking base-passwd (3.5.44) ...
dpkg: base-passwd: dependency problems, but configuring anyway as you requested:
base-passwd depends on libc6 (>= 2.8); however:
<property name="igniteInstanceName" value="livefeeds-dev"/>
<property name="discoverySpi">
<bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
<property name="ipFinder">
<bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder">
<property name="addresses">
<list>
<value>127.0.0.1:47500..47510</value>
</list>
00:27:22.445 ERROR o.a.i.i.p.job.GridJobWorker - Failed to execute job due to unexpected runtime exception [jobId=4af15744161-cf82dd18-1fa8-4839-bb19-92453db99984, ses=GridJobSessionImpl [ses=GridTaskSessionImpl [taskName=o.a.i.i.v.node.VisorNodeConfigurationCollectorTask, dep=LocalDeployment [super=GridDeployment [ts=1517272036044, depMode=SHARED, clsLdr=URLClassLoader with NativeCopyLoader with RawResources(
urls = List(/Users/dan/projects/livefeeds/cloud/antenna/target/scala-2.11/classes, /Users/dan/projects/livefeeds/cloud/db/target/scala-2.11/classes, /Users/dan/projects/livefeeds/cloud/model/target/scala-2.11/classes, /Users/dan/projects/livefeeds/cloud/ignite/target/scala-2.11/classes, /Users/dan/projects/livefeeds/cloud/mercator/target/scala-2.11/classes, /Users/dan/.ivy2/cache/org.scala-lang/scala-library/jars/scala-library-2.11.11.jar, /Users/dan/.ivy2/cache/io.getquill/quill-async-postgres_2.11/jars/quill-async-postgres_2.11-2.1.0.jar, /Users/dan/.ivy2/cache/io.getquill/quill-async_2.11/jars/quil
[19:27:16,823][INFO][tcp-disco-srvr-#2%livefeeds-dev%][TcpDiscoverySpi] TCP discovery accepted incoming connection [rmtAddr=/192.168.192.139, rmtPort=54786]
[19:27:16,836][INFO][tcp-disco-srvr-#2%livefeeds-dev%][TcpDiscoverySpi] TCP discovery spawning a new thread for connection [rmtAddr=/192.168.192.139, rmtPort=54786]
[19:27:16,836][INFO][tcp-disco-sock-reader-#13%livefeeds-dev%][TcpDiscoverySpi] Started serving remote node connection [rmtAddr=/192.168.192.139:54786, rmtPort=54786]
[19:27:17,050][INFO][disco-event-worker-#41%livefeeds-dev%][GridDiscoveryManager] Added new node to topology: TcpDiscoveryNode [id=23028bec-c883-4ff4-9051-ac19a3e768d2, addrs=[0:0:0:0:0:0:0:1, 127.0.0.1, 192.168.1.185, 192.168.192.139, 2a00:23c5:c301:7600:1832:938d:c29e:4978, 2a00:23c5:c301:7600:c065:8a8:3e45:8181, fdaa:bbcc:ddee:0:1856:29e9:d528:bd07, fdaa:bbcc:ddee:0:185c:e244:fdbd:5691], sockAddrs=[/0:0:0:0:0:0:0:1:0, /127.0.0.1:0, /192.168.1.185:0, /fdaa:bbcc:ddee:0:185c:e244:fdbd:5691:0, imac.home/192.168.0.11:0, /192.168.19
Ignite Command Line Startup, ver. 2.3.0#20171028-sha1:8add7fd5
2017 Copyright(C) Apache Software Foundation
[19:26:22,413][INFO][main][IgniteKernal%livefeeds-dev]
>>> __________ ________________
>>> / _/ ___/ |/ / _/_ __/ __/
>>> _/ // (7 7 // / / / / _/
>>> /___/\___/_/|_/___/ /_/ /___/
>>>
@danellis
danellis / tf.py
Last active January 22, 2018 23:13
TensorFlow
import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plot
import pandas as pd
import csv
def load_data_points(filename):
print("Opening CSV file")
with open(filename) as csvfile:
print("Creating CSV reader")
23:46:28.015 ERROR o.a.i.i.p.job.GridJobWorker - Failed to execute job due to unexpected runtime exception [jobId=f5cc7c26061-2f0490e2-cf03-48f4-b3d7-b6579753fc2a, ses=GridJobSessionImpl [ses=GridTaskSessionImpl [taskName=o.a.i.i.v.node.VisorNodeConfigurationCollectorTask, dep=LocalDeployment [super=GridDeployment [ts=1513485813826, depMode=SHARED, clsLdr=URLClassLoader with NativeCopyLoader with RawResources(
urls = List(/Users/dan/projects/livefeeds/cloud/api/target/scala-2.11/classes, /Users/dan/projects/livefeeds/cloud/ignite/target/scala-2.11/classes, /Users/dan/projects/livefeeds/cloud/transforms/target/scala-2.11/classes, /Users/dan/.ivy2/cache/org.scala-lang/scala-library/jars/scala-library-2.11.11.jar, /Users/dan/.ivy2/cache/org.apache.ignite/ignite-core/jars/ignite-core-2.3.0.jar, /Users/dan/.ivy2/cache/javax.cache/cache-api/jars/cache-api-1.0.0.jar, /Users/dan/.ivy2/cache/org.jetbrains/annotations/jars/annotations-13.0.jar, /Users/dan/.ivy2/cache/org.gridgain/ignite-shmem/jars/ignite-shmem-1.0.0.
@danellis
danellis / visorexceptions
Created December 17, 2017 04:47
Ignite visor exceptions
[23:46:28,013][SEVERE][mgmt-#63%LiveFeeds Development%][GridTaskWorker] Failed to reduce job results due to undeclared user exception [task=o.a.i.i.v.node.VisorNodeConfigurationCollectorTask@346bcff5, err=class o.a.i.compute.ComputeUserUndeclaredException: Failed to execute job due to unexpected runtime exception [jobId=f5cc7c26061-2f0490e2-cf03-48f4-b3d7-b6579753fc2a, ses=GridJobSessionImpl [ses=GridTaskSessionImpl [taskName=o.a.i.i.v.node.VisorNodeConfigurationCollectorTask, dep=LocalDeployment [super=GridDeployment [ts=1513485813826, depMode=SHARED, clsLdr=URLClassLoader with NativeCopyLoader with RawResources(
urls = List(/Users/dan/projects/livefeeds/cloud/api/target/scala-2.11/classes, /Users/dan/projects/livefeeds/cloud/ignite/target/scala-2.11/classes, /Users/dan/projects/livefeeds/cloud/transforms/target/scala-2.11/classes, /Users/dan/.ivy2/cache/org.scala-lang/scala-library/jars/scala-library-2.11.11.jar, /Users/dan/.ivy2/cache/org.apache.ignite/ignite-core/jars/ignite-core-2.3.0.jar, /Users/dan/.