@Fox Привет.Я описывал задачу в этой теме https://community.bablosoft.com/topic/27417/вызов-многопоточной-функции
Дело в том,что я не могу вообще никак перевести свой скрипт на многопоток,у меня тупо,что в вызове функции в многопоток,что просто обычный многопоток,выполняет свою работу с данными по очереди,а не одновременно.И это очень сильно бьет по времени,а нужна именно скорость обработки.Все уже готово и скрипт рабочий полностью,но скорость обработки заставила воспользоваться многопотоком.Ранее,подобных проблем не замечал,а сейчас элементарную задачу не могу уже несколько дней решить.
Скрипт очень простой и работает без браузера вообще,в скрипте используется только одно взаимодействие с гет запросом.Пример скрипта я приложил в этой теме(но без запросов),он точно почти такой же,как и основа.
Логика такова:
1)Запускается скрипт (без всяких ресурсов изначально и данных) и создаются два ресурса.
2)Делается запрос на сайт,который обрабатывается в отдельной функции,т.е. обрабатывает полученные строки и записывает в ресурс.
3)Вызывается функция в несколько потоков,которая работает (должна работать) с каждой строкой из созданного ранее ресурса(уникальной)в отдельном потоке.Данные обрабатываются и записываются во второй ранее созданный ресурс.
4)Как только данные обработаны,ресурс переводится в список и список записывается в файл.Более ничего не делается.
-Сперва я думал,что проблема в создаваемых в ходе работы ресурсах,но нет.Создавал изначально ресурсы и то же самое было.
-Потом пробовал брать из файлов значения\потом создавать файлы по ходу и из них брать данные\сохранять напрямую пытался и.т.д
-Возможно думал стоят какие то ограничения из за слабого пк с 4 гб оперативы и взял сервер с 64 гб,но как обрабатывалась строка за 5 минут на моем пк,так же по скорости и на серваке.Ладно, с этим я уже ничего не поделаю из за регулярок в проекте,согласен.Но вот перевести на поток и хотя бы по 10 строк одновременно обрабатывать,очень бы помогло.А сейчас в любом случае,у меня,сколько бы потоков не выставил - работает все равно как один,просто по очереди разный поток берет свои данные(
Не весь текст сохраняется в File
-
Здравствуйте, я столкнулся с такой проблемой, что при парсинге текста со страницы, я получаю текст вот такого вида:
This structure is used in the set of results returned by the * findNotesMetadata function. It represents the high-level information about * a single Note, without some of the larger deep structu...А мне нужно вот такого:
/** * This structure is used in the set of results returned by the * findNotesMetadata function. It represents the high-level information about * a single Note, without some of the larger deep structure. This allows * for the information about a list of Notes to be returned relatively quickly * with less marshalling and data transfer to remote clients. * Most fields in this structure are identical to the corresponding field in * the Note structure, with the exception of: * * <dl> * <dt>largestResourceMime</dt> * <dd>If set, then this will contain the MIME type of the largest Resource * (in bytes) within the Note. This may be useful, for example, to choose * an appropriate icon or thumbnail to represent the Note. * </dd> * * <dt>largestResourceSize</dt> * <dd>If set, this will contain the size of the largest Resource file, in * bytes, within the Note. This may be useful, for example, to decide whether * to ask the server for a thumbnail to represent the Note. * </dd> * </dl> */ /** * This structure is used in the set of results returned by the * findNotesMetadata function. It represents the high-level information about * a single Note, without some of the larger deep structure. This allows * for the information about a list of Notes to be returned relatively quickly * with less marshalling and data transfer to remote clients. * Most fields in this structure are identical to the corresponding field in * the Note structure, with the exception of: * * <dl> * <dt>largestResourceMime</dt> * <dd>If set, then this will contain the MIME type of the largest Resource * (in bytes) within the Note. This may be useful, for example, to choose * an appropriate icon or thumbnail to represent the Note. * </dd> * * <dt>largestResourceSize</dt> * <dd>If set, this will contain the size of the largest Resource file, in * bytes, within the Note. This may be useful, for example, to decide whether * to ask the server for a thumbnail to represent the Note. * </dd> * </dl> */ /** * This structure is used in the set of results returned by the * findNotesMetadata function. It represents the high-level information about * a single Note, without some of the larger deep structure. This allows * for the information about a list of Notes to be returned relatively quickly * with less marshalling and data transfer to remote clients. * Most fields in this structure are identical to the corresponding field in * the Note structure, with the exception of: * * <dl> * <dt>largestResourceMime</dt> * <dd>If set, then this will contain the MIME type of the largest Resource * (in bytes) within the Note. This may be useful, for example, to choose * an appropriate icon or thumbnail to represent the Note. * </dd> * * <dt>largestResourceSize</dt> * <dd>If set, this will contain the size of the largest Resource file, in * bytes, within the Note. This may be useful, for example, to decide whether * to ask the server for a thumbnail to represent the Note. * </dd> * </dl> */ /** * This structure is used in the set of results returned by the * findNotesMetadata function. It represents the high-level information about * a single Note, without some of the larger deep structure. This allows * for the information about a list of Notes to be returned relatively quickly * with less marshalling and data transfer to remote clients. * Most fields in this structure are identical to the corresponding field in * the Note structure, with the exception of: * * <dl> * <dt>largestResourceMime</dt> * <dd>If set, then this will contain the MIME type of the largest Resource * (in bytes) within the Note. This may be useful, for example, to choose * an appropriate icon or thumbnail to represent the Note. * </dd> * * <dt>largestResourceSize</dt> * <dd>If set, this will contain the size of the largest Resource file, in * bytes, within the Note. This may be useful, for example, to decide whether * to ask the server for a thumbnail to represent the Note. * </dd> * </dl> */Т.е, у меня теряется текст заменяя его точками.. Помогите пожалуйста : )
-
-
-
Как раз таки я и не пойму как цикл этот сделать... Получается чтобы он брал из двух заметок текст, нужно цикличное нажатие на каждую заметку сделать, чтобы в html doc появился текст второй заметки, а про цикл что выше сказал, я сделал идентичный вашему проекту предыдущему.
-

Вот смотрите, мне нужно кликнуть на каждую заметку, чтобы получить текст из неё, я не могу понять, как мне сделать в цикле, чтобы можно было кликать на каждый найденный элемент по классу (XPath) например. То что вы сделали, это работает, но мне нужно получить все заметки, их сейчас 2, но их может быть и 10 и 100 и тд.
-
-
@FreshLik, checkerevernote.xml, но у вас там второй список будет перезаписывать первый