- Реализовать класс
Containerсо следующими методами:SetValue(value)должен устанавливать значение в контейнере вvalueGetValue()должен возвращать устанавленное значение.
Пример использования:
var ct = new Container();| class PhoneList extends Component { | |
| onRemovePhone(phone) { | |
| fetch(`${this.props.apiUrl}/${phone.id}`, { | |
| method: "delete", | |
| credentials: "same-origin" | |
| }).then(() => { | |
| this.setState(state => ({ phones: state.phones.filter(p => p.id != phone.id) })) | |
| }) | |
| import inspect | |
| def double(x): | |
| """ doubles the argument. """ | |
| return x * 2 | |
| def main(): | |
| print(inspect.getdoc(double)) | |
| main() |
| class Locker: | |
| __value = None | |
| def set(self, value): | |
| self.__value = value | |
| def get(self): | |
| return self.__value | |
| import sys | |
| class InvIn(ValueError): pass | |
| def main(): | |
| filename = get_string("Choose filename", name = "filename", default = "test") | |
| flagNS = False | |
| Editing = False | |
| TheSet = set() | |
| User = None | |
| MakeOrFind(filename) | |
| while(True): |
| /* | |
| Word list by frequency | |
| Written by Igor N. Dultsev | |
| Tested to compile by Visual C++ Compiler version 19.10.24903.0 (x86) with no additional keys | |
| For compilation with g++, use the following command: g++ -std=c++14 word-freq-list.cc | |
| */ | |
| #include <iostream> | |
| #include <map> |
| #include <stdio.h> | |
| int foo(struct { int hui; } *klimov) { | |
| return klimov->hui * 42; | |
| } | |
| int main() { | |
| struct { int hui; } klmv; | |
| klmv.hui = 42; |
| int main () { | |
| int value = 18361; // присвоит в value 18361 | |
| int outsys = 6; // присвоит в outsys 6 | |
| while (value > 0) { // пока value > 0, условие вычислится в true. заходим | |
| printf ("%d", value % outsys); // выведет value % outsys == 18361 % 6 == 1, 0, 0, 1, 2, 2 | |
| value = (value / outsys); // запишет в value 3060, 510, 85, 14, 2, 0 | |
| } | |
| return 0; // выйдет | |
| } |
| #%RAML 0.8 | |
| title: New API | |
| version: v1 | |
| baseUri: http://api.samplehost.com | |
| /helloWorld: | |
| get: | |
| responses: | |
| 200: | |
| body: | |
| application/json: |
| #%RAML 0.8 | |
| title: New API | |
| version: v1 | |
| baseUri: http://api.samplehost.com | |
| /helloWorld: | |
| get: | |
| responses: | |
| 200: | |
| body: | |
| application/json: |