这里很有趣。显然,15.625
是通过将其解释为[H]:MM:SS的。 375 /24 = 15.625 < / code>。因此,要返回
375:00:00
,您只能做15.625 * 24&amp; “:00:00”。当您将其分配给单元格时,Excel将其解释为一个值,而不是 string (但请参见下面...)。但是,这里有些奇怪。你说:
查看公式时,我可以看到该值是 14.01.1900 15:00:00 。
这很奇怪。显然,它应该解决 15 .01.1900等。我认为您可能已经制作了错字,但显然不是。我已经进行了一些测试:
Sub test()
For Each cell In Range("A1:A4")
'Range("A1") = 375:00:00 custom formatting automatically applied: "[h]:mm:ss"
'Range("A2") = 375:00:00 custom formatting manually adjusted: "mm/dd/yyyy h:mm:ss AM/PM"
'Range("A3") = "=VALUE(""375:00:00"")", defaults to general formatting: 15.625
'Range("A4") = "=VALUE(""10000:00:00"")" from 10000 this produces #VALUE! errors (or "Error 2015")
Debug.Print cell.Value
Debug.Print cell.Value2
Debug.Print cell.Text
Debug.Print "---"
Next cell
'''Immediate Window output
' 15.625
' 15.625
' 375:00:00
' ---
' 1/14/1900 3:00:00 PM
' 15.625
' 01/15/1900 3:00:00 PM
' ---
' 15.625
' 15.625
' 15.625
' ---
' Error 2015
' Error 2015
' #VALUE!
' ---
'''
End Sub
因此,这里有两个非常奇怪的事情:
cell.value
forrange(“ A2”)
作为1/14/1900 3:00:00 pm
(在提到的问题中重现怪异),即使.text
也将正确产生01/15/1900 3:00:00 pm < /代码>。
- Excel停止理解
10000:00:00
的“逻辑”。比较以下内容:
Sub insert_convert()
Range("A6") = 10000 / 24 * 24 & ":00:00" 'expected 416.6666667, but now a String: "10000:00:00"
Range("A7") = 9999 / 24 * 24 & ":00:00" '416.625 (and "2/19/1901 3:00:00 PM" in formula bar)
End Sub
我看不出为什么会出现这些奇怪之处。对我来说似乎是虫子。
编辑:我猜问题2可能与以下事实有关:在评估= value(“ 10000:00:00”)
时,Excel试图将字符串解释为a date
< /a>,然后是错误,因为:
[日期h] Olds IEEE 64位(8字节)值,代表日期为从0001的1月1日到年度12月31日 9999 ... ...
您必须使用flag -lpthread
或-pthread
编译(通常建议使用pthread
)。如果您使用的是Clion,则需要编辑cmakelists.txt,以确保通过使用命令设置编译器标志来确保与此标志编译您的代码:
SET( CMAKE_CXX_FLAGS "<other compiler flags> -pthread")
您可以在
您没有获得位置许可,因为在您的Initstate内部,您称之为一些异步事件。 Flutter Lifecycle告诉我们,尽管Initstate首先运行,但是任何异步事件都需要时间进行。这就是为什么即使您在Initstate中的功能首先称为,但由于它们是异步的,因此小部件构建方法是首先触发的,因此它覆盖了您的位置权限弹出。
为了解决这个问题,您可以将另一个未来构建器包裹在当前的未来建筑商中。第一个FutureBuilder应该具有位置权限任务,第二个FutureBuilder应具有i列任务。
如果您只想要帐户界图标,那么您可以像&lt; greenbox&gt;&lt; acccountcircle /&gt; {Notification}&lt;/greenbox&gt;
,或者如果您想要不同的通知图标,则可以做类似的事情。
export default function ControlledSwitches() {
const UserIcon = styled(AccountCircle)({
margin: "0px 0px 0px 0px"
});
const dummyNotification = [
{ text: "Notification #1", icon: <UserIcon /> },
{ text: "Notification #2", icon: <UserIcon /> },
{ text: "Notification #3", icon: <UserIcon /> }
];
const cardComponents =
dummyNotification !== undefined
? dummyNotification.map((notification) => (
<div key={notification}>
<div>
<GreenBox>
{notification.icon} {notification.text}
</GreenBox>
</div>
</div>
))
: "Loading...";
return (
<>
<NavBar />
<Row>
<RightCol>
<div>{cardComponents}</div>
</RightCol>
</Row>
</>
);
}
当然,您要去:
init
Col_data = pd.Series([
625814.205486,
782267.756857,
938721.308229])
C_PV_data = pd.Series([
2039032.206909,
2548790.258636,
3058548.310363])
C_elec_data = pd.Series([
1337523.743009,
1671904.678761,
2006285.614513])
作为df
df = pd.concat(
[Col_data, C_PV_data, C_elec_data], axis=1,
keys=['Col_data', 'C_PV_data', 'C_elec_data'])
>>> df
Col_data C_PV_data C_elec_data
0 625814.205486 2.039032e+06 1.337524e+06
1 782267.756857 2.548790e+06 1.671905e+06
2 938721.308229 3.058548e+06 2.006286e+06
旁注:我总是不喜欢重复。以下替代方案是干燥的(不要重复自己),但也许不清楚:
keys = ['Col_data', 'C_PV_data', 'C_elec_data']
d = locals() # just for DRY...
df = pd.concat([d[k] for k in keys], axis=1, keys=keys)
假设
您已经安装了openpyxl
已安装:
df.to_excel('foo.xlsx', index=False)
box plot
edit :(并保存保存作为PNG)
ax = df.loc[[0,1,1,1,2]].plot.box()
ax.figure.savefig('costs.png')
按照建议的答案,我最终使用了以下方式:
INSERT INTO vb_postmeta(
SELECT
NULL,
post_id,
'csco_post_video_url',
CONCAT('https://www.youtube.com/watch?v=', meta_value)
FROM
vb_postmeta
WHERE
meta_key = 'bpxl_videourl'
)
您可以用scrollbartheme包装并设置Crossaxismargin:
const ScrollbarTheme(
data: ScrollbarThemeData(crossAxisMargin: 10),
child: Scrollbar(
thickness: 10,
trackVisibility: true,
thumbVisibility: true,
child: TextField(),
),
);
另外,您可以使用RAWSCROLLBAR并设置Crossaxismargin:
const RawScrollbar(
thickness: 10,
trackVisibility: true,
thumbVisibility: true,
crossAxisMargin: 5,
child: TextField(),
);
data WANT;
set HAVE;
by ID;
first_visit = first.ID;
retain firstDate;
if first.ID then firstDate = Date;
days = Date - firstDate;
drop firstDate;
run;
我正在使用Web-Server-Bundle
启动我的服务器(php bin/Console Server:run
)。
当我尝试使用其他命令来启动本地服务器(php -s localhost:8000 -t public/
)时,第404页工作。
我们需要在此处谈论消息处理保证。
如果我们追求精确的处理语义和消息传递顺序,则必须使用隔离配置消费者。Level=“ read_comments”,并且必须使用retries = integer.max_value,enable.idempotence.idempotence = true和max进行配置。 in.flight.requests.per.connection =每默认值1。
另外,设置max.in.flight.requests.per.connection = 1,即使发生回收,也将以发送的顺序写给经纪人。
您可以创建自己的日志功能并将其用于在屏幕上打印
func Log(args ...interface{}) {
fmt.Fprintln(os.Stdout, args...)
}
您还可以根据通过标志传递的条件
var p = flag.Bool("p", false, "Enable Local Logging")
func MyLog(args ...interface{}) {
if *p {
fmt.Fprintln(os.Stdout, args...)
}
}
示例
package main
import (
"fmt"
"testing"
"os"
"flag"
)
var p = flag.Bool("p", false, "Enable Local Logging")
func Log(args ...interface{}) {
if *p {
fmt.Fprintln(os.Stdout, args...)
}
}
func IntMin(a, b int) int {
if a < b {
return a
}
return b
}
func TestIntMinBasic(t *testing.T) {
ans := IntMin(2, -2)
if ans != -2 {
t.Errorf("IntMin(2, -2) = %d; want -2", ans)
}
}
func TestIntMinTableDriven(t *testing.T) {
var tests = []struct {
a, b int
want int
}{
{0, 1, 0},
{1, 0, 0},
{2, -2, -2},
{0, -1, -1},
{-1, 0, -1},
}
Log("Print to Screen")
for _, tt := range tests {
testname := fmt.Sprintf("%d,%d", tt.a, tt.b)
t.Run(testname, func(t *testing.T) {
ans := IntMin(tt.a, tt.b)
if ans != tt.want {
t.Errorf("got %d, want %d", ans, tt.want)
}
})
}
}
func BenchmarkIntMin(b *testing.B) {
for i := 0; i < b.N; i++ {
IntMin(1, 2)
}
}
并通过标志来打印日志,并且可以使用 -args
-args
将命令行的其余部分(-args之后)传递到测试二进制,未解释和不变。因为此标志消耗了命令行的其余部分,所以包装列表(如果存在)必须出现在此标志之前。
CMD示例:
go test -args -p
通常使用这些(err,结果)=&gt; {...}
回调,您检查err
first ,因为如果是真实,第二个参数很有可能不会定义。
您还应返回
在检测到错误以防止其余回调执行后。
fyi, node-postgresl node-postgresl 在本地支持承诺,因此无需明确创建一个。在下面,我将您的代码转换为异步函数,以利用这一点。
const getUserById = async (id) => {
const { rows } = await db.query({
text: "SELECT id, first_name as firstName, email, phone FROM users WHERE id = $1",
values: [id],
});
// `rows` is always an array so check the length
if (rows.length !== 1) {
throw new Error(`Could not find user by id [${id}]`);
}
return rows[0];
};
sqrt&lt; x,n&gt;
instantiatessqrt&lt; x+1,n&gt;
and instantiatessqrt&lt; x+2,n&gt;
等永不停止。即使仅采用一个分支机,也通过编译器评估两个分支。编译器还不够聪明,无法看到该条件在某个时候是错误的,然后
sqrt&lt; value+1,n&gt;
不需要实例化。您必须更加解释。 (实际上更正确:编译器确实需要知道的两侧:
以确定其常见类型,因为这就是条件运算符类型的类型)。由于C ++ 17,您可以使用
constexpr,如果
丢弃false-branch:在C ++ 17之前,您可以将模板专业化作为递归的停止条件:
但是,当<时,两者都会失败。代码> n 不是平方数。您应该将条件更改为
value*value&gt; = n
以确保递归始终停止(并在addionionally中检查n == value*value*value
)。此外,我建议交换参数的顺序,以便您可以将默认的
1
用于value
。另外,enum
东西看起来有些过时。我不记得要克服什么限制。无论如何,您可以简单地使用static const val = ...
。sqrt<X,N>
instantiatessqrt<X+1,N>
and that instantiatessqrt<X+2,N>
etc. it never stops.Both branches are evaluated by the compiler, even if only one of them is taken. The compiler is not clever enough to see that the condition is false at some point and then
sqrt<value+1,N>
does not need to be instantiated. You have to tell it more explictly. (Actually more correct: The compiler does need to know both sides of the:
to determine their common type, because thats what the conditional operators type is).Since C++17 you can use
constexpr if
to get the false-branch discarded:Before C++17 you could use template specialization as the stop condition for the recursion:
However, both will fail when
N
is not a square number. You should change the condition tovalue*value >= N
to make sure the recursion always stops (and addtionally check ifN == value*value
).Further I suggest to swap the order of the arguments so you can use a default
1
forvalue
. Also theenum
thingy looks a little outdated. I don't remember what restriction is was meant to overcome. Anyhow, you can simply use astatic const val = ...
instead.此模板元图有什么问题找到平方根?