Skip to content

Instantly share code, notes, and snippets.

View mAlishera's full-sized avatar

Ekaterina mAlishera

  • Berlin, Germany
View GitHub Profile
#include <stdlib.h>
#include <math.h>
#include <curses.h>
#include <cmath>
#include <algorithm>
#include <iostream>
#include <time.h>
// Задача 1
// Исходн массив заполнен случайными числами
pry(3)> {status, _body} =
...(3)> NDCEx.request(:SeatAvailability, test_data[:SeatAvailability], provider_config, consumer_config)
20:00:01.868 [debug] <?xml version="1.0" encoding="UTF-8" ?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns="http://www.iata.org/IATA/EDIST">
<SeatAvailabilityRQ>
<Document>
<MessageVersion>1.3</MessageVersion>
</Document>
@mAlishera
mAlishera / bash-cheatsheet.sh
Created April 9, 2017 19:44 — forked from LeCoupa/bash-cheatsheet.sh
Bash CheatSheet for UNIX Systems
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04
@mAlishera
mAlishera / 10_04_17_clr.cpp
Last active April 10, 2017 19:28
считает количество гласных в строках файла и выводит строку с максимальным количеством
#include <string>
#include <stdio.h>
#include <iostream>
#include <fstream>
#include <sstream>
using namespace std;
int main()
{
@mAlishera
mAlishera / laba_06_04_17.cpp
Created April 10, 2017 19:42
1 - отсортировать столбцы матрицы, 2 -четные выше гл диагонали - поменять на максимум
#include <stdlib.h>
#include <math.h>
#include <curses.h>
#include <cmath>
#include <algorithm>
#include <iostream>
#include <time.h>
int main(int argc, const char * argv[])
{
@mAlishera
mAlishera / 06_04_17.cpp
Created April 12, 2017 07:45
лекция
#include <stdlib.h>
#include <math.h>
#include <curses.h>
#include <cmath>
int main(int argc, const char * argv[])
{
// заполняем двумерный массив рандомными значениями
const int R = 15;
const int C = 12;
@mAlishera
mAlishera / 12_04_17.txt
Last active September 26, 2018 11:31
Информатика д/з
факториал Ruby
2.3.1 :001 > def factorial n
2.3.1 :002?> n > 1 ? n * factorial(n - 1) : 1
2.3.1 :003?> end
2.3.1 :004 > factorial(3)
=> 6
Фибоначчи Ruby one line
2.5.1 :025 > print (1...10).inject( [0, 1] ) { | fib | fib << fib.last(2).inject(:+) }
@mAlishera
mAlishera / laba_13_04_17.cpp
Created April 20, 2017 12:26
1 - сдвиг массива влево до минимального и потом вправо до максимального, 2 - сортировка матрицы по столбцам
#include <stdlib.h>
#include <math.h>
#include <curses.h>
#include <cmath>
#include <algorithm>
#include <iostream>
#include <time.h>
// функция, которая получает и выводит на пачеть
// *ptr - указатель на нулевой элемент
@mAlishera
mAlishera / damerau_levenshtein_distance.rb
Created March 3, 2019 21:34 — forked from dhruvasagar/damerau_levenshtein_distance.rb
Damerau-Levenshtein distance for ruby in C
#!/usr/bin/env ruby1.9
# encoding: UTF-8
require 'rubygems'
require 'inline'
require 'time'
class DamerauLevenshtein
def distance(str1, str2, block_size=2, max_distance=10)
res = distance_utf(str1.unpack("U*"), str2.unpack("U*"), block_size, max_distance)
(res > max_distance) ? nil : res
@mAlishera
mAlishera / damerau_levenshtein.go
Created March 3, 2019 21:57
Proper Damerau-Levenshtein edit distance algorithm in Go
package damerau_levenshtein
// O(|s| x |t|)
// a and b are zero-indexed, not one-indexed
func Distance(s, t string) int {
var i, j, cost int
m, n := len(s), len(t)
d := make([][]int, m+1)
for i = 0; i <= m; i++ {