Skip to content

Instantly share code, notes, and snippets.

View al42and's full-sized avatar

Andrey Alekseenko al42and

View GitHub Profile
@al42and
al42and / ttwym.myo
Last active August 29, 2015 14:14
Throw Trucks With Your Mind Connector for Myo armband
scriptId = 'com.aland.ttwym'
scriptDetailsUrl = 'https://gist.github.com/al42and/bd5b4bfa25c911eb7de9'
scriptTitle = 'Throw Trucks With Your Mind Connector'
--Andrey Alekseenko - Jan 23, 2015
--http://throwtrucks.com/
--Make a fist to activate powers
--Move hand to aim
--doubleTap to lock/unlock.
@al42and
al42and / solo.py
Created January 8, 2014 18:18
This code snippet is a part of stackexchange answer http://bitcoin.stackexchange.com/a/20060/2343
#!/usr/bin/env python
#-*- encoding: utf-8 -*-
# This code is a part of stackexchange answer
# http://bitcoin.stackexchange.com/a/20060/2343
# License: cc-wiki with attribution required
import numpy as np
HR = 550 # GHash/s, own hashrate
@al42and
al42and / homework1.tex
Created September 20, 2016 21:04
Homework 1 solution for Calculus 1 course at Innopolis University, 2016
\documentclass[a4paper,10pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[russian]{babel} % Cyrillics!
\usepackage{cmap} % Copypastable cyrillics!
\usepackage{amsmath} % Multiline equations
\usepackage{mathtools} % Disable numbering equations by default
\mathtoolsset{showonlyrefs}
\usepackage{indentfirst} % Indent first paragraph in chapter
@al42and
al42and / read-till-the-eof.md
Last active February 10, 2017 22:16
The (Not So) Ultimate Guide Of Reading Till EOF

Как читать до конца файла / EOF

C++

while (! std::cin.eof ()) {
  std::cin >> q >> v >> rho;
}

C

@al42and
al42and / pcms_timings.py
Created February 16, 2017 19:48
Get total time to complete all tests from PCMS code checker system
#!/usr/bin/env python3
# -*- encoding: utf-8 -*-
import tabulate
from configparser import ConfigParser
import os
import requests
from bs4 import BeautifulSoup
@al42and
al42and / install_vmd_ubuntu.sh
Last active January 5, 2021 22:56 — forked from lambdalisue/install_vmd_ubuntu.sh
An install script of VMD to Ubuntu
#!/bin/bash
#==============================================================================
# An install script which help you to install VMD in Ubuntu 16.04
#
# Authors: Alisue (lambdalisue@hashnote.net). Al42and (al42and@gmail.com)
# License: MIT License
#
# Copyright hashnote.net, 2015, allright reserved.
#==============================================================================
#include <CL/sycl.hpp>
#include <iostream>
#ifdef USE_NATIVE
static inline float mySqrt(float x) {
#ifdef SYCL_DEVICE_ONLY
return cl::sycl::native::sqrt(x);
#else
return cl::sycl::sqrt(x);
#endif
#include <iostream>
#include <vector>
#include <CL/sycl.hpp>
using namespace cl;
int main() {
sycl::device dev{sycl::gpu_selector{}};
sycl::queue q{dev, sycl::property_list{sycl::property::queue::in_order{}}};
#include <CL/sycl.hpp>
#include <iostream>
using mode = sycl::access_mode;
using sycl::access::fence_space;
using sycl::access::target;
static constexpr int blockSize = 32;
static constexpr int numBlocks = 8;
@al42and
al42and / sg.cpp
Created May 23, 2022 13:24
Calling a kernel with different subgroup size for different vendors
// clang++ sg.cpp -fsycl-device-code-split=per_kernel -fsycl-targets=nvptx64-nvidia-cuda,spir64 -Xsycl-target-backend=nvptx64-nvidia-cuda,spir64 --offload-arch=sm_75 -fsycl -o sg
#include <CL/sycl.hpp>
#include <vector>
template <int subGroupSize> class Kernel;
template <int subGroupSize>
void run_kernel(const cl::sycl::device &syclDevice) {
static const int numThreads = 64;