Skip to content

Instantly share code, notes, and snippets.

@Intey
Intey / shell.nix
Created August 23, 2021 07:32
Nix shell with ROS for development
with import (builtins.fetchTarball https://github.com/lopsided98/nix-ros-overlay/archive/master.tar.gz) {};
# when we try `with rosPackages` and specify dist in paths, we get error:
# with repl we can find needed packages
with rosPackages.noetic;
mkShell {
buildInputs = [
gtest
@Intey
Intey / main.py
Created September 23, 2021 07:50
Досок в кубометре / цена за N досок
def planks_in_cube(height, width, length):
return (1 * 1000 ** 3) / (height * width * length)
def price_for_planks(count, cube_price, height, width, length):
planks_count_in_cube = planks_in_cube(height, width, length)
one_plank_price = cube_price / planks_count_in_cube
return one_plank_price * count
# price_for_planks(3, 36000, 50, 200, 2000)
# > 2160
/*
* Copyright 2017 The Cartographer Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
Абстрактная часть:
- понимает ООП, использует принципы SOLID (обязательно), KISS, YAGNI
- понимает алгоритмы, знает о наличии альтернатив, при необходимости осуществляет анализ и выбор наиболее оптимального под задачу
- поверхностно знает паттерны архитектуры
- имеет представление о функциональном программировании: функции высшего
порядка, каррирование
- понимает почему изменяемое состояние - это плохо, придерживается констант
- знает что такое интерфейс(void myfunc() = 0;), зачем он нужен
- умеет самостоятельно искать информацию: stackoverflow.com, cppreference.com,
etc.
@Intey
Intey / test-server.red
Created December 16, 2019 14:07
Red ZeroMQ from Red(not Red/System)
Red [
Title: "Red Jupyter kernel implementation"
Author: "Intey"
File: "%kernel.red"
Tabs: 4
License: "MIT"
; Needs: ['json 'zeromq] ;; waiting for 0.8.0
]
#system [
@Intey
Intey / annotation tools stats
Created September 11, 2019 09:05
pyhton annotation tools
https://github.com/Dumbris/trunklucator
https://github.com/KarchinLab/open-cravat
https://github.com/abreheret/PixelAnnotationTool
https://github.com/bernwang/latte *
https://github.com/bfortuner/labelml
https://github.com/chakki-works/doccano *
https://github.com/commaai/commacoloring *
https://github.com/dsgou/annotator
https://github.com/jiesutd/YEDDA
https://github.com/jveitchmichaelis/deeplabel
int main(int argc, char** argv) {
char* s;
char b = '1';
char a = '2';
char e = '\0';
s = &b;
int i = 0;
while(*s++ && i++ < 5) {
*s = '9';
}
@Intey
Intey / main.c
Last active November 1, 2018 18:36
#include <stdio.h> // scanf, printf
#include <math.h> // pow
int slen(char* s) {
int res = 0;
while(*s) { res++; s++; }
return res;
}
int fromBin(char* s) {
@Intey
Intey / main.cpp
Created October 11, 2017 18:44
C++14 style
#include <vector>
#include <functional>
#include <memory>
#include <iostream>
using namespace std;
class Unit
{
public:
@Intey
Intey / inotifywait.bash
Created December 11, 2016 11:45
wait file change and execute
#!/bin/bash
file=$1
shift
let changed=0
while [[ $changed -eq 0 ]]; do
inotifywait -e CLOSE_WRITE $file -qo /dev/null && changed=$?
echo "update with: $@"
$@