根据您的问题,您的问题是Flutterfirebasemessagingservice的到来。如果您在日志中看到,已经提到
io.flutter.plugins.firebasemessaging.FlutterFirebaseMessagingService: Targeting S+ (version 31 and above)
requires that an explicit value for android:exported be defined when intent filters are present]
您只需要从Intent-Filter中删除额外的Android:导出=“ false”即可。
放在此处
<intent-filter >
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<intent-filter>
<action android:name="FLUTTER_NOTIFICATION_CLICK" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
也像更新插件一样,如果它们没有更新
- firebase_core: ^1.16.0
- firebase_messaging: ^11.3.0
使用洗牌索引
np.ndarray
对象的答案
name_list = ['Glen','John','Mark','Shane','Ricky','Steve']
partition = len(name_list) // 2
part1, part2 = np.array_split(name_list, 2)
idx = np.arange(partition)
np.random.shuffle(idx)
roll = np.arange(partition)
np.random.shuffle(roll)
for i in roll:
roll_idx = np.roll(idx, i)
print(np.vstack([part1, part2[:partition][roll_idx]]).T)
输出
[['Glen' 'Ricky']
['John' 'Shane']
['Mark' 'Steve']]
[['Glen' 'Steve']
['John' 'Ricky']
['Mark' 'Shane']]
[['Glen' 'Shane']
['John' 'Steve']
['Mark' 'Ricky']]
说明
- 将返回相应的值。
-
part2 [:partition] [idx]
可以确保其长度相等。
我解决了这个问题。我只是用'单引号'
封闭了角色的价值。我使用'
,而不是 [?]
,这是一个很好的方法,还是有人有更好的想法?
这就是我这样做的方式:
import csv
with open('StudentsMajorsList.csv', newline='') as file:
reader = csv.reader(file)
data1 = list(reader)
with open('GPAList.csv', newline='') as file:
reader = csv.reader(file)
data2 = list(reader)
merge1 = []
merge2 = []
merge3 = []
for list1 in data1:
for item in list1:
x = item.split(',')
merge1.append(x)
for list2 in data2:
for item in list2:
x = item.split(',')
merge2.append(x)
for i in range(len(merge1)):
for j in range(len(merge2)):
if(merge1[i][0] == merge2[j][0]):
merge3.append(merge1[i][0:])
merge3[i].append(merge2[j][1])
for item in merge3:
for i in item:
if (i == ''):
item.remove(i)
for item in range(len(merge3)):
print(merge3[item])
with open('FullRoster.csv', 'w') as csvfile:
csvwriter = csv.writer(csvfile)
csvwriter.writerows(merge3)
输出:
['305671', 'Jones', 'Bob', 'Electrical Engineering', '3.1']
['987621', 'Wong', 'Chen', 'Computer Science', '3.85']
['323232', 'Rubio', 'Marco', 'Computer Information Systems', '3.8']
['564321', 'Awful', 'Student', 'Computer Science', 'Y', '2.2']
['769889', 'Boy', 'Sili', 'Computer Information Systems', 'Y', '3.9']
['156421', 'McGill', 'Tom', 'Electrical Engineering', '3.4']
['999999', 'Genius', 'Real', 'Physics', '4']
我已经开始充实这一点, accountId
是可以的,因为三个组件形式形式:
// An account belongs to broker, and within a tenant (that can have multiple accounts).
public class AccountId : ValueObject
{
public string Id { get; init; }
public TenantId TenantId { get; init; }
public BrokerId BrokerId { get; init; }
public AccountId(TenantId tenantId, BrokerId brokerId, string id)
{
TenantId = tenantId;
BrokerId = brokerId;
Id = id;
}
protected override IEnumerable<object> GetEqualityComponents()
{
yield return TenantId;
yield return BrokerId;
yield return Id;
}
}
执行是价值对象,没有生命周期,因为它们不能存在于帐户之外:
public class FillDetail : ValueObject
{
public string FillId { get; init; }
// Must be unique for each and every fill.
public FillDetail(string fillId) => FillId = fillId;
protected override IEnumerable<object> GetEqualityComponents()
{
yield return FillId;
}
}
public class Execution : ValueObject
{
public FillDetail FillDetail { get; init; }
public UserId UserId { get; init; } // A user potentially could create trades in other tenants, with appropriate claims/roles.
public Contract Contract { get; init; }
public string Exchange { get; init; }
public string BrokerContractId { get; init; }
public string BucketName { get; init; }
public decimal Size { get; init; }
public double Price { get; init; } // The execution price, excluding commissions.
public DateTime Timestamp { get; init; }
public Action Action { get; init; }
public bool IsForcedLiquidation { get; init; }
public Side Side { get; init; }
public Liquidity Liquidity { get; init; }
public FillDetail? Correction { get; init; }
protected override IEnumerable<object> GetEqualityComponents()
{
yield return FillDetail;
yield return UserId;
yield return Contract;
yield return Exchange;
yield return BrokerContractId;
yield return BucketName;
yield return Size;
yield return Price;
yield return Timestamp;
yield return Action;
yield return IsForcedLiquidation;
yield return Side;
yield return Liquidity;
if (Correction != null) yield return Correction;
}
}
帐户是 ENTITY
随着时间的推移而演变,并且将具有业务逻辑以例如:
- 计算p+l当在分类帐中输入执行时,
- 请防止当前职位(从执行日志派生)开放时进行交易,或其他订单,树篱等。
此逻辑将属于帐户
:
public sealed class Account : Entity
{
public AccountId AccountId { get; init; }
readonly List<Execution> executions = new();
public void LogExecution(Execution execution)
{
// TODO: Check if this execution already exists, if so ignore it.
this.executions.Add(execution);
// This is where we would scan list of prior trades, calculate open positions, P+L etc.
}
public void PlaceOrder(Contract contract)
{
// We could have limit of no more than 10% of account balance allocated to any one position.
}
public IEnumerable<Execution> GetExecutions()
{
throw new NotImplementedException();
}
protected override IEnumerable<ValueObject> GetIdentityComponents()
{
yield return AccountId;
}
}
我认为这更可能是一个更好的模型,而我现在对大量执行日志(和管理该性能)感到担忧,但是我将保存此问题。
请随时提供自己的答案,Pointers非常感谢。
您没有正确模拟 fs.promises
。
index.js
:
const fs = require('fs').promises;
const path = require('path');
const writeData = async (data, file) => {
const directoryPath = path.join(__dirname, '../wiremock/stubs/mappings');
try {
await fs.writeFile(`${directoryPath}/${file}`, data);
return `${file} written`;
} catch (err) {
return err;
}
};
module.exports = { writeData };
index.test.js
:
const { writeData } = require('.');
jest.mock('fs', () => ({
promises: {
writeFile: jest.fn(),
},
}));
describe('Write file', () => {
it('should write a file', async () => {
const result = await writeData('test data', 'test-file');
expect(result).toEqual('test-file written');
});
});
测试结果:
PASS stackoverflow/72115160/index.test.js
Write file
✓ should write a file (3 ms)
Test Suites: 1 passed, 1 total
Tests: 1 passed, 1 total
Snapshots: 0 total
Time: 2.857 s, estimated 12 s
您正在Callapi方法中创建警报对话框。然后,当单击重试按钮时,您应该能够再次呼叫Callapi方法。
这是Callapi方法的错误回调的修改版本。让我知道这是否是您需要的。
if (error instanceof NoConnectionError | error instanceof TimeoutError) {
AlertDialog.Builder builder = new
AlertDialog.Builder(context);
builder.setMessage("some network related message");
builder.setPositiveButton("RETRY", (dialog, which) -> {
dialog.cancel();
// Make another call to callAPI with the same parameter
callAPI(context, url, REQUEST, parameters)
});
builder.setNegativeButton("CANCEL", (dialog, which) -> {
dialog.cancel();
});
builder.show();
}
df.pivot(index='time', columns='location', values='count')
location A B C D
time
2022-05-01 1 2 3 4
2022-05-02 5 6 7 8
1.Drop用户'read_account'@'%';
2.创建用户'read_account'@'%'由“密码”确定;
3.将。上的选择授予'read_account'@'%';
4.Flush特权;
您的有条件逻辑
if a[i] < 0 and a[i - 1] > 0 and a[i + 1] > 0
似乎是听起来和可读的。但是它将在边界案例中存在问题:
[1, 2, -3] -> IndexError: list index out of range
[-1, 2, 3] -> [2, 3]
正确处理它可能很简单,就像跳过您的第一个和最后一个元素一样列出了
for i in range(1, len(a) - 1)
测试
import numpy as np
def del_neg_between_pos(a):
delete_idx = []
for i in range(1, len(a) - 1):
if a[i] < 0 and a[i - 1] > 0 and a[i + 1] > 0:
delete_idx.append(i)
return np.delete(a, delete_idx)
if __name__ == "__main__":
a1 = [1, 3, 6, -2, 4, 5, 8, -3, 9, 2, -5, -7, -9, 3, 6, -7, -6, 2]
a2 = [1, 2, -3]
a3 = [-1, 2, 3]
for a in [a1, a2, a3]:
print(del_neg_between_pos(a))
输出
[ 1 3 6 4 5 8 9 2 -5 -7 -9 3 6 -7 -6 2]
[ 1 2 -3]
[-1 2 3]
SELECT G.GROUP_ID
FROM GROUP_MEMBER AS G
WHERE NOT EXISTS
(
SELECT 1 FROM GROUP_MEMBER AS X WHERE G.GROUP_ID=X.GROUP_ID AND X.ROLE='OWNER'
)
使用其他库有一些更简单的方法来实现这一目标。但是,考虑到您正在使用小型阵列,可以使用以下修改使用代码:
array2[10]
array[50]
int counter = 0;
for(int i = 0; i < 10; ++i){
for(int k = 0; k < 50; ++k){
if( array2[i] == array[k])counter++;
}
}
这应该有效。
在F串中,需要由两层表示卷发括号,因此您需要三层来满足您的要求:
>>> a = 100
>>> f'{{a}}'
'{a}'
>>> f'{{{a}}}'
'{100}'
Sagemaker项目没有硬删除。当您通过SDK或CLI删除它们时(
There's no hard delete on SageMaker Projects. When you delete them through the SDK or CLI (API reference), it updates the status of the project to 'Deleted'. You can extend the left pane to see the status, like the screenshot below.
如何删除Amzon Sagemaker Studio项目