您的问题看起来是因为您的参数是没有长度的。 nvarchar
1 ,因此仅接收到错误的值。更好的数据类型将是 char(3)
,它是固定长度的,因为所有货币都有精确的三个字母的名称。
您还应该将此功能转换为表值函数,该功能可能会表现更好。
CREATE OR ALTER FUNCTION dbo.getFiatProfit (
@fiatInvested float,
@fiatInvestedCurrency char(3),
@quantity float,
@currency char(3)
)
RETURNS TABLE
AS RETURN
SELECT
result = ((@quantity * u.Value) - @fiatInvested)
/ (CASE WHEN @fiatInvestedCurrency = 'USD'
THEN 1
ELSE
(SELECT u2.Value FROM dbo.usdtPairs u2 WHERE u2.ID = 'GBP')
END)
FROM dbo.usdtPairs u
WHERE u.ID = @currency;
你这样用它
SELECT t.*, fp.*
FROM YourTable t
CROSS APPLY dbo.getFiatProfit(t.fiatInvested, t.fiatInvestedCurrency, t.Qty, 'GBP') fp;
这是你想要的吗?
# Python program to print all heading tags
import requests
from bs4 import BeautifulSoup
# scraping a wikipedia article
url_link = 'https://www.britannica.com/place/Alabama-state'
request = requests.get(url_link)
Soup = BeautifulSoup(request.text, 'lxml')
# creating a list of all common heading tags
heading_tags = ["h1", "h2", "h3"]
for tags in Soup.find_all(heading_tags):
print(tags.name + ' -> ' + tags.text.strip())
结果:
这对我来说非常有效:
const sw: ServiceWorkerGlobalScope = self as unknown as ServiceWorkerGlobalScope;
现在您将 self
替换为 sw
,哪个更有意义,而且您获得了正确的类型。
怎么样。
marginbottom :( platform.os ===“ ios”&& 10)|| (设备。包括(deviceInfo.getModel()&& 30)|| 0;
它可能不完全适合您想要的东西,但是有了一点修改,应该有可能。
在我的主机上,我必须执行 brew install openssl
,它安装openssl@3但是 brew -prefix openssl
仍然链接到openssl@1
我需要完全输入建造Python的路径3.9.13。也许有更好的方法来执行前缀链接。
LDFLAGS="-Wl,-rpath,/home/linuxbrew/.linuxbrew/opt/openssl@3/lib" \
CPPFLAGS="-I/home/linuxbrew/.linuxbrew/opt/openssl@3/include" \
CONFIGURE_OPTS="--with-openssl=/home/linuxbrew/.linuxbrew/opt/openssl@3" \
pyenv install -v 3.9.13
您基本上希望将列转换为行和将行转换为列。为此,您可以使用 和 pivot
操作员。
这为您提供了所需的输出:
WITH your_table AS
(
SELECT 'Jan-2022' AS month, 'male' AS gender, 2000 AS sales, 50 AS quantity
UNION ALL
SELECT 'Jan-2022', 'female', 3000, 100
)
SELECT
month,
metrics,
(male + female) AS overall,
male,
male / (male + female) AS male_composition,
female,
female / (male + female) AS female_composition
FROM
(
SELECT *
FROM
your_table
UNPIVOT(vals FOR metrics IN (sales, quantity))
) PIVOT(SUM(vals) FOR gender IN ('male', 'female'))
有两件事:
- 您必须初始化
首次亮相
才能将其写入JSON( get_storage < /a>); - 而且,您必须默认
首次亮相
和fin
的值在json(get_storage)阅读时;
因此,整个类 mesure
看起来像这样:
class Mesure {
late int id;
String status;
late String mode;
late String equipementNumero;
late String temperature;
late String courant;
late String debut = "";
late String fin = "";
Mesure.init(List<String> values, this.id, this.status) {
mode = values[0];
equipementNumero = values[1];
temperature = values[2];
courant = values[3];
if (mode == "display") {
debut = values[4];
fin = values[5];
}
}
Mesure.fromJson(Map<String, dynamic> json)
: id = json['id'],
status = json['status'],
mode = json['mode'],
temperature = json['temperature'],
equipementNumero = json['equipementNumero'],
courant = json['courant'],
debut = json['debut'] ?? '',
fin = json['fin'] ?? '';
Map<String, dynamic> toJson() {
if (mode == "display") {
return {
'id': id,
'status': status,
'mode': mode,
'temperature': temperature,
'equipementNumero': equipementNumero,
'courant': courant,
};
} else {
return {
'id': id,
'status': status,
'mode': mode,
'temperature': temperature,
'equipementNumero': equipementNumero,
'courant': courant,
'debut': debut,
'fin': fin,
};
}
}
}
另外,构造函数中的代码在 tojson
中看起来倒置。在构造函数中不应该像这样的 mode!=“ display”
而不是 mode ==“ display”
:
Mesure.init(List<String> values, this.id, this.status) {
mode = values[0];
equipementNumero = values[1];
temperature = values[2];
courant = values[3];
if (mode != "display") {
debut = values[4];
fin = values[5];
}
}
您可以使用 onsubmit
。在
@using (Html.BeginForm("Edit", "Post", FormMethod.Post, new
{ onsubmit="deleteImages()", enctype = "multipart/form-data" }))
第二个选项之前运行onsubmit :(使用jQuery)
$('form').submit(function() {
deleteImages();
return true;
});
从主函数上升起变量,然后使其成为RX:
var localMemberid=Rxn<String>(); // i would like to make this varial global or pass this value to other pages
void main() {
SecureStorage secureStorage = SecureStorage();
.......
SecureStorage.readLocalSecureData('memberid')
.then((value) => localMemberid.value = value);
}
然后在loginController上删除字符串? localmemberid; //
和导入 main.dart
:
localMemberid.value == null
? Get.toNamed(Routes.LOGIN)
: Get.toNamed(Routes.HOME);
我的sugention是让您使用通用界面...
void SortPeople<T>(HashSet<T> people)
where T : IPeople
{
}
public class Student : IPeople
{
public string Name { get; set; }
public int Id { get; set; }
}
public class Teacher : IPeople
{
public string Name { get; set; }
public int Id { get; set; }
}
public interface IPeople
{
string Name { get; set; }
int Id { get; set; }
}
您的 find_min
功能不好。我的意思是,如果没有比第一个元素低的元素,则不会返回任何元素。但是,即使有一个 - 根本不会考虑所有其他人 - 返回
语句也会破坏循环。
Rigth方法:
def find_min(students):
minimum = students[0]
for x in students[1:]:
if x < minimum:
minimum = x
return minimum
使用flool():
sum += Math.floor(value%2);
value = Math.floor(value/2);
我猜您的算法适用于某些打字语言,整数部门会导致整数
以下代码提供了最高销售产品的直方图(可能有多个):
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
df = pd.DataFrame(np.array([['PRODUCT_75',12 ], ['PRODUCT_75',11], ['PRODUCT_75' ,12],['PRODUCT_75',12],['PRODUCT_63',10],['PRODUCT_63',10],['PRODUCT_63',5],['PRODUCT_63',5],['PRODUCT_12',1],['PRODUCT_120',7],['PRODUCT_120',5],['PRODUCT_120',5],['PRODUCT_120',5]]),
columns=['Product','Hour'])
df['Hour']= df['Hour'].astype('int')
res = df.groupby(['Product', 'Hour']).size().reset_index()
res.rename(columns={0:'count'},inplace=True)
def histogram(df, product):
df[df['Product'] == product]['Hour'].hist()
plt.suptitle(str(product))
plt.show()
def highest_selling(res,hour):
highest_selling_product = res[res['Hour']==hour]['Product'][res['count']==res['count'].max()].to_list()
return highest_selling_product
highest_selling_product = highest_selling(res, 5)
for i in highest_selling_product:
histogram(df,i)
正常算术是基本10,因此小数代表十分之一,百分之十
。积分存储为整数mantissas和指数。 Mantissa代表着重要的数字。指数就像科学符号一样,但它使用2的碱基而不是10。例如,64.0将以1的mantissa表示,指数为6。0.125将以1的Mantissa为1,指数为-3。
浮点小数必须将负2
等负功率添加。
在处理浮点算术时,通常使用错误的delta而不是使用平等运算符。而不是
你会使用
Normal arithmetic is base-10, so decimals represent tenths, hundredths, etc. When you try to represent a floating-point number in binary base-2 arithmetic, you are dealing with halves, fourths, eighths, etc.
In the hardware, floating points are stored as integer mantissas and exponents. Mantissa represents the significant digits. Exponent is like scientific notation but it uses a base of 2 instead of 10. For example 64.0 would be represented with a mantissa of 1 and exponent of 6. 0.125 would be represented with a mantissa of 1 and an exponent of -3.
Floating point decimals have to add up negative powers of 2
and so on.
It is common to use a error delta instead of using equality operators when dealing with floating point arithmetic. Instead of
you would use
浮点数学破裂了吗?