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
DROP VIEW IF EXISTS AreaUsers; | |
DROP VIEW IF EXISTS PersonActualContracts; | |
DROP TABLE IF EXISTS Contracts, ContractTypes, Persons, Areas, AreaTypes, Houses; | |
CREATE TABLE Houses ( | |
HouseId SERIAL PRIMARY KEY NOT NULL, | |
Name VARCHAR(256) NOT NULL, | |
Address VARCHAR(1024) NOT NULL, | |
Phone VARCHAR(256) NOT NULL | |
); |
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
# | |
# Copyright (c) 2016, Nikolay Polyarnyi | |
# All rights reserved. | |
# | |
import numpy as np | |
def rgb_to_hsv(rgb): | |
""" |
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 Control.Monad.Free | |
import Control.Monad | |
import System.Exit | |
import Data.Traversable (traverse) | |
data TeletypeF next | |
= Say String next | |
| Ask (String -> next) | |
| Stop |
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
# | |
# Copyright (c) 2016, Nikolay Polyarnyi | |
# All rights reserved. | |
# | |
# Requirements: | |
# | |
# beautifulsoup4>=4.4.1 | |
# requests>=2.9.1 | |
import json |
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 <boost/multiprecision/cpp_int.hpp> | |
typedef boost::multiprecision::cpp_int bigint; | |
typedef boost::rational<bigint> rational; | |
/* | |
Online running: https://ideone.com/zTH8pK | |
This is example of absolutely accurate rational arithmetics with boost. |
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 collections | |
import numpy as np | |
from matplotlib import pyplot as plt | |
from matplotlib import cm | |
from mpl_toolkits.mplot3d import Axes3D | |
def makeGaussian(size, sigma=None): | |
if not isinstance(size, collections.Iterable): | |
size = (size, size) | |
w, h = size |
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
// See https://streamhpc.com/blog/2016-02-09/atomic-operations-for-floats-in-opencl-improved/ | |
static float atomic_cmpxchg_f32(volatile __global float *p, float cmp, float val) { | |
union { | |
unsigned int u32; | |
float f32; | |
} cmp_union, val_union, old_union; | |
cmp_union.f32 = cmp; | |
val_union.f32 = val; |
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
#pragma once | |
#include <cstddef> | |
#include <stdexcept> | |
#include <emmintrin.h> | |
#ifndef _MSC_VER | |
#include <mm_malloc.h> | |
#endif |
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
# Example: | |
# depth_blur.py im3.png im4.png -16 32 | |
# where im3.png and im4.png: | |
# http://vision.middlebury.edu/stereo/eval/newEval/tsukuba/im3.png | |
# http://vision.middlebury.edu/stereo/eval/newEval/tsukuba/im4.png | |
# Usage: | |
# move mouse over image to change depth of focus | |
# | |
# Requires pyopencl and OpenCV builded with Python support |
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
__device__ float atomicCAS_f32(float *p, float cmp, float val) { | |
return __int_as_float(atomicCAS((int *) p, __float_as_int(cmp), __float_as_int(val))); | |
} |
OlderNewer