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
<html> | |
<title>Laba3</title> | |
<script type="text/javascript" src="raphael.js"></script> | |
<script> | |
//var paper = Raphael(0, 0 , 1500, 800); | |
var activate = function(j) |
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
<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); | |
} |
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 <iostream> | |
using namespace std; | |
int main() | |
{ | |
string str,str1,str2; | |
int count,i,j,k,pos; | |
count=0; |
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 <iostream> | |
using namespace std; | |
int main() | |
{ | |
string str,str1,str2; | |
int count,i,j,k,pos; | |
count=0; |
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 <iostream> | |
#include <fstream> | |
using namespace std; | |
int main() | |
{ | |
string str,str1,str2,dopstr; | |
int count,i,j,k,pos,pos1,pos2; | |
ifstream fin; |
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
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 |
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
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") |
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
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: |
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
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: |
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
/* Необходимо написать функция, которая работала бы в следующем случае: | |
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) { |
OlderNewer