Skip to content

Instantly share code, notes, and snippets.

View Ir1d's full-sized avatar
💭
Looking for internship

Dejia Xu Ir1d

💭
Looking for internship
View GitHub Profile
@Ir1d
Ir1d / SplayTreever1
Created February 26, 2015 07:02
Splay Tree ---ver1
#include<iostream>
#include<cassert>
using namespace std;
struct Node {
Node * child[2], * parent;
bool reverse;
int value, size;
long long sum;
};
/**
* http://www.lydsy.com/JudgeOnline/problemset.php?search=1834
*/
#include <cstdio>// NOLINT
#include <cstring>// NOLINT
#include <queue>// NOLINT
#include <cmath>// NOLINT
#define x1 x11
#define y1 y11
\documentclass[a4paper]{article}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{cmap}
\usepackage{geometry}
\usepackage{hyperref}
\usepackage{indentfirst}
\usepackage{xeCJK}
@Ir1d
Ir1d / tmux-cheatsheet.markdown
Created June 23, 2016 01:51 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
PublicTransitHard http://community.topcoder.com/stat?c=problem_statement&pm=13797
SimilarNames http://community.topcoder.com/stat?c=problem_statement&pm=12868
n个字符串s_1, s_2, …, s_n,m个条件(a_i, b_i),统计满足s_{p(a_i)}是s_{p(b_i)}前缀的排列p_1, p_2, …, p_n数量
n <= 50, |s_i| <= 50, m <= 8
BichromeSky http://community.topcoder.com/stat?c=problem_statement&pm=13711
n个红点,m个蓝点,没有三点共线,第i个红点以p_i的概率出现,求红点的凸包包含所有蓝点的概率
n, m <= 100
### Keybase proof
I hereby claim:
* I am ir1d on github.
* I am ir1d (https://keybase.io/ir1d) on keybase.
* I have a public key ASB_u05xGDRtJeJm11LkX_5uIwzpTyYzsuCzmMBLhK0HIgo
To claim this, I am signing this object:
@Ir1d
Ir1d / new.jsx
Created January 10, 2019 15:00
Photoshop script released
// Import Folder as Layers - Adobe Photoshop Script
// Description: imports a folder of images as named layers within a new document
// Requirements: Adobe Photoshop CS2, or higher
// (c) Copyright 2006. Adobe Systems, Incorporated. All rights reserved.
/*
@@@BUILDINFO@@@ Load, Merge, Align, Export.jsx 1.0.0.1
*/
//
@Ir1d
Ir1d / crawler.py
Created May 28, 2020 12:25
Download all your accepted code from openjudge.cn
import bs4
import requests
import json
import os
from IPython import embed
email = input("> enter email: ")
passwd = input("> enter password: ")
userAgent = "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36"
@Ir1d
Ir1d / vswt_onnx_trt7.py
Created July 12, 2022 16:54 — forked from devymex/vswt_onnx_trt7.py
Exporting Video-Swin-Transformer to onnx for TensorRT 7.x
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.checkpoint as checkpoint
import numpy as np
import math
def drop_path(x, drop_prob: float = 0., training: bool = False, scale_by_keep: bool = True):
"""Drop paths (Stochastic Depth) per sample (when applied in main path of residual blocks).
This is the same as the DropConnect impl I created for EfficientNet, etc networks, however,