“2020年11月”存档文章有17

Angular subscribe loading

最近在使用Angular rxjs的时候,获取数据的时候,页面显示增加加载,代码如下:article.component.html<div class="page-loading" *ngIf="isLoading$ | async"> <mat-spinner></mat-spinner></div><table *ngIf="!(isLoading$ | async)" mat-tabl...

IPy将IP地址转换成整数

IPy是一个处理IPv4和IPv6地址和网络的类和工具。项目地址:github - python-ipy利用IPy包如何将IP地址转换成整数或者是int类型的数据呢?下面是代码示例:from IPy import IP, IPint ip_range_start = IPint('1.2.3.4').int()参考资料:1、IPy-IPv4和IPv6地址处理模块学习笔记黄兵个人博客原创。转载...

Python自增运算

在其他语言中自增运算时这样写的:i++在Python中自增运算是怎么写的呢?写法如下:number += 1参考资料:1、Python integer incrementing with ++ [duplicate]

Angular 提交 按钮加载,button 加载mat-spinner动画

最近在使用Angular,每当修改内容提交的时候,禁止用户再次点击,这个时候需要将按钮变成disabled状态。具体实现效果如下:具体代码如下:css样式:@keyframes spinner { to {transform: rotate(360deg);}}.spinner:before { content: ''; box-sizing: border-box; position: ...

mat-table 如何设置Index

最近在使用Angular Material的mat-table的时候,需要设置表格的编号。具体代码如下:表头设置:displayedColumns: string[] = ['index'];之后设置index列:<ng-container matColumnDef="index"> <th mat-header-cell *matHeaderCellDef> No.</th> <td...

SQLAlchemy BigInteger与BIGINT区别

BigInteger定义:class BigInteger(Integer): """A type for bigger ``int`` integers. Typically generates a ``BIGINT`` in DDL, and otherwise acts like a normal :class:`.Integer` on the Pyt...

(1062, "Duplicate entry '2147483647' for key 'PRIMARY'")

最近在使用MySQL数据库的时候,出现了如下错误:(1062, "Duplicate entry '2147483647' for key 'PRIMARY'")需要说明的是,这里使用的主键是int类型的,自增。可以看下表,每个类型的范围:出现问题的原因:可以看到int类型最大正是2147483647,超出了范围所以提示这个错误。解决方案:修改主键数据类型:ALTER TABLE ‘table_n...

mat-table 刷新数据源

最近在使用Angular Material的时候,使用mat-table修改表格,数据不同步更新。delete($event, id, root, section, child): void { const dialogRef = this.dialog.open(MenuDialogComponent, { width: '20vw', data: {id, r...