Skip to content

Instantly share code, notes, and snippets.

View tomilov's full-sized avatar

Anatoliy V Tomilov tomilov

  • Yandex
  • Yekaterinburg
View GitHub Profile
@tomilov
tomilov / VkFormat_regex.py
Last active February 5, 2023 21:33
full pythonic re for VkFormat
FORMAT_REGEX = re.compile(r'''
VK_FORMAT
(?:
# NVIDIA optical flow
_R16G16_S10_5_NV
|
# PVRTC
_(?P<pvrtc>PVRTC[12])
_(?P<pvrtc_bpp>[24])BPP
_(?P<pvrtc_numeric_format>UNORM|SRGB)
#include <unordered_set>
#include <list>
#include <optional>
#include <functional>
#include <utility>
#include <tuple>
#include <memory>
#include <type_traits>
#include <cstdlib>
struct SourceCodeJsonEscape
{
const char * text;
};
template<>
struct fmt::formatter<engine::SourceCodeJsonEscape> : fmt::formatter<fmt::string_view>
{
@tomilov
tomilov / postgres_queries_and_commands.sql
Created October 13, 2022 12:48 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@tomilov
tomilov / make_sorted_box.cpp
Last active July 2, 2022 07:11
make AA box consisting of inherently sorted triangles from two points
#include <iterator>
#include <algorithm>
#include <tuple>
#include <vector>
#include <iostream>
#include <numeric>
#include <functional>
#include <random>
#include <cassert>
@tomilov
tomilov / box_triangle_intersection.plt
Last active June 29, 2022 17:41
nonagon as result of intersection of parallelotope and triangle in space
reset
set view equal xyz
unset border
unset tics
set xyplane 0
set xrange [-3:3]
set yrange [-3:3]
set zrange [-3:3]
$cube << EOI
@tomilov
tomilov / springer-free-maths-books.sh
Created December 29, 2015 15:54 — forked from bishboria/springer-free-maths-books.md
Springer have made a bunch of books available for free, here are the direct links
wget http://link.springer.com/content/pdf/10.1007/978-1-4757-1779-2.pdf
wget http://link.springer.com/content/pdf/10.1007/978-1-4757-2103-4.pdf
wget http://link.springer.com/content/pdf/10.1007/978-1-4684-9884-4.pdf
wget http://link.springer.com/content/pdf/10.1007/978-3-662-02945-9.pdf
wget http://link.springer.com/content/pdf/10.1007/978-1-4612-9923-3.pdf
wget http://link.springer.com/content/pdf/10.1007/978-1-4757-3828-5.pdf
wget http://link.springer.com/content/pdf/10.1007/978-1-4684-9936-0.pdf
wget http://link.springer.com/content/pdf/10.1007/978-1-4419-8566-8.pdf
wget http://link.springer.com/content/pdf/10.1007/978-1-4757-4385-2.pdf
wget http://link.springer.com/content/pdf/10.1007/978-1-4419-8592-7.pdf
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;
--- 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 )
+ {
#include <optix.h>
#include <optix_stubs.h>
#include <optix_function_table_definition.h>
#include <cuda.h>
namespace Denoiser
{
static void CUDA_CHECK(CUresult result)
{