Skip to content

Instantly share code, notes, and snippets.

View selevit's full-sized avatar

Sergey Levitin selevit

View GitHub Profile
#!/usr/bin/env python
#!-*- coding: utf-8 -*-
import time
import sys
class TestObject:
def __del__(self):
print "Destructor occured..."
#include <iostream>
#include <cmath>
#include <cstdlib>
using namespace std;
// Проверяет, четное ли число
bool is_even(int num)
{
return num % 2 == 0;
/* Дана последовательность, для */
#include <iostream>
#include <cmath>
using namespace std;
// Найти значение выражения
double get_expr_val(double a, double b, double x, double y, double z)
{
double part1 = log(a + b);
double part2 = pow(log(x + y), 3) / log(z + 2);
program matr;
type
matrix = array [1..5, 1..3] of integer;
var
a: matrix; { двумерный массив }
i, j: integer; { индексы массива }
{ количество элементов массива, которые без остатка
делятся на собственный индекс (строки или столбца }
program clock;
var
C: Integer; { часы }
M: Integer; { минуты }
S: Integer; { секунды }
NEW_C: Integer; { часы через 15 секунд }
NEW_M: Integer; { минуты через 15 секунд }
NEW_S: Integer; { секунды через 15 секунд }
#include <iostream>
using namespace std;
int main()
{
setlocale(LC_ALL, "Russian");
int mass [15];
int sr=0, j=0;
for (int i=0;i<15;i++)
{
#include <iostream>
using namespace std;
int main()
{
setlocale(LC_ALL, "Russian");
int mass [15];
int sr, j=0;
for (int i=0;i<15;i++)
{
<?php
$str = $_GET['someString'];
$resp = array(
'hash' => md5($str),
'price' => 1200,
'time' => time(),
);
header('Content-type: application/json');
@selevit
selevit / part1.pro
Created September 17, 2012 19:33
Qt Address Book Tutorial — Part 1
SOURCES = addressbook.cpp \
main.cpp
HEADERS = addressbook.h
# install
target.path = $$[QT_INSTALL_EXAMPLES]/tutorials/addressbook/part1
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS part1.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/tutorials/addressbook/part1
INSTALLS += target sources
@selevit
selevit / main.cpp
Created September 17, 2012 19:32
Qt Address Book Tutorial — Part 1
/****************************************************************************
**
** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the examples of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows: