摘要: 定义资源接口: 1 public interface Resource { 2 void accept(Visitor visitor); 3 } 定义visitor,支持2种类型,reader类资源和writer资源,访问writer资源需要额外一个line参数: 1 public interfa 阅读全文
posted @ 2020-09-25 15:43 Joynic 阅读(165) 评论(0) 推荐(0) 编辑
摘要: 1 #include <stdio.h> 2 3 void bubble_sort(int arr[], int len); 4 5 void main() { 6 int arr[] = {5, 5, 6, 9, 10, 1, 0, 3, 2}; 7 8 int total_size = size 阅读全文
posted @ 2020-09-23 21:25 Joynic 阅读(173) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> void main() { int year; int month; int day; printf("calculate Weekday of input date!\n"); printf("year:"); scanf("%d", &year); prin 阅读全文
posted @ 2020-09-23 20:12 Joynic 阅读(119) 评论(0) 推荐(0) 编辑
摘要: 使用Java 8 consumer替代传统Java builder模式代码 阅读全文
posted @ 2020-07-01 18:34 Joynic 阅读(367) 评论(0) 推荐(0) 编辑
摘要: 执行: git config --system core.longpaths true 阅读全文
posted @ 2020-04-30 11:26 Joynic 阅读(587) 评论(0) 推荐(0) 编辑
摘要: - 什么是“配置选项等级”呢? 举个例子,PHP设置报错级别(来源PHP官网示例:https://www.php.net/manual/zh/function.error-reporting.php): 1 <?php 2 3 // 关闭所有PHP错误报告 4 error_reporting(0); 阅读全文
posted @ 2019-10-15 17:43 Joynic 阅读(384) 评论(0) 推荐(0) 编辑
摘要: 最近想用Python写一个简单生成器,类似指定类型和范围,返回指定列表; 比如想要 0 ~ 3 的整数,则 我只需要指定: 最小:0, 最大:3, 步长:1 则返回一个 [0,1,2,3] 的列表 思路是用Python 装饰器,在def方法上打装饰器,装饰器内部替换方法调用时传入的参数值 代码如下: 阅读全文
posted @ 2019-07-29 21:23 Joynic 阅读(1054) 评论(0) 推荐(0) 编辑
摘要: Thrift,oneway 阅读全文
posted @ 2019-06-06 16:28 Joynic 阅读(1901) 评论(0) 推荐(0) 编辑
摘要: log4j.rootLogger=INFO,commonLogger,log4j.appender.commonLogger=org.apache.log4j.ConsoleAppenderlog4j.appender.commonLogger.target=System.outlog4j.appe 阅读全文
posted @ 2019-05-07 22:22 Joynic 阅读(736) 评论(0) 推荐(0) 编辑
摘要: TimeZone.setDefault(TimeZone.getTimeZone("GMT+8")); 阅读全文
posted @ 2019-04-17 19:24 Joynic 阅读(1859) 评论(0) 推荐(0) 编辑