Skip to content

Instantly share code, notes, and snippets.

@Lxbinary
Lxbinary / data_f.py
Last active November 28, 2018 20:26
data_f
News_Time_Unix_ls = np.array(data_news.News_Time_Unix)
Data_Unix_ls = np.array(data.time_unix)
time_p600_ls = np.array(data_news.News_Time_Unix + 600)
time_m600_ls = np.array(data_news.News_Time_Unix - 600)
news = np.zeros(len(Data_Unix_ls), dtype=int)
for i in tnrange(len(Data_Unix_ls),desc='Data_Unix_ls'):
for t in range(len(News_Time_Unix_ls)):
if (time_p600_ls[t]) < Data_Unix_ls[i] > (time_m600_ls[t]):
@stefanct
stefanct / IEEEtranUrldate.bst
Last active July 1, 2020 11:04 — forked from philmtd/IEEEtran.bst
IEEEtran bibstyle with URLdate and ISBN, ISSN + DOI support
%% IEEEtranUrldate.bst
%% BibTeX Bibliography Style file for IEEE Journals and Conferences (unsorted)
%% Merged GQMJr + Ian Oois versions on 2017.02.14
%%
%% Edited on 2013.05.18 by GQMJr
%% Added ISBN, ISSN, DOI support
%%
%% Edited by Ian Ooi
%% Added urldate field, with accompanying default and CTLname variables to
%% allow for last accessed date on urls
@wangruohui
wangruohui / intel-nvidia.md
Last active September 3, 2025 06:50
Intel for display, Nvidia for computing

Intel for display, NVIDIA for computing

This guide will show you how to use Intel graphics for rendering display and NVIDIA graphics for CUDA computing on Ubuntu 18.04 / 20.04 desktop.

I made this work on an ordinary gaming PC with two graphics devices, an Intel UHD Graphics 630 plus an NVIDIA GeForce GTX 1080 Ti. Both of them can be shown via lspci | grep VGA.

00:02.0 VGA compatible controller: Intel Corporation Device 3e92
01:00.0 VGA compatible controller: NVIDIA Corporation GP102 [GeForce GTX 1080 Ti] (rev a1)
@asanakoy
asanakoy / Scrape with proxy
Created October 12, 2018 19:11
How to scrape data fwom awebsite through proxies
#Proxy list graper
# https://github.com/abdallahelsokary/Proxy-Collector-/blob/master/Proxy_Collector.py
import urllib.request
import urllib.error
import time
def proxy_list():
try:
@poxyu
poxyu / albumentations_targets.py
Last active October 4, 2018 06:50
Custom targets for albumentations
# import base class first
# or you'll get such error:
# TypeError: super(type, obj): obj must be an instance or subtype of type
from albumentations import DualTransform
# new targets function
def new_tf_targets(self):
return {
'image': self.apply, # do not rename this one
'image2': self.apply, # new
@kuk
kuk / task.md
Last active June 28, 2021 20:57
arb task

Тестовая задача

Предлагается написать программу для извлечения из текста ссылок на нормативные акты. Ссылка — это подстрока вида "ч. 3 ст.19 АПК РФ", "ст.ст. 15, 309 ГК РФ", "части 6, 7 статьи 210 АПК РФ". Программа должна находить такие подстроки в тексте и приводить их к нормальному виду, например:

В соответствии с частью 1 статьи 123 и частью 2 статьи 215 Арбитражного процессуального
кодекса Российской Федерации дело рассмотрено без участия представителей сторон.

[17, 116]  # начало и конец подстроки со ссылкой.

[
@rszeto
rszeto / .xbindkeysrc
Created September 30, 2017 21:33
Mouse bindings for Logitech M705 on Ubuntu
# Scroll left --> Ctrl+Shift+Tab
"xte 'keydown Control_L' 'keydown Shift_L' 'key Tab' 'keyup Shift_L' 'keyup Control_L'"
b:6
# Scroll right --> Ctrl+Tab
"xte 'keydown Control_L' 'key Tab' 'keyup Control_L'"
b:7
# Bottom side button --> Alt+Tab
"xte 'keydown Alt_L' 'key Tab' 'usleep 100000' 'keyup Alt_L'"
@umidjons
umidjons / youtube-dl-download-audio-only-on-best-quality.md
Last active September 9, 2025 12:59
Download Audio from YouTube with youtube-dl

Download Audio from YouTube

-i - ignore errors

-c - continue

-t - use video title as file name

--extract-audio - extract audio track

@mrtns
mrtns / README.md
Last active September 26, 2024 18:38
Markdown-based Literate Programming

R Ecosystem

  • R Markdown

    Use a productive notebook interface to weave together narrative text and code to produce elegantly formatted output. Use multiple languages including R, Python, and SQL.

Python Ecosystem

  • Pweave

    Pweave is a scientific report generator and a literate programming tool for Python. It can capture the results and plots from data analysis and works well with numpy, scipy and matplotlib.

  • podoc
import argparse
import torch
import torch.nn as nn
from torch.autograd import Variable
from torch.utils.data import DataLoader
import torchvision
import torchvision.transforms as T
from torchvision.datasets import ImageFolder