Kornel Koszela
kornel@koszela.me
KoNaR, 27.10.2022
Miro
Taiga
Figma
Macie JetBrains za darmo
Ja nie, dlatego spędziłem wieczność konfigurując VSCode
$ docker compose --file ./docker/docker-compose.yml down && \
docker compose --file ./docker/docker-compose.yml up
$ cat ~/.bashrc
#!/bin/bash
alias compose="docker compose --file ./docker/docker-compose.yml"
alias compose_rebuild="compose down && compose up"
$ compose up
$ compose_rebuild
def fizzbuzz(n: int) -> str:
answer = ""
if x % 3 == 0:
answer += "fizz"
if x % 5 == 0:
answer += "buzz"
if answer == "":
answer = str(n)
return answer
import pytest
@pytest.mark.parametrize("input", [3, 6, 9, 12])
def test_fizz(input):
assert fizzbuzz(input) == "fizz"
@pytest.mark.parametrize("input", [5, 10, 20])
def test_buzz(input):
assert fizzbuzz(input) == "buzz"
@pytest.mark.parametrize("input", [15, 30])
def test_fizzbuzz(input):
assert fizzbuzz(input) == "fizzbuzz"
@pytest.mark.parametrize("input", [1, 2, 4])
def test_number(input):
assert fizzbuzz(input) == str(input)
while(theWorldTurns) {
if(isMorning || day != "Monday" && !sesja) {
try {
if (env.debugMode()) {
System.out.println("Hello, world!");
}
}
catch (BadDay e) {
System.out.println("Yikes!");
}
}
}
const log_debug = (data) => {
if (env.debugMode()) {
System.out.println(data);
}
}
const morning_routine = () => {
try {
log_debug("Hello, world!");
} catch (BadDay e) {
System.out.println("Yikes!");
}
}
const isGoodMorning = () => {
return isMorning || day != "Monday" && !sesja;
}
while(theWorldTurns) {
if(!isGoodMorning()) {
continue;
}
morning_routine();
[...]
}
float Q_rsqrt(float y){
long i;
float x2, y;
const float threehalfs = 1.5F;
x2 = number * 0.5F;
y = number;
i = * ( long * ) &y; // evil floating point bit level hacking
i = 0x5f3759df - ( i >> 1 ); // what the fuck?
y = * ( float * ) &i;
y = y * ( threehalfs - ( x2 * y * y ) ); // 1st iteration
// 2nd iteration, this can be removed
// y = y * ( threehalfs - ( x2 * y * y ) );
return y;
}
float inverse_sqrt(float number){
return 1.0/sqrt(number);
}
#include
#include
struct sensor{
GPIO_TypeDef sensorPort;
uint16_t sensorPin;
uint16_t sensorValue;
} sensor;
bool check_sensor(struct sensor* arr[]){
for(int i=0;i++;i<5){
if(arr[i]->sensorValue>50){
return true;
}
else{
return false;
}
}
}
#include
#include
struct sensor{
GPIO_TypeDef sensorPort;
uint16_t sensorPin;
uint16_t sensorValue;
} sensor;
bool check_sensor(struct sensor* arr[]){
for(int i=0;i++;i<5){
if(arr[i]->sensorValue>50){
return true;
}
else{
return false;
}
}
}