This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
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() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
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 | |
""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* | |
* DTC Media implement OTM | |
* | |
* Author: DTC Media | |
* Description: Generic script for implement the Online Taxation Module (3.0) | |
* | |
*/ | |
(function(d) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from typing import Callable | |
from dataclasses import dataclass | |
import random | |
gen = np.random.default_rng() | |
@dataclass | |
class Simulation: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 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%' |