我正在使用 Tailwind (react/next) 并努力改变我的滚动条的外观。
这是一个单页应用程序,我一直在尝试创建自定义 CSS 以应用于索引文件中的第一个 div,如下所示:
<div className="no-scroll"> <<<<<<<--------- Adding custom css here
<Head>
<title>Oscar Ekstrand</title>
<link rel="icon" href="/images/favicon.ico" />
</Head>
<main className="flex flex-col no-scroll">
<section ref={heroref}>
<Hero scrollToContacts={scrollToContacts} />
</section>
<section ref={offeringref}>
<Offering />
</section>
<section ref={processref}>
<WhatIDo />
</section>
<section ref={biographyref}>
<CvBar />
</section>
<section ref={skillsetref}>
<Skillset />
</section>
</main>
<section ref={contactsref}>
<Footer />
</section>
</div>
Run Code Online (Sandbox Code Playgroud)
我可以使用自定义 CSS 类来处理按钮等内容,既具有“插件方法”又具有全局样式表。(https://play.tailwindcss.com/zQftpiBCmf)
但我不明白如何改变滚动条的外观。
有人有主意吗?
我使用 npm 工作区和 Typescript 项目引用创建了一个项目,与此示例存储库非常相似:https://github.com/Quramy/npm-ts-workspaces-example。
\n此设置将所有 node_modules 保留在 中root-directory/node_modules,并在文件夹中创建到包的符号链接root-directory/node_modules,以便可以从另一个包直接引用它们。
对于开发来说,这工作得很好,但我陷入了部署。如果所有节点模块都位于根目录中,我将如何部署单个工作区?dist 文件夹不包含节点模块,npm i会安装所有依赖项并创建所有符号链接。
结构如下:
\n\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 node_modules/\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 package-lock.json\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 package.json\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 packages\n\xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 package-1\n\xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 dist\n\xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 helper.d.ts\n\xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 helper.js\n\xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 helper.js.map\n\xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 main.d.ts\n\xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 main.js\n\xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 main.js.map\n\xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 package.json\n\xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 src\n\xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 helper.ts\n\xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 main.ts\n\xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 tsconfig.json\n\xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 package-2\n\xe2\x94\x82\xc2\xa0\xc2\xa0 …Run Code Online (Sandbox Code Playgroud) 我已将 React 版本升级到 18,并从 BrowserRouter 组件中收到一些类型错误,尝试了不同的方法,但无法识别问题所在。
下面是我调试代码时的错误,
Overload 1 of 2, '(props: BrowserRouterProps | Readonly<BrowserRouterProps>): BrowserRouter', gave the following error.
Type '{ children: Element; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes<BrowserRouter> & Readonly<BrowserRouterProps>'.
Overload 2 of 2, '(props: BrowserRouterProps, context: any): BrowserRouter', gave the following error.
Type '{ children: Element; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes<BrowserRouter> & Readonly<BrowserRouterProps>'.
Run Code Online (Sandbox Code Playgroud)
如果能伸出援助之手,我将不胜感激。
typescript reactjs react-router react-router-dom react-typescript
我在 Next.js 应用程序中实现了Tiny Slider,它需要页面上的内联脚本来控制滑块的行为。现在,虽然脚本在我第一次启动 index.js 时正确加载,但是每当我使用 Link 导航到另一个页面并返回到 index.js 时,脚本都不会加载。
这是我在 index.js 中编写脚本的方式
{/* Script */}
<Script id='tester'>
{`
var slider = tns({
container: '.my-slider',
items: 6,
autoplay: true,
autoplayTimeout: 2000,
gutter: 20,
autoplayButtonOutput: false,
controls: false,
navPosition: 'bottom',
nav: false,
mouseDrag: true,
arrowKeys: true,
responsive: {
300: {
items: 2,
gutter: 50,
center: true,
fixedWidth: 250,
},
700: {
items: 3,
gutter: 50,
center: true,
fixedWidth: 250,
},
1440: {
items: 3,
gutter: 50,
fixedWidth: 250,
center: …Run Code Online (Sandbox Code Playgroud) 我想从股票市场检测多种类型的旗帜模式,我想识别的第一个是牛市旗帜模式。我尝试过一些公式,但他们都没有抓住要点,给了我很多没有图案的股票名称。以我最近的方式
获取数据的代码如下
from pprint import print
from nsepy import get_history
from datetime import date
from datetime import datetime, timedelta
import matplotlib
from nsetools import Nse
nse = Nse()
old_date=date.today()-timedelta(days=30)
for stock in nse.get_stock_codes():
print("Stock",stock)
stock_data = get_history(symbol=stock,
start=date(old_date.year,old_date.month,old_date.day),
end=date(datetime.now().year,datetime.now().month,datetime.now().day)))
Run Code Online (Sandbox Code Playgroud)
任何帮助都会有用的。提前致谢。
我如何使用material-ui的TreeView,其中所有数据都在单一真实来源的javascript数据结构中,并在修改数据时避免对未更改的子树部分进行重新渲染(对输入使用身份检查)(添加/删除/重命名节点、更改选择、更改打开/关闭状态等)?https://material-ui.com/components/tree-view/上没有这样的示例,并且使用“丰富对象”示例来表示大型宽树(约 1000 个元素,例如在完整二叉树中),在我的计算机上重新渲染所有内容大约需要一秒钟。
通过手动执行或使用不可变数据结构库,输入树可以在修改时重用先前渲染的子树。例如,给定以下树,
A
/ \
B C
/ \ \
D E F
Run Code Online (Sandbox Code Playgroud)
如果您想向 F 添加子 X,那么您将为 X、F、C 和 A 创建新节点,但可以保留 B、D 和 E 节点。
对于大型宽树,我们如何利用这一点来获得可接受的性能(我想说<50ms,理想情况下只有几毫秒)?
我有一个带有带有广角镜头的固定相机和移动物体的系统。当物体匀速移动时,我以 10 毫米间隔和 2064x40 像素拍摄图像。此外,我在没有匀速的情况下拍摄了 2048x40 的图像。我想缝合这些捕获的图像。
\n首先我参考链接尝试了OpenCV的拼接方法。但是,我收到错误代码 1,并且我了解到两个图像之间没有足够的重叠区域来缝合。
\n之后,我想我可以尝试连接恒速物体的图像。我使用了下面的代码,并将 13 px 作为移位参数。
\nimport numpy as np\nimport cv2\nimport os\n\nfrom Stitching.Blending import UVSSBlendingConcate\nfrom Stitching.DistortionCorrection import load_coefficients\n\n\ndef load_images_from_folder(folder):\n print("\\nImages are reading from folder: " + folder)\n images = []\n for filename in os.listdir(folder):\n img = cv2.imread((folder + "/" + filename))\n if img is not None:\n images.append(img)\n return images\n\n\ndef unDistortImages(images):\n mtx, dist = load_coefficients(\'calibration_chessboard.yml\')\n for i in range(len(images)):\n images[i] = cv2.undistort(images[i], mtx, dist, None, None)\n return …Run Code Online (Sandbox Code Playgroud) python opencv image-processing computer-vision image-stitching
我有一个训练有素的 SVR 模型,需要以JSON格式保存,而不是腌制。
JSON 化训练模型背后的想法是简单地捕获权重和其他“拟合”属性的状态。然后,我可以稍后设置这些属性来进行预测。这是我所做的一个实现:
# assume SVR has been trained
regressor = SVR()
regressor.fit(x_train, y_train)
# saving the regressor params in a JSON file for later retrieval
with open(f'saved_regressor_params.json', 'w', encoding='utf-8') as outfile:
json.dump(regressor.get_params(), outfile)
# finding the fitted attributes of SVR()
# if an attribute is trailed by '_', it's a fitted attribute
attrs = [i for i in dir(regressor) if i.endswith('_') and not i.endswith('__')]
remove_list = ['coef_', '_repr_html_', '_repr_mimebundle_'] # unnecessary attributes
for attr in remove_list: …Run Code Online (Sandbox Code Playgroud) 我试图在表单提交上调用一个突变,用于登录用户,我试图调用的函数是这样的:
export const login = async (email : string , password : string) => {
const response = await axios.post(`${BASE_URL}/users/login` , {"user":{email:email, password:password}});
return response.data;
}
Run Code Online (Sandbox Code Playgroud)
我正在尝试使用以下代码调用它:
const { mutate, isLoading , error} = useMutation(variables => login(variables.email , variables.password))
Run Code Online (Sandbox Code Playgroud)
我提交的表单如下所示:
onSubmit={(values) => {
console.log(values);
mutate({email : values.email , password:values.password});
}}
Run Code Online (Sandbox Code Playgroud)
但我这样做时遇到多个错误,正确的方法是什么?
错误是:类型“void”上不存在属性“email”。
类型“void”上不存在属性“password”。
类型为 '{ email: string; 的参数 密码:字符串;}' 不可分配给“void”类型的参数。
我无法在 XCode 中显示/获取“XCode 项目(项目 > 签名和功能 >“+ 功能”按钮)并选择“位置更新”功能。
它在链接中
https://pub.dev/packages/geolocator
在 iOS 上,您需要将以下条目添加到您的 Info.plist 文件(位于 ios/Runner 下)才能访问设备的位置。只需打开 Info.plist 文件并添加以下内容(确保更新说明,使其在您的应用程序上下文中有意义):
<key>NSLocationWhenInUseUsageDescription</key>
<string>This app needs access to location when open.</string>
<key>NSLocationAlwaysUsageDescription</key>
<string>This app needs access to location when in the background.</string>
Run Code Online (Sandbox Code Playgroud)
如果您希望在应用程序处于后台时接收更新,您还需要将后台模式功能添加到您的 XCode 项目(项目 > 签名和功能 >“+ 功能”按钮)并选择位置更新。请小心这一点,在将您的应用程序提交到AppStore时,您需要向Apple详细解释为什么您的应用程序需要这个。如果 Apple 对解释不满意,您的应用程序将被拒绝。
使用 requestTemporaryFullAccuracy({ PurposeKey: "YourPurposeKey"}) 方法时,应将字典添加到 Info.plist 文件中。
<key>NSLocationTemporaryUsageDescriptionDictionary</key>
<dict>
<key>YourPurposeKey</key>
<string>The example App requires temporary access to the device's precise location.</string>
</dict>
Run Code Online (Sandbox Code Playgroud)
第二个键(在此示例中称为 YourPurposeKey)应与 requestTemporaryFullAccuracy() 方法中传递的 PurposeKey 匹配。可以为应用程序中的不同功能定义多个键。更多信息可以在 Apple 的文档中找到。
注意:第一次请求临时完全准确访问时,可能需要几秒钟的时间才会显示弹出窗口。这是因为 iOS …
reactjs ×5
typescript ×3
javascript ×2
next.js ×2
python ×2
calendar ×1
css ×1
dart ×1
dayjs ×1
expo ×1
flutter ×1
formik ×1
location ×1
material-ui ×1
monorepo ×1
node.js ×1
npm ×1
opencv ×1
performance ×1
react-native ×1
react-query ×1
react-router ×1
scikit-learn ×1
stock ×1
svm ×1
tailwind-css ×1
treeview ×1
workspace ×1
xcode ×1