This file contains hidden or 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 <stdlib.h> | |
| #include <math.h> | |
| #include <curses.h> | |
| #include <cmath> | |
| #include <algorithm> | |
| #include <iostream> | |
| #include <time.h> | |
| // Задача 1 | |
| // Исходн массив заполнен случайными числами |
This file contains hidden or 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
| 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> |
This file contains hidden or 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
| #!/bin/bash | |
| ##################################################### | |
| # Name: Bash CheatSheet for Mac OSX | |
| # | |
| # A little overlook of the Bash basics | |
| # | |
| # Usage: | |
| # | |
| # Author: J. Le Coupanec | |
| # Date: 2014/11/04 |
This file contains hidden or 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 <string> | |
| #include <stdio.h> | |
| #include <iostream> | |
| #include <fstream> | |
| #include <sstream> | |
| using namespace std; | |
| int main() | |
| { |
This file contains hidden or 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 <stdlib.h> | |
| #include <math.h> | |
| #include <curses.h> | |
| #include <cmath> | |
| #include <algorithm> | |
| #include <iostream> | |
| #include <time.h> | |
| int main(int argc, const char * argv[]) | |
| { |
This file contains hidden or 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 <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; |
This file contains hidden or 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
| факториал 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(:+) } |
This file contains hidden or 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 <stdlib.h> | |
| #include <math.h> | |
| #include <curses.h> | |
| #include <cmath> | |
| #include <algorithm> | |
| #include <iostream> | |
| #include <time.h> | |
| // функция, которая получает и выводит на пачеть | |
| // *ptr - указатель на нулевой элемент |
This file contains hidden or 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/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 |
This file contains hidden or 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
| 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++ { |