小编Eug*_*nij的帖子

如何在Android平板模拟器中隐藏底部栏

我正在 Android Studio 中开发 Android 应用程序,并使用 Android 虚拟设备管理器(AVD 管理器)进行调试。

现在,我想将我的应用程序发布到 PlayMarket,并且我需要上传适用于移动设备以及 7 英寸和 10 英寸平板电脑的应用程序的屏幕截图。

我运行 AVDNexus 10Android API 33得到这样的屏幕截图。

在此输入图像描述

我怎样才能摆脱底部栏?我不希望这些图标出现在 PlayMarket 中我的应用程序屏幕截图上。

android android-emulator android-studio

12
推荐指数
2
解决办法
2487
查看次数

Django 存根中断 Pycharm 自动完成

我有一个带有多个模型的 Django 应用程序。这是我过滤对象时的自动完成

在此输入图像描述

然后我为 MyPy 安装 django-stubs

pip install django-stubs
Run Code Online (Sandbox Code Playgroud)

现在我的自动完成看起来像这样

在此输入图像描述 在此输入图像描述

当我删除 django-stubs 时,自动完成效果很好,就像第一张图片一样

pip uninstall django-stubs
Run Code Online (Sandbox Code Playgroud)

那么,有没有办法将 django-stubs 与 Pycharm Django 自动完成功能结合使用?

我使用Pycharm Professional 2019.1和Python3.7

python django pycharm django-stubs

5
推荐指数
1
解决办法
652
查看次数

MyPy 错误:类模式中的预期类型;找到“任意”

想要将 MyPy 检查器添加到我的 html scraper 中。我设法修复了除此之外的所有错误Expected type in class pattern

源代码:

from bs4 import BeautifulSoup

from bs4.element import Tag, NavigableString

soup = BeautifulSoup("""
    <!DOCTYPE html>
    <html>
        <body>
            EXTRA TEXT
            <p>
            first <b>paragraph</b>
            <br>
            <br>
            second paragraph
            </p>
        </body>
    </html>
    """, "lxml")

tag = soup.select_one('body')

for el in tag.children:
    match el:
        case NavigableString():
            ...
        case Tag(name="p"):
            ...
        case Tag():
            ...
Run Code Online (Sandbox Code Playgroud)

mypy example.py

错误:

example.py:24: error: Expected type in class pattern; found "Any"
example.py:26: error: Expected type in class pattern; …
Run Code Online (Sandbox Code Playgroud)

python python-3.x mypy

5
推荐指数
1
解决办法
1272
查看次数

PostgreSQL 中的 Edge NGram 搜索

我需要为大量公司(超过 80,000,000 家)进行搜索时自动完成。公司名称应包含以这样的搜索查询开头的单词

+-------+----------------------------------+
| term  | results                          |
+-------+----------------------------------+ 
| gen   | general motors; general electric |
| geno  | genoptix; genomic health         |
| genom | genoma group; genomic health     |
+-------+----------------------------------+
Run Code Online (Sandbox Code Playgroud)

pg_trgm模块和GIN索引实现类似行为,但并没有解决我的问题。

例如,ElasticSearch 具有完全符合我的要求的Edge NGram Tokenizer功能。

从文档:

The edge_ngram tokenizer first breaks the text down into words 
whenever it encounters one of a list of specified characters, 
then it emits N-grams of each word 
where the start of the N-gram is …
Run Code Online (Sandbox Code Playgroud)

postgresql full-text-search elasticsearch pg-trgm

3
推荐指数
1
解决办法
1675
查看次数

Postgresql 数组唯一聚合

我有一张带有结构的大桌子

CREATE TABLE t (
  id SERIAL primary key ,
  a_list int[] not null,
  b_list int[] not null,
  c_list int[] not null,
  d_list int[] not null,
  type int not null 
)

Run Code Online (Sandbox Code Playgroud)

我想查询a_list, b_list, c_list,中的所有唯一值,d_list如下type所示

    select 
        some_array_unique_agg_function(a_list), 
        some_array_unique_agg_function(b_list), 
        some_array_unique_agg_function(c_list), 
        some_array_unique_agg_function(d_list),
        count(1) 
    where type = 30
Run Code Online (Sandbox Code Playgroud)

例如对于这个数据

+----+---------+--------+--------+---------+------+
| id | a_list  | b_list | c_list | d_list  | type |
+----+---------+--------+--------+---------+------+  
| 1  | {1,3,4} | {2,4}  | {1,1}  | {2,4,5} | 30 …
Run Code Online (Sandbox Code Playgroud)

postgresql aggregate-functions

2
推荐指数
1
解决办法
1214
查看次数