Skip to content

Instantly share code, notes, and snippets.

View heatblazer's full-sized avatar
😉
working... probably

ilian zapryanov heatblazer

😉
working... probably
  • this->company
  • there
View GitHub Profile
@heatblazer
heatblazer / mcast.cpp
Created March 7, 2018 15:12
Multicast example for WSA
#include "stdafx.h"
#include "resolve.h"
#include <WinSock2.h>
#include <WS2tcpip.h>
#include <MSWSock.h>
#pragma comment (lib, "Ws2_32.lib")
#include <QCoreApplication>
#include <stdint.h>
#include <stdio.h>
// test cases
template <typename T> union bitset_u
{
struct
{
uint8_t b0 : 1;
import pygame, sys
from pygame.locals import *
from pygame import gfxdraw
# set up the window
windowSurface = pygame.display.set_mode((500, 400), 0, 32)
pygame.display.set_caption('Hello world!')
class Position:
def __init__(self, x, y):
/** create that file w content vector_add_kernel.cl
__kernel void vector_add(__global int* A, __global int* B, __global int *C)
{
// get the idx of the current element
int i = get_global_id(0);
C[i] = A[i] + B[i];
}
@heatblazer
heatblazer / gist:ba8f0ea0d30be04eff8bfd253ab82261
Last active October 2, 2018 15:38
hello-serialization-c
/** object.def - generate this file
INT(x)
INT(y)
PDATA()
*/
#include <stdio.h>
#define INT(x) int x;
@heatblazer
heatblazer / vec3d.cpp
Created October 9, 2018 14:14
intirnsicstest
// ConsoleApplication4.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include "pch.h"
#include <intrin.h>
#include <iostream>
class Vec3D
{
float x;
#include <iostream>
class A
{
int a, b, c, d;
public:
A() : a(1), b(2), c(3), d(4) {}
#include <iostream>
#include <vector>
#include <setjmp.h>
#include <thread>
#define Yield
struct Stack
{
protected:
#include <iostream>
template <int N> struct SolveQ
{
unsigned char mat[N][N];
SolveQ()
{
for(int i=0; i < N; ++i)
{
@heatblazer
heatblazer / rle.c
Created December 8, 2018 13:42
RLE algorithm
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
static int codes[0xFF]= {0};
static void addcode(unsigned char c)
{
codes[(int)c]++;
}