This file contains 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 ruby | |
RubyVM::InstructionSequence.compile_option = {tailcall_optimization: true, trace_instruction: false} | |
def parse_line(line) | |
case line.strip | |
when /^\s*\[\s*(.+?)\s*\]\s*$/ then {section: $1} | |
when /^\s*(.+?)\s*=\s*(.+?)\s*$/ then {key: $1, value: $2} | |
when /^\s*$/ then {} | |
else {error: line} | |
end |
This file contains 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
class ConfigParseError < StandardError | |
def initialize(file_name,line,text) | |
@file_name,@line,@text = file_name,line,text | |
super("Error in config file #{@file_name} at line #{line}. Line content \"#{@text}\" is incorrect.") | |
end | |
end | |
class ConfigReader | |
LINE_CONTINUE = /\\\s*$/ | |
def self.read_config(file_name) |
This file contains 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
(ql:quickload "cl-ppcre") | |
(ql:quickload "anaphora") | |
(defpackage :ini-parser | |
(:use :common-lisp :anaphora) | |
(:export :read-config-from-file)) | |
(in-package :ini-parser) | |
(defparameter +empty-line+ (format nil "~%")) |
This file contains 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
type length = int;; | |
type boxes = int;; | |
type temperature = int;; | |
let make_len x : length = x;; | |
let make_box x : boxes = x;; | |
let make_temp x : temperature = x;; | |
let sum_len (a:length) (b: length) : length = a+b;; | |
sum_len (make_box 5) (make_temp 10);; |
This file contains 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
-record(deal, {name, timestamp, cost, quantity}). | |
-define(deal_spec(Name, Timestamp, Cost, Quantity), is_atom(Name), is_integer(Timestamp), is_float(Cost), is_integer(Quantity), Timestamp >=0). | |
-record(report_in, {name, from_timestamp, to_timestamp, by_timestamp}). | |
-define(report_in_spec(Name, FromTimestamp, ToTimestamp, ByTimestamp), | |
is_atom(Name), | |
is_integer(FromTimestamp), | |
is_integer(ToTimestamp), | |
is_integer(ByTimestamp), | |
FromTimestamp >= 0, |
This file contains 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 ruby | |
require 'rmagick' | |
class Array | |
alias :head :first | |
def tail | |
self[1..-1] | |
end | |
end | |
module Treemap |
This file contains 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
[10:58:40] Yuliya Sadouskaya: собственно задание: | |
[11:00:02] Yuliya Sadouskaya: | |
написаны задания. Необходимо в правом столбике написать команды, которые необходимо выполнить для выполнения задания. Для каждого задания необходимо написать только одну команду. Если в скобках указана команда или переменная, тогда их обязательно надо использовать при выполнении задания. | |
[11:00:15] Yuliya Sadouskaya: трудности с командами: | |
1.Ввести в файл list.txt всю информацию (файлы и каталоги), которая находится в текущем каталоге. Всю информацию надо сортировать по времени. | |
2.Создать файл ups.txt, в котором находится случайное число ($RANDOM) | |
3.Дополнить файл list.txt информацией, какой драйвер подключен к терминалу | |
4.Создать каталоги dir и dir2 ($HOME, $PWD) | |
5.Копировать файл list.txt на каталог dir с названием list2.dat, и всю информацию из файла показать на экране(cat) |
This file contains 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
library ieee; | |
use ieee.std_logic_1164.all; | |
entity jk_trigger is | |
port ( | |
Clk, Clr, Set, J, K : in std_logic; | |
Q,notQ : out std_logic); | |
end jk_trigger; |
This file contains 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
library ieee; | |
use ieee.std_logic_1164.all; | |
entity adder is | |
port ( | |
i0 : in std_logic; | |
i1 : in std_logic; | |
ci : in std_logic; | |
s : out std_logic; |
This file contains 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
(ql:quickload (list "cl-opengl" "cl-glu" "cl-glut")) | |
(defclass my-window (glut:window) | |
() | |
(:default-initargs :width 250 :height 250 :title "lab 3" | |
:mode '(:single :rgb :depth))) | |
(defvar *angle* 0) | |
(defvar *window*) |