Skip to content

Instantly share code, notes, and snippets.

#include <iostream>
#include <thread>
#include <concurrent_vector.h>
#include <random>
#include <fstream>
#include <windows.h>
#include <stdlib.h> /* srand, rand */
#include <time.h> /* time */
using namespace std;
@rolaxxxx
rolaxxxx / ebay_scraper.py
Created October 9, 2020 09:07 — forked from scrapehero/ebay_scraper.py
Python 3 Code to scrape prices from ebay.com
import argparse
from pprint import pprint
from traceback import format_exc
import requests
import unicodecsv as csv
from lxml import html
def parse(brand):
#define SDL_MAIN_HANDLED
#include "WindowController.h"
#include <windows.h>
#include <chrono>
#include <string>
#include <dos.h>
//void StartsSreen(cont ref int screenNumber)
#include <iostream>
#include <thread>
@rolaxxxx
rolaxxxx / sat.cpp
Created October 17, 2019 16:29 — forked from nyorain/sat.cpp
Small Separating Axis Theorem implementation in C++
#include <nytl/vec.hpp>
#include <nytl/vecOps.hpp>
#include <vector>
#include <limits>
using Polygon = std::vector<nytl::Vec2f>;
/// Returns whether the two given convex polygons intersect using the
/// separating axis theorem. The given polygons can be in clockwise or
@rolaxxxx
rolaxxxx / _GJK.md
Created October 7, 2019 07:07 — forked from vurtun/_GJK.md
3D Gilbert–Johnson–Keerthi (GJK) distance algorithm

Gilbert–Johnson–Keerthi (GJK) 3D distance algorithm

The Gilbert–Johnson–Keerthi (GJK) distance algorithm is a method of determining the minimum distance between two convex sets. The algorithm's stability, speed which operates in near-constant time, and small storage footprint make it popular for realtime collision detection.

Unlike many other distance algorithms, it has no requirments on geometry data to be stored in any specific format, but instead relies solely on a support function to iteratively generate closer simplices to the correct answer using the Minkowski sum (CSO) of two convex shapes.

@rolaxxxx
rolaxxxx / transform
Created August 28, 2019 18:33
transform test
#include <iostream>
#include <vector>
#include <algorithm>
using std::cout;
using std::endl;
void print_it(const int &n){
std::cout << "-" << n ;
}
int op_increase (int i) { return ++i; }
int main() {
@rolaxxxx
rolaxxxx / lambda test
Created August 28, 2019 18:25
Lambda difference
#include <iostream>
#include <vector>
#include <algorithm>
using std::cout;
using std::endl;
void print_it(const int &n){
std::cout << "-" << n ;
}
int main() {
std::vector<int>nums{3, 4, 2, 8, 15, 267};
@rolaxxxx
rolaxxxx / bitonic_sort.cu
Created June 25, 2018 10:48 — forked from mre/bitonic_sort.cu
Bitonic Sort on CUDA. On a quick benchmark it was 10x faster than the CPU version.
/*
* Parallel bitonic sort using CUDA.
* Compile with
* nvcc -arch=sm_11 bitonic_sort.cu
* Based on http://www.tools-of-computing.com/tc/CS/Sorts/bitonic_sort.htm
* License: BSD 3
*/
#include <stdlib.h>
#include <stdio.h>