将要崩溃的行:
GoogleSignInAccount googleUser = await _googleSignIn.signIn();
Run Code Online (Sandbox Code Playgroud)
我试过什么:
keytool -list -v \
-alias androiddebugkey -keystore ~/.android/debug.keystoredebug.keystore从.android到MyProject/android添加到android/build.gradle这些行中:
添加到android/app/build.gradle这一行:
release-signing.properties在我的项目文件夹下创建一个文件,其中包含这些行。
另外,我已经在所有 StackOverflow问题中搜索了我能找到的这个问题,但没有一个对我有用。
我的 pubspec.yaml:
firebase_core: ^0.4.0+1
firebase_analytics: ^3.0.1
cloud_firestore: ^0.11.0+2
firebase_auth: ^0.11.1
google_sign_in: ^4.0.1+3
rxdart: ^0.22.0
Run Code Online (Sandbox Code Playgroud)
认证类:
class AuthService {
final GoogleSignIn …Run Code Online (Sandbox Code Playgroud) dart google-signin flutter googlesigninaccount googlesigninapi
我必须连接到一台服务器,我的用户可以访问其中的一个小分区,/home/users/user_name我有一个有限的空间配额和一个更大的分区/big_partition/users/user
登录该服务器后,我将到达/home/users/user_name大区。之后,我正在执行以下步骤。
cd /big_partition/users/usercreate conda --prefix=envs python=3.6在第四行,它说Package plan for installation in environment /big_partition/users/user/envs:哪个可以。
按y,而不是我收到以下消息。
OSError: [Errno 122] Disk quota exceeded: '/home/users/user_name/.conda/envs/.pkgs/python-3.6.2-0/lib/python3.6/unittest/result.py'
谁能帮助我了解当我创建此环境时如何将.conda文件夹从移动/home/users/user_name到?/big_partition/users/user
伙计们,我在这里确实有一个有趣的问题,如果你们中的任何人能够帮助我,我会非常高兴。
我的应用流程是什么:
就是这样,这就是我所有的基本逻辑,据我所知,你怎么看我没有从数据库中读取任何信息。
现在......问题是,由于一些奇怪的原因,当我注册我的用户时,我要去firebase控制台查看我的数据库的使用情况,我会看到类似......对于创建的一个用户,我将有 1 次写入(正如我预期的那样很好),但也有13-20 次从 DB 读取。
现在这就是我的问题,为什么我在进行身份验证和写入时会阅读firestorm?
这是我现在正在使用的数据库代码。
class DatabaseFirebase implements BaseDataBase {
final FirebaseAuth _firebaseAuth = FirebaseAuth.instance;
final FirebaseStorage _storage = FirebaseStorage.instance;
FirebaseUser _firebaseUser;
Firestore _firestore = Firestore.instance;
@override
Future<String> login(String email, String password) async {
_firebaseUser = await _firebaseAuth.signInWithEmailAndPassword(
email: email, password: password);
return _firebaseUser.uid;
}
@override
Future<String> register(String email, String password) async {
_firebaseUser = await _firebaseAuth.createUserWithEmailAndPassword(
email: email, password: password);
return _firebaseUser.uid; …Run Code Online (Sandbox Code Playgroud) dart firebase firebase-authentication flutter google-cloud-firestore
我必须做的:
我正在构建一个应用程序,我想在 firebase 中进行查询并接收 X 公里范围内的用户。但我想限制这个收到的文件,并有一个功能来获取更多的文件滚动。我正在使用 aStreamBuilder->ListView.build来构建我的列表。当我要收到可滚动列表的末尾时,我想从 Firestore 获取更多文档(如果有的话)。
我已经做过的事情:
到目前为止,我只找到了 2 个解决我的问题的方法:
问题:
这两个库是好的只有一个大问题,在这两个这种情况下,我无法限制的文件,我要去接受(我可以数JUST限制了原始查询Firestore.instance.collection("MyColection")),但不会帮我那么多,因为我会有这个案子
给我来自 Firestore 的 10 个文件 -> 给我 5 公里范围的用户 -> 我只会收到 4 个让我们说。
我想要的是从 X 范围内的 Firestore 接收 10 个文档。
这个问题有什么解决方案吗?或者我需要为此实现我自己的库?或者即使这样也不可能?
我正在尝试在线程上运行一个拥抱脸模型,模式完全是“cardiffnlp/twitter-roberta-base-sentiment”。但与此同时,我只想要它的一个实例,因为就时间而言,它真的很昂贵。
换句话说,我有多个 CSV 文件(几千个),每个文件都有大约 20k-30k 行,我希望所有这些文件中的每一行都由 Huggingface 模型执行,正如您可能已经想象到的那样我不想为每个线程实例化模型的原因(每个线程仅用于读取一行并将其写入数据库中)。我的方法的问题是,当我运行代码时,我会因为 Huggingface 模型而出现错误。
运行时错误:已借用
你们中的任何人都可以帮助我了解如何修复它吗?
抱脸型:
class EmotionDetection(object):
def __init__(self, model_name="cardiffnlp/twitter-roberta-base-sentiment"):
self.model_name = model_name
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name)
self.classifier = TextClassificationPipeline(model=model, tokenizer=tokenizer, return_all_scores=True,
task="sentiment-analysis", device=0)
def get_emotion_by_label(self, label: str):
if label == "LABEL_0":
return "negative"
elif label == "LABEL_1":
return "neutral"
elif label == "LABEL_2":
return "positive"
else:
print("SOMETHING IS WRONG")
return ""
def get_emotion(self, phrase):
results = self.classifier(phrase)
res = dict()
for result in results:
for emotion in …Run Code Online (Sandbox Code Playgroud) python multithreading threadpool huggingface-transformers huggingface-tokenizers
我从文件夹中有以下代码example,但我添加了@profile. 我只是想让这个例子运行,因为在我的代码中更复杂,我有同样的错误,我想知道每行使用了多少内存。
系统:
蟒蛇:3.9
内存分析器:0.58
操作系统:Manjaro
代码:
import time
import multiprocessing as mp
from memory_profiler import profile
# Big numbers
X6 = 10 ** 6
X7 = 10 ** 7
def worker(num, wait, amt=X6):
"""
A function that allocates memory over time.
"""
frame = []
for idx in range(num):
frame.extend([1] * amt)
time.sleep(wait)
del frame
def main_sequential():
"""
A sequential version of the work, where one worker is called at a time.
"""
worker(5, 5, …Run Code Online (Sandbox Code Playgroud) 我正在尝试安装此软件包,ncurses5-compat-libs但由于以下问题,我可以安装。
我做了什么:
1. 是的 ncurses5-compat-libs
有两种类型的错误:要么我将检查“Y”并添加密钥,那么在这种情况下,我将收到如下错误消息
gpg: keyserver receive failed: Permission denied
==> Error: Problem importing keys
Run Code Online (Sandbox Code Playgroud)
或者我将检查为“n”以不添加密钥,我将收到
==> Verifying source file signatures with gpg...
ncurses-6.1.tar.gz ... FAILED (unknown public key 702353E0F7E48EDB)
==> ERROR: One or more PGP signatures could not be verified!
Error downloading sources: ncurses5-compat-libs
Run Code Online (Sandbox Code Playgroud)
2. sudo gpg --recv-keys C52048C0C0748FEE227D47A2702353E0F7E48EDB
我试过手动添加它,但没有用。
3. sudo gpg --recv-keys 702353E0F7E48EDB
还有这个我尝试手动添加,但没有用
4. yay -S --noconfirm --needed ncurses5-compat-libs
5. 试图关闭这个论坛
最少但不是最后
6.我尝试通过以下方式手动克隆存储库
git clone http://aur.archlinux.org/ncurses5-compat-libs.git
cd ncurses5-compat-libs
sudo gpg --recv-keys …Run Code Online (Sandbox Code Playgroud) 操作系统:Ubuntu 21.10\nAndroid-Studio:2021.1.1\nFlutter:2.10.2
\n如果我正在运行,flutter doctor我将得到以下输出:
[\xe2\x9c\x93] Flutter (Channel stable, 2.10.2, on Ubuntu 21.10 5.13.0-30-generic, locale en_US.UTF-8)\n[\xe2\x9c\x97] Android toolchain - develop for Android devices\n \xe2\x9c\x97 cmdline-tools component is missing\n Run `path/to/sdkmanager --install "cmdline-tools;latest"`\n See https://developer.android.com/studio/command-line for more details.\n[\xe2\x9c\x97] Chrome - develop for the web (Cannot find Chrome executable at google-chrome)\n ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.\n[\xe2\x9c\x93] Linux toolchain - develop for Linux desktop\n[\xe2\x9c\x93] Android Studio (version 2021.1)\n[\xe2\x9c\x93] VS Code\n[\xe2\x9c\x93] Connected device (2 available)\n[\xe2\x9c\x93] …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用 Qt 5.14 构建一个发布模式下的应用程序,并且 Qt Creator 内部一切正常,但是当我尝试单独运行可执行文件时,我收到如下错误:
操作系统: Windows 10
Qt: 5.14
编译: 3.5
我尝试过的:
上述方法都不适合我,每当我尝试在不使用 Qt Creator 的情况下自行运行可执行文件时,我都会遇到相同的错误。
我的 CMake 文件:
cmake_minimum_required(VERSION 3.5)
project(Scrollable LANGUAGES CXX)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++ -static")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -fPIC")
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(Qt5 REQUIRED Core Widgets Gui Qml Quick Qml)
qt5_add_resources(resource.qrc)
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
include_directories("MoviesInterface")
set(SOURCES
main.cpp
MovieInterface/movieinterfaceomdb.cpp
MovieInterface/moviesinterface.cpp
)
set(HEADERS
MovieInterface/movieinterfaceomdb.h
MovieInterface/moviesinterface.h
)
add_executable(Scrollable ${SOURCES} ${HEADERS} …Run Code Online (Sandbox Code Playgroud) 这是此刻的代码:
ClipRRect(
borderRadius: BorderRadius.circular(11),
child: Container(
decoration: BoxDecoration(
gradient: LinearGradient(
begin: FractionalOffset.bottomLeft,
end: FractionalOffset.topRight,
colors: <Color>[Colors.purple, AppBaseColors.orange],
),
boxShadow: [BoxShadow(color: Colors.yellow)]
),
child: Material(
child: InkWell(
onTap: () {
print("tapped");
},
child: Container(
width: ButtonTheme.of(context).minWidth,
height: ButtonTheme.of(context).height,
child: Center(
child: Text(
"log in",
style: TextStyle(
color: Colors.white, fontWeight: FontWeight.bold),
),
),
),
),
color: Colors.transparent,
),
),
),
Run Code Online (Sandbox Code Playgroud)
我尝试过的是:
我正在尝试学习 QML,目前我在理解 rowSpan 和 columnSpan 方面遇到了一些问题,如果这个问题对你们中的一些人来说可能听起来很愚蠢,那么很抱歉。
我学到的是:
如果我错了,请纠正我,但在GridLayout中应该是这样的:
我正在尝试做什么:
这种布局理论上应该具有以下特点:
或者至少到目前为止我是这么理解的。
问题:
在我用 col、row 以及 colSpan 和 rowSpan 编码 QML 后,我得到了这个。
我的代码:
import …Run Code Online (Sandbox Code Playgroud) 我有以下课程
class Test{
int a;
int b;
};
Run Code Online (Sandbox Code Playgroud)
我想要的只是有一个QSet<Test>我将插入一些测试对象的地方。
int main(int argc, char *argv[]) {
QCoreApplication a(argc, argv);
QSet<Test> setTest;
setTest.insert(Test());
return QCoreApplication::exec();
}
Run Code Online (Sandbox Code Playgroud)
问题是我由于某种原因收到以下错误,我不知道为什么或如何解决它。
C:\Qt\5.14.2\msvc2017_64\include\QtCore/qhashfunctions.h(118): error C2665: 'qHash': 24 个重载中没有一个可以转换所有参数类型 C:\Qt\5.14.2\msvc2017_64 \include\QtCore/qlocale.h(62): 注意:可能是 'uint qHash(const QLocale &,uint) noexcept' C:\Qt\5.14.2\msvc2017_64\include\QtCore/qregexp.h(56):注意:或
正在使用 [ T=Test ] C:\Users\vlad.dumitru\CLionProjects\Test\main.cpp(11) 进行编译:注意:请参阅对正在编译的类模板实例“QSet”的引用 C:\Qt\5.14.2\ msvc2017_64\include\QtCore/qhashfunctions.h(118):错误C2056:非法表达式NMAKE:致命错误U1077:'C:\PROGRA~2\MICROS~2\2017\BUILDT~1\VC\Tools\MSVC\1416~ 1.270\bin\Hostx64\x64\cl.exe' : 返回码 '0x2' 停止。NMAKE: 致命错误 U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64\nmake.exe"': 返回代码 ' 0x2' 停止。NMAKE: 致命错误 U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64\nmake.exe"': 返回代码 ' 0x2' 停止。NMAKE: 致命错误 U1077: '"C: …