Skip to content

Instantly share code, notes, and snippets.

View Lukas0025's full-sized avatar

Lukáš Plevač Lukas0025

View GitHub Profile
@Lukas0025
Lukas0025 / newton_sqrt.asm
Last active August 6, 2021 12:41
Calculate sqrt using newton iteration method
;;
; Calculate sqrt using newton iteration method
; Assembly version of https://gist.github.com/Lukas0025/b6aacb8d2a5d79d51d2f9ca7cd5af2ab with fixed iteration count
; @autor Lukáš Plevač <lukas@plevac.eu>
; @date 6.8.2021
; Under CC0
;
%include "io.inc"
@Lukas0025
Lukas0025 / newton_sqrt.py
Created August 6, 2021 12:34
Calculate sqrt using newton iteration method
##
# Calculate sqrt using newton iteration method
# @autor Lukáš Plevač <lukas@plevac.eu>
# @date 6.8.2021
# Under CC0
#
import math
#
@Lukas0025
Lukas0025 / mysqli_mockup.php
Last active June 16, 2021 15:38
mysqli mockup for testing
<?php
/**
* mysqli mockup for testing
* @autor Lukáš Plevač <lukas@plevac.eu>
* @date 16.6.2021
* CC0 license - No Rights Reserved.
*
*/
/**
@Lukas0025
Lukas0025 / pi.py
Last active June 2, 2021 20:52
Calculate pi using numeric integration
# Calculate pi using numeric integration
# @autor Lukáš Plevač <xpleva07@vutbr.cz> (BUT FIT)
# @date 2.6.2021
# CC0 license - No Rights Reserved.
#
# taken from the relationship:
#
# pi * r ** 2 S of circle
# ------------ = --------------------------
# (2r) ** 2 S of square around circle
@Lukas0025
Lukas0025 / calc_pi.py
Last active September 13, 2022 19:46
Caclculate pi by random numbers
# Calculate pi by random numbers between 0 and 1
# @autor Lukáš Plevač <xpleva07@vutbr.cz> (BUT FIT)
# @date 1.6.2021
# CC0 license - No Rights Reserved.
import random
import math
##
# Calculate distance between point and [0,0]
@Lukas0025
Lukas0025 / basics.pl
Created June 1, 2021 13:13
Prolog basics
% Basics in Prolog language
% @autor Lukáš Plevač <xpleva07@vutbr.cz>
% @date 1.6.2021
% under CC0
% mod([list of numbers], mod by num, [res])
mod([], _, []).
mod([H|T], X, [G|L]) :- G is H mod X, mod(T, X, L).
%mod([H|T], X, [G|L]) :- ownmod(H, X, G), mod(T, X, L).
@Lukas0025
Lukas0025 / k-means.py
Last active May 17, 2021 20:49
Python k-means clustering
##
# k-mean clustering algoritm
# @autor Lukáš Plevač <xpleva07@vutbr.cz>
# @date 5.5.2021
# CC0 license - No Rights Reserved.
#
import numpy as np
import os