- Включить режим разработчика на телефоне (обычно это 7 раз тапнуть на номер билда в разделе о системе)
- В настройках для разработчиков включить пункт "Отладка по USB"
- На компьютере скачать Android SDK Platform-Tools и найти директорию с
adb
- Подключить телефон по USB к компьютеру
- В командной строке запустить
adb devices
, эта команда выведет список подключенных устройств, а на телефоне появится диалоговое окно с разрешением, где надо нажать Ok. Сначала напротив имени устройства будетunknown
, после разрешения на телефоне и очередного запуска командыadb devices
напротив имени устройства будетdevice
- Теперь можно запустить
adb shell
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
public interface ICatalogue | |
{ | |
int Id { get; set; } | |
string Name { get; set; } | |
} | |
public abstract class BaseEnumController<TEnum, TViewModel> : Controller | |
where TEnum : struct, IConvertible, IFormattable | |
where TViewModel : class, ICatalogue, new() | |
{ |
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
// in addUploadFeature.js | |
/** | |
* Convert a `File` object returned by the upload input into a base 64 string. | |
* That's not the most optimized way to store images in production, but it's | |
* enough to illustrate the idea of data provider decoration. | |
*/ | |
const convertFileToBase64 = (file: any) => new Promise((resolve, reject) => { | |
const reader = new FileReader(); | |
reader.readAsDataURL(file.rawFile); |
Stephen Toub, Microsoft February 2012 Original
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
[:zero, :one, :two, :three, :four, :five, | |
:six, :seven, :eight, :nine].each.with_index do |method, index| | |
define_method method do |function = nil| | |
(function) ? function.call(index) : index | |
end | |
end | |
[[:plus, :+], [:minus, :-], | |
[:times, :*], [:divided_by, :/]].each do |(method, action)| | |
define_method method do |second_operand| |
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
let ArrayUtils = {} | |
ArrayUtils.getSquare = function(x, y) { | |
return Array.apply(null, Array(y)).map( () => Array.apply(null, | |
Array(x)).map(() => 0) ); | |
}; | |
ArrayUtils.crop = function(array) { | |
let top, bottom, left, right; | |
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 find_gcd(a, b) | |
if a == 0; b | |
elsif b == 0; a | |
elsif a == b; a | |
elsif a == 1 || b == 1; 1 | |
elsif a.even? && b.even?; 2 * find_gcd(a / 2, b / 2) | |
elsif a.even? && b.odd?; find_gcd(a / 2, b) | |
elsif a.odd? && b.even?; find_gcd(a, b / 2) | |
elsif a.odd? && b.odd?; (b > a) ? find_gcd((b - a) / 2, a) : find_gcd((a - b) / 2, b) | |
end |