Skip to content

Instantly share code, notes, and snippets.

View Makazone's full-sized avatar

Makar Makazone

  • Silicon Valley Insight
  • Moscow
View GitHub Profile
/* Author: Stetsenko Makar */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <math.h>
#include <time.h>
#define MIN 1
@Makazone
Makazone / git_snippets
Created July 13, 2015 08:07
Useful git commands
#The tools to compare branches:
git diff b1..b2
git log b1..b2
git shortlog b1..b2
# See files different in two branches
git diff --name-status b1..b2
#Optimal git text width (based on http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)
:set textwidth=72 # vim setting
import itertools
import sys
from operator import itemgetter
def getScore(p1, p2, el):
if p1.count(el) > p2.count(el):
return 1
elif p1.count(el) < p2.count(el):
return -1
else:
@Makazone
Makazone / matan.m
Created November 16, 2015 19:57
Complex plain transformation, task 3 N = 8
function [ output_args ] = untitled2( input_args )
figure
hold on
n = 8; % too lazy to hold shift
center = (2*n+1 - 1i*n) / (n+5);
radius = (n+3)/(2*n+1);
% plot(real(center), imag(center), '.g')
@Makazone
Makazone / matan2.m
Last active November 17, 2015 08:50
figure
hold on
% Построим область
for x = -2:0.1:2
for y = -2:0.1:2
z = x + 1i*y;
if (abs(z-(17-8*1i)/13) > 17/11)
plot(x, y, '*r')
newZ = z2(z);
@Makazone
Makazone / pollard_base.cpp
Created November 29, 2015 18:10
p-1 Pollard Factorization algorithm
#include <iostream>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <vector>
using namespace std;
typedef unsigned long long ull;
@Makazone
Makazone / data.json
Created December 1, 2015 12:29
Backend for test iOS project
{
"events": [
{
"title": " LA FORZA DEL DESTINO - VERDI",
"type": "opera",
"dates": ["2015-12-21", "2016-01-21"],
"tickets_left": 123,
"overview": "La forza del destino (The Power of Fate, often translated The Force of Destiny) is an Italian opera by Giuseppe Verdi. The libretto was written by Francesco Maria Piave based on a Spanish drama, Don Alvaro o la fuerza del sino (1835), by Angel de Saavedra, 3rd Duke of Rivas, with a scene adapted from Friedrich Schiller's Wallensteins Lager. It was first performed in the Bolshoi Kamenny Theatre of Saint Petersburg, Russia, on 22 November 1862. \n After some further revisions, performances in Rome in 1863 (as Don Alvaro) and Madrid (with the Duke of Rivas, the play's author, in attendance) followed shortly afterwards, and the opera subsequently travelled to New York and Vienna (1865), Buenos Aires (1866) and London (1867). Verdi made other revisions, with additions by Antonio Ghislanzoni. This version, which premiered at La Scala,
@Makazone
Makazone / protocols.swift
Created January 27, 2016 20:39
Protocol inheritance in Swift
//: Playground - noun: a place where people can play
import UIKit
protocol A { }
protocol B: A { }
class MyClass: B { }
let b: [B] = (1...3).map { MyClass(indx: $0) }
function [y] = Fred_II_Rect(K,f,a,b,h)
x = a:h:b;
n = size(x,2);
wt = 1/2;
wj = 1;
A = zeros(n);
for i = 1:n
A(i,1)= h*wt*K(x(i),x(1));

Keybase proof

I hereby claim:

  • I am Makazone on github.
  • I am makarst (https://keybase.io/makarst) on keybase.
  • I have a public key whose fingerprint is C86E F424 D8AD 5DCD EE3D 9F71 9D09 F341 9BE3 7A93

To claim this, I am signing this object: