Skip to content

Instantly share code, notes, and snippets.

View attashe's full-sized avatar

Attashe attashe

  • Kingston, CA
View GitHub Profile
@attashe
attashe / cgp.md
Created December 22, 2024 09:06 — forked from notnotrobby/cgp.md
List of free resources to study computer graphics programming.
'''
https://arxiv.org/abs/2312.00858
1. put this file in ComfyUI/custom_nodes
2. load node from <loaders>
start_step, end_step: apply this method when the timestep is between start_step and end_step
cache_interval: interval of caching (1 means no caching)
cache_depth: depth of caching
'''
import json
import time
from flask import Flask, render_template
from flask_socketio import SocketIO, send, emit
from server import State, Player
import numpy as np
app = Flask(__name__, static_folder='./static')
app.config['SECRET_KEY'] = 'secret!'
socketio = SocketIO(app, cors_allowed_origins='*')
@attashe
attashe / NLL_OHEM.py
Created October 29, 2020 18:32 — forked from erogol/NLL_OHEM.py
Online hard example mining PyTorch
import torch as th
class NLL_OHEM(th.nn.NLLLoss):
""" Online hard example mining.
Needs input from nn.LogSotmax() """
def __init__(self, ratio):
super(NLL_OHEM, self).__init__(None, True)
self.ratio = ratio
import argparse
class ConfigType(type):
def __new__(mcls, name, bases, attrs):
if name.startswith('None'):
return None
print(attrs)
mcls.parse_args()
@attashe
attashe / BattleUnit.cs
Created February 25, 2020 10:13
Porting Unity Scripts
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class BattleUnit : MonoBehaviour {
public GameObject fireCyrcle;
public GameObject moveCyrcle;
bool isSelected;
GameObject fireZone;
@attashe
attashe / GoogleMapDownloader.py
Last active November 2, 2018 10:16 — forked from eskriett/GoogleMapDownloader.py
A python script to download high resolution Google map images given a longitude, latitude and zoom level.
#!/usr/bin/python
# GoogleMapDownloader.py
# Created by Hayden Eskriett [http://eskriett.com]
#
# A script which when given a longitude, latitude and zoom level downloads a
# high resolution google map
# Find the associated blog post at: http://blog.eskriett.com/2013/07/19/downloading-google-maps/
import urllib
import Image
int RandomazerPartition(int* A, int p, int r) {
int q = rand() % (r - p) + p;
int j = 0;
int k = 0;
for (int i = p; i <= r; i++) {
if (A[i] < A[q]) {
A1[j] = A[i];
j++;
}
if(A[i] > A[q]) {
#include <iostream>
#include <string>
#include <exception>
#include <clocale>
#include <typeinfo>
using namespace std;
class Transport {
double mass;
string title;
#include <iostream>
#include <stdlib.h>
#include <time.h>
using namespace std;
// класс-список, работает с указателями
class node
{
int info; node* next;
public: