dumps() 转换成json loads() 转换成dict import json dict = {'a': 'wo', 'b': 'zai', 'c': 'zhe', 'd': 'li'} string = json.dumps(dict) loads = json.loads(string) ...
分类:
编程语言 时间:
2021-07-22 17:38:51
阅读次数:
0
遍历的话若全部遍历则为N,若遍历k次,则为k class Solution: """ @param str: str: the given string @return: char: the first unique character in a given string """ def first ...
分类:
其他好文 时间:
2021-07-21 17:39:49
阅读次数:
0
需求 某分布式系统中,主节点可以有多台,可以动态上下线,任意一台客户端都能实时感知到主节点服务器的上下线。 设计 实现 public class DistributeServer { public static void main(String[] args) throws Exception { ...
分类:
其他好文 时间:
2021-07-21 17:32:52
阅读次数:
0
import com.logistics.channel.constant.BizException;import com.logistics.channel.tool.CommonErrorEnum;import com.logistics.channel.tool.ResultBody;impo ...
分类:
其他好文 时间:
2021-07-21 17:30:16
阅读次数:
0
php魔法函数 介绍 php中把以两个下划线__开头的方法称为魔法函数(Magic methods),这些方法在php中充当了举足轻重的作用。魔法函数包括: __construct(),类的构造函数 __destruct(),类的析构函数 __call(),在对象中调用一个不可访问方法时调用 __c ...
分类:
Web程序 时间:
2021-07-19 16:58:46
阅读次数:
0
新生代: 1:eden、servicorFrom 复制到ServicorTo,年龄+1首先,把Eden和ServivorFrom区域中存活的对象复制到ServicorTo区域(如果有对象的年龄以及达到了老年的标准,则赋值到老年代区),同时把这些对象的年龄+1(如果ServicorTo不够位置了就放到 ...
分类:
其他好文 时间:
2021-07-19 16:54:13
阅读次数:
0
String对象的不可变性 在实现代码中,String类被final关键字修饰了。变量char数组也被final修饰了。 类被final修饰代表该类不可被继承,char[]被final+private修饰,代表String对象不可被修改。Java实现的这个特性叫做String对象的不可变性,即Str ...
分类:
其他好文 时间:
2021-07-19 16:51:57
阅读次数:
0
一个try代码块后面跟着多个catch代码块的情况就叫多重捕获 语法 try{ //可能发生异常的代码块 }catch(ExceptionName1 e1){ // 出异常时候处理 }catch(ExceptionName2 e2){ // 出异常时候处理 } 代码中发生异常,异常被抛给第一个cat ...
分类:
编程语言 时间:
2021-07-19 16:50:39
阅读次数:
0
代码出异常常见的处理方法 try catch捕获 throws 声明异常 往外抛出 语法:throws字句放在方法参数列表的右括号之后,一个方法可以声明抛出多个异常,多个异常之间用逗号隔开。 例子 public class Main{ public static void readChar() th ...
分类:
编程语言 时间:
2021-07-19 16:50:19
阅读次数:
0
#Springboot-微服务-微服务组件之服务管理-eureka-服务的高可用-ribbon 关键要点 引入相关依赖 在restTemplate 添加@LoadBalanced//开启负载均衡注解 入门使用方式 引入依赖 <dependency> <groupId>org.springframew ...
分类:
编程语言 时间:
2021-07-19 16:38:13
阅读次数:
0