Github不提供此功能。存储库可以包含任意数量的分支和拉请请求。
如果您使用的是GitHub Enterprise Server,则可以使用预先接收的挂钩进行此操作,但是这些挂钩在GitHub.com上不可用。
实际上,您实际上想做一些事情,而不是限制分支机构的数量和拉出请求,这是实现其他目标的一种方式。如果您问一个有关如何实现该目标的新问题,则可能会为可能的问题提供解决方案。
您可以通过 ID
列和 diff
day
列中的 conter 列
df['DAY'] = pd.to_datetime(df['DAY'], dayfirst=True)
from datetime import timedelta
m = timedelta(days=30)
out = df.groupby('ID').apply(lambda group: group[~group['DAY'].diff().abs().le(m)]).reset_index(drop=True)
print(out)
ID DAY
0 1 2020-03-22
1 2 2020-05-10
2 2 2020-01-13
3 3 2020-03-30
4 3 2021-02-24
转换为原始日期格式,您可以使用 dt .Strftime
out['DAY'] = out['DAY'].dt.strftime('%d.%m.%Y')
print(out)
ID DAY
0 1 22.03.2020
1 2 10.05.2020
2 2 13.01.2020
3 3 30.03.2020
4 3 24.02.2021
好吧,迈克(Mike)如“评论”中的评论使用16个字节IV和16、24或32个字节的密钥大小,因此不可能加密字符串或任何内容,除非您为您做了一些技巧,否则使用短IV和键示例用零的值扩展长度,直到它变为16个字节。.
您可以非常简单地将您的密码转换为iv并添加零,直到在您的情况下变为16个“ asdfghjkl ”将是在十六进制中“ 61 73 64 66 67 68 68 6B 6B 6C ”,因此您需要添加 0000000000000000 这样它将在没有任何错误的情况下工作。 。
我发现了seluce:
public function forceLogout() : void
{
$logoutEvent = new LogoutEvent($this->requestStack->getCurrentRequest(), $this->tokenStorage->getToken());
$this->eventDispatcher->dispatch($logoutEvent);
$this->tokenStorage->setToken(null);
$response = new Response();
$response->headers->clearCookie('REMEMBERME');
$response->send();
}
PL/PGSQL支持函数内部的变量,因此,如果需要,您可以使其成为一个函数,然后查询函数结果。说类似的话:
CREATE FUNCTION get_user_interaction_counts
(
date_start date,
date_end date
)
RETURNS TABLE(user_id int, like_count int, comment_count int) as $
SELECT u.id, likes.likes, comments.comments
FROM "user" u
JOIN (SELECT user_id, count(*) as likes
FROM likes l
WHERE l.created_on > date_start AND l.created_on <= date_end
GROUP BY l.user_id
) as likes ON u.id = likes.user_id
JOIN (
SELECT user_id, count(*) as comments
FROM comment c
WHERE c.created_on > date_start AND c.created_on <= date_end
GROUP BY c.user_id
) as comments ON u.id = comments.user_id
$ LANGUAGE SQL;
您会查询它:
select * from get_user_interaction_counts('2021-10-01', '2021-10-30')
当然,这可能不是您所追求的。如果“只是查询”时想要变量,它将取决于您正在使用的客户端。如果您使用的是PSQL,则它确实支持变量。其他客户可能会或可能不会支持他们,取决于他们。
您还可以做的是像这样稍微刷新查询,然后使用参数CTE,然后使用它加入选定的参数:
WITH parameters AS (
SELECT '2021-10-01'::date as date_start
, '2021-10-30'::date as date_end
)
SELECT u.id, likes.likes, comments.comments
FROM "user" u
JOIN (SELECT user_id, count(*) as likes
FROM likes l
JOIN parameters par
ON l.created_on > par.date_start AND l.created_on <= par.date_end
GROUP BY l.user_id
) as likes ON u.id = likes.user_id
JOIN (
SELECT user_id, count(*) as comments
FROM comment c
JOIN parameters par
ON c.created_on > par.date_start AND c.created_on <= par.date_end
GROUP BY c.user_id
) as comments ON u.id = comments.user_id
ps的DBFIDDLE演示。您的查询使用内部加入,因此仅包括喜欢和评论的用户。如果用户没有发表评论或不喜欢任何内容,则将被排除在外,因为不会从加入查询中返回任何记录。
问题1:
有人可以解释私人和共享扩展属性之间的区别吗?
官方文件显示如下。
ExtendedProperties.private
:属于此日历上事件副本的属性。ExtendedProperties.shared
:事件副本之间在其他与会者日历上共享的属性。
例如,当创建一个新事件,并使用 extendedProperties.private
and extendedProperties.shared
通过包括与会者,您可以看到两个值。但是,与会者只能看到 ExtendedProperties.shared
的值。
这种解释有用吗?
问题2的答案:
我想在Google脚本= .gs文件中添加 /插入带有扩展属性的新事件。< / p>
当我看到 createEvent方法的正式文档(标题,开始时间,末日,选项)
时,似乎 options
没有 ExtendedProperties 。 ref 我认为这是您问题的原因。如果要创建一个新事件,包括
extendedProperties.private
和 ExtendedProperties.shared
的值,如何使用高级Google Services的日历API?
示例脚本如下。
const calendarId = "###"; // Please set your calendar ID.
// Create a new event including extendedProperties.
const params = {
start: { dateTime: "2022-04-27T00:00:00Z" },
end: { dateTime: "2022-04-27T01:00:00Z" },
extendedProperties: {
private: { key1: "value1" },
shared: { key2: "value2" }
},
summary: "sample",
attendees: [{ email: "###" }] // Please set the email of attendee, if you want to include.
};
const res1 = Calendar.Events.insert(params, calendarId);
// Check the value of extendedProperties
const res2 = Calendar.Events.get(calendarId, res1.id);
console.log(res2.extendedProperties)
- 当此脚本由日历的所有者运行时,您可以看到
extendedProperties.private
和extendedProperties.shared
的两个值。 - 当您获得与会者的事件时,您只能看到
ExtendedProperties.shared
的值。
参考:
问题在于,您使用相同的变量 y
作为原始列表。
在原始代码块中,您不重新签名 y
,直到 list()
在列表上迭代。因此,在 lambda
中, y
是指原始列表,您可以使用 y [i]
访问这些列表元素。
但是在您将 map()
结果分配给变量的版本中地图
对象,而不是原始列表。您会得到该错误,因为 MAP
对象无法索引,而只迭代。
由于您有 Xmatch()
,您不能只切换到 filter()
吗?
例如:
=FILTER(ROW(B2:B12),B1:B11=A2)
或者,只需避免使用返回的位置,然后直接过滤您想要的任何东西。这里没有特定的字符限制可以阻止您,并且不使用 mid()
的奇怪构造,您确实确实具有完全匹配的。
可变插值根本不起作用。
但是您可以使用CSS变量:
@mixin defineVars($id) {
--#{$id}-background-color: tomato;
--#{$id}-background-image: null;
--#{$id}-background-size: null;
--#{$id}-background-position-x: null;
--#{$id}-background-position-y: null;
--#{$id}-background-repeat: null;
--#{$id}-color: null;
--#{$id}-border-radius: null;
--#{$id}-border-width: null;
--#{$id}-border-color: null;
--#{$id}-padding: null;
--#{$id}-margin: null;
}
:root {
@include defineVars('some-id');
}
body {
background-color: var(--some-id-background-color);
}
SCSS块的输出:
:root {
--some-id-background-color: tomato;
--some-id-background-image: null;
--some-id-background-size: null;
--some-id-background-position-x: null;
--some-id-background-position-y: null;
--some-id-background-repeat: null;
--some-id-color: null;
--some-id-border-radius: null;
--some-id-border-width: null;
--some-id-border-color: null;
--some-id-padding: null;
--some-id-margin: null;
}
body {
background-color: var(--some-id-background-color);
}
如果语句使用使用来设置是否提供该字段的条件。
exports.updateUser = (req, res, next) => {
try {
let image = null;
if (req.?file.?filename) {
image = `${req.protocol}://${req.get('host')}/images/${req.file.filename}`;
}
if (res.locals.userId === parseInt(req.params.id)) {
const user = [
req.body.user_lastName,
req.body.user_firstName,
image,
req.params.id
]
const sql = "UPDATE users SET user_lastName=?, user_firstName=?,user_avatar=? WHERE user_id=?";
db.query(sql, user, function(error, results) {
if (!error) {
res.status(200).json({
message: 'modification profil executé'
});
} else {
console.log(error)
res.status(401).json({
error: 'Erreur utilisateur table users'
});
}
});
} else {
res.status(401).json({
error: 'erreur d\'authentification, vous n\'avez pas les droits pour modifier ce profil'
})
}
} catch (error) {
res.status(500).json({
error
});
console.log(error)
}
}
您在正确的轨道上, grepl
是您的朋友。这样您就可以使用其中的国家,糊剂
它们一起倒在或或 |
上。
然后,使用子集
EU_p <- paste(EU, collapse='|')
subset(df, grepl(EU_p, a))
# a b
# 2 Croatia USA 2
# 4 Switzerland Hungary 4
# 5 Lithuania Indonesia 5
或使用括号所示,
df[grepl(EU_p, df$a), ]
# a b
# 2 Croatia USA 2
# 4 Switzerland Hungary 4
# 5 Lithuania Indonesia 5
结果是 df
至少包含 eu
向量的任何一行位置。
数据:
df <- structure(list(a = c("Albania Canada", "Croatia USA", "Mexico Egypt",
"Switzerland Hungary", "Lithuania Indonesia"), b = c(1, 2, 3,
4, 5)), class = "data.frame", row.names = c(NA, -5L))
原因可能是您使用的是path_provider函数“ getApplicationDocumentsDirectory()”来存储文件。通过用“ getExternalStoreDirectory()”替换上述函数,您可以将文件存储在外部目录中以显示在图库中。如果那不起作用,您也可以使用此插件:
https://pub.dev/packages/gallery_saver
使用 type
作为密钥,将数组减少到地图。使用 array.from()
将地图的值迭代器转换为数组:
const arr = [{"id":1,"name":"a","type":"foo"},{"id":2,"name":"b","type":"bar"},{"id":3,"name":"c","type":"fizz"},{"id":4,"name":"d","type":"foo"}]
const result = Array.from(arr.reduce((acc, o) => {
const type = o.type
if(!acc.has(type)) acc.set(type, { type, groups: [] })
acc.get(type).groups.push(o)
return acc
}, new Map()).values())
console.log(result)
要使TS推断分组数组的类型,请从原始数组中推断项目的类型,然后使用它设置地图的类型(TS playground):
const arr = [{"id":1,"name":"a","type":"foo"},{"id":2,"name":"b","type":"bar"},{"id":3,"name":"c","type":"fizz"},{"id":4,"name":"d","type":"foo"}]
type Item = (typeof arr)[0]
const result = Array.from(arr.reduce((acc, o) => {
const type = o.type
if(!acc.has(type)) acc.set(type, { type, groups: [] })
acc.get(type)!.groups.push(o)
return acc
}, new Map<string, { type: Item['type'], groups: Item[] }>()).values())
console.log(result)
Another option is to reduce the array to a map of groups [type, object]
,然后使用 array.from()
将映射的条目转换为所需的形式(TS playground):
const arr = [{"id":1,"name":"a","type":"foo"},{"id":2,"name":"b","type":"bar"},{"id":3,"name":"c","type":"fizz"},{"id":4,"name":"d","type":"foo"}]
const result = Array.from(
arr.reduce((acc, o) => {
const type = o.type
if(!acc.has(type)) acc.set(type, [])
acc.get(type).push(o)
return acc
}, new Map()),
([type, groups]) => ({ type, groups })
)
console.log(result)
如您所知,变量可以具有多个维度,每个维度可以具有多个值,其中每个值都与名称关联。
有2个重要性索引,第一个是与维度索引相关的索引,我们称其为DimIndex
在您的情况下,只有一个名为module_list的维度,因此,dimIndex必须等于0,
第二个是该维度的值,在您的情况下,module_list具有busman_113和busman_124和busman_124
modules.getDimensions.getDimensions.getDimensions() (0)
等于“ busman_113”和
模块.getDimensions()[DimIndex] .getIndexName(1)
将等于“ Busman_124”as you know, a variable can have multiple dimensions, and each dimension can have multiple values, where each value is associated to a name.
There are 2 indexes of importance, the first one is the one associated to the index of the dimension, let's call it dimIndex
In your case there's only 1 dimension called Module_List so, dimIndex must be equal to 0
The second one is the value of that dimension, in your case Module_List has values of Busman_113 and Busman_124
Modules.getDimensions()[dimIndex].getIndexName(0)
will be equal to "Busman_113"and
Modules.getDimensions()[dimIndex].getIndexName(1)
will be equal to "Busman_124"获取尺寸阵列的名称