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
#include <iostream> | |
struct Widget { | |
template <typename T, typename U> | |
void operator()(const T& a, const U& b) | |
{ | |
std::cout << a << " " << b << std::endl; | |
} | |
}; |
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
#include <iterator> | |
template <typename T> | |
void rotate(T begin, T end, int k) | |
{ | |
typedef typename std::iterator_traits<T>::value_type TValue; | |
// ... | |
} |
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
__author__ = 'VladimirDel' | |
import sys | |
import os | |
import csv | |
CLASSES_DIR = "/Users/VladimirDel/Projects/java/diploma/dist/data/network/kddcup/classes/" | |
OUTPUT_DIR = "/Users/VladimirDel/Projects/java/diploma/dist/data/network/kddcup/output/" | |
TEST_DATASET = "kddcup.tst" |
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
__author__ = 'VladimirDel' | |
import roman | |
import unittest | |
class KnownValues(unittest.TestCase): | |
known_values = ( (1, 'I'), | |
(2, 'II'), | |
(3, 'III'), |
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
import re | |
__author__ = 'VladimirDel' | |
class OutOfRangeError(ValueError): | |
pass | |
class NotIntegerError(ValueError): | |
pass |
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
# -*- coding: utf8 -*- | |
__author__ = 'VladimirDel' | |
import urllib.request | |
import time | |
page_url = "http://ma.hse.ru" | |
prev_text = urllib.request.urlopen(page_url).read() | |
cur_text = prev_text |
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
res = [] | |
File.open('/Users/VladimirDel/Projects/Ruby/results.txt').each_line do |line| | |
words = line.split(' ') | |
res << [line, words[-1].to_i] | |
end | |
res.sort_by! { |elem| elem[1]}.reverse! | |
current = 1 | |
res.each do |elem| |
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
#!/usr/bin/ruby | |
require 'rubygems' | |
require 'decisiontree' | |
attributes = ['Temperature'] | |
training = [ | |
[36.6, 'healthy'], | |
[37, 'sick'], | |
[38, 'sick'], |