char *escapeString(char *str) {
char *result, *temp;
int i;
temp = malloc(strlen(str)*2+1);
i = 0;
while (*str) {
switch(*str) {
case '\n':
temp[i++] = '\\';
temp[i++] = 'n';
break;
case '\r':
temp[i++] = '\\';
temp[i++] = 'r';
break;
case ':':
case '$':
case '\\':
temp[i++] = '\\';
default:
temp[i++] = *str;
}
str++;
}
temp[i] = 0;
result = malloc(i+1);
strcpy(result, temp);
free(temp);
return result;
}
. +-м(1)-о(1)-б(1)-и(1)-л(1)-ь(1)
.а(3)-в(3)-т(3)-о(3)+
. +-с(1)-т(1)-р(1)-а(1)-д(1)-а(1)
Затем обходим дерево, там где сумма счётчиков в дочерних узлах не равна счётчику в родительском - заканчивается слово, а разность между суммами даёт количество этих слов в тексте. $size = filesize($_FILES['file']['tmp_name']);
$data = fread(fopen($_FILES['file']['tmp_name'], "r"), $size);
$descr = trim($_POST['form_description']);
$name = $_FILES['file']['name'];
$type = $_FILES['file']['type'];
$request = $dbh->prepare("INSERT INTO `binary_data` ".
"(`description`, `bin_data`, `filename`, `filesize`, `filetype`) ".
"VALUES (?, ?, ?, ?, ?)");
$resuest->bind_param('sbsis', $descr, $data, $name, $size, $type);
$request->execute();
$id = $dbh->insert_id;
man rsync
...
--del an alias for --delete-during
--delete delete files that don't exist on sender
--delete-before receiver deletes before transfer (default)
--delete-during receiver deletes during xfer, not before
--delete-after receiver deletes after transfer, not before
--delete-excluded also delete excluded files on receiver
...
AllowTcpForwarding yes
X11Forwarding yes
X11DisplayOffset 10
X11UseLocalhost yes
Перезапускаете sshd.xhost +
ForwardAgent yes
ForwardX11 yes
Соединяетесь с десктопом по sshssh -Y user@desktop
SELECT `e1`.`user2` FROM `event` AS `e1`
INNER JOIN `event` AS `e2` ON `e1`.`user2` = `e2`.`user1`
WHERE `e1`.`user1` = $user AND `e2`.`user2` = $user
SELECT `e1`.`user1`, `e1`.`user2` FROM `event` AS `e1`
INNER JOIN `event` AS `e2` ON `e1`.`user2` = `e2`.`user1` AND `e1`.`user1` = `e2`.`user2`
WHERE `e1`.`user1` < `e1`.`user2`