Skip to content

Instantly share code, notes, and snippets.

View rgordeev's full-sized avatar

Roman Gordeev rgordeev

View GitHub Profile
@rgordeev
rgordeev / scala-session-5.exercise.scala
Created December 10, 2015 13:39
scala homework #5
// Lutz Prechelt: An Empirical Comparison of Seven Programming Languages
val in = scala.io.Source.fromURL("http://lamp.epfl.ch/files/content/sites/lamp/files/teaching/progfun/linuxwords.txt")
val words: List[String] = in.getLines().toList
val mnemonics: Map[Char, String] = Map('2' -> "ABC", '3' -> "DEF", '4' -> "GHI", '5' -> "JKL", '6' -> "MNO", '7' -> "PQRS", '8' -> "TUV", '9' -> "WXYZ", '0' -> " ")
/*
Получаем на основе карты `mnemonics` отношение Цифра -> Символ
@rgordeev
rgordeev / scala-session-4.exercise.scala
Created November 30, 2015 12:40
scala homework #4
/**
* User: rgordeev
* Date: 30.11.15
* Time: 16:15
*/
package patmat
import common._
@rgordeev
rgordeev / scala-session-3.exercise.scala
Created November 16, 2015 12:49
scala homework #3
// Натуральные числа
abstract class Nat{
// является ли нулем
def isZero: Boolean
// возвращает предыдущее натуральное число
def predecessor: Nat
// возвращает следущее натуральное число
def successor: Nat = new Succ(this)
// возвращает результат сложения с that
def +(that: Nat): Nat
@rgordeev
rgordeev / The Technical Interview Cheat Sheet.md
Last active August 28, 2015 13:09 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
@rgordeev
rgordeev / deploy.yml
Last active August 29, 2015 14:20 — forked from mokevnin/Dockerfile
- hosts: localhost
gather_facts: no
tasks:
- local_action:
module: slack
domain: hexlet.slack.com
token: {{ slack_token }}
msg: "deploy started: {{ rails_env }}:{{ hexlet_image_tag }}"
channel: "#operation"
username: "{{ ansible_ssh_user }}"