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
#include <utility> | |
#include <unordered_set> | |
#include <vector> | |
#include <stack> | |
using std::pair; | |
using std::make_pair; | |
using std::unordered_set; | |
using std::vector; | |
using std::stack; |
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
import random; import operator; from six.moves import range, reduce | |
def swap(arr, iv, ip, dir): | |
if iv == ip + dir: arr[iv], arr[ip] = arr[ip], arr[iv] | |
else: arr[iv], arr[ip + dir], arr[ip] = arr[ip + dir], arr[ip], arr[iv] | |
shift = lambda (cmp, dir, arr, ip), iv: (cmp, dir, arr, ip) if cmp(arr[iv], arr[ip]) else (swap(arr, iv, ip, dir) or (cmp, dir, arr, ip + dir)) | |
def qs(arr, bgn=0, end=None): | |
if end is None: end = len(arr) - 1 - bgn | |
if end - bgn < 1: return arr | |
ip = bgn if end - bgn == 1 else random.randint(bgn + 1, end - 1) | |
_, _, _, ipl = reduce(shift, range(ip - 1, bgn - 1, -1), (operator.le, -1, arr, ip)) |
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
//в 6м кодексе нет возможности работать с кукисами, | |
//все хранится в базе | |
function DoSearch() { | |
// без этого костыля поиск по сборникам в клиенте не работает | |
if (null != window.getSearchFormLength) { | |
var len = window.getSearchFormLength(); | |
if (len > 400) { | |
alert('Для выполнения поиска, пожалуйста, конкретизируйте запрос путем уменьшения поисковых условий.'); | |
return false; |
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
//==== Козарь 26.06.2007 списки из клиента подглючивают в showModalDialog | |
//==== Miguel 05.07.2007 можно подумать, они хоть где-то хоть как-то не подглючивают |
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
/// <summary> | |
/// Получить имя файла для сохранения изображения | |
/// </summary> | |
/// <param name="filePrefix">префикс имени файла</param> | |
/// <returns>StringBuilder, в который уже записано имя файла</returns> | |
private StringBuilder GetImageFileName(string filePrefix) | |
{ | |
Logger.LogVerbose(Message.DebugVerbose, "call"); | |
var fileName = new StringBuilder(); |
NewerOlder