This file contains hidden or 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
## Here values of secret_offset, secret_key1, secret_key2, plaintext_01, plaintext_02 and plaintext_03 are set | |
require 'shift_ciphers' # Library's code at: https://github.com/TeWu/shift-ciphers (version 1.0.1) | |
caesar = ShiftCiphers::Caesar.new(offset: secret_offset) | |
vigenere = ShiftCiphers::Vigenere.new(secret_key1) | |
strong_vigenere = ShiftCiphers::HardenedVigenere.new(secret_key2) | |
p caesar.encrypt(plaintext_01) # => "!M;BL;AtKw;MH;ytBEd;uNM;BM;BL;PHKLx;GxOxK;MH;AtOx;MKBxw;MH;LNvvxxwe;1_AxHwHKx;)HHLxOxEM" | |
p vigenere.encrypt(plaintext_02) # => "qit$b#D1R-js+ntrt'-7U-hy+bImv-Ehw-Hv/z9$T:l6&qty\".{Go{m1@p" |
- Włóż płytę instalacyjną Windows 10 do napędu DVD
- Uruchom komputer ponownie, bootując go z tej płyty
- Po uruchomieniu instalatora kliknij w Repair your computer w lewym dolnym rogu okienka instalatora
- Wybierz Troubleshoot -> Command Prompt by otworzyć konsolę
- Wykonaj w konsoli następujące polecenia:
bootrec /FixMbr
This file contains hidden or 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
observations <- c(17.13, 17.71, 17.51, 19.39, 17.70, 19.15, 17.17, 18.48, 21.71, 19.55, 17.63, 18.55, 14.77) | |
tr <- t.test(observations, mu=18, conf.level=0.99) | |
tr # print Test Results | |
# Plot t-distribution | |
stderr <- sqrt(var(observations)/length(observations)) | |
x <- seq(-4, 4, by=0.01) | |
y <- dt(x, df=tr$parameter) | |
plot(x, y, type='l') | |
abline(v=0, col="black") |
This file contains hidden or 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
## | |
# Polynomial interpolator using both sample values and sample derivatives. | |
# Source: https://commons.apache.org/proper/commons-math/javadocs/api-3.6/org/apache/commons/math3/analysis/interpolation/HermiteInterpolator.html | |
# | |
class HermiteInterpolator | |
def initialize(*points_and_derivatives) | |
@abscissae = [] | |
@top_diagonal = [] |
This file contains hidden or 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
## | |
## Some non-binding thoughts on krpc-rb Events API. | |
## (This API Concept is probably too high-level.) | |
## | |
KRPC.connect do |client| | |
v = client.space_center.active_vessel | |
# Fires once | |
v.orbit.once :apoapsis_altitude, :change do |apo| |
This file contains hidden or 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
/// | |
/// Factorial function in lambda calculus - implemented in JS | |
/// | |
//// Lambda calculus | |
// zero = λs.λz.z | |
// succ = λn.λs.λz.s (n s z) | |
// mult = λn.λm.λs.m (n s) | |
// pred = λn.λf.λx.n(λg.λh.h (g f))(λu.x)(λu.u) | |
// minus = λn.λm.m pred n |
This file contains hidden or 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 RolesBitmaskSerializerSupport | |
extend ActiveSupport::Concern | |
RolesBitmaskSerializer = GamesBox::Serializers::RolesBitmaskSerializer | |
class_methods do | |
def serialize_as_roles_bitmask(deserialized_attr, serialized_attr) | |
deser_setter_name = "#{deserialized_attr}=".to_sym | |
ser_setter_name = "#{serialized_attr}=".to_sym |
This file contains hidden or 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
setInterval(() => $('body').css('background-color', "#"+(Math.round(Math.random()*1000000))),500) |
This file contains hidden or 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
## INSPIRED BY: Eigenvectors and eigenvalues | Essence of linear algebra, chapter 10 | |
## https://www.youtube.com/watch?v=PFDu9oVAE-g&feature=youtu.be&t=16m28s | |
require 'bigdecimal' | |
def fib(n, accuracy = 100) | |
n = BigDecimal.new(n - 1) | |
accuracy = 10 if n < 80 | |
sqrt5 = BigDecimal.new(5).sqrt(accuracy) # sqrt(p1) - Returns the square root of the value. If p1 is specified, returns at least that many significant digits. | |
# Where all the 'magic' happens: |