Skip to content

Instantly share code, notes, and snippets.

View stefanvladvoinea's full-sized avatar

stefanvladvoinea

View GitHub Profile
@meyer9
meyer9 / transactioncoding.py
Last active March 7, 2024 21:54
Bitcoin transaction decoding/encoding
import sys
import struct
WITNESS = 1
from test_framework.script import *
class RawTransaction:
def __init__(self, tx_data):
self.tx_data = bytearray.fromhex(tx_data)
#Import needed packages
import torch
import torch.nn as nn
from torchvision.datasets import CIFAR10
from torchvision.transforms import transforms
from torch.utils.data import DataLoader
from torch.optim import Adam
from torch.autograd import Variable
import numpy as np
@bartolsthoorn
bartolsthoorn / multilabel_example.py
Created April 29, 2017 12:13
Simple multi-laber classification example with Pytorch and MultiLabelSoftMarginLoss (https://en.wikipedia.org/wiki/Multi-label_classification)
import torch
import torch.nn as nn
import numpy as np
import torch.optim as optim
from torch.autograd import Variable
# (1, 0) => target labels 0+2
# (0, 1) => target labels 1
# (1, 1) => target labels 3
train = []
@klucar
klucar / ECEF2LLA.java
Last active December 28, 2022 20:46
Java stubs for converting ECEF (Earth Centered Earth Fixed) coords to Latitude Longitude Altitude
/*
*
* ECEF - Earth Centered Earth Fixed
*
* LLA - Lat Lon Alt
*
* ported from matlab code at
* https://gist.github.com/1536054
* and
* https://gist.github.com/1536056