Skip to content

Instantly share code, notes, and snippets.

Avatar

Anatoliy V Tomilov tomilov

  • Yekaterinburg
View GitHub Profile
View LRU cache C++20.cpp
#include <unordered_set>
#include <list>
#include <optional>
#include <functional>
#include <utility>
#include <tuple>
#include <memory>
#include <type_traits>
#include <cstdlib>
View StdDevs for 8x8 tiles of input image.cu
constexpr size_t tileSize = 8;
const size_t width = ...;
const size_t height = ...;
thrust::cuda::pointer<const float3> p = ...;
assert(width % tileSize == 0);
assert(height % tileSize == 0);
thrust::cuda::vector<float3> sums;
View 1.diff
--- c:/Users/Anatoly/Documents/Projects/Vulkan-Hpp/vulkan/vulkan.hpp 2020-05-05 20:09:03.802924000 +0500
+++ c:/VulkanSDK/1.2.135.0/Include/vulkan/vulkan.hpp 2020-04-24 11:54:44.062122600 +0500
@@ -13150,6 +13150,22 @@
return UniqueHandle<T,D>(data, deleter);
#endif
}
+
+ template <typename T, typename D>
+ VULKAN_HPP_INLINE typename ResultValueType<UniqueHandle<T,D>>::type createResultValue( Result result, T & data, char const * message, std::initializer_list<Result> successCodes, typename UniqueHandleTraits<T,D>::deleter const& deleter )
+ {
View Optix 7 denoiser Vulkan interop.cpp
#include <optix.h>
#include <optix_stubs.h>
#include <optix_function_table_definition.h>
#include <cuda.h>
namespace Denoiser
{
static void CUDA_CHECK(CUresult result)
{
@tomilov
tomilov / git-serve.md
Created Jan 10, 2020 — forked from datagrok/git-serve.md
How to easily launch a temporary one-off git server from any local repository, to enable a peer-to-peer git workflow.
View git-serve.md
@tomilov
tomilov / box_triangle_intersection.plt
Created Nov 23, 2019
nonagon as result of intersection of parallelotope and triangle in space
View box_triangle_intersection.plt
reset
set view equal xyz
set autoscale
unset border
unset xtics
unset ytics
unset ztics
set xyplane at -1
set xrange [-1:5]
set yrange [-1:5]
@tomilov
tomilov / ddp_ssp.cpp
Last active Nov 13, 2019
dynamic dynamic programming for subset sum problem
View ddp_ssp.cpp
#include <iostream>
#include <algorithm>
#include <cassert>
struct pair
{
int term;
int sum;
pair operator + (int x)
View crc32c.h
#pragma once
#include <cstdint>
#include <x86intrin.h>
inline
std::uint32_t crc32c(const void * input, std::size_t size, std::uint32_t result = ~0)
{
auto i8 = static_cast< const std::uint8_t * >(input);
@tomilov
tomilov / ssh-telegram.sh
Created Sep 29, 2017 — forked from matriphe/ssh-telegram.sh
Bash Script to notify via Telegram Bot API when user log in SSH
View ssh-telegram.sh
# save it as /etc/profile.d/ssh-telegram.sh
# use jq to parse JSON from ipinfo.io
# get jq from here http://stedolan.github.io/jq/
USERID="<target_user_id>"
KEY="<bot_private_key>"
TIMEOUT="10"
URL="https://api.telegram.org/bot$KEY/sendMessage"
DATE_EXEC="$(date "+%d %b %Y %H:%M")"
TMPFILE='/tmp/ipinfo-$DATE_EXEC.txt'
if [ -n "$SSH_CLIENT" ]; then
@tomilov
tomilov / stream.js
Created Apr 23, 2017 — forked from padenot/stream.js
How to serve media on node.js
View stream.js
var http = require('http');
var path = require('path');
var fs = require('fs');
var AUDIOFILE = "./audio.ogg";
function serveWithRanges(request, response, content) {
var range = request.headers.range;
var total = content.length;
var parts = range.replace(/bytes=/, "").split("-");