LINUX.ORG.RU

Сообщения damix9

 

MUI - выпадающий список, потдягивающий опции с сервера

Форум — Web-development

Есть компонент, представляющий выпадающий список и поле ввода. Когда пользователь вводит текст, с сервера подтягиваются опции для выбора.
Помогите исправить такой баг: label опции, установленной в начале (через проп defaultList) отображается пустым.

import React, { Component } from 'react';
import Autocomplete from '@material-ui/lab/Autocomplete';
import TextField from '@material-ui/core/TextField';
import CheckIcon from '@material-ui/icons/Check';

/*

SearchSelect Component

Props:
- selectedIds: array of currently selected options
- onItemSelect: function, a callback function that is called when an option is selected or unselected
- label: string, the caption for the select input
- fetchList: function, a callback function that takes a query and returns a Promise that 
    resolves to an array of available objects from the server. The callback will only 
    be fired if the user has entered at least 3 characters, excluding trailing white spaces.
    Returned array:
    [
        { label: 'Option 1', value: 'option1' },
        { label: 'Option 2', value: 'option2' },
        // ... additional options
    ]
- defaultList: array of the objects available without fetching from server. If fetchList is called later 
    and finds options with same values, their labels will be overwritten by those from server. Has the 
    same format as returned by fetchList.
- noOptionsMessage: string, the message to display when no options are found on the server or no proper query
    
Usage Example:
<SearchSelect
  selectedIds={currentOptions}
  onItemSelect={(selectedItems) => {
    console.log('Selected items:', selectedItems);
  }}
  label="Caption"
  fetchList={(query) => {
    return fetch(https://api.example.com/search?q=${query})
      .then(response => response.json())
      .then(data => data.results);
  }}
/>

*/


class SearchSelect extends Component {
    constructor(props) {
        super(props);
        this.state = {
            availableOptions: []
        }
    }
    
    componentDidMount() {
        this.setState({
            availableOptions: this.props.defaultList || []
        })
    }
    
    componentDidUpdate(prevProps) {
        if (prevProps.defaultList !== this.props.defaultList) {
            this.setState({
                availableOptions: this.props.defaultList || []
            });
        }
    }

    handleFetchList = (query) => {
        if (query.trim().length >= 3) {
            this.props.fetchList(query).then((options) => {
                const mergedOptions = options.map((option) => {
                    const existingOption = this.state.availableOptions.find((existing) => existing.value === option.value);
                    return existingOption ? { ...existingOption, label: option.label } : option;
                });
                this.setState({
                    availableOptions: [...this.props.defaultList, ...mergedOptions]
                });
            });
        } 
        else {
            this.setState({
                availableOptions: this.props.defaultList || []
            });
        }
    }

    isOptionEqualToValue = (option, value) => {
        return (option.value == value)
    }
    
    getOptionSelected = (option, value) => option.value == value;

    render() {
        const { selectedIds, onItemSelect, label, noOptionsMessage } = this.props;
        console.log(this.props);
        console.log(this.state);
        
        return (
            <Autocomplete
                multiple
                options={this.state.availableOptions}
                getOptionLabel={ (option) => option.label }
                getOptionSelected={this.getOptionSelected}
                renderOption={ (option, { selected }) => (
                    <React.Fragment>
                        { selected && <CheckIcon /> }
                        { option.label }
                    </React.Fragment> ) }
                renderInput={(params) => (
                    <TextField {...params} label={label} variant="outlined" />
                )}
                value={selectedIds}
                onChange={ (event, newValue) => onItemSelect(newValue) }
                onInputChange={ (event, newInputValue) => this.handleFetchList(newInputValue) }
                noOptionsText={noOptionsMessage || "Ничего не найдено"}
                clearText="Очистить"
                openText="Открыть"
                closeText="Закрыть"
                style={{ marginTop: 7 }}
            />
        )
    }

}

SearchSelect.defaultProps = {
    defaultList: [],
};

export default SearchSelect;

 

damix9
()

Получать сообщения с сервера в реальном времени - авторизация

Форум — Web-development

Есть такой код на бэкенде

    using System;
    using System.Collections.Generic;
    using System.Threading;
    using System.Threading.Tasks;
    using Microsoft.AspNetCore.Mvc;
    using Microsoft.AspNetCore.Authorization;
    using Microsoft.AspNetCore.Http;
    
    using Services;
    using Models;
    
    [Route("api/[controller]")]
    [ApiController]
    public class FeedbackController : ControllerBase
    {
        public FeedbackController(FeedbackService feedbackService)
        {
            this.FeedbackService = feedbackService;
        }
        
        private FeedbackService FeedbackService { get; set; }
        
        // ...
        
        [Route("[action]")]
        [Authorize]
        [HttpGet]
        public async Task Push(CancellationToken cancellationToken)
        {
            Response.StatusCode = 200;
            Response.Headers.Add("Content-Type", "text/event-stream");

            EventHandler<FeedbackEventArgs> onFeedbackReceived = async (sender, eventArgs) =>
            {
                try
                {
                    var newMessageCount = eventArgs.NewMessageCount;
                    await Response.WriteAsync($"data:{newMessageCount}\n\n");
                    await Response.Body.FlushAsync();
                }
                catch (Exception ex)
                {
                    // Log the exception
                    Program.Logger.Error(ex, ex.Message);
                }
            };

            this.FeedbackService.Subscribe(onFeedbackReceived);

            while (!cancellationToken.IsCancellationRequested)
            {
                await Task.Delay(1000);
            }

            this.FeedbackService.Unsubscribe();
        }
    }
FeedbackService:
        // ...
        private NotificationService NotificationService;
        
        // ...
        
        public void Subscribe(EventHandler<FeedbackEventArgs> onFeedbackReceived)
        {
            this.NotificationService.Subscribe(this.CurrentLogin, onFeedbackReceived);
        }
        
        public void Unsubscribe()
        {
            this.NotificationService.Unsubscribe(this.CurrentLogin);
        }

        public void TriggerNewMessageNotification(string receiverLogin, int newMessageCount)
        {
            FeedbackEventArgs args = new FeedbackEventArgs { NewMessageCount = newMessageCount };
            this.NotificationService.Notify(receiverLogin, args);
        }
        // ...
FeedbackEventArgs:
    using System;
    
    public class FeedbackEventArgs : EventArgs
    {
        public int NewMessageCount { get; set; }
    }
Я хочу его использовать вот так на фронтенде
class Notifier {
    
    constructor() {
        store.subscribe(this.onAppStateChange.bind(this))
    }
    
    _callbacks = []
    _timerId = null
    _stage = ''
    _evtSource = null
    _sound = null
    
    // ...

    connect() {
        try {
            this._evtSource = new EventSource('/api/Feedback/Push');
            this._evtSource.addEventListener("arrived", this.onMessageArrived.bind(this));
        }
        catch (err) {
            console.log('Браузер пользователя не поддерживает Server sent events.')
        }
        // Backup method if PUSH doesn't work, we'll check for notifications at least every half hour
        this._timerId = setInterval(this.checkForNotifications.bind(this), notifierCheckingDelay)
    }

    
    disconnect() {
        clearInterval(this._timerId)
        try {
            this._evtSource.close()
        }
        catch (err) {
            console.log(
                'Браузер пользователя не поддерживает Server sent events.'
            )
        }
    }
    
    // ...
    
}
Но так при connect() получаю от сервера
HTTP/1.1 401 Unauthorized
X-Powered-By: Express
connection: close
date: Tue, 05 Mar 2024 13:28:07 GMT
server: Kestrel
content-length: 0
www-authenticate: Bearer

UPD

npm i eventsource
Поправил JS так
import EventSource from 'eventsource';
// ...
    connect() {
        try {
            let token = api.getAUTHToken();
            this._evtSource = new EventSource('/api/Feedback/Push', {
                headers: {
                    Authorization: `Bearer ${token.text}`
                }
            });
            this._evtSource.addEventListener("arrived", this.onMessageArrived.bind(this));
        }
        catch (err) {
            console.log('Браузер пользователя не поддерживает Server sent events.')
        }
        // Backup method if PUSH doesn't work, we'll check for notifications at least every half hour
        this._timerId = setInterval(this.checkForNotifications.bind(this), notifierCheckingDelay)
    }
И C# так
        [Route("[action]")]
        [Authorize]
        [HttpGet]
        public async Task Push(CancellationToken cancellationToken)
        {
            Response.StatusCode = 200;
            Response.Headers.Add("Content-Type", "text/event-stream");
            Response.Headers.Add("Cache-Control", "no-transform");

            EventHandler<FeedbackEventArgs> onFeedbackReceived = async (sender, eventArgs) =>
            {
                try
                {
                    var newMessageCount = eventArgs.NewMessageCount;
                    await Response.WriteAsync($"data:{newMessageCount}\n\n");
                    await Response.Body.FlushAsync();
                }
                catch (Exception ex)
                {
                    // Log the exception
                    Program.Logger.Error(ex, ex.Message);
                }
            };

            this.FeedbackService.Subscribe(onFeedbackReceived);

            while (!cancellationToken.IsCancellationRequested)
            {
                await Task.Delay(1000);
            }

            this.FeedbackService.Unsubscribe();
        }
Запрос выполняется бесконечно, как и положено.

 

damix9
()

Sylpheed - поиск по дате

Форум — Desktop

Как искать письма по дате? Задать две даты, вывести письма пришедшие или отправленные между ними.

Если никак, то в каком клиенте это можно?

 ,

damix9
()

GParted - A filesystem supporting Unix file mode for syslinux is required.

Форум — General

Делаю по инструкции https://gparted.org/liveusb.php#linux-method-b

Пятый шаг, получаю

...
Do you want to install the syslinux boot files on /dev/sdc1 on this machine "MS-7A34" ?
[y/n] y
OK! Let's do it!
A filesystem supporting Unix file mode for syslinux is required. Copying syslinux to /tmp/linux_tmp.WlCYpu
...
Что значит? Получилось или нет?

 

damix9
()

Темы пропали

Форум — Linux-org-ru

Я что-то пропустил?

В www.linux.org.ru/people/damix9/settings из тем остались только

  • tango
  • black
  • waltz

 

damix9
()

Положить данные относительно бинарника

Форум — General

Как собрать бинарник, чтобы он искал данные не в $XDG_DATA_DIRS, а относительно себя? Что-то вроде rpath, только для данных.

 , ,

damix9
()

Почему форум такой душный?

Форум — Talks

Почему на ЛОРе так много душных? Вот то ли дело на убунтофоруме или минтофоруме, там пользователей облизывают. А тут напишешь, что не можешь поднять стим на кали линукс, над тобой сразу же начнут издеваться.

А еще модераторы тут свирепствуют. Чуть что - сразу удаляют сообщения. Я правда на других форумах не пробовал оффтопить, но ведь там точно лучше, не может же ЛОР быть самым свободным форумом по соответствующей тематике.

 ,

damix9
()

Git - показать файлы, созданные с определенного коммита

Форум — Development

Как показать файлы, созданные с определенного коммита до HEAD?

Перемещено hobbit из general

 

damix9
()

Показывать при регистрации сообщение о том, как пользоваться форумом

Форум — Linux-org-ru
  • Русский перевод Smart questions howto
  • Предупреждение вида «так мол и так, у нас тут уведомлений по email нет и не будет, чтобы узнать, что вам ответили, поставьте RSS-клиент»
  • Информацию о необходимости ознакомится с закрепленными темами раздела Linux-org-ru

Как вам идея?

cast hobbit

 

damix9
()

Создать плагин для Avidemux

Форум — Development

Вот что я уже нашел
http://www.avidemux.org/admWiki/doku.php?id=tutorial:writing_your_own_filter
http://www.avidemux.org/admWiki/doku.php?id=using:video_filters

Написал такой код
bilateralFilter.cpp:

#include <opencv2/opencv.hpp>
#include "ADM_coreVideoFilter.h"
#include <QDialog>
#include <QLineEdit>
#include <QLabel>

typedef struct bilateralFilterParam {
    int d;
    double sigmaColor;
    double sigmaSpace;
} bilateralFilterParam;

class BilateralFilter : public AVDMGenericVideoStream {
public:
    BilateralFilter(AVDMGenericVideoStream *in, CONFcouple *couples);
    ~BilateralFilter();

    char *printConf();
    uint8_t getCoupledConf(CONFcouple **couples);
    uint8_t configure(AVDMGenericVideoStream *in);
    uint8_t getFrameNumberNoAlloc(uint32_t inframe, uint32_t *len, ADMImage *data, uint32_t *flags);

private:
    bilateralFilterParam *_param;
    QDialog *dialog;
    QLineEdit *dEdit;
    QLineEdit *sigmaColorEdit;
    QLineEdit *sigmaSpaceEdit;
};

BilateralFilter::BilateralFilter(AVDMGenericVideoStream *in, CONFcouple *couples) {
    _in = in;
    _param = new bilateralFilterParam;
    GET(_param->d);
    GET(_param->sigmaColor);
    GET(_param->sigmaSpace);
    _info = _in->getInfo();

    dialog = new QDialog();
    QLabel *dLabel = new QLabel("d:");
    dEdit = new QLineEdit(QString::number(_param->d));
    QLabel *sigmaColorLabel = new QLabel("Sigma Color:");
    sigmaColorEdit = new QLineEdit(QString::number(_param->sigmaColor));
    QLabel *sigmaSpaceLabel = new QLabel("Sigma Space:");
    sigmaSpaceEdit = new QLineEdit(QString::number(_param->sigmaSpace));

    QVBoxLayout *layout = new QVBoxLayout();
    layout->addWidget(dLabel);
    layout->addWidget(dEdit);
    layout->addWidget(sigmaColorLabel);
    layout->addWidget(sigmaColorEdit);
    layout->addWidget(sigmaSpaceLabel);
    layout->addWidget(sigmaSpaceEdit);
    dialog->setLayout(layout);
}

char *BilateralFilter::printConf() {
    static char buf[50];
    sprintf((char *)buf, "Bilateral filter, d : %d, sigmaColor : %.2f, sigmaSpace : %.2f", _param->d, _param->sigmaColor, _param->sigmaSpace);
    return buf;
}

uint8_t BilateralFilter::getCoupledConf(CONFcouple **couples) {
    ADM_assert(_param);
    *couples = new CONFcouple(3);
    #undef CSET
    #define CSET(x) (*couples)->setCouple(#x,(_param->x))
    CSET(d);
    CSET(sigmaColor);
    CSET(sigmaSpace);
    return 1;
}

uint8_t BilateralFilter::configure(AVDMGenericVideoStream *in) {
    _in = in;
    
    // Return 1 to indicate that the filter chain might have to be rebuilt
    return 1;
}

//Implement the getFrameNumberNoAlloc method. This is the central method where the work will be done.
uint8_t BilateralFilter::getFrameNumberNoAlloc(uint32_t inframe, uint32_t *len, ADMImage *data, uint32_t *flags) {
    ADM_assert(inframe < _info.nb_frames); // Make sure we don't go out of bounds
    
    // Read frames for the previous
    ADM_assert(_in->getFrameNumberNoAlloc(inframe, len, _uncompressed, flags));
    
    // Apply the bilateral filter
    cv::Mat src(_uncompressed->height, _uncompressed->width, CV_8UC3, _uncompressed->planes[0], _uncompressed->pitches[0]);
    cv::Mat dst;
    cv::bilateralFilter(src, dst, _param->d, _param->sigmaColor, _param->sigmaSpace);
    
    // Copy the result to data
    memcpy(data->planes[0], dst.data, len[0]);
    
    return 1; // ok
}

extern "C" {
    SCRIPT_CREATE(FILTER_create_fromscript, BilateralFilter, bilateralFilterParam);
    BUILD_CREATE(FILTER_create, BilateralFilter);
    char *FILTER_getName(void) {
        return "BilateralFilter";
    }
    char *FILTER_getDesc(void) {
        return "Applies a bilateral filter to the video";
    }
    uint32_t FILTER_getVersion(void) {
        return 1;
    }
    uint32_t FILTER_getAPIVersion(void) {
        return ADM_FILTER_API_VERSION;
    }
}
Makefile:
CXX = g++
CXXFLAGS = -Wall -fPIC
INCLUDES := -I/opt/qt/5.8/gcc_64/include -I/opt/qt/5.8/gcc_64/include/QtWidgets -I/opt/qt/5.8/gcc_64/include/QtGui -I/opt/qt/5.8/gcc_64/include/QtCore $(shell echo -n ""; for d in ./avidemux_2.7.1/avidemux_core/*/include; do echo -n "-I$$d "; done) -I./avidemux_2.7.1/addons/fontGen -I./avidemux_2.7.1/avidemux_core/ADM_coreDemuxer/include/unix
LIBS = -L/opt/qt/gcc_64/lib -L/usr/lib -lQtCore -lQtGui -lADM_coreVideoFilter6 -lopencv_core -lopencv_imgproc

all: bilateralFilter.so

bilateralFilter.so: bilateralFilter.o
        $(CXX) -shared -o $@ $^ $(LIBS)

%.o: %.cpp
        $(CXX) $(CXXFLAGS) $(INCLUDES) -c $< -o $@

clean:
        rm -f *.o bilateralFilter.so
Что уже сделал
apt install libopencv-dev
make
Но на выходе
g++ -Wall -fPIC -I/opt/qt/5.8/gcc_64/include -I/opt/qt/5.8/gcc_64/include/QtWidgets -I/opt/qt/5.8/gcc_64/include/QtGui -I/opt/qt/5.8/gcc_64/include/QtCore -I./avidemux_2.7.1/avidemux_core/ADM_core/include -I./avidemux_2.7.1/avidemux_core/ADM_coreAudio/include -I./avidemux_2.7.1/avidemux_core/ADM_coreAudioCodec/include -I./avidemux_2.7.1/avidemux_core/ADM_coreAudioDevice/include -I./avidemux_2.7.1/avidemux_core/ADM_coreAudioEncoder/include -I./avidemux_2.7.1/avidemux_core/ADM_coreAudioFilter/include -I./avidemux_2.7.1/avidemux_core/ADM_coreAudioParser/include -I./avidemux_2.7.1/avidemux_core/ADM_coreDemuxer/include -I./avidemux_2.7.1/avidemux_core/ADM_coreDemuxerMpeg/include -I./avidemux_2.7.1/avidemux_core/ADM_coreImage/include -I./avidemux_2.7.1/avidemux_core/ADM_coreImageLoader/include -I./avidemux_2.7.1/avidemux_core/ADM_coreJobs/include -I./avidemux_2.7.1/avidemux_core/ADM_coreMuxer/include -I./avidemux_2.7.1/avidemux_core/ADM_coreScript/include -I./avidemux_2.7.1/avidemux_core/ADM_coreSocket/include -I./avidemux_2.7.1/avidemux_core/ADM_coreSqlLight3/include -I./avidemux_2.7.1/avidemux_core/ADM_coreSubtitles/include -I./avidemux_2.7.1/avidemux_core/ADM_coreUI/include -I./avidemux_2.7.1/avidemux_core/ADM_coreUtils/include -I./avidemux_2.7.1/avidemux_core/ADM_coreVideoCodec/include -I./avidemux_2.7.1/avidemux_core/ADM_coreVideoEncoder/include -I./avidemux_2.7.1/avidemux_core/ADM_coreVideoFilter/include  -I./avidemux_2.7.1/addons/fontGen -I./avidemux_2.7.1/avidemux_core/ADM_coreDemuxer/include/unix -c bilateralFilter.cpp -o bilateralFilter.o
bilateralFilter.cpp:13:55: error: expected class-name before ‘{’ token
 class BilateralFilter : public AVDMGenericVideoStream {
                                                       ^
bilateralFilter.cpp:15:44: error: expected ‘)’ before ‘*’ token
     BilateralFilter(AVDMGenericVideoStream *in, CONFcouple *couples);
                                            ^
bilateralFilter.cpp:20:23: error: ‘AVDMGenericVideoStream’ has not been declared
     uint8_t configure(AVDMGenericVideoStream *in);
                       ^~~~~~~~~~~~~~~~~~~~~~
bilateralFilter.cpp:31:33: error: expected constructor, destructor, or type conversion before ‘(’ token
 BilateralFilter::BilateralFilter(AVDMGenericVideoStream *in, CONFcouple *couples) {
                                 ^
bilateralFilter.cpp: In member function ‘uint8_t BilateralFilter::getCoupledConf(CONFcouple**)’:
bilateralFilter.cpp:67:33: error: ‘class CONFcouple’ has no member named ‘setCouple’; did you mean ‘CONFcouple’?
     #define CSET(x) (*couples)->setCouple(#x,(_param->x))
                                 ^
bilateralFilter.cpp:67:33: note: in definition of macro ‘CSET’
     #define CSET(x) (*couples)->setCouple(#x,(_param->x))
                                 ^~~~~~~~~
bilateralFilter.cpp:67:33: error: ‘class CONFcouple’ has no member named ‘setCouple’; did you mean ‘CONFcouple’?
     #define CSET(x) (*couples)->setCouple(#x,(_param->x))
                                 ^
bilateralFilter.cpp:67:33: note: in definition of macro ‘CSET’
     #define CSET(x) (*couples)->setCouple(#x,(_param->x))
                                 ^~~~~~~~~
bilateralFilter.cpp:67:33: error: ‘class CONFcouple’ has no member named ‘setCouple’; did you mean ‘CONFcouple’?
     #define CSET(x) (*couples)->setCouple(#x,(_param->x))
                                 ^
bilateralFilter.cpp:67:33: note: in definition of macro ‘CSET’
     #define CSET(x) (*couples)->setCouple(#x,(_param->x))
                                 ^~~~~~~~~
bilateralFilter.cpp: At global scope:
bilateralFilter.cpp:74:36: error: ‘uint8_t BilateralFilter::configure’ is not a static data member of ‘class BilateralFilter’
 uint8_t BilateralFilter::configure(AVDMGenericVideoStream *in) {
                                    ^~~~~~~~~~~~~~~~~~~~~~
bilateralFilter.cpp:74:36: error: ‘AVDMGenericVideoStream’ was not declared in this scope
bilateralFilter.cpp:74:60: error: ‘in’ was not declared in this scope
 uint8_t BilateralFilter::configure(AVDMGenericVideoStream *in) {
                                                            ^~
bilateralFilter.cpp:74:60: note: suggested alternative: ‘yn’
 uint8_t BilateralFilter::configure(AVDMGenericVideoStream *in) {
                                                            ^~
                                                            yn
In file included from ./avidemux_2.7.1/avidemux_core/ADM_coreImage/include/ADM_image.h:30:0,
                 from ./avidemux_2.7.1/avidemux_core/ADM_coreVideoFilter/include/ADM_coreVideoFilter.h:22,
                 from bilateralFilter.cpp:2:
bilateralFilter.cpp: In member function ‘uint8_t BilateralFilter::getFrameNumberNoAlloc(uint32_t, uint32_t*, ADMImage*, uint32_t*)’:
bilateralFilter.cpp:83:26: error: ‘_info’ was not declared in this scope
     ADM_assert(inframe < _info.nb_frames); // Make sure we don't go out of bounds
                          ^
./avidemux_2.7.1/avidemux_core/ADM_core/include/ADM_assert.h:30:30: note: in definition of macro ‘ADM_assert’
 #define ADM_assert(x) { if(!(x)) {ADM_backTrack("Assert failed :"#x,__LINE__,__FILE__);  }}
                              ^
bilateralFilter.cpp:83:26: note: suggested alternative: ‘sinf’
     ADM_assert(inframe < _info.nb_frames); // Make sure we don't go out of bounds
                          ^
./avidemux_2.7.1/avidemux_core/ADM_core/include/ADM_assert.h:30:30: note: in definition of macro ‘ADM_assert’
 #define ADM_assert(x) { if(!(x)) {ADM_backTrack("Assert failed :"#x,__LINE__,__FILE__);  }}
                              ^
bilateralFilter.cpp:86:16: error: ‘_in’ was not declared in this scope
     ADM_assert(_in->getFrameNumberNoAlloc(inframe, len, _uncompressed, flags));
                ^
./avidemux_2.7.1/avidemux_core/ADM_core/include/ADM_assert.h:30:30: note: in definition of macro ‘ADM_assert’
 #define ADM_assert(x) { if(!(x)) {ADM_backTrack("Assert failed :"#x,__LINE__,__FILE__);  }}
                              ^
bilateralFilter.cpp:86:16: note: suggested alternative: ‘sin’
     ADM_assert(_in->getFrameNumberNoAlloc(inframe, len, _uncompressed, flags));
                ^
./avidemux_2.7.1/avidemux_core/ADM_core/include/ADM_assert.h:30:30: note: in definition of macro ‘ADM_assert’
 #define ADM_assert(x) { if(!(x)) {ADM_backTrack("Assert failed :"#x,__LINE__,__FILE__);  }}
                              ^
bilateralFilter.cpp:86:57: error: ‘_uncompressed’ was not declared in this scope
     ADM_assert(_in->getFrameNumberNoAlloc(inframe, len, _uncompressed, flags));
                                                         ^
./avidemux_2.7.1/avidemux_core/ADM_core/include/ADM_assert.h:30:30: note: in definition of macro ‘ADM_assert’
 #define ADM_assert(x) { if(!(x)) {ADM_backTrack("Assert failed :"#x,__LINE__,__FILE__);  }}
                              ^
bilateralFilter.cpp:86:57: note: suggested alternative: ‘qUncompress’
     ADM_assert(_in->getFrameNumberNoAlloc(inframe, len, _uncompressed, flags));
                                                         ^
./avidemux_2.7.1/avidemux_core/ADM_core/include/ADM_assert.h:30:30: note: in definition of macro ‘ADM_assert’
 #define ADM_assert(x) { if(!(x)) {ADM_backTrack("Assert failed :"#x,__LINE__,__FILE__);  }}
                              ^
bilateralFilter.cpp:89:17: error: ‘_uncompressed’ was not declared in this scope
     cv::Mat src(_uncompressed->height, _uncompressed->width, CV_8UC3, _uncompressed->planes[0], _uncompressed->pitches[0]);
                 ^~~~~~~~~~~~~
bilateralFilter.cpp:89:17: note: suggested alternative: ‘qUncompress’
     cv::Mat src(_uncompressed->height, _uncompressed->width, CV_8UC3, _uncompressed->planes[0], _uncompressed->pitches[0]);
                 ^~~~~~~~~~~~~
                 qUncompress
bilateralFilter.cpp:94:18: error: ‘class ADMImage’ has no member named ‘planes’; did you mean ‘_planes’?
     memcpy(data->planes[0], dst.data, len[0]);
                  ^~~~~~
                  _planes
bilateralFilter.cpp: At global scope:
bilateralFilter.cpp:100:18: error: expected constructor, destructor, or type conversion before ‘(’ token
     SCRIPT_CREATE(FILTER_create_fromscript, BilateralFilter, bilateralFilterParam);
                  ^
bilateralFilter.cpp:101:17: error: expected constructor, destructor, or type conversion before ‘(’ token
     BUILD_CREATE(FILTER_create, BilateralFilter);
                 ^
bilateralFilter.cpp: In function ‘char* FILTER_getName()’:
bilateralFilter.cpp:103:16: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]
         return "BilateralFilter";
                ^~~~~~~~~~~~~~~~~
bilateralFilter.cpp: In function ‘char* FILTER_getDesc()’:
bilateralFilter.cpp:106:16: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]
         return "Applies a bilateral filter to the video";
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
bilateralFilter.cpp: In function ‘uint32_t FILTER_getAPIVersion()’:
bilateralFilter.cpp:112:16: error: ‘ADM_FILTER_API_VERSION’ was not declared in this scope
         return ADM_FILTER_API_VERSION;
                ^~~~~~~~~~~~~~~~~~~~~~
bilateralFilter.cpp:112:16: note: suggested alternative: ‘VF_API_VERSION’
         return ADM_FILTER_API_VERSION;
                ^~~~~~~~~~~~~~~~~~~~~~
                VF_API_VERSION
bilateralFilter.cpp: In member function ‘char* BilateralFilter::printConf()’:
bilateralFilter.cpp:57:7: warning: ‘, sigmaSpace : ’ directive writing 15 bytes into a region of size between 0 and 8 [-Wformat-overflow=]
 char *BilateralFilter::printConf() {
       ^~~~~~~~~~~~~~~
bilateralFilter.cpp:59:12: note: ‘sprintf’ output between 62 and 690 bytes into a destination of size 50
     sprintf((char *)buf, "Bilateral filter, d : %d, sigmaColor : %.2f, sigmaSpace : %.2f", _param->d, _param->sigmaColor, _param->sigmaSpace);
     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Makefile:12: recipe for target 'bilateralFilter.o' failed
make: *** [bilateralFilter.o] Error 1

UPD

Попробовал применить другой базовый класс, сейчас код собирается и запускается, но требует дебага и выполняется без падений.

 ,

damix9
()

После закрытия-открытия браузера session cookies остаются

Форум — Desktop

Версия Firefox 122.0 (64-bit)

Как воспроизвести

function setCookie(szName, szValue, szExpires, szPath, szDomain, bSecure)
{
 	var szCookieText = 	   escape(szName) + '=' + escape(szValue);
	szCookieText +=	 	   (szExpires ? '; EXPIRES=' + szExpires.toGMTString() : '');
	szCookieText += 	   (szPath ? '; PATH=' + szPath : '');
	szCookieText += 	   (szDomain ? '; DOMAIN=' + szDomain : '');
	szCookieText += 	   (bSecure ? '; SECURE' : '');
	
	document.cookie = szCookieText;
}
setCookie('test', 'session_cookie')
После этого в Storage -> Cookies в столбце Expires / Max-age указано Session, но после перезапуска не удаляется.

UPD

Лучший ответ

 

damix9
()

Залогиниться в Tartube

Форум — Desktop

Как в сабже залогиниться на youtube, т.е. указать программе логин и пароль и качать видео из под своего аккаунта?

 tartube,

damix9
()

Бесконечно грузятся страницы [ERROR glean_core] Error setting metrics feature config

Форум — Desktop
$ firefox --version                                                                                                      
Mozilla Firefox 113.0.2
$ inxi -S                                                                                                                
System:    Host: ryzen Kernel: 5.4.0-135-generic x86_64 bits: 64 Desktop: KDE Plasma 5.12.6                                          
           Distro: Ubuntu 18.04.1 LTS

Захожу на любой сайт (даже веб-интерфейс роутера) получаю бесконечно крутящийся индикатор загрузки. На стандартный вывод пишет

$ firefox 

(firefox:29917): Gtk-WARNING **: 22:26:39.880: Theme parsing error: gtk.css:68:35: The style property GtkButton:child-displacement-x is deprecated and shouldn't be used anymore. It will be removed in a future version

(firefox:29917): Gtk-WARNING **: 22:26:39.880: Theme parsing error: gtk.css:69:35: The style property GtkButton:child-displacement-y is deprecated and shouldn't be used anymore. It will be removed in a future version

(firefox:29917): Gtk-WARNING **: 22:26:39.880: Theme parsing error: gtk.css:73:46: The style property GtkScrolledWindow:scrollbars-within-bevel is deprecated and shouldn't be used anymore. It will be removed in a future version

(firefox:29917): Gtk-WARNING **: 22:26:39.912: Theme parsing error: gtk.css:68:35: The style property GtkButton:child-displacement-x is deprecated and shouldn't be used anymore. It will be removed in a future version

(firefox:29917): Gtk-WARNING **: 22:26:39.912: Theme parsing error: gtk.css:69:35: The style property GtkButton:child-displacement-y is deprecated and shouldn't be used anymore. It will be removed in a future version

(firefox:29917): Gtk-WARNING **: 22:26:39.913: Theme parsing error: gtk.css:73:46: The style property GtkScrolledWindow:scrollbars-within-bevel is deprecated and shouldn't be used anymore. It will be removed in a future version

(firefox:29917): Gtk-WARNING **: 22:26:39.938: Theme parsing error: gtk.css:68:35: The style property GtkButton:child-displacement-x is deprecated and shouldn't be used anymore. It will be removed in a future version

(firefox:29917): Gtk-WARNING **: 22:26:39.938: Theme parsing error: gtk.css:69:35: The style property GtkButton:child-displacement-y is deprecated and shouldn't be used anymore. It will be removed in a future version

(firefox:29917): Gtk-WARNING **: 22:26:39.938: Theme parsing error: gtk.css:73:46: The style property GtkScrolledWindow:scrollbars-within-bevel is deprecated and shouldn't be used anymore. It will be removed in a future version
[GFX1-]: glxtest: libEGL missing methods for GL test
[ERROR glean_core] Error setting metrics feature config: Json(Error("EOF while parsing a value", line: 1, column: 0))
[Child 30051, Main Thread] WARNING: JSWindowActorChild::SendRawMessage (Conduits, ConduitClosed) not sent: !CanSend() || !mManager || !mManager->CanSend(): file /build/firefox-DxjVTE/firefox-113.0.2+build1/dom/ipc/jsactor/JSWindowActorChild.cpp:57
[Child 30051, Main Thread] WARNING: JSWindowActorChild::SendRawMessage (Conduits, ConduitClosed) not sent: !CanSend() || !mManager || !mManager->CanSend(): file /build/firefox-DxjVTE/firefox-113.0.2+build1/dom/ipc/jsactor/JSWindowActorChild.cpp:57
[Child 30051, Main Thread] WARNING: JSWindowActorChild::SendRawMessage (Conduits, ConduitClosed) not sent: !CanSend() || !mManager || !mManager->CanSend(): file /build/firefox-DxjVTE/firefox-113.0.2+build1/dom/ipc/jsactor/JSWindowActorChild.cpp:57
[Child 30051, Main Thread] WARNING: JSWindowActorChild::SendRawMessage (Conduits, ConduitClosed) not sent: !CanSend() || !mManager || !mManager->CanSend(): file /build/firefox-DxjVTE/firefox-113.0.2+build1/dom/ipc/jsactor/JSWindowActorChild.cpp:57
[Child 30051, Main Thread] WARNING: JSWindowActorChild::SendRawMessage (Conduits, ConduitClosed) not sent: !CanSend() || !mManager || !mManager->CanSend(): file /build/firefox-DxjVTE/firefox-113.0.2+build1/dom/ipc/jsactor/JSWindowActorChild.cpp:57
[Child 30051, Main Thread] WARNING: JSWindowActorChild::SendRawMessage (Conduits, ConduitClosed) not sent: !CanSend() || !mManager || !mManager->CanSend(): file /build/firefox-DxjVTE/firefox-113.0.2+build1/dom/ipc/jsactor/JSWindowActorChild.cpp:57
[Child 30051, Main Thread] WARNING: JSWindowActorChild::SendRawMessage (Conduits, ConduitClosed) not sent: !CanSend() || !mManager || !mManager->CanSend(): file /build/firefox-DxjVTE/firefox-113.0.2+build1/dom/ipc/jsactor/JSWindowActorChild.cpp:57
[Child 30051, Main Thread] WARNING: JSWindowActorChild::SendRawMessage (Conduits, ConduitClosed) not sent: !CanSend() || !mManager || !mManager->CanSend(): file /build/firefox-DxjVTE/firefox-113.0.2+build1/dom/ipc/jsactor/JSWindowActorChild.cpp:57
[Child 30051, Main Thread] WARNING: JSWindowActorChild::SendRawMessage (Conduits, ConduitClosed) not sent: !CanSend() || !mManager || !mManager->CanSend(): file /build/firefox-DxjVTE/firefox-113.0.2+build1/dom/ipc/jsactor/JSWindowActorChild.cpp:57
[Child 30051, Main Thread] WARNING: JSWindowActorChild::SendRawMessage (Conduits, ConduitClosed) not sent: !CanSend() || !mManager || !mManager->CanSend(): file /build/firefox-DxjVTE/firefox-113.0.2+build1/dom/ipc/jsactor/JSWindowActorChild.cpp:57
[Child 30051, Main Thread] WARNING: JSWindowActorChild::SendRawMessage (Conduits, ConduitClosed) not sent: !CanSend() || !mManager || !mManager->CanSend(): file /build/firefox-DxjVTE/firefox-113.0.2+build1/dom/ipc/jsactor/JSWindowActorChild.cpp:57
[Child 30051, Main Thread] WARNING: JSWindowActorChild::SendRawMessage (Conduits, ConduitClosed) not sent: !CanSend() || !mManager || !mManager->CanSend(): file /build/firefox-DxjVTE/firefox-113.0.2+build1/dom/ipc/jsactor/JSWindowActorChild.cpp:57
[Child 30051, Main Thread] WARNING: JSWindowActorChild::SendRawMessage (Conduits, ConduitClosed) not sent: !CanSend() || !mManager || !mManager->CanSend(): file /build/firefox-DxjVTE/firefox-113.0.2+build1/dom/ipc/jsactor/JSWindowActorChild.cpp:57
[Child 30051, Main Thread] WARNING: JSWindowActorChild::SendRawMessage (Conduits, ConduitClosed) not sent: !CanSend() || !mManager || !mManager->CanSend(): file /build/firefox-DxjVTE/firefox-113.0.2+build1/dom/ipc/jsactor/JSWindowActorChild.cpp:57
[Child 30051, Main Thread] WARNING: JSWindowActorChild::SendRawMessage (Conduits, ConduitClosed) not sent: !CanSend() || !mManager || !mManager->CanSend(): file /build/firefox-DxjVTE/firefox-113.0.2+build1/dom/ipc/jsactor/JSWindowActorChild.cpp:57
[Child 30051, Main Thread] WARNING: JSWindowActorChild::SendRawMessage (Conduits, ConduitClosed) not sent: !CanSend() || !mManager || !mManager->CanSend(): file /build/firefox-DxjVTE/firefox-113.0.2+build1/dom/ipc/jsactor/JSWindowActorChild.cpp:57
[Child 30051, Main Thread] WARNING: JSWindowActorChild::SendRawMessage (Conduits, ConduitClosed) not sent: !CanSend() || !mManager || !mManager->CanSend(): file /build/firefox-DxjVTE/firefox-113.0.2+build1/dom/ipc/jsactor/JSWindowActorChild.cpp:57
[Child 30051, Main Thread] WARNING: JSWindowActorChild::SendRawMessage (Conduits, ConduitClosed) not sent: !CanSend() || !mManager || !mManager->CanSend(): file /build/firefox-DxjVTE/firefox-113.0.2+build1/dom/ipc/jsactor/JSWindowActorChild.cpp:57
[Child 30051, Main Thread] WARNING: JSWindowActorChild::SendRawMessage (Conduits, ConduitClosed) not sent: !CanSend() || !mManager || !mManager->CanSend(): file /build/firefox-DxjVTE/firefox-113.0.2+build1/dom/ipc/jsactor/JSWindowActorChild.cpp:57
[Child 30051, Main Thread] WARNING: JSWindowActorChild::SendRawMessage (Conduits, ConduitClosed) not sent: !CanSend() || !mManager || !mManager->CanSend(): file /build/firefox-DxjVTE/firefox-113.0.2+build1/dom/ipc/jsactor/JSWindowActorChild.cpp:57
[Child 30051, Main Thread] WARNING: JSWindowActorChild::SendRawMessage (Conduits, ConduitClosed) not sent: !CanSend() || !mManager || !mManager->CanSend(): file /build/firefox-DxjVTE/firefox-113.0.2+build1/dom/ipc/jsactor/JSWindowActorChild.cpp:57
[Child 30051, Main Thread] WARNING: JSWindowActorChild::SendRawMessage (Conduits, ConduitClosed) not sent: !CanSend() || !mManager || !mManager->CanSend(): file /build/firefox-DxjVTE/firefox-113.0.2+build1/dom/ipc/jsactor/JSWindowActorChild.cpp:57
[Child 30051, Main Thread] WARNING: JSWindowActorChild::SendRawMessage (Conduits, ConduitClosed) not sent: !CanSend() || !mManager || !mManager->CanSend(): file /build/firefox-DxjVTE/firefox-113.0.2+build1/dom/ipc/jsactor/JSWindowActorChild.cpp:57
[Child 30051, Main Thread] WARNING: JSWindowActorChild::SendRawMessage (Conduits, ConduitClosed) not sent: !CanSend() || !mManager || !mManager->CanSend(): file /build/firefox-DxjVTE/firefox-113.0.2+build1/dom/ipc/jsactor/JSWindowActorChild.cpp:57
[Child 30051, Main Thread] WARNING: JSWindowActorChild::SendRawMessage (Conduits, ConduitClosed) not sent: !CanSend() || !mManager || !mManager->CanSend(): file /build/firefox-DxjVTE/firefox-113.0.2+build1/dom/ipc/jsactor/JSWindowActorChild.cpp:57
[Child 30051, Main Thread] WARNING: JSWindowActorChild::SendRawMessage (Conduits, ConduitClosed) not sent: !CanSend() || !mManager || !mManager->CanSend(): file /build/firefox-DxjVTE/firefox-113.0.2+build1/dom/ipc/jsactor/JSWindowActorChild.cpp:57
[Child 30051, Main Thread] WARNING: JSWindowActorChild::SendRawMessage (Conduits, ConduitClosed) not sent: !CanSend() || !mManager || !mManager->CanSend(): file /build/firefox-DxjVTE/firefox-113.0.2+build1/dom/ipc/jsactor/JSWindowActorChild.cpp:57
Sandbox: Unexpected EOF, op 0 flags 00 path /proc/cpuinfo
Работать как надо перестало после перезагрузки. Так происходит только на одном профиле. Сделал так, восстановил из бэкапа профиль, ничего не поменялось.

Лучший ответ

 

damix9
()

Мерч форума

Форум — Linux-org-ru

Есть ли у ЛОРа какой-то мерч? Футболки, кружки, ручки и т.д. с символикой форума.

 

damix9
()

Свернуть окно по ID процесса

Форум — Admin

Как из командной строки свернуть окно программы, зная ее PID и ID окна (as in wmctrl -lp)?

Нашел

xdotool search --name "<окно>" windowminimize
но тут надо заголовок окна.

Иксы, кеды.

Конечная цель - проверить почту в Sylpheed из скрипта, не разворачивая его окно, sylpheed --receive-all делает что надо, только разворачивает окно, я хочу сворачивать обратно.


UPD

WN=$(xprop -id $WID WM_NAME | awk -F '"' '{print $2}')
xdotool search --name "$WN" windowminimize

 ,

damix9
()

Смешные картинки

Форум — Talks

Покидайте смешных картинок про Linux и не только.

 

damix9
()

Подписаться на обновления документации

Форум — Linux-org-ru

Zhbert, эта лента же будет уведомлять, если кто-то поправит статью или создаст новую?

http://lorwiki.zhbert.ru/api.php?hidebots=1&urlversion=1&days=7&limit=50&action=feedrecentchanges&feedformat=atom

Она пустая, потому что с момента деплоя правок не было?

 

damix9
()

Децентрализованные мгновенные сообщения

Форум — Talks

Вот есть почта. С ней всё хорошо. Есть несколько конкурирующих серверов, несколько конкурирующих клиентов. Пользователь выбирает и то и другое. Но SMTP и IMAP не предназначены для общения в реальном времени, это другой сценарий. Нужны еще мгновенные сообщения.

А для этого есть аналогичный протокол или набор протоколов? Вроде есть какой-то Matrix, но почему тогда им никто не пользуется?

А то получается, что клиенты мгновенных сообщений проприетарные, сервера тоже, существует разные несовместимые проприетарные протоколы, которые появляются и исчезают в зависимости от моды и чего-то еще, а почта с 70-ых годов просто существует. Почему нельзя так?

Лучший ответ

 

damix9
()

Сторонний telegram-клиент

Форум — Desktop

Посоветуйте telegram-клиент со следующими фичами (или хотя бы их частью):

  • Опция отключить аватары
  • Задать размер шрифта в сообщениях
  • Сделать сообщения шире, чем в официальном, т.е. если справа есть место, то продолжать строку, а не переносить ее
  • Показывать ники в списке чатов и в самих чатах
  • Опция не показывать имена в списке чатов

Желательно:

  • Шифрованные сообщения
  • Более старомодный дизайн

 ,

damix9
()

Почему удалили?

Форум — Linux-org-ru

Почему удалили www.linux.org.ru/forum/linux-hardware/17441552?cid=17441598
а само некорректное сообщение оставили?

cast Dimez

 

damix9
()

RSS подписка на новые темы