RError.com

RError.com Logo RError.com Logo

RError.com Navigation

  • 主页

Mobile menu

Close
  • 主页
  • 系统&网络
    • 热门问题
    • 最新问题
    • 标签
  • Ubuntu
    • 热门问题
    • 最新问题
    • 标签
  • 帮助
主页 / 问题

全部问题

Martin Hope
SargeAnt
Asked: 2024-09-26 12:24:00 +0000 UTC

来自 Avito 的推送通知停止发送

  • 5

请帮忙,Avito 技术支持无法提供帮助:我停止接收来自 Avito 的推送通知。他们以前经常来,突然我不知道他们为什么停下来。也许是在更新 Windows 后,也许是在更新浏览器后,或者可能是 Avito 出现问题。或者我不知道还有什么可能

Messenger 中缺少有关新消息的通知尤其令人不快。以前,多亏了他们,我可以立即回复消息,现在我只能在通过电子邮件收到新消息通知时才能回复消息,而且这种情况只会在大约十五分钟后发生

技术支持可能无济于事,因为我的配置相当罕见 - 我没有智能手机,我只在普通计算机上使用 Avito 网站。它有 Windows 7 和 Yandex 浏览器。关于缺少推送通知的问题,我已经写信给Avito技术支持和Yandex技术支持。到目前为止,他们还无法提供帮助。也许你有一些想法?为什么推送通知可能无法到达?如何让他们来

根据技术支持请求,我已经尝试强制如下:

  1. 注销您的 Avito 个人资料并重新登录。没有帮助
  2. 在装有 Windows Server 2008R2 的新计算机上安装 Yandex 浏览器,并从那里接收来自 Avito 的通知。他们也不来
  3. 登录另一个 Avito 帐户(我有两个)并在那里接收推送通知。他们也不来
  4. 在 Yandex 浏览器中添加新的配置文件并尝试在那里接收推送通知。他们也不来
  5. 测试在网站https://simple-push-demo.vercel.app/上接收推送通知,他们会立即收到推送通知,100%
  6. 测试是否在任何其他浏览器(Microsoft Edge、Internet Explorer、Mozilla Firefox 或 Google Chrome)中收到通知。结果是:
  • Google Chrome 不再在 Windows 7 上运行,已经好几年了
  • Internet Explorer 无法显示推送通知
  • 仅在手动将 mail.yandex.ru 添加到通知权限后,我们才设法让 Microsoft Edge 仅显示来自 mail.yandex.ru 网站的推送通知。尽管手动将这些站点添加到通知权限,但无法显示来自站点 e.mail.ru 和 mail.rambler.ru 的推送通知
  • Firefox 无法从 mail.yandex.ru、e.mail.ru、mail.rambler.ru 等任何网站获取要显示的推送通知。此外,您无法在 Firefox 中手动将网站添加到通知权限 - 它在设置中没有这样的选项(只有当用户积极响应网站显示通知的请求时,它才会将网站添加到权限中,并且由于某种原因用户不这样做)不会收到此类请求)

你还会有什么其他想法?

push-уведомления
  • 1 个回答
  • 67 Views
Martin Hope
Den
Asked: 2024-09-26 12:22:04 +0000 UTC

如何缩短代码以及是否值得为了度量目标而这样做?

  • 5

如何缩短代码?

$(".copy_header_mail").bind('copy', function() {
    ym(666777888, 'reachGoal', 'copy-header-email');
    return true;
});
$(".copy_header_phone").bind('copy', function() {
    ym(666777888, 'reachGoal', 'copy-header-phone');
    return true;
});

$(".copy_footer_mail").bind('copy', function() {
    ym(666777888, 'reachGoal', 'copy-footer-email');
    return true;
});
$(".copy_footer_phone").bind('copy', function() {
    ym(666777888, 'reachGoal', 'copy-footer-phone');
    return true;
});
javascript
  • 1 个回答
  • 25 Views
Martin Hope
Данило Багута
Asked: 2024-09-26 04:44:15 +0000 UTC

尝试通过 ip ESP-IDF 连接时显示没有到该站点的连接

  • 5

我正在尝试sta-сервер在 中创建ESP-IDF,但遇到了一个问题 - 当我尝试连接到ip服务器时,它说没有与该站点的连接:

没有连接到该网站

代码esp-idf:

#include <stdio.h>
#include <stdlib.h>
#include <string.h> //Requires by memset
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "esp_system.h"
#include "esp_spi_flash.h"
#include <esp_http_server.h>

#include "esp_wifi.h"//
#include "esp_event.h"//
#include "freertos/event_groups.h"
#include "esp_log.h"
#include "nvs_flash.h"
#include "esp_netif.h"
#include "driver/gpio.h"
#include <lwip/sockets.h>
#include <lwip/sys.h>
#include <lwip/api.h>
#include <lwip/netdb.h>
#include <sys/param.h>
#include "esp_eth.h"
#include "lwip/err.h"
#include "sayt.h"

int ServTimer = 0;
char data[15];
extern char home[];
char Mylink;

static const char *TAG = "espressif"; // TAG for debug

#define EXAMPLE_ESP_WIFI_SSID "Danilo"
#define EXAMPLE_ESP_WIFI_PASS "357357357"
#define EXAMPLE_ESP_MAXIMUM_RETRY 7

/* FreeRTOS event group to signal when we are connected*/
static EventGroupHandle_t s_wifi_event_group;

/* The event group allows multiple bits for each event, but we only care about two events:
 * - we are connected to the AP with an IP
 * - we failed to connect after the maximum amount of retries */
#define WIFI_CONNECTED_BIT BIT0
#define WIFI_FAIL_BIT BIT1

static int s_retry_num = 0;

static void event_handler(void *arg, esp_event_base_t event_base,
                          int32_t event_id, void *event_data)
{
    if (event_base == WIFI_EVENT && event_id == WIFI_EVENT_STA_START)
    {
        esp_wifi_connect();
    }
    else if (event_base == WIFI_EVENT && event_id == WIFI_EVENT_STA_DISCONNECTED)
    {
        if (s_retry_num < EXAMPLE_ESP_MAXIMUM_RETRY)
        {
            esp_wifi_connect();
            s_retry_num++;
            ESP_LOGI(TAG, "retry to connect to the AP");
        }
        else
        {
            xEventGroupSetBits(s_wifi_event_group, WIFI_FAIL_BIT);
        }
        ESP_LOGI(TAG, "connect to the AP fail");
    }
    else if (event_base == IP_EVENT && event_id == IP_EVENT_STA_GOT_IP)
    {
        ip_event_got_ip_t *event = (ip_event_got_ip_t *)event_data;
        ESP_LOGI(TAG, "got ip:" IPSTR, IP2STR(&event->ip_info.ip));
        s_retry_num = 0;
        xEventGroupSetBits(s_wifi_event_group, WIFI_CONNECTED_BIT);
    }
}

void connect_wifi(void)
{
    s_wifi_event_group = xEventGroupCreate();

    ESP_ERROR_CHECK(esp_netif_init());

    ESP_ERROR_CHECK(esp_event_loop_create_default());
    esp_netif_create_default_wifi_sta();

    wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT();
    ESP_ERROR_CHECK(esp_wifi_init(&cfg));

    esp_event_handler_instance_t instance_any_id;
    esp_event_handler_instance_t instance_got_ip;
    ESP_ERROR_CHECK(esp_event_handler_instance_register(WIFI_EVENT,
                                                        ESP_EVENT_ANY_ID,
                                                        &event_handler,
                                                        NULL,
                                                        &instance_any_id));
    ESP_ERROR_CHECK(esp_event_handler_instance_register(IP_EVENT,
                                                        IP_EVENT_STA_GOT_IP,
                                                        &event_handler,
                                                        NULL,
                                                        &instance_got_ip));

    wifi_config_t wifi_config = {
        .sta = {
            .ssid = EXAMPLE_ESP_WIFI_SSID,
            .password = EXAMPLE_ESP_WIFI_PASS,
            .threshold.authmode = WIFI_AUTH_WPA2_PSK,
        },
    };
    ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_STA));
    ESP_ERROR_CHECK(esp_wifi_set_config(WIFI_IF_STA, &wifi_config));
    ESP_ERROR_CHECK(esp_wifi_start());

    ESP_LOGI(TAG, "wifi_init_sta finished.");

    /* Waiting until either the connection is established (WIFI_CONNECTED_BIT) or connection failed for the maximum
     * number of re-tries (WIFI_FAIL_BIT). The bits are set by event_handler() (see above) */
    EventBits_t bits = xEventGroupWaitBits(s_wifi_event_group,
                                           WIFI_CONNECTED_BIT | WIFI_FAIL_BIT,
                                           pdFALSE,
                                           pdFALSE,
                                           portMAX_DELAY);

    /* xEventGroupWaitBits() returns the bits before the call returned, hence we can test which event actually
     * happened. */
    if (bits & WIFI_CONNECTED_BIT)
    {
        ESP_LOGI(TAG, "connected to ap SSID:%s password:%s",
                 EXAMPLE_ESP_WIFI_SSID, EXAMPLE_ESP_WIFI_PASS);
    }
    else if (bits & WIFI_FAIL_BIT)
    {
        ESP_LOGI(TAG, "Failed to connect to SSID:%s, password:%s",
                 EXAMPLE_ESP_WIFI_SSID, EXAMPLE_ESP_WIFI_PASS);
    }
    else
    {
        ESP_LOGE(TAG, "UNEXPECTED EVENT");
    }
    vEventGroupDelete(s_wifi_event_group);
}

esp_err_t get_req_handler(httpd_req_t *req)
{
    const char *response = (const char *) req->user_ctx;
    return httpd_resp_send(req, response, strlen(response));
}

esp_err_t led_on_handler(httpd_req_t *req)
{
    ServTimer++;
    sprintf(data,"%i",ServTimer);
    char buf[100];
    httpd_req_get_url_query_str(req, buf, httpd_req_get_url_query_len(req)+1);
    ESP_LOGI(TAG,"%s", buf);
    const char *response = (const char *) req->user_ctx;
    return httpd_resp_send(req, response, strlen(response));
};
static esp_err_t echo_post_handler(httpd_req_t *req)
{
    char buf[100];
    httpd_req_get_url_query_str(req, buf, httpd_req_get_url_query_len(req)+1);
    ESP_LOGI(TAG,"%s", buf);
    const char *response = (const char *) req->user_ctx;
    return httpd_resp_send(req, response, strlen(response));
};

httpd_uri_t uri_get = {
    .uri = "/",
    .method = HTTP_GET,
    .handler = get_req_handler,
    .user_ctx = home};

httpd_uri_t uri_on = {
    .uri = "/read",
    .method = HTTP_GET,
    .handler = led_on_handler,
    .user_ctx = data};


static const httpd_uri_t button = {
    .uri       = "/post",
    .method    = HTTP_GET,
    .handler   = echo_post_handler,
    .user_ctx  = data
};


httpd_handle_t setup_server(void)
{
    httpd_config_t config = HTTPD_DEFAULT_CONFIG();
    httpd_handle_t server = NULL;

    if (httpd_start(&server, &config) == ESP_OK)
    {
        httpd_register_uri_handler(server, &uri_get);
        httpd_register_uri_handler(server, &uri_on);
        httpd_register_uri_handler(server, &button);
    }

    return server;
}

void app_main()
{
    // Initialize NVS
    esp_err_t ret = nvs_flash_init();
    if (ret == ESP_ERR_NVS_NO_FREE_PAGES || ret == ESP_ERR_NVS_NEW_VERSION_FOUND)
    {
        ESP_ERROR_CHECK(nvs_flash_erase());
        ret = nvs_flash_init();
    }
    ESP_ERROR_CHECK(ret);

    ESP_LOGI(TAG, "ESP_WIFI_MODE_STA");
    connect_wifi();
    setup_server();
}

sayt.h:

#ifndef MAIN_SAYT_H_
#define MAIN_SAYT_H_

char home[] = "<head>\
    <script src=\"https://cdn.plot.ly/plotly-2.30.0.min.js\"></script>\
</head>\
<body>\
    <div id='myDiv'></div>\
    <script>\
        const graphDiv = document.getElementById('myDiv');\
        var time = [0];\
        var value = [0];\
        var i = 1;\
        var f1 = [\
        {\
            x: time,\
            y: value,\
            fill: 'tozeroy',\
            type: 'scatter',\
            line: {color: 'orange'}\
        }\
        ];\
        setInterval(function(){\
            i+=1;\
            time.push(i);\
            vaue.push(i);\
            Plotly.relayout(graphDiv, {y: [value],x: [time]});\
            if (time.length>12){\
                time.shift();\
                value.shift();\
            }\
        },1000);\
        Plotly.newPlot( graphDiv, f1);\
    </script>\
</body>";

#endif
esp32
  • 1 个回答
  • 20 Views
Martin Hope
Роман Филиппов
Asked: 2024-09-26 04:35:45 +0000 UTC

需要验证json中的重复数据

  • 6

REST API 方法必须接受一些 json。如果作为输入的 json 中存在数据重复,是否应该将其视为验证错误?

输入数据示例:

{
  "id": 15,
  "id": 16
}

必须只有一个 id。问题是,支持者并不关心有多少重复项,他将能够通过处理第一个重复项来正确处理请求。另一方面,存在明显的歧义,因为不清楚哪个 id 前面意味着什么。这似乎与 REST 限制相矛盾,因为请求的组成方式必须使服务器能够清楚地了解客户端正在请求哪种资源。还是我错了?

rest
  • 1 个回答
  • 38 Views
Martin Hope
UsbFan
Asked: 2024-09-26 04:12:11 +0000 UTC

FetchData 使用 xml

  • 5

帮助有一个网站,上面有一个 xml 文件 https://example.com/export/xml/com.xml 具有结构

<test>
<date yesterday="25.09.2024" today="26.09.2024" tomorrow="27.09.2024" tomorrow02="28.09.2024"/>
<test1>
<yesterday>Вчера</yesterday>
<today>Сегодня </today>
<tomorrow>Завтра</tomorrow>
<tomorrow02>тоже текст</tomorrow02>
</test1>

例如,如何从该 xml 中获取 Today02 的文本,并将其写入变量。我将弄清楚如何找出变量,我怎样才能至少在控制台中显示此文本?

javascript
  • 1 个回答
  • 31 Views
上一页
下一页

Sidebar

Stats

  • 问题 10021
  • Answers 30001
  • 最佳答案 8000
  • 用户 6900
  • 常问
  • 回答
  • Marko Smith

    我看不懂措辞

    • 1 个回答
  • Marko Smith

    请求的模块“del”不提供名为“default”的导出

    • 3 个回答
  • Marko Smith

    "!+tab" 在 HTML 的 vs 代码中不起作用

    • 5 个回答
  • Marko Smith

    我正在尝试解决“猜词”的问题。Python

    • 2 个回答
  • Marko Smith

    可以使用哪些命令将当前指针移动到指定的提交而不更改工作目录中的文件?

    • 1 个回答
  • Marko Smith

    Python解析野莓

    • 1 个回答
  • Marko Smith

    问题:“警告:检查最新版本的 pip 时出错。”

    • 2 个回答
  • Marko Smith

    帮助编写一个用值填充变量的循环。解决这个问题

    • 2 个回答
  • Marko Smith

    尽管依赖数组为空,但在渲染上调用了 2 次 useEffect

    • 2 个回答
  • Marko Smith

    数据不通过 Telegram.WebApp.sendData 发送

    • 1 个回答
  • Martin Hope
    Alexandr_TT 2020年新年大赛! 2020-12-20 18:20:21 +0000 UTC
  • Martin Hope
    Alexandr_TT 圣诞树动画 2020-12-23 00:38:08 +0000 UTC
  • Martin Hope
    Air 究竟是什么标识了网站访问者? 2020-11-03 15:49:20 +0000 UTC
  • Martin Hope
    Qwertiy 号码显示 9223372036854775807 2020-07-11 18:16:49 +0000 UTC
  • Martin Hope
    user216109 如何为黑客设下陷阱,或充分击退攻击? 2020-05-10 02:22:52 +0000 UTC
  • Martin Hope
    Qwertiy 并变成3个无穷大 2020-11-06 07:15:57 +0000 UTC
  • Martin Hope
    koks_rs 什么是样板代码? 2020-10-27 15:43:19 +0000 UTC
  • Martin Hope
    Sirop4ik 向 git 提交发布的正确方法是什么? 2020-10-05 00:02:00 +0000 UTC
  • Martin Hope
    faoxis 为什么在这么多示例中函数都称为 foo? 2020-08-15 04:42:49 +0000 UTC
  • Martin Hope
    Pavel Mayorov 如何从事件或回调函数中返回值?或者至少等他们完成。 2020-08-11 16:49:28 +0000 UTC

热门标签

javascript python java php c# c++ html android jquery mysql

Explore

  • 主页
  • 问题
    • 热门问题
    • 最新问题
  • 标签
  • 帮助

Footer

RError.com

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

帮助

© 2023 RError.com All Rights Reserve   沪ICP备12040472号-5