Skip to content

Instantly share code, notes, and snippets.

View mAlishera's full-sized avatar

Ekaterina mAlishera

  • Berlin, Germany
View GitHub Profile
@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 / 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 / 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 / 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 / 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
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>
#include <stdlib.h>
#include <math.h>
#include <curses.h>
#include <cmath>
#include <algorithm>
#include <iostream>
#include <time.h>
// Задача 1
// Исходн массив заполнен случайными числами
//
int x;
int d[] = {3, 4, 5, 6};
x = d[2] + 3*d[3];
const int N = 10;
int i, a[N];
for(i=0; i<N; i++) {
printf("Введите a[%d]: ", i)
scanf("%d\n", &a[i]);
int main(int argc, const char * argv[]) {
int num, new_num(0), i(0), new_i(0), temp_i;
printf("введите x\n");
scanf("%i", &num);
temp_i = i;
while (i <= num) {
while (i) {
new_i = i*10 + (i % 10);
i = i/10;
@mAlishera
mAlishera / configs_controller.rb
Last active February 20, 2017 15:18
Skip token verification
class ConfigsController < ApplicationController
skip_before_filter :verify_authenticity_token, only: [:create, :new]
...
end