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
module BF | |
// Natural number | |
type N = abstract member Value : int | |
[<StructuredFormatDisplay("{IntValue}")>] | |
type Z = Z with | |
member z.IntValue = 0 | |
interface N with member z.Value = 0 |
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
" https://github.com/jeetsukumaran/vim-indentwise | |
" Vim indent-level based motion | |
Plugin 'jeetsukumaran/vim-indentwise' | |
augroup fsharp_commands | |
autocmd! | |
" Prev/next let/type/exception/module/namespace | |
autocmd FileType fsharp nnoremap [[ :call search('\(^\s*\)\@<=\(let\\|and\\|type\\|exception\\|module\\|namespace\)\>', "bW")<CR> | |
autocmd FileType fsharp nnoremap ]] :call search('\(^\s*\)\@<=\(let\\|and\\|type\\|exception\\|module\\|namespace\)\>', "W")<CR> |
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
using System; | |
using UnityEngine; | |
using System.Linq; | |
using System.Collections.Generic; | |
using Random = UnityEngine.Random; | |
using Object = UnityEngine.Object; | |
// Class Diagram | |
// | |
// MonoBehaviour vertical arrow = is-a |
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 <iostream> | |
#include <iomanip> | |
using namespace std; | |
/*- | |
* | |
* 0 1 2 3 4 5 | |
* a b c d | |
* ^ ^ |
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
// Hotter Colder: http://acm.student.cs.uwaterloo.ca/~acm00/010127/E.html | |
#include <iostream> | |
#include <list> | |
#include <cmath> | |
using namespace std; | |
/////////////////////////////////////////////////////////// | |
// POINT |
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
// See http://www.khronos.org/registry/cl/sdk/1.0/docs/man/xhtml/sampler_t.html | |
const sampler_t sampler = CLK_NORMALIZED_COORDS_FALSE | CLK_FILTER_NEAREST | CLK_ADDRESS_CLAMP_TO_EDGE; | |
constant int n = 2; // field exponent | |
constant float e = 1e-3; // smoothing factor | |
constant float c = 5e-4; // field multiplier | |
constant float br = 4e-5; // brightness factor | |
float z(float r, float k) { | |
return k / (e + pow(r, n - 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
/** | |
QueryFormat example : query image format dynamically inside the kernel | |
Written by Olivier Chafik, no right reserved :-) */ | |
// See http://www.khronos.org/registry/cl/sdk/1.0/docs/man/xhtml/sampler_t.html | |
const sampler_t sampler = CLK_NORMALIZED_COORDS_FALSE | CLK_FILTER_NEAREST | CLK_ADDRESS_CLAMP_TO_EDGE; | |
int2 ripple(float x, float y, float a, float w) { | |
float m = sqrt(x*x + y*y); |
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 time import gmtime, strftime;data = { } | |
while True: | |
inp = raw_input().split(" ") | |
if inp[0] == '*': | |
data = { } | |
elif len(inp) < 2: | |
break | |
else: | |
if inp[0] == '!': | |
del data[inp[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
import java.io.*; | |
import javax.tools.*; | |
class Factorial12 { | |
static final char Q=34; | |
static final int N=12; | |
static final int M=1; | |
public static void main(String[]a)throws Exception{ | |
if (N == 0) { | |
System.out.println(M); | |
System.exit(0); |
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
final int[][] D1 = { { 1, 0, 0 }, { 0, 1, 0 }, { 0, 0, 1 } }; | |
final boolean[][] D2 = { { false, false, false }, { false, false, false }, { true, false, false }, { true, true, false }, | |
{ false, false, true }, { false, false, true }, { true, false, true }, { true, true, true }, | |
{ false, false, false }, { false, true, false }, { true, false, false }, { true, true, false } }; | |
final boolean[][] D3 = { { true, false, false }, { false, true, false }, { true, true, false }, { false, true, false }, | |
{ true, false, true }, { false, true, true }, { true, true, true }, { false, true, true }, | |
{ false, false, true }, { false, true, true }, { true, false, true }, { true, true, true } }; | |
float o = 10, b = 8 / 3, p = 28; | |
float ra = 0.1, rb = 0.1, rc = 18; |
NewerOlder