This file contains 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
// paste this into web console | |
codes = $("code"); | |
contents = Array.from(codes).map(i => i.textContent); //.filter(i => i.includes("@")); | |
uniqs = contents.filter((v, i, a) => a.indexOf(v) === i); | |
copy(uniqs.join('\n')); // save array to clipboard |
This file contains 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
.entry-content > ul > li { | |
margin: 0 0 0 36px; | |
} | |
.entry-content > ul { | |
list-style-type: circle; | |
} | |
.entry-content > ol { | |
list-style-type: decimal; | |
} | |
h2 { |
This file contains 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 <cuda_runtime.h> | |
#include <iostream> | |
#include <device_launch_parameters.h> | |
#include "cuda_error_detector.h" | |
#include <vector> | |
#ifdef __CUDACC__ | |
#define KERNEL_ARGS2(numerOfBlocks, threadsPerBlock) <<< numerOfBlocks, threadsPerBlock >>> | |
#define KERNEL_ARGS3(numerOfBlocks, threadsPerBlock, sh_mem) <<< numerOfBlocks, threadsPerBlock, sh_mem >>> |
This file contains 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
#ifdef __CUDACC__ | |
#define KERNEL_ARGS2(numerOfBlocks, threadsPerBlock) <<< numerOfBlocks, threadsPerBlock >>> | |
#define KERNEL_ARGS3(numerOfBlocks, threadsPerBlock, sh_mem) <<< numerOfBlocks, threadsPerBlock, sh_mem >>> | |
#define KERNEL_ARGS4(numerOfBlocks, threadsPerBlock, sh_mem, stream) <<< numerOfBlocks, threadsPerBlock, sh_mem, stream >>> | |
#else | |
#define KERNEL_ARGS2(numerOfBlocks, threadsPerBlock) | |
#define KERNEL_ARGS3(numerOfBlocks, threadsPerBlock, sh_mem) | |
#define KERNEL_ARGS4(numerOfBlocks, threadsPerBlock, sh_mem, stream) | |
#endif |
This file contains 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 <cuda_runtime.h> | |
#include <device_launch_parameters.h> | |
namespace comment_thread_id | |
{ | |
/* | |
blockIdx.x == n | |
blockIdx.y == 1 | |
blockIdx.z == 1 | |
This file contains 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
// Define this to turn on error checking | |
// original https://codeyarns.com/2011/03/02/how-to-do-error-checking-in-cuda/ | |
#ifndef CUDA_ERROR_DETECTOR_H | |
#define CUDA_ERROR_DETECTOR_H | |
#define CUDA_ERROR_CHECK | |
#define CudaSafeCall(err) CUDA_ERROR_DETECTOR::__cudaSafeCall(__FUNCTION__, err, __FILE__, __LINE__ ) // __FUNCTION__ https://stackoverflow.com/questions/679021/how-to-find-the-name-of-the-current-function-at-runtime | |
#define CudaCheckError() CUDA_ERROR_DETECTOR::__cudaCheckError(__FUNCTION__, __FILE__, __LINE__ ) |
This file contains 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
from sympy.tensor.tensor import TensorIndexType, tensor_indices, tensorhead, TensorManager | |
Lorentz = TensorIndexType('Lorentz') | |
i0, i1, i2, i3, i4 = tensor_indices('i0:5', Lorentz) | |
A = tensorhead('A', [Lorentz], [[1]]) | |
G = tensorhead('G', [Lorentz], [[1]], 'Gcomm') | |
GH = tensorhead('GH', [Lorentz], [[1]], 'GHcomm') | |
TensorManager.set_comm('Gcomm', 'GHcomm', 0) | |
(GH(i1) * G(i0)).canon_bp() |
This file contains 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
const divs = document.querySelectorAll(".cue.style-scope.ytd-transcript-body-renderer"); | |
const array = Array.from(divs); | |
const texts = array.map(t => t.textContent.trim()+"\n"); | |
const fileName = document.title; | |
const file = new File(texts, fileName, { | |
type: "text/plain", | |
}); |
This file contains 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
Shader "TextureSampler" { | |
Properties | |
{ | |
_MainTex ("Texture", 2D) = "white" {} | |
} | |
SubShader | |
{ | |
Pass | |
{ | |
CGPROGRAM |
This file contains 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
void Main() | |
{ | |
Func<float, float> fx = x => | |
{ | |
return x * x - 612; | |
}; | |
Func<float, float> primeFx = x => | |
{ | |
return 2 * x; |