Skip to content

Instantly share code, notes, and snippets.

View Bandd-k's full-sized avatar

Denis Karpenko Bandd-k

  • HSE Student
  • Moscow
View GitHub Profile
import sys
FIN = open('input.txt', 'r')
x = FIN.read().split()[:-1]
prev = -999
cur = 0
answer = 0
# max increase
for element in x:
class SectionModel {
var items: [Any] {
didSet {
print("aaa")
}
}
var numberOfItems: Int { return items.count }
init(items: [Any]) {
self.items = items
}
struct Section<CellType: UICollectionViewCell, ModelType: AnyObject> {
var numberOfItems: Int { return elements.count }
var elements: [ModelType]
var identifier: String { return String(describing: type(of: ModelType.self)) }
var configurator: CollectionCellConfigurator<CellType, ModelType>
}
protocol Configurator {
var configureCell: (UICollectionViewCell, AnyObject) -> () { get set }
@Bandd-k
Bandd-k / denis.md
Last active April 1, 2018 23:03
try

Life WWDC Game

Created by Denis Karpenko

It is a very colorful and bright implementation of amazing "Game of Life" which devised by the British mathematician John Horton Conway in 1970

Rules of Game

  • Any animal with fewer than two live neighbors dies as if caused by underpopulation
  • Any animal with two or three neighbors lives on to the next generation
  • Any animal with more than three neighbors dies, as if by overpopulation
  • Any empty cell with exactly three live neighbors becomes an animal, as if by reproduction
@Bandd-k
Bandd-k / CellApproximation.swift
Created December 11, 2017 10:34
Ячейка/КолвоСимоволов
//iphone 8
// высота 57.5 количество элементов: 49
// высота 98.0 количество элементов: 111
// высота 77.5 количество элементов: 75
// высота 98.0 количество элементов: 93
// высота 98.0 количество элементов: 113
// высота 57.5 количество элементов: 37
// высота 118.0 количество элементов: 142
// высота 57.5 количество элементов: 41
// высота 77.5 количество элементов: 81
import requests
import shutil
import urllib3
import csv
base_url = "http://warashi-asian-pornstars.fr"
def downloadImage(url,imgName="img.jpg"):
r = requests.get(url, stream=True)
with open(imgName, 'wb') as f:
r.raw.decode_content = True
SMALL ROBOT
ssh pi@192.168.1.213
пароль raspberry
cd Desktop/Eurobot/NewCommunication
python small.py
BIG ROBOT
ssh pi@192.168.1.200
пароль raspberry
cd Desktop/.../Sucker
var date:Date?{
didSet{
if(date != nil && (messageLabel.text != nil) ){
let currentDate = Date()
let formatter = DateFormatter()
formatter.dateStyle = .medium
formatter.timeStyle = .none
if(formatter.string(from: date!) != formatter.string(from: currentDate)){
timeLabel.text = "\(formatter.string(from: date!))"
}
@Bandd-k
Bandd-k / live_pos.py
Last active August 2, 2017 08:22
Python sript which detects cpecial LED marker and determines a position.
# Launch script on the lab computer(Manual)
# 1)log in (standart lab password)
# 2) launch command line
# 3) command 'idle'
# 4) go to recent files and open finalScript)
# 5) plug in camera
# 6) put on 950 nm ir-filter
# 7) run script
# 8) Good Job!
import cv2

Tutorial

  1. Download FireSSH (Windows)
  2. Connect to Skoltech Guest network
  3. Name: pi, adress: 10.30.65.151, login: pi, password: raspberry
  4. Connect
  5. use command 'cd Desktop/Eurobot-2017/NewCommunication/'
  6. Move robot to right position!
  7. use command 'python main_file.py' to start robot
  8. Well Done!