Skip to content

Instantly share code, notes, and snippets.

import torch
import pdb
import torch.nn.functional as F
import torch.nn as nn
from torch.autograd import Variable
import numpy as np
import struct
import data
import torch.optim as optim
"""
test data coming from a thread, to be processed by an asyncio process
"""
import asyncio
import threading
import time
some_queue = asyncio.Queue()
event = asyncio.Event()
"""
Idea: Resizer tasks depend on previously generated file. Create a graph-like structure with these dependencies
and execute them individually on a separate thread (can be anything, system thread, process, lambda, hetzner)
"""
import networkx as nx
import uuid
"""
/*
*
* DTC Media implement OTM
*
* Author: DTC Media
* Description: Generic script for implement the Online Taxation Module (3.0)
*
*/
(function(d) {
import { BleManager } from 'react-native-ble-plx';
var Buffer = require('buffer').Buffer;
const SERVICE_ID = '0000fefb-0000-1000-8000-00805f9b34fb';
const DATA_TXCH_ID = '00000002-0000-1000-8000-008025000000';
const DATA_RXCH_ID = '00000001-0000-1000-8000-008025000000';
const CREDITS_TXCH_ID = '00000004-0000-1000-8000-008025000000';
const CREDITS_RXCH_ID = '00000003-0000-1000-8000-008025000000';
const MAX_PAYLOAD_SIZE = 240;
set nocompatible " be iMproved, required
filetype off " required
let g:node_client_debug = 1
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
@ericdevries
ericdevries / taxcalculator.py
Created April 16, 2023 08:59
tax calculator
import numpy as np
from typing import Callable
from dataclasses import dataclass
import random
gen = np.random.default_rng()
@dataclass
class Simulation:
/*
* Copyright (C) 2023 DANS - Data Archiving and Networked Services ([email protected])
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@ericdevries
ericdevries / postgres_queries_and_commands.sql
Last active January 3, 2024 17:18 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'