Skip to content

Instantly share code, notes, and snippets.

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;
@yhaskell
yhaskell / liz.md
Last active November 13, 2016 13:11

Задание для Полежаевой Елизаветы

  • Реализовать класс Container со следующими методами:
    • SetValue(value) должен устанавливать значение в контейнере в value
    • GetValue() должен возвращать устанавленное значение.

Пример использования:

var ct = new Container();
@yhaskell
yhaskell / code.c
Last active October 7, 2015 16:05
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:
@yhaskell
yhaskell / begin.raml
Last active September 28, 2015 19:58
#%RAML 0.8
title: New API
version: v1
baseUri: http://api.samplehost.com
/helloWorld:
get:
protocols:
- HTTP
- HTTPS
responses: