This file contains 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
// | |
// BlurredStatusBarView.swift | |
// | |
// Created by Filipp Fediakov on 23.11.17. | |
// Copyright © 2017 filletofish. All rights reserved. | |
// | |
import UIKit | |
class BlurredStatusBarView: UIView { |
This file contains 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
import UIKit | |
/// Work around problem described here: https://stackoverflow.com/questions/47223680/safe-area-changes-in-parent-vc-when-presenting-modally-vc-in-landscape | |
/// When presenting screen with another orientation safe area changes on first screen | |
/// that affects constraints and all layout that depends on safe area. | |
/// To avoid this bug one should use UCFixedSafeAreaLayoutConstraint that can be updated with safe | |
/// area inset using `updateAllFixedSafeAreaConstraints(newSafeAreaInsets:)` in UIViewController | |
/// | |
/// | |
/// |
This file contains 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
import Foundation | |
protocol Performable { | |
associatedtype Input | |
associatedtype Output | |
var action: (Input) -> (Output) { get } | |
var completion: (Output) -> () { get } | |
func perform(data: Input) | |
} |
This file contains 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
// вызывается для каждой переменой | |
void SSAFormer::RenameVarToSSAForm(std::string varName) { | |
counter = 0; | |
stack.clear(); | |
TraverseBBWithVar(cfg->basicBlocks.front(), varName); | |
} | |
// метод для обхода всех использований переменой, на вход принимает энтри поинт CFG | |
void SSAFormer::TraverseBBWithVar(BasicBlock *bb, std::string varName) { | |
// цикл по всем выражениям |
This file contains 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
import UIKit | |
import TableKit | |
class WSTeamsTableViewController: UITableViewController { | |
var tableDirector:TableDirector! | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
tableDirector = TableDirector(tableView: tableView, shouldUseAutomaticCellRegistration: true) |
This file contains 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
def my_int(x): | |
if len(x) == 0: | |
return -1 | |
res = 0 | |
exp = len(x) - 1 | |
for c in x: | |
digit = ord(c) - ord('0') |
This file contains 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
user_inp = input("Введите числа через пробелы: ") | |
user_list = user_inp.split() | |
res = [] | |
i = len(user_list) - 1 | |
while i >= 0: | |
res.append(user_list[i]) | |
i -= 1 |
This file contains 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
print("Введите арифметическое выражение, например 4+5−3−5+2 и нажмите Enter:") | |
expression = input("-> ") # ввод | |
res = None | |
operation = "" | |
for e in expression: # смотрим что на каждый элемент из ввода | |
if e == '+': | |
operation = '+'# запоминаем операцию | |
elif e == '-': |