首先,我不得不说我对Android开发非常新,所以如果我忽略了一些明显的东西,请原谅我.
对于大学项目,我必须创建一个应用程序,首先使用Firebase通过其Google帐户对用户进行身份验证.我先按照我在这里找到的说明进行操作.
首先,我从Firebase Tutorial复制粘贴此代码.一切似乎都在起作用,除了一件事:
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
Log.d(TAG, "------------------ onActivityResult ------------------");
super.onActivityResult(requestCode, resultCode, data);
// Result returned from launching the Intent from GoogleSignInApi.getSignInIntent(...);
if (requestCode == RC_SIGN_IN) {
GoogleSignInResult result = Auth.GoogleSignInApi.getSignInResultFromIntent(data);
if (result.isSuccess()) {
Log.d(TAG, "------------------ googleSignInSuccess ------------------");
// Google Sign In was successful, authenticate with Firebase
GoogleSignInAccount account = result.getSignInAccount();
firebaseAuthWithGoogle(account);
// Start menu activity once the user has been logged in
Intent intent = …Run Code Online (Sandbox Code Playgroud) android google-authentication firebase firebase-authentication
我定义了以下数据类:
"""This module declares the SubtitleItem dataclass."""
import re
from dataclasses import dataclass
from time_utils import Timestamp
@dataclass
class SubtitleItem:
"""Class for storing all the information for
a subtitle item."""
index: int
start_time: Timestamp
end_time: Timestamp
text: str
@staticmethod
def load_from_text_item(text_item: str) -> "SubtitleItem":
"""Create new subtitle item from their .srt file text.
Example, if your .srt file contains the following subtitle item:
```
3
00:00:05,847 --> 00:00:06,916
The robot.
```
This function will return:
```
SubtitleItem(
index=3,
start_time=Timestamp(seconds=5, milliseconds=847), …Run Code Online (Sandbox Code Playgroud) 为了完成家庭作业,我必须修改 Linux 内核。
\n\n我正在虚拟机上工作,我向内核添加了一个系统调用,我将其称为get_unique_id. 这是代码get_unique_id.c:
#include <linux/linkage.h>\n#include <asm/uaccess.h>\n\nasmlinkage long sys_get_unique_id(int * uuid)\n{\n // static because we want its state to persist between calls\n static int uid = 0;\n\n ++uid;\n\n // assign new uid value to user-provided mem location\n // returns non-zero if success or -EFAULT otherwise\n int ret = put_user(uid, uuid);\n return ret;\n}\nRun Code Online (Sandbox Code Playgroud)\n\n我还将这一行添加到syscalls.h:
asmlinkage long sys_get_unique_id(int * uuid);\nRun Code Online (Sandbox Code Playgroud)\n\n这一行到 syscall_32.tbl :
\n\n383 i386 get_unique_id sys_get_unique_id\nRun Code Online (Sandbox Code Playgroud)\n\n最后这一行 …