我正在关注这个关于 Medium 的教程,让 Gatsby 与 Prismic 一起工作。
在 GraphiQL 资源管理器中,下面的两个查询都产生相同的结果,并且想知道我什么时候应该使用一个而不是另一个(即edge.node.data与nodes.data):
查询#1:
query Articles {
articles: allPrismicArticle {
edges {
node {
data {
title {
text
}
image {
url
}
paragraph {
html
}
}
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
查询#2:
query Articles {
articles: allPrismicArticle {
nodes {
data {
title {
text
}
image {
url
}
paragraph {
html
}
}
}
}
}
Run Code Online (Sandbox Code Playgroud) 甚至在编码时,如果按CtrlAltShiftS一下,也会打开窗口。现在它不像过去那样工作了。为了打开窗口,我必须打开File,然后我需要按快捷键进行操作。
我正在使用Android Studio 3.5.x
我有以下芯片组,当我点击已经选中的芯片时,它会被取消选中,但我必须始终有一个选中的芯片。行为类似于无线电组。
<com.google.android.material.chip.ChipGroup
android:id="@+id/chip_group_filter"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:checkedChip="@id/chip_1"
app:singleSelection="true">
<com.google.android.material.chip.Chip
android:id="@+id/chip_1"
style="@style/Widget.MaterialComponents.Chip.Choice"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/chip1"
app:chipBackgroundColor="@color/chip_color" />
<com.google.android.material.chip.Chip
android:id="@+id/chip_2"
style="@style/Widget.MaterialComponents.Chip.Choice"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/chip2"
app:chipBackgroundColor="@color/chip_color" />
</com.google.android.material.chip.ChipGroup>
Run Code Online (Sandbox Code Playgroud) android android-chips material-components material-components-android
MySQL/Oracle/Teradata 必须SELECT ... INTO FROM ...
从表中获取值并将其分配给变量。如何使用 BigQuery 执行此操作?
SELECT
c1, c2, c3, ...
INTO
@v1, @v2, @v3,...
FROM
table_name
WHERE
condition;
Run Code Online (Sandbox Code Playgroud) 互联网上有大量相同的解决方案,用于定义 git 下载的代理隧道,就像这样,这一切都是通过设置 git 的https.proxy
& http.proxy
config.js 来实现的。但是当您尝试通过协议clone
/ push
/pull
等时,这些答案不起作用ssh
!
例如,通过设置git config --global https.proxy socks5://127.0.0.1:9999
当您尝试克隆时git clone git@github.org:user/repo.git
它不通过定义的 sock5 隧道!
我尝试了各种方法,但都没有奏效!
如何设置 git127.0.0.1:9999
在使用ssh
连接时使用本地 socks5 代理(例如)?
在我的计算机(MacOS 10.14.x)上编译并运行以下代码会导致在clang ++上打印空字符串,并在g ++上引发运行时错误。为什么?
#include <locale>
#include <iostream>
int main()
{
std::cout << "User-preferred locale setting is " <<
std::locale("").name().c_str() << '\n';
return 0;
}
Run Code Online (Sandbox Code Playgroud)
$ clang++ locale.cc
$ ./a.out
User-preferred locale setting is
$ g++-mp-8 locale.cc
$ ./a.out
terminate called after throwing an instance of 'std::runtime_error'
what(): locale::facet::_S_create_c_locale name not valid
User-preferred locale setting is Abort trap: 6
$ clang++ --version
clang version 7.0.1 (tags/RELEASE_701/final)
Target: x86_64-apple-darwin18.7.0
Thread model: posix
InstalledDir: /opt/local/libexec/llvm-7.0/bin
$ g++-mp-8 --version
g++-mp-8 (MacPorts gcc8 8.3.0_0) …
Run Code Online (Sandbox Code Playgroud) 根据 Google 文档,“allAuthenticatedUsers”成员将包括任何经过身份验证的人,包括常规 gmail 帐户。所以我给了那个成员“云函数调用者”角色,认为任何经过身份验证的用户都应该能够调用我的谷歌云函数。那是行不通的。我得到以下结果:
错误:禁止 您的客户端无权从此服务器获取 URL /function-1。
我已经证明,如果我将“云函数调用者”角色授予“allUsers”,则可以调用该函数。所以我知道该功能有效(这是谷歌云创建的默认功能)。
那么为什么不授予“allAuthenticatedUsers”成员“云函数调用者”角色对谷歌云函数起作用呢?我错过了什么?
谢谢
我正在尝试运行一段简单的代码(Python 3.6)将 Excel 工作表中的一系列单元格转换为列表。这是代码:
import openpyxl
wb_d = openpyxl.load_workbook('example.xlsx')
ws = wb_d.active
# iterate through all rows in specific column openpyxl
mylist = []
for row in ws.iter_rows('A{}:A{}'.format(ws.min_row,ws.max_row)):
for cell in row:
mylist.append(cell.value)
print(mylist)
Run Code Online (Sandbox Code Playgroud)
我收到错误:
Traceback (most recent call last):
File "PycharmProjects/Excel/list_generator.py", line 7, in <module>
for row in ws.iter_rows('A{}:A{}'.format(ws.min_row,ws.max_row)):
File "venv\Excel\lib\site-packages\openpyxl\worksheet\worksheet.py", line 438, in _cells_by_row
for row in range(min_row, max_row + 1):
TypeError: 'str' object cannot be interpreted as an integer
Run Code Online (Sandbox Code Playgroud)
我还尝试将单元格范围定义为“A1:A10”,但也收到错误。有人可以建议代码有什么问题吗?
我正在构建一个Android应用,需要从后台开始活动。我正在使用ForegroundStarter来扩展Service来完成此任务。我有一个活动Adscreen.class,需要从我的前台服务中运行。活动Adscreen.class在除Android 10以外的所有Android版本上都可以正常运行(从后台开始)。
ForeGroundStarter.class
public class ForeGroundStarter extends Service {
@Nullable
@Override
public IBinder onBind(Intent intent) {
return null;
}
@Override
public void onCreate() {
super.onCreate();
Log.d("sK", "Inside Foreground");
}
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
Log.d("sK", "Inside Foreground onStartCommand");
Intent notificationIntent = new Intent(this, Adscreen.class);
PendingIntent pendingIntent =
PendingIntent.getActivity(this, 0, notificationIntent, 0);
Notification notification =
null;
//Launching Foreground Services From API 26+
notificationIntent = new Intent(this, Adscreen.class);
pendingIntent =
PendingIntent.getActivity(this, 0, notificationIntent, 0);
if (Build.VERSION.SDK_INT >= …
Run Code Online (Sandbox Code Playgroud) 我在 debian 系统中使用 gcc 编译 C 代码。通常,我会使用 gcc file.c -o file.out。但我错误地输入了 gcc file.c -o file.o 。
当,运行 ./file.o 它仍然有效!
这个.o文件是什么,和.out一样吗?