所以在运行我的程序的过程中,我的 build.gradle 因这个错误而失败。我的意思是它实际上在一秒钟之前起作用,而不是一秒钟之后。我的gradle没有任何改变。
Could not find androidsdk.modules:shield:unspecified.
Required by:
project :app > com.facebook.android:facebook-login:5.15.2
project :app > com.facebook.android:facebook-core:5.15.2
project :app > com.facebook.android:facebook-common:5.15.2
Search in build.gradle files
Run Code Online (Sandbox Code Playgroud)
这是我的毕业证书。
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-android'
android {
compileSdkVersion 28
buildToolsVersion "29.0.2"
defaultConfig {
multiDexEnabled true
applicationId "com.example.casualdatingapp"
minSdkVersion 26
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
lintOptions {
disable "ResourceType"
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility …
Run Code Online (Sandbox Code Playgroud) 所以我习惯这样设置助手:
useHelper(sLightRef, THREE.SpotLightHelper);
return <spotLight
castShadow
ref={sLightRef}
position={[0, 2, 2]}
args={["#fff", 0.4, 10, Math.PI * 0.3]}
></spotLight>
Run Code Online (Sandbox Code Playgroud)
这将在 SpotLight 对象上创建一个助手。
我不明白的是如何在 SpotLight 的阴影相机上创建一个。(spotlight.shadow.camera) 我们无法为其分配 ref(),因为它不在我的 return 语句中。它是在 SpotLight 组件内部创建的。
在普通的 Three.js 中,这很简单:
const helper = new THREE.CameraHelper(spotlight.shadow.camera);
scene.add(helper);
Run Code Online (Sandbox Code Playgroud)
我将如何在反应三纤维中做到这一点?有什么明显的我失踪了吗?谢谢。
尝试为我的 Node.JS 应用程序设置 MongoDB。我运行这个命令:
mongo "mongodb+srv://cluster0-gjc2u.mongodb.net/test" --username <myusername>
Run Code Online (Sandbox Code Playgroud)
并且每次都得到这个回应。
MongoDB shell version v4.2.1
Enter password:
connecting to: mongodb://cluster0-shard-00-00-gjc2u.mongodb.net:27017,cluster0-shard-00-01-gjc2u.mongodb.net:27017,cluster0-shard-00-02-gjc2u.mongodb.net:27017/test?authSource=admin&compressors=disabled&gssapiServiceName=mongodb&replicaSet=Cluster0-shard-0&ssl=true
2019-12-07T12:14:39.630-0600 I NETWORK [js] Starting new replica set monitor for Cluster0-shard-0/cluster0-shard-00-00-gjc2u.mongodb.net:27017,cluster0-shard-00-01-gjc2u.mongodb.net:27017,cluster0-shard-00-02-gjc2u.mongodb.net:27017
2019-12-07T12:14:39.630-0600 I CONNPOOL [ReplicaSetMonitor-TaskExecutor] Connecting to cluster0-shard-00-00-gjc2u.mongodb.net:27017
2019-12-07T12:14:39.631-0600 I CONNPOOL [ReplicaSetMonitor-TaskExecutor] Connecting to cluster0-shard-00-01-gjc2u.mongodb.net:27017
2019-12-07T12:14:39.631-0600 I CONNPOOL [ReplicaSetMonitor-TaskExecutor] Connecting to cluster0-shard-00-02-gjc2u.mongodb.net:27017
2019-12-07T12:14:40.259-0600 I NETWORK [ReplicaSetMonitor-TaskExecutor] Confirmed replica set for Cluster0-shard-0 is Cluster0-shard-0/cluster0-shard-00-00-gjc2u.mongodb.net:27017,cluster0-shard-00-01-gjc2u.mongodb.net:27017,cluster0-shard-00-02-gjc2u.mongodb.net:27017
2019-12-07T12:14:40.799-0600 I NETWORK [js] Marking host cluster0-shard-00-00-gjc2u.mongodb.net:27017 as failed :: caused by :: Location40659: can't connect to new replica …
Run Code Online (Sandbox Code Playgroud) 因此,我希望遍历 URL 数组并打开不同的 URL 以使用 Selenium 进行网页抓取。问题是,一旦我点击第二个 browser.get(url),我就会收到“URL 超出最大重试次数”和“无法建立连接,因为目标计算机主动拒绝它”。
编辑:添加了其余的代码,尽管它只是 BeautifulSoup 的东西。
from bs4 import BeautifulSoup
import time
from selenium import webdriver
from selenium.webdriver import Chrome
from selenium.webdriver.chrome.options import Options
import json
chrome_options = Options()
chromedriver = webdriver.Chrome(executable_path='C:/Users/andre/Downloads/chromedriver_win32/chromedriver.exe', options=chrome_options)
urlArr = ['https://link1', 'https://link2', '...']
for url in urlArr:
with chromedriver as browser:
browser.get(url)
time.sleep(5)
# Click a button
chromedriver.find_elements_by_tag_name('a')[7].click()
chromedriver.execute_script("window.scrollTo(0, document.body.scrollHeight);")
time.sleep(2)
for i in range (0, 2):
chromedriver.execute_script("window.scrollTo(0, document.body.scrollHeight);")
time.sleep(5)
html = browser.page_source
page_soup = BeautifulSoup(html, 'html.parser')
boxes = …
Run Code Online (Sandbox Code Playgroud) python selenium beautifulsoup web-scraping selenium-webdriver
所以我有一个 FlatList,它提供一系列项目。当我滚动到底部时,我将更多项目附加到该数组的末尾并向用户显示。
问题是当我们添加到项目数组时,每个项目都会被渲染,有时甚至渲染两次。
这里代码被简化了。/r/reactnative 无法回答这个问题。
constructor(props) {
super(props);
this.state = {itemsTest: ['A', 'A', 'A', 'A']}
}
render() {
// Key is fine, since none of my items are changing indexes. I am just adding new items.
return (
<FlatList
keyExtractor={(item,index) => index}
scroll
data={this.state.itemsTest}
renderItem={({item, index}) => <View style={{width: windowWidth}}><Text>{item}</Text></View>
onEndReached={() => this.nextItemsTest()}
onEndReachedThreshold={0.2}
</FlatList>
)
}
nextItemsTest() {
// From suggestions below, just add an element to this array.
console.log('nextItemsTest');
const x = ['A'];
// Have worked with many …
Run Code Online (Sandbox Code Playgroud) javascript ×2
android ×1
gradle ×1
java ×1
kotlin ×1
mongodb ×1
node.js ×1
python ×1
react-native ×1
reactjs ×1
replicaset ×1
selenium ×1
three.js ×1
web-scraping ×1