- Реализовать класс
Containerсо следующими методами:SetValue(value)должен устанавливать значение в контейнере вvalueGetValue()должен возвращать устанавленное значение.
Пример использования:
var ct = new Container();| #include <stdio.h> | |
| int foo(struct { int hui; } *klimov) { | |
| return klimov->hui * 42; | |
| } | |
| int main() { | |
| struct { int hui; } klmv; | |
| klmv.hui = 42; |
| /* | |
| 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> |
| 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): |
| class Locker: | |
| __value = None | |
| def set(self, value): | |
| self.__value = value | |
| def get(self): | |
| return self.__value | |
| import inspect | |
| def double(x): | |
| """ doubles the argument. """ | |
| return x * 2 | |
| def main(): | |
| print(inspect.getdoc(double)) | |
| main() |
| 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 render from './my-awesome-component.render' | |
| class MyAwesomeComponent extends Component { | |
| constructor() { | |
| super() | |
| this.state = { | |
| data: ['First item', 'Second Item'] | |
| } | |
| this.render = render.bind(this) | |
| } |
| yhaskell@kallahan:~/Programming/dotnet/reverse $ cat test.py | |
| def reverse(str): | |
| return str[::-1] | |
| print(reverse('les misérables')) | |
| yhaskell@kallahan:~/Programming/dotnet/reverse $ python3 test.py | |
| selbaŕesim sel |
| import { Model, model, connect, primary } from 'mysql-records' | |
| import { createHash } from 'crypto' | |
| const dbc = connect('localhost', 'mysql-user', 'mysql-password', 'mysql-db') | |
| @model(dbc, 'users') | |
| export class User extends Model { | |
| @primary id: number | |
| username: string | |
| password: string |