- 博客(1153)
- 问答 (3)
- 收藏
- 关注
原创 python requests 禁止重定向
r = requests.get('http://github.com', allow_redirects=False)http://www.testclass.net/requests/redirect/https://testerhome.com/topics/8518
2018-05-03 17:35:01 11071
转载 python requests获取response headers中的location
python requests获取response headers中的location 只要类似如下做即可import requestsres = requests.post(url=url, headers=headers, data=data, allow_redirects=Fal...
2018-05-03 17:34:22 35893 1
原创 Linux 中使用 kill 和 lsof 命令杀死指定端口的进程
kill -9 `lsof -t -i:port`亲测有效https://stackoverflow.com/questions/33101725/how-to-combine-lsof-i-port-and-kill-pid-in-bash
2018-05-03 15:34:12 6387
转载 shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such fi
[root@web-server php]# /etc/init.d/httpd restart shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory该错误表示 getcwd 命令无法定位到当前工作目录。...
2018-05-03 10:52:33 1452
原创 Elasticsearch 外网访问9200端口访问
系统centos6.5 可以访问127.0.0.1:9200,但不能访问 公网IP:9200 后面ip就是127.0.0.1的局域网ip,如何解决?修改配置文件 config/elasticsearch.ymlnetwork.host: 0.0.0.0...
2018-05-02 19:02:59 1913
原创 Linux 中创建用户、切换用户、赋予 root 权限的方法
参考资料:1、linux用户管理(1)—-创建用户(adduser和useradd)和删除用户(userdel) https://blog.csdn.net/beitiandijun/article/details/416782512、Linux系统中切换用户身份su与sudo的用法与实例 http://blog.51cto.com/zebralinux/13693013、Linu...
2018-05-02 19:01:09 5097
转载 Redis 中 String 类型可以容纳的最大数据长度
项目中使用redis存储,key-value方式,在Redis中字符串类型的Value最多可以容纳的数据长度是512M 官方信息: A String value can be at max 512 Megabytes in length.Redis中String类型的Value最大可以容纳数据长度https://blog.csdn.net/lu_wei_wei/articl...
2018-05-02 18:54:11 21845 5
转载 Linux find 命令的使用方法
linux查找文件命令find 每一种操作系统都是由成千上万个不同种类的文件所组成的。其中有系统本身自带的文件,用户自己的文件,还有共享文件等等。我们有时候经常忘记某份文件放在硬盘中的哪个地方。在微软的WINDOWS操作系统中要查找一份文件是相当简单的事情,只要在桌面上点击“开始”-“搜索”中就能按照各种方式在本地硬盘上,局域网络,甚至在INTERNET上查找各种文件,文档。 可是使用Li...
2018-05-02 18:52:17 469
原创 SpringBoot 项目打成 jar 包,并跳过测试的方法
SpringBoot 打成 jar 包<build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin...
2018-05-02 18:47:26 5756 1
原创 log.info()传入多个参数的方法
不知道项目里用的是啥 ** 版本的 log4j居然不能传入变长参数logger.info(String.format("%s %s %s", username, feature, "1111"));只好采用这种方式啦
2018-05-02 18:20:14 78671 3
原创 Dubbo filter 相关的参考资料
1、扩展点加载 http://dubbo.apache.org/books/dubbo-dev-book/SPI.html2、调用拦截扩展 http://dubbo.apache.org/books/dubbo-dev-book/impls/filter.html3、给dubbo接口添加白名单——dubbo Filter的使用 https://blog.csdn.net/mj1585...
2018-05-02 18:15:46 274
原创 Dubbo filter 的执行顺序与调用阶段
自己搞明白了,开始没读懂代码。Dubbo的Filter是一个调用另一个的,最后再执行业务代码。在这一行调下一个Filter,那么写在这行代码前面的代码就是在业务代码前拦截了,写在之后的代码就是执行完业务代码后拦截了。参考资料:1、请问dubbo的Filter在调用的什么阶段执行的呢? https://segmentfault.com/q/1010000006738377?_e...
2018-05-02 16:44:13 2689
原创 报错 Could not read document: Can not deserialize instance of java.lang.String ou
解决办法:1、Can not deserialize instance of java.lang.String out of START_OBJECT tokenhttps://blog.csdn.net/smileiam/article/details/499642892、Json 异常:Can not deserialize instance of xx out of START_...
2018-05-02 15:36:05 7271
原创 报错 org.apache.http.ProtocolException: Target host is not specified
org.apache.http.ProtocolException: Target host is not specified对于httpClient4.3访问指定页面,对于URL必须使用 http://开始,否则会有报错信息:org.apache.http.ProtocolException: Target host is not specified形如在下面的uriBuilde...
2018-05-02 14:59:02 11600
转载 CyclicBarrier和CountDownLatch区别
CyclicBarrier和CountDownLatch区别 这两天写多线程时,用到了CyclicBarrier,下意识的认为CyclicBarrier和CountDownLatch作用很像,就翻阅资料查了一下,说一下他们的区别吧CyclicBarrier和CountDownLatch 都...
2018-05-01 21:02:59 397
原创 Intellij IDEA 中一些很牛B 的插件
效果图:1、阿里 p3chttps://github.com/alibaba/p3c/blob/master/idea-plugin/README_cn.md2、翻译Translation,log高亮Grep Consolehttps://blog.csdn.net/zrc199021/article/details/716013943、利用grep-console...
2018-05-01 15:43:57 57888 3
原创 SpirngBoot+MyBatis+Sharding-JDBC 整合
参考资料:1、Spring boot+MyBatis+Sharding jdbc配置 https://blog.csdn.net/hpb21/article/details/533528032、Spring boot Mybatis 整合(完整版) https://blog.csdn.net/winter_chen001/article/details/772490293、基于MY...
2018-04-30 21:49:48 2046
转载 JUnit神奇的报错 java.lang.Exception:No tests found matching
谈一谈JUnit神奇的报错 java.lang.Exception:No tests found matching 最近在学习Spring+SpringMVC+MyBatis,一个人的挖掘过程确实有点艰难,尤其是有一些神奇的报错让你会很蛋疼。特别是接触一些框架还是最新版本的时候,会因为版本问题出现...
2018-04-30 21:45:13 1126 1
转载 修改 SpringBoot 运行时端口号的方法
修改Spring Boot的运行端口号 (1)方法一右击对应的方法,选择Run as à Run Confugerations…选择Arguments下的VM Arguments:-Dserver.port=8280(对应的端口号),然后直接运行 Run as Java applicati...
2018-04-30 13:36:15 3089
原创 win10 中查询占用端口进程的方法
win+R打开cmd窗口netstat -ano列出所有端口的情况,找到被占用的端口输入命令netstat -aon|findstr "8080" 找对应的PID输入命令tasklist|findstr "21548" 查找具体的占用进程1、win10端口被占用如何查看 https://blog.csdn.net/Oraclesand/article/details/...
2018-04-30 13:35:15 2665
转载 SpringBoot 警告:ApplicationContext is unlikely to start due to a @ComponentScan of the default package
* WARNING * : Your ApplicationContext is unlikely to start due to a @ComponentScan of the default package.如何解决 既然他说该类不能从组件的默认包启动,那就给他建立一个包好了。// 一般发出这个警告的原因是你把启动类直接放在的src目录下面。 // 你需要在src目录下...
2018-04-30 13:33:54 289
转载 Intellij IDEA 中新建 SpringBoot 项目的方法
IDEA上面搭建一个SpringBoot的web-mvc项目 使用IDEA创建SpringBoot项目 这几天一直在研究IDEA上面怎么搭建一个web-mvc的SpringBoot项目,看网上的教程一步步的搭建,可是还是出现一堆的问题。为了让大家以后少走一些弯路,我在...
2018-04-30 13:32:53 1628
转载 RocketMQ 可视化控制台 rocketmq-console-ng
RocketMQ最佳实践(四)可视化管理控制台rocketmq-console-ng RocketMQ有一个对其扩展的开源项目incubator-rocketmq-externals,这个项目中有一个子模块叫“rocketmq-console”,这个便是管理控制台项目了。先将incubator...
2018-04-28 14:18:40 2031
原创 RocketMQ Demo 启动报错 No route info of this topic
com.alibaba.rocketmq.client.exception.MQClientException: No route info of this topic, TopicTest1 See http://docs.aliyun.com/cn#/pub/ons/faq/exceptions&topic_not_exist for further details. ...
2018-04-28 14:16:45 2258
原创 Linux 上安装 RocketMQ 的方法
具体方法参加:Quick Start https://rocketmq.apache.org/docs/quick-start/Apache 的文档写的超级棒,我没啥可bb 的了装个 RocketMQ 居然又装了一上午….so sad 该去吃午饭了...
2018-04-28 12:07:30 739 1
原创 RocketMQ 启动 mqnamesrv 报错 Invalid initial heap size: -Xms4g 的解决办法
造成这个错误的原因是 JDK 位数将 JDK 从 32 bit 换成 64 bit 即可参考:1、阿里RocketMQ Quick Start https://blog.csdn.net/a19881029/article/details/34446629
2018-04-28 11:58:56 3885
原创 查看 Linux 系统版本位数、JDK 版本位数的方法
Linux 系统版本位数系统版本;[root@666666 apache-rocketmq]# cat /etc/issueCentOS release 6.7 (Final)Kernel \r on an \m系统位数:[root@666666 apache-rocketmq]# uname -aLinux 66666 3.10.0-514.16.1.el7.x...
2018-04-28 11:48:29 3351
原创 安装 RocketMQ 报错 Could not find artifact io.netty:netty-tcnative:jar:linux-x86_32:1.1.33.Fork22 解决办法
Could not find artifact io.netty:netty-tcnative:jar:linux-x86_32:1.1.33.Fork22 Could not resolve dependencies for project org.apache.rocketmq:rocketmq-remoting:jar:4.2.0: Could not find artifa...
2018-04-28 11:21:07 6491
原创 Java 通过反射获取字段和方法的修饰符
@Test public void getMethodType() { List<Method> methodList = Arrays.asList(UpdateInfoPushServiceItf.class.getDeclaredMethods()); methodList.forEach(method -> System.o...
2018-04-27 17:12:31 4429
原创 Java 通过反射获取父类字段的方法
public static <T> T convertJsonRequestToVo(HttpServletRequest request, Class<T> voClass) throws Exception { request.setCharacterEncoding("utf-8"); String requestBody = ...
2018-04-24 17:00:16 7265
原创 使用Redis SETNX 命令实现分布式锁
防止多台机器上的 task 在同一时间一起执行,只要执行一个就可以了import service.redis.RedisFacade;/** * Author: heatdeath * Date: 2018/4/24 * Desc: 基于 Redis 实现的简易分布式锁 */public class DistributedLockUtil { pr...
2018-04-24 15:07:52 524
原创 Java 使用正则表达式提取字符串中的时间(年月日时分秒)
public static void main(String[] args) { // String str = "2015/07/20 11:01 来源: 测试";// String str = "[INFO][2018-04-23 10:29:08 911][http-nio-6900-exec-8]"; String ...
2018-04-24 13:58:01 15508 1
原创 List 中根据 Map String,Object 的某个值排序
List<Map<String, String> resultList = new ArrayList<>(); resultList.sort((o1, o2) -> { String key1 = o1.get("time"); String key2 = o2.get("time"); ...
2018-04-24 12:09:34 2677
转载 去掉IntelliJ IDEA 中 mybatis 对应的 xml 文件警告
版权声明:本文为博主原创文章,如需转载,请写明出处, 尊重他人即尊重自己(^_^)。 http://blog.csdn.net/aubdiy/article/details/68485336IntelliJ IDEA 打开 mybatis 的 xml 文件时,对应的 xm...
2018-04-24 09:37:36 485
原创 一大坨关于 AOP 还写得蛮棒的文章
参考资料:1、Spring中的AOP(三)——基于Annotation的配置方式(一) https://my.oschina.net/itblog/blog/2107182、Spring中的AOP(四)——基于Annotation的配置方式(二) https://my.oschina.net/itblog/blog/2108073、Spring中的AOP(六)——定义切入点和切入点...
2018-04-23 20:32:45 216
原创 Java 中的线程池 ThreadPool
线程池主要有以下三种:SingleThreadExecutorFixedThreadPoolCachedThreadPoolSingleThreadExecutor只有一个线程的线程池, 核心线程数为 1, 最大线程数为 1,线程存活时间 0(反正也用不到…),阻塞队列使用的 LinkedBlockingQueue(一个 FIFO 队列)FixedThread...
2018-04-22 21:33:46 488
原创 Java 中的深拷贝与浅拷贝
clone() 是 Object 类的一个 protected 方法,如果一个类想要使用 clone() 这个方法,需要实现 Cloneable 接口,并 Override clone()(需要自己定义 clone 规则)所谓浅拷贝,就是指 Class_A 实现了 Cloneable 接口,并重写了 clone()方法,但是 Class_A 中的引用类型成员变量 ref_b 所指向的类 Cla...
2018-04-22 19:33:54 388
原创 Java String#intern
参考资料:1、浅谈Java String.intern() https://www.jianshu.com/p/0d1c003d2ff52、Java String类中的intern()方法 https://www.cnblogs.com/dreamroute/p/3650399.html3、Java技术——你真的了解String类的intern()方法吗 https://blog...
2018-04-22 12:39:11 216
原创 Java8 对应的 JMM 划分
参考资料: 1、 JVM(二)Java8内存划分 https://blog.csdn.net/yjp198713/article/details/787599332、JAVA7、JAVA8的堆内存有啥变化 https://blog.csdn.net/chlu113/article/details/518904693、Java8—底层内存结构方法区 https://blog.csdn...
2018-04-22 12:37:45 1329 1
空空如也
汇编求两个任意位数的十进制数字的差,并输出。结果总是输出10进制的补码是什么情况
2016-04-25
汇编将输入的十进制数字转换成二进制,八进制,十六进制,代码写出来了,但是却无法正常运行
2016-04-21
初学者的一点疑问,汇编语言计算两个输入数字的和并输出
2016-04-06
TA创建的收藏夹 TA关注的收藏夹
TA关注的人