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
sf::Vector2f put_point_on_line(sf::Vector2f point, sf::Vector2f line_point0, sf::Vector2f line_point1) | |
{ | |
const double new_point_x | |
{ | |
( | |
point.x * std::pow(line_point0.x - line_point1.x, 2) | |
+ | |
( | |
point.y * (line_point0.x - line_point1.x) | |
- line_point0.x * line_point1.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
sf::Vector2f put_point_on_line(sf::Vector2f point, sf::Vector2f line_point0, sf::Vector2f line_point1) | |
{ | |
const sf::Vector2f line_seg{line_point1 - line_point0}; | |
return line_point1 + unitV(line_seg) * dot(unitV(line_seg), point - line_point1); | |
} |
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
acpi | perl -ne '$_=~m/(\\d+)(?=%)/;print "$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
using StaticArrays | |
mutable struct CAcceleration | |
a::SVector{2, Float32} | |
end | |
mutable struct CPosition | |
p::SVector{2, Float32} | |
end |
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
# This file has been auto-generated by i3-config-wizard(1). | |
# It will not be overwritten, so edit it as you like. | |
# | |
# Should you change your keyboard layout some time, delete | |
# this file and re-run i3-config-wizard(1). | |
# | |
# i3 config file (v4) | |
# | |
# Please see https://i3wm.org/docs/userguide.html for a complete reference! |
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 "/usr/include/julia/julia.h" | |
#include <chrono> | |
#include <cstdio> | |
int main() { | |
jl_init(); | |
std::chrono::high_resolution_clock c; | |
jl_eval_string("module Some module Nested module Module function f(a::Int64) " | |
"end end end end"); | |
auto t1 = c.now(); |
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 breakpoints = Int[4, 6] | |
const registeredvars = Symbol[] | |
const filename = "testscript.jl" | |
module Exec end | |
function evalandregister(line::String) | |
ast = Meta.parse(line) | |
typeof(ast) == Expr || return | |
if length(ast.args) == 2 && typeof(ast.args[1]) == Symbol |
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
#pragma once | |
#include <Identifiers.hpp> | |
#include <Inputs.hpp> | |
#include <SFML/Graphics/Drawable.hpp> | |
#include <SFML/Graphics/RenderWindow.hpp> | |
#include <SFML/Graphics/Transformable.hpp> | |
#include <SFML/Graphics/View.hpp> | |
#include <SFML/System/Vector2.hpp> | |
#include <Utility.hpp> |
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 <tuple> | |
template<unsigned, typename...> | |
struct ntuple_impl; | |
template<unsigned N, typename E, typename... Es> | |
struct ntuple_impl<N, std::enable_if_t<(N > 1)>, E, Es...> | |
{ | |
using type = typename ntuple_impl<N - 1, void, E, E, Es...>::type; |
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
template<unsigned, typename...> | |
struct ntuple_impl; | |
template<unsigned N, typename E, typename... Es> | |
struct ntuple_impl<N, std::enable_if_t<(N > 1)>, E, Es...> | |
{ | |
using type = typename ntuple_impl<N - 1, void, E, E, Es...>::type; | |
}; | |
template<typename... Es> |