Skip to content

Instantly share code, notes, and snippets.

@SeqviriouM
SeqviriouM / ModelLaba3
Created November 29, 2012 13:27
AnalyzShemy
<html>
<title>Laba3</title>
<script type="text/javascript" src="raphael.js"></script>
<script>
//var paper = Raphael(0, 0 , 1500, 800);
var activate = function(j)
@SeqviriouM
SeqviriouM / Mnogomerpoisk
Created December 2, 2012 10:43
Mnogomerpoisk
<script>
var f = function(x1,x2)
{
return (x1-5)*(x1-5)+(x2-4)*(x2-4)
}
var func = function(a,b,c,d,s)
{
return (a-s*b-5)*(a-s*b-5)+(c-s*d-4)*(c-s*d-4);
}
#include <string>
#include <iostream>
using namespace std;
int main()
{
string str,str1,str2;
int count,i,j,k,pos;
count=0;
#include <string>
#include <iostream>
using namespace std;
int main()
{
string str,str1,str2;
int count,i,j,k,pos;
count=0;
@SeqviriouM
SeqviriouM / gist:6767033
Created September 30, 2013 17:16
Task3
#include <string>
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
string str,str1,str2,dopstr;
int count,i,j,k,pos,pos1,pos2;
ifstream fin;
@SeqviriouM
SeqviriouM / gist:7100356
Last active December 26, 2015 05:19
Homework_1
import re
error = re.compile("<(kernel|initrd|cmdline)>.*$")
boot = re.compile("<boot dev='hd'/>.*$")
fr = open('input.xml','r')
fw = open('output.xml','w')
not_change = True
@SeqviriouM
SeqviriouM / Runlevel
Created October 24, 2013 15:00
Homework_2_Runlevel
import re,tarfile
runlevel = re.compile("env DEFAULT_RUNLEVEL=\d*$")
initdefault = re.compile(".*:initdefault:.*$")
# Open archive
tar_archive = tarfile.open("etc.tar.gz", "r:gz")
# Extract necessary file
file = tar_archive.extractfile("etc/init/rc-sysinit.conf")
@SeqviriouM
SeqviriouM / IPv6
Created October 31, 2013 14:17
Homework_3_IPv6
import re
fr = open('access.log','r')
ip = re.compile('^([0-9a-fA-F]?[0-9a-fA-F]?[0-9a-fA-F]?[0-9a-fA-F]?(:| )){1,8}')
count = 0
for line in fr:
if ip.search(line) != None:
import re,tarfile
lxc = re.compile("sys/fs/cgroup/cpuacct/lxc/.*/cpuacct.usage$")
tar_archive = tarfile.open("input.tgz", "r:gz")
lxc_time = 0
lxc_name = ''
for tarname in tar_archive:
@SeqviriouM
SeqviriouM / func_with_random_brackets
Created April 9, 2014 14:52
Функция с произвольным количеством скобок
/* Необходимо написать функция, которая работала бы в следующем случае:
var x = add(1)(5)(7)(11)(3) ...
console.log(x+10);
Должно вывести: 1+5+7+11+3+10 = 37
Кол-во скобок в функции add может быть произвольным.
*/
add.result = 0;
function add(x) {