我有一个Angular PWA.它的服务工作者一直在完美地工作,直到我从Angular 5.0升级到7.2
升级后,我在/ ngsw/state中看到以下错误
驱动程序状态:SAFE_MODE(由于错误而导致初始化失败:违反Invariant(初始化):最新散列null没有已知的清单初始化/ <@https:// {{domain}} .com/ngsw-worker.js:2227:27已完成@https:// {{domain}} .com/ngsw-worker.js:1772:52)最新清单哈希:无最后更新检查:从不
应用背景
用于检查更新的代码
/ngsw/state
到目前为止我的研究和故障排除步骤
在Chrome中


在Microsoft边缘
我的想法和期望
我打算在我的一个项目中创建一个书架.基本要求如下:
UICollectionView是我遇到的第一个选项.它可以轻松支持网格单元.所以我用Google搜索并发现了一些非常有用的教程:
Bryan Hansen的UICollectionView自定义布局教程
Mark Pospesel的如何将装饰视图添加到UICollectionView
LXReorderableCollectionViewFlowLayout
结果如下:(请忽略颜色不一致问题,因为我选择的图形尚不完美.)

我做了什么:
但是我遇到了一些问题:
如果项目可以在一个屏幕上显示,我根本无法滚动
然后我添加了以下代码,以使contentize更大
- (CGSize)collectionViewContentSize
{
return CGSizeMake(self.collectionView.bounds.size.width, self.collectionView.bounds.size.height+100);
}
Run Code Online (Sandbox Code Playgroud)
然后我就可以滚动了.在这里,我拉下第一行:

您可以看到徽标的装饰视图正常工作.
但是当我拉出最后一排时,我遇到了第二组问题:

您可以看到绿色框部分未添加装饰视图.
当我重新订购商品时,书架栏有时会移动

我在这里列出了一些重要的代码:
- (void)prepareLayout
{
// call super so flow layout can do all the math for cells, headers, and footers
[super prepareLayout];
NSMutableDictionary *dictionary = [NSMutableDictionary dictionary];
NSMutableDictionary *shelfLayoutInfo = [NSMutableDictionary dictionary];
// decoration view - emblem
NSIndexPath *indexPath = [NSIndexPath indexPathForItem:0 inSection:0]; …Run Code Online (Sandbox Code Playgroud) 我正在使用:
错误消息是
org.openqa.selenium包可以从多个模块访问:client.combined,net.bytebuddy"
我正在关注 Spring Batch 的教程,当我编写以下代码时 - IntelliJ 抱怨作业函数中的 tasklet(null) 调用被直接调用:
Method annotated with @Bean is called directly. Use dependency injection instead.
Run Code Online (Sandbox Code Playgroud)
如果我从作业中删除 @Bean 注释,错误就会消失 - 但我想知道发生了什么。我怎样才能在那里注入豆子?简单地写tasklet(Tasklet tasklet(null))会产生同样的错误。
@Bean
@StepScope
public Tasklet tasklet(@Value("#{jobParameters['name']}") String name) {
return ((contribution, chunkContext) -> {
System.out.println(String.format("This is %s", name));
return RepeatStatus.FINISHED;
});
}
@Bean
public Job job() {
return jobBuilderFactory.get("job")
.start(stepBuilderFactory.get("step1")
.tasklet(tasklet(null)) // tasklet(null) = problem
.build())
.build();
}
Run Code Online (Sandbox Code Playgroud)
自闭症谱系障碍
我使用以下代码制作了一个简单的直方图:
a = ['a', 'a', 'a', 'a', 'b', 'b', 'c', 'c', 'c', 'd', 'e', 'e', 'e', 'e', 'e']
pd.Series(a).value_counts().plot('bar')
Run Code Online (Sandbox Code Playgroud)
虽然这是绘制频率直方图的简洁方法,但我不确定如何自定义绘图,即:
我正在尝试在 Visual Studio 代码(ubuntu 18.04)上调试 fortran 文件。
我安装了以下扩展
我的launch.json文件如下
"version": "0.0.1",
"configurations": [
{
"name": "Fortran Launch (GDB)",
"type": "cppdbg",
"request": "launch",
"targetArchitecture": "x86",
"program": "${workspaceRoot}/./a.out",
"miDebuggerPath": "gdb",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceRoot}",
"externalConsole": true,
"preLaunchTask": "gfortran"
}
]
Run Code Online (Sandbox Code Playgroud)
因为我使用的是 linux,所以我不需要给出 gfortran 的路径。我还尝试通过更改.exe为 linux 扩展来稍微更改 launch.json 。我已经在问题中更新了它。但是调试器仍然没有运行并在控制台中给出以下错误
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other …Run Code Online (Sandbox Code Playgroud) 我试图了解在 Java Spring Boot 中定义模型时@Indexed和的两个不同注释有何不同。@Field
public class Notation {
@Id
private String id;
@Field("value")
private String value;
@Field("description")
private String description;
@Field("frequency")
private int frequency;
}
Run Code Online (Sandbox Code Playgroud)
public class Notation {
@Id
private String id;
@Indexed("value")
private String value;
@Indexed("description")
private String description;
@Field("frequency")
private int frequency;
}
Run Code Online (Sandbox Code Playgroud)
我的用例是最终基于 和value字段从存储库中实现搜索description,因此最好了解两者中数据的结构以及可以从这些注释中使用的各种选项。
我在我的存储库上执行了以下操作,现在所有文件都已被此类语句替换(我已将第二行中的值替换为 *s):
version https://git-lfs.github.com/spec/v1
oid sha256:8*****************************************93
size 1003203
Run Code Online (Sandbox Code Playgroud)
lfs 命令运行:
git lfs install
git lfs track "*.xyz"
git lfs migrate import
Run Code Online (Sandbox Code Playgroud)
现在,包括 xyz 文件在内的所有文件都无法读取。我怎样才能撤消这些?
我愿与参数的一类系统:sysname,temp,N
并创建一个子类Molecule,它使用继承从System获取参数.
class System() :
def __init__(self,sysname,temp,N):
self.sysname=sysname
self.temp=temp
self.syslist=[]
self.N=N
class Molecule(System) :
def __init__(self,name,position,mass,radius):
self.name=name
self.position=position
self.mass=mass
self.radius=radius
self.epsilon=1
self.sigma=1
self.syslist.append(self)
Run Code Online (Sandbox Code Playgroud)
我可以将System的一个实例作为
System1=System("system1",100,10)
System2=System("system2",120,10)
Run Code Online (Sandbox Code Playgroud)
现在在定义分子时,我该如何定义它属于哪个系统?
另外,请告诉我的班级定义是否有其他问题