library(tidyverse)
library(lubridate)
一些其他数据清洁
d %>%
janitor::clean_names() %>%
as_tibble() %>%
select(ind, cancer_date, everything()) %>%
mutate(across(2:6, ~ as.Date(.x))) %>%
gather(-c(ind, cancer_date), key = "inclusion_id", value = "inclusion_date") %>%
drop_na() %>%
mutate(diff = interval(cancer_date, inclusion_date) %>%
as.numeric('years'))
计算癌症日期和纳入日期之间的
# A tibble: 5 x 5
ind cancer_date inclusion_id inclusion_date diff
<dbl> <date> <chr> <date> <dbl>
1 1 2004-11-01 inclusion_date0 2014-11-01 10.0
2 2 2000-08-02 inclusion_date2 2016-01-18 15.5
3 3 2011-01-14 inclusion_date2 2016-01-18 5.01
4 5 2009-01-02 inclusion_dat4 2018-12-11 9.94
5 4 2016-03-16 inclusion_date6 2020-07-11 4.32
时间差,以年度过滤给出
d %>%
filter(diff <= 10)
# A tibble: 4 x 5
ind cancer_date inclusion_id inclusion_date diff
<dbl> <date> <chr> <date> <dbl>
1 1 2004-11-01 inclusion_date0 2014-11-01 10.0
2 3 2011-01-14 inclusion_date2 2016-01-18 5.01
3 5 2009-01-02 inclusion_dat4 2018-12-11 9.94
4 4 2016-03-16 inclusion_date6 2020-07-11 4.32
如果您正在使用 jayway jsonpath 您可以使用过滤器操作员 in
$..[?('loks3123' in @.plans[*].plan.planId)].skuId
在这里尝试: https://jsonpath.herokuapp.com/
如果您正在使用 newtonsoft.json
$..[?(@.plans[*].plan.planId == 'loks3123')].skuId
Simple
You need it when you call a templated function from inside a templated class:
#include <iostream>
#include <string>
struct printable {
std::string mystr = "Hello World";
template <typename T>
auto print() {
if constexpr (std::same_as<T, std::string>) {
std::cout << mystr << std::endl;
}
}
};
template <typename Printable>
struct entity {
auto print(Printable& myprintable) {
myprintable.template print<std::string>();
}
};
int main() {
entity<printable> e;
printable p;
e.print(p);
}
Will output
Hello World
from the templated print()
function在可打印
中。
useEffect(()=>{
const email = user?.user?.email;
const currentUser = {email:email};
console.log(currentUser,'hfghfh')
if(email){
fetch(`http://localhost:5000/user/${currentUser.email}`,{
method: 'PUT',
headers: {
'content-type': 'application/json'
},
body:JSON.stringify(currentUser)
})
.then(res=>res.json())
.then(data=>{
console.log(data);
const accessToken = data.token;
localStorage.setItem('accessToken',accessToken);
setToken(accessToken);
})
}
},[user])
在我的前端代码中,我犯了一个错误。我正在通过并对准透彻的电子邮件,但没有提取电子邮件值。传递currentuser.email fetch( http:// localhost:5000/user/$ {currentuser.email}
我正在通过Currentuser
。
如果您始终期望如图所示,请完全格式化三个冲刺,则可以使用以下查询获得所有行的总和,而该行名为“ Tigers”,该行中最高的Sprint值正好为11。
=QUERY({A2:A,B2:B,ARRAYFORMULA(INT(SPLIT(REGEXREPLACE(C2:C,"[a-zA-Z ]",""),";")))},"select sum(Col2) where Col1='Tigers' and (Col3>=11 or Col4>=11 or Col5>=11) and not (Col3>=12 or Col4>=12 or Col5>=12) label sum(Col2) ''")
如果您期望这样冲刺的数量可能会更改(例如,一个具有“ Sprint 2; Sprint 3; Sprint 3; Sprint 11; Sprint 12”的单元格中的单元格,则此公式将起作用。
=QUERY({FILTER(A2:A,NOT(ISBLANK(C2:C))),FILTER(B2:B,NOT(ISBLANK(C2:C))),QUERY(TRANSPOSE(QUERY(TRANSPOSE(ARRAYFORMULA(IF(ISBLANK(C2:C),,INT(SPLIT(REGEXREPLACE(C2:C,"[a-zA-Z ]",""),";"))))),"select "®EXREPLACE(JOIN("",ARRAYFORMULA(IF(LEN(C2:C),"max(Col"&ROW(C2:C)-ROW(C2)+1&"), ",""))),"..\z",""))),"select Col2")},"select sum(Col2) where Col1='Tigers' and Col3=11 label sum(Col2) ''")
以下评论的批处理文件可以用于此任务:
@echo off
setlocal EnableExtensions DisableDelayedExpansion
set "DataFile=\\server\share\MyDataFile.txt"
set "VersionInfo="
rem The command line below for getting the version information works even for Windows XP.
for /F "tokens=2 delims=[]" %%G in ('ver') do for /F "tokens=2" %%H in ("%%G") do set "VersionInfo=%%H"
rem Do nothing if the command line above fails which is very unlikely.
if not defined VersionInfo goto EndBatch
rem Do not change the data file on containing already a line with
rem the name of this computer and identical version data. Date
rem and time are not updated in this case which should not matter.
if exist "%DataFile%" %SystemRoot%\System32\findstr.exe /I /R /X /C:"%COMPUTERNAME%;.*;%VersionInfo%" "%DataFile%" >nul && goto EndBatch
rem Get current date/time in the format yyyy-MM-dd;HH:mm:ss independent
rem on which country/region is configured for the current user account.
for /F "tokens=1-6 delims=/: " %%G in ('%SystemRoot%\System32\robocopy.exe "%SystemDrive%\|" . /NJH') do set "DateTime=%%I-%%H-%%G;%%J:%%K:%%L" & goto CheckFile
:CheckFile
rem Create the data file if not existing at all with the data of current computer.
if not exist "%DataFile%" goto AppendData
rem Create a copy of the data file in temporary files directory of the
rem current user with omitting the line of the current computer. Then
rem move the filtered data file back to original storage location. If
rem that process fails because of the data file is opened currently by
rem another process which denies read and/or write access on the data file,
rem then exit processing of the batch file without updating the data file.
rem There will be one more chance in the near future to update the data file.
(
%SystemRoot%\System32\findstr.exe /B /I /L /V /C:"%COMPUTERNAME%;" "%DataFile%" >"%TEMP%\%~n0.tmp" 2>nul
if not exist "%TEMP%\%~n0.tmp" goto EndBatch
if exist "%TEMP%\%~n0.tmp" move /Y "%TEMP%\%~n0.tmp" "%DataFile%" >nul 2>nul
if exist "%TEMP%\%~n0.tmp" del "%TEMP%\%~n0.tmp" & goto EndBatch
) 2>nul
:AppendData
rem Append the data of current computer to the data file and next sort the
rem data file to have the lines sorted by computer names in the data file.
setlocal EnableDelayedExpansion
(echo !COMPUTERNAME!;!DateTime!;!VersionInfo!>>"%DataFile%") 2>nul
endlocal
%SystemRoot%\System32\sort.exe "%DataFile%" /O "%DataFile%" 2>nul
:EndBatch
endlocal
注1:批处理文件可以同时由多台计算机运行,这仅导致一个批处理文件可以读取/写入访问数据文件而其他文件未能读/写数据文件。上面的批处理文件将其考虑在内,但没有100%失败。最好是在C或C ++中编码Windows控制台应用程序,该应用程序处理共享的文件访问拒绝,以等待短时文件被保护以读取和/或写入更长的时间。
注2:计算机名称可以包含一个半隆,如果将计算机名称写入数据文件,则需要将计算机名称包含在中,如果数据文件应为CSV 也应有效。
对于此特殊用例 href =“ https://stackoverflow.com/a/60126994/3074564”>时间在午夜之后不正确地设置以说明命令行以以特定格式获得当前日期/时间以确保所有人都确保所有 时间数据始终以国际日期/时间格式写入数据文件。
日期/ 打开命令键入的方法in-windows-10/“ rel =“ nofollow noreferrer”>命令提示符窗口,执行以下命令,并读取每个命令的显示的帮助页,完全和小心。
-
call/?
...说明%〜n0
...参数0,即无文件扩展名的批处理文件名,没有路径 del/?
-
echo /?< /code>
-
endlocal /?< /code>
-
findstr /?
- < /code> < /code> for /?
- < /code >
goto /?< /?代码>
- <代码>如果 /?< /code>
-
移动 /?
- < /code>
rem /?
- < /code>
robocopy /?< /code> -
set /?< /code> < /code> < /?代码>
-
setLocal/?
-
sort/?
-
ver/?
另请参见:
- 有关
- https://stackoverflow.com/a/25344009/3074564"> single line line windows batch file 带有多个命令
当您按值 s传递 std :: string
s,就像在第二个示例中一样,每次都要复制它们。这需要时间(和内存),并解释了超出限制。您也可能无法超过内存限制。当您通过参考将它们传递时,您不会制作字符串的副本。而是引用已经存在的字符串。
根据 sidstart ,是的, sizeof
( ace_header )+ size> size of
( access_mask )= 8byte。
找不到解决方案的原因是您有2个不同的接口,一个用于慢速访问,一个用于快速访问。他们可以共享相同的基础界面,这意味着它们本身可能是空的,但是两者都应该存在,因为它们解决了2个不同的问题。
此外,其中有两个允许您延长每个接口的需求,而无需触摸另一个接口。例如:您的快速接口需要返回扩展对象,最初不是预期的。您只需实施它,就完成了。 慢速接口保持不变,因为此特定功能或要求不适用于它。
另一方面,如果以后您的慢界面需要新的查询才能返回一些数据,则可以实现它,而不必担心如何在<<<<强>快速接口,仅仅是因为您没有它。
请记住:保持简单,每个类/接口的一个责任。您可以“减少”代码,共享共同零件(例如,定义基本接口),但是应该始终清楚您要解决哪些问题而不混合职责。
这个很棘手!
我知道Plotly没有任何内置的事情可以简单地做到这一点。我试图使用形状绘制此框进行锻炼,但这是行不通的,因为它将传奇放在顶部(因此大多数盒子都被隐藏了)。我显然比情节更固执。
此答案需要软件包 htmlwidgets
。我没有更改您的情节将其分配给对象。我为此答案命名了您的情节对象 pl
。
onRender
函数的内容:
or = ("function(el){
costLeg = document.querySelectorAll('g.traces')[2]; /* third legend entry */
cChW = costLeg.firstChild.getBoundingClientRect().width; /* text only */
cR = costLeg.lastChild.getBoundingClientRect(); /*g trace space*/
cR2 = costLeg.lastChild.outerHTML.split('\" ');
cy = cR2[3].split('\"')[1]; /* the y without padding*/
cDf = cR.width - cChW - 14; /*legend width - text width - padding*/
costLC = costLeg.lastChild.cloneNode(true); /* copy the current rect element */
costLC.removeAttribute('pointer-events'); /* remove the pointer events */
costLeg.removeAttribute('class'); /*stop refresh from changing it*/
costLC.setAttribute('x', 3); /* calc values + or minus padding */
costLC.setAttribute('y', (cR.height - 6)/2 * -1); /* measure from center */
costLC.setAttribute('width', cDf);
costLC.setAttribute('height', cR.height - 6);
costLC.setAttribute('style',
'fill: rgb(0, 0, 0); fill-opacity: 0; stroke-width: 2px; stroke: black;');
costLeg.insertBefore(costLC, costLeg.lastChild);
}")
调用图块,然后添加 onRender
函数绘制框。
pL %>% htmlwidgets::onRender(or)
顺便说一句,这也应该随您的情节扩展。
您只需要在操作中添加 [来自Body]
并使用第一个Ajax,这是一个演示:
Action
[HttpPost]
public IActionResult CreateProduct([FromBody]ProductViewModel productViewModel)
{
return RedirectToAction("Index");
}
Ajax:
function post() {
/* var url = $("#CreateProductForm").attr("action");*/
var data = $("#CreateProductForm").serialize();
var FoodsIDVal = [];
$("select[name='FoodsID']").each(function () {
var values = $(this).val();
FoodsIDVal.push(values);
});
var ViewModel = {
"MST":data,
"FoodsID":FoodsIDVal
};
console.log(ViewModel);
$.ajax({
type: "POST",
url: "CreateProduct",
data: JSON.stringify(ViewModel),
dataType: "json",
contentType: 'application/json; charset=utf-8',
success: function (response) {
},
error: function () {
}
});
}
如果您仍然无法获得FoodSid,请尝试检查 foodsidval
foodsidval < /代码>在Ajax中。
第113行是
声明变量的,
这意味着 - 当您在循环中处理数据时,其长度超过了32672个字符的长度。
该怎么办?改用 clob ,或检查是否真的有很多数据(即光标返回的行比您预期的更多 - 检查其
select
语句)。Line 113 is
That variable is declared as
which means that - as you're processing data in a loop - its length exceeds 32672 characters in length.
What to do? Use CLOB instead, or check whether there's really that much data (i.e. maybe cursor returned more rows than you'd expect - check its
SELECT
statement).varchar2的替代?