Skip to content

Instantly share code, notes, and snippets.

<p>One of the easiest ways for an epithet to lose its value is for it to become over-broad, which causes it to mean
little more than “I don’t like this”. Case in point is the term, <strong>“spaghetti code”</strong>, which people
often use interchangeably with “bad code”. The problem is that not all bad code is spaghetti code. Spaghetti
code is an especially virulent but specific <em>kind</em> of bad code, and its particular badness is instructive
in how we develop software. Why? Because individual people rarely write spaghetti code on their own. Rather,
certain styles of development process make it increasingly common as time passes. In order to assess this, it’s
important first to address the original context in which “spaghetti code” was defined: the dreaded (and mostly
archaic)&nbsp;<strong>goto</strong> statement.</p>
<p>The goto statement is a simple and powerful control flow mechanism: jump to another point in the code. It’s what
a compiled assembly program actually does
@xamgore
xamgore / lecture1.md
Last active March 18, 2019 16:59
VM lectures

Лекция 1. Зачем нужна VM, и как устроена память

Виртуализация -- это парадигма, подход к решению некоторого широкого набора задач при помощи определенной практики.

Слово "виртуальный" -- средневековая латынь, латинское слово virtualis было впервые использовано товарищем, которого граф оставил вместо себя управлять поместьем (потом появилась специальная должность виконт, viscount). Этот граф отправился в крестовый поход, а на его месте остался человек, который обладал теми же достоинствами и добродетелями, но графом не являлся.

По некоторому набору требований мы создаем что-то, что не является тем, что мы воссоздаем (либо потому, что это просто не оно, или потому, что его никогда и не было). Мы создаем модель некоторого окружения, в котором происходит функционирование некоторых сущностей.

Виртуализация -- это всегда создание некоторой "кажимости", некоторого набора условностей. Программа, которая создает набор таких "кажимостей", это и называется виртуальной машиной (монитор, который контролирует исполне

@xamgore
xamgore / python5.ipynb
Created November 13, 2017 12:33
numpy, pandas, matplotlib
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@xamgore
xamgore / python1.ipynb
Created October 22, 2017 22:06
Python. Семинар 1.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@xamgore
xamgore / python2.ipynb
Created October 22, 2017 22:05
Python. Семинар 2.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@xamgore
xamgore / cmd.md
Created June 16, 2017 08:50
Работа с cmd.exe

На этой странице приведены некоторые полезные рецепты того, как улучшить работу стандартного интерпретатора cmd.

Как запускать cmd

Win + RcmdEnter. Либо правой кнопкой мыши по пуску → «Командная строка».

Как изменить кодировку

Первый способ, динамический: заходим в cmd.exe, пишем chcp 1251. Можно создать ярлык с названием cmd-rus.exe где-нибудь в System32/,

; Note: the encoding of this file SHOULD be "UTF-8 with BOM".
; Emulate mouse-wheel tab switching on google-chrome/iron (windows version).
;
; Keys:
; • mouseWheelUp : switch to previous tab (only if the mouse is above )
; • mouseWheelDown : switch to next tab (the google-chrome/iron tab bar)
;
; Strangely, google refuses to add this feature on the windows version of google-chrome.
;
@xamgore
xamgore / cmd.md
Created March 15, 2017 13:58
Как работать с cmd

На этой странице приведены некоторые полезные рецепты того, как улучшить работу стандартного интерпретатора cmd.

Как запускать cmd

Win + RcmdEnter. Либо правой кнопкой мыши по пуску → «Командная строка».

Как изменить кодировку

Первый способ, динамический: заходим в cmd.exe, пишем chcp 1251. Можно создать ярлык с названием cmd-rus.exe где-нибудь в System32/,

@xamgore
xamgore / server.go
Created May 15, 2016 20:37
Light http over tcp server as an example of net package in Go
package main
import ("fmt"; "io"; "net"; "strings"; "sync/atomic")
var clientsCount int64 = 0
func main() {
server, _ := net.Listen("tcp", "127.0.0.1:28563")
defer server.Close()
@xamgore
xamgore / transitiv.go
Created April 23, 2016 09:27
check G² is not transitiv for any fuzzy relation G
// check G² is not transitiv for any fuzzy relation / graph G
// G² = G ∘ G, where ∘ is min-max composition
package main
import "fmt"
import "math"
type Matrix struct {
size int