MoreRSS

site iconii74 | 朝舞修改

博客内容包含各种生活记录和技术分享,如Android学习。
请复制 RSS 到你的阅读器,或快速订阅到 :

Inoreader Feedly Follow Feedbin Local Reader

ii74 | 朝舞的 RSS 预览

vs2022使用c++ std::any_of 等 c++ 11 标准语言时,提示报错namespace "std" has no member "all_of"

2024-08-06 14:23:40

vs2022使用c++ std::any_of 等 c++ 11 标准语言时,提示报错namespace "std" has no member "all_of" 时怎么办


在当前文件引入头

#include <algorithm>

ChromeDriverManager 镜像地址

2024-07-01 12:04:14

今天运行了个浏览器的模拟python,但是提示 could not reach host. are you offline? 找到原因是浏览器更新了,驱动插件过期了,需要在线下载,以前可以通过本地代理下载,但是最近墙高了,所以找到个镜像下载的方法。 最后还是需要建议尽量用其他的库,国内网络环境不太好。

import os
from typing import Optional
from packaging import version
from webdriver_manager.core.logger import log

from webdriver_manager.core.download_manager import DownloadManager
from webdriver_manager.core.driver_cache import DriverCacheManager
from webdriver_manager.core.manager import DriverManager
from webdriver_manager.core.os_manager import OperationSystemManager, ChromeType
from webdriver_manager.drivers.chrome import ChromeDriver


class ExtChromeDriver(ChromeDriver):
    def get_driver_download_url(self, os_type):
        driver_version_to_download = self.get_driver_version_to_download()
        # For Mac ARM CPUs after version 106.0.5249.61 the format of OS type changed
        # to more unified "mac_arm64". For newer versions, it'll be "mac_arm64"
        # by default, for lower versions we replace "mac_arm64" to old format - "mac64_m1".
        if version.parse(driver_version_to_download) < version.parse("106.0.5249.61"):
            os_type = os_type.replace("mac_arm64", "mac64_m1")

        if version.parse(driver_version_to_download) >= version.parse("115"):
            if os_type == "mac64":
                os_type = "mac-x64"
            if os_type in ["mac_64", "mac64_m1", "mac_arm64"]:
                os_type = "mac-arm64"

            modern_version_url = self.get_url_for_version_and_platform(driver_version_to_download, os_type)
            log(f"Modern chrome version {modern_version_url}")
            return modern_version_url

        return f"{self._url}/{driver_version_to_download}/{self.get_name()}_{os_type}.zip"

    def get_browser_type(self):
        return self._browser_type

    def get_latest_release_version(self):
        determined_browser_version = self.get_browser_version_from_os()
        log(f"Get LATEST {self._name} version for {self._browser_type}")
        if determined_browser_version is not None and version.parse(determined_browser_version) >= version.parse("115"):
            url = "https://registry.npmmirror.com/-/binary/chrome-for-testing"
            response = self._http_client.get(url)
            response_list = response.json()
            determined_browser_version = self.get_version_form_net(determined_browser_version, response_list)
            if determined_browser_version.endswith("/"):
                determined_browser_version = determined_browser_version[:-1]
            return determined_browser_version
            # Remove the build version (the last segment) from determined_browser_version for version < 113
        determined_browser_version = ".".join(determined_browser_version.split(".")[:3])
        latest_release_url = (
            self._latest_release_url
            if (determined_browser_version is None)
            else f"{self._latest_release_url}_{determined_browser_version}"
        )
        resp = self._http_client.get(url=latest_release_url)
        return resp.text.rstrip()

    def get_version_form_net(self, os_version, net_versions):
        for v in net_versions:
            if os_version in v["name"]:
                return v["name"]
        raise Exception(f"No such driver version {os_version} for {self._browser_type}")

    def get_url_for_version_and_platform(self, browser_version, platform):
        base_url = f"https://registry.npmmirror.com/-/binary/chrome-for-testing/{browser_version}/"

        platform_path_map = {
            'linux64': 'linux64/chromedriver-linux64.zip',
            'mac-x64': 'mac-x64/chromedriver-mac-x64.zip',
            'mac-arm64': 'mac-arm64/chromedriver-mac-arm64.zip',
            'win32': 'win32/chromedriver-win32.zip',
            'win64': 'win64/chromedriver-win64.zip',
        }

        download_url = base_url + platform_path_map[platform]
        return download_url


class ChromeDriverManager(DriverManager):
    def __init__(
        self,
        driver_version: Optional[str] = None,
        name: str = "chromedriver",
        url: str = "https://registry.npmmirror.com/-/binary/chromedriver",
        latest_release_url: str = "https://registry.npmmirror.com/-/binary/chromedriver/LATEST_RELEASE",
        chrome_type: str = ChromeType.GOOGLE,
        download_manager: Optional[DownloadManager] = None,
        cache_manager: Optional[DriverCacheManager] = None,
        os_system_manager: Optional[OperationSystemManager] = None

    ):
        super().__init__(
            download_manager=download_manager,
            cache_manager=cache_manager,
            os_system_manager=os_system_manager
        )

        self.driver = ExtChromeDriver(
            name=name,
            driver_version=driver_version,
            url=url,
            latest_release_url=latest_release_url,
            chrome_type=chrome_type,
            http_client=self.http_client,
            os_system_manager=os_system_manager
        )

    def install(self) -> str:
        driver_path = self._get_driver_binary_path(self.driver)
        os.chmod(driver_path, 0o755)
        return driver_path


在启动chrome.option中中ChromeDriverManager重新import一下就可以了

安卓模拟器最简单ssl证书安装

2024-05-11 09:45:52

使用nox模拟器

复制这个目录的文件到 


image.png

这个目录就行

image.png

Thingsboard 设置搜索关键字的方法

2024-03-29 09:12:01

thingsboard 中,默认的搜索只搜索名字(name),有些时候,我们还添加了标签 (label),此时需要通过label去搜索对应的设备。


分析源码后找到 

AbstractDeviceEntity


只需要修改

@Override
public String getSearchTextSource() {
    return name + label;
}

即可

某东云彩屏版4G随身wifi替换图片的方法

2024-03-15 15:35:25

前段时间买了个彩屏随身wifi

记录一下如何替换图片的过程

1:开启adb

2:使用 adb pull /etc_ro/mmi ./  将图片下载到本地

3:打开mmi目录会发现,所有图片都是PNG格式,我们只需要替换相应的图片,即可实现图片替换效果,注意分辨率必须一致,否则加载不出来

某东云R106 切sim卡方式

2024-03-15 15:31:58

最近买了个某东云的5G随身WIFI  r106的板子,跟长城那些是一套东西。 代工厂是品速

实际上就是品速M2的换壳

所以我们只需要使用常规操作,进行破解就行了。

破解过程自行研究


下面说一下切卡怎么切

登录到后台页面 也就是http://192.168.1.1

按F12找到控制台,输入g_disable = "enable"

解除限制后,访问 #cardmode模式就可以进入到切卡页面了。