Skip to content

Instantly share code, notes, and snippets.

Denis Karpenko Bandd-k

  • HSE Student
  • Moscow
Block or report user

Report or block Bandd-k

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View maxSequence.py
import sys
FIN = open('input.txt', 'r')
x = FIN.read().split()[:-1]
prev = -999
cur = 0
answer = 0
# max increase
for element in x:
View DenisTableView.swift
class SectionModel {
var items: [Any] {
didSet {
print("aaa")
}
}
var numberOfItems: Int { return items.count }
init(items: [Any]) {
self.items = items
}
View test.swift
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 }
View denis.md

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 Dec 11, 2017
Ячейка/КолвоСимоволов
View CellApproximation.swift
//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
View download.py
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
View Launch
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
View date.swift
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 Aug 2, 2017
Python sript which detects cpecial LED marker and determines a position.
View live_pos.py
# 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
View Robot Launch Tutorial.md

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!
You can’t perform that action at this time.