Skip to content

Instantly share code, notes, and snippets.

@exyi
exyi / Membench.jl
Created August 13, 2023 11:39
Memory latency and bogotroughput benchmark
using BenchmarkTools
import Optim
function generate_permutation(size::Int)
arr = collect(UInt32(1):UInt32(size))
for i in size:-1:2
j = rand(1:(i-1))
arr[i], arr[j] = arr[j], arr[i]
end
@exyi
exyi / client.ts
Created February 23, 2021 09:20
websocket basic client
/// <reference path="../node_modules/lz-string/typings/lz-string.d.ts" />
import * as P from './protocol'
const endpoint = `ws://${window.location.host}/ws/`
let conn : WebSocket | undefined;
let active = false
let logged = false
export type LoginOptions = {
token: string,
@exyi
exyi / strom.py
Created September 15, 2020 19:26
Intervaláče
from __future__ import annotations
from dataclasses import dataclass
from typing import *
import unittest
// This source code was generated by anyexec2c.
// Link: https://github.com/exyi/anyexec2C
// ==============================
// tools/memtest.c
// ==============================
// // Part of anyexec2c project
// // https://github.com/exyi/anyexec2C/tree/master/tools
// //
// // Tests memory limits of the sandbox, measured in blocks of BLOCK_SIZE

Keybase proof

I hereby claim:

  • I am exyi on github.
  • I am exyi (https://keybase.io/exyi) on keybase.
  • I have a public key ASCQHm65lz9jNqBqcV9qronJnbCKX3AQY5QRoHEYcPwCIAo

To claim this, I am signing this object:

@exyi
exyi / dotvvm_src_.vscode_tasks.json
Created August 2, 2017 11:34
dotvvm/src/.vscode/tasks.json
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "0.1.0",
"command": "dotnet",
"isShellCommand": true,
"args": [ ],
"tasks": [
{
"taskName": "build",
@exyi
exyi / dotvvm_src_.vscode_launch.json
Created August 2, 2017 11:33
dotvvm/src/.vscode/launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Launch (web)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceRoot}/DotVVM.Samples.BasicSamples.AspNetCore/bin/Debug/netcoreapp1.0/DotVVM.Samples.BasicSamples.AspNetCore.dll",
"args": [],
using System;
struct A_1 { public int A; public int B; }
struct A_2 { public A_1 A; public A_1 B; }
struct A_3 { public A_2 A; public A_2 B; }
struct A_4 { public A_3 A; public A_3 B; }
struct A_5 { public A_4 A; public A_4 B; }
struct A_6 { public A_5 A; public A_5 B; }
struct A_7 { public A_6 A; public A_6 B; }
struct A_8 { public A_7 A; public A_7 B; }
struct A_9 { public A_8 A; public A_8 B; }
@exyi
exyi / TreeView.cs
Created July 13, 2016 17:26
simple server rendred TreeView control for dotvvm
public interface IHierarchyItem
{
IEnumerable<IHierarchyItem> Children { get; }
}
public class TreeView : DotvvmControl
{
public IEnumerable<IHierarchyItem> DataSource
{
get { return (IEnumerable<IHierarchyItem>)GetValue(DataSourceProperty); }
set { SetValue(DataSourceProperty, value); }