在您的视频标签中使用预加载属性并将其设置为无。
<video controls preload="none" poster="video-poster.jpg">
<source src="video-name.webm" type="video/webm">
<source src="video-name.mp4" type="video/mp4">
</video>
从熊猫v1.4.0开始,附加
被弃用 concat
( source )。另外,您必须将返回值分配给 final_df
才能查看更改。 附加
和 concat
不要为您更新数据帧。
import pandas as pd
def my_fun(var):
temp={"File_Exist":'no',"desc":var,"Bucket":'bucket',"name":'fadsf',"size":'','last_modified':'',"generation":''}
temp_df=pd.DataFrame(temp,columns=list(temp.keys()), index=['x'])
return temp_df
final_df = pd.DataFrame()
final_df = pd.concat([final_df, my_fun('my 1st file')],ignore_index = True)
final_df = pd.concat([final_df, my_fun('my 2nd file')],ignore_index = True)
print(final_df)
请参阅此处: /a>。异步函数将无法从ES2017打开回调参数。看看您正在使用的ES版本。
解决方法是使工人的功能不是“异步”,而是基于“异步”。如果有人知道如何在不转换承诺的情况下修复它,那么将不胜感激。
// async bases
async function worker(opts, callback) { // callback will be undefined}
const q = async.queue(worker)
//promised based
function worker(opts, callback) { // callback will work as expected}
const q = async.queue(worker)
无论我们在哪里接受节点式异步函数,我们也直接接受ES2017异步函数。在这种情况下,异步函数将不会传递最终回调参数,并且任何抛出的错误都将用作隐式回调的错误参数,并且返回值将用作结果值。 (即拒绝退回的承诺成为错误回调参数,而解决的值成为结果。)
请使用 kubectl
运行您的两个应用程序
kubectl apply -f Partner1-MyApp.yaml --namespace ingress-basic
kubectl apply -f Partner2-MyApp.yaml --namespace ingress-basic
,以设置以在YAML文件中进行路由,如果两个应用程序都在Kubernetes群集中运行以在每个应用程序 exterm_ip/static 中路由流量。路由服务,创建一个文件名添加此 yaml代码在下面
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: partner-ingress-static
annotations:
nginx.ingress.kubernetes.io/ssl-redirect: "false"
nginx.ingress.kubernetes.io/rewrite-target: /static/$2
spec:
ingressClassName: nginx
rules:
- http:
paths:
- path: /static(/|$)(.*)
pathType: Prefix
backend:
service:
name: partner1-myapp
port:
number: 6669
azure/aks/indress-basic?tabs = azure-powershell“ rel =“ nofollow noreferrer”>在azure kubernetes服务(AKS)中创建一个入口控制器
没有捕获异常不确定的行为?
不,明确的定义是,这将导致呼叫 std :: terminate
(没有UB),尽管在呼叫之前是否在呼叫之前解开了堆栈,如 [except.thexext.ternation] :
在某些情况下,
/1的例外处理被放弃,以减少细微
错误处理技术。
- [...]
- 当异常处理机构找不到抛出的处理程序时
/2在这种情况下,函数
std :: terminate
被调用。在
找不到匹配处理程序的情况,是
实施定义了堆栈是否在
std :: terminate
被调用。 [...]不允许实现基于确定未列的过程最终会导致函数呼叫std ::终止
您将道具定义如下:
const props = defineProps<{
title: IntArgumentListData;
content: IntArgumentListData;
}>();
这意味着您可以创建两个道具,一种称为 title
,具有 intargumentListData
的类型 IntargumentListData
。
在您的类型定义 intargumentListData
您已经定义了 title
和 content
,
所以您想做的是类似的事情:
const props = defineProps<{
tabsData: IntArgumentListData[];
}>();
在组件中,您只需要循环 TABSDATA
。
注意:当使用DefineProps时,Props将在模板中可用,而无需使用props.tabsdata;尽管在脚本设置中,您需要使用props.tabsdata 访问它,
<TabPanel v-for="tab in tabsData" :key="tab.title" :header="tab.title">
然后将其在父母中使用时将其暴露在组件上。
在那里,您必须将数据绑定到组件调用的道具。
<ArgumentTabComponent :tab-data="tabsData" />
有用的文档链接:
您可以提供错误的英文翻译吗?
应该导致这样的事情:
<script setup lang="ts">
//import { reactive, ref, computed } from "vue";
import ArgumentTabComponent from "./components/ArgumentTabComponent.vue";
import $t from "@/core/utils/i18n/translate";
import Button from "primevue/button";
import type { IntArgumentListData } from "./types/IntArgumentListData";
const tabsData: IntArgumentListData[] = [
{
title: "Argumento 1",
content: "texto1",
},
{
title: "Argumento 2",
content: "texto2",
},
{
title: "Argumento 3",
content: "texto3",
},
{
title: "Argumento 4",
content: "texto4",
},
{
title: "Argumento 5",
content: "texto5",
},
];
const handleRedirect = () => {
alert("Aceptando!");
};
</script>
<template>
<br />
<h1>Argumentarios</h1>
<div class="">
<ArgumentTabComponent :tabs-data="tabsData" />
<hr />
<Button :label="$t('common.accept')" @click="handleRedirect" />
</div>
</template>
孩子:
<script setup lang="ts">
import TabView from "primevue/tabview.vue";
import TabPanel from "primevue/tabpanel.vue";
// Lib imports
//import { ref } from "vue";
import type { IntArgumentListData } from "../types/IntArgumentListData";
// Properties
const props = defineProps<{
tabsData: IntArgumentListData[];
}>();
</script>
<template>
<br />
<div class="">
<TabView>
<TabPanel v-for="tab in tabsData" :key="tab.title" :header="tab.title">
<p>{{ tab.content }}</p>
</TabPanel>
</TabView>
</div>
<br />
</template>
有几种方法可以实现:
- 您可以在 projects 组件中移动 prosecon 路由,例如:
const Projects = () => {
...other logic
return(
<Routes>
<Route path="/individual_project" element={<IndividualProject />} />
</Routes>
)
}
docs: https://reactrouter.com/docs/docs/en/en/v6/getting-started/overview-started/overview#nested-routes
- 另外,您还可以创建一个上下文来包装路由。然后,您可以直接从上下文中检索变量:
<Context.Provider value={yourValuesToShare}>
<Routes>
<Route path="/" element={<Login navigate={navigate} setOverlays={setOverlays} setToken={setToken} setUser={setUser} />} />
<Route path="/create-account" element={<CreateAccount />} />
<Route path="/projects" element={<Projects token={token} name={user.name} jobTitle={user.jobTitle} navigate={navigate} setOverlays={setOverlays} />} />
<Route path="/individual_project" element={<IndividualProject />} />
</Routes>
</Context.Provider>
您可以使用 cleaned_data
保存表单。
尝试以下视图:
views.py
def account(request):
profile_instance = profile.objects.get(user=request.user)
form = accountForm(instance=profile_instance)
if request.method == "POST":
form = accountForm(request.POST, instance=profile_instance)
if form.is_valid():
user = request.user
bio = request.POST.get('bio')
profile_img = request.POST.get('profile_img')
location = request.POST.get('location')
profile.objects.create(
user=user, bio=bio, profile_img=profile_img, location=location)
return redirect("sign_in")
else:
form = accountForm()
return render(request, "home/account.html", {'form': form})
确保您已登录,并且配置文件
模型不包含两个相同的用户用于上述代码的工作,因为您已将其 foreferkey
。
注意:
模型是用pascalcase
而不是Smallcase
编写的,因此,如果您将其命名为配置文件而不是
配置文件 。表单也是如此,如果您编写accountform
或更多更好的profileform
而不是。。。 >accode> accodeform
尝试以下代码,在其中创建个人配置文件。
Models.py
class profile(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE)
# other fields are same...
在实际情况下,最好将用户
a onetoonefield
模型,因为一个人只能拥有一个配置文件,我以为您是第一次创建用户的个人资料,而不是更新现有的配置文件,所以我不会使用
实例
在表单中。
views.py
def account(request):
if request.method == "POST":
form = accountForm(request.POST)
if form.is_valid():
username = request.POST.get('username')
password = request.POST.get('password1')
bio = request.POST.get('bio')
profile_img = request.POST.get('profile_img')
location = request.POST.get('location')
created_user = User.objects.create(
username=username, password=password)
profile.objects.create(
user=created_user, bio=bio, profile_img=profile_img, location=location)
return redirect('sign_in')
else:
form = accountForm()
return render(request, "home/account.html", {'form': form})
forms.py
class accountForm(ModelForm):
username = forms.CharField(
widget=forms.TextInput(attrs={'class': 'form-control'}))
password1 = forms.CharField(
widget=forms.PasswordInput(attrs={'class': 'form-control'}))
password2 = forms.CharField(
widget=forms.PasswordInput(attrs={'class': 'form-control'}))
def clean(self):
cleaned_data = super().clean()
p1 = cleaned_data.get('password1')
p2 = cleaned_data.get('password2')
if p1 != p2:
raise forms.ValidationError('Both the passwords must match')
class Meta:
model = profile
fields = ['username', 'password1',
'password2', 'profile_img', 'bio', 'location']
widgets = {
# 'fields': forms.TextInput(attrs={'class': "form-control"}),
'profile_img': forms.FileInput(attrs={'class': 'form-control', 'id': 'inputGroupFile04'}),
'bio': forms.Textarea(attrs={'class': 'form-control'}),
'location': forms.TextInput(attrs={'class': 'form-control', 'placeholder': 'Location'}),
}
它将直接创建新用户的配置文件,并使用密码验证,这些用户也与 user
模型有关,因此您将不会在中获得
字段用户的错误配置文件模型必须是用户实例
。
这是一种使用更新带有聚合管道功能的更新操作的方法(需要MongoDB v4.2或更高)。变量 new_events
表示作为文档数组输入的新数据(例如, [{“ eventname”:“ fote”,“ pote”,“ protorid”,“ actorId”:“ 5”,“详细信息”: “ up”},{...},...]
)。
db.collection.updateMany(
{ }, // query filter
[
{
$set: {
events: {
$reduce: {
input: NEW_EVENTS,
initialValue: "$events",
in: {
$cond: {
if: {
$eq: [
{ $size: {
$filter: {
input: "$events",
as: "ev",
cond: {
$and: [
{ $eq: [ "$this.eventName", "$ev.eventName" ] },
{ $eq: [ "$this.actorId", "$ev.actorId" ] }
]
}
}
}}, 0
]
},
then: { $concatArrays: [ "$value", [ "$this" ] ] },
else: "$value"
}
}
}
}
}
}
])
所以。服务器端GTM正是它所说的。它在服务器上执行。它听取网络请求。它没有任何接触前端发生的事情。前端没有任何线索,即服务器端GTM。好吧,除非有明确调用其端点,否则您可以在需要时与后端镜子代理。
您所经历的是Adblockers阻止您的前端GTM容器。尽管理论上可以跟踪您所需的一切,包括使用服务器端GTM的前端事件,但它被认为是使用GTMS和流前端事件通过前端GTM进行后端GTM的最佳实践。
当然,这会让您依赖Adblockers,因为它们会阻止您的前端GTM。避免这种情况的一种方法是...好吧,不要使用前端GTM,并且在没有阻止的标签管理器中实现了所有跟踪所有前端跟踪并将其发送到后端GTM进行正确处理和分发。
通常,没有TMS实施跟踪太贵了,因为现在您确实必须了解JS,因此只有很酷的孩子才能负担得起这样做。一个很好的例子是亚马逊。
基本上,没有TMS的实施跟踪的费用约为两到五倍(取决于细节),但是Adblockers通常只降低了约10%的流量。 10%对于报告,衡量Funnels的有效性以及什么不是至关重要。无论如何,分析都没有报告所有至关重要的数据。后端是关键数据的真正来源。
您可以将 new_timestamp
绑定到现有对象中,然后返回整个对象:
const notifications = [
{
_id: "12934193c51a231b0165425a",
userid: '62921df1c14a2eea0efa9399',
timestamp: 1653817696599,
},
{
_id: "11934193c51a231b0165425a",
userid: '62921df1c14a2eea0efa9399',
timestamp: 1653817696600,
}
];
const newNotifications = notifications.map((element) => {
element['new_timestamp'] = new Date(element.timestamp).toString()
return element;
});
console.log(newNotifications);
要在给定位置(0&lt; = loc&lt; =列数)中插入一个新列,只需使用dataframe.insert:
DataFrame.insert(loc, column, value)
因此,如果要添加列
e = [-0.335485, -1.166658, -0.385571]
DataFrame.insert(loc=len(df.columns), column='e', value=e)
value 可以是一个系列,一个整数(在这种情况下,所有单元格都被此值填充),或类似数组的结构
*
是一个元字符,需要逃脱成为常规角色:VIM将其称为“魔术”:如果模式为“魔术”,则需要逃脱元观念,如果它是“ nomagic”,您没有(这有点过分简化,请参见
:help Magic
)。因此,您可以用
\ m
甚至“非常名义”将VIM强制将模式视为“ nomagic”,并使用\ v
:它无济于事,此处,但是……
关于为什么
/**
突出显示了整个缓冲区,可以在下找到提示:help/star/star
:*
匹配缓冲区中的星星,*
匹配零或以上原子的零或更多原子,因此,本质上是每个字符。*
is a meta-character that needs to be escaped to become a regular character:Vim refers to this as "magic": if the pattern is "magic", you need to escape meta-characters, if it is "nomagic", you don't (this is a bit over-simplified, see
:help magic
).Therefore, you can force Vim to treat the pattern as "nomagic" with
\M
or even "very nomagic", with\V
:Which doesn't help much, here, but well…
As for why
/**
highlights the whole buffer, a hint can be found under:help /star
:*
matches (at least some of) the stars in your buffer,*
matches zero or more of the preceding atom, as many as possible, so, essentially, every character.如何使用vim中的文件中搜索字符串`**`的所有出现?