我开发了一个用facebook登录的应用程序,登录过程没有问题。但是当我想注销时看不到按钮。
损坏的应用截图
工作应用截图
损坏的应用程序 gradle 文件;
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "24.0.1"
defaultConfig {
applicationId "com.ex.ex"
minSdkVersion 15
targetSdkVersion 24
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
// Glide image library
compile 'com.android.support:appcompat-v7:24.2.1'
compile 'com.android.support:design:24.2.1'
compile 'com.android.support:support-v4:24.2.1'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.google.android.gms:play-services-auth:9.2.1'
compile 'com.facebook.android:facebook-android-sdk:4.1.0'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
Run Code Online (Sandbox Code Playgroud)
问题的根源是什么?我怎样才能解决这个问题? …
android facebook android-gradle-plugin androiddesignsupport facebook-sdk-4.x
我的脚本是一个简单的单行脚本,它使用 curl 获取带有 xml 输出的 URL。我正在尝试仅输出以下标签中的文本:
<TEXT>No Hosts Queued for Purging</TEXT>
Run Code Online (Sandbox Code Playgroud)
我的脚本:
curl -u username:password -H 'X-Requested-With:QualysApiExplorer' 'https://qualysapi.qualys.com:443/api/2.0/fo/asset/host/' -d "action=purge&ips=$1&" | xmlstarlet sel -t -m '/BATCH_RETURN/RESPONSE/BATCH_LIST/BATCH/TEXT' -v "."
Run Code Online (Sandbox Code Playgroud)
不使用 xmlstarlet 时的 curl 输出如下所示:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE BATCH_RETURN SYSTEM "https://qualysapi.qualys.com/api/2.0/batch_return.dtd">
<BATCH_RETURN>
<RESPONSE>
<DATETIME>2017-04-20T20:27:15Z</DATETIME>
<BATCH_LIST>
<BATCH>
<CODE>1921</CODE>
<TEXT>No Hosts Queued for Purging</TEXT>
</BATCH>
</BATCH_LIST>
</RESPONSE>
</BATCH_RETURN>
Run Code Online (Sandbox Code Playgroud)
使用 xmlstarlet 时出现以下错误:
failed to load external entity "https://qualysapi.qualys.com/api/2.0/batch_return.dtd"
TYPE BATCH_RETURN SYSTEM "https://qualysapi.qualys.com/api/2.0/batch_return.dtd"
^
Run Code Online (Sandbox Code Playgroud) ssh: Could not resolve hostname slack-master: Name or service not known
rsync: did not see server greeting
rsync error: error starting client-server protocol (code 5) at main.c(1653) [Receiver=3.1.0]
FATAL[slack-getroles]: 'rsync --links --times -e ssh slack-master::slack/etc/roles.conf /var/cache/slack/_role_list' exited 5 at /usr/lib/slack/slack-getroles line 158.
FATAL[slack]: '/usr/lib/slack/slack-getroles' exited 5 at /usr/sbin/slack line 205.
Run Code Online (Sandbox Code Playgroud) 使用GitHub API,如何计算请求时的用户/组织总数?
用户和组织API 响应不包含last Link header。
注意:跟随next链接标题直到最后一个,对我来说不是一个解决方案,因为免费帐户的速率限制。
我可以像这样查询第一个拉取请求:
query {
repository(owner: "test_owner", name: "test_name") {
pullRequests(first: 1) {
nodes {
id
number
title
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
但是我如何根据它查询某个拉取请求呢number?
以下不起作用:
query {
repository(owner: "test_owner", name: "test_name") {
pullRequests(first: 1, number: 50) { <-- CANNOT FILTER BY `number`
nodes {
id
number
title
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
谢谢你的帮助!
嗨,我正在尝试从 Github API 获取用户的数据、他们编程的语言、他们的存储库以及他们所连接的关注者/关注者以及他们的数量。
我已经通读了文档,但没有找到任何特定于我需要的查询的内容。
目前,我已经使用这个查询来调用 https://api.github.com/search/users?q=location:uk&sort=stars&order=desc&page=1&per_page=100
但是,这会返回与我要实现的目标无关的帐户名称、网址和其他内容。我正在 Jupyter 笔记本上使用 json 和 python 请求分析这些数据。
任何人都可以分享他们的意见,谢谢。
嗨,我目前正在尝试解码从 Github API 返回的 base64 /:username/:repo/contents/:filepath
它返回一个 json 对象
{ "type": "file", "encoding": "base64", "size": 5362, "name": "README.md", "path": "README.md", "content": "encoded content ...", "sha": "3d21ec53a331a6f037a91c368710b99387d012c1", "url": "https://api.github.com/repos/octokit/octokit.rb/contents/README.md", "git_url": "https://api.github.com/repos/octokit/octokit.rb/git/blobs/3d21ec53a331a6>f037a91c368710b99387d012c1", "html_url": >"https://github.com/octokit/octokit.rb/blob/master/README.md", "download_url": >"https://raw.githubusercontent.com/octokit/octokit.rb/master/README.md", "_links": { "git": "https://api.github.com/repos/octokit/octokit.rb/git/blobs/3d21ec53a331a6f037a91c368710b99387d012c1", "self": "https://api.github.com/repos/octokit/octokit.rb/contents/README.md", "html": "https://github.com/octokit/octokit.rb/blob/master/README.md" }}
内容被编码为 base64,但是当我尝试对其进行解码时 - 它给了我随机字符
from googleapiclient import discovery
from go????!?)?wWF&6?VB6W'f6U66VB'B6W'f6T66[?Y[X[[\?X]QgTS_DISCOVERY_URL='https://sheets.googleapis.c??????)M.....
这是我的代码:
Run Code Online (Sandbox Code Playgroud)try: result = urlfetch.fetch(url, headers={"accept": >"application/vnd.github.v3+json"}) if result.status_code == 200: decoded_content = base64.b64decode(result.content) print(decoded_content) else: self.response.status_code = result.status_code
我想将 GitHub 存储库用于 Gatsby 站点中的帖子。现在我正在使用两个查询,首先是获取文件的名称:
{
viewer {
repository(name: "repository-name") {
object(expression: "master:") {
id
... on Tree {
entries {
name
}
}
}
pushedAt
}
}
}
Run Code Online (Sandbox Code Playgroud)
第二个获取文件的内容:
{
viewer {
repository(name: "repository-name") {
object(expression: "master:file.md") {
... on Blob {
text
}
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
有什么方法可以获取有关每个文件的创建时间和上次使用 GraphQL 更新的信息?现在我只能获取pushedAt整个存储库而不是单个文件。
我正在为 Gatsby 制作一个自定义源插件,它将从 GitHub 存储库获取 Markdown 文件。存储库具有单独的文件(blob)和文件夹(树),它们又包含文件。我需要将所有文件(包括文件夹内的文件)放在一个中Promise.all,但我不知道如何做到这一点。我已经设法从存储库中获取单个文件,并且有一个函数可以从树中返回文件数组。但我不知道如何将它们结合起来。
这是我的代码。GraphQL 查询以获取存储库、树和文件信息:
const repositoryQuery = `
{
viewer {
repository(name: "repository-name") {
object(expression: "master:") {
... on Tree {
entries {
name
oid
type
}
}
}
}
}
}
`
const treeQuery = `
query getTree($id: GitObjectID!) {
viewer {
repository(name: "repository-name") {
object(oid: $id) {
... on Tree {
entries {
name
oid
type
}
}
}
}
}
}
`
const fileQuery = `
query getFile($id: GitObjectID!) { …Run Code Online (Sandbox Code Playgroud) 我正在Android 10 上使用此文档参考addNetworkSuggestions自动连接到现有 Wifi 接入点。
我正在使用以下代码:
\nval wifiManager = context.getSystemService(Context.WIFI_SERVICE) as WifiManager;\n\nval status = wifiManager.addNetworkSuggestions(suggestionsList);\nif (status != WifiManager.STATUS_NETWORK_SUGGESTIONS_SUCCESS) {\n\xc2\xa0\xc2\xa0\xc2\xa0\xc2\xa0// do error handling here\n}\n\n// Optional (Wait for post connection broadcast to one of your suggestions)val intentFilter = IntentFilter(WifiManager.NETWORK_STATE_CHANGED_ACTION);\n\nval broadcastReceiver = object : BroadcastReceiver() {\n\xc2\xa0\xc2\xa0\xc2\xa0\xc2\xa0override fun onReceive(context: Context, intent: Intent) {\n\xc2\xa0\xc2\xa0\xc2\xa0\xc2\xa0\xc2\xa0\xc2\xa0\xc2\xa0\xc2\xa0if (!intent.action.equals(WifiManager.NETWORK_STATE_CHANGED_ACTION)) {\n\xc2\xa0\xc2\xa0\xc2\xa0\xc2\xa0\xc2\xa0\xc2\xa0\xc2\xa0\xc2\xa0\xc2\xa0\xc2\xa0\xc2\xa0\xc2\xa0return;\n }\n // do post connect processing here\n }\n};\ncontext.registerReceiver(broadcastReceiver, intentFilter);\nRun Code Online (Sandbox Code Playgroud)\n我使用的是 Android 10 设备,并且收到一条通知,邀请用户允许或不允许该权限:
\n\n根据文档,这是 Android 10 上的正确行为:
\n\n在 Android …
android android-wifi kotlin android-permissions android-10.0
github-api ×6
github ×5
graphql ×3
android ×2
python ×2
android-10.0 ×1
android-wifi ×1
api ×1
facebook ×1
gatsby ×1
javascript ×1
kotlin ×1
linux ×1
web2py ×1
xml ×1
xmlstarlet ×1