Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

import math
from typing import Any
import numpy as np
import pandas as pd # type: ignore
import seaborn as sns # type: ignore
import torch
import torch.nn as nn
from matplotlib import pyplot as plt # type: ignore
from scipy.special import lambertw # type: ignore
@jeffwillette
jeffwillette / test.py
Last active April 13, 2021 07:05
Reproduction of an issue causing a core dump on Pytorch (1.8.1+cu111)
from argparse import Namespace
from typing import Any
import torch
from torch import nn
from torch.nn import functional as F
T = torch.Tensor
import numpy as np
a = np.array([[13, 4], [6, 2]])
b = np.array([487, 232])
print(np.linalg.solve(a, b))
@jeffwillette
jeffwillette / increment.py
Created December 30, 2018 10:25
increment version number with python
import sys
version = sys.argv[1]
front = ".".join(version.split(".")[:-1])
last = int(version.split(".")[-1]) + 1
print(front + "." + str(last))
import { ApolloClient } from 'apollo-client';
import { ApolloLink } from 'apollo-link';
import { ApolloProvider } from 'react-apollo';
import { InMemoryCache } from 'apollo-cache-inmemory';
import { JssProvider } from 'react-jss';
import { renderToString } from 'react-dom/server';
import { withClientState } from 'apollo-link-state';
import React from 'react';
import { defaultState } from './src/state/defaults';
@jeffwillette
jeffwillette / iotaNode.sh
Created January 12, 2018 05:08
A full public IOTA node in a single command
#!/bin/bash
# download the current tangle database
wget http://db.iota.partners/IOTA.partners-mainnetdb.tar.gz
# make a data directory for the database and unpack it
mkdir -p iri/mainnetdb
tar -xvf IOTA.partners-mainnetdb.tar.gz -C iri/mainnetdb
# run IRI with the data mounted into it
@jeffwillette
jeffwillette / gist:548fabec65ed02532b98e328734fae1b
Created January 10, 2018 02:56
Iota nelson example log output
01/10 02:50:42.337 [XNIO-1 task-11] INFO com.iota.iri.service.API - Removing neighbor: udp://136.243.57.228:14600
01/10 02:50:42.794 [XNIO-1 task-12] INFO com.iota.iri.service.API - Removing neighbor: udp://mainnet2.deviota.com:14600
01/10 02:50:45.679 [pool-2-thread-2] INFO com.iota.iri.network.Node - toProcess = 0 , toBroadcast = 0 , toRequest = 978 , toReply = 0 / totalTransactions = 8091
01/10 02:50:52.847 [XNIO-1 task-15] INFO com.iota.iri.service.API - Removing neighbor: udp://iotadesert.ddns.net:14600
01/10 02:50:55.681 [pool-2-thread-2] INFO com.iota.iri.network.Node - toProcess = 0 , toBroadcast = 0 , toRequest = 1054 , toReply = 0 / totalTransactions = 8948
01/10 02:50:57.189 [XNIO-1 task-1] INFO com.iota.iri.service.API - Removing neighbor: udp://90.74.7.212:14602
01/10 02:51:02.377 [XNIO-1 task-2] INFO com.iota.iri.service.API - Removing neighbor: udp://95.183.50.6:14600
01/10 02:51:05.687 [pool-2-thread-2] INFO com.iota.iri.network.Node - toProcess = 0 , toBroadcast = 0 , toRequest = 1121