Skip to content

Instantly share code, notes, and snippets.

Adrian Wielgosik adrian17

  • Polska
Block or report user

Report or block adrian17

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:445f1b8ebbe0020256cbbc355a17bd9d
printf 'à____]\0k“ôç¹ñ6$s8,gã®]•TÍNäsÐÐs«Ò܍@:ñ=/¸Â-¶ ‡ß9¿Í~ë¬PJdÆv³—Q›¹­E¶çøäkƒ5bÉoŠ€ÁÚN®È@ëPuÞ¨Ä3׶*<§†N]¥:µV»jUÑÁYÑ.qGÄ
uá–vPå.úU!Ð\äŒÞ, ìÓè¬_'|xz -dqqFraw
View gist:d457c1110dadad58b9b2f084d8e58799
#include <iostream>
#include <string>
#include <regex>
int main() {
std::regex pattern(R"((\d+) #(.+)# (\d+) ([\d.]+))");
std::string line = "83 #Electric Sander# 7 57.00";
// imagine that's inside the while() loop
View gist:2e4df101b03175fa9c36d25cbef7e9dd
#include <string>
#include <iostream>
#include <vector>
#include <utility>
#include <chrono>
#include <unordered_set>
using namespace std::chrono;
View ub14.txt
import timeit
import time
import subprocess
lines = [
"a = ''",
"a = ' '",
"a = ' '",
"a = 'a'",
"a = 'a b a b '*100",
@adrian17
adrian17 / main.py
Created Aug 24, 2016
Python implementation of anagram solver
View main.py
from collections import defaultdict
import string
words = open("enable1.txt").read().splitlines()
print(max(len(x) for x in words))
def add(a, b):
return tuple(x+y for x, y in zip(a, b))
def over(a, b):
@adrian17
adrian17 / main.cpp
Last active Aug 24, 2016
slightly simpler and slower anagram generator implementation
View main.cpp
#include <string>
#include <algorithm>
#include <vector>
#include <map>
#include <array>
#include <fstream>
#include <xmmintrin.h>
#include <experimental/string_view>
using namespace std;
using namespace std::experimental;
@adrian17
adrian17 / main.cpp
Created Jul 25, 2016
concepts diagn
View main.cpp
template<typename T> using id=T;
template<typename T>
concept bool A = requires(T a) { a==a; };
template<typename T, typename U>
concept bool B =
A<T> && // (1) basic usage
A<T> && // (2) duplicate concept check
A<U> && // (3) different concept check that happens to work on the same type here
@adrian17
adrian17 / kanji_easy.json
Last active Sep 23, 2018
kanji data for NHK News Web Easy
View kanji_easy.json
{
"desc": "kanji frequency for NHK News Web Easy, 1855 articles from 2014-12-02 to 2016-07-15",
"source": "https://gist.github.com/adrian17/836b97ee5740b20e63edbe35251d6bc1",
"label": "easy news",
"total": 158118,
"list": [
[
"人",
5093
],
View loops.py
class Node:
def __init__(self, val):
self.up = bool(val & 1)
self.right = bool(val & 2)
self.down = bool(val & 4)
self.left = bool(val & 8)
def rotate(self):
self.up, self.right, self.down, self.left = self.right, self.down, self.left, self.up
def num(self):
return self.up<<0 | self.right<<1 | self.down<<2 | self.left<<3
@adrian17
adrian17 / STL.cpp
Last active Mar 25, 2016
Examples for "make pointers to members callable"
View STL.cpp
// and it works with standard algorithms out of the box
#include <algorithm>
#include <iostream>
#include <memory>
#include <vector>
struct S{
S(){static int N; val = N++;}
void f(){std::cout << " " << val << "\n";}
You can’t perform that action at this time.