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
def chain_qs(*querysets): | |
class CombinedQuerySet: | |
def __init__(self, *querysets): | |
self.qs_list = querysets | |
def __next__(self): | |
return chain(self.qs_list) | |
def __iter__(self): | |
return self |
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 | |
x = np.fromfile(r'1920x1080BGRA16.raw', np.uint16) | |
y = x/256 | |
z= y.astype(np.uint8) | |
z.tofile('1920x1080BGRA.raw') | |
w= np.zeros((1919*1079*4), np.uint8) | |
for i in range(1079): | |
#cut with reordering BGRA -> ARGB | |
for j in range(1919): | |
w[j*4 + 1919*4*i ] = z[j*4 + 3 + 1920*4*i] |
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
-list all available formats | |
>ffmpeg -formats | |
-how to get aac | |
>ffmpeg -i e:\Tasks2\Audio_start\wombat_128.mp3 -c:adts aac -strict experimental -vbr -y e:\Tasks2\Audio_start\wombat_128.m4a | |
-instead of <adts> put <aac> for raw stream | |
>ffmpeg -i e:\Tasks2\Audio_start\wombat_128.mp3 e:\Tasks2\Audio_start\wombat_128.aac | |
-how to check |
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
#include <iostream> | |
#include <vector> | |
#include <string> | |
#include <numeric> | |
#include <sstream> | |
#include <algorithm> | |
#include <fstream> | |
#include <iterator> | |
#include <map> | |
#include <set> |
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
#include <iostream> | |
using namespace std; | |
void print(){cout<<'\n';} | |
template<typename T, typename ...TAIL> | |
void print(const T &t, TAIL... tail) | |
{ | |
cout<<t<<' '; |
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
#define UNICODE | |
#include <windows.h> | |
#include <dbghelp.h> | |
#include <shellapi.h> | |
#include <shlobj.h> | |
#include <Strsafe.h> | |
int GenerateDump(EXCEPTION_POINTERS* pExceptionPointers) | |
{ | |
BOOL bMiniDumpSuccessful; |